62% book-a-room-event-calendar

Code Review | Book a Room Event Calendar

WordPress plugin Book a Room Event Calendarscored62%from 54 tests.

About plugin

  • Plugin page: book-a-room-event...
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 19, 2015
  • Latest release: Aug 28, 2022
  • Number of updates: 41
  • Update frequency: every 61.2 days
  • Top authors: chuhpl (75.61%)ManiacalV (26.83%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /5,145 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.13MB] [CPU: ▼24.51ms] Passed 4 tests

Server-side resources used by Book a Room Event Calendar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▼0.0152.65 ▼9.88
Dashboard /wp-admin3.32 ▼0.0354.11 ▼40.12
Posts /wp-admin/edit.php3.37 ▼0.4751.37 ▼23.40
Add New Post /wp-admin/post-new.php5.90 ▲0.0198.74 ▼24.65
Media Library /wp-admin/upload.php3.24 ▲0.0134.97 ▼7.89
Events Settings /wp-admin/options-general.php?page=bookaroom-Events3.2634.01

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Book a Room Event Calendar: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲23013.85 ▼0.587.05 ▲4.9146.08 ▼9.66
Dashboard /wp-admin2,237 ▲555.93 ▼0.03100.47 ▼35.3039.53 ▼10.05
Posts /wp-admin/edit.php2,123 ▲282.09 ▼0.0736.43 ▼27.0534.50 ▼14.16
Add New Post /wp-admin/post-new.php1,551 ▲3223.04 ▼0.17716.55 ▼8.5739.49 ▼15.24
Media Library /wp-admin/upload.php1,422 ▲374.22 ▲0.08101.14 ▼23.0348.83 ▼2.99
Events Settings /wp-admin/options-general.php?page=bookaroom-Events9721.9228.3132.17

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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-includes/option.php+2520
    Trying to access array offset on value of type null
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/book-a-room-event-calendar/bookaroom-create_iCal.php
    • > /wp-content/plugins/book-a-room-event-calendar/templates/events_list.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-room-event-calendar/templates/emailRegistrations_email.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-room-event-calendar/templates/emailRegistrations_success.php:1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/book-a-room-event-calendar/templates/events_list.php on line 66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-room-event-calendar/templates/searchResults.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/book-a-room-event-calendar/bookaroom-create_iCal.php on line 42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-room-event-calendar/templates/events_settings.php:15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/book-a-room-event-calendar/bookaroom-create_iCal.php on line 40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-room-event-calendar/templates/events_settings_success.php:5
    • > PHP Notice
      Undefined variable: eventList in wp-content/plugins/book-a-room-event-calendar/templates/events_list.php on line 66
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/book-a-room-event-calendar/bookaroom-create_iCal.php on line 41

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=bookaroom-Events
    • > Network (severe)
    wp-content/plugins/book-a-room-event-calendar/js/scripts.js - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=bookaroom-Events
    • > Network (severe)
    wp-content/plugins/book-a-room-event-calendar/js/jstree/jquery.jstree.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Book a Room Event Calendar=== )
The official readme.txt is a good inspiration

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

The main PHP file in "Book a Room Event Calendar" ver. 1.9 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("book-a-room-event-calendar.php" instead of "bookaroom-events.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,636 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP134301472,328
CSS1200308

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity31.50
▷ Minimum class complexity1.00
▷ Maximum class complexity108.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods40
▷ Static methods40100.00%
▷ Public methods1845.00%
▷ Protected methods2255.00%
▷ Private methods00.00%
Functions12
▷ Named functions758.33%
▷ Anonymous functions541.67%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected