10% wp-recaptcha-bp

Code Review | WP-reCAPTCHA-bp

WordPress plugin WP-reCAPTCHA-bp scored10%from 54 tests.

About plugin

  • Plugin page: wp-recaptcha-bp
  • Plugin version: 4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.9
  • WordPress version: 6.3.1
  • First release: Jan 10, 2015
  • Latest release: Feb 23, 2019
  • Number of updates: 24
  • Update frequency: every 62.9 days
  • Top authors: elrata_ (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /14,363 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wp-recaptcha-bp/recaptchalib.php+42
    Methods with the same name as their class will not be constructors in a future version of PHP; ReCaptcha has a deprecated constructor

Server metrics [RAM: ▼1.82MB] [CPU: ▼59.51ms] Passed 4 tests

Server-side resources used by WP-reCAPTCHA-bp
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.285.77 ▼36.30
Dashboard /wp-admin2.21 ▼1.147.23 ▼58.46
Posts /wp-admin/edit.php2.21 ▼1.157.24 ▼39.87
Add New Post /wp-admin/post-new.php2.21 ▼3.696.90 ▼103.40
Media Library /wp-admin/upload.php2.21 ▼1.035.75 ▼32.20
WP-reCAPTCHA-bp /wp-admin/options-general.php?page=wp-recaptcha-bp/recaptcha.php2.217.17

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
recaptcha_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP-reCAPTCHA-bp
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲2814.35 ▲0.001.84 ▼0.0246.71 ▲8.09
Dashboard /wp-admin2,208 ▲315.65 ▲0.0085.31 ▼6.4338.55 ▼2.75
Posts /wp-admin/edit.php2,110 ▲131.99 ▼0.1034.65 ▼3.3437.62 ▲2.82
Add New Post /wp-admin/post-new.php1,535 ▲923.25 ▼0.27673.97 ▼14.4463.81 ▼4.47
Media Library /wp-admin/upload.php1,404 ▲44.22 ▼0.0397.89 ▼0.1041.36 ▼10.18
WP-reCAPTCHA-bp /wp-admin/options-general.php?page=wp-recaptcha-bp/recaptcha.php1,1112.1723.6226.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/wp-recaptcha-bp/recaptchalib.php+42
    Methods with the same name as their class will not be constructors in a future version of PHP; ReCaptcha has a deprecated constructor
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=wp-recaptcha-bp/recaptcha.php
    • > Deprecated in wp-content/plugins/wp-recaptcha-bp/recaptchalib.php+42
    Methods with the same name as their class will not be constructors in a future version of PHP; ReCaptcha has a deprecated constructor

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-recaptcha-bp/settings.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-recaptcha-bp/wp-plugin.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-recaptcha-bp/wp-plugin.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-recaptcha-bp/wp-plugin.php:96
    • > PHP Fatal error
      Uncaught Error: Call to undefined function unregister_setting() in wp-content/plugins/wp-recaptcha-bp/uninstall.php:8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-recaptcha-bp/wp-plugin.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-recaptcha-bp/wp-plugin.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (The reCAPTCHA Settings), #2 (Comments page with reCAPTCHA)
  • Plugin Name: You should set the name of your plugin on the first line ( === wp-recaptcha-bp === )
Please take inspiration from this readme.txt

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

"WP-reCAPTCHA-bp" version 4.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-recaptcha-bp.php" instead of "wp-recaptcha.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected642 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6118144616
reStructuredText19326

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.60
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods50
▷ Static methods918.00%
▷ Public methods4284.00%
▷ Protected methods510.00%
▷ Private methods36.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.19MB with 0.12MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png100.76KB34.89KB▼ 65.37%
screenshot-1.png91.10KB34.39KB▼ 62.25%