84% sf-bootstrap-menu

Code Review | SF Bootstrap Menu

WordPress plugin SF Bootstrap Menu scored 84% from 54 tests.

About plugin

  • Plugin page: sf-bootstrap-menu
  • Plugin version: 2.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.1
  • WordPress version: 5.9.2
  • First release: Sep 10, 2015
  • Latest release: Mar 23, 2018
  • Number of updates: 25
  • Update frequency: every 37.0 days
  • Top authors: Studiofreya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 3,483 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼307.99ms] Passed 4 tests

An overview of server-side resources used by SF Bootstrap Menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0859.29 ▲4.41
Dashboard /wp-admin3.42 ▲0.0235.53 ▼52.79
Posts /wp-admin/edit.php3.65 ▲0.0244.32 ▲1.09
Add New Post /wp-admin/post-new.php6.89 ▼0.0899.34 ▼1,179.33
Media Library /wp-admin/upload.php3.31 ▲0.0128.93 ▼0.91

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 1 new option
New WordPress options
widget_sfmenu

Browser metrics Passed 4 tests

A check of browser resources used by SF Bootstrap Menu
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,878 ▲12416.27 ▲0.6311.28 ▲5.332.37 ▼0.60
Dashboard /wp-admin2,892 ▲316.18 ▲0.07141.97 ▲6.81173.84 ▲13.65
Posts /wp-admin/edit.php2,657 ▼273.24 ▼0.0162.04 ▼26.02135.63 ▼17.37
Add New Post /wp-admin/post-new.php1,661 ▼016.93 ▲1.05403.99 ▼29.72158.78 ▼22.36
Media Library /wp-admin/upload.php1,698 ▼05.51 ▲0.02135.53 ▼8.76231.70 ▲49.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_sfmenu

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Page' not found in wp-content/plugins/sf-bootstrap-menu/sf-navwalker.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Page' not found in wp-content/plugins/sf-bootstrap-menu/sf-navwalker-horizontal.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sf-bootstrap-menu/sf-menu-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sf-bootstrap-menu/sf-menu.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: top, menu, horizontal, list, pages...

sf-bootstrap-menu/sf-menu.php 92% from 13 tests

The main PHP file in "SF Bootstrap Menu" ver. 2.4.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sf-bootstrap-menu.php" instead of "sf-menu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,816 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
SVG2318231,005
PHP414599621
CSS4277173
PO File10015
JavaScript1052

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity38.67
▷ Minimum class complexity19.00
▷ Maximum class complexity76.00
Average method complexity6.14
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected