10% 3-sheep-booking

Code Review | 3 Sheep Booking

WordPress plugin 3 Sheep Booking scored 10% from 54 tests.

About plugin

  • Plugin page: 3-sheep-booking
  • Plugin version: 1.00
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.4.2
  • WordPress version: 5.9.2
  • First release: Oct 29, 2012
  • Latest release: Oct 29, 2012
  • Number of updates: 11
  • Update frequency: every 0.1 days
  • Top authors: 3sheep (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,987 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
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/3-sheep-booking/3SheepBooking.php+118
    Use of undefined constant tsbooking_makebooking - assumed 'tsbooking_makebooking' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼2.43MB] [CPU: ▼350.96ms] Passed 4 tests

Server-side resources used by 3 Sheep Booking
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.93 ▼1.585.13 ▼57.12
Dashboard /wp-admin1.95 ▼1.454.10 ▼30.12
Posts /wp-admin/edit.php1.95 ▼1.694.83 ▼34.33
Add New Post /wp-admin/post-new.php1.95 ▼5.024.16 ▼1,282.26
Media Library /wp-admin/upload.php1.95 ▼1.344.22 ▼24.46
Appointment Booking /wp-admin/plugins.php?page=tsbooking_options_page2.064.66

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: 1 new table, 6 new options
New tables
wp_tsbooking_bookings
New WordPress options
tsbooking_booklength
tsbooking_version
tsbooking_email_bcc
tsbooking_email_message
tsbooking_email_subject
tsbooking_email_from

Browser metrics Passed 4 tests

A check of browser resources used by 3 Sheep Booking
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲7916.17 ▲0.575.54 ▼0.612.57 ▲0.42
Dashboard /wp-admin2,898 ▲406.25 ▲0.14129.22 ▼15.90202.69 ▲28.05
Posts /wp-admin/edit.php2,697 ▲63.24 ▼0.0062.30 ▼6.25141.99 ▼24.77
Add New Post /wp-admin/post-new.php1,703 ▲4821.10 ▲0.51424.09 ▼7.82179.71 ▲6.08
Media Library /wp-admin/upload.php1,708 ▲105.50 ▲0.04152.70 ▲6.48224.52 ▲35.40
Appointment Booking /wp-admin/plugins.php?page=tsbooking_options_page1,2162.4154.65126.73

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 25% 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
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/3-sheep-booking/3SheepBooking.php+118
    Use of undefined constant tsbooking_makebooking - assumed 'tsbooking_makebooking' (this will throw an Error in a future version of PHP)
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_tsbooking_bookings
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • tsbooking_booklength
    • tsbooking_email_from
    • tsbooking_email_bcc
    • tsbooking_version
    • tsbooking_email_message
    • tsbooking_email_subject

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/plugins.php?page=tsbooking_options_page
    • > Warning in wp-content/plugins/3-sheep-booking/3SheepBooking.php+118
    Use of undefined constant tsbooking_makebooking - assumed 'tsbooking_makebooking' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/plugins.php?page=tsbooking_options_page
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tsbooking handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/plugins.php?page=tsbooking_options_page
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tsbooking handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/3-sheep-booking/core/placeBooking.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > WordPress database error Incorrect DATETIME value
      '' for query UPDATE `wp_tsbooking_bookings` SET `first_name` = '', `last_name` = '', `job` = '', `email` = '', `company` = '', `telephone` = '', `source` = '', `mailinglist` = '0' WHERE `time` = ''
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/3-sheep-booking/3SheepBooking.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: shortcode, reservation, booking, appointment

3-sheep-booking/3SheepBooking.php 92% from 13 tests

The main PHP file in "3 Sheep Booking" ver. 1.00 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("3-sheep-booking.php" instead of "3SheepBooking.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected517 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP27218303
JavaScript13714175
CSS19439

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png28.82KB8.59KB▼ 70.19%
screenshot-1.png73.08KB24.24KB▼ 66.83%