68% book-a-place

Code Review | Book a Place

WordPress plugin Book a Place scored68%from 54 tests.

About plugin

  • Plugin page: book-a-place
  • Plugin version: 0.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 8, 2013
  • Latest release: Nov 27, 2018
  • Number of updates: 83
  • Update frequency: every 22.5 days
  • Top authors: ArtkanMedia (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /21,001 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▼7.29ms] Passed 4 tests

This is a short check of server-side resources used by Book a Place
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4844.68 ▲2.76
Dashboard /wp-admin3.76 ▲0.4246.01 ▼16.55
Posts /wp-admin/edit.php3.81 ▲0.4649.56 ▲4.18
Add New Post /wp-admin/post-new.php6.28 ▲0.4082.60 ▼18.29
Media Library /wp-admin/upload.php3.62 ▲0.4036.13 ▲2.93
Settings /wp-admin/admin.php?page=book-a-place-settings3.6432.27
Book a Place /wp-admin/admin.php?page=book-a-place3.6032.58
Events /wp-admin/admin.php?page=book-a-place-events3.6431.99
Orders /wp-admin/admin.php?page=book-a-place-orders3.6331.00
Schemes /wp-admin/admin.php?page=book-a-place-schemes3.6329.21

Server storage [IO: ▲0.84MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 76 new files
Database: 5 new tables, 9 new options
New tables
wp_bap_events
wp_bap_orders
wp_bap_places
wp_bap_carts
wp_bap_schemes
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
bap_email_new_order_user
bap_email_new_order_admin
can_compress_scripts
bap_plugin_options

Browser metrics Passed 4 tests

Book a Place: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲20514.21 ▼0.4414.65 ▲12.5639.65 ▼2.76
Dashboard /wp-admin2,248 ▲575.80 ▲0.9395.82 ▼10.0338.42 ▼4.46
Posts /wp-admin/edit.php2,128 ▲392.02 ▲0.0538.62 ▲1.2334.02 ▲4.15
Add New Post /wp-admin/post-new.php1,544 ▲1022.78 ▼0.60686.18 ▲85.1063.90 ▲17.43
Media Library /wp-admin/upload.php1,427 ▲424.17 ▼0.0395.14 ▼9.3042.17 ▼4.70
Settings /wp-admin/admin.php?page=book-a-place-settings1,1852.2352.9966.59
Book a Place /wp-admin/admin.php?page=book-a-place1,0022.3939.5027.19
Events /wp-admin/admin.php?page=book-a-place-events1,7722.9180.6738.94
Orders /wp-admin/admin.php?page=book-a-place-orders1,1132.4335.5525.53
Schemes /wp-admin/admin.php?page=book-a-place-schemes1,0492.3252.9135.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_bap_events
    • wp_bap_places
    • wp_bap_carts
    • wp_bap_orders
    • wp_bap_schemes
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • can_compress_scripts
    • bap_plugin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • bap_email_new_order_user
    • widget_recent-posts
    • theysaidso_admin_options
    • bap_email_new_order_admin

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > Notice in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php+12
    Undefined index: scheme-id
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > Notice in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php+13
    Undefined index: scheme-name
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > Notice in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php+14
    Undefined index: scheme-width
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > Notice in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php+15
    Undefined index: scheme-height
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > Notice in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php+16
    Undefined index: scheme-hidden
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > Notice in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php+17
    Undefined index: scheme-description
    • > GET request to /wp-admin/admin.php?page=book-a-place-schemes
    • > Notice in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php+18
    Undefined index: scheme-purchase-limit

SRP 50% 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
Almost there! Just fix the following items
  • 27× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/book-a-place/views/admin-schemes.php:3
    • > PHP Notice
      Undefined variable: form_title in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php on line 25
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/book-a-place/views/admin-orders-list.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/book-a-place/views/admin-schemes-view.php:1
    • > PHP Notice
      Undefined index: scheme-width in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php on line 14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/book-a-place/views/admin-orders-clear.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/book-a-place/views/admin-events.php:3
    • > PHP Notice
      Undefined index: scheme-height in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php on line 15
    • > PHP Notice
      Undefined index: scheme-purchase-limit in wp-content/plugins/book-a-place/views/includes/admin-schemes-form.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can look at the official readme.txt

book-a-place/book-a-place.php 92% from 13 tests

The main PHP script in "Book a Place" version 0.7.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 176 characters long)

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
Success! There were no dangerous files found in this plugin12,268 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript91,5766875,606
PHP258832843,535
PO File58571,1301,643
CSS514568949
LESS21464535

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity108.50
▷ Minimum class complexity21.00
▷ Maximum class complexity196.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods117
▷ Static methods86.84%
▷ Public methods8270.09%
▷ Protected methods32.56%
▷ Private methods3227.35%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
17 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jquery-ui-themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png0.26KB0.15KB▼ 42.37%
css/jquery-ui-themes/smoothness/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
css/jquery-ui-themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
css/jquery-ui-themes/smoothness/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
css/jquery-ui-themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%