84% stop-media-comment-spamming

Code Review | Stop Media Comment Spamming

WordPress plugin Stop Media Comment Spamming scored84%from 54 tests.

About plugin

  • Plugin page: stop-media-commen...
  • Plugin version: 1.8.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Oct 19, 2012
  • Latest release: Mar 30, 2023
  • Number of updates: 20
  • Update frequency: every 190.7 days
  • Top authors: DeveloperWil (60%)limecanvas (45%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /16,005 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.23ms] Passed 4 tests

A check of server-side resources used by Stop Media Comment Spamming
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.75 ▼2.05
Dashboard /wp-admin3.31 ▲0.0143.83 ▼1.13
Posts /wp-admin/edit.php3.36 ▲0.0146.99 ▲4.40
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.15 ▼3.03
Media Library /wp-admin/upload.php3.23 ▲0.0133.18 ▼2.72

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Stop Media Comment Spamming
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.15 ▼1.231.95 ▼0.0840.47 ▼0.20
Dashboard /wp-admin2,206 ▲215.88 ▼0.01107.19 ▼10.8141.22 ▼5.59
Posts /wp-admin/edit.php2,092 ▼01.97 ▼0.0244.24 ▲7.3636.18 ▲6.30
Add New Post /wp-admin/post-new.php1,536 ▲1123.27 ▲0.04616.82 ▼59.9649.55 ▼5.73
Media Library /wp-admin/upload.php1,391 ▲34.16 ▼0.05103.23 ▼3.9842.92 ▼1.94

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/stop-media-comment-spamming/stop-media-comment-spamming.php:41

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 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Before the plugin. Comments on attachments are open.), #2 (After plugin has been activated. Comments on attachments disappear.)
You can look at the official readme.txt

stop-media-comment-spamming/stop-media-comment-spamming.php Passed 13 tests

The main PHP script in "Stop Media Comment Spamming" version 1.8.3 is automatically included on every request by WordPress
115 characters long description:
Stops media comment spamming by removing the ability to comment on attachments. Other post types are not affected.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP193017

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.57
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin