72% wp-food

Code Review | WP Food ordering and Restaurant Menu

WordPress plugin WP Food ordering and Restaurant Menu scored72%from 54 tests.

About plugin

  • Plugin page: wp-food
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 8, 2019
  • Latest release: Oct 29, 2021
  • Number of updates: 10
  • Update frequency: every 85.7 days
  • Top authors: exthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /4,332 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.43MB] [CPU: ▼1.66ms] Passed 4 tests

An overview of server-side resources used by WP Food ordering and Restaurant Menu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2047.25 ▼0.39
Dashboard /wp-admin3.81 ▲0.5153.09 ▲3.02
Posts /wp-admin/edit.php3.86 ▲0.5054.17 ▲4.59
Add New Post /wp-admin/post-new.php6.43 ▲0.5591.82 ▼13.00
Media Library /wp-admin/upload.php3.74 ▲0.5140.11 ▲3.75
Help /wp-admin/edit.php?post_type=ex_food&page=exfd_helps3.7435.70
/wp-admin/edit.php?post_type=ex_food&page=exfood_js_css_file_options4.1141.70
Stores /wp-admin/edit.php?post_type=exfood_store3.7841.18
Locations /wp-admin/edit-tags.php?taxonomy=exfood_loc&post_type=ex_food3.7341.05
Orders /wp-admin/edit.php?post_type=exfood_order3.7841.92
Settings /wp-admin/edit.php?post_type=ex_food&page=exfood_options3.9649.43
Menus /wp-admin/edit-tags.php?taxonomy=exfood_cat&post_type=ex_food3.7942.92
Food /wp-admin/edit.php?post_type=ex_food3.7845.28
Add New Food /wp-admin/post-new.php?post_type=ex_food4.1359.00
Shortcodes builder /wp-admin/edit.php?post_type=exfood_scbd3.7843.99

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 401 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_ex-widget

Browser metrics Passed 4 tests

WP Food ordering and Restaurant Menu: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,119 ▲35813.49 ▼0.8611.36 ▲9.5244.79 ▼0.28
Dashboard /wp-admin2,280 ▲1035.71 ▲0.0087.18 ▼2.8839.17 ▼8.90
Posts /wp-admin/edit.php2,188 ▲882.08 ▲0.0643.43 ▲4.2736.68 ▲1.12
Add New Post /wp-admin/post-new.php1,596 ▲6823.30 ▲0.26663.34 ▼9.1565.97 ▲10.42
Media Library /wp-admin/upload.php1,488 ▲884.29 ▲0.1799.21 ▼9.4143.49 ▼2.91
Help /wp-admin/edit.php?post_type=ex_food&page=exfd_helps1,1802.1326.0272.68
/wp-admin/edit.php?post_type=ex_food&page=exfood_js_css_file_options9202.1630.2324.48
Stores /wp-admin/edit.php?post_type=exfood_store1,1602.0135.1331.21
Locations /wp-admin/edit-tags.php?taxonomy=exfood_loc&post_type=ex_food1,3642.3230.3428.97
Orders /wp-admin/edit.php?post_type=exfood_order1,1682.0240.0528.21
Settings /wp-admin/edit.php?post_type=ex_food&page=exfood_options2,2694.0784.7128.00
Menus /wp-admin/edit-tags.php?taxonomy=exfood_cat&post_type=ex_food1,6373.2744.2525.71
Food /wp-admin/edit.php?post_type=ex_food1,1852.0534.6333.01
Add New Food /wp-admin/post-new.php?post_type=ex_food3,2758.08194.6695.37
Shortcodes builder /wp-admin/edit.php?post_type=exfood_scbd1,1682.0034.6432.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_ex-widget
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=exfood_loc&post_type=ex_food
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-food/admin/exfd-help.php
  • 61× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function EX_WPFood_customlink() in wp-content/plugins/wp-food/templates/content-shortcodes/content-list-1.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-food/admin/inc/cmb2/init.php:126
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/wp-food/admin/inc/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/wp-food/admin/inc/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/wp-food/admin/inc/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-food/inc/shortcodes/wp-food-mini-cart.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-food/inc/class-buildin-ordering-food.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/wp-food/admin/inc/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/wp-food/admin/inc/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/wp-food/admin/inc/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt might help

wp-food/ex-food.php 85% from 13 tests

The main PHP file in "WP Food ordering and Restaurant Menu" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-food.php" instead of "ex-food.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin61,451 lines of code in 247 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP812,2916,40512,092
CSS211,2851,2276,759
JavaScript121,2085924,104
XML322483,021
SVG3132,101
Markdown32150633
Sass2275260
LESS1135150
Ruby1208

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity18.74
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes74
▷ Abstract classes810.81%
▷ Concrete classes6689.19%
▷ Final classes00.00%
Methods565
▷ Static methods8715.40%
▷ Public methods47383.72%
▷ Protected methods8915.75%
▷ Private methods30.53%
Functions109
▷ Named functions10899.08%
▷ Anonymous functions10.92%
Constants15
▷ Global constants746.67%
▷ Class constants853.33%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/icon-dropdow.png1.06KB0.20KB▼ 81.58%
js/zoomico.png0.25KB0.25KB0.00%
admin/inc/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
admin/inc/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
admin/inc/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%