78% admin-menu-editor

Code Review | Admin Menu Editor

WordPress plugin Admin Menu Editor scored78%from 54 tests.

About plugin

  • Plugin page: admin-menu-editor
  • Plugin version: 1.12
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.2
  • WordPress version: 6.3.1
  • First release: Dec 13, 2009
  • Latest release: Oct 17, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

281 reviews

Install metrics

400,000+ active /5,571,283 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.38MB] [CPU: ▼6.28ms] Passed 4 tests

An overview of server-side resources used by Admin Menu Editor
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2832.54 ▼6.13
Dashboard /wp-admin3.77 ▲0.4249.31 ▼10.33
Posts /wp-admin/edit.php3.82 ▲0.4648.56 ▼0.15
Add New Post /wp-admin/post-new.php6.31 ▲0.4292.22 ▼8.52
Media Library /wp-admin/upload.php3.63 ▲0.4035.98 ▲2.84
Menu Editor /wp-admin/options-general.php?page=menu_editor4.3949.27

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 327 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
ws_menu_editor
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Admin Menu Editor
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲2514.41 ▲0.061.83 ▲0.0138.74 ▼1.29
Dashboard /wp-admin2,220 ▲495.83 ▲0.2893.56 ▲8.5241.69 ▼0.03
Posts /wp-admin/edit.php2,122 ▲222.18 ▲0.1844.89 ▲9.4037.29 ▲1.11
Add New Post /wp-admin/post-new.php1,556 ▲2818.33 ▼4.83614.37 ▼29.7668.05 ▲18.52
Media Library /wp-admin/upload.php1,416 ▲164.38 ▲0.2499.13 ▲5.7541.56 ▲0.66
Menu Editor /wp-admin/options-general.php?page=menu_editor4,7806.85173.3835.40

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/admin-menu-editor/includes/generate-menu-dashicons.php
    • > /wp-content/plugins/admin-menu-editor/modules/actor-selector/actor-selector-template.php
    • > /wp-content/plugins/admin-menu-editor/includes/test-access-screen.php
    • > /wp-content/plugins/admin-menu-editor/includes/cap-suggestion-box.php
  • 110× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\AdminMenuEditor\\Customizable\\Settings\\Setting' not found in wp-content/plugins/admin-menu-editor/customizables/Settings/EnumSetting.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\AdminMenuEditor\\Customizable\\Controls\\ChoiceControl' not found in wp-content/plugins/admin-menu-editor/customizables/Controls/SelectBox.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/admin-menu-editor/modules/redirector/redirector-template.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MenuEd_ShadowPluginFramework' not found in wp-content/plugins/admin-menu-editor/includes/menu-editor-core.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\AdminMenuEditor\\Customizable\\Rendering\\ClassicRenderer' not found in wp-content/plugins/admin-menu-editor/customizables/Rendering/TabbedPanelRenderer.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\AdminMenuEditor\\Customizable\\Builders\\ContainerBuilder' not found in wp-content/plugins/admin-menu-editor/customizables/Builders/SectionBuilder.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\AdminMenuEditor\\Customizable\\Controls\\UiElement' not found in wp-content/plugins/admin-menu-editor/customizables/Controls/Container.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/admin-menu-editor/includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/CSSNamespace.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\AdminMenuEditor\\Customizable\\Controls\\ClassicControl' not found in wp-content/plugins/admin-menu-editor/customizables/Controls/WpEditor.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/admin-menu-editor/includes/shortcodes.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Plugin interface), #2 (A sample menu created by the plugin), #3 (Re-ordering menu items via drag and drop)
You can look at the official readme.txt

admin-menu-editor/menu-editor.php 92% from 13 tests

This is the main PHP file of "Admin Menu Editor" version 1.12, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("admin-menu-editor.php" instead of "menu-editor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin58,417 lines of code in 263 files:
LanguageFilesBlank linesComment linesLines of code
PHP1683,7105,23718,818
JavaScript262,83010,07316,108
TypeScript212,98010,73115,048
CSS175594054,212
Sass248621423,424
Markdown31600615
SVG100126
XML19940
JSON20026

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity16.69
▷ Minimum class complexity1.00
▷ Maximum class complexity683.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces18
Interfaces9
Traits1
Classes159
▷ Abstract classes2918.24%
▷ Concrete classes13081.76%
▷ Final classes21.54%
Methods1,334
▷ Static methods1259.37%
▷ Public methods1,01776.24%
▷ Protected methods16412.29%
▷ Private methods15311.47%
Functions27
▷ Named functions1659.26%
▷ Anonymous functions1140.74%
Constants89
▷ Global constants22.25%
▷ Class constants8797.75%
▷ Public constants87100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
38 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/new-menu-badge.png1.47KB0.32KB▼ 78.01%
images/plugin_add.png0.67KB0.70KB0.00%
images/bullet_error.png0.44KB0.45KB0.00%
images/font-awesome/undo.png1.13KB0.26KB▼ 76.80%
images/logo-medium.png7.92KB7.72KB▼ 2.49%