10% admin-menu-creator

Code Review | Admin Menu

WordPress plugin Admin Menu scored 10% from 54 tests.

About plugin

  • Plugin page: admin-menu-creator
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 5.8.1
  • First release: Jul 3, 2018
  • Latest release: Jul 3, 2018
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: pixeltoweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 370 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/admin-menu-creator/class.function.php+10
    Undefined index: page

Server metrics [RAM: ▼1.81MB] [CPU: ▼184.82ms] Passed 4 tests

This is a short check of server-side resources used by Admin Menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0131.31 ▼3.17
Dashboard /wp-admin1.84 ▼1.226.58 ▼35.27
Posts /wp-admin/edit.php1.84 ▼1.276.08 ▼36.08
Add New Post /wp-admin/post-new.php1.84 ▼3.595.52 ▼643.68
Media Library /wp-admin/upload.php1.84 ▼1.165.78 ▼24.23
Wp Admin Help /wp-admin/admin.php?page=admin-menu-help2.7920.35
Wp Admin Menu /wp-admin/admin.php?page=admin-menu-listing2.7920.75

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Admin Menu
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲20015.81 ▲0.3210.30 ▲0.6046.79 ▼1.52
Dashboard /wp-admin3,047 ▲1136.20 ▲0.23140.32 ▲0.62113.24 ▲1.97
Posts /wp-admin/edit.php2,842 ▲1032.72 ▲0.0066.31 ▲4.6998.10 ▲13.50
Add New Post /wp-admin/post-new.php1,668 ▲6421.03 ▲2.59274.37 ▼102.86159.95 ▲44.89
Media Library /wp-admin/upload.php1,909 ▲995.05 ▲0.03125.41 ▼22.89107.25 ▼11.40
Wp Admin Help /wp-admin/admin.php?page=admin-menu-help1,6192.1053.13118.77
Wp Admin Menu /wp-admin/admin.php?page=admin-menu-listing1,3362.0857.0978.81

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/admin-menu-creator/class.function.php+10
    Undefined index: page

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method AMC_Function::wcamc_custom_admin_menu() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method AMC_Function::wcamc_menu_adminscripts() should not be called statically
    • > GET request to /wp-admin/admin.php?page=admin-menu-help
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method AMC_Function::wcamc_menuHelp() should not be called statically
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method AMC_Function::wcamc_menu_listing() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Notice in wp-content/plugins/admin-menu-creator/class.function.php+172
    Undefined index: original_publish
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Notice in wp-content/plugins/admin-menu-creator/class.function.php+203
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Notice in wp-content/plugins/admin-menu-creator/class.function.php+192
    Undefined index: action2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Notice in wp-content/plugins/admin-menu-creator/admin/admin_menu_listing_details.php+32
    Undefined variable: adminMenuArray
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Warning in wp-content/plugins/admin-menu-creator/admin/admin_menu_listing_details.php+119
    usort() expects parameter 1 to be array, null given
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Warning in wp-content/plugins/admin-menu-creator/admin/admin_menu_listing_details.php+121
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Warning in wp-content/plugins/admin-menu-creator/admin/admin_menu_listing_details.php+122
    array_slice() expects parameter 1 to be array, null given
    • > GET request to /wp-admin/admin.php?page=admin-menu-listing
    • > Notice in wp-content/plugins/admin-menu-creator/admin/admin_menu_listing_details.php+137
    Undefined variable: message

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/admin-menu-creator/help.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/admin-menu-creator/admin/admin_menu_listing_details.php:8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/admin-menu-creator/class.function.php:10
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/admin-menu-creator/admin/edit_menu.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/admin-menu-creator/help.php:137
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/admin-menu-creator/adminmenucreator.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=admin-menu-help
    • > Network (severe)
    wp-content/plugins/AdminMenuCreator/screenshots/Admin_Menu_Add_New.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=admin-menu-help
    • > Network (severe)
    wp-content/plugins/AdminMenuCreator/screenshots/Admin_Select_Option.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=admin-menu-help
    • > Network (severe)
    wp-content/plugins/AdminMenuCreator/screenshots/Admin_Menu_With_Data.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=admin-menu-help
    • > Network (severe)
    wp-content/plugins/AdminMenuCreator/screenshots/Admin_Menu_Listing.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=admin-menu-help
    • > Network (severe)
    wp-content/plugins/AdminMenuCreator/screenshots/Admin_Menu_Display.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=admin-menu-help
    • > Network (severe)
    wp-content/plugins/AdminMenuCreator/screenshots/Admin_Menu_Help.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Screenshot #6 (Admin_Menu_Help) image not found
You can take inspiration from this readme.txt

admin-menu-creator/adminmenucreator.php 92% from 13 tests

The entry point to "Admin Menu" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("admin-menu-creator.php" instead of "adminmenucreator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin905 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP64949708
JavaScript112899
CSS23498

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.00
▷ Minimum class complexity4.00
▷ Maximum class complexity16.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods414.81%
▷ Public methods2592.59%
▷ Protected methods00.00%
▷ Private methods27.41%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.69MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshots/Admin_Select_Option.png136.84KB43.03KB▼ 68.56%
screenshots/Admin_Menu_With_Data.png102.20KB30.34KB▼ 70.31%
screenshots/Admin_Menu_Help.png196.94KB87.09KB▼ 55.78%
screenshots/Admin_Menu_Display.png94.73KB28.40KB▼ 70.02%
screenshots/Admin_Menu_Listing.png94.37KB26.88KB▼ 71.52%