10% wp-travel-engine

Code Review | WP Travel Engine - Best Travel Booking WordPress Plugin

WordPress plugin WP Travel Engine - Best Travel Booking WordPress Plugin scored10%from 54 tests.

About plugin

  • Plugin page: wp-travel-engine
  • Plugin version: 5.7.9
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: May 4, 2017
  • Latest release: Nov 10, 2023
  • Number of updates: 1,704
  • Update frequency: every 1.4 days
  • Top authors: wptravelengine (100%)

Code review

54 tests

User reviews

168 reviews

Install metrics

10,000+ active /520,532 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-travel-engine/includes/helpers/helpers-analytics.php+1050
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence

Server metrics [RAM: ▲2.89MB] [CPU: ▼25.50ms] Passed 4 tests

Analyzing server-side resources used by WP Travel Engine - Best Travel Booking WordPress Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.89 ▲3.4333.16 ▼5.37
Dashboard /wp-admin6.91 ▲3.5632.85 ▼28.44
Posts /wp-admin/edit.php6.91 ▲3.5532.16 ▼11.90
Add New Post /wp-admin/post-new.php6.91 ▲1.0237.59 ▼56.27
Media Library /wp-admin/upload.php6.91 ▲3.6836.84 ▲1.30
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius6.9133.13
Destinations /wp-admin/edit-tags.php?taxonomy=destination&post_type=trip6.9133.82
Difficulty /wp-admin/edit-tags.php?taxonomy=difficulty&post_type=trip6.9131.73
Extensions /wp-admin/edit.php?post_type=booking&page=extensions6.9133.57
What's New?NEW /wp-admin/edit.php?post_type=booking&page=whats-new6.9132.99
Themes /wp-admin/edit.php?post_type=booking&page=themes6.9132.93
Activities /wp-admin/edit-tags.php?taxonomy=activities&post_type=trip6.9132.63
Add New /wp-admin/post-new.php?post_type=trip6.9131.92
Custom Filters /wp-admin/edit.php?post_type=trip&page=custom-filters6.9139.10
Trip Type /wp-admin/edit-tags.php?taxonomy=trip_types&post_type=trip6.9134.80

