83% recaptcha-in-wp-comments-form

Code Review | reCAPTCHA in WP comments form

WordPress plugin reCAPTCHA in WP comments form scored83%from 54 tests.

About plugin

  • Plugin page: recaptcha-in-wp-c...
  • Plugin version: 9.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Jun 29, 2016
  • Latest release: Apr 22, 2019
  • Number of updates: 50
  • Update frequency: every 20.5 days
  • Top authors: jmviade (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

10,000+ active /69,638 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.73ms] Passed 4 tests

Analyzing server-side resources used by reCAPTCHA in WP comments form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.59 ▼0.84
Dashboard /wp-admin3.34 ▲0.0460.60 ▲9.18
Posts /wp-admin/edit.php3.45 ▲0.1050.92 ▲0.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.45 ▼11.01
Media Library /wp-admin/upload.php3.26 ▲0.0337.81 ▲4.61
reCAPTCHA in Comments /wp-admin/options-general.php?page=google_recaptcha_in_wp_comments_settings3.2533.24

Server storage [IO: ▲1.50MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 94 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
griwpc-params
widget_recent-comments
widget_theysaidso_widget
cool-griwpc-ver
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for reCAPTCHA in WP comments form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲2014.28 ▲0.042.05 ▲0.0445.54 ▲2.50
Dashboard /wp-admin2,199 ▲195.65 ▼0.0395.19 ▲1.6841.02 ▲1.10
Posts /wp-admin/edit.php2,107 ▲42.00 ▼0.0238.39 ▼3.2936.67 ▲0.03
Add New Post /wp-admin/post-new.php1,531 ▲523.39 ▼0.24669.77 ▲38.2469.26 ▲13.63
Media Library /wp-admin/upload.php1,407 ▲74.20 ▲0.01103.28 ▼0.8449.70 ▲2.53
reCAPTCHA in Comments /wp-admin/options-general.php?page=google_recaptcha_in_wp_comments_settings1,0942.0023.5868.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • cool-griwpc-ver
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • griwpc-params

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/examples/example-captcha.php on line 36
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/tests/ReCaptcha/ReCaptchaTest.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/tests/ReCaptcha/ResponseTest.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/src/ReCaptcha/RequestMethod/Post.php:35
    • > PHP Warning
      require_once(wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/examples/example-captcha.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha-in-wp-comments.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'griwpc_interface' not found in wp-content/plugins/recaptcha-in-wp-comments-form/includes/recaptcha.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'griwpc_interface' not found in wp-content/plugins/recaptcha-in-wp-comments-form/includes/frontend-interface.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/tests/ReCaptcha/RequestMethod/PostTest.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/recaptcha-in-wp-comments-form/recaptcha/tests/ReCaptcha/RequestMethod/CurlPostTest.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

recaptcha-in-wp-comments-form/recaptcha-in-wp-comments.php 77% from 13 tests

The primary PHP file in "reCAPTCHA in WP comments form" version 9.1.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 418 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("recaptcha-in-wp-comments-form.php" instead of "recaptcha-in-wp-comments.php")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected3,291 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP268361,0512,087
JavaScript4211141545
CSS37670373
Markdown2290108
SVG40499
JSON10028
INI11020
XML10017
YAML14014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods152
▷ Static methods2617.11%
▷ Public methods15098.68%
▷ Protected methods21.32%
▷ Private methods00.00%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants21
▷ Global constants1466.67%
▷ Class constants733.33%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
39 PNG files occupy 0.79MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/g-spam-die.png2.53KB1.76KB▼ 30.37%
images/g-spam-trash.png0.88KB0.60KB▼ 32.01%
images/g-select-language.png3.88KB2.81KB▼ 27.65%
images/g-activation-accordion.png16.29KB7.90KB▼ 51.52%
images/g-installation-metabox.png16.71KB13.09KB▼ 21.65%