84% different-menu-in-different-pages-and-posts

Code Review | Different Menu in Different Pages and Posts

WordPress plugin Different Menu in Different Pages and Posts scored84%from 54 tests.

About plugin

  • Plugin page: different-menu-in...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2022
  • Latest release: Nov 8, 2022
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: tusharknovator (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /221 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.06MB] [CPU: ▼5.86ms] Passed 4 tests

Analyzing server-side resources used by Different Menu in Different Pages and Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.46 ▼3.55
Dashboard /wp-admin3.36 ▲0.0248.03 ▼14.05
Posts /wp-admin/edit.php3.48 ▲0.1252.86 ▲2.61
Add New Post /wp-admin/post-new.php5.97 ▲0.0895.79 ▼5.81
Media Library /wp-admin/upload.php3.29 ▲0.0638.24 ▼0.04

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Different Menu in Different Pages and Posts: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲16613.42 ▼1.188.17 ▲6.5239.90 ▼11.77
Dashboard /wp-admin2,199 ▲195.58 ▼0.0292.74 ▼7.4644.08 ▲1.15
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0638.27 ▲3.1837.41 ▲0.21
Add New Post /wp-admin/post-new.php6,232 ▲4,70425.99 ▲3.06932.90 ▲283.6750.78 ▼12.60
Media Library /wp-admin/upload.php1,398 ▼54.11 ▼0.06104.33 ▼0.9447.41 ▲3.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/different-menu-in-different-pages-and-posts/admin/partials/different-menu-in-different-pages-and-posts-admin-display.php
    • > /wp-content/plugins/different-menu-in-different-pages-and-posts/public/partials/different-menu-in-different-pages-and-posts-public-display.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% 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:
  • Screenshots: Please add an image for screenshot #3 (Frontend Screen showing the chosen Menu)
The official readme.txt is a good inspiration

different-menu-in-different-pages-and-posts/different-menu-in-different-pages-and-posts.php Passed 13 tests

"Different Menu in Different Pages and Posts" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
88 characters long description:
This plugin gives you an option for showing the custom header menu for your post or page

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected219 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12120557213
JavaScript24546
CSS2080

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.57
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.41
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin