84% menu-cache

Code Review | Menu Cache

WordPress plugin Menu Cache scored84%from 54 tests.

About plugin

  • Plugin page: menu-cache
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1+
  • WordPress version: 6.3.1
  • First release: Jan 5, 2015
  • Latest release: Dec 2, 2015
  • Number of updates: 4
  • Update frequency: every 82.8 days
  • Top authors: ryanhellyer (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /6,525 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.12MB] [CPU: ▼15.68ms] Passed 4 tests

Analyzing server-side resources used by Menu Cache
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▼0.0238.29 ▼15.79
Dashboard /wp-admin3.32 ▲0.0146.09 ▼7.01
Posts /wp-admin/edit.php3.37 ▼0.4848.03 ▼16.17
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.12 ▼23.75
Media Library /wp-admin/upload.php3.24 ▲0.0132.43 ▼3.23

Server storage [IO: ▲0.01MB] [DB: ▲0.07MB] 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
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Menu Cache: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.10 ▲0.161.65 ▼0.2543.27 ▼3.48
Dashboard /wp-admin2,195 ▲215.54 ▼0.1191.61 ▼18.1437.81 ▼9.03
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0537.40 ▼0.3835.44 ▼0.21
Add New Post /wp-admin/post-new.php1,526 ▼423.41 ▲0.30626.42 ▼43.9656.54 ▲3.03
Media Library /wp-admin/upload.php1,400 ▼34.15 ▼0.07108.55 ▲6.0441.23 ▼3.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/menu-cache/menu-cache.php:51
    • > PHP Warning
      Use of undefined constant HOUR_IN_SECONDS - assumed 'HOUR_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/menu-cache/menu-cache.php on line 183

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: cache, menu, wpnav, nav, navigation

menu-cache/menu-cache.php Passed 13 tests

"Menu Cache" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
33 characters long description:
Caches WordPress navigation menus

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 detected78 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1368166
PO File13212

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods888.89%
▷ Protected methods111.11%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin