72% dd-roles

Code Review | DD Roles

WordPress plugin DD Roles scored72%from 54 tests.

About plugin

  • Plugin page: dd-roles
  • Plugin version: 4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.5.1
  • WordPress version: 6.3.1
  • First release: Dec 21, 2013
  • Latest release: Sep 26, 2020
  • Number of updates: 54
  • Update frequency: every 45.8 days
  • Top authors: Mosterd3d (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

70+ active /6,671 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by DD Roles
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.78 ▼3.26
Dashboard /wp-admin3.34 ▲0.0446.95 ▼4.45
Posts /wp-admin/edit.php3.39 ▲0.0447.37 ▼2.24
Add New Post /wp-admin/post-new.php5.92 ▲0.0484.42 ▼20.08
Media Library /wp-admin/upload.php3.26 ▲0.0436.41 ▲5.43

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for DD Roles
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.46 ▼0.761.61 ▼0.5939.26 ▼7.98
Dashboard /wp-admin2,210 ▲195.12 ▼0.74110.59 ▲6.7637.57 ▼6.10
Posts /wp-admin/edit.php2,093 ▲42.44 ▲0.4333.88 ▼3.4329.02 ▼6.71
Add New Post /wp-admin/post-new.php1,520 ▲623.46 ▲5.89609.45 ▼62.4650.89 ▼4.12
Media Library /wp-admin/upload.php1,386 ▲74.49 ▲0.29101.60 ▲0.8342.91 ▼0.98
DD Roles /wp-admin/dd-roles.php260.440.1118.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/dd-roles/views/widgets/donate.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'dd_roles' not found in wp-content/plugins/dd-roles/views/widgets/migrate_users.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/dd-roles/views/widgets/manage_capabilities.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_role() in wp-content/plugins/dd-roles/dd_roles.php:438
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/dd-roles/views/widgets/create_role.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/dd-roles/views/widgets/create_role.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/dd-roles.php
    • > Network (severe)
    wp-admin/dd-roles.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 21 tag instead of maximum 10
You can look at the official readme.txt

dd-roles/dd_roles.php 92% from 13 tests

Analyzing the main PHP file in "DD Roles" version 4.1
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("dd-roles.php" instead of "dd_roles.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
No dangerous file extensions were detected1,784 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS1813966
PHP69562646
JavaScript3211125
SVG20047

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity48.00
▷ Minimum class complexity48.00
▷ Maximum class complexity48.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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