57% fw-food-menu

Code Review | FW Food Menu - Responsive food menu with ordering & delivery solutions

WordPress plugin FW Food Menu - Responsive food menu with ordering & delivery solutions scored 57% from 54 tests.

About plugin

  • Plugin page: fw-food-menu
  • Plugin version: 4.7.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8.0
  • WordPress version: 6.3.1
  • First release: Mar 7, 2021
  • Latest release: Sep 23, 2021
  • Number of updates: 36
  • Update frequency: every 6.3 days
  • Top authors: fastw3b (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,277 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.14MB] [CPU: ▲3.60ms] Passed 4 tests

Server-side resources used by FW Food Menu - Responsive food menu with ordering & delivery solutions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.40 ▲0.9544.25 ▲4.65
Dashboard /wp-admin4.51 ▲1.2152.63 ▲0.68
Posts /wp-admin/edit.php4.56 ▲1.2155.86 ▲12.72
Add New Post /wp-admin/post-new.php7.09 ▲1.2192.90 ▼3.65
Media Library /wp-admin/upload.php4.43 ▲1.2144.87 ▲15.07
Add-ons /wp-admin/admin.php?page=fwfm-addon4.87226.87
Categories /wp-admin/admin.php?page=fwfm-category4.7740.95
Badges /wp-admin/admin.php?page=fwfm-badges4.6840.67
Settings /wp-admin/admin.php?page=fwfm-settings4.8439.56
Orders /wp-admin/admin.php?page=fwfm-orders4.6840.31
Translations /wp-admin/admin.php?page=fwfm-translation4.6537.39
CSS Styles /wp-admin/admin.php?page=fwfm-css4.8543.26
Meals /wp-admin/admin.php?page=fwfm-items4.7842.82
Data Management /wp-admin/admin.php?page=fwfm-data4.7438.77
Dashboard /wp-admin/admin.php?page=fwfm-menu5.02195.66

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 252 new files
Database: 14 new tables, 6 new options
New tables
wp_extensions
wp_fwfoodmenu_menu_price
wp_fwfoodmenu_order
wp_fwfoodmenu_menu_image
wp_fwfoodmenu_menu_badge
wp_fwfoodmenu_order_statuschage
wp_fwfoodmenu_menu
wp_fwfoodmenu_cart
wp_fwfoodmenu_menu_modificator
wp_fwfoodmenu_order_items
...
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

FW Food Menu - Responsive food menu with ordering & delivery solutions: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲15013.15 ▼1.285.15 ▲3.1942.37 ▼2.35
Dashboard /wp-admin2,251 ▲665.82 ▲0.95107.87 ▼6.7684.34 ▲40.91
Posts /wp-admin/edit.php2,149 ▲601.97 ▼0.0635.26 ▼1.8832.46 ▼2.10
Add New Post /wp-admin/post-new.php1,566 ▲5222.15 ▲4.63787.69 ▲187.3257.00 ▼2.09
Media Library /wp-admin/upload.php1,439 ▲514.17 ▼0.0298.69 ▲5.3371.41 ▲29.91
Add-ons /wp-admin/admin.php?page=fwfm-addon2,4082.5686.0697.97
Categories /wp-admin/admin.php?page=fwfm-category2,8823.0790.8350.46
Badges /wp-admin/admin.php?page=fwfm-badges2,3332.6575.7854.67
Settings /wp-admin/admin.php?page=fwfm-settings4,1664.51169.4772.30
Orders /wp-admin/admin.php?page=fwfm-orders2,0972.4464.2541.40
Translations /wp-admin/admin.php?page=fwfm-translation3,7343.0892.3991.65
CSS Styles /wp-admin/admin.php?page=fwfm-css7,0279.20250.57159.88
Meals /wp-admin/admin.php?page=fwfm-items2,8763.0787.1246.87
Data Management /wp-admin/admin.php?page=fwfm-data2,6172.7685.6362.59
Dashboard /wp-admin/admin.php?page=fwfm-menu2,7932.5381.64104.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall successfully, leaving 14 tables in the database
    • wp_fwfoodmenu_order
    • wp_fwfoodmenu_menu_badge
    • wp_fwfoodmenu_menu_price
    • wp_fwfoodmenu_cart
    • wp_fwfoodmenu_menu_modificator_group
    • wp_extensions
    • wp_fwfoodmenu_category
    • wp_fwfoodmenu_menu_modificator
    • wp_fwfoodmenu_menu_image
    • wp_fwfoodmenu_order_items
    • ...
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 25 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fwfm-menu
    • > Notice in wp-content/plugins/fw-food-menu/admin/helpers/fwfcategory.php+220
    Undefined offset: 0
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=fwfm-translation
    • > Notice in wp-content/plugins/fw-food-menu/admin/views/translation/tmpl/default.php+94
    Trying to get property 'tag' of non-object
    • > GET request to /wp-admin/admin.php?page=fwfm-translation
    • > Notice in wp-content/plugins/fw-food-menu/admin/views/translation/tmpl/default.php+94
    Undefined index: en-US

