83% open-menu

Code Review | OpenMenu - The official plugin for OpenMenu

WordPress plugin OpenMenu - The official plugin for OpenMenu scored83%from 54 tests.

About plugin

  • Plugin page: open-menu
  • Plugin version: 3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 5, 2010
  • Latest release: Sep 24, 2020
  • Number of updates: 144
  • Update frequency: every 25.5 days
  • Top authors: OpenMenu (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /36,453 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.42MB] [CPU: ▼10.57ms] Passed 4 tests

This is a short check of server-side resources used by OpenMenu - The official plugin for OpenMenu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4641.88 ▲1.68
Dashboard /wp-admin3.78 ▲0.4348.74 ▼8.48
Posts /wp-admin/edit.php3.83 ▲0.4744.05 ▼13.80
Add New Post /wp-admin/post-new.php6.30 ▲0.4187.47 ▼21.66
Media Library /wp-admin/upload.php3.64 ▲0.4039.05 ▲6.10
Add New Menu /wp-admin/post-new.php?post_type=openmenu3.8350.48
OpenMenu /wp-admin/options-general.php?page=openmenu3.6033.80
OpenMenu /wp-admin/edit.php?post_type=openmenu3.6834.93
Cuisine Types /wp-admin/edit-tags.php?taxonomy=cuisine_type&post_type=openmenu3.6334.28

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 14 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_om-restaurant-location
widget_om-specials
widget_om-filter
widget_om-qrcode
widget_om-menu
widget_om-tagcloud
db_upgraded
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for OpenMenu - The official plugin for OpenMenu
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8614.35 ▲0.131.73 ▲0.0944.02 ▲0.87
Dashboard /wp-admin2,219 ▲455.58 ▲0.0190.30 ▲2.7675.16 ▲32.23
Posts /wp-admin/edit.php2,139 ▲422.03 ▲0.0133.99 ▼6.3033.22 ▼7.30
Add New Post /wp-admin/post-new.php1,568 ▲4218.66 ▼4.60701.87 ▲62.0555.74 ▼0.97
Media Library /wp-admin/upload.php1,439 ▲394.17 ▼0.0099.17 ▲2.4678.86 ▲32.97
Add New Menu /wp-admin/post-new.php?post_type=openmenu2,4497.59172.68107.21
OpenMenu /wp-admin/options-general.php?page=openmenu1,0092.1723.1028.70
OpenMenu /wp-admin/edit.php?post_type=openmenu1,1201.9331.6929.31
Cuisine Types /wp-admin/edit-tags.php?taxonomy=cuisine_type&post_type=openmenu1,3132.1226.0230.97

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
The following items require your attention
  • The uninstall procedure has failed, leaving 14 options in the database
    • theysaidso_admin_options
    • openmenu_options
    • db_upgraded
    • can_compress_scripts
    • widget_om-qrcode
    • widget_recent-posts
    • widget_om-tagcloud
    • widget_om-filter
    • widget_om-restaurant-location
    • widget_om-specials
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/open-menu/templates/default/single-openmenu.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/open-menu/templates/default/openmenu.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/open-menu/openmenu.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/open-menu/widgets.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (OpenMenu Overview), #2 (Adding/Editing a Menu), #3 (OpenMenu Options), #4 (Sample Rendered Menu), #5 (Powerful Widgets), #6 (Deals and Coupon Widget / Shortcode)
You can take inspiration from this readme.txt

open-menu/openmenu.php 85% from 13 tests

The entry point to "OpenMenu - The official plugin for OpenMenu" version 3.5 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 196 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("open-menu.php" instead of "openmenu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected2,925 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP86366972,852
CSS2241873

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity34.45
▷ Minimum class complexity2.00
▷ Maximum class complexity158.00
Average method complexity7.34
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods58
▷ Static methods00.00%
▷ Public methods4272.41%
▷ Protected methods712.07%
▷ Private methods915.52%
Functions70
▷ Named functions6390.00%
▷ Anonymous functions710.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.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
18 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/openmenu-32.png1.72KB1.33KB▼ 22.82%
templates/default/images/ico-32-restaurant.png1.38KB1.03KB▼ 25.28%
templates/default/images/peppers-2.png0.83KB0.71KB▼ 14.52%
templates/default/images/peppers-5.png0.84KB0.72KB▼ 14.75%
templates/default/images/ico-24-deal.png4.20KB1.38KB▼ 67.04%