68% custom-menu-class

Code Review | Custom Menu Class

WordPress plugin Custom Menu Class scored68%from 54 tests.

About plugin

  • Plugin page: custom-menu-class
  • Plugin version: 0.2.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.5
  • WordPress version: 6.3.1
  • First release: Jun 3, 2015
  • Latest release: Apr 25, 2016
  • Number of updates: 47
  • Update frequency: every 7.0 days
  • Top authors: Aiken1 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

500+ active /10,534 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.91MB] [CPU: ▼42.53ms] Passed 4 tests

This is a short check of server-side resources used by Custom Menu Class
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2643.10 ▲2.29
Dashboard /wp-admin3.04 ▼0.2720.71 ▼40.70
Posts /wp-admin/edit.php3.04 ▼0.3219.70 ▼37.80
Add New Post /wp-admin/post-new.php3.04 ▼2.8520.40 ▼78.86
Media Library /wp-admin/upload.php3.04 ▼0.1923.15 ▼12.76
Menu CSS Classes /wp-admin/edit.php?post_type=cmc_classes3.0421.76

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

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

Browser metrics Passed 4 tests

Custom Menu Class: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6414.64 ▲0.372.04 ▲0.1046.15 ▼2.23
Dashboard /wp-admin2,213 ▲224.88 ▼0.02105.20 ▼6.2040.74 ▼4.17
Posts /wp-admin/edit.php2,096 ▲42.04 ▲0.0141.45 ▲1.6933.67 ▼2.04
Add New Post /wp-admin/post-new.php1,543 ▲2923.42 ▲5.94738.60 ▲106.4658.13 ▲11.12
Media Library /wp-admin/upload.php1,395 ▲74.23 ▼0.05115.43 ▲1.4450.84 ▲8.77
Menu CSS Classes /wp-admin/edit.php?post_type=cmc_classes1,0351.9635.4430.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/custom-menu-class/custom-menu-class.php+37
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=cmc_classes
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/custom-menu-class/custom-menu-class.php+37
    Function create_function() is deprecated

SRP 50% 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
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/nav-menu.php): failed to open stream: No such file or directory in wp-content/plugins/custom-menu-class/custom-menu-class.php on line 131
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-menu-class/custom-menu-class.php on line 131
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/nav-menu.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-menu-class/custom-menu-class.php on line 131
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-menu-class/classes.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% 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: Add an image for screenshot #1 (Here's a screenshot of it in action)
Please take inspiration from this readme.txt

custom-menu-class/custom-menu-class.php Passed 13 tests

"Custom Menu Class" version 0.2.6.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
43 characters long description:
Select predefined CSS classes to menu items

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin206 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24645206

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity6.33
▷ Minimum class complexity2.00
▷ Maximum class complexity15.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods8
▷ Static methods675.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin