You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unclear error message: "PHP Code Sniffer is not available. Try running composer install first." #254
That is a super interesting report, I will check on a fresh new PHP locally to see if I can reproduce. On my current local and some of the InstaWP testing instances I used that wasn't a problem.
It's caused by plugin-check/inc/class-phpcs.php calling is_executable() as the first part of the run() method.
That checks the permissions of the plugin-check/vendor/squizlabs/php_codesniffer/bin/phpcs file. That file is a PHP file so it doesn't actually need to have executable permissions when running from the web, but maybe there's other places that it runs via CLI so the check is needed? If that's the case, maybe only do the is_executable() check if PHP_SAPI === 'cli' ?
The quick and dirty solution for making it work on the web is to change the permissions of the phpcs file to be executable, but making PHP files executable if there's not an actual reason to do so isn't good security practice.
Activity
bordoni commentedon Sep 21, 2023
That is a super interesting report, I will check on a fresh new PHP locally to see if I can reproduce. On my current local and some of the InstaWP testing instances I used that wasn't a problem.
bordoni commentedon Sep 21, 2023
Figured out what happened. I will take a look into how to resolve that.
shawn-digitalpoint commentedon Sep 21, 2023
It's caused by
plugin-check/inc/class-phpcs.phpcallingis_executable()as the first part of therun()method.That checks the permissions of the
plugin-check/vendor/squizlabs/php_codesniffer/bin/phpcsfile. That file is a PHP file so it doesn't actually need to have executable permissions when running from the web, but maybe there's other places that it runs via CLI so the check is needed? If that's the case, maybe only do the is_executable() check if PHP_SAPI === 'cli' ?The quick and dirty solution for making it work on the web is to change the permissions of the phpcs file to be executable, but making PHP files executable if there's not an actual reason to do so isn't good security practice.