84% wp-spamainator

Code Review | Wp SpamAinator

WordPress plugin Wp SpamAinator scored84%from 54 tests.

About plugin

  • Plugin page: wp-spamainator
  • Plugin version: 1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 15, 2020
  • Latest release: Feb 15, 2020
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: arminschaeffer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /371 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Analyzing server-side resources used by Wp SpamAinator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.91 ▼6.25
Dashboard /wp-admin3.34 ▲0.0447.04 ▼6.55
Posts /wp-admin/edit.php3.39 ▲0.0449.53 ▼2.01
Add New Post /wp-admin/post-new.php5.92 ▲0.0485.13 ▼22.19
Media Library /wp-admin/upload.php3.27 ▲0.0438.19 ▲1.45
SpamAinator /wp-admin/plugins.php?page=spamainator3.2333.04

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 165 new files
Database: no new tables, 7 new options
New WordPress options
spamainator_text_field_0
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Wp SpamAinator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.72 ▲0.072.00 ▼0.2842.76 ▼4.82
Dashboard /wp-admin2,199 ▲195.57 ▼0.0584.55 ▼7.7442.87 ▼3.28
Posts /wp-admin/edit.php2,101 ▲11.96 ▼0.0538.65 ▼0.3332.39 ▲0.31
Add New Post /wp-admin/post-new.php1,531 ▼423.46 ▲5.21679.70 ▲50.7847.91 ▼17.90
Media Library /wp-admin/upload.php1,404 ▲44.20 ▼0.01100.15 ▼2.2745.14 ▼0.43
SpamAinator /wp-admin/plugins.php?page=spamainator8611.9925.2228.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 85× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Estimator' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/Regression/Regression.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Phpml\\DimensionReduction\\EigenTransformerBase' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/DimensionReduction/LDA.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Classification\\Classifier' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/Classification/Ensemble/Bagging.php:14
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-spamainator/src/Inc/SpamAinatorListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\FeatureSelection\\ScoringFunction' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/FeatureSelection/ScoringFunction/UnivariateLinearRegression.php:23
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-spamainator/src/Inc/SpamAinatorListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Tokenization\\Tokenizer' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/Tokenization/WhitespaceTokenizer.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\euralNetwork\\ActivationFunction' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/NeuralNetwork/ActivationFunction/HyperbolicTangent.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Tokenization\\Tokenizer' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/Tokenization/WordTokenizer.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Phpml\\Classification\\Linear\\Perceptron' not found in wp-content/plugins/wp-spamainator/vendor/php-ai/php-ml/src/Classification/Linear/Adaline.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
1 plugin tags: spam

wp-spamainator/SpamAInator.php 92% from 13 tests

The main PHP file in "Wp SpamAinator" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-spamainator.php" instead of "SpamAInator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin8,222 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP1522,3212,7327,988
JSON300117
Markdown1290117

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.66
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces39
Interfaces17
Traits3
Classes126
▷ Abstract classes107.94%
▷ Concrete classes11692.06%
▷ Final classes108.62%
Methods620
▷ Static methods6710.81%
▷ Public methods40865.81%
▷ Protected methods10216.45%
▷ Private methods11017.74%
Functions56
▷ Named functions58.93%
▷ Anonymous functions5191.07%
Constants49
▷ Global constants00.00%
▷ Class constants49100.00%
▷ Public constants4285.71%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin