73% tennisthor

Code Review | Tennis booking system, Sport tournament management - TennisThor

WordPress plugin Tennis booking system, Sport tournament management - TennisThor scored73%from 54 tests.

About plugin

  • Plugin page: tennisthor
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.3-6.0.1
  • WordPress version: 6.3.1
  • First release: Apr 22, 2020
  • Latest release: Aug 22, 2022
  • Number of updates: 26
  • Update frequency: every 32.8 days
  • Top authors: tennisthor (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,422 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.32MB] [CPU: ▼14.62ms] Passed 4 tests

Analyzing server-side resources used by Tennis booking system, Sport tournament management - TennisThor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.405.24 ▼30.98
Dashboard /wp-admin3.36 ▲0.0146.80 ▼10.84
Posts /wp-admin/edit.php3.41 ▲0.0545.96 ▼2.84
Add New Post /wp-admin/post-new.php5.94 ▲0.0579.25 ▼13.81
Media Library /wp-admin/upload.php3.28 ▲0.0536.40 ▼1.38
Registration /wp-admin/admin.php?page=tennisthor-registration3.2431.64
Configuration /wp-admin/admin.php?page=tennisthor-setting3.2427.67

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 168 new files
Database: no new tables, 13 new options
New WordPress options
tennisthor_thor_power_rating_page
tennisthor_reservation_page
tennisthor_register_page
widget_recent-comments
tennisthor_tournament_detail_page
tennisthor_tournaments_page
can_compress_scripts
widget_recent-posts
tennisthor_login_page
tennisthor_rating_page
...

Browser metrics Passed 4 tests

