58% yatra

Code Review | Best Travel Booking WordPress Plugin, Tour Booking System, Trip Booking WordPress Plugin - Yatra

WordPress plugin Best Travel Booking WordPress Plugin, Tour Booking System, Trip Booking WordPress Plugin - Yatra scored58%from 54 tests.

About plugin

  • Plugin page: yatra
  • Plugin version: 2.1.16
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: May 10, 2019
  • Latest release: Oct 7, 2023
  • Number of updates: 49
  • Update frequency: every 32.9 days
  • Top authors: mantrabrain (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active /26,737 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.34MB] [CPU: ▲25.61ms] 75% from 4 tests

Server-side resources used by Best Travel Booking WordPress Plugin, Tour Booking System, Trip Booking WordPress Plugin - Yatra
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 5,356.97ms on /wp-admin/admin.php?page=yatra-status)
PageMemory (MB)CPU Time (ms)
Home /6.67 ▲3.2076.92 ▲36.94
Dashboard /wp-admin7.68 ▲4.33126.07 ▲61.13
Posts /wp-admin/edit.php6.81 ▲3.4584.73 ▲31.96
Add New Post /wp-admin/post-new.php9.27 ▲3.38113.40 ▲2.86
Media Library /wp-admin/upload.php6.58 ▲3.3569.89 ▲30.66
Destination /wp-admin/edit-tags.php?taxonomy=destination&post_type=tour6.6067.23
All Tours /wp-admin/edit.php?post_type=tour6.6967.13
Activity /wp-admin/edit-tags.php?taxonomy=activity&post_type=tour6.6066.40
Import/Export /wp-admin/admin.php?page=yatra_import_export6.5764.53
Home /wp-admin/admin.php?page=yatra-dashboard6.6175.71
Status /wp-admin/admin.php?page=yatra-status7.395,356.97
Coupons /wp-admin/edit.php?post_type=yatra-coupons6.6972.60
Enquiries /wp-admin/admin.php?page=enquiries6.6067.17
Customers /wp-admin/edit.php?post_type=yatra-customers6.7666.95
Bookings /wp-admin/edit.php?post_type=yatra-booking6.7763.40

