84% tour-booking

Code Review | Tour Booking

WordPress plugin Tour Booking scored84%from 54 tests.

About plugin

  • Plugin page: tour-booking
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.5.3
  • WordPress version: 6.3.1
  • First release: Jul 17, 2019
  • Latest release: Nov 23, 2020
  • Number of updates: 7
  • Update frequency: every 70.9 days
  • Top authors: elsand (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,912 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.23MB] [CPU: ▲3.47ms] Passed 4 tests

This is a short check of server-side resources used by Tour Booking
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2149.08 ▲9.35
Dashboard /wp-admin3.54 ▲0.2357.43 ▲5.52
Posts /wp-admin/edit.php3.64 ▲0.2856.55 ▲3.80
Add New Post /wp-admin/post-new.php6.15 ▲0.2693.05 ▼4.47
Media Library /wp-admin/upload.php3.46 ▲0.2342.56 ▲9.03
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=tour_listing3.4647.71
Tour Booking Settings /wp-admin/options-general.php?page=options_page_slug3.4541.13
Add New /wp-admin/post-new.php?post_type=tour3.6062.00
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tour3.4645.21
Add New /wp-admin/post-new.php?post_type=tour_listing3.5455.18
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=tour3.4744.00
All Tours /wp-admin/edit.php?post_type=tour3.5045.93
All Tour Listings /wp-admin/edit.php?post_type=tour_listing3.5043.38
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tour_listing3.4641.22

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 39 new files
Database: no new tables, 8 new options
New WordPress options
widget_tb_tour_selector
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
category_children
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Tour Booking
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲21913.57 ▼0.789.78 ▲8.1047.67 ▲4.92
Dashboard /wp-admin2,287 ▲1135.71 ▲0.1889.80 ▼0.7144.80 ▲6.07
Posts /wp-admin/edit.php2,194 ▲942.31 ▲0.2835.90 ▼5.9836.45 ▼0.62
Add New Post /wp-admin/post-new.php1,605 ▲7723.03 ▲0.01658.03 ▲46.9835.74 ▼16.32
Media Library /wp-admin/upload.php1,492 ▲954.39 ▲0.2197.88 ▼13.6642.10 ▼4.90
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=tour_listing1,5552.0732.7634.33
Tour Booking Settings /wp-admin/options-general.php?page=options_page_slug2,3083.0681.4329.80
Add New /wp-admin/post-new.php?post_type=tour2,8138.05210.0575.42
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tour1,4222.0633.6831.47
Add New /wp-admin/post-new.php?post_type=tour_listing1,8532.9960.6930.71
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=tour1,5582.0733.2634.55
All Tours /wp-admin/edit.php?post_type=tour1,2162.2533.9328.93
All Tour Listings /wp-admin/edit.php?post_type=tour_listing1,2072.2133.6831.47
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tour_listing1,4222.0332.7431.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_tb_tour_selector
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • category_children
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=tour
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: google is not defined" "ReferenceError: google is not defined\n at admin_map_initialize (/wp-content/plugins/tour-booking/admin/js/admin_scripts.js?ver=1.0:23:22)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/tour-booking/admin/js/admin_scripts.js?ver=1.0:14:4)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=tour
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught ReferenceError: google is not defined

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: sightseeing, tourist agency, travel, tour, tourism...

tour-booking/tour-booking.php 92% from 13 tests

"Tour Booking" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin2,467 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP17238301,222
CSS39320452
PO File2194196444
JavaScript33814200
SVG816149

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity2.50
▷ Minimum class complexity2.00
▷ Maximum class complexity3.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
front/images/close.png0.91KB0.75KB▼ 18.07%