67% restaurant-reservations

Code Review | Five Star Restaurant Reservations - WordPress Booking Plugin

WordPress plugin Five Star Restaurant Reservations - WordPress Booking Plugin scored67%from 54 tests.

About plugin

  • Plugin page: restaurant-reserv...
  • Plugin version: 2.6.15
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 8, 2014
  • Latest release: Nov 7, 2023
  • Number of updates: 264
  • Update frequency: every 13.1 days
  • Top authors: Rustaurius (54.55%)NateWr (45.83%)

Code review

54 tests

User reviews

175 reviews

Install metrics

10,000+ active /834,897 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.54MB] [CPU: ▲16.47ms] Passed 4 tests

A check of server-side resources used by Five Star Restaurant Reservations - WordPress Booking Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /6.83 ▲3.3760.64 ▲17.69
Dashboard /wp-admin6.89 ▲3.5975.34 ▲24.13
Posts /wp-admin/edit.php6.94 ▲3.5878.01 ▲26.87
Add New Post /wp-admin/post-new.php9.58 ▲3.70101.89 ▼2.83
Media Library /wp-admin/upload.php6.83 ▲3.6066.32 ▲31.43
Dashboard /wp-admin/admin.php?page=rtb-dashboard6.7859.62
Five-Star Restaurant Reservations - Welcome! /wp-admin/index.php?page=rtb-getting-started6.7860.54
About Us /wp-admin/admin.php?page=rtb-about-us6.7758.27
Custom Fields /wp-admin/admin.php?page=cffrtb-editor6.7658.55
Settings /wp-admin/admin.php?page=rtb-settings6.9164.86
Bookings /wp-admin/admin.php?page=rtb-bookings7.1182.77

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 1,123 new files
Database: no new tables, 11 new options
New WordPress options
widget_rtb_booking_form_widget
rtb-installation-time
rtb-permission-level
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
rtb-version
rtb_pending_count
db_upgraded
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Five Star Restaurant Reservations - WordPress Booking Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲7214.37 ▲0.031.60 ▼0.0939.56 ▼5.33
Dashboard /wp-admin2,239 ▲625.57 ▲0.0784.53 ▼19.1840.49 ▼4.72
Posts /wp-admin/edit.php2,147 ▲472.03 ▲0.0238.02 ▲1.7433.50 ▼3.01
Add New Post /wp-admin/post-new.php1,529 ▲321.55 ▼1.61695.13 ▼1.8737.51 ▼15.49
Media Library /wp-admin/upload.php1,441 ▲414.33 ▲0.13100.34 ▼0.5841.04 ▼2.28
Dashboard /wp-admin/admin.php?page=rtb-dashboard1,3522.0533.9670.08
Five-Star Restaurant Reservations - Welcome! /wp-admin/index.php?page=rtb-getting-started2,1152.2728.4034.09
About Us /wp-admin/admin.php?page=rtb-about-us1,5352.0530.9833.27
Custom Fields /wp-admin/admin.php?page=cffrtb-editor1,2482.0035.0539.45
Settings /wp-admin/admin.php?page=rtb-settings1,83310.10296.4039.61
Bookings /wp-admin/admin.php?page=rtb-bookings4,3133.8475.85102.62

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 11 options
    • can_compress_scripts
    • rtb-installation-time
    • widget_rtb_booking_form_widget
    • rtb-version
    • widget_theysaidso_widget
    • db_upgraded
    • rtb-permission-level
    • widget_recent-posts
    • theysaidso_admin_options
    • rtb_pending_count
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 13× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/includes/framework.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/examples/parseicalendar.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/includes/timezone.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/includes/date.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/examples/recurringdate.php
    • > /wp-content/plugins/restaurant-reservations/lib/stripe/update_certs.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/includes/recurringdate.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/includes/ical.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/examples/timezoneevent.php
    • > /wp-content/plugins/restaurant-reservations/lib/zapcal/examples/simpleevent.php
  • 436× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/restaurant-reservations/lib/mpdf/vendor/mpdf/mpdf/src/Barcode/Codabar.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'sapAdminPageSetting_2_6_18' not found in wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'sapAdminPageSetting_2_6_18' not found in wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/restaurant-reservations/lib/mpdf/vendor/setasign/fpdi/src/PdfParser/Type/PdfDictionary.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/restaurant-reservations/lib/mpdf/vendor/mpdf/mpdf/src/Tag/S.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/restaurant-reservations/lib/mpdf/vendor/mpdf/mpdf/src/Tag/Bdo.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/restaurant-reservations/lib/stripe/lib/Exception/CardException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/restaurant-reservations/lib/mpdf/vendor/mpdf/mpdf/src/Tag/Acronym.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/restaurant-reservations/lib/stripe/lib/TransferReversal.php:36
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Util\\LoggerInterface' not found in wp-content/plugins/restaurant-reservations/lib/stripe/lib/Util/DefaultLogger.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Tags: Please delete some tags, you are using 28 tag instead of maximum 10
Please take inspiration from this readme.txt

restaurant-reservations/restaurant-reservations.php 92% from 13 tests

Analyzing the main PHP file in "Five Star Restaurant Reservations - WordPress Booking Plugin" version 2.6.15
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 152 characters long)

Code Analysis 0% from 3 tests

File types 0% from 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
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/restaurant-reservations/lib/stripe/data/ca-certificates.crt
177,973 lines of code in 872 files:
LanguageFilesBlank linesComment linesLines of code
PHP71919,25139,254147,860
PO File134,0655,10413,535
JavaScript801,7831,0067,236
CSS286242606,996
Markdown1255701,646
JSON11320548
XML411093
YAML311350
HTML1006
Bourne Shell1203

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 7,007)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity45.52
▷ Minimum class complexity1.00
▷ Maximum class complexity7,007.00
Average method complexity8.84
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces64
Interfaces17
Traits13
Classes578
▷ Abstract classes223.81%
▷ Concrete classes55696.19%
▷ Final classes132.34%
Methods3,448
▷ Static methods42912.44%
▷ Public methods2,89483.93%
▷ Protected methods36110.47%
▷ Private methods1935.60%
Functions94
▷ Named functions5861.70%
▷ Anonymous functions3638.30%
Constants1,255
▷ Global constants12810.20%
▷ Class constants1,12789.80%
▷ Public constants1,127100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
43 PNG files occupy 1.54MB with 0.97MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/fivestartextlogo.png16.97KB7.38KB▼ 56.50%
assets/img/dash-asset-badge.png33.32KB10.39KB▼ 68.80%
assets/img/ewd-support-icon-forum.png5.77KB2.17KB▼ 62.41%
assets/img/options-asset-star.png0.78KB0.32KB▼ 58.92%
assets/img/premium-screenshots/export.png71.65KB23.06KB▼ 67.82%