83% restaurant-bookings

Code Review | Restaurant Bookings

WordPress plugin Restaurant Bookings scored83%from 54 tests.

About plugin

  • Plugin page: restaurant-bookings
  • Plugin version: 2.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.3
  • WordPress version: 6.3.1
  • First release: May 23, 2012
  • Latest release: Nov 5, 2022
  • Number of updates: 48
  • Update frequency: every 86.1 days
  • Top authors: moz667 (77.08%)listaedvlp (18.75%)chitez (8.33%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,262 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.04MB] [CPU: ▲2.68ms] Passed 4 tests

Server-side resources used by Restaurant Bookings
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.66 ▲2.2052.74 ▲16.66
Dashboard /wp-admin5.35 ▲2.0153.52 ▼4.86
Posts /wp-admin/edit.php5.40 ▲2.0559.51 ▲9.22
Add New Post /wp-admin/post-new.php7.95 ▲2.0789.61 ▼10.32
Media Library /wp-admin/upload.php5.27 ▲2.0549.87 ▲16.85
Restaurant Bookings /wp-admin/options-general.php?page=rbk-options5.1842.29

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Restaurant Bookings
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲95713.65 ▼0.791.77 ▲0.1040.42 ▼0.48
Dashboard /wp-admin2,246 ▲545.06 ▲0.08101.99 ▼3.4036.06 ▼7.45
Posts /wp-admin/edit.php2,129 ▲402.03 ▲0.0235.98 ▼7.6231.45 ▼5.16
Add New Post /wp-admin/post-new.php1,560 ▲4623.08 ▲5.59697.52 ▲20.2461.13 ▲9.22
Media Library /wp-admin/upload.php1,428 ▲404.26 ▲0.0698.05 ▲3.7241.21 ▼4.04
Restaurant Bookings /wp-admin/options-general.php?page=rbk-options1,1132.0325.5775.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 154× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/Review.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/Phone.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/DeliveryCfg.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/DiningArea.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/CategoryFilterRoot.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/vendor/guzzlehttp/promises/src/Promise.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/ItemField.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/EasyTimeRanges.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Listae\\Client\\Model\\ModelInterface' not found in wp-content/plugins/restaurant-bookings/inc/ae-api/lib/Model/OrderCfg.php:42

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 75% 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 your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === restaurant-bookings === )
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
  • Screenshots: Please add an image for screenshot #1 (Detail of insertion of content from Listae in a post)
  • Screenshots: Please add descriptions for these screenshots #5, #6, #7 in restaurant-bookings/assets to your readme.txt
The official readme.txt is a good inspiration

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

The main PHP file in "Restaurant Bookings" ver. 2.2.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: A good plugin description is longer than 10 characters (currently 0 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected120,569 lines of code in 337 files:
LanguageFilesBlank linesComment linesLines of code
PHP24310,37736,82651,142
HTML3195435,444
CSS81,4267011,319
JavaScript292,3372,3769,240
JSON12005,506
Markdown121,13203,453
SVG273752,768
PO File17971,1881,673
XML10015
make1409

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity25.08
▷ Minimum class complexity1.00
▷ Maximum class complexity818.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces12
Interfaces21
Traits3
Classes216
▷ Abstract classes41.85%
▷ Concrete classes21298.15%
▷ Final classes209.43%
Methods4,163
▷ Static methods73717.70%
▷ Public methods3,89093.44%
▷ Protected methods1022.45%
▷ Private methods1714.11%
Functions362
▷ Named functions6116.85%
▷ Anonymous functions30183.15%
Constants295
▷ Global constants62.03%
▷ Class constants28997.97%
▷ Public constants289100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
35 PNG files occupy 1.11MB with 0.52MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ae-icon.png12.75KB5.14KB▼ 59.68%
rbktmce/img/menu.png106.18KB48.61KB▼ 54.22%
img/icon-128x128.png4.70KB2.26KB▼ 51.90%
img/ae_feedback_verified.png11.74KB4.75KB▼ 59.58%
img/jqueryui/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%