80% spamjam

Code Review | SpamJam

WordPress plugin SpamJam scored80%from 54 tests.

About plugin

  • Plugin page: spamjam
  • Plugin version: 0.4.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.0
  • WordPress version: 6.3.1
  • First release: Jul 27, 2022
  • Latest release: Jul 4, 2023
  • Number of updates: 6
  • Update frequency: every 57.0 days
  • Top authors: skyminds (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /320 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.79MB] [CPU: ▲24.26ms] Passed 4 tests

A check of server-side resources used by SpamJam
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /8.91 ▲5.1866.39 ▲20.96
Dashboard /wp-admin8.93 ▲5.3776.56 ▲24.27
Posts /wp-admin/edit.php8.93 ▲5.2583.97 ▲32.48
Add New Post /wp-admin/post-new.php9.52 ▲3.38126.20 ▲19.33
Media Library /wp-admin/upload.php8.93 ▲5.4473.04 ▲34.38
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9362.56

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 197 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
fs_accounts
fs_active_plugins
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
fs_debug_mode

Browser metrics Passed 4 tests

SpamJam: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7014.74 ▲0.471.65 ▲0.0531.74 ▼10.29
Dashboard /wp-admin2,237 ▲605.69 ▲0.0595.11 ▲3.4845.02 ▲2.64
Posts /wp-admin/edit.php2,143 ▲432.03 ▲0.0142.02 ▲4.9938.04 ▲7.64
Add New Post /wp-admin/post-new.php1,541 ▲1517.53 ▼0.13616.38 ▼19.1065.35 ▲5.01
Media Library /wp-admin/upload.php1,439 ▲454.21 ▲0.04106.58 ▲2.4247.74 ▲3.57
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0971.6927.3029.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 without warnings or errors
    • > Notice in wp-content/plugins/spamjam/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_active_plugins
    • can_compress_scripts
    • db_upgraded
    • fs_accounts
    • widget_recent-comments
    • fs_debug_mode
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Everything seems fine, however this is by no means an exhaustive test

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 Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: spamjam, comment spam, registration spam, antispam, spam jam...

spamjam/spamjam.php Passed 13 tests

The principal PHP file in "SpamJam" v. 0.4.0 is loaded by WordPress automatically on each request
57 characters long description:
SpamJam silently kills spam in comments and registration.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected34,041 lines of code in 148 files:
LanguageFilesBlank linesComment linesLines of code
PHP1298,13217,72233,731
JavaScript33459194
JSON20053
PO File1131450
CSS130013

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity87.69
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,300
▷ Static methods21616.62%
▷ Public methods90869.85%
▷ Protected methods171.31%
▷ Private methods37528.85%
Functions113
▷ Named functions11198.23%
▷ Anonymous functions21.77%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/wordpress-sdk/assets/img/spamjam.png80.08KB33.69KB▼ 57.93%