78% recaptcha-for-all

Code Review | reCAPTCHA and Cloudflare Turnstile For All Pages, to Block Spam and Hackers Attack, Block Visitors from China

WordPress plugin reCAPTCHA and Cloudflare Turnstile For All Pages, to Block Spam and Hackers Attack, Block Visitors from China scored78%from 54 tests.

About plugin

  • Plugin page: recaptcha-for-all
  • Plugin version: 1.30
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: Jun 8, 2021
  • Latest release: Nov 4, 2023
  • Number of updates: 247
  • Update frequency: every 3.6 days
  • Top authors: sminozzi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /28,013 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▲1.90ms] Passed 4 tests

This is a short check of server-side resources used by reCAPTCHA and Cloudflare Turnstile For All Pages, to Block Spam and Hackers Attack, Block Visitors from China
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1847.14 ▲6.58
Dashboard /wp-admin3.65 ▲0.3060.86 ▼1.94
Posts /wp-admin/edit.php3.70 ▲0.3457.57 ▲9.73
Add New Post /wp-admin/post-new.php6.17 ▲0.2893.16 ▼6.35
Media Library /wp-admin/upload.php3.49 ▲0.2643.66 ▲9.30
reCAPTCHA for all /wp-admin/tools.php?page=recaptcha_for_all_admin_page3.5241.45

Server storage [IO: ▲0.90MB] [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: 38 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
recaptcha_for_all_was_activated
widget_recent-posts
bill_show_warnings
recaptcha_last_feedback
recaptcha_for_all_string_whitelist
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

reCAPTCHA and Cloudflare Turnstile For All Pages, to Block Spam and Hackers Attack, Block Visitors from China: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,364 ▲61317.77 ▲3.0932.89 ▲31.1942.69 ▼2.35
Dashboard /wp-admin2,419 ▲2396.97 ▲1.42119.06 ▲20.9748.26 ▲3.49
Posts /wp-admin/edit.php2,357 ▲2574.02 ▲2.0258.40 ▲16.4934.14 ▼6.64
Add New Post /wp-admin/post-new.php1,572 ▲4223.55 ▲0.32665.78 ▲21.1240.12 ▼10.62
Media Library /wp-admin/upload.php1,487 ▲904.74 ▲0.5487.23 ▼14.2843.05 ▼3.00
reCAPTCHA for all /wp-admin/tools.php?page=recaptcha_for_all_admin_page1,1803.6550.2666.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • recaptcha_last_feedback
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 12× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/recaptcha-for-all/dashboard/dashboard-pages.php
    • > /wp-content/plugins/recaptcha-for-all/recaptcha.php
    • > /wp-content/plugins/recaptcha-for-all/includes/checkup/class_bill_catch_errors.php
    • > /wp-content/plugins/recaptcha-for-all/dashboard/dashboard-whitelist.php
    • > /wp-content/plugins/recaptcha-for-all/dashboard/dashboard-settings.php
    • > /wp-content/plugins/recaptcha-for-all/dashboard/dashboard-container.php
    • > /wp-content/plugins/recaptcha-for-all/dashboard/dashboard.php
    • > /wp-content/plugins/recaptcha-for-all/includes/checkup/bill_class_diagnose.php
    • > /wp-content/plugins/recaptcha-for-all/dashboard/dashboard-keys.php
    • > /wp-content/plugins/recaptcha-for-all/dashboard/dashboard-message.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/recaptcha-for-all/template.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Initial Page box), #2 (Dashboard)
You can take inspiration from this readme.txt

recaptcha-for-all/recaptcha.php 92% from 13 tests

"reCAPTCHA and Cloudflare Turnstile For All Pages, to Block Spam and Hackers Attack, Block Visitors from China" version 1.30's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("recaptcha-for-all.php" instead of "recaptcha.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected4,619 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP157153962,868
PO File3281304947
CSS44817432
JavaScript58769372

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods520.83%
▷ Public methods2291.67%
▷ Protected methods00.00%
▷ Private methods28.33%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants51
▷ Global constants51100.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.56MB with 0.31MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/checkup/bell.png1.07KB0.27KB▼ 74.45%
screenshot-2.png134.79KB50.99KB▼ 62.17%
screenshot-1.png432.57KB242.03KB▼ 44.05%
images/logo.png5.96KB3.65KB▼ 38.72%