84% baw-moderator-role

Code Review | Moderator Role

WordPress plugin Moderator Role scored84%from 54 tests.

About plugin

  • Plugin page: baw-moderator-role
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.3
  • WordPress version: 6.3.1
  • First release: Mar 7, 2012
  • Latest release: Aug 12, 2015
  • Number of updates: 15
  • Update frequency: every 84.0 days
  • Top authors: juliobox (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /5,410 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.98ms] Passed 4 tests

This is a short check of server-side resources used by Moderator Role
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.29 ▼0.93
Dashboard /wp-admin3.34 ▲0.0448.78 ▼4.80
Posts /wp-admin/edit.php3.40 ▲0.0448.73 ▼8.46
Add New Post /wp-admin/post-new.php5.93 ▲0.0492.80 ▼13.71
Media Library /wp-admin/upload.php3.27 ▲0.0440.69 ▲2.14

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Moderator Role: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.011.56 ▼0.2739.37 ▼3.18
Dashboard /wp-admin2,195 ▲155.64 ▲0.0085.49 ▼8.6638.49 ▼3.30
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0037.31 ▼0.2533.94 ▼1.07
Add New Post /wp-admin/post-new.php1,526 ▼023.28 ▲0.08672.66 ▼10.0056.22 ▼5.33
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.00109.42 ▼4.7347.39 ▲0.34

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/baw-moderator-role/baw_moderator.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: member, comments, moderator, capability, role...

baw-moderator-role/baw_moderator.php 92% from 13 tests

"Moderator Role" version 1.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("baw-moderator-role.php" instead of "baw_moderator.php")

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
Everything looks great! No dangerous files found in this plugin137 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11922137

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions7
▷ Named functions7100.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
There are no PNG files in this plugin