72% custom-admin-menu

Code Review | Custom Admin Menu

WordPress plugin Custom Admin Menu scored72%from 54 tests.

About plugin

  • Plugin page: custom-admin-menu
  • Plugin version: 1.0.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

2 reviews

Install metrics

30+ active /2,374 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

A check of server-side resources used by Custom Admin Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2426.74 ▼17.43
Dashboard /wp-admin3.39 ▲0.0433.47 ▼32.74
Posts /wp-admin/edit.php3.46 ▲0.1141.60 ▼12.54
Add New Post /wp-admin/post-new.php5.70 ▼0.1882.73 ▼17.62
Media Library /wp-admin/upload.php3.41 ▲0.1834.76 ▼1.78
Custom Admin Menu /wp-admin/admin.php?page=adminmenu-settings3.3727.41
DuoGeek /wp-admin/admin.php?page=duogeek-panel3.3733.23
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses3.3727.12
Help /wp-admin/admin.php?page=duogeek-panel-help3.3727.39

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 177 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
recovery_mode_email_last_sent
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Admin Menu
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13413.75 ▼0.472.52 ▲0.7042.51 ▼1.52
Dashboard /wp-admin2,262 ▲855.95 ▲0.3590.19 ▼11.7941.14 ▼0.93
Posts /wp-admin/edit.php2,171 ▲712.40 ▲0.3847.58 ▲9.7545.88 ▲11.73
Add New Post /wp-admin/post-new.php1,741 ▲20422.68 ▼0.62607.27 ▼5.9334.25 ▼24.33
Media Library /wp-admin/upload.php1,464 ▲674.50 ▲0.30100.90 ▼4.0643.63 ▼0.14
Custom Admin Menu /wp-admin/admin.php?page=adminmenu-settings1,5326.54128.9359.21
DuoGeek /wp-admin/admin.php?page=duogeek-panel7851.536.5826.79
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses8512.0426.9821.74
Help /wp-admin/admin.php?page=duogeek-panel-help8662.1528.7325.95

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
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • widget_recent-comments

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 errors were triggered by the plugin
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=duogeek-panel-help
    • > Notice in wp-content/plugins/custom-admin-menu/adminmenu-files/includes/admin-internal.php+3
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=adminmenu-settings
    • > Warning in wp-content/plugins/custom-admin-menu/adminmenu-files/modules/class.menu.management.php+55
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=duogeek-panel
    • > Error in wp-content/plugins/custom-admin-menu/duogeek/duogeek-panel.php+413
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/custom-admin-menu/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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-admin-menu/adminmenu-files/includes/admin-internal.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-admin-menu/adminmenu-files/includes/login-internal.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/custom-admin-menu/duogeek/class.customPostType.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/custom-admin-menu/duogeek/helper.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'AdminMenu' not found in wp-content/plugins/custom-admin-menu/adminmenu-files/modules/class.menu.management.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/custom-admin-menu/duogeek/duogeek-panel.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=duogeek-panel-help
    • > 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=adminmenu-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=adminmenu-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

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === custom-admin-menu === )
You can look at the official readme.txt

custom-admin-menu/adminmenu.php 92% from 13 tests

"Custom Admin Menu" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-admin-menu.php" instead of "adminmenu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected18,163 lines of code in 97 files:
LanguageFilesBlank linesComment linesLines of code
CSS559133009,894
JavaScript55639322,790
PHP83101441,470
Sass1326241,352
LESS1326331,343
SVG3001,314

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.87
Average class complexity24.00
▷ Minimum class complexity3.00
▷ Maximum class complexity59.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3386.84%
▷ Protected methods513.16%
▷ 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

Using a strong compression for your PNG files is a great way to speed-up your plugin
66 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
duogeek/inc/icheck/skins/square/grey.png2.13KB1.83KB▼ 14.27%
duogeek/inc/icheck/skins/minimal/minimal@2x.png1.38KB2.66KB0.00%
duogeek/inc/icheck/skins/square/blue.png2.13KB1.83KB▼ 14.42%
duogeek/inc/icheck/skins/flat/aero@2x.png3.14KB2.77KB▼ 11.93%
duogeek/inc/icheck/skins/minimal/red.png1.10KB1.45KB0.00%