72% book-a-room

Code Review | Book a Room

WordPress plugin Book a Room scored 72% from 54 tests.

About plugin

  • Plugin page: book-a-room
  • Plugin version: 2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2015
  • Latest release: Dec 21, 2022
  • Number of updates: 156
  • Update frequency: every 16.9 days
  • Top authors: chuhpl (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

90+ active / 14,559 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.74MB] [CPU: ▲8.71ms] Passed 4 tests

An overview of server-side resources used by Book a Room
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.44 ▲0.9845.93 ▲6.92
Dashboard /wp-admin5.29 ▲1.9963.17 ▲12.83
Posts /wp-admin/edit.php5.41 ▲2.0564.23 ▲13.54
Add New Post /wp-admin/post-new.php7.87 ▲1.9999.45 ▲1.56
Media Library /wp-admin/upload.php5.22 ▲1.9949.92 ▲16.21
Search /wp-admin/admin.php?page=bookaroom_meetings_search5.2846.24
Approved [0] /wp-admin/admin.php?page=bookaroom_meetings_approvedRequests5.2448.01
Content Admin /wp-admin/admin.php?page=bookaroom_Settings_Content5.2648.65
Create Event /wp-admin/admin.php?page=bookaroom_event_management5.4751.68
Containers Admin /wp-admin/admin.php?page=bookaroom_Settings_RoomCont5.2042.68
Search Registrations /wp-admin/admin.php?page=bookaroom_event_management_customerSearch5.2345.71
Pend. Payments [0] /wp-admin/admin.php?page=bookaroom_meetings_pendingPayment5.2472.06
Room Admin /wp-admin/admin.php?page=bookaroom_Settings_Rooms5.1945.80
Denied [0] /wp-admin/admin.php?page=bookaroom_meetings_deniedRequests5.2445.63

Server storage [IO: ▲1.91MB] [DB: ▲0.03MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 197 new files
Database: 16 new tables, 64 new options
New tables
wp_bookaroom_closings
wp_bookaroom_roomConts
wp_bookaroom_eventCats
wp_bookaroom_times_deleted
wp_bookaroom_event_ages
wp_bookaroom_cityList
wp_bookaroom_rooms
wp_bookaroom_registrations
wp_bookaroom_reservations_deleted
wp_bookaroom_roomConts_members
...
New WordPress options
bookaroom_hide_contract
bookaroom_regChange_subject
can_compress_scripts
bookaroom_addressType
bookaroom_profit_pending_body
bookaroom_profitDeposit
bookaroom_regChange_body
widget_theysaidso_widget
bookaroom_newAlert_subject
bookaroom_cleanupIncrement
...

Browser metrics Passed 4 tests

Checking browser requirements for Book a Room
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,335 ▲60015.07 ▲0.7111.03 ▲8.9936.81 ▼8.77
Dashboard /wp-admin2,442 ▲2545.63 ▼0.24119.64 ▲11.4541.09 ▼4.88
Posts /wp-admin/edit.php2,325 ▲2332.35 ▲0.3350.87 ▲10.8635.58 ▼0.43
Add New Post /wp-admin/post-new.php1,692 ▲15023.32 ▲5.16692.34 ▲53.2855.70 ▼4.32
Media Library /wp-admin/upload.php1,624 ▲2424.76 ▲0.54103.93 ▲3.5242.15 ▼1.24
Search /wp-admin/admin.php?page=bookaroom_meetings_search1,4043.0341.0530.84
Approved [0] /wp-admin/admin.php?page=bookaroom_meetings_approvedRequests1,1502.0334.2031.92
Content Admin /wp-admin/admin.php?page=bookaroom_Settings_Content2,1267.36137.5461.60
Create Event /wp-admin/admin.php?page=bookaroom_event_management1,9793.2545.5934.73
Containers Admin /wp-admin/admin.php?page=bookaroom_Settings_RoomCont1,1232.2731.8926.63
Search Registrations /wp-admin/admin.php?page=bookaroom_event_management_customerSearch1,3483.1140.9330.59
Pend. Payments [0] /wp-admin/admin.php?page=bookaroom_meetings_pendingPayment1,1562.0430.6529.86
Room Admin /wp-admin/admin.php?page=bookaroom_Settings_Rooms1,1182.2733.8528.45
Denied [0] /wp-admin/admin.php?page=bookaroom_meetings_deniedRequests1,1532.0533.1729.40
/wp-admin/admin.php?page=#280.440.084.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • bookaroom_hide_contract
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • bookaroom_defaultState_name
    • widget_recent-posts
    • can_compress_scripts
    • bookaroom_installing

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/book-a-room/templates/mainSettings/helpTableSetup.php
    • > /wp-content/plugins/book-a-room/templates/events/delete_multi.php
    • > /wp-content/plugins/book-a-room/templates/events/eventForm_instance.php
    • > /wp-content/plugins/book-a-room/templates/events/eventForm_event.php
    • > /wp-content/plugins/book-a-room/templates/events/eventForm_times.php
  • 106× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-room/templates/public/publicRequest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/closings/deleteMulti.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/rooms/addSuccess.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/amenities/add_success.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/events/categories_form_reactivate.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/branches/editSuccess.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/events/age_form_deactivate.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/events/eventList.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/amenities/delete_success.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/book-a-room/templates/closings/editSuccess.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=#
    • > Network (severe)
    wp-admin/admin.php?page=# - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === book-a-room === )
You can take inspiration from this readme.txt

book-a-room/bookaroom.php 92% from 13 tests

The main PHP file in "Book a Room" ver. 2.9 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("book-a-room.php" instead of "bookaroom.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
There were no executable files found in this plugin36,432 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP1282,4341,24121,160
JavaScript65412,94510,789
CSS13205853,531
HTML101763952

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity60.83
▷ Minimum class complexity1.00
▷ Maximum class complexity434.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods281
▷ Static methods27999.29%
▷ Public methods15254.09%
▷ Protected methods12845.55%
▷ Private methods10.36%
Functions24
▷ Named functions1354.17%
▷ Anonymous functions1145.83%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
18 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
scripts/zebra-dialog/css/flat/question.png1.61KB0.89KB▼ 44.89%
js/jstree/themes/default-rtl/d.png7.28KB2.51KB▼ 65.48%
scripts/zebra-dialog/css/default/confirmation.png4.57KB2.33KB▼ 49.11%
scripts/zebra-dialog/css/flat/error.png1.98KB1.06KB▼ 46.29%
js/jstree/themes/apple/d.png7.58KB2.63KB▼ 65.33%