Automattic / vip-scanner

Deprecated: Scan all sorts of themes and files and things! Use PHPCS and the VIP coding standards instead
https://automattic.com
140 stars 51 forks source link

PHP Fatal error: Using $this when not in object context in vip-scanner/class-wp-cli.php on line 97 #247

Closed flacoman91 closed 8 years ago

flacoman91 commented 9 years ago

I'm trying to use the wp-cli to scan some plugins and themes and I keep getting this error. I followed the directions to install the plugin in a site's wp-content/plugins folders and also enabled it.

I tried doing it on Mac OS and also in a vagrant box.

wp-cli seems to work correctly since i am able to download plugins and enable/disable them, but the vip scanner is giving me the error.

The plugin does work in the web browser's admin interface to scan the twentyfourteen and twentyfifteen themes, etc, but I'd like to use it via the wp-cli to scan some plugins.

PHP Fatal error:  Using $this when not in object context in /vagrant/public/wordpress/wp-content/plugins/vip-scanner/vip-scanner/class-wp-cli.php on line 97
Fatal error: Using $this when not in object context in /vagrant/public/wordpress/wp-content/plugins/vip-scanner/vip-scanner/class-wp-cli.php on line 97

Any assistance would be greatly appreciated. Thank you!

flacoman91 commented 9 years ago

removing the static property fixes the issue. pull request here https://github.com/Automattic/vip-scanner/pull/248

jogindermourya commented 8 years ago

Fatal error: Using $this when not in object context in C:\xampp\htdocs\wp\wp-content\themes\edu_wp_free\warp\systems\wordpress\src\Warp\Wordpress\Helper\SystemHelper.php on line 225

jogindermourya commented 8 years ago

Please resolve this problem of my wp themem.

Fatal error: Using $this when not in object context in C:\xampp\htdocs\wp\wp-content\themes\edu_wp_free\warp\systems\wordpress\src\Warp\Wordpress\Helper\SystemHelper.php on line 225

flacoman91 commented 8 years ago

Sorry. Please read the referenced pull request. Josh has info on how to fix this. The $this reference is not the correct way to do this.