Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

PHP Fatal Error with every theme #154

Open
johnh10 opened this issue Mar 25, 2019 · 7 comments
Open

PHP Fatal Error with every theme #154

johnh10 opened this issue Mar 25, 2019 · 7 comments
Assignees
Labels
Type: Bug There is a bug in the plugin.
Milestone

Comments

@johnh10
Copy link

johnh10 commented Mar 25, 2019

Just installed v1.0.0 from WP site.
Running WordPress 5.1.1
Options: no theme prefix, only checked WPThemeReview setting.
Receive this in error log for every theme checked:

[25-Mar-2019 21:04:04 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to WordPress\Sniff::process() must be an instance of PHP_CodeSniffer_File, instance of PHP_CodeSniffer\Files\DummyFile given, called in /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Files/File.php on line 502 and defined in /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php:838
Stack trace:
#0 /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Files/File.php(502): WordPress\Sniff->process(Object(PHP_CodeSniffer\Files\DummyFile), 0)
#1 /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Runner.php(592): PHP_CodeSniffer\Files\File->process()
#2 /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/src/callback/class- in /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php on line 838

@dingo-d dingo-d self-assigned this Mar 26, 2019
@dingo-d dingo-d added the Type: Bug There is a bug in the plugin. label Mar 26, 2019
@dingo-d
Copy link
Member

dingo-d commented Mar 26, 2019

What PHP version are you running this on?

@johnh10
Copy link
Author

johnh10 commented Mar 26, 2019

PHP 7.1.10

@balabanov
Copy link

Can confirm the same problem, log output is

[06-Apr-2019 09:48:18] WARNING: [pool www] child 20148 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to WordPress\Sniff::process() must be an instance of PHP_CodeSniffer_File, instance of PHP_CodeSniffer\Files\DummyFile given, called in /usr/share/nginx/v2/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Files/File.php on line 502 and defined in /usr/share/nginx/v2/wp-content/plugins/theme-sniffer/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php:838"
[06-Apr-2019 09:48:18] WARNING: [pool www] child 20148 said into stderr: "Stack trace:"
[06-Apr-2019 09:48:18] WARNING: [pool www] child 20148 said into stderr: "#0 /usr/share/nginx/v2/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Files/File.php(502): WordPress\Sniff->process(Object(PHP_CodeSniffer\Files\DummyFile), 0)"
[06-Apr-2019 09:48:18] WARNING: [pool www] child 20148 said into stderr: "#1 /usr/share/nginx/v2/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Runner.php(592): PHP_CodeSniffer\Files\File->process()"
[06-Apr-2019 09:48:18] WARNING: [pool www] child 20148 said into stderr: "#2 /usr/share/nginx/v2/wp-content/plugins/theme-sniffer/src/callback/class-run-sniffer-callback.php(595): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\DummyFile))"
[06-Apr-2019 09:48:18] WARNING: [pool www] child 20148 said into stderr: "#3 /usr/share/nginx/v2/wp-content/plugi..."

Environment

  • Ubuntu 16.04
  • PHP 7.2.16-1 in FPM mode with Nginx
  • Wordpress 5.1.1 with a single custom ACF-based theme

@dingo-d
Copy link
Member

dingo-d commented Aug 21, 2019

Hi @balabanov @johnh10 Can you reproduce this with the latest version?

@dingo-d dingo-d added this to the 1.2.0 milestone Aug 21, 2019
@balabanov
Copy link

Just confirmed in 1.1.1 version, same behavior

@johnh10
Copy link
Author

johnh10 commented Aug 21, 2019

Yes a fatal error with v1.1.1, though stack trace is slightly different.

[21-Aug-2019 17:58:54 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to PHPCompatibility\Sniffs\Miscellaneous\RemovedAlternativePHPTagsSniff::process() must be an instance of PHP_CodeSniffer_File, instance of PHP_CodeSniffer\Files\DummyFile given, called in /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Files/File.php on line 489 and defined in /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php:70
Stack trace:
#0 /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/Files/File.php(489): PHPCompatibility\Sniffs\Miscellaneous\RemovedAlternativePHPTagsSniff->process(Object(PHP_CodeSniffer\Files\DummyFile), 0)
#1 /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/squizlabs/php_codesniffer/src/ in /home/domains/superblogme.com/htdocs/development/testsite/wp-content/plugins/theme-sniffer/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Miscellaneous/RemovedAlternativePHPTagsSniff.php on line 70

@dingo-d
Copy link
Member

dingo-d commented Aug 21, 2019

This happens when you download the plugin from the .org as well? https://wordpress.org/plugins/theme-sniffer/

I'll try to see if this is due to a theme or something else, it's odd that this is happening.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug There is a bug in the plugin.
Projects
None yet
Development

No branches or pull requests

3 participants