67% mp-restaurant-menu

Code Review | Restaurant Menu and Food Ordering

WordPress plugin Restaurant Menu and Food Ordering scored67%from 54 tests.

About plugin

  • Plugin page: mp-restaurant-menu
  • Plugin version: 2.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Apr 4, 2016
  • Latest release: Apr 11, 2023
  • Number of updates: 81
  • Update frequency: every 32.0 days
  • Top authors: MotoPress (76.54%)jetmonsters (24.69%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /116,081 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
Install script ran successfully

Server metrics [RAM: ▲1.13MB] [CPU: ▲3.26ms] 75% from 4 tests

An overview of server-side resources used by Restaurant Menu and Food Ordering
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,498.68ms on /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-extensions)
PageMemory (MB)CPU Time (ms)
Home /4.39 ▲0.9342.53 ▼0.83
Dashboard /wp-admin4.51 ▲1.2153.42 ▲6.74
Posts /wp-admin/edit.php4.55 ▲1.2055.12 ▲7.11
Add New Post /wp-admin/post-new.php7.13 ▲1.2492.83 ▼0.00
Media Library /wp-admin/upload.php4.43 ▲1.2050.64 ▲17.61
Extensions /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-extensions4.641,498.68
Categories /wp-admin/edit-tags.php?taxonomy=mp_menu_category&post_type=mp_menu_item4.5151.54
Add New /wp-admin/post-new.php?post_type=mp_menu_item4.6663.07
Orders 0 /wp-admin/edit.php?post_type=mprm_order4.5148.63
Ingredients /wp-admin/edit-tags.php?taxonomy=mp_ingredient&post_type=mp_menu_item4.4244.92
Settings /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-settings4.5251.33
Customers /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-customers4.4445.83
Import / Export /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-import4.4543.57
Tags /wp-admin/edit-tags.php?taxonomy=mp_menu_tag&post_type=mp_menu_item4.4244.15
Menu Items /wp-admin/edit.php?post_type=mp_menu_item4.5149.32

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 283 new files
Database: 1 new table, 12 new options
New tables
wp_mprm_customer
New WordPress options
widget_mprm_menu_item
widget_mprm_category
theysaidso_admin_options
can_compress_scripts
widget_mprm_cart_widget
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
mprm_db_version
...

Browser metrics Passed 4 tests

An overview of browser requirements for Restaurant Menu and Food Ordering
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲22114.01 ▼0.575.33 ▲3.4039.22 ▼9.92
Dashboard /wp-admin2,266 ▲785.87 ▲0.93105.88 ▼3.0171.69 ▲21.87
Posts /wp-admin/edit.php2,155 ▲662.01 ▲0.0333.93 ▼6.4233.36 ▲0.05
Add New Post /wp-admin/post-new.php1,728 ▲19321.13 ▼2.14785.82 ▲107.4236.54 ▼21.56
Media Library /wp-admin/upload.php1,442 ▲544.22 ▲0.04105.27 ▲1.5244.26 ▲0.30
Extensions /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-extensions8872.0227.9033.17
Categories /wp-admin/edit-tags.php?taxonomy=mp_menu_category&post_type=mp_menu_item1,8033.1954.7182.03
Add New /wp-admin/post-new.php?post_type=mp_menu_item3,2177.65188.28137.39
Orders 0 /wp-admin/edit.php?post_type=mprm_order1,2472.0132.8732.99
Ingredients /wp-admin/edit-tags.php?taxonomy=mp_ingredient&post_type=mp_menu_item1,2972.1427.1030.97
Settings /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-settings1,2643.4646.1864.56
Customers /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-customers1,1011.7124.9527.86
Import / Export /wp-admin/edit.php?post_type=mp_menu_item&page=mprm-import8572.0627.0631.01
Tags /wp-admin/edit-tags.php?taxonomy=mp_menu_tag&post_type=mp_menu_item1,3002.1525.7432.15
Menu Items /wp-admin/edit.php?post_type=mp_menu_item1,2042.0232.8529.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_mprm_customer
  • Zombie WordPress options detected upon uninstall: 13 options
    • mprm_settings
    • widget_mprm_category
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_mprm_menu_item
    • theysaidso_admin_options
    • mprm_capabilities_version
    • widget_recent-posts
    • widget_mprm_cart_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/mp-restaurant-menu/templates/emails/menu-item-list.php
    • > /wp-content/plugins/mp-restaurant-menu/templates/emails/footer.php
    • > /wp-content/plugins/mp-restaurant-menu/templates/emails/body.php
    • > /wp-content/plugins/mp-restaurant-menu/admin/import/footer.php
    • > /wp-content/plugins/mp-restaurant-menu/templates/emails/body-default.php
  • 188× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\Core' not found in wp-content/plugins/mp-restaurant-menu/classes/class-controller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\Shortcodes' not found in wp-content/plugins/mp-restaurant-menu/classes/shortcodes/class-shortcode-item.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mp-restaurant-menu/admin/metaboxes/price.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/mp-restaurant-menu/templates/common/notice.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\Model' not found in wp-content/plugins/mp-restaurant-menu/classes/models/settings/class-settings-emails.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/mp-restaurant-menu/templates/shop/default_cc_address_fields.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\Core' not found in wp-content/plugins/mp-restaurant-menu/classes/class-model.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\Core' not found in wp-content/plugins/mp-restaurant-menu/classes/class-module.php:9
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/mp-restaurant-menu/templates/common/menu-item-image.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'mp_restaurant_menu\\classes\\models\\parents\\Parent_query' not found in wp-content/plugins/mp-restaurant-menu/classes/models/shop/class-payments.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 21 tag instead of maximum 10
  • Screenshots: Please describe screenshot #6 in mp-restaurant-menu/assets to your readme.txt
You can take inspiration from this readme.txt

mp-restaurant-menu/restaurant-menu.php 85% from 13 tests

The main PHP file in "Restaurant Menu and Food Ordering" ver. 2.4.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mp-restaurant-menu.php" instead of "restaurant-menu.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 168 characters long)

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin41,928 lines of code in 253 files:
LanguageFilesBlank linesComment linesLines of code
PHP2063,6328,21023,968
JavaScript141,7821,2677,786
CSS175271025,391
LESS12204322,544
PO File17791,0511,934
SVG200269
XML10036

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity37.16
▷ Minimum class complexity1.00
▷ Maximum class complexity249.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes79
▷ Abstract classes00.00%
▷ Concrete classes79100.00%
▷ Final classes22.53%
Methods999
▷ Static methods10210.21%
▷ Public methods92292.29%
▷ Protected methods111.10%
▷ Private methods666.61%
Functions300
▷ Named functions29999.67%
▷ Anonymous functions10.33%
Constants23
▷ Global constants2191.30%
▷ Class constants28.70%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/img/shortcode-icon.png0.33KB0.40KB0.00%
media/img/icons/iphone.png0.63KB0.70KB0.00%
media/img/close-icon.png0.28KB0.29KB0.00%
media/css/lib/chosen-sprite.png0.63KB0.88KB0.00%
media/img/icons/googlecheckout.png1.23KB1.31KB0.00%