78% quick-restaurant-reservations

Code Review | Quick Restaurant Reservations

WordPress plugin Quick Restaurant Reservations scored78%from 54 tests.

About plugin

  • Plugin page: quick-restaurant-...
  • Plugin version: 1.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2
  • WordPress version: 6.3.1
  • First release: Nov 28, 2017
  • Latest release: Apr 2, 2023
  • Number of updates: 80
  • Update frequency: every 24.6 days
  • Top authors: AlejandroPascual (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /22,605 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼2.11ms] Passed 4 tests

Analyzing server-side resources used by Quick Restaurant Reservations
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1147.05 ▲1.57
Dashboard /wp-admin3.45 ▲0.1554.16 ▲2.41
Posts /wp-admin/edit.php3.57 ▲0.2152.17 ▲2.84
Add New Post /wp-admin/post-new.php6.06 ▲0.1794.93 ▼7.93
Media Library /wp-admin/upload.php3.37 ▲0.1432.82 ▼4.48
Settings /wp-admin/edit.php?post_type=qrr_booking&page=qrr-settings3.3435.20
Create Booking /wp-admin/edit.php?post_type=qrr_booking&page=qrr_create_booking3.3738.24
All Bookings /wp-admin/edit.php?post_type=qrr_booking3.4339.88
Restaurants /wp-admin/edit.php?post_type=qrr_restaurant3.4240.65
Clients /wp-admin/edit.php?post_type=qrr_client3.4235.37
Add-ons /wp-admin/edit.php?post_type=qrr_booking&page=qrr-addons3.3834.36

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 178 new files
Database: no new tables, 7 new options
New WordPress options
qrr_settings
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Quick Restaurant Reservations: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲8313.18 ▼1.161.72 ▼0.1744.04 ▲1.95
Dashboard /wp-admin2,251 ▲635.86 ▲0.98103.02 ▼5.1541.20 ▼3.05
Posts /wp-admin/edit.php2,137 ▲512.06 ▲0.0237.47 ▲0.9035.37 ▼1.53
Add New Post /wp-admin/post-new.php1,551 ▲3117.61 ▼5.63693.58 ▲4.7859.18 ▼0.39
Media Library /wp-admin/upload.php1,436 ▲484.21 ▲0.0996.59 ▼19.5846.50 ▼2.00
Settings /wp-admin/edit.php?post_type=qrr_booking&page=qrr-settings9302.0527.6936.05
Create Booking /wp-admin/edit.php?post_type=qrr_booking&page=qrr_create_booking8612.0527.3432.74
All Bookings /wp-admin/edit.php?post_type=qrr_booking1,3362.3936.6535.76
Restaurants /wp-admin/edit.php?post_type=qrr_restaurant1,1631.9432.7335.46
Clients /wp-admin/edit.php?post_type=qrr_client1,1511.9331.9338.37
Add-ons /wp-admin/edit.php?post_type=qrr_booking&page=qrr-addons1,0772.0126.6464.78

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • qrr_settings

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-email-admin.php
    • > /wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-email-admin_confirmed.php
    • > /wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-email-pending.php
    • > /wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-email-confirmed.php
    • > /wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-email-rejected.php
  • 14× 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 wp_enqueue_script() in wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-fields.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quick-restaurant-reservations/includes/banner.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-notifications.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/quick-restaurant-reservations/includes/admin/settings/settings.php:494
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-components.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function QRR_Active_plugin() in wp-content/plugins/quick-restaurant-reservations/includes/admin/template-addons/addon-fields.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/quick-restaurant-reservations/includes/admin/templates/template-email-tags.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function QRR_Active_plugin() in wp-content/plugins/quick-restaurant-reservations/includes/admin/template-addons/addon-capacity.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quick-restaurant-reservations/includes/admin/settings/class-settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/quick-restaurant-reservations/quick-restaurant-reservations.php:116

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: restaurant reservations, bookings, table bookings, restaurant, reservations

quick-restaurant-reservations/quick-restaurant-reservations.php 77% from 13 tests

The primary PHP file in "Quick Restaurant Reservations" version 1.6.7 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path must begin with a forward slash character ("/languages")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")

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
Everything looks great! No dangerous files found in this plugin30,219 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript723,0522,60715,526
PHP501,9868966,225
CSS232825045,047
PO File37659472,136
LESS4180114657
SVG201609
Markdown29019

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity29.45
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes14.55%
Methods248
▷ Static methods72.82%
▷ Public methods23996.37%
▷ Protected methods00.00%
▷ Private methods93.63%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.21MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/libs/ionrangeslider/img/sprite-skin-simple.png0.35KB0.35KB▼ 0.84%
assets/libs/ionrangeslider/img/sprite-skin-modern.png0.49KB0.49KB0.00%
assets/libs/ionrangeslider/img/sprite-skin-nice.png0.68KB0.71KB0.00%
assets/libs/ionrangeslider/img/sprite-skin-flat-green.png3.28KB0.27KB▼ 91.79%
assets/libs/ionrangeslider/img/sprite-skin-flat.png3.35KB0.34KB▼ 89.97%