10% cbx-restaurant-booking

Code Review | CBX Restaurant Booking

WordPress plugin CBX Restaurant Booking scored 10% from 54 tests.

About plugin

  • Plugin page: cbx-restaurant-bo...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5.1
  • WordPress version: 6.3.1
  • First release: Aug 8, 2017
  • Latest release: Sep 9, 2020
  • Number of updates: 42
  • Update frequency: every 26.9 days
  • Top authors: manchumahara (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 3,412 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/cbx-restaurant-booking/includes/class-cbxrbooking-mailtemplate.php+155
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.11ms] Passed 4 tests

An overview of server-side resources used by CBX Restaurant Booking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.65 ▼6.51
Dashboard /wp-admin3.31 ▲0.0046.15 ▼2.73
Posts /wp-admin/edit.php3.36 ▲0.0044.16 ▼4.12
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.66 ▼7.06
Media Library /wp-admin/upload.php3.23 ▲0.0037.57 ▲2.40

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 346 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by CBX Restaurant Booking
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.17 ▼1.191.82 ▼0.3136.12 ▼7.66
Dashboard /wp-admin2,209 ▲274.87 ▼1.00101.36 ▼4.3839.30 ▲0.26
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0335.75 ▲0.8530.39 ▼6.25
Add New Post /wp-admin/post-new.php1,533 ▼023.65 ▲0.18594.05 ▼47.5445.81 ▼14.13
Media Library /wp-admin/upload.php1,385 ▼34.22 ▲0.02101.32 ▲4.3942.68 ▼0.30

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cbx-restaurant-booking/includes/fpdf/formatedstring.php
    • > /wp-content/plugins/cbx-restaurant-booking/includes/fpdf/easyTable.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cbx-restaurant-booking/includes/class-cbxrbooking-branch-manager.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/cbx-restaurant-booking/includes/class-cbxrbooking-branch-manager.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cbx-restaurant-booking/includes/class-cbxrbooking-log.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/cbx-restaurant-booking/includes/class-cbxrbooking-log.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/cbx-restaurant-booking/includes/class-cbxrbooking-branch-manager.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/cbx-restaurant-booking/includes/fpdf/exfpdf.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/cbx-restaurant-booking/includes/class-cbxrbooking-log.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: restaurant, booking, restaurant booking, table booking, restaurant reservations

cbx-restaurant-booking/cbxrbooking.php 85% from 13 tests

This is the main PHP file of "CBX Restaurant Booking" version 1.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("cbx-restaurant-booking.php" instead of "cbxrbooking.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin64,460 lines of code in 304 files:
LanguageFilesBlank linesComment linesLines of code
CSS303,50145824,531
JavaScript1434,6092,28920,035
PHP552,9143,74114,386
TypeScript68503,508
Sass417521,013
SVG200547
JSON100435
LESS1155

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 114)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity79.21
▷ Minimum class complexity1.00
▷ Maximum class complexity338.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity114.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods540
▷ Static methods488.89%
▷ Public methods45183.52%
▷ Protected methods437.96%
▷ Private methods468.52%
Functions13
▷ Named functions861.54%
▷ Anonymous functions538.46%
Constants22
▷ Global constants836.36%
▷ Class constants1463.64%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sort_asc.png0.16KB0.25KB0.00%
assets/images/cbxbooking_menu_icon.png0.68KB0.80KB0.00%
assets/images/icon_move.png0.22KB0.22KB▼ 0.89%
assets/images/sort_desc.png0.15KB0.25KB0.00%
assets/images/sort_desc_disabled.png0.14KB0.25KB0.00%