PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.9
Yatra – Travel Booking & Tour Operator Software v3.0.9
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
yatra / yatra.php

yatra.php in Yatra – Travel Booking & Tour Operator Software 3.0.9, at yatra.php

90 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Yatra - Travel Booking & Tour Operator Software
4 * Plugin URI: https://wpyatra.com/
5 * Description: Tours and activities on WordPress — trips, bookings, PayPal and Pay Later, guest accounts, emails, reports. Yatra Pro adds premium gateways and modules.
6 * Version: 3.0.9
7 * Requires at least: 6.0
8 * Requires PHP: 7.4
9 * Author: MantraBrain
10 * Author URI: https://mantrabrain.com/
11 * License: GPL v2 or later
12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
13 * Text Domain: yatra
14 * Domain Path: /i18n/languages
15 */
16
17 declare(strict_types=1);
18
19 // Prevent direct access
20 if (!defined('ABSPATH')) {
21 exit;
22 }
23
24 require_once __DIR__ . '/includes/php-compat.php';
25
26 // Define plugin constants
27 define('YATRA_PLUGIN_FILE', __FILE__);
28 define('YATRA_PLUGIN_PATH', plugin_dir_path(__FILE__));
29 define('YATRA_PLUGIN_URL', plugin_dir_url(__FILE__));
30 define('YATRA_PLUGIN_BASENAME', plugin_basename(__FILE__));
31 define('YATRA_ABSPATH', plugin_dir_path(__FILE__));
32 define('YATRA_PLUGIN_URI', plugin_dir_url(__FILE__));
33 define('YATRA_VERSION', '3.0.9');
34 define('YATRA_MIN_PHP_VERSION', '7.4');
35 define('YATRA_MIN_WP_VERSION', '6.0');
36
37 /** Sample / preview email verification URL segment (not a real token). */
38 if (!defined('YATRA_EMAIL_VERIFICATION_PREVIEW_TOKEN')) {
39 define('YATRA_EMAIL_VERIFICATION_PREVIEW_TOKEN', 'preview-verify-token');
40 }
41
42 // Deactivate incompatible Yatra Pro (&lt; 3.0) and normalize plugin load order before Composer (prevents fatals from old Pro extending removed classes).
43 require_once YATRA_PLUGIN_PATH . 'includes/incompatible-pro-guard.php';
44 yatra_run_incompatible_pro_guard();
45
46 // Load Composer autoloader
47 $autoloader = YATRA_PLUGIN_PATH . 'vendor/autoload.php';
48 if (!file_exists($autoloader)) {
49 wp_die(
50 'Yatra plugin requires Composer dependencies. From the plugin directory run: composer install --no-dev --optimize-autoloader (or: composer run install:prod).',
51 'Yatra Plugin Error',
52 ['back_link' => true]
53 );
54 }
55 require_once $autoloader;
56
57 // Check minimum requirements
58 if (!\Yatra\Core\Requirements::check()) {
59 return;
60 }
61
62 // Bootstrap the plugin
63 try {
64 if (!class_exists('Yatra\Bootstrap')) {
65 throw new \Exception('Bootstrap class not found. Run composer install --no-dev --optimize-autoloader (or composer run install:prod) in the plugin directory.');
66 }
67
68 $yatra = new \Yatra\Bootstrap();
69 $yatra->init();
70
71 } catch (Throwable $e) {
72 // Use plain strings instead of translation functions to avoid early loading
73 wp_die(
74 sprintf(
75 'Yatra plugin failed to initialize: %s',
76 esc_html($e->getMessage())
77 ),
78 'Yatra Plugin Error',
79 ['back_link' => true]
80 );
81 }
82
83 register_activation_hook(YATRA_PLUGIN_FILE, static function (): void {
84 if (!function_exists('yatra_normalize_yatra_plugins_active_order')) {
85 require_once YATRA_PLUGIN_PATH . 'includes/incompatible-pro-guard.php';
86 }
87 yatra_normalize_yatra_plugins_active_order();
88 yatra_deactivate_incompatible_old_pro();
89 });
90