83% throws-spam-away

Code Review | Throws SPAM Away

WordPress plugin Throws SPAM Away scored83%from 54 tests.

About plugin

  • Plugin page: throws-spam-away
  • Plugin version: 3.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2011
  • Latest release: Jul 7, 2023
  • Number of updates: 204
  • Update frequency: every 21.4 days
  • Top authors: tsato (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20,000+ active /294,746 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.31MB] [CPU: ▼3.37ms] Passed 4 tests

A check of server-side resources used by Throws SPAM Away
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3243.16 ▲1.48
Dashboard /wp-admin3.61 ▲0.3148.45 ▼0.83
Posts /wp-admin/edit.php3.72 ▲0.3752.24 ▲1.47
Add New Post /wp-admin/post-new.php6.19 ▲0.3185.67 ▼15.60
Media Library /wp-admin/upload.php3.53 ▲0.3136.74 ▲4.90
Throws SPAM Away /wp-admin/admin.php?page=throws-spam-away3.5142.11
スパムコメント一括削除 /wp-admin/admin.php?page=throws-spam-away/throws_spam_away_comments.php3.5434.43

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Throws SPAM Away
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.29 ▼1.021.77 ▼0.0043.25 ▲3.68
Dashboard /wp-admin2,233 ▲594.90 ▼0.20105.15 ▼4.4645.34 ▲1.92
Posts /wp-admin/edit.php2,116 ▲242.01 ▼0.0140.87 ▼0.9544.06 ▲9.47
Add New Post /wp-admin/post-new.php1,555 ▲3623.30 ▲0.10665.35 ▲40.9146.94 ▼5.08
Media Library /wp-admin/upload.php1,412 ▲304.21 ▲0.02101.90 ▲7.7147.04 ▲5.11
Throws SPAM Away /wp-admin/admin.php?page=throws-spam-away1,5481.6925.99153.42
スパムコメント一括削除 /wp-admin/admin.php?page=throws-spam-away/throws_spam_away_comments.php8092.0627.7542.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • 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 no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/throws-spam-away/hostbyip.php:17
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/throws-spam-away/throws_spam_away_comments.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/throws-spam-away/hostbyip.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === throws-spam-away === )
The official readme.txt might help

throws-spam-away/throws_spam_away.php 85% from 13 tests

The primary PHP file in "Throws SPAM Away" version 3.5.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("throws-spam-away.php" instead of "throws_spam_away.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 156 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
Good job! No executable or dangerous file extensions detected2,530 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP52194101,948
PO File1104110284
CSS34313255
JavaScript391443

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity185.00
▷ Minimum class complexity185.00
▷ Maximum class complexity185.00
Average method complexity8.08
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected