77% wp-advanced-math-captcha

Code Review | WP Advanced Math Captcha

WordPress plugin WP Advanced Math Captcha scored77%from 54 tests.

About plugin

  • Plugin page: wp-advanced-math-...
  • Plugin version: 1.2.20
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Dec 3, 2020
  • Latest release: Sep 26, 2022
  • Number of updates: 11
  • Update frequency: every 60.7 days
  • Top authors: lulub5592 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

6,000+ active /19,963 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.43MB] [CPU: ▼4.55ms] Passed 4 tests

A check of server-side resources used by WP Advanced Math Captcha
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4648.88 ▲2.49
Dashboard /wp-admin3.79 ▲0.4457.51 ▼5.81
Posts /wp-admin/edit.php3.84 ▲0.4852.74 ▼1.79
Add New Post /wp-admin/post-new.php6.31 ▲0.4287.93 ▼12.98
Media Library /wp-admin/upload.php3.65 ▲0.4239.13 ▲2.40
Math Captcha /wp-admin/options-general.php?page=math-captcha3.6038.30

Server storage [IO: ▲3.91MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • Illegal file modification detected: 1 file (13.56KB) outside of "wp-content/plugins/wp-advanced-math-captcha/" and "wp-content/uploads/"
    • (new file) siteguarding_tools.php
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Advanced Math Captcha
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.27 ▼0.111.89 ▼0.3142.48 ▼0.46
Dashboard /wp-admin2,211 ▲345.60 ▼0.0296.99 ▲11.4443.77 ▲6.91
Posts /wp-admin/edit.php2,113 ▲132.03 ▲0.0338.05 ▲0.8733.50 ▼1.62
Add New Post /wp-admin/post-new.php1,551 ▲1723.02 ▼0.09651.44 ▼15.3551.39 ▲0.67
Media Library /wp-admin/upload.php1,416 ▲194.21 ▼0.0299.81 ▼2.1342.95 ▼3.98
Math Captcha /wp-admin/options-general.php?page=math-captcha2,3621.7223.7735.65

Uninstaller [IO: ▲0.01MB] [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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=math-captcha
    • > Notice in wp-content/plugins/wp-advanced-math-captcha/includes/class-settings.php+274
    Undefined index: ip_rules
    • > GET request to /wp-admin/options-general.php?page=math-captcha
    • > Notice in wp-content/plugins/wp-advanced-math-captcha/includes/class-settings.php+300
    Undefined index: geo_captcha_rules
  • 250 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=math-captcha
    • > Notice in wp-content/plugins/wp-advanced-math-captcha/includes/class-settings.php+321
    Undefined index: hide_for_countries
  • 250 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=math-captcha
    • > Notice in wp-content/plugins/wp-advanced-math-captcha/includes/class-settings.php+321
    Trying to access array offset on value of type null

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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-advanced-math-captcha/includes/integrations/contact-form-7.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed: You can take inspiration from this readme.txt

wp-advanced-math-captcha/wp-math-captcha.php 77% from 13 tests

The main PHP file in "WP Advanced Math Captcha" ver. 1.2.20 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-advanced-math-captcha.php" instead of "wp-math-captcha.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 151 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,999 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP84383511,960
CSS22232
JavaScript1317

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity55.17
▷ Minimum class complexity5.00
▷ Maximum class complexity176.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods91
▷ Static methods11.10%
▷ Public methods6369.23%
▷ Protected methods00.00%
▷ Private methods2830.77%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
2 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/banner-pentryforms.png50.53KB20.72KB▼ 58.99%
images/logo-dfactory.png2.92KB1.92KB▼ 34.20%