83% wp-nav-menu-cache

Code Review | WP Nav Menu Cache

WordPress plugin WP Nav Menu Cache scored83%from 54 tests.

About plugin

  • Plugin page: wp-nav-menu-cache
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 21, 2015
  • Latest release: Jan 18, 2023
  • Number of updates: 21
  • Update frequency: every 134.7 days
  • Top authors: onetarek (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /4,456 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by WP Nav Menu Cache
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1143.29 ▲2.70
Dashboard /wp-admin3.50 ▲0.2052.92 ▲2.54
Posts /wp-admin/edit.php3.55 ▲0.2049.87 ▲6.45
Add New Post /wp-admin/post-new.php5.99 ▲0.1193.38 ▼5.26
Media Library /wp-admin/upload.php3.34 ▲0.1136.20 ▲3.48
WP Nav Menu Cache /wp-admin/options-general.php?page=wp_nav_menu_cache3.3437.13

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
wp_nav_menu_cache
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP Nav Menu Cache: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,983 ▲24814.85 ▲0.462.00 ▲0.1444.01 ▼0.63
Dashboard /wp-admin2,364 ▲1736.62 ▲1.75118.07 ▲9.4335.96 ▼10.10
Posts /wp-admin/edit.php2,270 ▲1783.51 ▲1.5449.75 ▲10.9432.18 ▼1.06
Add New Post /wp-admin/post-new.php1,529 ▲1017.72 ▼5.62589.39 ▼98.6236.42 ▼21.79
Media Library /wp-admin/upload.php1,412 ▲244.41 ▲0.1982.49 ▼17.4842.06 ▼2.37
WP Nav Menu Cache /wp-admin/options-general.php?page=wp_nav_menu_cache1,0653.5650.1625.04

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • wp_nav_menu_cache
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× 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-menu-cache/class.settings-api.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-nav-menu-cache/class.settings-api.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

wp-nav-menu-cache/menu-cache.php 85% from 13 tests

The principal PHP file in "WP Nav Menu Cache" v. 2.2 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 153 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-nav-menu-cache.php" instead of "menu-cache.php")

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 detected496 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3168247496

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity24.67
▷ Minimum class complexity4.00
▷ Maximum class complexity50.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods40
▷ Static methods00.00%
▷ Public methods3997.50%
▷ Protected methods00.00%
▷ Private methods12.50%
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