79% spamassassin-preferences

Code Review | SpamAssassin Preferences

WordPress plugin SpamAssassin Preferences scored79%from 54 tests.

About plugin

  • Plugin page: spamassassin-pref...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2014
  • Latest release: Apr 17, 2023
  • Number of updates: 31
  • Update frequency: every 103.3 days
  • Top authors: GregRoss (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,002 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▲0.50ms] Passed 4 tests

Server-side resources used by SpamAssassin Preferences
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0336.94 ▼4.48
Dashboard /wp-admin3.33 ▲0.0346.50 ▼2.00
Posts /wp-admin/edit.php3.38 ▲0.0250.18 ▲5.21
Add New Post /wp-admin/post-new.php5.91 ▲0.02107.45 ▲8.15
Media Library /wp-admin/upload.php3.25 ▲0.0233.99 ▲3.26

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for SpamAssassin Preferences
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.45 ▼0.171.78 ▼0.2940.90 ▼4.38
Dashboard /wp-admin2,210 ▲194.86 ▼0.02110.10 ▲9.0542.49 ▼3.45
Posts /wp-admin/edit.php2,096 ▲72.00 ▼0.0540.66 ▲0.6137.04 ▲0.70
Add New Post /wp-admin/post-new.php1,545 ▲318.26 ▲0.19607.51 ▼7.5949.64 ▼4.80
Media Library /wp-admin/upload.php1,392 ▲44.14 ▼0.0595.91 ▼3.4541.96 ▼5.16
SpamAssassin Preferences /wp-admin/spamassassin-preferences.php260.440.0614.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spamassassin-preferences/spamassassin-preferences.php:178
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SAPrefsUserFieldList() in wp-content/plugins/spamassassin-preferences/spamassassin-preferences-admin-options.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/spamassassin-preferences.php
    • > Network (severe)
    wp-admin/spamassassin-preferences.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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: spamassassin

spamassassin-preferences/spamassassin-preferences.php Passed 13 tests

The main PHP script in "SpamAssassin Preferences" version 1.0 is automatically included on every request by WordPress
67 characters long description:
Set your SpamAssassin preferences from your WordPress user profile.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected426 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4112100426

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin