51% wp-travel

Code Review | WP Travel - Best Travel Booking WordPress Plugin, Tour Management Engine

WordPress plugin WP Travel - Best Travel Booking WordPress Plugin, Tour Management Engine scored51%from 54 tests.

About plugin

  • Plugin page: wp-travel
  • Plugin version: 7.6.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 5, 2017
  • Latest release: Nov 6, 2023
  • Number of updates: 272
  • Update frequency: every 8.6 days
  • Top authors: wptravel (76.1%)WEN Solutions (24.26%)

Code review

54 tests

User reviews

98 reviews

Install metrics

6,000+ active /453,887 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲7.38MB] [CPU: ▲88.69ms] 50% from 4 tests

An overview of server-side resources used by WP Travel - Best Travel Booking WordPress Plugin, Tour Management Engine
It is recommended to improve the following
  • RAM: Total memory usage must be kept under 10MB (currently 10.95MB on /wp-admin/edit-tags.php?taxonomy=itinerary_types&post_type=itineraries)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 7.38MB on /wp-admin/edit-tags.php?taxonomy=itinerary_types&post_type=itineraries)
PageMemory (MB)CPU Time (ms)
Home /9.92 ▲6.46104.73 ▲61.85
Dashboard /wp-admin11.01 ▲7.67223.67 ▲162.82
Posts /wp-admin/edit.php11.03 ▲7.67156.13 ▲107.71
Add New Post /wp-admin/post-new.php13.61 ▲7.72193.71 ▲92.11
Media Library /wp-admin/upload.php10.94 ▲7.71129.21 ▲93.10
Keywords /wp-admin/edit-tags.php?taxonomy=travel_keywords&post_type=itineraries10.95137.50
Activities /wp-admin/edit-tags.php?taxonomy=activity&post_type=itineraries10.95132.34
Custom Filters /wp-admin/edit.php?post_type=itinerary-booking&page=wp_travel_custom_filters_page10.94129.42
New Trip /wp-admin/post-new.php?post_type=itineraries11.17154.89
Settings /wp-admin/edit.php?post_type=itinerary-booking&page=settings10.94132.83
All Trips /wp-admin/edit.php?post_type=itineraries11.12136.47
Marketplace /wp-admin/edit.php?post_type=itinerary-booking&page=wp-travel-marketplace10.94128.08
Enquiries /wp-admin/edit.php?post_type=itinerary-enquiries11.03134.60
Destinations /wp-admin/edit-tags.php?taxonomy=travel_locations&post_type=itineraries10.95126.26
Trip Types /wp-admin/edit-tags.php?taxonomy=itinerary_types&post_type=itineraries10.95127.20

Server storage [IO: ▲15.80MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 501 new files
Database: 4 new tables, 37 new options
New tables
wp_wt_pricings
wp_wt_dates
wp_wt_price_category_relation
wp_wt_excluded_dates_times
New WordPress options
wp_travel_first_active
_wp_session_expires_c20d8460807d1ca8b501e1654661136f
theysaidso_admin_options
wp_travel_wp-travel-dashboard_page_id
wp_travel_wp-travel-checkout_page_id
widget_wp_travel_trip_type
widget_theysaidso_widget
widget_wp_travel_featured
wp_travel_version
widget_recent-comments
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Travel - Best Travel Booking WordPress Plugin, Tour Management Engine
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,125 ▲36317.38 ▲3.158.52 ▲6.7436.72 ▼6.26
Dashboard /wp-admin2,383 ▲2067.55 ▲1.92225.10 ▲131.0242.72 ▲2.68
Posts /wp-admin/edit.php2,313 ▲2137.25 ▲5.2267.14 ▲30.9434.31 ▼0.34
Add New Post /wp-admin/post-new.php1,658 ▲13222.85 ▼0.28547.65 ▼62.8933.25 ▼30.87
Media Library /wp-admin/upload.php1,687 ▲2879.39 ▲5.17125.03 ▲29.1041.33 ▲0.23
Keywords /wp-admin/edit-tags.php?taxonomy=travel_keywords&post_type=itineraries1,6808.4291.7132.44
Activities /wp-admin/edit-tags.php?taxonomy=activity&post_type=itineraries1,7118.3694.7333.18
Custom Filters /wp-admin/edit.php?post_type=itinerary-booking&page=wp_travel_custom_filters_page1,2228.3782.2428.49
New Trip /wp-admin/post-new.php?post_type=itineraries2,79714.56338.0882.73
Settings /wp-admin/edit.php?post_type=itinerary-booking&page=settings1,65111.87216.0493.29
All Trips /wp-admin/edit.php?post_type=itineraries1,77713.34160.3636.04
Marketplace /wp-admin/edit.php?post_type=itinerary-booking&page=wp-travel-marketplace2,8258.4994.17163.75
Enquiries /wp-admin/edit.php?post_type=itinerary-enquiries1,69313.04148.5035.46
Destinations /wp-admin/edit-tags.php?taxonomy=travel_locations&post_type=itineraries1,7028.4290.7233.49
Trip Types /wp-admin/edit-tags.php?taxonomy=itinerary_types&post_type=itineraries1,7088.3989.2235.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables were found after uninstall: 4 tables
    • wp_wt_excluded_dates_times
    • wp_wt_pricings
    • wp_wt_price_category_relation
    • wp_wt_dates
  • This plugin does not fully uninstall, leaving 41 options in the database
    • _wp_session_expires_44a05519409b92aa703e81336e31a9cb
    • widget_wp_travel_trip_type
    • _wp_session_490c8445e137401a1892cf2c0e06f4e4
    • widget_wp_travel_filter_search_widget
    • _wp_session_44a05519409b92aa703e81336e31a9cb
    • wp_travel_version
    • _wp_session_expires_7951f3d811150153ae9eca75e5e4c716
    • widget_wp_travel_location
    • _wp_session_e204f3bf6bb52fa3314d64b7f7ee4854
    • _wp_session_511f882e1167aaabf19dd76aba58d3fb
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-travel/inc/admin/views/tabs/tabs.php
    • > /wp-content/plugins/wp-travel/templates/admin/post/tab-contents/location-tab.php
  • 143× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-travel/templates/account/tab-content/bookings.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-travel/inc/admin/class-admin-pointers.php:18
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-travel/inc/admin/views/tabs/tabs.php on line 25
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Travel_FW_Field_Text' not found in wp-content/plugins/wp-travel/inc/framework/form/fields/class.field.hidden.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-travel/templates/admin/post/tab-contents/additional-info-tab.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-travel/core/ajax/enquiry.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-travel/templates/account/tab-content/address.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Travel_Emails' not found in wp-content/plugins/wp-travel/inc/class-wp-travel-email.php:13
    • > PHP Warning
      Use of undefined constant WP_TRAVEL_ABSPATH - assumed 'WP_TRAVEL_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-travel/inc/helpers.php on line 8
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/wp-travel/templates/account/tab-content/payments.php on line 150

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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=itinerary-enquiries
    • > Console-api (severe) in wp-includes/js/dist/data.min.js?ver=ff7eb3945f963be850ff+1:19276
    Store \"WPTravel/Admin\" is already registered.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
The official readme.txt might help

wp-travel/wp-travel.php 92% from 13 tests

The principal PHP file in "WP Travel - Best Travel Booking WordPress Plugin, Tour Management Engine" v. 7.6.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 147 characters long)

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-travel/inc/gateways/standard-paypal/php-paypal-ipn/cert/api_cert_chain.crt
90,208 lines of code in 413 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript919,2326,96938,992
PHP2446,4458,95938,669
CSS422,9291597,739
SVG13134,347
TypeScript1503212
Markdown1440135
XML24089
JSON40019
Sass1206

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 125)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity27.01
▷ Minimum class complexity1.00
▷ Maximum class complexity346.00
Average method complexity5.92
▷ Minimum method complexity1.00
▷ Maximum method complexity125.00
Code structure
Namespaces1
Interfaces1
Traits1
Classes137
▷ Abstract classes10.73%
▷ Concrete classes13699.27%
▷ Final classes32.21%
Methods706
▷ Static methods28540.37%
▷ Public methods66894.62%
▷ Protected methods91.27%
▷ Private methods294.11%
Functions708
▷ Named functions66193.36%
▷ Anonymous functions476.64%
Constants25
▷ Global constants2392.00%
▷ Class constants28.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
50 PNG files occupy 2.15MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/themes/pleased-free.png78.35KB77.69KB▼ 0.84%
assets/images/login-dashboard.png1.09KB1.06KB▼ 2.51%
assets/images/pro.png1,185.55KB346.91KB▼ 70.74%
assets/images/themes/tourable-free.png55.14KB54.21KB▼ 1.70%
assets/images/support.png1.10KB1.04KB▼ 5.61%