84% wp-restaurant-booking

Code Review | WP Restaurant Booking

WordPress plugin WP Restaurant Booking scored84%from 54 tests.

About plugin

  • Plugin page: wp-restaurant-boo...
  • Plugin version: 1.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 18, 2019
  • Latest release: Nov 13, 2023
  • Number of updates: 28
  • Update frequency: every 51.0 days
  • Top authors: ghera74 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /4,977 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.52MB] [CPU: ▼0.10ms] Passed 4 tests

This is a short check of server-side resources used by WP Restaurant Booking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5438.92 ▲2.19
Dashboard /wp-admin3.88 ▲0.5350.85 ▼7.99
Posts /wp-admin/edit.php3.94 ▲0.5853.82 ▲4.05
Add New Post /wp-admin/post-new.php6.41 ▲0.5188.37 ▲1.35
Media Library /wp-admin/upload.php3.74 ▲0.5141.28 ▲8.49

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 223 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WP Restaurant Booking
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,379 ▲63214.68 ▲0.3328.37 ▲26.7039.29 ▼1.04
Dashboard /wp-admin2,234 ▲545.61 ▼0.0692.97 ▲1.0738.40 ▼1.04
Posts /wp-admin/edit.php2,136 ▲362.00 ▲0.0340.39 ▼2.4437.17 ▲0.63
Add New Post /wp-admin/post-new.php1,557 ▲1322.93 ▼2.40595.14 ▼9.5355.01 ▼9.81
Media Library /wp-admin/upload.php1,436 ▲334.23 ▲0.02100.35 ▼4.3341.70 ▼1.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 15× 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 get_option() in wp-content/plugins/wp-restaurant-booking/includes/class-wprb-reservation-widget.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-restaurant-booking/includes/class-wprb-reservations.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/wp-restaurant-booking/includes/wprb-reservation-template.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-restaurant-booking/admin/wprb-set-notifications-template.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-restaurant-booking/admin/wprb-set-bookables-template.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-restaurant-booking/wp-restaurant-booking.php:49
    • > PHP Notice
      Undefined variable: admin in wp-content/plugins/wp-restaurant-booking/admin/wprb-set-tables-template.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-restaurant-booking/admin/wprb-set-closing-days-template.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-restaurant-booking/admin/class-wprb-admin.php:19
    • > PHP Fatal error
      Uncaught Error: Call to a member function display_rooms_tables_elements() on null in wp-content/plugins/wp-restaurant-booking/admin/wprb-set-tables-template.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-restaurant-booking/wp-restaurant-booking.php Passed 13 tests

Analyzing the main PHP file in "WP Restaurant Booking" version 1.1.9
75 characters long description:
A feature-rich and easy to use reservation system for bars and restaurants.

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
Success! There were no dangerous files found in this plugin44,617 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript706,0026,52723,920
SVG60139,194
CSS407222954,762
PHP241,4021,1382,912
HTML346651,941
Markdown61740603
Sass513828586
PO File1184258418
JSON700269
YAML13412

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity47.70
▷ Minimum class complexity1.00
▷ Maximum class complexity182.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods138
▷ Static methods4834.78%
▷ Public methods13497.10%
▷ Protected methods00.00%
▷ Private methods42.90%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
28 PNG files occupy 0.24MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/tzCheckbox/img/page_bg.png0.19KB0.26KB0.00%
js/tooltipster/doc/images/browser-safari.png12.14KB4.50KB▼ 62.90%
js/tooltipster/doc/js/jquery-ui-draggable/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
js/tooltipster/doc/images/pattern-navy.png116.28KB121.97KB0.00%
js/tooltipster/doc/images/browser-opera.png4.48KB2.03KB▼ 54.61%