83% wp-better-sub-menus

Code Review | WP Better Sub Menus

WordPress plugin WP Better Sub Menus scored83%from 54 tests.

About plugin

  • Plugin page: wp-better-sub-menus
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2018
  • Latest release: Feb 1, 2023
  • Number of updates: 16
  • Update frequency: every 98.0 days
  • Top authors: adrianifero (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /700 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼9.35ms] Passed 4 tests

This is a short check of server-side resources used by WP Better Sub Menus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.91 ▲0.29
Dashboard /wp-admin3.31 ▼0.0346.12 ▼10.61
Posts /wp-admin/edit.php3.36 ▲0.0142.91 ▼15.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.81 ▼9.78
Media Library /wp-admin/upload.php3.23 ▲0.0135.37 ▼1.60

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

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

Browser metrics Passed 4 tests

WP Better Sub Menus: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.40 ▲0.402.17 ▲0.2845.10 ▲4.17
Dashboard /wp-admin2,195 ▲185.63 ▲0.0190.30 ▼3.0639.94 ▼0.75
Posts /wp-admin/edit.php2,097 ▼61.97 ▼0.0240.26 ▲1.3634.56 ▲3.33
Add New Post /wp-admin/post-new.php1,535 ▲718.22 ▼4.87611.66 ▼22.1574.13 ▼9.29
Media Library /wp-admin/upload.php1,397 ▼04.17 ▲0.06101.18 ▼1.8944.24 ▼2.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-better-sub-menus/wp_better_submenus.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === wp-better-sub-menus === )
You can take inspiration from this readme.txt

wp-better-sub-menus/wp_better_submenus.php 77% from 13 tests

The main PHP script in "WP Better Sub Menus" version 1.0.5 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-better-sub-menus.php" instead of "wp_better_submenus.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected122 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS17255
JavaScript130954
PHP111913

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods150.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
There are no PNG files in this plugin