58% wp-headless-menu-editor

Code Review | WP Headless Menu Editor

WordPress plugin WP Headless Menu Editor scored58%from 54 tests.

About plugin

  • Plugin page: wp-headless-menu-...
  • Plugin version: 1.0.0....
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Sep 20, 2019
  • Latest release: Sep 29, 2019
  • Number of updates: 8
  • Update frequency: every 1.1 days
  • Top authors: deployer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /634 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.75MB] [CPU: ▼32.63ms] Passed 4 tests

Server-side resources used by WP Headless Menu Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.31 ▼1.36
Dashboard /wp-admin3.19 ▼0.1128.58 ▼21.23
Posts /wp-admin/edit.php3.19 ▼0.1729.79 ▼20.25
Add New Post /wp-admin/post-new.php3.19 ▼2.7027.80 ▼79.44
Media Library /wp-admin/upload.php3.19 ▼0.0425.64 ▼9.58

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 97 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Headless Menu Editor
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲16017.04 ▲2.691.65 ▲0.0343.85 ▲2.44
Dashboard /wp-admin2,302 ▲1227.77 ▲2.17124.87 ▲34.9855.45 ▲13.51
Posts /wp-admin/edit.php2,232 ▲1324.85 ▲2.7854.84 ▲13.2852.35 ▲18.35
Add New Post /wp-admin/post-new.php1,711 ▲18528.21 ▲4.82607.23 ▼78.5359.16 ▲6.49
Media Library /wp-admin/upload.php1,652 ▲2526.96 ▲2.73121.14 ▲16.2754.85 ▲9.33

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • The plugin did not uninstall successfully, leaving 97 files (4.42MB) in the plugin directory
    • (new file) assets/banner-1544x500-rtl.png
    • (new file) assets/banner-1544x500.png
    • (new file) assets/banner-772x250.png
    • (new file) assets/screenshot-1.png
    • (new file) .gitignore
    • (new file) assets/banner-772x250-rtl.png
    • (new file) .eslintrc.json
    • (new file) assets/icon-128x128.png
    • (new file) assets/icon-256x256.png
    • (new file) assets/icon.svg
    • ...
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-headless-menu-editor/includes/templates/menu_editor.template.php
    • > /wp-content/plugins/wp-headless-menu-editor/includes/templates/menu_api.template.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant HME_PLUGIN_DIR_PATH - assumed 'HME_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-headless-menu-editor/includes/classes/menu_editor.class.php on line 7
    • > PHP Fatal error
      require(): Failed opening required 'HME_PLUGIN_DIR_PATH/includes/models/menu-item.model.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-headless-menu-editor/includes/classes/menu_editor.class.php on line 7
    • > PHP Warning
      require(HME_PLUGIN_DIR_PATH/includes/models/menu-item.model.php): failed to open stream: No such file or directory in wp-content/plugins/wp-headless-menu-editor/includes/classes/menu_editor.class.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: menu, editor, headless

wp-headless-menu-editor/wp-headless-menu-editor.php 92% from 13 tests

The principal PHP file in "WP Headless Menu Editor" v. 1.0.0.... is loaded by WordPress automatically on each request
It is important to fix the following:
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "1.0.0....")

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
There were no executable files found in this plugin21,137 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
JSON60013,663
JavaScript52353743,814
SVG40122,881
PHP78262448
Sass12690273
CSS1231340
Markdown18018

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods37
▷ Static methods00.00%
▷ Public methods3081.08%
▷ Protected methods00.00%
▷ Private methods718.92%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.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
8 PNG files occupy 0.47MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png58.27KB28.68KB▼ 50.78%
assets/banner-1544x500-rtl.png105.20KB40.94KB▼ 61.09%
assets/icon-256x256.png22.79KB8.86KB▼ 61.12%
assets/banner-772x250.png40.28KB15.13KB▼ 62.43%
assets/banner-1544x500.png105.20KB40.94KB▼ 61.09%