72% wp-cafe

Code Review | WPCafe - Restaurant Menu, Online Ordering for WooCommerce, Pickup / Delivery and Table Reservation

WordPress plugin WPCafe - Restaurant Menu, Online Ordering for WooCommerce, Pickup / Delivery and Table Reservation scored72%from 54 tests.

About plugin

  • Plugin page: wp-cafe
  • Plugin version: 2.2.19
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.2
  • WordPress version: 6.3.1
  • First release: May 21, 2020
  • Latest release: Nov 5, 2023
  • Number of updates: 139
  • Update frequency: every 9.2 days
  • Top authors: themewinter (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

7,000+ active /140,178 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.21MB] [CPU: ▲8.54ms] Passed 4 tests

Analyzing server-side resources used by WPCafe - Restaurant Menu, Online Ordering for WooCommerce, Pickup / Delivery and Table Reservation
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.46 ▲0.9953.36 ▲14.31
Dashboard /wp-admin4.59 ▲1.2565.02 ▲2.90
Posts /wp-admin/edit.php4.72 ▲1.3660.83 ▲11.87
Add New Post /wp-admin/post-new.php7.24 ▲1.3594.80 ▲6.32
Media Library /wp-admin/upload.php4.49 ▲1.2650.38 ▲13.06
Reservation List /wp-admin/edit.php?post_type=wpc_reservation4.6354.90
Dashboard /wp-admin/admin.php?page=cafe_menu4.6049.62
Settings /wp-admin/admin.php?page=cafe_settings5.1555.62
Available Shortcodes /wp-admin/admin.php?page=wpc_shortcode4.7546.81
Get Help /wp-admin/admin.php?page=wpcafe_get_help4.5147.40
Tools /wp-admin/admin.php?page=wpc_tools4.6944.60

Server storage [IO: ▲2.73MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 128 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
wpcafe_convert_date_time_format_from_wp
widget_theysaidso_widget
wp-cafe__banner_last_check
wpc_format_booking_date
wp-cafe__banner_data
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WPCafe - Restaurant Menu, Online Ordering for WooCommerce, Pickup / Delivery and Table Reservation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,038 ▲25113.87 ▼0.3917.77 ▲15.9541.90 ▼2.76
Dashboard /wp-admin2,289 ▲1185.62 ▼0.0399.05 ▼3.3775.65 ▲31.82
Posts /wp-admin/edit.php2,252 ▲1523.10 ▲1.1651.75 ▲16.4951.73 ▲16.43
Add New Post /wp-admin/post-new.php6,309 ▲4,78326.87 ▲4.131,020.61 ▲351.5040.49 ▼12.85
Media Library /wp-admin/upload.php1,491 ▲944.19 ▼0.0399.92 ▼14.4476.52 ▲28.50
Reservation List /wp-admin/edit.php?post_type=wpc_reservation1,3133.2144.5269.18
Dashboard /wp-admin/admin.php?page=cafe_menu1,4233.6880.7944.81
Settings /wp-admin/admin.php?page=cafe_settings4,79711.19300.8066.51
Available Shortcodes /wp-admin/admin.php?page=wpc_shortcode2,0372.8840.2039.12
Get Help /wp-admin/admin.php?page=wpcafe_get_help1,0612.8234.4434.23
Tools /wp-admin/admin.php?page=wpc_tools1,1151.8227.8443.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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
  • The uninstall procedure has failed, leaving 10 options in the database
    • wp-cafe__banner_data
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • wpcafe_convert_date_time_format_from_wp
    • widget_recent-posts
    • wp-cafe__banner_last_check
    • wpc_format_booking_date
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-cafe/core/shortcodes/views/reservation/reservation-detials.php
  • 60× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-cafe/core/settings/part/app-banner.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Wpcafe' not found in wp-content/plugins/wp-cafe/core/settings/layout/header.php:5
    • > PHP Notice
      Undefined variable: show_thumbnail in wp-content/plugins/wp-cafe/widgets/wpc-food-menu-tab/style/style-1.php on line 4
    • > PHP Notice
      Undefined variable: show_thumbnail in wp-content/plugins/wp-cafe/widgets/wpc-food-menu-tab/style/style-1.php on line 4
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/wp-cafe/core/shortcodes/views/food-menu/food-list.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-cafe/core/shortcodes/views/food-menu/food-list.php on line 17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-cafe/core/shortcodes/views/food-menu/food-list.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-cafe/core/shortcodes/views/food-menu/location-search.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Wpcafe' not found in wp-content/plugins/wp-cafe/core/shortcodes/views/reservation/form-settings.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-cafe/core/settings/part/languages.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=cafe_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=cafe_settings 1125 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=cafe_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=cafe_settings 1134 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: multivendor, restaurant, food menu, food ordering

wp-cafe/wpcafe.php 85% from 13 tests

The primary PHP file in "WPCafe - Restaurant Menu, Online Ordering for WooCommerce, Pickup / Delivery and Table Reservation" version 2.2.19 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-cafe.php" instead of "wpcafe.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
No dangerous file extensions were detected49,285 lines of code in 110 files:
LanguageFilesBlank linesComment linesLines of code
CSS133,19521524,341
PHP652,1151,45712,448
Sass7803769,443
JavaScript176484382,976
SVG80177

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity32.11
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces23
Interfaces0
Traits1
Classes37
▷ Abstract classes38.11%
▷ Concrete classes3491.89%
▷ Final classes25.88%
Methods334
▷ Static methods7622.75%
▷ Public methods30089.82%
▷ Protected methods247.19%
▷ Private methods102.99%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 0.31MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/curve_left.png0.22KB0.21KB▼ 3.52%
utils/pro-awareness/assets/community.png5.51KB2.64KB▼ 52.03%
utils/pro-awareness/assets/support.png4.80KB2.68KB▼ 44.22%
assets/images/reservation_image.png290.11KB120.59KB▼ 58.43%
assets/images/curve_right.png0.22KB0.21KB▼ 6.96%