62% wp-easy-booking

Code Review | WP Booking

WordPress plugin WP Booking scored62%from 54 tests.

About plugin

  • Plugin page: wp-easy-booking
  • Plugin version: 2.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.3-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 12, 2015
  • Latest release: Jul 10, 2023
  • Number of updates: 50
  • Update frequency: every 58.4 days
  • Top authors: avi.megladon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /8,708 total downloads

Benchmarks

Plugin footprint 65% 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.38MB] [CPU: ▼5.01ms] Passed 4 tests

This is a short check of server-side resources used by WP Booking
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4138.09 ▼4.45
Dashboard /wp-admin3.71 ▲0.4146.16 ▼0.37
Posts /wp-admin/edit.php3.76 ▲0.4049.43 ▲0.91
Add New Post /wp-admin/post-new.php6.25 ▲0.3682.40 ▼13.46
Media Library /wp-admin/upload.php3.57 ▲0.3436.74 ▼1.77
Category /wp-admin/edit-tags.php?taxonomy=booking_category&post_type=booking_address3.5635.68
Add New Booking /wp-admin/post-new.php?post_type=booking_address3.7650.96
WP Booking /wp-admin/admin.php?page=wp_booking_afo3.5637.16
All Booking /wp-admin/edit.php?post_type=booking_address3.6837.15
WP Booking Log /wp-admin/admin.php?page=wp_booking_log_afo3.5331.55

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 84 new files
Database: 3 new tables, 6 new options
New tables
wp_booking_barcode
wp_booking_location_schedule
wp_booking_log
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Booking
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲21013.84 ▼0.727.79 ▲5.7936.92 ▼9.37
Dashboard /wp-admin2,286 ▲984.92 ▲0.03107.22 ▲1.1638.90 ▼3.00
Posts /wp-admin/edit.php2,166 ▲772.39 ▲0.2536.14 ▼3.2630.12 ▼5.78
Add New Post /wp-admin/post-new.php1,578 ▲5922.46 ▼0.66678.55 ▲8.9437.45 ▼21.36
Media Library /wp-admin/upload.php1,465 ▲774.27 ▲0.0897.20 ▼17.4242.07 ▼5.80
Category /wp-admin/edit-tags.php?taxonomy=booking_category&post_type=booking_address1,3452.3430.3127.83
Add New Booking /wp-admin/post-new.php?post_type=booking_address2,4797.77180.5470.11
WP Booking /wp-admin/admin.php?page=wp_booking_afo1,2601.9125.6443.07
All Booking /wp-admin/edit.php?post_type=booking_address1,1442.2032.9026.44
WP Booking Log /wp-admin/admin.php?page=wp_booking_log_afo9381.9327.6826.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_booking_barcode
    • wp_booking_log
    • wp_booking_location_schedule
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=wp_booking_log_afo
    • > Notice in wp-content/plugins/wp-easy-booking/includes/class-booking-log.php+278
    Undefined index: paged
    • > GET request to /wp-admin/admin.php?page=wp_booking_log_afo
    • > Notice in wp-content/plugins/wp-easy-booking/view/admin/booking-search.php+9
    Undefined index: c_email
    • > GET request to /wp-admin/admin.php?page=wp_booking_log_afo
    • > Notice in wp-content/plugins/wp-easy-booking/view/admin/booking-search.php+10
    Undefined index: book_id

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 fix the following
  • 10× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-easy-booking/view/admin/pro-add.php
    • > /wp-content/plugins/wp-easy-booking/barcode/FColor.php
    • > /wp-content/plugins/wp-easy-booking/barcode/code39.barcode.php
    • > /wp-content/plugins/wp-easy-booking/view/admin/shortcode-help.php
    • > /wp-content/plugins/wp-easy-booking/view/frontend/booking-calender.php
    • > /wp-content/plugins/wp-easy-booking/view/admin/login-add.php
    • > /wp-content/plugins/wp-easy-booking/barcode/BarCode.php
    • > /wp-content/plugins/wp-easy-booking/view/frontend/booking-locations.php
    • > /wp-content/plugins/wp-easy-booking/view/admin/add-schedule.php
    • > /wp-content/plugins/wp-easy-booking/barcode/FDrawing.php
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Form_Class' not found in wp-content/plugins/wp-easy-booking/view/admin/booking-edit.php:2
    • > PHP Notice
      Undefined variable: sc_data in wp-content/plugins/wp-easy-booking/view/admin/add-schedule.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'Form_Class' not found in wp-content/plugins/wp-easy-booking/view/frontend/booking-form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/wp-easy-booking/view/frontend/booking-orders-page-link.php:1
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/wp-easy-booking/view/frontend/booking-log.php on line 3
    • > PHP Notice
      Undefined variable: no_of_month in wp-content/plugins/wp-easy-booking/view/frontend/booking-calender.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-easy-booking/config/config-default.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-easy-booking/view/frontend/booking-log.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Form_Class' not found in wp-content/plugins/wp-easy-booking/view/admin/booking-address-form.php:5
    • > PHP Notice
      Undefined variable: loc_id in wp-content/plugins/wp-easy-booking/view/frontend/booking-calender.php on line 17

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 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-easy-booking/booking.php 85% from 13 tests

Analyzing the main PHP file in "WP Booking" version 2.4.4
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 214 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-easy-booking.php" instead of "booking.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected4,505 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP393162922,392
CSS352631,332
JavaScript5138394711
PO File134070

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity13.21
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods128
▷ Static methods1814.06%
▷ Public methods12093.75%
▷ Protected methods86.25%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
32 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ui-icons_72a7cf_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
assets/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
assets/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
assets/images/ui-bg_glass_50_3baae3_1x400.png0.33KB0.16KB▼ 50.89%