90% machine-learning-antispam

Code Review | Machine Learning Antispam

WordPress plugin Machine Learning Antispam scored90%from 54 tests.

About plugin

  • Plugin page: machine-learning-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-3.9
  • WordPress version: 6.3.1
  • First release: Sep 15, 2013
  • Latest release: Apr 17, 2014
  • Number of updates: 5
  • Update frequency: every 44.0 days
  • Top authors: datumbox (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /965 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Machine Learning Antispam
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.12 ▼2.89
Dashboard /wp-admin3.35 ▲0.0143.86 ▼16.04
Posts /wp-admin/edit.php3.47 ▲0.1148.51 ▲3.59
Add New Post /wp-admin/post-new.php5.93 ▲0.0585.25 ▼8.31
Media Library /wp-admin/upload.php3.28 ▲0.0533.62 ▼2.21
Machine Learning Antispam /wp-admin/options-general.php?page=machine-learning-antispam-config3.2432.43

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Machine Learning Antispam
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.19 ▼1.204.53 ▲2.7844.35 ▲1.55
Dashboard /wp-admin2,210 ▲225.79 ▼0.1197.46 ▼16.3638.34 ▼5.40
Posts /wp-admin/edit.php2,096 ▲72.05 ▲0.0639.67 ▲3.8935.19 ▲0.07
Add New Post /wp-admin/post-new.php1,537 ▲723.33 ▲5.04611.96 ▲20.8761.82 ▲9.63
Media Library /wp-admin/upload.php1,392 ▲74.20 ▲0.0394.38 ▼1.6742.85 ▲1.82
Machine Learning Antispam /wp-admin/options-general.php?page=machine-learning-antispam-config8252.0325.2925.26

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
The SRP test was a success

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 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: machine learning, comments, text analysis, spam

machine-learning-antispam/machine-learning-antispam.php 92% from 13 tests

Analyzing the main PHP file in "Machine Learning Antispam" version 1.0
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 199 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected246 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP481141246

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1588.24%
▷ Protected methods211.76%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin