83% invisible-recaptcha-by-threatpress

Code Review | Google Invisible reCaptcha by ThreatPress

WordPress plugin Google Invisible reCaptcha by ThreatPress scored 83% from 54 tests.

About plugin

  • Plugin page: invisible-recaptc...
  • Plugin version: 0.9.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.1.1
  • WordPress version: 6.3.1
  • First release: Aug 30, 2017
  • Latest release: Mar 30, 2019
  • Number of updates: 8
  • Update frequency: every 72.1 days
  • Top authors: dominykasgel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,945 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.00ms] Passed 4 tests

An overview of server-side resources used by Google Invisible reCaptcha by ThreatPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.33 ▼7.87
Dashboard /wp-admin3.33 ▲0.0246.11 ▲0.80
Posts /wp-admin/edit.php3.38 ▲0.0243.83 ▼5.37
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.79 ▲4.19
Media Library /wp-admin/upload.php3.25 ▲0.0235.25 ▲0.45
Invisible reCAPTCHA /wp-admin/tools.php?page=threatpress_recaptcha_settings3.3832.45

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
threatpress_recaptcha_settings

Browser metrics Passed 4 tests

Google Invisible reCaptcha by ThreatPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.58 ▼1.061.70 ▼0.1740.90 ▼5.43
Dashboard /wp-admin2,210 ▲224.85 ▼0.01106.77 ▼2.7237.61 ▼4.43
Posts /wp-admin/edit.php2,093 ▲11.98 ▼0.0140.44 ▼3.2336.03 ▼1.70
Add New Post /wp-admin/post-new.php1,536 ▲2223.06 ▲5.43590.38 ▼92.6954.98 ▼15.77
Media Library /wp-admin/upload.php1,395 ▲134.21 ▲0.0297.36 ▲1.4843.78 ▼0.24
Invisible reCAPTCHA /wp-admin/tools.php?page=threatpress_recaptcha_settings1,4612.2329.9426.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • threatpress_recaptcha_settings
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

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
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ThreatPress_Recaptcha_Admin_Option' not found in wp-content/plugins/invisible-recaptcha-by-threatpress/admin/options/class-form-option-settings.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ThreatPress_Recaptcha_Admin_Form' not found in wp-content/plugins/invisible-recaptcha-by-threatpress/admin/pages/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/invisible-recaptcha-by-threatpress/bootstrap.php:114

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: recaptcha, security, captcha, invisible recaptcha, google...

invisible-recaptcha-by-threatpress/threatpress.php 77% from 13 tests

The main file in "Google Invisible reCaptcha by ThreatPress" v. 0.9.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("invisible-recaptcha-by-threatpress.php" instead of "threatpress.php")
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,746 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP193707801,149
CSS12088578
JavaScript13619

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.85
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods95
▷ Static methods2223.16%
▷ Public methods8488.42%
▷ Protected methods66.32%
▷ Private methods55.26%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin