67% cf7-easy-math-captcha

Code Review | Easy Math Captcha for CF7

WordPress plugin Easy Math Captcha for CF7 scored 67% from 54 tests.

About plugin

  • Plugin page: cf7-easy-math-cap...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.3
  • WordPress version: 5.9.2
  • First release: Dec 31, 2019
  • Latest release: Jan 2, 2020
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: alphabposervice (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

3,000+ active / 6,787 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.53MB] [CPU: ▼275.61ms] 75% from 4 tests

A check of server-side resources used by Easy Math Captcha for CF7
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,847.05ms on /wp-admin/admin.php?page=cf7-easy-math-captcha)
PageMemory (MB)CPU Time (ms)
Home /8.43 ▲4.9276.40 ▲14.49
Dashboard /wp-admin8.45 ▲5.0455.40 ▲24.68
Posts /wp-admin/edit.php8.45 ▲4.8157.78 ▲16.58
Add New Post /wp-admin/post-new.php10.35 ▲3.35111.93 ▼1,154.37
Media Library /wp-admin/upload.php8.45 ▲5.1645.25 ▲20.87
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius8.4546.80
Easy Math Captcha for CF7 /wp-admin/admin.php?page=cf7-easy-math-captcha8.451,847.05

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 182 new files
Database: no new tables, 4 new options
New WordPress options
fs_active_plugins
fs_gdpr
fs_debug_mode
fs_accounts

Browser metrics Passed 4 tests

A check of browser resources used by Easy Math Captcha for CF7
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,820 ▲9815.98 ▲0.205.86 ▼1.382.11 ▼0.48
Dashboard /wp-admin2,948 ▲876.13 ▼0.03119.67 ▼24.00171.98 ▼46.63
Posts /wp-admin/edit.php2,744 ▲533.25 ▲0.0265.45 ▲2.44158.46 ▼3.28
Add New Post /wp-admin/post-new.php1,703 ▲521.22 ▼0.60437.95 ▼5.74158.27 ▲5.27
Media Library /wp-admin/upload.php1,750 ▲525.68 ▲0.17165.94 ▲24.19206.22 ▲4.57
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius1,4302.7359.73128.11
Easy Math Captcha for CF7 /wp-admin/admin.php?page=cf7-easy-math-captcha1,2892.4658.03181.24

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
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/cf7-easy-math-captcha/freemius/includes/class-freemius.php+8218
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 4 options
    • fs_debug_mode
    • fs_gdpr
    • fs_active_plugins
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/cf7-easy-math-captcha/freemius/templates/ajax-loader.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cf7-easy-math-captcha/freemius/templates/account/partials/addon.php on line 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 Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: form captcha, math captcha, contact form 7, contact form 7 captcha, captcha...

cf7-easy-math-captcha/easy-math-captcha-cf7.php 69% from 13 tests

The main PHP file in "Easy Math Captcha for CF7" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("cf7-easy-math-captcha.php" instead of "easy-math-captcha-cf7.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected45,456 lines of code in 140 files:
LanguageFilesBlank linesComment linesLines of code
PHP1127,12415,98229,789
PO File126,9608,45515,240
JavaScript33459194
Markdown1610192
JSON10027
CSS110014

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,772)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity81.81
▷ Minimum class complexity1.00
▷ Maximum class complexity2,772.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,132
▷ Static methods17515.46%
▷ Public methods79169.88%
▷ Protected methods151.33%
▷ Private methods32628.80%
Functions100
▷ Named functions100100.00%
▷ Anonymous functions00.00%
Constants125
▷ Global constants10080.00%
▷ Class constants2520.00%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%