WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
267 stars 53 forks source link

Investigate why the memory limit issue is occurring when testing the plugin checker plugin. #224

Closed mukeshpanchal27 closed 1 year ago

mukeshpanchal27 commented 1 year ago

Describe the bug

Check discussion here https://github.com/10up/plugin-check/issues/213#issuecomment-1609786902

Steps to Reproduce

Follow steps describe here https://github.com/10up/plugin-check/issues/213#issuecomment-1610717623

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

swissspidy commented 1 year ago

Sounds like it was scanning .git, node_modules, or vendor folders. That would explain the memory limit issue.

mukeshpanchal27 commented 1 year ago

Thanks @swissspidy, Agreed.

I will take a look as many other plugins have vendor directory so they may be face similar issues.

joemcgill commented 1 year ago

I share the assumption that @swissspidy shared. PHPCS has the ability to ignore files and folders when running checks. Are those types of files not being excluded when running sniffs, by chance?

mukeshpanchal27 commented 1 year ago

The Plugin Checker plugin displays the following error when I exclude the .git, node_modules, vendor, and tests folders.

Some of the errors are showing because we have files that are not part of the official plugin once it is uploaded to the plugin repository. We ignore these files when the plugin is uploaded to the WordPress repository, but I will take a look at other errors that are feasible to solve.

cc. @felixarntz @joemcgill @eclarke1

Errors

FILE: templates/admin-page.php

Line Column Type Code Message
46 86 ERROR WordPress.WP.I18n.NonSingularStringLiteralText The $text parameter must be a single text string literal. Found: $category
49 55 ERROR WordPress.WP.I18n.NonSingularStringLiteralText The $text parameter must be a single text string literal. Found: ucfirst( strreplace( '', ' ', $category ) )

FILE: includes/Checker/Checks/Code_Obfuscation_Check.php

Line Column Type Code Message
0 0 ERROR obfuscated_code_detected Code Obfuscation tools are not permitted. Detected: Zend Guard
0 0 ERROR obfuscated_code_detected Code Obfuscation tools are not permitted. Detected: ionCube

FILE: .DS_Store

Line Column Type Code Message
0 0 ERROR hidden_files Hidden files are not permitted.

FILE: .editorconfig

Line Column Type Code Message
0 0 ERROR hidden_files Hidden files are not permitted.

FILE: .eslintrc.js

Line Column Type Code Message
0 0 ERROR hidden_files Hidden files are not permitted.

FILE: .gitignore

Line Column Type Code Message
0 0 ERROR hidden_files Hidden files are not permitted.

FILE: .nvmrc

Line Column Type Code Message
0 0 ERROR hidden_files Hidden files are not permitted.

FILE: .phpunit.result.cache

Line Column Type Code Message
0 0 ERROR hidden_files Hidden files are not permitted.

FILE: plugin-check.php

Line Column Type Code Message
61 9 ERROR WordPress.Security.EscapeOutput.OutputNotEscaped All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'.
62 9 ERROR WordPress.Security.EscapeOutput.OutputNotEscaped All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'WP_PLUGIN_CHECK_MINIMUM_PHP'.

FILE: includes/Checker/Checks/Plugin_Updater_Check.php

Line Column Type Code Message
0 0 ERROR plugin_updater_detected Plugin Updater detected. These are not permitted in WordPress.org hosted plugins. Detected: WP_GitHub_Updater
0 0 ERROR plugin_updater_detected Plugin Updater detected. These are not permitted in WordPress.org hosted plugins. Detected: WPGitHubUpdater
0 0 ERROR plugin_updater_detected Plugin Updater detected. These are not permitted in WordPress.org hosted plugins. Detected: site_transient_update_plugins
0 0 WARNING update_modification_detected Detected code which may be altering WordPress update routines. Detected: auto_update_plugin

FILE: includes/Checker/AJAX_Runner.php

Line Column Type Code Message
39 17 WARNING WordPress.Security.NonceVerification.Recommended Processing form data without nonce verification.
39 72 WARNING WordPress.Security.NonceVerification.Recommended Processing form data without nonce verification.
56 17 WARNING WordPress.Security.NonceVerification.Recommended Processing form data without nonce verification.
62 31 WARNING WordPress.Security.NonceVerification.Recommended Processing form data without nonce verification.

FILE: includes/Checker/Checks/Abstract_File_Check.php

Line Column Type Code Message
180 41 WARNING WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents file_get_contents() is discouraged. Use wp_remote_get() for remote URLs instead.

FILE: includes/Traits/URL_Aware.php

Line Column Type Code Message
71 16 WARNING WordPress.Security.NonceVerification.Recommended Processing form data without nonce verification.
72 16 WARNING WordPress.Security.NonceVerification.Missing Processing form data without nonce verification.
134 12 WARNING WordPress.WP.AlternativeFunctions.parse_url_parse_url parse_url() is discouraged because of inconsistency in the output across PHP versions; use wp_parse_url() instead.
140 33 WARNING WordPress.Security.NonceVerification.Recommended Processing form data without nonce verification.

FILE: includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php

Line Column Type Code Message
32 22 WARNING WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude Using exclude, which is subsequently used by post__not_in, should be done with caution, see https://docs.wpvip.com/how-tos/improve-performance-by-removing-usage-of-post__not_in/ for more information.

FILE: readme.txt

Line Column Type Code Message
0 0 WARNING stable_tag_mismatch The Stable Tag in your readme.txt file does not match the version in your main plugin file.

FILE: includes/Checker/Checks/No_Unfiltered_Uploads_Check.php

Line Column Type Code Message
0 0 ERROR allow_unfiltered_uploads_detected ALLOW_UNFILTERED_UPLOADS is not permitted.