79% spam-notifier

Code Review | Spam Notifier

WordPress plugin Spam Notifier scored79%from 54 tests.

About plugin

  • Plugin page: spam-notifier
  • Plugin version: 2.00
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: Aug 21, 2014
  • Latest release: Oct 30, 2022
  • Number of updates: 35
  • Update frequency: every 85.5 days
  • Top authors: Flector (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,985 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.01MB] [CPU: ▼2.73ms] Passed 4 tests

Analyzing server-side resources used by Spam Notifier
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.57 ▼6.81
Dashboard /wp-admin3.31 ▲0.0146.91 ▼0.10
Posts /wp-admin/edit.php3.36 ▲0.0149.33 ▼1.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.55 ▼0.45
Media Library /wp-admin/upload.php3.24 ▲0.0133.72 ▼2.01

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
sn_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Spam Notifier
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.44 ▲0.301.69 ▼0.0441.31 ▼2.68
Dashboard /wp-admin2,210 ▲225.87 ▲0.0695.91 ▼4.0039.37 ▼4.40
Posts /wp-admin/edit.php2,090 ▲11.99 ▼0.0440.77 ▲5.4937.06 ▼1.19
Add New Post /wp-admin/post-new.php1,531 ▲1223.29 ▲0.16657.50 ▼14.3959.37 ▼3.78
Media Library /wp-admin/upload.php1,392 ▲74.13 ▼0.0596.31 ▼1.5244.61 ▼1.21
Spam Notifier /wp-admin/spam-notifier.php260.440.0918.85

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spam-notifier/spam-notifier.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/spam-notifier.php
    • > Network (severe)
    wp-admin/spam-notifier.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: email, comments, comment, akismet, spam...

spam-notifier/spam-notifier.php Passed 13 tests

The principal PHP file in "Spam Notifier" v. 2.00 is loaded by WordPress automatically on each request
73 characters long description:
The plugin sends an email message when a comment goes to the spam folder.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin548 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript36727296
PHP14541217
CSS22735

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon_coffee.png5.14KB5.32KB0.00%