84% dp-toolbar-plus

Code Review | (dp) Toolbar Plus

WordPress plugin (dp) Toolbar Plus scored84%from 54 tests.

About plugin

  • Plugin page: dp-toolbar-plus
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.0
  • WordPress version: 6.3.1
  • First release: Sep 10, 2021
  • Latest release: Jun 10, 2022
  • Number of updates: 18
  • Update frequency: every 15.2 days
  • Top authors: getdp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.69ms] Passed 4 tests

This is a short check of server-side resources used by (dp) Toolbar Plus
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0937.14 ▼3.35
Dashboard /wp-admin3.39 ▲0.0946.78 ▼1.89
Posts /wp-admin/edit.php3.52 ▲0.1647.08 ▲1.35
Add New Post /wp-admin/post-new.php5.98 ▲0.0981.00 ▼16.10
Media Library /wp-admin/upload.php3.32 ▲0.0936.34 ▼1.42
Toolbar /wp-admin/options-general.php?page=dp-toolbar-settings3.3033.75

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for (dp) Toolbar Plus
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,758 ▼314.62 ▲0.221.98 ▲0.3938.07 ▲0.00
Dashboard /wp-admin2,151 ▼205.60 ▲0.0682.05 ▼9.9640.08 ▲0.78
Posts /wp-admin/edit.php2,053 ▼442.02 ▼0.0032.47 ▼2.0434.49 ▼1.50
Add New Post /wp-admin/post-new.php1,503 ▼2323.30 ▲0.05673.79 ▼10.2258.50 ▲1.10
Media Library /wp-admin/upload.php1,359 ▼414.14 ▼0.0695.85 ▼8.5442.22 ▼5.24
Toolbar /wp-admin/options-general.php?page=dp-toolbar-settings9448.03198.3328.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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)
Even though no errors were found, 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DP\\Toolbar\\plugin_dir_path() in wp-content/plugins/dp-toolbar-plus/dp-toolbar-plus.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: toolbar, admin-bar

dp-toolbar-plus/dp-toolbar-plus.php Passed 13 tests

"(dp) Toolbar Plus" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
137 characters long description:
Get more control of WordPress Toolbar (Admin-Bar) - Hide toolbar from front-end based on user roles and capabilities, auto hide/show etc.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected555 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11151148532
JavaScript27317
JSON1005
CSS1111

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.14
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods41
▷ Static methods3278.05%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin