78% sbs-seat-booking-system

Code Review | SBS - Seat Booking System

WordPress plugin SBS - Seat Booking System scored78%from 54 tests.

About plugin

  • Plugin page: sbs-seat-booking-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.1.1
  • WordPress version: 6.3.1
  • First release: May 8, 2015
  • Latest release: May 8, 2015
  • Number of updates: 2
  • Update frequency: every 8.5 days
  • Top authors: uouapps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,891 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼0.15ms] Passed 4 tests

This is a short check of server-side resources used by SBS - Seat Booking System
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0938.91 ▼2.18
Dashboard /wp-admin3.40 ▲0.0951.44 ▼1.22
Posts /wp-admin/edit.php3.51 ▲0.1550.51 ▲0.10
Add New Post /wp-admin/post-new.php5.98 ▲0.09109.65 ▲8.71
Media Library /wp-admin/upload.php3.32 ▲0.0938.54 ▲2.70

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 234 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for SBS - Seat Booking System
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.38 ▲0.191.66 ▲0.0644.84 ▲3.57
Dashboard /wp-admin2,201 ▲275.64 ▲0.0494.54 ▲0.6444.64 ▲0.96
Posts /wp-admin/edit.php2,113 ▲162.01 ▲0.0134.76 ▼2.4137.18 ▲1.08
Add New Post /wp-admin/post-new.php1,537 ▲1123.09 ▼0.65671.10 ▼3.8960.23 ▲12.10
Media Library /wp-admin/upload.php1,412 ▲94.19 ▼0.02100.55 ▼1.6942.69 ▼0.53

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sbs-seat-booking-system/templates/drag.php
    • > /wp-content/plugins/sbs-seat-booking-system/templates/frontpopup.php
  • 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_header() in wp-content/plugins/sbs-seat-booking-system/templates/custom-template.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sbs-seat-booking-system/includes/class-uou-rmd-ajax-frontend-request.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Cuztom_Post_Type' not found in wp-content/plugins/sbs-seat-booking-system/includes/class-uou-rmd-post-type.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woocommerce_wp_text_input() in wp-content/plugins/sbs-seat-booking-system/includes/admin/views/html-reserve-pricing.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sbs-seat-booking-system/templates/drag.php:131
    • > PHP Warning
      file_get_contents(UOU_RMD_URL/objects.json): failed to open stream: No such file or directory in wp-content/plugins/sbs-seat-booking-system/templates/drag.php on line 41
    • > PHP Warning
      include_once(UOU_RMD_DIR/includes/vendor/cuztom/cuztom.php): failed to open stream: No such file or directory in wp-content/plugins/sbs-seat-booking-system/includes/class-uou-rmd-post-type.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/sbs-seat-booking-system/includes/vendor/wrapper/views/frontend.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sbs-seat-booking-system/includes/admin/views/html-reserve-tab.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/sbs-seat-booking-system/templates/schedule.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png)
The official readme.txt is a good inspiration

sbs-seat-booking-system/roomdrag.php 92% from 13 tests

"SBS - Seat Booking System" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sbs-seat-booking-system.php" instead of "roomdrag.php")

Code Analysis Passed 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 plugin33,666 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
CSS181,25740218,874
JavaScript161,1256586,467
PHP561,2061,2183,796
SVG5002,012
Sass1323241,256
LESS1323331,247
JSON10014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.14
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes43
▷ Abstract classes00.00%
▷ Concrete classes43100.00%
▷ Final classes00.00%
Methods202
▷ Static methods115.45%
▷ Public methods19596.53%
▷ Protected methods31.49%
▷ Private methods41.98%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants1392.86%
▷ Class constants17.14%
▷ Public constants1100.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
80 PNG files occupy 0.74MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/cuztom/assets/images/jquery-ui/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
objects/red/10.png17.53KB1.97KB▼ 88.75%
objects/grey/4.png17.57KB1.43KB▼ 91.84%
assets/css/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
objects/red/13.png2.57KB0.25KB▼ 90.16%