78% timely-booking-button

Code Review | Timely Booking Button

WordPress plugin Timely Booking Button scored78%from 54 tests.

About plugin

  • Plugin page: timely-booking-bu...
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Jun 13, 2013
  • Latest release: Apr 6, 2021
  • Number of updates: 58
  • Update frequency: every 49.2 days
  • Top authors: TimelySystem (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /14,936 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.03MB] [CPU: ▼2.21ms] Passed 4 tests

An overview of server-side resources used by Timely Booking Button
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.53 ▼7.07
Dashboard /wp-admin3.34 ▲0.0444.27 ▼3.67
Posts /wp-admin/edit.php3.39 ▲0.0448.13 ▲4.19
Add New Post /wp-admin/post-new.php5.92 ▲0.0488.32 ▼2.28
Media Library /wp-admin/upload.php3.26 ▲0.0435.26 ▲5.20
Timely /wp-admin/options-general.php?page=timely-booking-buttons3.2335.77

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Timely Booking Button
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.54 ▼0.841.73 ▼0.0340.05 ▼3.44
Dashboard /wp-admin2,213 ▲224.85 ▼0.16107.52 ▼7.0540.91 ▼4.02
Posts /wp-admin/edit.php2,090 ▼22.06 ▲0.0639.72 ▲3.5934.70 ▼0.85
Add New Post /wp-admin/post-new.php1,536 ▲323.02 ▲0.01649.63 ▲17.7555.82 ▲4.37
Media Library /wp-admin/upload.php1,389 ▼24.19 ▲0.01103.80 ▲3.5343.79 ▼0.17
Timely /wp-admin/options-general.php?page=timely-booking-buttons8892.0330.9530.05

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
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_tbb-widget-new
    • db_upgraded
    • widget_tbw-widget-new
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/timely-booking-button/tests/bootstrap.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/timely-booking-button/widget/timely-booking-button-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/timely-booking-button/tests/test-sample.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/timely-booking-button/widget/timely-booking-frame-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/timely-booking-button/admin/timely-booking-button-admin.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/timely-booking-button/widget/timely-booking-button-widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

timely-booking-button/timely-booking-button.php 85% from 13 tests

"Timely Booking Button" version 2.0.2'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:
  • Description: Keep the plugin description shorter than 140 characters (currently 220 characters long)
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin607 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP789185406
Bourne Shell12111123
JavaScript19146
JSON11016
XML10016

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.20
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods23
▷ Static methods313.04%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin