78% spam-destroyer

Code Review | Spam Destroyer

WordPress plugin Spam Destroyer scored78%from 54 tests.

About plugin

  • Plugin page: spam-destroyer
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.9
  • WordPress version: 6.3.1
  • First release: Jul 29, 2012
  • Latest release: Jan 16, 2022
  • Number of updates: 57
  • Update frequency: every 60.7 days
  • Top authors: ryanhellyer (94.74%)BrianLayman (7.02%)

Code review

54 tests

User reviews

51 reviews

Install metrics

9,000+ active /80,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.24ms] Passed 4 tests

A check of server-side resources used by Spam Destroyer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.87 ▼8.44
Dashboard /wp-admin3.43 ▲0.0855.74 ▼5.74
Posts /wp-admin/edit.php3.54 ▲0.1950.59 ▲2.43
Add New Post /wp-admin/post-new.php6.01 ▲0.1293.30 ▼7.57
Media Library /wp-admin/upload.php3.35 ▲0.1240.43 ▼3.19

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
db_upgraded
spam-destroyer-key
widget_recent-posts
spam-destroyer-version
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Spam Destroyer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7913.36 ▼1.011.92 ▼0.2048.56 ▲4.32
Dashboard /wp-admin2,224 ▲184.87 ▼1.0399.27 ▼8.5739.54 ▼4.12
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0337.61 ▼1.0635.58 ▲0.55
Add New Post /wp-admin/post-new.php1,554 ▲2218.40 ▼4.80640.89 ▼79.8392.97 ▲22.72
Media Library /wp-admin/upload.php1,397 ▼34.28 ▲0.09101.84 ▼6.7245.21 ▼8.16

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/spam-destroyer/index.php
    • > /wp-content/plugins/spam-destroyer/uninstall.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Spam_Destroyer' not found in wp-content/plugins/spam-destroyer/inc/class-spam-destroyer-generate-captcha.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Spam_Destroyer' not found in wp-content/plugins/spam-destroyer/inc/class-spam-destroyer-add-meta.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Spam_Destroyer' not found in wp-content/plugins/spam-destroyer/inc/class-spam-destroyer-captcha-question.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spam-destroyer/inc/class-spam-destroyer-stats.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Spam_Destroyer' not found in wp-content/plugins/spam-destroyer/inc/class-spam-destroyer-settings.php:12
    • > PHP Warning
      Use of undefined constant HOUR_IN_SECONDS - assumed 'HOUR_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/spam-destroyer/inc/class-spam-destroyer.php on line 516
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/spam-destroyer/inc/class-spam-destroyer.php:73

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were 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:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt might help

spam-destroyer/index.php 92% from 13 tests

"Spam Destroyer" version 2.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("spam-destroyer.php" instead of "index.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
Good job! No executable or dangerous file extensions detected824 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9236470768
JavaScript262256

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.30
Average class complexity14.43
▷ Minimum class complexity2.00
▷ Maximum class complexity41.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods3375.00%
▷ Protected methods1125.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin