10% tennis-court-bookings

Code Review | Tennis Court Bookings

WordPress plugin Tennis Court Bookings scored10%from 54 tests.

About plugin

  • Plugin page: tennis-court-book...
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 23, 2015
  • Latest release: Dec 14, 2020
  • Number of updates: 23
  • Update frequency: every 83.1 days
  • Top authors: renoirIII (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /6,546 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.

Server metrics [RAM: ▼1.93MB] [CPU: ▼53.72ms] Passed 4 tests

An overview of server-side resources used by Tennis Court Bookings
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.85 ▼43.53
Dashboard /wp-admin2.09 ▼1.216.00 ▼46.18
Posts /wp-admin/edit.php2.09 ▼1.268.00 ▼41.80
Add New Post /wp-admin/post-new.php2.09 ▼3.806.69 ▼83.35
Media Library /wp-admin/upload.php2.09 ▼1.145.49 ▼37.27
Coaching /wp-admin/admin.php?page=rncbc_coaching2.095.19
Go Pro /wp-admin/admin.php?page=rncbc_go_pro2.097.05
Settings /wp-admin/admin.php?page=rncbc_setting2.096.37
Calendars /wp-admin/admin.php?page=rncbc_calendars2.096.01

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 30 new files
Database: 3 new tables, 7 new options
New tables
wp_rncbc_court
wp_rncbc_reservation
wp_rncbc_calendar
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
rncbc_database_version
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Tennis Court Bookings: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲4214.63 ▲0.181.75 ▼0.5144.90 ▲2.27
Dashboard /wp-admin2,227 ▲535.54 ▼0.06103.05 ▲15.1841.93 ▼1.88
Posts /wp-admin/edit.php2,138 ▲352.02 ▼0.0240.93 ▲2.8836.22 ▲0.31
Add New Post /wp-admin/post-new.php1,412 ▼11417.68 ▲0.08534.08 ▼156.6145.27 ▼10.34
Media Library /wp-admin/upload.php1,435 ▲354.26 ▲0.0597.10 ▼15.5141.67 ▼5.68
Coaching /wp-admin/admin.php?page=rncbc_coaching8062.0524.0226.27
Go Pro /wp-admin/admin.php?page=rncbc_go_pro8432.0326.0724.22
Settings /wp-admin/admin.php?page=rncbc_setting1,2722.0524.2329.48
Calendars /wp-admin/admin.php?page=rncbc_calendars9182.0524.6228.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.
  • Zombie tables were found after uninstall: 3 tables
    • wp_rncbc_court
    • wp_rncbc_calendar
    • wp_rncbc_reservation
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • rncbc_database_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rncbc_calendars
    • > User deprecated in wp-includes/functions.php+5643
    File upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rncbc_setting
    • > Notice in wp-content/plugins/tennis-court-bookings/views/setting.php+137
    Undefined index: description
    • > GET request to /wp-admin/admin.php?page=rncbc_setting
    • > Notice in wp-content/plugins/tennis-court-bookings/views/setting.php+129
    Undefined index: placeholder
    • > GET request to /wp-admin/admin.php?page=rncbc_calendars
    • > Notice in wp-content/plugins/tennis-court-bookings/libs/class-manage.php+24
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=rncbc_calendars
    • > Notice in wp-content/plugins/tennis-court-bookings/libs/class-calendar-list-table.php+63
    Undefined index: type
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rncbc_calendars
    • > Notice in wp-content/plugins/tennis-court-bookings/libs/model-calendar.php+14
    Undefined index: paged
    • > GET request to /wp-admin/admin.php?page=rncbc_calendars
    • > Notice in wp-content/plugins/tennis-court-bookings/libs/class-calendar-list-table.php+65
    Undefined index: orderby
    • > GET request to /wp-admin/admin.php?page=rncbc_calendars
    • > Notice in wp-content/plugins/tennis-court-bookings/libs/class-calendar-list-table.php+66
    Undefined index: order

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 fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/tennis-court-bookings/views/coaching_inactivate.php
  • 11× 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/tennis-court-bookings/views/calendar_reservation.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tennis-court-bookings/views/go_pro.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tennis-court-bookings/views/calendar_form.php:30
    • > PHP Notice
      Trying to get property 'title' of non-object in wp-content/plugins/tennis-court-bookings/views/calendar_court.php on line 2
    • > PHP Notice
      Undefined variable: calendar in wp-content/plugins/tennis-court-bookings/views/calendar_court.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/tennis-court-bookings/rn_booking_calendar.php:19
    • > PHP Notice
      Undefined variable: calendar in wp-content/plugins/tennis-court-bookings/views/calendar_reservation.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tennis-court-bookings/views/setting.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tennis-court-bookings/views/calendars.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tennis-court-bookings/views/calendar_court.php:2

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 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Lots of customisation.), #2 (Create your own courts.), #3 (Email notification to the visitor.), #4 (Email notification to the Admin.), #5 (Put your booking system in any post or page with an easy short-code.), #6 (Easy to use front-end.), #7 (Shows available and booked periods.), #8 (Captures the visitor's data.)
You can take inspiration from this readme.txt

tennis-court-bookings/rn_booking_calendar.php 77% from 13 tests

"Tennis Court Bookings" version 1.2.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 ("tennis-court-bookings.php" instead of "rn_booking_calendar.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 144 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected3,098 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP20481352,234
JavaScript314315557
PO File17186155
CSS130152

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.30
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods63
▷ Static methods3250.79%
▷ Public methods5790.48%
▷ Protected methods11.59%
▷ Private methods57.94%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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