68% menu-item-scheduler

Code Review | Menu Item Scheduler

WordPress plugin Menu Item Scheduler scored 68% from 54 tests.

About plugin

  • Plugin page: menu-item-scheduler
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6.38+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 5.9.2
  • First release: Feb 28, 2020
  • Latest release: Mar 3, 2020
  • Number of updates: 13
  • Update frequency: every 0.3 days
  • Top authors: ahmed17 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 329 total downloads

Benchmarks

Plugin footprint 65% 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: ▲4.31MB] [CPU: ▼277.92ms] 75% from 4 tests

Analyzing server-side resources used by Menu Item Scheduler
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,687.00ms on /wp-admin/admin.php?page=menu-item-scheduler)
PageMemory (MB)CPU Time (ms)
Home /8.27 ▲4.7580.77 ▲23.28
Dashboard /wp-admin8.28 ▲4.8766.48 ▲29.62
Posts /wp-admin/edit.php8.28 ▲4.6461.66 ▲16.60
Add New Post /wp-admin/post-new.php9.96 ▲2.99122.38 ▼1,160.46
Media Library /wp-admin/upload.php8.28 ▲4.9846.25 ▲8.89
Menu Item - Scheduler /wp-admin/admin.php?page=menu-item-scheduler8.281,687.00
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius8.2849.65

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 181 new files
Database: no new tables, 4 new options
New WordPress options
fs_active_plugins
fs_accounts
fs_gdpr
fs_debug_mode

Browser metrics Passed 4 tests

Menu Item Scheduler: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲8416.01 ▲0.025.83 ▲0.082.13 ▼0.17
Dashboard /wp-admin2,943 ▲856.19 ▲0.08125.86 ▼19.88170.32 ▲4.29
Posts /wp-admin/edit.php2,742 ▲583.27 ▲0.0365.98 ▲1.87155.73 ▲11.87
Add New Post /wp-admin/post-new.php1,713 ▼3921.95 ▲0.75418.87 ▼28.83156.04 ▼0.38
Media Library /wp-admin/upload.php1,752 ▲545.61 ▲0.18150.25 ▼1.32210.15 ▲11.79
Menu Item - Scheduler /wp-admin/admin.php?page=menu-item-scheduler1,2982.5454.76172.97
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius1,4392.7656.35119.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 without warnings or errors
    • > Notice in wp-content/plugins/menu-item-scheduler/freemius/includes/class-freemius.php+8218
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 4 options
    • fs_accounts
    • fs_debug_mode
    • fs_active_plugins
    • fs_gdpr

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/menu-item-scheduler/freemius/templates/ajax-loader.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/menu-item-scheduler/edit-walker-nav-menu.php:11
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/menu-item-scheduler/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/menu-item-scheduler/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/menu-item-scheduler/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/menu-item-scheduler/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/menu-item-scheduler/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/menu-item-scheduler/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-item-scheduler/menu-item-scheduler.php:20
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/menu-item-scheduler/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/menu-item-scheduler/freemius/templates/account/partials/addon.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: nav menu item, redirect, datetime, menu item scheduler, hide...

menu-item-scheduler/menu-item-scheduler.php Passed 13 tests

Analyzing the main PHP file in "Menu Item Scheduler" version 1.0.0
62 characters long description:
Redirect or Hide/show specific menu item for scheduled period.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin45,710 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1097,15015,98130,041
PO File126,9608,45515,240
JavaScript43459195
Markdown1610192
JSON10027
CSS120015

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,772)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity83.83
▷ Minimum class complexity1.00
▷ Maximum class complexity2,772.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes24.26%
▷ Concrete classes4595.74%
▷ Final classes00.00%
Methods1,132
▷ Static methods17315.28%
▷ Public methods79269.96%
▷ Protected methods151.33%
▷ Private methods32528.71%
Functions102
▷ Named functions102100.00%
▷ Anonymous functions00.00%
Constants122
▷ Global constants9779.51%
▷ Class constants2520.49%
▷ Public constants25100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%