An overview of browser requirements for Tennis booking system, Sport tournament management - TennisThor
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,985 ▲23914.00 ▼0.388.71 ▲6.9334.40 ▼6.82
Dashboard /wp-admin2,258 ▲705.84 ▲0.9598.05 ▼3.1287.05 ▲46.52
Posts /wp-admin/edit.php2,140 ▲512.03 ▲0.0634.16 ▼4.7136.09 ▲3.68
Add New Post /wp-admin/post-new.php1,710 ▲19622.40 ▲4.82730.51 ▲54.8557.75 ▼3.36
Media Library /wp-admin/upload.php1,437 ▲494.27 ▲0.0296.53 ▼12.8671.53 ▲23.42
ADMIN /wp-admin/admin.php?page=#280.440.073.70
Registration /wp-admin/admin.php?page=tennisthor-registration3,0119.58339.69156.12
Configuration /wp-admin/admin.php?page=tennisthor-setting9082.0225.0727.15

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, 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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tennisthor/include/tour_detail/gallery.php
    • > /wp-content/plugins/tennisthor/include/tour_detail/players.php
    • > /wp-content/plugins/tennisthor/include/tour_detail/points.php
  • 58× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tennisthor/include/tour_detail/info.php on line 12
    • > PHP Notice
      Undefined variable: body in wp-content/plugins/tennisthor/include/tour_detail/players.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tennisthor/include/tour_detail/info.php on line 4
    • > PHP Notice
      Undefined variable: body in wp-content/plugins/tennisthor/include/tour_detail/players.php on line 19
    • > PHP Notice
      Undefined variable: body in wp-content/plugins/tennisthor/include/tour_detail/info.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tennisthor/include/tour_detail/players.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tennisthor/include/tour_detail/players.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tennisthor/include/tournaments.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/tennisthor/include/tour_detail/schedule.php:2
    • > PHP Notice
      Undefined variable: body in wp-content/plugins/tennisthor/include/tour_detail/players.php on line 11

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side 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)
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Javascript (severe) in unknown
    https://www.tennisthor.com/en/signup?frame_enabled=yes&tennis-thor-api-key= - Access to XMLHttpRequest at 'https://www.facebook.com/plugins/customer_chat/SDK/?app_id=874951776000531&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Dfa3f487f4947c%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_create&is_loaded_by_facade=true&loading_time=0&locale=en_US&log_id=253569fa-cfb2-4d96-8607-279cfdc21446&page_id=151518805689411&request_time=1696866855203&sdk=joey&should_use_new_domain=false&suppress_http_code=1' from origin 'https://www.tennisthor.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Network (severe)
    https://www.facebook.com/plugins/customer_chat/SDK/?app_id=874951776000531&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Dfa3f487f4947c%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_create&is_loaded_by_facade=true&loading_time=0&locale=en_US&log_id=253569fa-cfb2-4d96-8607-279cfdc21446&page_id=151518805689411&request_time=1696866855203&sdk=joey&should_use_new_domain=false&suppress_http_code=1 - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Javascript (severe) in unknown
    https://www.tennisthor.com/en/signup?frame_enabled=yes&tennis-thor-api-key= - Access to XMLHttpRequest at 'https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df3370fedd7087c4%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_create&is_loaded_by_facade=true&loading_time=0&locale=en_US&log_id=0c973206-b03a-4100-9195-b494cb1b9142&page_id=151518805689411&request_time=1696866855129&sdk=joey&should_use_new_domain=false&suppress_http_code=1' from origin 'https://www.tennisthor.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Network (severe)
    https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df3370fedd7087c4%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_create&is_loaded_by_facade=true&loading_time=0&locale=en_US&log_id=0c973206-b03a-4100-9195-b494cb1b9142&page_id=151518805689411&request_time=1696866855129&sdk=joey&should_use_new_domain=false&suppress_http_code=1 - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Javascript (severe) in unknown
    https://www.tennisthor.com/en/signup?frame_enabled=yes&tennis-thor-api-key= - Access to XMLHttpRequest at 'https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df3370fedd7087c4%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_load&is_loaded_by_facade=true&loading_time=361&locale=en_US&log_id=0c973206-b03a-4100-9195-b494cb1b9142&page_id=151518805689411&request_time=1696866855490&sdk=joey&should_use_new_domain=false&suppress_http_code=1' from origin 'https://www.tennisthor.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Network (severe)
    https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df3370fedd7087c4%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_load&is_loaded_by_facade=true&loading_time=361&locale=en_US&log_id=0c973206-b03a-4100-9195-b494cb1b9142&page_id=151518805689411&request_time=1696866855490&sdk=joey&should_use_new_domain=false&suppress_http_code=1 - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Javascript (severe) in unknown
    https://www.tennisthor.com/en/signup?frame_enabled=yes&tennis-thor-api-key= - Access to XMLHttpRequest at 'https://www.facebook.com/plugins/customer_chat/SDK/?app_id=874951776000531&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Dfa3f487f4947c%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_load&is_loaded_by_facade=true&loading_time=284&locale=en_US&log_id=253569fa-cfb2-4d96-8607-279cfdc21446&page_id=151518805689411&request_time=1696866855487&sdk=joey&should_use_new_domain=false&suppress_http_code=1' from origin 'https://www.tennisthor.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=tennisthor-registration
    • > Network (severe)
    https://www.facebook.com/plugins/customer_chat/SDK/?app_id=874951776000531&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Dfa3f487f4947c%26domain%3Dwww.tennisthor.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.tennisthor.com%252Ff19a1b7e13d5b3c%26relation%3Dparent.parent&current_url=https%3A%2F%2Fwww.tennisthor.com%2Fen%2Fsignup%3Fframe_enabled%3Dyes%26tennis-thor-api-key%3D&event_name=chat_plugin_sdk_facade_load&is_loaded_by_facade=true&loading_time=284&locale=en_US&log_id=253569fa-cfb2-4d96-8607-279cfdc21446&page_id=151518805689411&request_time=1696866855487&sdk=joey&should_use_new_domain=false&suppress_http_code=1 - Failed to load resource: net::ERR_FAILED

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

tennisthor/tennisthor.php Passed 13 tests

Analyzing the main PHP file in "Tennis booking system, Sport tournament management - TennisThor" version 1.2.0
91 characters long description:
Tennis court bookings for tennis courts & other sports such as table tennis, football etc..

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 plugin24,717 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript929082,33316,462
CSS207044685,808
PHP19459622,418
SVG41029

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions68
▷ Named functions68100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
21 PNG files occupy 0.28MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flags16.png50.10KB18.91KB▼ 62.26%
assets/css/jQueryUI/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%
assets/css/jQueryUI/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
assets/css/blueimp/img/play-pause.png0.59KB0.46KB▼ 22.77%
assets/css/jQueryUI/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%