| 1 |
<?php |
| 2 |
/** |
| 3 |
* Yatra Pro Compatibility Checker |
| 4 |
* |
| 5 |
* Checks for old individual plugins and shows notice to upgrade to Yatra Pro 2.0.0 |
| 6 |
* |
| 7 |
* @package Yatra |
| 8 |
* @since 2.0.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
if (!defined('ABSPATH')) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
class Yatra_Pro_Compatibility |
| 16 |
{ |
| 17 |
/** |
| 18 |
* List of old individual plugins that are now integrated into Yatra Pro 2.0.0 |
| 19 |
*/ |
| 20 |
private $old_plugins = [ |
| 21 |
'yatra-downloads/yatra-downloads.php', |
| 22 |
'yatra-2checkout/yatra-2checkout.php', |
| 23 |
'yatra-authorizenet/yatra-authorizenet.php', |
| 24 |
'yatra-availability-conditions/yatra-availability-conditions.php', |
| 25 |
'yatra-google-calendar/yatra-google-calendar.php', |
| 26 |
'yatra-partial-payment/yatra-partial-payment.php', |
| 27 |
'yatra-razorpay/yatra-razorpay.php', |
| 28 |
'yatra-review/yatra-review.php', |
| 29 |
'yatra-services/yatra-services.php', |
| 30 |
'yatra-square/yatra-square.php', |
| 31 |
'yatra-stripe/yatra-stripe.php' |
| 32 |
]; |
| 33 |
|
| 34 |
/** |
| 35 |
* Plugin names for display |
| 36 |
*/ |
| 37 |
private $plugin_names = [ |
| 38 |
'yatra-downloads/yatra-downloads.php' => 'Yatra Downloads', |
| 39 |
'yatra-2checkout/yatra-2checkout.php' => 'Yatra 2Checkout', |
| 40 |
'yatra-authorizenet/yatra-authorizenet.php' => 'Yatra AuthorizeNet', |
| 41 |
'yatra-availability-conditions/yatra-availability-conditions.php' => 'Yatra Availability Conditions', |
| 42 |
'yatra-google-calendar/yatra-google-calendar.php' => 'Yatra Google Calendar', |
| 43 |
'yatra-partial-payment/yatra-partial-payment.php' => 'Yatra Partial Payment', |
| 44 |
'yatra-razorpay/yatra-razorpay.php' => 'Yatra Razorpay', |
| 45 |
'yatra-review/yatra-review.php' => 'Yatra Review', |
| 46 |
'yatra-services/yatra-services.php' => 'Yatra Services', |
| 47 |
'yatra-square/yatra-square.php' => 'Yatra Square', |
| 48 |
'yatra-stripe/yatra-stripe.php' => 'Yatra Stripe' |
| 49 |
]; |
| 50 |
|
| 51 |
/** |
| 52 |
* Mapping of old plugins to Yatra Pro features |
| 53 |
*/ |
| 54 |
private $plugin_to_feature_mapping = [ |
| 55 |
'yatra-downloads/yatra-downloads.php' => 'downloads', |
| 56 |
'yatra-2checkout/yatra-2checkout.php' => 'payment_gateways', |
| 57 |
'yatra-authorizenet/yatra-authorizenet.php' => 'payment_gateways', |
| 58 |
'yatra-availability-conditions/yatra-availability-conditions.php' => 'availability_conditions', |
| 59 |
'yatra-google-calendar/yatra-google-calendar.php' => 'google_calendar', |
| 60 |
'yatra-partial-payment/yatra-partial-payment.php' => 'partial_payment', |
| 61 |
'yatra-razorpay/yatra-razorpay.php' => 'payment_gateways', |
| 62 |
'yatra-review/yatra-review.php' => 'review_ratings', |
| 63 |
'yatra-services/yatra-services.php' => 'services', |
| 64 |
'yatra-square/yatra-square.php' => 'payment_gateways', |
| 65 |
'yatra-stripe/yatra-stripe.php' => 'payment_gateways' |
| 66 |
]; |
| 67 |
|
| 68 |
/** |
| 69 |
* Constructor |
| 70 |
*/ |
| 71 |
public function __construct() |
| 72 |
{ |
| 73 |
add_action('admin_init', array($this, 'check_compatibility')); |
| 74 |
add_action('admin_notices', array($this, 'show_compatibility_notice')); |
| 75 |
add_action('wp_ajax_yatra_enable_feature_and_deactivate', array($this, 'handle_enable_feature_and_deactivate')); |
| 76 |
add_action('wp_ajax_yatra_go_to_features', array($this, 'handle_go_to_features')); |
| 77 |
add_action('wp_ajax_yatra_activate_pro', array($this, 'handle_activate_pro')); |
| 78 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); |
| 79 |
} |
| 80 |
|
| 81 |
/** |
| 82 |
* Check if any old plugins are active |
| 83 |
* |
| 84 |
* @return array Array of active old plugins |
| 85 |
*/ |
| 86 |
public function get_active_old_plugins() |
| 87 |
{ |
| 88 |
$active_plugins = get_option('active_plugins', array()); |
| 89 |
$active_old_plugins = array(); |
| 90 |
|
| 91 |
foreach ($this->old_plugins as $plugin) { |
| 92 |
if (in_array($plugin, $active_plugins)) { |
| 93 |
$active_old_plugins[] = $plugin; |
| 94 |
} |
| 95 |
} |
| 96 |
|
| 97 |
return $active_old_plugins; |
| 98 |
} |
| 99 |
|
| 100 |
/** |
| 101 |
* Check if all old plugins are deactivated |
| 102 |
* |
| 103 |
* @return bool True if all old plugins are deactivated |
| 104 |
*/ |
| 105 |
public function are_all_old_plugins_deactivated() |
| 106 |
{ |
| 107 |
$active_old_plugins = $this->get_active_old_plugins(); |
| 108 |
return empty($active_old_plugins); |
| 109 |
} |
| 110 |
|
| 111 |
/** |
| 112 |
* Get plugin display name |
| 113 |
* |
| 114 |
* @param string $plugin_file Plugin file path |
| 115 |
* @return string Plugin display name |
| 116 |
*/ |
| 117 |
public function get_plugin_display_name($plugin_file) |
| 118 |
{ |
| 119 |
return isset($this->plugin_names[$plugin_file]) ? $this->plugin_names[$plugin_file] : $plugin_file; |
| 120 |
} |
| 121 |
|
| 122 |
/** |
| 123 |
* Check compatibility on admin init |
| 124 |
*/ |
| 125 |
public function check_compatibility() |
| 126 |
{ |
| 127 |
// Only show notice if there are active old plugins |
| 128 |
if (!$this->are_all_old_plugins_deactivated()) { |
| 129 |
add_action('admin_notices', array($this, 'show_compatibility_notice')); |
| 130 |
} |
| 131 |
} |
| 132 |
|
| 133 |
/** |
| 134 |
* Show compatibility notice |
| 135 |
*/ |
| 136 |
public function show_compatibility_notice() |
| 137 |
{ |
| 138 |
$active_old_plugins = $this->get_active_old_plugins(); |
| 139 |
|
| 140 |
if (empty($active_old_plugins)) { |
| 141 |
return; |
| 142 |
} |
| 143 |
|
| 144 |
$plugin_names = array(); |
| 145 |
foreach ($active_old_plugins as $plugin) { |
| 146 |
$plugin_names[] = $this->get_plugin_display_name($plugin); |
| 147 |
} |
| 148 |
|
| 149 |
$plugin_list = implode(', ', $plugin_names); |
| 150 |
$plugin_count = count($active_old_plugins); |
| 151 |
$yatra_pro_status = $this->get_yatra_pro_status(); |
| 152 |
|
| 153 |
// Different messages based on Yatra Pro status |
| 154 |
if ($yatra_pro_status['needs_installation']) { |
| 155 |
$message = sprintf( |
| 156 |
/* translators: %s: comma-separated list of legacy Yatra add-on plugin names that now ship with Yatra Pro 2.0. */ |
| 157 |
_n( |
| 158 |
'The following plugin has been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. To use these features, you need to install Yatra Pro 2.0.0. <em>Note: Updates for this plugin will only be available in Yatra Pro from now onwards.</em>', |
| 159 |
'The following plugins have been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. To use these features, you need to install Yatra Pro 2.0.0. <em>Note: Updates for these plugins will only be available in Yatra Pro from now onwards.</em>', |
| 160 |
$plugin_count, |
| 161 |
'yatra' |
| 162 |
), |
| 163 |
$plugin_list |
| 164 |
); |
| 165 |
} elseif ($yatra_pro_status['needs_activation']) { |
| 166 |
$message = sprintf( |
| 167 |
/* translators: %s: comma-separated list of legacy Yatra add-on plugin names that now ship with Yatra Pro 2.0. */ |
| 168 |
_n( |
| 169 |
'The following plugin has been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. Please activate Yatra Pro 2.0.0 to use these features. <em>Note: Updates for this plugin will only be available in Yatra Pro from now onwards.</em>', |
| 170 |
'The following plugins have been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. Please activate Yatra Pro 2.0.0 to use these features. <em>Note: Updates for these plugins will only be available in Yatra Pro from now onwards.</em>', |
| 171 |
$plugin_count, |
| 172 |
'yatra' |
| 173 |
), |
| 174 |
$plugin_list |
| 175 |
); |
| 176 |
} elseif ($yatra_pro_status['needs_upgrade']) { |
| 177 |
$message = sprintf( |
| 178 |
/* translators: %s: comma-separated list of legacy Yatra add-on plugin names that now ship with Yatra Pro 2.0. */ |
| 179 |
_n( |
| 180 |
'The following plugin has been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. Please upgrade Yatra Pro to version 2.0.0 or higher to use these features. <em>Note: Updates for this plugin will only be available in Yatra Pro from now onwards.</em>', |
| 181 |
'The following plugins have been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. Please upgrade Yatra Pro to version 2.0.0 or higher to use these features. <em>Note: Updates for these plugins will only be available in Yatra Pro from now onwards.</em>', |
| 182 |
$plugin_count, |
| 183 |
'yatra' |
| 184 |
), |
| 185 |
$plugin_list |
| 186 |
); |
| 187 |
} else { |
| 188 |
$message = sprintf( |
| 189 |
/* translators: %s: comma-separated list of legacy Yatra add-on plugin names that now ship with Yatra Pro 2.0. */ |
| 190 |
_n( |
| 191 |
'The following plugin has been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. Please make sure you have updated Yatra Pro to version 2.0.0, enable the related features, and deactivate this plugin. <em>Note: Updates for this plugin will only be available in Yatra Pro from now onwards.</em>', |
| 192 |
'The following plugins have been integrated into Yatra Pro 2.0.0 and onwards: <strong>%s</strong>. Please make sure you have updated Yatra Pro to version 2.0.0, enable the related features, and deactivate these plugins. <em>Note: Updates for these plugins will only be available in Yatra Pro from now onwards.</em>', |
| 193 |
$plugin_count, |
| 194 |
'yatra' |
| 195 |
), |
| 196 |
$plugin_list |
| 197 |
); |
| 198 |
} |
| 199 |
|
| 200 |
?> |
| 201 |
<div class="notice notice-warning is-dismissible yatra-pro-compatibility-notice" style="border-left: 4px solid #f0b849; background: linear-gradient(135deg, #fff8e1 0%, #fffbf0 100%); box-shadow: 0 2px 8px rgba(240, 184, 73, 0.15); margin: 20px 0; padding: 20px;"> |
| 202 |
<div style="display: flex; align-items: flex-start; gap: 15px;"> |
| 203 |
<div style="flex-shrink: 0; margin-top: 2px;"> |
| 204 |
<span class="dashicons dashicons-warning" style="font-size: 24px; color: #f0b849; text-shadow: 0 1px 2px rgba(240, 184, 73, 0.3);"></span> |
| 205 |
</div> |
| 206 |
<div style="flex: 1;"> |
| 207 |
<h3 style="margin: 0 0 12px 0; color: #8a6914; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px;"> |
| 208 |
<span class="dashicons dashicons-update" style="color: #f0b849; animation: pulse 2s ease-in-out infinite;"></span> |
| 209 |
<?php _e('Yatra Pro 2.0.0 Compatibility Update', 'yatra'); ?> |
| 210 |
</h3> |
| 211 |
<div style="background: rgba(255, 255, 255, 0.7); padding: 15px; border-radius: 8px; border: 1px solid rgba(240, 184, 73, 0.2); margin-bottom: 15px;"> |
| 212 |
<p style="margin: 0; color: #5d4e37; line-height: 1.6; font-size: 14px;"> |
| 213 |
<?php echo $message; ?> |
| 214 |
</p> |
| 215 |
</div> |
| 216 |
|
| 217 |
<div style="display: flex; flex-wrap: wrap; gap: 10px; align-items: center;"> |
| 218 |
<?php if ($yatra_pro_status['is_compatible']): ?> |
| 219 |
<button type="button" class="button button-primary yatra-enable-feature-btn" data-nonce="<?php echo wp_create_nonce('yatra_enable_feature'); ?>" style="background: linear-gradient(135deg, #0073aa 0%, #005a87 100%); border: none; border-radius: 6px; padding: 10px 16px; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3); transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 6px;"> |
| 220 |
<span class="dashicons dashicons-yes-alt" style="font-size: 16px; line-height: 1;"></span> |
| 221 |
<span><?php _e('Enable Feature & Deactivate', 'yatra'); ?></span> |
| 222 |
</button> |
| 223 |
|
| 224 |
<button type="button" class="button button-secondary yatra-go-to-features-btn" data-nonce="<?php echo wp_create_nonce('yatra_go_to_features'); ?>" style="background: linear-gradient(135deg, #f0f0f1 0%, #e8e8e9 100%); border: 1px solid #c3c4c7; border-radius: 6px; padding: 10px 16px; font-weight: 600; color: #50575e; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 6px;"> |
| 225 |
<span class="dashicons dashicons-admin-generic" style="font-size: 16px; line-height: 1;"></span> |
| 226 |
<span><?php _e('Go to Features', 'yatra'); ?></span> |
| 227 |
</button> |
| 228 |
<?php elseif ($yatra_pro_status['needs_installation']): ?> |
| 229 |
<a href="https://store.mantrabrain.com/account" target="_blank" class="button button-primary" style="background: linear-gradient(135deg, #0073aa 0%, #005a87 100%); border: none; border-radius: 6px; padding: 10px 16px; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3); transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;"> |
| 230 |
<span class="dashicons dashicons-download" style="font-size: 16px; line-height: 1;"></span> |
| 231 |
<span><?php _e('Download Yatra Pro', 'yatra'); ?></span> |
| 232 |
</a> |
| 233 |
|
| 234 |
<a href="https://wpyatra.com/pricing/" target="_blank" class="button button-secondary" style="background: linear-gradient(135deg, #f0f0f1 0%, #e8e8e9 100%); border: 1px solid #c3c4c7; border-radius: 6px; padding: 10px 16px; font-weight: 600; color: #50575e; text-decoration: none; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 6px;"> |
| 235 |
<span class="dashicons dashicons-cart" style="font-size: 16px; line-height: 1;"></span> |
| 236 |
<span><?php _e('Purchase License', 'yatra'); ?></span> |
| 237 |
</a> |
| 238 |
<?php elseif ($yatra_pro_status['needs_activation']): ?> |
| 239 |
<button type="button" class="button button-primary yatra-activate-pro-btn" data-nonce="<?php echo wp_create_nonce('yatra_activate_pro'); ?>" style="background: linear-gradient(135deg, #0073aa 0%, #005a87 100%); border: none; border-radius: 6px; padding: 10px 16px; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3); transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 6px;"> |
| 240 |
<span class="dashicons dashicons-yes" style="font-size: 16px; line-height: 1;"></span> |
| 241 |
<span><?php echo esc_js(__('Activate Yatra Pro', 'yatra')); ?></span> |
| 242 |
</button> |
| 243 |
<?php elseif ($yatra_pro_status['needs_upgrade']): ?> |
| 244 |
<a href="https://store.mantrabrain.com/account" target="_blank" class="button button-primary" style="background: linear-gradient(135deg, #0073aa 0%, #005a87 100%); border: none; border-radius: 6px; padding: 10px 16px; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3); transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;"> |
| 245 |
<span class="dashicons dashicons-admin-network" style="font-size: 16px; line-height: 1;"></span> |
| 246 |
<span><?php _e('Manage License', 'yatra'); ?></span> |
| 247 |
</a> |
| 248 |
|
| 249 |
<a href="https://store.mantrabrain.com/account" target="_blank" class="button button-secondary" style="background: linear-gradient(135deg, #f0f0f1 0%, #e8e8e9 100%); border: 1px solid #c3c4c7; border-radius: 6px; padding: 10px 16px; font-weight: 600; color: #50575e; text-decoration: none; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 6px;"> |
| 250 |
<span class="dashicons dashicons-download" style="font-size: 16px; line-height: 1;"></span> |
| 251 |
<span><?php _e('Download Latest', 'yatra'); ?></span> |
| 252 |
</a> |
| 253 |
<?php endif; ?> |
| 254 |
|
| 255 |
<a href="<?php echo admin_url('plugins.php'); ?>" class="button button-secondary" style="background: linear-gradient(135deg, #f0f0f1 0%, #e8e8e9 100%); border: 1px solid #c3c4c7; border-radius: 6px; padding: 10px 16px; font-weight: 600; color: #50575e; text-decoration: none; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 6px;"> |
| 256 |
<span class="dashicons dashicons-admin-plugins" style="font-size: 16px; line-height: 1;"></span> |
| 257 |
<span><?php _e('Go to Plugins Page', 'yatra'); ?></span> |
| 258 |
</a> |
| 259 |
</div> |
| 260 |
|
| 261 |
<div style="margin-top: 15px; padding: 12px; background: rgba(240, 184, 73, 0.1); border-radius: 6px; border-left: 3px solid #f0b849;"> |
| 262 |
<p style="margin: 0; color: #8a6914; font-size: 13px; font-style: italic;"> |
| 263 |
<span class="dashicons dashicons-info" style="margin-right: 6px; color: #f0b849;"></span> |
| 264 |
<?php |
| 265 |
if ($yatra_pro_status['is_compatible']) { |
| 266 |
_e('This will automatically deactivate the old plugins and enable the corresponding features in Yatra Pro 2.0.0. Future updates for these plugins will only be available in Yatra Pro.', 'yatra'); |
| 267 |
} elseif ($yatra_pro_status['needs_installation']) { |
| 268 |
_e('Yatra Pro 2.0.0 is required to use these integrated features. Download Yatra Pro from your account at store.mantrabrain.com/account or purchase a license to unlock all premium functionality and receive future updates.', 'yatra'); |
| 269 |
} elseif ($yatra_pro_status['needs_activation']) { |
| 270 |
_e('Yatra Pro is installed but not activated. Activate it to use the integrated features and receive future updates.', 'yatra'); |
| 271 |
} elseif ($yatra_pro_status['needs_upgrade']) { |
| 272 |
_e('Your Yatra Pro version is outdated. Manage your license to upgrade to version 2.0.0 or higher, or download the latest version from your account to use these features and receive future updates.', 'yatra'); |
| 273 |
} |
| 274 |
?> |
| 275 |
</p> |
| 276 |
</div> |
| 277 |
|
| 278 |
<?php if ($yatra_pro_status['needs_installation']): ?> |
| 279 |
<div style="margin-top: 15px; padding: 15px; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border-radius: 8px; border: 1px solid #dee2e6;"> |
| 280 |
<h4 style="margin: 0 0 10px 0; color: #495057; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px;"> |
| 281 |
<span class="dashicons dashicons-admin-tools" style="color: #0073aa;"></span> |
| 282 |
<?php _e('Installation Instructions:', 'yatra'); ?> |
| 283 |
</h4> |
| 284 |
<ol style="margin: 0; padding-left: 20px; color: #6c757d; font-size: 13px; line-height: 1.6;"> |
| 285 |
<li><?php _e('Click "Download Yatra Pro" to go to your account page', 'yatra'); ?></li> |
| 286 |
<li><?php _e('Download the Yatra Pro plugin file from your account', 'yatra'); ?></li> |
| 287 |
<li><?php _e('Go to WordPress Admin → Plugins → Add New → Upload Plugin', 'yatra'); ?></li> |
| 288 |
<li><?php _e('Upload and activate the Yatra Pro plugin', 'yatra'); ?></li> |
| 289 |
<li><?php _e('Return here and click "Enable Feature & Deactivate" to migrate your old plugins', 'yatra'); ?></li> |
| 290 |
</ol> |
| 291 |
</div> |
| 292 |
<?php endif; ?> |
| 293 |
|
| 294 |
<?php if ($yatra_pro_status['needs_upgrade']): ?> |
| 295 |
<div style="margin-top: 15px; padding: 15px; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border-radius: 8px; border: 1px solid #dee2e6;"> |
| 296 |
<h4 style="margin: 0 0 10px 0; color: #495057; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px;"> |
| 297 |
<span class="dashicons dashicons-admin-network" style="color: #0073aa;"></span> |
| 298 |
<?php _e('Upgrade Instructions:', 'yatra'); ?> |
| 299 |
</h4> |
| 300 |
<ol style="margin: 0; padding-left: 20px; color: #6c757d; font-size: 13px; line-height: 1.6;"> |
| 301 |
<li><?php _e('Click "Manage License" to access your license settings', 'yatra'); ?></li> |
| 302 |
<li><?php _e('Check your license status and update if needed', 'yatra'); ?></li> |
| 303 |
<li><?php _e('Click "Download Latest" to get the newest version from your account', 'yatra'); ?></li> |
| 304 |
<li><?php _e('Upload and activate the updated Yatra Pro plugin', 'yatra'); ?></li> |
| 305 |
<li><?php _e('Return here and click "Enable Feature & Deactivate" to migrate your old plugins', 'yatra'); ?></li> |
| 306 |
</ol> |
| 307 |
</div> |
| 308 |
<?php endif; ?> |
| 309 |
</div> |
| 310 |
</div> |
| 311 |
|
| 312 |
<div class="yatra-compatibility-status" style="display: none; margin-top: 15px; padding: 15px; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border-radius: 8px; border: 1px solid #dee2e6;"> |
| 313 |
<p class="yatra-status-message" style="margin: 0; font-weight: 500; display: flex; align-items: center; gap: 8px;"></p> |
| 314 |
</div> |
| 315 |
</div> |
| 316 |
|
| 317 |
<style> |
| 318 |
@keyframes pulse { |
| 319 |
0%, 100% { opacity: 1; transform: scale(1); } |
| 320 |
50% { opacity: 0.7; transform: scale(1.05); } |
| 321 |
} |
| 322 |
|
| 323 |
.yatra-pro-compatibility-notice .button:hover { |
| 324 |
transform: translateY(-1px); |
| 325 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); |
| 326 |
} |
| 327 |
|
| 328 |
.yatra-pro-compatibility-notice .button-primary:hover { |
| 329 |
background: linear-gradient(135deg, #005a87 0%, #004a70 100%) !important; |
| 330 |
} |
| 331 |
|
| 332 |
.yatra-pro-compatibility-notice .button-secondary:hover { |
| 333 |
background: linear-gradient(135deg, #e8e8e9 0%, #dcdcde 100%) !important; |
| 334 |
border-color: #8c8f94 !important; |
| 335 |
} |
| 336 |
</style> |
| 337 |
<?php |
| 338 |
} |
| 339 |
|
| 340 |
/** |
| 341 |
* Get list of all old plugins (for reference) |
| 342 |
* |
| 343 |
* @return array Array of all old plugin files |
| 344 |
*/ |
| 345 |
public function get_all_old_plugins() |
| 346 |
{ |
| 347 |
return $this->old_plugins; |
| 348 |
} |
| 349 |
|
| 350 |
/** |
| 351 |
* Get plugin names mapping (for reference) |
| 352 |
* |
| 353 |
* @return array Array of plugin file to display name mapping |
| 354 |
*/ |
| 355 |
public function get_plugin_names() |
| 356 |
{ |
| 357 |
return $this->plugin_names; |
| 358 |
} |
| 359 |
|
| 360 |
/** |
| 361 |
* Check if a specific plugin is active |
| 362 |
* |
| 363 |
* @param string $plugin_file Plugin file path |
| 364 |
* @return bool True if plugin is active |
| 365 |
*/ |
| 366 |
public function is_plugin_active($plugin_file) |
| 367 |
{ |
| 368 |
$active_plugins = get_option('active_plugins', array()); |
| 369 |
return in_array($plugin_file, $active_plugins); |
| 370 |
} |
| 371 |
|
| 372 |
/** |
| 373 |
* Get compatibility status |
| 374 |
* |
| 375 |
* @return array Array with compatibility information |
| 376 |
*/ |
| 377 |
public function get_compatibility_status() |
| 378 |
{ |
| 379 |
$active_old_plugins = $this->get_active_old_plugins(); |
| 380 |
|
| 381 |
return array( |
| 382 |
'is_compatible' => $this->are_all_old_plugins_deactivated(), |
| 383 |
'active_old_plugins' => $active_old_plugins, |
| 384 |
'active_old_plugins_count' => count($active_old_plugins), |
| 385 |
'all_old_plugins' => $this->old_plugins, |
| 386 |
'plugin_names' => $this->plugin_names |
| 387 |
); |
| 388 |
} |
| 389 |
|
| 390 |
/** |
| 391 |
* Enqueue scripts and styles |
| 392 |
*/ |
| 393 |
public function enqueue_scripts() |
| 394 |
{ |
| 395 |
if (!$this->are_all_old_plugins_deactivated()) { |
| 396 |
$this->inline_scripts(); |
| 397 |
} |
| 398 |
} |
| 399 |
|
| 400 |
/** |
| 401 |
* Output inline scripts |
| 402 |
*/ |
| 403 |
private function inline_scripts() |
| 404 |
{ |
| 405 |
$processing_text = esc_js(__('Processing...', 'yatra')); |
| 406 |
$deactivating_text = esc_js(__('Deactivating plugins and enabling features...', 'yatra')); |
| 407 |
$enable_text = esc_js(__('Enable Feature & Deactivate', 'yatra')); |
| 408 |
$error_text = esc_js(__('An error occurred. Please try again.', 'yatra')); |
| 409 |
$activating_text = esc_js(__('Activating...', 'yatra')); |
| 410 |
$activating_pro_text = esc_js(__('Activating Yatra Pro...', 'yatra')); |
| 411 |
$activate_pro_text = esc_js(__('Activate Yatra Pro', 'yatra')); |
| 412 |
|
| 413 |
?> |
| 414 |
<script type="text/javascript"> |
| 415 |
/* Yatra Pro Compatibility Script */ |
| 416 |
(function() { |
| 417 |
'use strict'; |
| 418 |
|
| 419 |
function initYatraCompatibility() { |
| 420 |
if (typeof jQuery === 'undefined') { |
| 421 |
setTimeout(initYatraCompatibility, 100); |
| 422 |
return; |
| 423 |
} |
| 424 |
|
| 425 |
jQuery(document).ready(function($) { |
| 426 |
// Handle Enable Feature & Deactivate button |
| 427 |
$('.yatra-enable-feature-btn').on('click', function(e) { |
| 428 |
e.preventDefault(); |
| 429 |
|
| 430 |
var $btn = $(this); |
| 431 |
var $status = $('.yatra-compatibility-status'); |
| 432 |
var $message = $('.yatra-status-message'); |
| 433 |
var nonce = $btn.data('nonce'); |
| 434 |
|
| 435 |
// Disable button and show loading |
| 436 |
$btn.prop('disabled', true); |
| 437 |
$btn.find('.dashicons').removeClass('dashicons-yes-alt').addClass('dashicons-update').css('animation', 'spin 1s linear infinite'); |
| 438 |
$btn.find('span:not(.dashicons)').text('<?php echo $processing_text; ?>'); |
| 439 |
|
| 440 |
// Show status area |
| 441 |
$status.show(); |
| 442 |
$message.html('<span class="dashicons dashicons-update" style="animation: spin 1s linear infinite;"></span> <?php echo $deactivating_text; ?>'); |
| 443 |
|
| 444 |
$.ajax({ |
| 445 |
url: ajaxurl, |
| 446 |
type: 'POST', |
| 447 |
data: { |
| 448 |
action: 'yatra_enable_feature_and_deactivate', |
| 449 |
nonce: nonce |
| 450 |
}, |
| 451 |
success: function(response) { |
| 452 |
if (response.success) { |
| 453 |
$message.html('<span class="dashicons dashicons-yes" style="color: #46b450;"></span> ' + response.data.message); |
| 454 |
|
| 455 |
// Reload page after 2 seconds |
| 456 |
setTimeout(function() { |
| 457 |
window.location.reload(); |
| 458 |
}, 2000); |
| 459 |
} else { |
| 460 |
$message.html('<span class="dashicons dashicons-warning" style="color: #dc3232;"></span> ' + response.data.message); |
| 461 |
$btn.prop('disabled', false); |
| 462 |
$btn.find('.dashicons').removeClass('dashicons-update').addClass('dashicons-yes-alt').css('animation', ''); |
| 463 |
$btn.find('span:not(.dashicons)').text('<?php echo $enable_text; ?>'); |
| 464 |
} |
| 465 |
}, |
| 466 |
error: function() { |
| 467 |
$message.html('<span class="dashicons dashicons-warning" style="color: #dc3232;"></span> <?php echo $error_text; ?>'); |
| 468 |
$btn.prop('disabled', false); |
| 469 |
$btn.find('.dashicons').removeClass('dashicons-update').addClass('dashicons-yes-alt').css('animation', ''); |
| 470 |
$btn.find('span:not(.dashicons)').text('<?php echo $enable_text; ?>'); |
| 471 |
} |
| 472 |
}); |
| 473 |
}); |
| 474 |
|
| 475 |
// Handle Go to Features button |
| 476 |
$('.yatra-go-to-features-btn').on('click', function(e) { |
| 477 |
e.preventDefault(); |
| 478 |
|
| 479 |
var $btn = $(this); |
| 480 |
var nonce = $btn.data('nonce'); |
| 481 |
|
| 482 |
// Disable button and show loading |
| 483 |
$btn.prop('disabled', true); |
| 484 |
$btn.find('.dashicons').removeClass('dashicons-admin-generic').addClass('dashicons-update').css('animation', 'spin 1s linear infinite'); |
| 485 |
|
| 486 |
$.ajax({ |
| 487 |
url: ajaxurl, |
| 488 |
type: 'POST', |
| 489 |
data: { |
| 490 |
action: 'yatra_go_to_features', |
| 491 |
nonce: nonce |
| 492 |
}, |
| 493 |
success: function(response) { |
| 494 |
if (response.success) { |
| 495 |
window.location.href = response.data.redirect_url; |
| 496 |
} else { |
| 497 |
alert(response.data.message); |
| 498 |
$btn.prop('disabled', false); |
| 499 |
$btn.find('.dashicons').removeClass('dashicons-update').addClass('dashicons-admin-generic').css('animation', ''); |
| 500 |
} |
| 501 |
}, |
| 502 |
error: function() { |
| 503 |
alert('<?php echo $error_text; ?>'); |
| 504 |
$btn.prop('disabled', false); |
| 505 |
$btn.find('.dashicons').removeClass('dashicons-update').addClass('dashicons-admin-generic').css('animation', ''); |
| 506 |
} |
| 507 |
}); |
| 508 |
}); |
| 509 |
|
| 510 |
// Handle Activate Yatra Pro button |
| 511 |
$('.yatra-activate-pro-btn').on('click', function(e) { |
| 512 |
e.preventDefault(); |
| 513 |
|
| 514 |
var $btn = $(this); |
| 515 |
var $status = $('.yatra-compatibility-status'); |
| 516 |
var $message = $('.yatra-status-message'); |
| 517 |
var nonce = $btn.data('nonce'); |
| 518 |
|
| 519 |
// Disable button and show loading |
| 520 |
$btn.prop('disabled', true); |
| 521 |
$btn.find('.dashicons').removeClass('dashicons-yes').addClass('dashicons-update').css('animation', 'spin 1s linear infinite'); |
| 522 |
$btn.find('span:not(.dashicons)').text('<?php echo $activating_text; ?>'); |
| 523 |
|
| 524 |
// Show status area |
| 525 |
$status.show(); |
| 526 |
$message.html('<span class="dashicons dashicons-update" style="animation: spin 1s linear infinite;"></span> <?php echo $activating_pro_text; ?>'); |
| 527 |
|
| 528 |
$.ajax({ |
| 529 |
url: ajaxurl, |
| 530 |
type: 'POST', |
| 531 |
data: { |
| 532 |
action: 'yatra_activate_pro', |
| 533 |
nonce: nonce |
| 534 |
}, |
| 535 |
success: function(response) { |
| 536 |
if (response.success) { |
| 537 |
$message.html('<span class="dashicons dashicons-yes" style="color: #46b450;"></span> ' + response.data.message); |
| 538 |
|
| 539 |
// Reload page after 2 seconds |
| 540 |
setTimeout(function() { |
| 541 |
window.location.reload(); |
| 542 |
}, 2000); |
| 543 |
} else { |
| 544 |
$message.html('<span class="dashicons dashicons-warning" style="color: #dc3232;"></span> ' + response.data.message); |
| 545 |
$btn.prop('disabled', false); |
| 546 |
$btn.find('.dashicons').removeClass('dashicons-update').addClass('dashicons-yes').css('animation', ''); |
| 547 |
$btn.find('span:not(.dashicons)').text('<?php echo $activate_pro_text; ?>'); |
| 548 |
} |
| 549 |
}, |
| 550 |
error: function() { |
| 551 |
$message.html('<span class="dashicons dashicons-warning" style="color: #dc3232;"></span> <?php echo $error_text; ?>'); |
| 552 |
$btn.prop('disabled', false); |
| 553 |
$btn.find('.dashicons').removeClass('dashicons-update').addClass('dashicons-yes').css('animation', ''); |
| 554 |
$btn.find('span:not(.dashicons)').text('<?php echo $activate_pro_text; ?>'); |
| 555 |
} |
| 556 |
}); |
| 557 |
}); |
| 558 |
|
| 559 |
// CSS for spin animation |
| 560 |
var style = document.createElement('style'); |
| 561 |
style.textContent = '@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }'; |
| 562 |
document.head.appendChild(style); |
| 563 |
}); |
| 564 |
} |
| 565 |
|
| 566 |
// Initialize when DOM is ready |
| 567 |
document.addEventListener('DOMContentLoaded', initYatraCompatibility); |
| 568 |
|
| 569 |
// Also try to initialize immediately in case DOM is already ready |
| 570 |
if (document.readyState !== 'loading') { |
| 571 |
initYatraCompatibility(); |
| 572 |
} |
| 573 |
})(); |
| 574 |
</script> |
| 575 |
<?php |
| 576 |
} |
| 577 |
|
| 578 |
/** |
| 579 |
* Handle Enable Feature & Deactivate AJAX request |
| 580 |
*/ |
| 581 |
public function handle_enable_feature_and_deactivate() |
| 582 |
{ |
| 583 |
// Verify nonce |
| 584 |
if (!wp_verify_nonce($_POST['nonce'], 'yatra_enable_feature')) { |
| 585 |
wp_die('Security check failed'); |
| 586 |
} |
| 587 |
|
| 588 |
// Check if user has permission |
| 589 |
if (!current_user_can('activate_plugins')) { |
| 590 |
wp_send_json_error(array('message' => __('You do not have permission to perform this action.', 'yatra'))); |
| 591 |
} |
| 592 |
|
| 593 |
$active_old_plugins = $this->get_active_old_plugins(); |
| 594 |
|
| 595 |
if (empty($active_old_plugins)) { |
| 596 |
wp_send_json_error(array('message' => __('No old plugins found to deactivate.', 'yatra'))); |
| 597 |
} |
| 598 |
|
| 599 |
// Check Yatra Pro status |
| 600 |
$yatra_pro_status = $this->get_yatra_pro_status(); |
| 601 |
|
| 602 |
if ($yatra_pro_status['needs_installation']) { |
| 603 |
wp_send_json_error(array('message' => __('Yatra Pro is not installed. Please install and activate Yatra Pro 2.0.0 first.', 'yatra'))); |
| 604 |
} |
| 605 |
|
| 606 |
if ($yatra_pro_status['needs_activation']) { |
| 607 |
wp_send_json_error(array('message' => __('Yatra Pro is not activated. Please activate Yatra Pro 2.0.0 first.', 'yatra'))); |
| 608 |
} |
| 609 |
|
| 610 |
if ($yatra_pro_status['needs_upgrade']) { |
| 611 |
wp_send_json_error(array('message' => __('Please upgrade Yatra Pro to version 2.0.0 or higher to use this feature.', 'yatra'))); |
| 612 |
} |
| 613 |
|
| 614 |
if (!$yatra_pro_status['is_compatible']) { |
| 615 |
wp_send_json_error(array('message' => __('Yatra Pro 2.0.0 is required but not properly configured.', 'yatra'))); |
| 616 |
} |
| 617 |
|
| 618 |
$deactivated_plugins = array(); |
| 619 |
$enabled_features = array(); |
| 620 |
|
| 621 |
// Deactivate old plugins |
| 622 |
foreach ($active_old_plugins as $plugin) { |
| 623 |
if (is_plugin_active($plugin)) { |
| 624 |
deactivate_plugins($plugin); |
| 625 |
$deactivated_plugins[] = $this->get_plugin_display_name($plugin); |
| 626 |
} |
| 627 |
} |
| 628 |
|
| 629 |
// Enable corresponding features in Yatra Pro |
| 630 |
foreach ($active_old_plugins as $plugin) { |
| 631 |
if (isset($this->plugin_to_feature_mapping[$plugin])) { |
| 632 |
$feature = $this->plugin_to_feature_mapping[$plugin]; |
| 633 |
$this->enable_yatra_pro_feature($feature); |
| 634 |
$enabled_features[] = $feature; |
| 635 |
} |
| 636 |
} |
| 637 |
|
| 638 |
$message = sprintf( |
| 639 |
/* translators: %d: number of legacy add-on plugins that were deactivated. */ |
| 640 |
__('Successfully deactivated %d plugin(s) and enabled corresponding features in Yatra Pro 2.0.0. The page will reload shortly.', 'yatra'), |
| 641 |
count($deactivated_plugins) |
| 642 |
); |
| 643 |
|
| 644 |
wp_send_json_success(array('message' => $message)); |
| 645 |
} |
| 646 |
|
| 647 |
/** |
| 648 |
* Handle Go to Features AJAX request |
| 649 |
*/ |
| 650 |
public function handle_go_to_features() |
| 651 |
{ |
| 652 |
// Verify nonce |
| 653 |
if (!wp_verify_nonce($_POST['nonce'], 'yatra_go_to_features')) { |
| 654 |
wp_die('Security check failed'); |
| 655 |
} |
| 656 |
|
| 657 |
// Check Yatra Pro status |
| 658 |
$yatra_pro_status = $this->get_yatra_pro_status(); |
| 659 |
|
| 660 |
if ($yatra_pro_status['needs_installation']) { |
| 661 |
wp_send_json_error(array('message' => __('Yatra Pro is not installed. Please install and activate Yatra Pro 2.0.0 first.', 'yatra'))); |
| 662 |
} |
| 663 |
|
| 664 |
if ($yatra_pro_status['needs_activation']) { |
| 665 |
wp_send_json_error(array('message' => __('Yatra Pro is not activated. Please activate Yatra Pro 2.0.0 first.', 'yatra'))); |
| 666 |
} |
| 667 |
|
| 668 |
if ($yatra_pro_status['needs_upgrade']) { |
| 669 |
wp_send_json_error(array('message' => __('Please upgrade Yatra Pro to version 2.0.0 or higher to access the features page.', 'yatra'))); |
| 670 |
} |
| 671 |
|
| 672 |
if (!$yatra_pro_status['is_compatible']) { |
| 673 |
wp_send_json_error(array('message' => __('Yatra Pro 2.0.0 is required but not properly configured.', 'yatra'))); |
| 674 |
} |
| 675 |
|
| 676 |
// Redirect to Yatra Pro features page |
| 677 |
$redirect_url = admin_url('admin.php?page=yatra-pro-features'); |
| 678 |
|
| 679 |
wp_send_json_success(array('redirect_url' => $redirect_url)); |
| 680 |
} |
| 681 |
|
| 682 |
/** |
| 683 |
* Handle Activate Yatra Pro AJAX request |
| 684 |
*/ |
| 685 |
public function handle_activate_pro() |
| 686 |
{ |
| 687 |
// Verify nonce |
| 688 |
if (!wp_verify_nonce($_POST['nonce'], 'yatra_activate_pro')) { |
| 689 |
wp_die('Security check failed'); |
| 690 |
} |
| 691 |
|
| 692 |
// Check if user has permission |
| 693 |
if (!current_user_can('activate_plugins')) { |
| 694 |
wp_send_json_error(array('message' => __('You do not have permission to perform this action.', 'yatra'))); |
| 695 |
} |
| 696 |
|
| 697 |
// Check if Yatra Pro is installed |
| 698 |
if (!$this->is_yatra_pro_installed()) { |
| 699 |
wp_send_json_error(array('message' => __('Yatra Pro is not installed. Please install Yatra Pro first.', 'yatra'))); |
| 700 |
} |
| 701 |
|
| 702 |
// Check if Yatra Pro is already activated |
| 703 |
if ($this->is_yatra_pro_activated()) { |
| 704 |
wp_send_json_error(array('message' => __('Yatra Pro is already activated.', 'yatra'))); |
| 705 |
} |
| 706 |
|
| 707 |
// Activate Yatra Pro |
| 708 |
$plugin_file = 'yatra-pro/yatra-pro.php'; |
| 709 |
$result = activate_plugin($plugin_file); |
| 710 |
|
| 711 |
if (is_wp_error($result)) { |
| 712 |
/* translators: %s: WordPress activation error message returned by activate_plugin(). */ |
| 713 |
wp_send_json_error(array('message' => sprintf(__('Failed to activate Yatra Pro: %s', 'yatra'), $result->get_error_message()))); |
| 714 |
} |
| 715 |
|
| 716 |
// Check if activation was successful |
| 717 |
if (!is_plugin_active($plugin_file)) { |
| 718 |
wp_send_json_error(array('message' => __('Yatra Pro activation failed. Please try again.', 'yatra'))); |
| 719 |
} |
| 720 |
|
| 721 |
$message = __('Yatra Pro has been successfully activated! The page will reload shortly.', 'yatra'); |
| 722 |
wp_send_json_success(array('message' => $message)); |
| 723 |
} |
| 724 |
|
| 725 |
/** |
| 726 |
* Get Yatra Pro version |
| 727 |
* |
| 728 |
* @return string|false Yatra Pro version or false if not found |
| 729 |
*/ |
| 730 |
private function get_yatra_pro_version() |
| 731 |
{ |
| 732 |
if (!function_exists('get_plugin_data')) { |
| 733 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 734 |
} |
| 735 |
|
| 736 |
$plugin_file = 'yatra-pro/yatra-pro.php'; |
| 737 |
|
| 738 |
if (is_plugin_active($plugin_file)) { |
| 739 |
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file); |
| 740 |
return isset($plugin_data['Version']) ? $plugin_data['Version'] : false; |
| 741 |
} |
| 742 |
|
| 743 |
return false; |
| 744 |
} |
| 745 |
|
| 746 |
/** |
| 747 |
* Check if Yatra Pro is installed |
| 748 |
* |
| 749 |
* @return bool True if Yatra Pro is installed |
| 750 |
*/ |
| 751 |
private function is_yatra_pro_installed() |
| 752 |
{ |
| 753 |
if (!function_exists('get_plugins')) { |
| 754 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 755 |
} |
| 756 |
|
| 757 |
$plugins = get_plugins(); |
| 758 |
return isset($plugins['yatra-pro/yatra-pro.php']); |
| 759 |
} |
| 760 |
|
| 761 |
/** |
| 762 |
* Check if Yatra Pro is activated |
| 763 |
* |
| 764 |
* @return bool True if Yatra Pro is activated |
| 765 |
*/ |
| 766 |
private function is_yatra_pro_activated() |
| 767 |
{ |
| 768 |
return is_plugin_active('yatra-pro/yatra-pro.php'); |
| 769 |
} |
| 770 |
|
| 771 |
/** |
| 772 |
* Get Yatra Pro installation status |
| 773 |
* |
| 774 |
* @return array Array with installation status information |
| 775 |
*/ |
| 776 |
private function get_yatra_pro_status() |
| 777 |
{ |
| 778 |
$is_installed = $this->is_yatra_pro_installed(); |
| 779 |
$is_activated = $this->is_yatra_pro_activated(); |
| 780 |
$version = $this->get_yatra_pro_version(); |
| 781 |
|
| 782 |
return array( |
| 783 |
'is_installed' => $is_installed, |
| 784 |
'is_activated' => $is_activated, |
| 785 |
'version' => $version, |
| 786 |
'is_compatible' => $is_activated && $version && version_compare($version, '2.0.0', '>='), |
| 787 |
'needs_installation' => !$is_installed, |
| 788 |
'needs_activation' => $is_installed && !$is_activated, |
| 789 |
'needs_upgrade' => $is_activated && $version && version_compare($version, '2.0.0', '<') |
| 790 |
); |
| 791 |
} |
| 792 |
|
| 793 |
/** |
| 794 |
* Enable Yatra Pro feature |
| 795 |
* |
| 796 |
* @param string $feature Feature name to enable |
| 797 |
* @return bool True if feature was enabled successfully |
| 798 |
*/ |
| 799 |
private function enable_yatra_pro_feature($feature) |
| 800 |
{ |
| 801 |
// Get current enabled features |
| 802 |
$enabled_features = get_option('yatra_pro_enabled_features', array()); |
| 803 |
|
| 804 |
// Add the feature if not already enabled |
| 805 |
if (!in_array($feature, $enabled_features)) { |
| 806 |
$enabled_features[] = $feature; |
| 807 |
update_option('yatra_pro_enabled_features', $enabled_features); |
| 808 |
} |
| 809 |
|
| 810 |
// Also enable specific feature settings if needed |
| 811 |
switch ($feature) { |
| 812 |
case 'downloads': |
| 813 |
update_option('yatra_pro_downloads_enabled', 'yes'); |
| 814 |
break; |
| 815 |
case 'payment_gateways': |
| 816 |
update_option('yatra_pro_payment_gateways_enabled', 'yes'); |
| 817 |
break; |
| 818 |
case 'availability_conditions': |
| 819 |
update_option('yatra_pro_availability_conditions_enabled', 'yes'); |
| 820 |
break; |
| 821 |
case 'google_calendar': |
| 822 |
update_option('yatra_pro_google_calendar_enabled', 'yes'); |
| 823 |
break; |
| 824 |
case 'partial_payment': |
| 825 |
update_option('yatra_pro_partial_payment_enabled', 'yes'); |
| 826 |
break; |
| 827 |
case 'review_ratings': |
| 828 |
update_option('yatra_pro_review_ratings_enabled', 'yes'); |
| 829 |
break; |
| 830 |
case 'services': |
| 831 |
update_option('yatra_pro_services_enabled', 'yes'); |
| 832 |
break; |
| 833 |
} |
| 834 |
|
| 835 |
return true; |
| 836 |
} |
| 837 |
|
| 838 |
/** |
| 839 |
* Get plugin to feature mapping |
| 840 |
* |
| 841 |
* @return array Array of plugin to feature mapping |
| 842 |
*/ |
| 843 |
public function get_plugin_to_feature_mapping() |
| 844 |
{ |
| 845 |
return $this->plugin_to_feature_mapping; |
| 846 |
} |
| 847 |
} |
| 848 |
|
| 849 |
// Initialize the compatibility checker |
| 850 |
new Yatra_Pro_Compatibility(); |
| 851 |
|