84% wp-nav-plus

Code Review | WP Nav Plus

WordPress plugin WP Nav Plus scored 84% from 54 tests.

About plugin

  • Plugin page: wp-nav-plus
  • Plugin version: 3.4.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Sep 4, 2017
  • Latest release: Feb 7, 2022
  • Number of updates: 16
  • Update frequency: every 101.1 days
  • Top authors: mattkeys (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active / 13,270 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.78ms] Passed 4 tests

A check of server-side resources used by WP Nav Plus
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1441.99 ▼6.51
Dashboard /wp-admin3.43 ▲0.1244.16 ▼9.17
Posts /wp-admin/edit.php3.55 ▲0.2045.26 ▼3.11
Add New Post /wp-admin/post-new.php6.01 ▲0.1293.07 ▼4.33
Media Library /wp-admin/upload.php3.35 ▲0.1239.48 ▲6.22

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_nav_plus_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Nav Plus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.45 ▲0.221.63 ▼0.0641.46 ▲2.12
Dashboard /wp-admin2,206 ▲214.81 ▼0.11107.82 ▼3.7537.84 ▼6.61
Posts /wp-admin/edit.php2,092 ▲32.14 ▲0.1437.81 ▼3.5534.49 ▼1.31
Add New Post /wp-admin/post-new.php1,547 ▲2818.46 ▼4.84633.46 ▼22.9682.90 ▲31.45
Media Library /wp-admin/upload.php1,388 ▼04.16 ▼0.0396.51 ▲1.9742.08 ▲1.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_nav_plus_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-nav-plus/feature_classes/limit_offset.php:109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-nav-plus/wp-nav-plus.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-nav-plus/feature_classes/divided_menu.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-nav-plus/feature_classes/menu_segment.php:81
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-nav-plus/feature_classes/start_depth.php:342
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-nav-plus/widget.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: tertiary menu, start depth, divided menu, secondary menu, split menu

wp-nav-plus/wp-nav-plus.php 92% from 13 tests

The principal PHP file in "WP Nav Plus" v. 3.4.9 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 186 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,386 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP718576715
HTML1802344
CSS42031295
JavaScript19032

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity28.80
▷ Minimum class complexity10.00
▷ Maximum class complexity67.00
Average method complexity5.48
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods31
▷ Static methods13.23%
▷ Public methods2167.74%
▷ Protected methods00.00%
▷ Private methods1032.26%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
6 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
documentation/assets/images/wp_nav_plus_widget_split_menu.png21.01KB8.62KB▼ 58.97%
documentation/assets/images/wp_nav_plus_widget_segment_menu.png28.31KB7.98KB▼ 71.80%
documentation/assets/images/wp_nav_plus_widget_lo_menu.png19.11KB7.74KB▼ 59.50%
documentation/assets/images/wp_nav_plus_widget_divided_menu.png30.13KB11.51KB▼ 61.80%
documentation/assets/images/wp_nav_plus_multiple_widgets.png45.75KB13.12KB▼ 71.32%