Server storage [IO: ▲17.98MB] [DB: ▲0.66MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 910 new files
Database: no new tables, 39 new options
New WordPress options
_wp_session_998ed0b8eea04e71bcba42e4002bf47e
fs_active_plugins
_wp_session_expires_33177f22fd18154a62d1453bdb6439ca
wp_travel_engine_wp-travel-engine-checkout_page_id
_wp_session_3ac07ed66dbda2ee0dcffa61561f4e97
fs_debug_mode
_wp_session_11dfa8389057c4c1470e8b73142a1f4c
_wp_session_expires_3ac07ed66dbda2ee0dcffa61561f4e97
widget_recent-comments
_wp_session_expires_11dfa8389057c4c1470e8b73142a1f4c
...

Browser metrics Passed 4 tests

WP Travel Engine - Best Travel Booking WordPress Plugin: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /9,665 ▲6,90317.02 ▲2.3929.21 ▲27.5930.98 ▼14.95
Dashboard /wp-admin8,650 ▲6,4705.69 ▲0.05159.65 ▲59.1755.64 ▲9.07
Posts /wp-admin/edit.php8,536 ▲6,4393.55 ▲1.6162.64 ▲26.2742.19 ▲7.03
Add New Post /wp-admin/post-new.php7,831 ▲6,30525.75 ▲2.57654.26 ▲10.6638.84 ▼30.44
Media Library /wp-admin/upload.php7,668 ▲6,2684.16 ▲0.00122.02 ▲26.1445.31 ▲0.34
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius7,4983.0551.4133.41
Destinations /wp-admin/edit-tags.php?taxonomy=destination&post_type=trip7,7613.3553.4536.36
Difficulty /wp-admin/edit-tags.php?taxonomy=difficulty&post_type=trip8,0963.3755.2746.05
Extensions /wp-admin/edit.php?post_type=booking&page=extensions8,3217.94101.84112.54
What's New?NEW /wp-admin/edit.php?post_type=booking&page=whats-new7,6567.92105.57133.65
Themes /wp-admin/edit.php?post_type=booking&page=themes7,6356.20103.5740.39
Activities /wp-admin/edit-tags.php?taxonomy=activities&post_type=trip7,7583.3556.3242.59
Add New /wp-admin/post-new.php?post_type=trip8,38919.63919.5353.21
Custom Filters /wp-admin/edit.php?post_type=trip&page=custom-filters7,6697.9599.1239.79
Trip Type /wp-admin/edit-tags.php?taxonomy=trip_types&post_type=trip7,7583.3150.4941.31

Uninstaller [IO: ▲0.00MB] [DB: ▲0.66MB] 50% 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
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wp-travel-engine/includes/helpers/helpers-analytics.php+1050
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence
  • The uninstall procedure has failed, leaving 45 options in the database
    • wptravelengine_difficulty_tax
    • _wp_session_expires_33177f22fd18154a62d1453bdb6439ca
    • wp_travel_engine_wp-travel-engine-cart_page_id
    • wte_search_params_updated_579
    • fs_debug_mode
    • _wp_session_expires_7d13527ff4028e7982e8daa0e13ebe71
    • _wp_session_expires_11dfa8389057c4c1470e8b73142a1f4c
    • wptravelengine_queue_flush_rewrite_rules
    • wp_travel_engine_my-account_page_id
    • _wp_session_7d13527ff4028e7982e8daa0e13ebe71
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=trip_types&post_type=trip
    • > Deprecated in wp-content/plugins/wp-travel-engine/includes/helpers/helpers-analytics.php+1050
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence

SRP 0% from 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
Please fix the following items
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-travel-engine/includes/templates/account/tab-content/bookings/active-bookings.php
    • > /wp-content/plugins/wp-travel-engine/includes/templates/script-templates/booking-process/tmpl-wte-booking-datetime.php
    • > /wp-content/plugins/wp-travel-engine/admin/partials/wp-travel-engine-admin-display.php
    • > /wp-content/plugins/wp-travel-engine/includes/templates/account/tab-content/bookings/recent-bookings.php
    • > /wp-content/plugins/wp-travel-engine/includes/templates/account/tab-content/bookings/bookings-history.php
  • 372× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Posts_Controller' not found in wp-content/plugins/wp-travel-engine/includes/rest-api/class-trip-controller.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Hybridauth\\Adapter\\OAuth2' not found in wp-content/plugins/wp-travel-engine/vendor/hybridauth/hybridauth/src/Provider/Patreon.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Hybridauth\\Adapter\\OAuth2' not found in wp-content/plugins/wp-travel-engine/vendor/hybridauth/hybridauth/src/Provider/Dropbox.php:18
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_discounts() on null in wp-content/plugins/wp-travel-engine/includes/modules/coupon-code/views/checkout-coupon-form.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Travel_Engine_Form_Field_Select' not found in wp-content/plugins/wp-travel-engine/includes/lib/wte-form-framework/field-types/class-field-trips_list.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wp-travel-engine/includes/backend/booking/customer-history.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-travel-engine/includes/dashboard/wp-travel-engine-user-functions.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wp-travel-engine/admin/meta-parts/trip-tabs/editor.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-travel-engine/includes/privacy-functions.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-travel-engine/includes/templates/emails/enquiry.php on line 5

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: travel-agency, tour-booking, travel, travel-booking, tour-operator

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

"WP Travel Engine - Best Travel Booking WordPress Plugin" version 5.7.9'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:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 305 characters long)

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-travel-engine/includes/payment-gateways/standard-paypal/php-paypal-ipn/cert/api_cert_chain.crt
136,094 lines of code in 746 files:
LanguageFilesBlank linesComment linesLines of code
PHP56116,60831,35288,446
JavaScript1071,01524622,303
JSON13008,809
CSS377191406,257
PO File32,5953,9166,101
Sass2302733,508
Markdown121670420
XML200147
YAML211269
SVG61033
HTML1001

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 247)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity33.13
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity247.00
Code structure
Namespaces31
Interfaces5
Traits2
Classes257
▷ Abstract classes83.11%
▷ Concrete classes24996.89%
▷ Final classes83.21%
Methods2,640
▷ Static methods46217.50%
▷ Public methods2,02776.78%
▷ Protected methods1415.34%
▷ Private methods47217.88%
Functions511
▷ Named functions36471.23%
▷ Anonymous functions14728.77%
Constants169
▷ Global constants11165.68%
▷ Class constants5834.32%
▷ Public constants58100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
82 PNG files occupy 2.99MB with 1.54MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
admin/css/images/tour package.png321.90KB329.50KB0.00%
admin/partials/plugin-updates/getting-started/550/assets/tax-checkout.png25.37KB9.90KB▼ 60.97%
admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
admin/css/images/booking-form.png200.50KB75.60KB▼ 62.30%