84% menu-choice

Code Review | Menu Choice

WordPress plugin Menu Choice scored84%from 54 tests.

About plugin

  • Plugin page: menu-choice
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: May 12, 2017
  • Latest release: May 12, 2017
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: jake_white1230 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /753 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.70ms] Passed 4 tests

An overview of server-side resources used by Menu Choice
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0255.86 ▲13.82
Dashboard /wp-admin3.33 ▲0.0249.47 ▲0.11
Posts /wp-admin/edit.php3.38 ▲0.0252.03 ▲1.78
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.22 ▼9.45
Media Library /wp-admin/upload.php3.25 ▲0.0237.81 ▼3.25

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Menu Choice
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.37 ▼0.012.00 ▲0.3446.03 ▼0.57
Dashboard /wp-admin2,195 ▲215.55 ▼0.1187.15 ▼6.7641.01 ▲2.24
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0044.29 ▲6.6041.37 ▲4.76
Add New Post /wp-admin/post-new.php6,245 ▲4,71725.97 ▲2.83889.45 ▲206.6259.67 ▲7.37
Media Library /wp-admin/upload.php1,400 ▲64.19 ▼0.0597.04 ▼8.2142.43 ▼4.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_menu_choice_widget
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

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
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
  • 3× 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/menu-choice/inc/menu-choice-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-choice/inc/mc-meta-box.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-choice/inc/mc-meta-box.php:55

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Drag the 'Menu Choice' widget to the desired widget area.), #2 (Create the desired menu.), #3 (Select menu when editing page.)
You can look at the official readme.txt

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

Analyzing the main PHP file in "Menu Choice" version 1.0
41 characters long description:
Choose what menu gets displayed on a 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 detected98 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3222198

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.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
No PNG files were detected