Server storage [IO: ▲6.07MB] [DB: ▲0.25MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 527 new files
Database: 4 new tables, 34 new options
New tables
wp_yatra_logs
wp_yatra_tour_enquiries
wp_yatra_tour_dates
wp_yatra_tour_booking_stats
New WordPress options
yatra_plugin_version
widget_yatra-tour-widget
yatra_setup_wizard_ran
yatra_update_cart_text
db_upgraded
yatra_booking_form_title_text
yatra_booknow_loading_text
yatra_checkout_page
can_compress_scripts
yatra_payment_gateways
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Best Travel Booking WordPress Plugin, Tour Booking System, Trip Booking WordPress Plugin - Yatra
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,490 ▲72917.20 ▲2.9718.32 ▲16.5532.39 ▼8.73
Dashboard /wp-admin2,614 ▲4346.91 ▲1.29131.27 ▲39.6591.90 ▲47.80
Posts /wp-admin/edit.php2,563 ▲4664.60 ▲2.5767.66 ▲31.9385.88 ▲49.34
Add New Post /wp-admin/post-new.php6,452 ▲4,92624.44 ▲1.48919.10 ▲235.1739.49 ▼29.12
Media Library /wp-admin/upload.php1,695 ▲2954.87 ▲0.7698.06 ▼22.8081.16 ▲32.49
Destination /wp-admin/edit-tags.php?taxonomy=destination&post_type=tour1,7984.6451.36101.27
All Tours /wp-admin/edit.php?post_type=tour1,6445.1574.3574.59
Activity /wp-admin/edit-tags.php?taxonomy=activity&post_type=tour1,7864.5351.0692.64
Import/Export /wp-admin/admin.php?page=yatra_import_export1,3704.7951.8173.50
Home /wp-admin/admin.php?page=yatra-dashboard1,75710.77265.0992.15
Status /wp-admin/admin.php?page=yatra-status2,5044.5050.23113.99
Coupons /wp-admin/edit.php?post_type=yatra-coupons1,5934.5758.9568.28
Enquiries /wp-admin/admin.php?page=enquiries1,4934.5248.7186.62
Customers /wp-admin/edit.php?post_type=yatra-customers1,5754.6255.7470.81
Bookings /wp-admin/edit.php?post_type=yatra-booking1,5874.5657.5973.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_yatra_tour_enquiries
    • wp_yatra_tour_booking_stats
    • wp_yatra_logs
    • wp_yatra_tour_dates
  • This plugin did not uninstall successfully, leaving 34 options in the database
    • yatra_update_cart_text
    • yatra_cart_page
    • yatra_booknow_button_text
    • widget_theysaidso_widget
    • yatra_custom_attributes_title_text
    • yatra_enable_guest_checkout
    • yatra_setup_wizard_ran
    • widget_recent-comments
    • yatra_failed_transaction_page
    • yatra_enquiry_button_text
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Please fix the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/yatra/includes/admin/templates/metabox/tour/tab.php
    • > /wp-content/plugins/yatra/templates/myaccount/tmpl-pricing-footer.php
    • > /wp-content/plugins/yatra/includes/admin/templates/addon/list.php
  • 197× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/yatra/includes/admin/templates/metabox/tour/tab-content.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'YATRA_ABSPATHincludes/payment-gateways/booking-only/class-yatra-payment-gateway-booking-only.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/yatra/includes/payment-gateways/class-yatra-gateways-core.php on line 30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function yatra_get_booking_statuses() in wp-content/plugins/yatra/includes/admin/templates/metabox/booking/status.php:3
    • > PHP Warning
      include_once(YATRA_ABSPATHincludes/modules/filters/includes/class-yatra-filter-query.php): failed to open stream: No such file or directory in wp-content/plugins/yatra/includes/modules/filters/class-yatra-module-filters.php on line 16
    • > PHP Warning
      include_once(YATRA_ABSPATHincludes/modules/filters/includes/sections/class-yatra-module-filter-section-activities.php): failed to open stream: No such file or directory in wp-content/plugins/yatra/includes/modules/filters/includes/class-yatra-module-filter-sidebar.php on line 17
    • > PHP Notice
      Undefined variable: multiple_pricing in wp-content/plugins/yatra/includes/admin/templates/metabox/tour/pricing/group-pricing.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Yatra_Widget_Base' not found in wp-content/plugins/yatra/includes/widgets/class-yatra-activity-widget.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Yatra_Module_Filter_Sections' not found in wp-content/plugins/yatra/includes/modules/filters/includes/sections/class-yatra-module-filter-section-duration.php:3
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/yatra/templates/tour/attributes-textarea.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function yatra_get_minimum_tour_pricing() in wp-content/plugins/yatra/templates/parts/price.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: travel-agency, travel, tour-operator, travel-booking, tour-booking

yatra/yatra.php Passed 13 tests

"Best Travel Booking WordPress Plugin, Tour Booking System, Trip Booking WordPress Plugin - Yatra" version 2.1.16's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
129 characters long description:
Yatra is a free travel & tour booking WordPress plugin to create travel and tour packages for tour operators and travel agencies.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/yatra/includes/payment-gateways/paypal/php-paypal-ipn/cert/api_cert_chain.crt
80,417 lines of code in 485 files:
LanguageFilesBlank linesComment linesLines of code
PHP2929,5446,73431,323
JavaScript1202,7961,77726,643
CSS353,73122318,650
Sass3580133,698
JSON20095
Markdown1208

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity16.66
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity90.00
Code structure
Namespaces12
Interfaces6
Traits0
Classes166
▷ Abstract classes169.64%
▷ Concrete classes15090.36%
▷ Final classes74.67%
Methods1,444
▷ Static methods24316.83%
▷ Public methods1,26787.74%
▷ Protected methods755.19%
▷ Private methods1027.06%
Functions213
▷ Named functions20998.12%
▷ Anonymous functions41.88%
Constants51
▷ Global constants1733.33%
▷ Class constants3466.67%
▷ Public constants34100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/menu-icon.png1.18KB0.48KB▼ 59.62%
assets/images/promo-icon.png9.50KB4.71KB▼ 50.37%
assets/images/upload-image.png2.57KB1.94KB▼ 24.52%
assets/admin/images/addons/placeholder.png11.23KB5.37KB▼ 52.22%
assets/lib/lightbox2/images/next.png1.32KB1.58KB0.00%