84% wp-recaptcha-integration

Code Review | ReCaptcha Integration for WordPress

WordPress plugin ReCaptcha Integration for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: wp-recaptcha-inte...
  • Plugin version: 1.2.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.0
  • WordPress version: 6.3.1
  • First release: Dec 20, 2014
  • Latest release: Jun 2, 2022
  • Number of updates: 55
  • Update frequency: every 49.5 days
  • Top authors: podpirate (87.27%)tareq1988 (14.55%)

Code review

54 tests

User reviews

90 reviews

Install metrics

10,000+ active /259,598 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼3.63ms] Passed 4 tests

An overview of server-side resources used by ReCaptcha Integration for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.35 ▼3.27
Dashboard /wp-admin3.54 ▲0.2351.11 ▲0.86
Posts /wp-admin/edit.php3.65 ▲0.2951.22 ▲3.84
Add New Post /wp-admin/post-new.php6.12 ▲0.2384.98 ▼14.62
Media Library /wp-admin/upload.php3.46 ▲0.2336.16 ▲2.53
ReCaptcha /wp-admin/options-general.php?page=recaptcha3.4332.87

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 40 new files
Database: no new tables, 20 new options
New WordPress options
recaptcha_lockout
recaptcha_enable_lostpw
recaptcha_comment_use_42_filter
widget_recent-posts
widget_recent-comments
recaptcha_enable_login
theysaidso_admin_options
recaptcha_flavor
widget_theysaidso_widget
recaptcha_disable_for_known_users
...

Browser metrics Passed 4 tests

A check of browser resources used by ReCaptcha Integration for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.30 ▼1.091.60 ▼0.3240.60 ▼2.51
Dashboard /wp-admin2,218 ▲335.81 ▲0.9394.46 ▼26.3440.49 ▼3.05
Posts /wp-admin/edit.php2,103 ▲112.16 ▲0.1437.37 ▼2.8634.16 ▼1.95
Add New Post /wp-admin/post-new.php1,547 ▲2723.28 ▲0.22676.28 ▲13.2155.67 ▲6.82
Media Library /wp-admin/upload.php1,403 ▲154.27 ▲0.0895.68 ▼8.1944.23 ▲2.35
ReCaptcha /wp-admin/options-general.php?page=recaptcha7891.7124.4527.87

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 20 options in the database
    • widget_recent-comments
    • recaptcha_noscript
    • recaptcha_enable_login
    • recaptcha_theme
    • recaptcha_comment_use_42_filter
    • recaptcha_lockout
    • recaptcha_enable_signup
    • recaptcha_language
    • recaptcha_disable_submit
    • recaptcha_enable_lostpw
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-recaptcha-integration/wp-recaptcha-integration.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'cforms2_captcha' not found in wp-content/plugins/wp-recaptcha-integration/inc/class-wp_recaptcha_cforms2.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_reCaptcha_Captcha' not found in wp-content/plugins/wp-recaptcha-integration/inc/class-wp_recaptcha_nocaptcha.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_reCaptcha_Captcha' not found in wp-content/plugins/wp-recaptcha-integration/inc/class-wp_recaptcha_recaptcha.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Plugin Settings (v 1.1.4)), #2 (Ninja Form Integration), #3 (Contact Form 7 Integration)
The official readme.txt might help

wp-recaptcha-integration/wp-recaptcha-integration.php 92% from 13 tests

The principal PHP file in "ReCaptcha Integration for WordPress" v. 1.2.5 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 160 characters long)

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,036 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP144098041,751
PO File64419391,132
CSS190102
JavaScript26451

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity17.58
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods136
▷ Static methods1410.29%
▷ Public methods11383.09%
▷ Protected methods00.00%
▷ Private methods2316.91%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.33MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/recaptcha-theme-red.png18.90KB8.94KB▼ 52.71%
screenshot-1.png132.03KB48.95KB▼ 62.93%
images/recaptcha-theme-clean.png12.69KB8.58KB▼ 32.40%
images/recaptcha-theme-blackglass.png19.87KB10.52KB▼ 47.06%
images/grecaptcha-theme-light.png6.24KB2.71KB▼ 56.61%