Fix non-existent class exception on plugin activation

| Q             | A
| ------------- | -------------------------------
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #3115
| License       | MIT

Fix the non-existent class exception on plugin activation.
The cause of the error is that nonclass could be found named $class