78% quick-restaurant-menu

Code Review | Quick Restaurant Menu

WordPress plugin Quick Restaurant Menu scored78%from 54 tests.

About plugin

  • Plugin page: quick-restaurant-...
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0.2
  • WordPress version: 6.3.1
  • First release: May 30, 2015
  • Latest release: Jan 20, 2023
  • Number of updates: 61
  • Update frequency: every 45.8 days
  • Top authors: AlejandroPascual (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

3,000+ active /65,797 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.87ms] Passed 4 tests

A check of server-side resources used by Quick Restaurant Menu
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.94 ▲5.85
Dashboard /wp-admin3.39 ▲0.0450.71 ▼12.78
Posts /wp-admin/edit.php3.50 ▲0.1445.99 ▲0.21
Add New Post /wp-admin/post-new.php5.98 ▲0.0987.82 ▼16.75
Media Library /wp-admin/upload.php3.31 ▲0.0844.75 ▲7.56
All Menu Items /wp-admin/edit.php?post_type=erm_menu_item3.3534.26
Add New Menu /wp-admin/post-new.php?post_type=erm_menu3.4651.94
All Menus /wp-admin/edit.php?post_type=erm_menu3.3541.83
Settings /wp-admin/edit.php?post_type=erm_menu&page=erm_settings3.2833.57

Server storage [IO: ▲3.41MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 47 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
erm_settings
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Quick Restaurant Menu
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.24 ▼0.521.77 ▲0.0243.46 ▲2.87
Dashboard /wp-admin2,233 ▲535.65 ▲0.0290.25 ▲0.4538.92 ▼2.35
Posts /wp-admin/edit.php2,135 ▲351.95 ▼0.0035.85 ▼2.5332.03 ▼5.67
Add New Post /wp-admin/post-new.php1,555 ▲2723.30 ▲0.23679.86 ▲5.7252.09 ▼11.37
Media Library /wp-admin/upload.php1,435 ▲384.26 ▲0.08103.87 ▼8.5445.89 ▼1.14
All Menu Items /wp-admin/edit.php?post_type=erm_menu_item1,1121.9732.1333.74
Add New Menu /wp-admin/post-new.php?post_type=erm_menu2,6039.92239.4378.17
All Menus /wp-admin/edit.php?post_type=erm_menu1,1121.9029.4530.37
Settings /wp-admin/edit.php?post_type=erm_menu&page=erm_settings9032.0224.0823.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • erm_settings
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/quick-restaurant-menu/includes/admin/erm_menu_week/metabox-menu-week.php
  • 21× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/quick-restaurant-menu/includes/template-functions.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/quick-restaurant-menu/templates/menu-item-section.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quick-restaurant-menu/includes/scripts-front.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/quick-restaurant-menu/templates/menu-footer.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/quick-restaurant-menu/includes/misc-functions.php:81
    • > PHP Warning
      require(ERM_PLUGIN_DIRassets/js/erm_menu/index.html): failed to open stream: No such file or directory in wp-content/plugins/quick-restaurant-menu/includes/admin/erm_menu/metabox-menu-vite.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/quick-restaurant-menu/templates/menu-header.php:3
    • > PHP Warning
      Use of undefined constant ERM_PLUGIN_DIR - assumed 'ERM_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/quick-restaurant-menu/includes/admin/erm_menu/metabox-menu-vite.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/quick-restaurant-menu/templates/menu-item-product.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/quick-restaurant-menu/includes/admin/settings/settings.php:431

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: food, cafe, restaurant menu, dining, restaurant...

quick-restaurant-menu/quick-restaurant-menu.php 77% from 13 tests

The main file in "Quick Restaurant Menu" v. 2.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin24,868 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,8603,58822,007
PHP294095821,424
CSS45791975
PO File2192198458
JSON1004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity17.00
▷ Minimum class complexity3.00
▷ Maximum class complexity56.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods45
▷ Static methods12.22%
▷ Public methods4293.33%
▷ Protected methods00.00%
▷ Private methods36.67%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png7.28KB1.56KB▼ 78.62%