74% my-bootstrap-menu

Code Review | My Bootstrap Menu

WordPress plugin My Bootstrap Menu scored74%from 54 tests.

About plugin

  • Plugin page: my-bootstrap-menu
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.5
  • WordPress version: 6.3.1
  • First release: Jul 7, 2015
  • Latest release: May 31, 2017
  • Number of updates: 59
  • Update frequency: every 11.8 days
  • Top authors: codetoolbox (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active /35,311 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
Installer ran successfully

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

Analyzing server-side resources used by My Bootstrap Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0047.74 ▲6.66
Dashboard /wp-admin3.31 ▲0.0048.41 ▼8.43
Posts /wp-admin/edit.php3.36 ▲0.0050.74 ▲1.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.54 ▼24.82
Media Library /wp-admin/upload.php3.23 ▲0.0034.22 ▼3.23

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 67 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Bootstrap Menu
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.42 ▲0.072.07 ▲0.4543.90 ▲5.44
Dashboard /wp-admin2,198 ▲205.64 ▲0.0297.32 ▼13.7638.56 ▼8.98
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0337.44 ▲2.0334.11 ▼2.64
Add New Post /wp-admin/post-new.php1,526 ▼523.33 ▲0.68634.00 ▼26.9258.69 ▼1.03
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.0299.69 ▼4.4644.51 ▼3.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/my-bootstrap-menu/assets/my-plugin-settings-helper/my-plugin-installer.php+104
    array_keys() expects parameter 1 to be array, bool given
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/my-bootstrap-menu/inc/nav-menu/nav-menu-walker.php:17
    • > PHP Fatal error
      require_once(): Failed opening required 'MY_BOOTSTRAP_MENU_PLUGIN_ASSETS/my-plugin-settings-helper/my-plugin-installer.php' (include_path='.:/usr/share/php') in wp-content/plugins/my-bootstrap-menu/my-bootstrap-menu-installer.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'My_Bootstrap_Menu_Plugin_Namespace\\My_Plugin_Settings_Base' not found in wp-content/plugins/my-bootstrap-menu/assets/my-plugin-settings-helper/inc/my-plugin-settings-public.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'My_Bootstrap_Menu_Plugin_Namespace\\My_Plugin_Public' not found in wp-content/plugins/my-bootstrap-menu/inc/my-bootstrap-menu-public.php:15
    • > PHP Warning
      require_once(MY_BOOTSTRAP_MENU_PLUGIN_ASSETS/my-plugin-settings-helper/my-plugin-installer.php): failed to open stream: No such file or directory in wp-content/plugins/my-bootstrap-menu/my-bootstrap-menu-installer.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'My_Bootstrap_Menu_Plugin_Namespace\\My_Plugin_Settings_Base' not found in wp-content/plugins/my-bootstrap-menu/assets/my-plugin-settings-helper/inc/my-plugin-settings-admin.php:15
    • > PHP Warning
      Use of undefined constant MY_BOOTSTRAP_MENU_PLUGIN_ASSETS - assumed 'MY_BOOTSTRAP_MENU_PLUGIN_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/my-bootstrap-menu/my-bootstrap-menu-installer.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'My_Bootstrap_Menu_Plugin_Namespace\\My_Plugin_Settings_Admin' not found in wp-content/plugins/my-bootstrap-menu/inc/my-bootstrap-menu-admin-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'My_Bootstrap_Menu_Plugin_Namespace\\My_Plugin_Admin' not found in wp-content/plugins/my-bootstrap-menu/inc/my-bootstrap-menu-admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function My_Bootstrap_Menu_Plugin_Namespace\\plugins_url() in wp-content/plugins/my-bootstrap-menu/my-bootstrap-menu.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (20 tag instead of maximum 10)
The official readme.txt might help

my-bootstrap-menu/my-bootstrap-menu.php Passed 13 tests

The main PHP script in "My Bootstrap Menu" version 1.2.1 is automatically included on every request by WordPress
96 characters long description:
Boostraps a menu using flexible and easy to use settings. Fully customizable for advanced users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin13,791 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
CSS10231398,478
PHP246821,3162,861
JavaScript96803811,852
SVG100288
LESS24067174
Markdown1340138

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.40
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes25
▷ Abstract classes1040.00%
▷ Concrete classes1560.00%
▷ Final classes00.00%
Methods176
▷ Static methods5430.68%
▷ Public methods12168.75%
▷ Protected methods10.57%
▷ Private methods5430.68%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants65
▷ Global constants1421.54%
▷ Class constants5178.46%
▷ Public constants51100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
inc/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
inc/img/mcl_logo_small.png13.08KB7.78KB▼ 40.49%