10% marctv-ajax-trash-comments

Code Review | MarcTV Moderate Comments

WordPress plugin MarcTV Moderate Comments scored10%from 54 tests.

About plugin

  • Plugin page: marctv-ajax-trash...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.0
  • WordPress version: 6.3.1
  • First release: Nov 1, 2014
  • Latest release: Sep 24, 2022
  • Number of updates: 56
  • Update frequency: every 51.5 days
  • Top authors: MarcDK (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,670 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MarcTVModerateComments::activate() should not be called statically

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.26ms] Passed 4 tests

An overview of server-side resources used by MarcTV Moderate Comments
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.81 ▼1.58
Dashboard /wp-admin3.34 ▲0.0447.62 ▼0.02
Posts /wp-admin/edit.php3.39 ▲0.0448.75 ▲3.08
Add New Post /wp-admin/post-new.php5.94 ▲0.0684.54 ▼10.53
Media Library /wp-admin/upload.php3.26 ▲0.0440.10 ▲6.79
All Comments /wp-admin/edit-comments.php3.2842.14
Reported0 /wp-admin/edit-comments.php?page=marctv-moderate_reported3.2636.03
Moderate Comments /wp-admin/options-general.php?page=marctv-moderate3.2635.80

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
marctv-moderation-text
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for MarcTV Moderate Comments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲16613.75 ▲0.515.23 ▲0.6840.67 ▼0.44
Dashboard /wp-admin2,233 ▲424.86 ▼0.0497.69 ▼9.1138.52 ▼6.25
Posts /wp-admin/edit.php2,113 ▲241.98 ▼0.0538.93 ▼1.1534.10 ▼0.62
Add New Post /wp-admin/post-new.php1,631 ▲11723.59 ▲6.09626.04 ▼30.9252.67 ▼6.92
Media Library /wp-admin/upload.php1,412 ▲244.25 ▲0.0596.01 ▼2.7745.19 ▲1.49
All Comments /wp-admin/edit-comments.php1,8162.2636.2437.01
Reported0 /wp-admin/edit-comments.php?page=marctv-moderate_reported7962.0626.3527.35
Moderate Comments /wp-admin/options-general.php?page=marctv-moderate8252.0323.5128.57

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • marctv-moderation-text
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/marctv-ajax-trash-comments/marctv-moderate.php:507
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/marctv-ajax-trash-comments/pages/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/marctv-ajax-trash-comments/pages/comments-list.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: flag, replace, report, admin, trash...

marctv-ajax-trash-comments/marctv-moderate.php 92% from 13 tests

The entry point to "MarcTV Moderate Comments" version 2.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("marctv-ajax-trash-comments.php" instead of "marctv-moderate.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin647 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP381122414
PO File1343797
JavaScript230694
CSS110042

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity43.00
▷ Minimum class complexity43.00
▷ Maximum class complexity43.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
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
PNG images were not found in this plugin