62% easy-custom-admin-bar

Code Review | Easy Custom Admin Bar

WordPress plugin Easy Custom Admin Bar scored 62% from 54 tests.

About plugin

  • Plugin page: easy-custom-admin...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.2
  • WordPress version: 6.3.1
  • First release: May 1, 2015
  • Latest release: May 2, 2015
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: duogeek (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,774 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼15.11ms] Passed 4 tests

Server-side resources used by Easy Custom Admin Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2629.56 ▼14.47
Dashboard /wp-admin3.40 ▲0.1032.89 ▼21.86
Posts /wp-admin/edit.php3.48 ▲0.1236.72 ▼9.05
Add New Post /wp-admin/post-new.php5.72 ▼0.1675.16 ▼15.05
Media Library /wp-admin/upload.php3.43 ▲0.2034.11 ▼2.50
Easy Custom Admin Bar /wp-admin/admin.php?page=adminbar-settings3.3929.12
Help /wp-admin/admin.php?page=duogeek-panel-help3.3928.98
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses3.3927.01
DuoGeek /wp-admin/admin.php?page=duogeek-panel3.3928.18

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 179 new files
Database: 1 new table, 8 new options
New tables
wp_admin_bar_table
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
jal_db_version
widget_theysaidso_widget
db_upgraded
recovery_mode_email_last_sent
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Easy Custom Admin Bar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲14313.76 ▼0.522.16 ▲0.5043.94 ▼4.35
Dashboard /wp-admin2,276 ▲885.17 ▲0.13104.74 ▼0.3234.70 ▼9.84
Posts /wp-admin/edit.php2,160 ▲742.44 ▲0.4539.40 ▲3.3734.96 ▲1.65
Add New Post /wp-admin/post-new.php1,738 ▲21824.89 ▲1.38592.91 ▼45.5934.61 ▼27.59
Media Library /wp-admin/upload.php1,452 ▲674.53 ▲0.3397.20 ▼1.4240.56 ▼1.43
Easy Custom Admin Bar /wp-admin/admin.php?page=adminbar-settings1,2266.43113.1454.67
Help /wp-admin/admin.php?page=duogeek-panel-help8542.1528.0824.33
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses8422.0228.2923.34
DuoGeek /wp-admin/admin.php?page=duogeek-panel7771.537.0524.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_admin_bar_table
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • jal_db_version
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=duogeek-panel
    • > Notice in wp-content/plugins/easy-custom-admin-bar/adminbar-files/includes/admin-internal.php+3
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=duogeek-panel
    • > Error in wp-content/plugins/easy-custom-admin-bar/duogeek/duogeek-panel.php+413
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/easy-custom-admin-bar/duogeek/duogeek-panel.php:413
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): DuoGeekPlugins->duogeek_panel_cb()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

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
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'EasyCustomAdminBar' not found in wp-content/plugins/easy-custom-admin-bar/adminbar-files/modules/class.custom.admin.bar.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/easy-custom-admin-bar/adminbar-files/includes/login-internal.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/easy-custom-admin-bar/adminbar-files/includes/admin-internal.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/easy-custom-admin-bar/duogeek/duogeek-panel.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/easy-custom-admin-bar/duogeek/class.customPostType.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/easy-custom-admin-bar/duogeek/helper.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=duogeek-panel
    • > Network (severe)
    http://fonts.googleapis.com/css?family= - Failed to load resource: the server responded with a status of 400 (Bad Request)
    • > GET request to /wp-admin/admin.php?page=adminbar-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=adminbar-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === easy-custom-admin-bar === )
The official readme.txt might help

easy-custom-admin-bar/adminbar.php 92% from 13 tests

The main file in "Easy Custom Admin Bar" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("easy-custom-admin-bar.php" instead of "adminbar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected18,581 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
CSS559143009,897
JavaScript55639322,790
PHP83181461,535
Sass1326241,352
LESS1326331,343
SVG3001,314
PO File1158182350

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.82
Average class complexity24.75
▷ Minimum class complexity3.00
▷ Maximum class complexity59.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods3687.80%
▷ Protected methods512.20%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
66 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
duogeek/inc/icheck/skins/flat/purple.png1.48KB1.65KB0.00%
duogeek/inc/icheck/skins/square/aero.png2.12KB1.83KB▼ 13.71%
duogeek/inc/icheck/skins/square/purple.png2.14KB1.83KB▼ 14.31%
duogeek/inc/icheck/skins/square/blue@2x.png4.38KB3.04KB▼ 30.61%
duogeek/inc/icheck/skins/minimal/purple.png1.11KB1.45KB0.00%