| @@ -348,8 +348,16 @@ | ||
| 348 | 348 | * Plugin deactivation |
| 349 | 349 | */ |
| 350 | 350 | public function deactivate(): void |
| 351 | 351 | { |
| 352 | + // Clear the booking maintenance sweeps so a deactivated plugin leaves no | |
| 353 | + // orphan events behind in WP-Cron. They are re-scheduled on `init` when | |
| 354 | + // the plugin is active again; the expiry activation floor is an option, | |
| 355 | + // so it survives and still protects pre-existing bookings. | |
| 356 | + foreach (['yatra_booking_expiry', 'yatra_booking_reminder', 'yatra_booking_completion'] as $hook) { | |
| 357 | + wp_clear_scheduled_hook($hook); | |
| 358 | + } | |
| 359 | + | |
| 352 | 360 | // Clean up if needed |
| 353 | 361 | flush_rewrite_rules(); |
| 354 | 362 | } |
| 355 | 363 | |
| @@ -370,10 +378,13 @@ | ||
| 370 | 378 | if (file_exists(WP_LANG_DIR . '/loco/plugins/yatra-' . $locale . '.mo')) { |
| 371 | 379 | load_textdomain('yatra', WP_LANG_DIR . '/loco/plugins/yatra-' . $locale . '.mo'); |
| 372 | 380 | } |
| 373 | 381 | |
| 374 | - // Load from plugin directory (fallback) | |
| 375 | - load_plugin_textdomain('yatra', false, 'i18n/languages'); | |
| 382 | + // Load from the plugin's own i18n/languages folder (fallback). The 3rd | |
| 383 | + // arg is relative to WP_PLUGIN_DIR, so it MUST include the plugin folder | |
| 384 | + // name — a bare 'i18n/languages' resolves to wp-content/plugins/i18n/ | |
| 385 | + // languages (which doesn't exist), so bundled translations never load. | |
| 386 | + load_plugin_textdomain('yatra', false, dirname(YATRA_PLUGIN_BASENAME) . '/i18n/languages'); | |
| 376 | 387 | } |
| 377 | 388 | |
| 378 | 389 | /** |
| 379 | 390 | * Get container instance |