68% nmt-sitewide-moderation

Code Review | NMT Sitewide moderation

WordPress plugin NMT Sitewide moderation scored68%from 54 tests.

About plugin

  • Plugin page: nmt-sitewide-mode...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 20, 2014
  • Latest release: Mar 5, 2014
  • Number of updates: 10
  • Update frequency: every 1.3 days
  • Top authors: xiffy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /766 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼3.44ms] Passed 4 tests

A check of server-side resources used by NMT Sitewide moderation
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2237.50 ▼3.57
Dashboard /wp-admin3.52 ▲0.2246.62 ▼7.06
Posts /wp-admin/edit.php3.63 ▲0.2845.74 ▼1.56
Add New Post /wp-admin/post-new.php6.10 ▲0.2198.11 ▲4.26
Media Library /wp-admin/upload.php3.44 ▲0.2137.53 ▼1.55
All Comments /wp-admin/edit-comments.php3.5138.82
Sitewide blacklist /wp-admin/edit-comments.php?page=nmt-sitewide-blacklist3.4636.80
Sitewide moderation /wp-admin/edit-comments.php?page=nmt-sitewide-moderation3.4430.85

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: 1 new table, 6 new options
New tables
wp_all_comments
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

NMT Sitewide moderation: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.33 ▼1.051.70 ▼0.1843.67 ▼7.57
Dashboard /wp-admin2,227 ▲364.83 ▼0.99109.18 ▼2.7140.71 ▲0.46
Posts /wp-admin/edit.php2,110 ▲212.05 ▲0.0434.04 ▼2.4936.35 ▲1.25
Add New Post /wp-admin/post-new.php1,560 ▲4618.16 ▲0.55611.54 ▼110.0548.62 ▼8.33
Media Library /wp-admin/upload.php1,412 ▲214.23 ▲0.0299.45 ▼4.9942.18 ▼5.01
All Comments /wp-admin/edit-comments.php1,8132.3039.4934.85
Sitewide blacklist /wp-admin/edit-comments.php?page=nmt-sitewide-blacklist8082.0227.4326.97
Sitewide moderation /wp-admin/edit-comments.php?page=nmt-sitewide-moderation1,3742.0534.7826.48

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_all_comments
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/edit-comments.php?page=nmt-sitewide-moderation
    • > Notice in wp-content/plugins/nmt-sitewide-moderation/nmt-sitewide-moderation.php+71
    Undefined index: comment_status
    • > GET request to /wp-admin/edit-comments.php?page=nmt-sitewide-moderation
    • > Notice in wp-content/plugins/nmt-sitewide-moderation/nmt-sitewide-moderation.php+191
    Undefined variable: post_id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-comments.php?page=nmt-sitewide-moderation
    • > Notice in wp-admin/includes/class-wp-list-table.php+1350
    Undefined offset: 3
    • > GET request to /wp-admin/edit-comments.php?page=nmt-sitewide-moderation
    • > Warning in wp-admin/includes/class-wp-list-table.php+1676
    Invalid argument supplied for foreach()

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/nmt-sitewide-moderation/nmt-sitewide-moderation.php on line 23
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/nmt-sitewide-moderation/nmt-sitewide-moderation.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/nmt-sitewide-moderation/nmt_comment_list_table.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/nmt-sitewide-moderation/nmt-sitewide-moderation.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

nmt-sitewide-moderation/nmt-sitewide-moderation.php Passed 13 tests

This is the main PHP file of "NMT Sitewide moderation" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
57 characters long description:
Enables site-wide comment moderation over multiple blogs.

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 detected1,933 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22281241,091
JavaScript223617842

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity61.50
▷ Minimum class complexity33.00
▷ Maximum class complexity90.00
Average method complexity6.04
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.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
No PNG images were found in this plugin