78% wp-food-manager

Code Review | WP Food Manager – Restaurant Menu & Online Food Ordering for WooCommerce - Food Delivery & Pickup - Table Reservation

WordPress plugin WP Food Manager – Restaurant Menu & Online Food Ordering for WooCommerce - Food Delivery & Pickup - Table Reservation scored 78% from 54 tests.

About plugin

  • Plugin page: wp-food-manager
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 31, 2021
  • Latest release: Sep 19, 2023
  • Number of updates: 22
  • Update frequency: every 50.1 days
  • Top authors: wpeventmanager (59.09%)ashokdudhat (27.27%)hiteshmakvana (22.73%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,022 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.67MB] [CPU: ▲9.49ms] Passed 4 tests

Analyzing server-side resources used by WP Food Manager – Restaurant Menu & Online Food Ordering for WooCommerce - Food Delivery & Pickup - Table Reservation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.92 ▲1.4551.61 ▲9.06
Dashboard /wp-admin5.02 ▲1.7162.63 ▲12.42
Posts /wp-admin/edit.php5.14 ▲1.7867.07 ▲11.41
Add New Post /wp-admin/post-new.php7.98 ▲2.09107.68 ▲5.06
Media Library /wp-admin/upload.php4.96 ▲1.7265.21 ▲30.56
Ingredients /wp-admin/edit-tags.php?taxonomy=food_manager_ingredient&post_type=food_manager4.9857.45
Toppings /wp-admin/edit-tags.php?taxonomy=food_manager_topping&post_type=food_manager4.9863.31
Types /wp-admin/edit-tags.php?taxonomy=food_manager_type&post_type=food_manager5.0057.55
Tags /wp-admin/edit-tags.php?taxonomy=food_manager_tag&post_type=food_manager4.9651.00
Add Food /wp-admin/post-new.php?post_type=food_manager5.5290.56
Setup /wp-admin/index.php?page=food_manager_setup4.9357.98
Settings /wp-admin/edit.php?post_type=food_manager&page=food-manager-settings4.9553.33
Categories /wp-admin/edit-tags.php?taxonomy=food_manager_category&post_type=food_manager5.0057.35
All Foods /wp-admin/edit.php?post_type=food_manager5.0555.53
Menus /wp-admin/edit.php?post_type=food_manager_menu5.0350.54

Server storage [IO: ▲2.99MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 179 new files
Database: no new tables, 38 new options
New WordPress options
wpfm_price_num_decimals
food_manager_food_dashboard_page_id
food_manager_unit_children
wpfm_price_decimal_sep
food_manager_enable_food_types
food_manager_enable_default_food_menu_multiselect
wpfm_currency_pos
food_manager_ingredient_children
food_manager_enable_registration
food_manager_nutrition_children
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Food Manager – Restaurant Menu & Online Food Ordering for WooCommerce - Food Delivery & Pickup - Table Reservation
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,261 ▲52617.25 ▲2.8918.99 ▲16.6536.80 ▼13.01
Dashboard /wp-admin2,304 ▲1226.81 ▲1.88116.89 ▲3.05102.30 ▲59.84
Posts /wp-admin/edit.php2,361 ▲2723.55 ▲1.5550.67 ▲8.9536.74 ▼0.47
Add New Post /wp-admin/post-new.php1,755 ▲24122.87 ▲5.34776.85 ▲144.4437.63 ▼14.51
Media Library /wp-admin/upload.php1,642 ▲2575.35 ▲1.10121.92 ▲16.37103.23 ▲54.65
Ingredients /wp-admin/edit-tags.php?taxonomy=food_manager_ingredient&post_type=food_manager2,0423.5662.6493.70
Toppings /wp-admin/edit-tags.php?taxonomy=food_manager_topping&post_type=food_manager2,0813.5742.7376.84
Types /wp-admin/edit-tags.php?taxonomy=food_manager_type&post_type=food_manager1,9404.7556.6597.22
Tags /wp-admin/edit-tags.php?taxonomy=food_manager_tag&post_type=food_manager1,5113.4540.8960.67
Add Food /wp-admin/post-new.php?post_type=food_manager3,2867.88206.24172.72
Setup /wp-admin/index.php?page=food_manager_setup1,1063.3341.0846.61
Settings /wp-admin/edit.php?post_type=food_manager&page=food-manager-settings2,5463.4147.6969.21
Categories /wp-admin/edit-tags.php?taxonomy=food_manager_category&post_type=food_manager2,0514.8554.0698.35
All Foods /wp-admin/edit.php?post_type=food_manager1,4643.7447.5559.59
Menus /wp-admin/edit.php?post_type=food_manager_menu1,3463.6344.0458.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 18 options in the database
    • widget_recent-posts
    • wpfm_currency
    • food_manager_nutrition_children
    • can_compress_scripts
    • widget_recent-comments
    • food_manager_registration_role
    • wpfm_price_decimal_sep
    • food_manager_type_children
    • food_manager_ingredient_children
    • food_manager_category_children
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-food-manager/templates/food-listings-end.php
  • 65× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-food-manager/templates/form-fields/checkbox-field.php on line 11
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/wp-food-manager/templates/form-fields/radio-field.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpfm_begnWith() in wp-content/plugins/wp-food-manager/templates/form-fields/textarea-field.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_post_thumbnail_url() in wp-content/plugins/wp-food-manager/templates/content-single-food_manager_menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_object_taxonomies() in wp-content/plugins/wp-food-manager/admin/wpfm-field-editor-group-form-field.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-food-manager/templates/food-submitted.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-food-manager/templates/form-fields/text-field.php:30
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-food-manager/templates/form-fields/button-options-field.php on line 17
    • > PHP Notice
      Undefined variable: child_index in wp-content/plugins/wp-food-manager/admin/wpfm-field-editor-group-form-field.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/wp-food-manager/templates/form-fields/term-multiselect-field.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

wp-food-manager/wp-food-manager.php 92% from 13 tests

The entry point to "WP Food Manager – Restaurant Menu & Online Food Ordering for WooCommerce - Food Delivery & Pickup - Table Reservation" version 1.0.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected26,969 lines of code in 153 files:
LanguageFilesBlank linesComment linesLines of code
PHP791,2063,36611,371
CSS188561307,599
JavaScript383,5839316,574
SVG13191,002
Sass2275262
LESS1115152
Ruby1208
JSON1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity47.64
▷ Minimum class complexity1.00
▷ Maximum class complexity324.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes00.00%
Methods248
▷ Static methods6425.81%
▷ Public methods20883.87%
▷ Protected methods187.26%
▷ Private methods228.87%
Functions92
▷ Named functions8895.65%
▷ Anonymous functions44.35%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ 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 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/jquery-ui/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/support-page-sprites-img.png6.58KB6.21KB▼ 5.55%
assets/images/organizer.png2.99KB1.53KB▼ 48.79%
assets/images/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
assets/images/wpfm-non-veg-organic.png0.44KB0.33KB▼ 24.67%