68% booking-works

Code Review | Booking Works

WordPress plugin Booking Works scored68%from 54 tests.

About plugin

  • Plugin page: booking-works
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2020
  • Latest release: May 1, 2023
  • Number of updates: 8
  • Update frequency: every 122.4 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /663 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
Installer ran successfully

Server metrics [RAM: ▼0.96MB] [CPU: ▼41.59ms] Passed 4 tests

An overview of server-side resources used by Booking Works
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0036.20 ▼5.39
Dashboard /wp-admin3.03 ▼0.3523.04 ▼40.03
Posts /wp-admin/edit.php3.03 ▼0.3625.59 ▼23.56
Add New Post /wp-admin/post-new.php3.03 ▼2.8924.25 ▼92.08
Media Library /wp-admin/upload.php3.03 ▼0.2324.29 ▼10.67

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: no files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Booking Works
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.17 ▼1.211.62 ▼0.4040.58 ▼5.96
Dashboard /wp-admin2,206 ▲185.88 ▲0.01105.82 ▲7.0241.63 ▼0.57
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0439.02 ▲3.4734.00 ▼0.23
Add New Post /wp-admin/post-new.php1,533 ▲523.20 ▲4.71676.58 ▲55.6555.08 ▲4.60
Media Library /wp-admin/upload.php1,388 ▲34.26 ▲0.03111.84 ▲15.2247.16 ▲4.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'wpbw_admin_menu' not found or invalid function name
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/booking-works/templates/wp_ca_rentable_items.php
    • > /wp-content/plugins/booking-works/templates/wp_ca_ticket_view.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_terms() in wp-content/plugins/booking-works/templates/wp_ca_edit_fields.php:14
    • > PHP Notice
      Undefined variable: is_edit in wp-content/plugins/booking-works/templates/wp_ca_rentable_items.php on line 556
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/booking-works/inc/functions-user.php:3
    • > PHP Notice
      Undefined variable: is_edit in wp-content/plugins/booking-works/templates/wp_ca_rentable_items.php on line 546
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_title() in wp-content/plugins/booking-works/templates/wp_ca_rentable_items.php:572
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/booking-works/templates/wp_ca_calendar_items.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/booking-works/inc/wp_ca_settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/booking-works/templates/wp_ca_ticket_view.php:550

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: calendars, bookings

booking-works/index.php 92% from 13 tests

The principal PHP file in "Booking Works" v. 1.0.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("booking-works.php" instead of "index.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
There were no executable files found in this plugin10,609 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP93,5774345,054
SVG5042,764
CSS71,494211,571
JavaScript71,0696491,220

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods6100.00%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions96
▷ Named functions8891.67%
▷ Anonymous functions88.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/check0.png3.83KB1.06KB▼ 72.38%
images/check2.png2.15KB1.61KB▼ 25.43%
images/step1.png14.45KB5.95KB▼ 58.80%
images/step3.png16.11KB6.71KB▼ 58.36%
images/check1.png5.13KB1.89KB▼ 63.13%