84% tlp-food-menu

Code Review | Food Menu - Restaurant Menu & Online Ordering for WooCommerce

WordPress plugin Food Menu - Restaurant Menu & Online Ordering for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: tlp-food-menu
  • Plugin version: 5.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 1, 2015
  • Latest release: Nov 20, 2023
  • Number of updates: 113
  • Update frequency: every 26.4 days
  • Top authors: techlabpro1 (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

3,000+ active /73,019 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Food Menu - Restaurant Menu & Online Ordering for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.43 ▲0.9643.24 ▲2.72
Dashboard /wp-admin4.57 ▲1.2255.34 ▼11.89
Posts /wp-admin/edit.php4.62 ▲1.2659.65 ▲9.80
Add New Post /wp-admin/post-new.php7.10 ▲1.2196.25 ▲2.22
Media Library /wp-admin/upload.php4.43 ▲1.1947.69 ▲12.98
Get Help /wp-admin/edit.php?post_type=food-menu&page=rtfm_get_help4.4252.33
Settings /wp-admin/edit.php?post_type=food-menu&page=food_menu_settings5.0458.10
Add Food /wp-admin/post-new.php?post_type=food-menu4.7566.77
Shortcode Generator /wp-admin/edit.php?post_type=fmsc4.5650.29
All Foods /wp-admin/edit.php?post_type=food-menu4.5445.22
Categories /wp-admin/edit-tags.php?taxonomy=food-menu-cat&post_type=food-menu4.5543.97

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 132 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
rtfm_plugin_activation_time
can_compress_scripts
db_upgraded
widget_recent-comments
widget_widget_fmp
widget_recent-posts
tlp-food-menu-installed-version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Food Menu - Restaurant Menu & Online Ordering for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲13214.67 ▲0.321.60 ▼0.0537.64 ▼6.82
Dashboard /wp-admin2,276 ▲965.76 ▲0.0893.52 ▼5.7290.46 ▲43.89
Posts /wp-admin/edit.php2,187 ▲872.13 ▲0.1340.24 ▼1.3736.23 ▲0.91
Add New Post /wp-admin/post-new.php6,352 ▲4,82621.29 ▼1.85962.74 ▲346.03197.74 ▲132.11
Media Library /wp-admin/upload.php1,481 ▲874.16 ▼0.04107.31 ▲10.7690.58 ▲49.48
Get Help /wp-admin/edit.php?post_type=food-menu&page=rtfm_get_help1,7029.20319.6993.94
Settings /wp-admin/edit.php?post_type=food-menu&page=food_menu_settings1,9372.6158.1351.25
Add Food /wp-admin/post-new.php?post_type=food-menu2,5478.16200.26191.86
Shortcode Generator /wp-admin/edit.php?post_type=fmsc1,4673.7759.22103.13
All Foods /wp-admin/edit.php?post_type=food-menu1,2242.5338.9036.67
Categories /wp-admin/edit-tags.php?taxonomy=food-menu-cat&post_type=food-menu1,3582.2728.8039.31

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • tlp-food-menu-installed-version
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_widget_fmp
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • rtfm_plugin_activation_time

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 56× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/tlp-food-menu/app/Models/Fields.php
    • > /wp-content/plugins/tlp-food-menu/app/Controllers/Admin/Upgrade.php
    • > /wp-content/plugins/tlp-food-menu/templates/archive-food-menu-cat.php
    • > /wp-content/plugins/tlp-food-menu/app/Controllers/Admin/Metabox/PostMeta.php
    • > /wp-content/plugins/tlp-food-menu/app/Controllers/Admin/ShortcodeButton.php
    • > /wp-content/plugins/tlp-food-menu/app/Controllers/Admin/AdminColumns.php
    • > /wp-content/plugins/tlp-food-menu/app/Widgets/Elementor/Shortcodes.php
    • > /wp-content/plugins/tlp-food-menu/app/Helpers/Fns.php
    • > /wp-content/plugins/tlp-food-menu/app/Models/QueryArgs.php
    • > /wp-content/plugins/tlp-food-menu/app/Controllers/Admin/Ajax/Settings.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

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

The main file in "Food Menu - Restaurant Menu & Online Ordering for WooCommerce" v. 5.0.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
127 characters long description:
A Simple Food & Restaurant Menu Display Plugin for Restaurant, Cafes, Fast Food, Coffee House with WooCommerce Online Ordering.

Code Analysis 97% from 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 detected10,008 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
PHP661,9572,5989,924
JavaScript7211468
SVG7007
JSON1005
CSS4004

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 118)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity31.11
▷ Minimum class complexity1.00
▷ Maximum class complexity317.00
Average method complexity4.85
▷ Minimum method complexity1.00
▷ Maximum method complexity118.00
Code structure
Namespaces16
Interfaces0
Traits1
Classes43
▷ Abstract classes12.33%
▷ Concrete classes4297.67%
▷ Final classes12.38%
Methods339
▷ Static methods13138.64%
▷ Public methods24873.16%
▷ Protected methods339.73%
▷ Private methods5817.11%
Functions12
▷ Named functions325.00%
▷ Anonymous functions975.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
43 PNG files occupy 0.40MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/layouts/list-layout-4.png1.25KB1.25KB0.00%
assets/images/admin/client2.png32.73KB11.66KB▼ 64.37%
assets/images/layouts/grid-layout-3.png1.35KB1.35KB0.00%
assets/images/food-cart.png103.38KB34.33KB▼ 66.80%
assets/images/layouts/isotope-1.png1.01KB1.01KB0.00%