83% miniorange-spam-protection

Code Review | SPAM Protection and Anti SPAM

WordPress plugin SPAM Protection and Anti SPAM scored83%from 54 tests.

About plugin

  • Plugin page: miniorange-spam-p...
  • Plugin version: 2.5.2
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-5.9.1
  • WordPress version: 6.3.1
  • First release: Jun 21, 2016
  • Latest release: Mar 1, 2022
  • Number of updates: 20
  • Update frequency: every 104.0 days
  • Top authors: cyberlord92 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /5,443 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.50MB] [CPU: ▼2.79ms] Passed 4 tests

A check of server-side resources used by SPAM Protection and Anti SPAM
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4943.61 ▲1.93
Dashboard /wp-admin3.85 ▲0.5449.22 ▼0.67
Posts /wp-admin/edit.php3.90 ▲0.5447.46 ▼4.98
Add New Post /wp-admin/post-new.php6.39 ▲0.5087.33 ▼7.42
Media Library /wp-admin/upload.php3.71 ▲0.4841.36 ▲4.74

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for SPAM Protection and Anti SPAM
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲3313.31 ▼1.041.97 ▼0.1143.96 ▼2.79
Dashboard /wp-admin2,213 ▲335.10 ▼0.4983.74 ▼15.1979.81 ▲36.61
Posts /wp-admin/edit.php2,130 ▲302.32 ▲0.3532.76 ▼5.2232.72 ▲1.96
Add New Post /wp-admin/post-new.php1,708 ▲18222.67 ▼0.35651.48 ▼29.9230.42 ▼26.43
Media Library /wp-admin/upload.php1,427 ▲244.58 ▲0.3894.48 ▼0.3077.05 ▲31.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/miniorange-spam-protection/spam_widget.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/miniorange-spam-protection/upgrade.php:12

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: Please take inspiration from this readme.txt

miniorange-spam-protection/spam_widget.php 92% from 13 tests

The entry point to "SPAM Protection and Anti SPAM" version 2.5.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("miniorange-spam-protection.php" instead of "spam_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected4,453 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP174381632,632
CSS514291,625
JavaScript31215196

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity20.83
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods70
▷ Static methods811.43%
▷ Public methods70100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants15.88%
▷ Class constants1694.12%
▷ Public constants16100.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
7 PNG files occupy 0.18MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/error.png1.04KB1.13KB0.00%
(invalid) includes/images/bank-transfer.png42.97KB0.00KB▼ 100.00%
includes/images/card.png59.80KB58.49KB▼ 2.19%
includes/images/paypal.png7.45KB7.20KB▼ 3.36%
includes/images/success.png15.72KB1.48KB▼ 90.60%