10% stop-junk

Code Review | Stop Junk

WordPress plugin Stop Junk scored 10% from 54 tests.

About plugin

  • Plugin page: stop-junk
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.3.2
  • WordPress version: 5.8.1
  • First release: May 5, 2012
  • Latest release: May 7, 2012
  • Number of updates: 14
  • Update frequency: every 0.3 days
  • Top authors: mbretag (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,087 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/stop-junk/stop-junk.php+59
    Methods with the same name as their class will not be constructors in a future version of PHP; StopJunk has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼199.07ms] Passed 4 tests

An overview of server-side resources used by Stop Junk
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.79 ▼1.055.55 ▼30.76
Dashboard /wp-admin1.80 ▼1.256.21 ▼52.62
Posts /wp-admin/edit.php1.81 ▼1.3010.28 ▼42.74
Add New Post /wp-admin/post-new.php1.81 ▼3.636.47 ▼670.14
Media Library /wp-admin/upload.php1.81 ▼1.209.73 ▼28.56
Stop Junk Plugin /wp-admin/plugins.php?page=stopjunkplugin1.815.45

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Stop Junk
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.79 ▲0.3412.01 ▲0.3550.11 ▼1.77
Dashboard /wp-admin2,969 ▲385.89 ▼0.05187.02 ▲32.90143.87 ▲24.03
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0188.81 ▲13.07104.35 ▲11.53
Add New Post /wp-admin/post-new.php1,686 ▲10518.79 ▼1.51437.52 ▼9.76118.22 ▼2.83
Media Library /wp-admin/upload.php1,812 ▲55.02 ▼0.02172.76 ▼6.06118.23 ▼8.26
Stop Junk Plugin /wp-admin/plugins.php?page=stopjunkplugin1,0292.0961.3173.41

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
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/stop-junk/stop-junk.php+59
    Methods with the same name as their class will not be constructors in a future version of PHP; StopJunk has a deprecated constructor

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/plugins.php?page=stopjunkplugin
    • > Deprecated in wp-content/plugins/stop-junk/stop-junk.php+59
    Methods with the same name as their class will not be constructors in a future version of PHP; StopJunk has a deprecated constructor

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/stop-junk/stop-junk.php:67

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Screenshot of plugin on Comments form)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === stop-junk === )
The official readme.txt might help

stop-junk/stop-junk.php 92% from 13 tests

The main PHP script in "Stop Junk" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 146 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
Success! There were no dangerous files found in this plugin83 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11864083

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png7.18KB6.11KB▼ 14.90%