SRP 0% 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
Please fix the following items
  • 88× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/fw-food-menu/admin/views/category/view.json.php
    • > /wp-content/plugins/fw-food-menu/site/models/menu.php
    • > /wp-content/plugins/fw-food-menu/admin/layouts/utilites/quick_categories.php
    • > /wp-content/plugins/fw-food-menu/admin/models/items.php
    • > /wp-content/plugins/fw-food-menu/admin/views/items/view.json.php
    • > /wp-content/plugins/fw-food-menu/admin/tables/order.php
    • > /wp-content/plugins/fw-food-menu/site/layouts/common/menu/subcategoryitem.php
    • > /wp-content/plugins/fw-food-menu/admin/views/category/tmpl/edit.php
    • > /wp-content/plugins/fw-food-menu/site/helpers/fwfoodmenufields.php
    • > /wp-content/plugins/fw-food-menu/admin/helpers/fwview.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_sql() in wp-content/plugins/fw-food-menu/helpers/connector.php:85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/fw-food-menu/fw-food-menu.php:13
    • > PHP Warning
      Use of undefined constant FWFM_DIR - assumed 'FWFM_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/fw-food-menu/helpers/connector.php on line 3202

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=fwfm-settings
    • > Console-api (warning) in unknown
    https://maps.google.com/maps/api/js?key&ver=6.3.1 208:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/admin.php?page=fwfm-settings
    • > Console-api (warning) in unknown
    https://maps.google.com/maps/api/js?key&ver=6.3.1 139:373 "google.maps.event.addDomListener() is deprecated, use the standard\naddEventListener() method instead:\nhttps://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener\nThe feature will continue to work and there is no plan to decommission\nit."

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: food ordering, cafe menu, food menu, food delivery, restaurant menu

fw-food-menu/fw-food-menu.php Passed 13 tests

"FW Food Menu - Responsive food menu with ordering & delivery solutions" version 4.7.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
16 characters long description:
Food Menu plugin

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
No dangerous file extensions were detected86,318 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
SVG502052,246
PHP10099587516,124
CSS131,46521214,137
JavaScript193581,0862,453
INI64201,168
XML510151
SQL11037
HTML2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity18.77
▷ Minimum class complexity1.00
▷ Maximum class complexity244.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes108
▷ Abstract classes00.00%
▷ Concrete classes108100.00%
▷ Final classes00.00%
Methods560
▷ Static methods20736.96%
▷ Public methods55899.64%
▷ Protected methods20.36%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants30
▷ Global constants30100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.15MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/utensils.png2.53KB0.96KB▼ 62.31%
media/jui/img/alpha.png0.43KB1.68KB0.00%
admin/assets/images/icon_fw_food_menu_200.png24.57KB10.08KB▼ 58.99%
media/jui/img/glyphicons-halflings.png12.30KB10.35KB▼ 15.88%
site/assets/images/saturation.png3.93KB5.13KB0.00%