68% wp-hidenmenuitems

Code Review | WP-HidenMenuItems

WordPress plugin WP-HidenMenuItems scored68%from 54 tests.

About plugin

  • Plugin page: wp-hidenmenuitems
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.1
  • WordPress version: 6.3.1
  • First release: Apr 23, 2020
  • Latest release: Jan 27, 2023
  • Number of updates: 23
  • Update frequency: every 43.9 days
  • Top authors: adminkov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,239 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.76ms] Passed 4 tests

Server-side resources used by WP-HidenMenuItems
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0944.61 ▲2.82
Dashboard /wp-admin3.39 ▲0.0846.78 ▼3.82
Posts /wp-admin/edit.php3.44 ▲0.0847.31 ▼0.81
Add New Post /wp-admin/post-new.php5.97 ▲0.0886.81 ▼5.23
Media Library /wp-admin/upload.php3.32 ▲0.0839.55 ▲5.79
Hiden menu items /wp-admin/themes.php?page=hiden-menu-items3.2732.57

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WP-HidenMenuItems
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.091.94 ▼0.2144.27 ▼4.04
Dashboard /wp-admin2,213 ▲285.89 ▲0.0399.58 ▼6.7941.11 ▼2.95
Posts /wp-admin/edit.php2,093 ▲12.01 ▼0.0140.06 ▼2.1835.30 ▼4.55
Add New Post /wp-admin/post-new.php1,545 ▲318.27 ▼0.31591.16 ▼48.6954.67 ▲3.77
Media Library /wp-admin/upload.php1,395 ▲104.23 ▲0.0595.43 ▼1.2741.27 ▼1.02
Hiden menu items /wp-admin/themes.php?page=hiden-menu-items8171.547.0124.20

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wp-hidenmenuitems/uninstall.php+23
    Undefined offset: 0
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/themes.php?page=hiden-menu-items
    • > Notice in wp-content/plugins/wp-hidenmenuitems/class-menu-items-hiden.php+283
    Undefined offset: 0
    • > GET request to /wp-admin/themes.php?page=hiden-menu-items
    • > Notice in wp-content/plugins/wp-hidenmenuitems/class-menu-items-hiden.php+283
    Trying to get property 'term_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=hiden-menu-items
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/wp-hidenmenuitems/class-structure-menu.php+103
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/themes.php?page=hiden-menu-items
    • > Error in wp-content/plugins/wp-hidenmenuitems/class-structure-menu.php+108
    Uncaught TypeError: Return value of HMI_Structure_Menu::get_items_selected_menu() must be of the type array, bool returned in wp-content/plugins/wp-hidenmenuitems/class-structure-menu.php:108
    Stack trace:
    #0 wp-content/plugins/wp-hidenmenuitems/class-menu-items-hiden.php(283): HMI_Structure_Menu->get_items_selected_menu()
    #1 wp-content/plugins/wp-hidenmenuitems/class-menu-items-hiden.php(243): HMI_Main->hmi_setting_field2()
    #2 wp-includes/class-wp-hook.php(310): HMI_Main->hiden_menu_items()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/themes.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown
    • > GET request to /wp-admin/themes.php?page=hiden-menu-items
    • > POST request to /wp-admin/admin-ajax.php
    • > Error in wp-content/plugins/wp-hidenmenuitems/class-structure-menu.php+108
    Uncaught TypeError: Return value of HMI_Structure_Menu::get_items_selected_menu() must be of the type array, bool returned in wp-content/plugins/wp-hidenmenuitems/class-structure-menu.php:108
    Stack trace:
    #0 wp-content/plugins/wp-hidenmenuitems/includes/ajax-menu-items-hiden.php(58): HMI_Structure_Menu->get_items_selected_menu()
    #1 wp-includes/class-wp-hook.php(310): hmi_menu_items_ajax()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin-ajax.php(188): do_action()
    #5 {main}
    thrown

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/themes.php?page=hiden-menu-items
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: items, menu, hide

wp-hidenmenuitems/wp-menu-items-hiden.php 77% from 13 tests

The main file in "WP-HidenMenuItems" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-hidenmenuitems.php" instead of "wp-menu-items-hiden.php")
  • Domain Path: The domain path folder was not found ("/languages/")

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
Success! There were no dangerous files found in this plugin730 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP554178472
JavaScript13467232
CSS111126

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.00
▷ Minimum class complexity11.00
▷ Maximum class complexity33.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/banner-772x250.png44.73KB14.34KB▼ 67.93%