83% mtcaptcha

Code Review | MTCaptcha WordPress Plugin

WordPress plugin MTCaptcha WordPress Plugin scored83%from 54 tests.

About plugin

  • Plugin page: mtcaptcha
  • Plugin version: 2.7.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 6.3.1
  • First release: Sep 29, 2019
  • Latest release: Mar 25, 2021
  • Number of updates: 21
  • Update frequency: every 26.1 days
  • Top authors: mtcaptcha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /1,174 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.21ms] Passed 4 tests

An overview of server-side resources used by MTCaptcha WordPress Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.22 ▼3.37
Dashboard /wp-admin3.34 ▲0.0450.06 ▼2.47
Posts /wp-admin/edit.php3.39 ▲0.0354.19 ▲2.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0396.99 ▼11.11
Media Library /wp-admin/upload.php3.26 ▲0.0339.30 ▲0.13
MTCaptcha /wp-admin/options-general.php?page=mt_options3.2637.43

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by MTCaptcha WordPress Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8014.24 ▼0.113.70 ▲1.9539.84 ▼3.60
Dashboard /wp-admin2,206 ▲325.63 ▲0.0889.70 ▼3.1938.45 ▼3.04
Posts /wp-admin/edit.php2,111 ▲111.98 ▲0.0240.64 ▲0.5937.51 ▼0.23
Add New Post /wp-admin/post-new.php1,533 ▲522.92 ▼0.05610.44 ▼6.1154.04 ▼1.75
Media Library /wp-admin/upload.php1,411 ▲144.22 ▲0.04100.37 ▼2.3242.13 ▼4.47
MTCaptcha /wp-admin/options-general.php?page=mt_options1,3152.1623.5036.58

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mtcaptcha/mt-captcha.php
    • > /wp-content/plugins/mtcaptcha/uninstall.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Requires at least: Version not formatted correctly
You can take inspiration from this readme.txt

mtcaptcha/mt-captcha.php 85% from 13 tests

The entry point to "MTCaptcha WordPress Plugin" version 2.7.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 242 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("mtcaptcha.php" instead of "mt-captcha.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin762 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP27722638
JavaScript211096
CSS26028

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity40.50
▷ Minimum class complexity2.00
▷ Maximum class complexity79.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3797.37%
▷ Protected methods00.00%
▷ Private methods12.63%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/logo.png3.79KB2.04KB▼ 46.09%
.wordpress-org/icon-256x256.png18.71KB7.25KB▼ 61.27%
.wordpress-org/icon-128x128.png8.88KB3.11KB▼ 65.01%