PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | libraries/system/builder.php +62 -16 1.6.8 → 1.8.16 View file →
@@ -24,8 +24,22 @@
24 24 * @return void
25 25 */
26 26 public static function loadLanguage()
27 27 {
28 + static $loaded = false;
29 +
30 + /**
31 + * Do not load the languages more than once.
32 + *
33 + * @since 1.8.4
34 + */
35 + if ($loaded)
36 + {
37 + return;
38 + }
39 +
40 + $loaded = true;
41 +
28 42 $app = JFactory::getApplication();
29 43
30 44 /**
31 45 * @since 1.0.2 All the language files have been merged
@@ -281,8 +295,9 @@
281 295 * Transaction property can be used to perform refunds, and it's collected
282 296 * and returned during charge/capture transactions only.
283 297 *
284 298 * @since 1.4.0
299 + * @since 1.6.9 added support for "tot_fees".
285 300 */
286 301
287 302 // manipulate the response to be compliant with the old payment system
288 303 $response = array(
@@ -287,8 +302,9 @@
287 302 // manipulate the response to be compliant with the old payment system
288 303 $response = array(
289 304 'verified' => (int) $status->isVerified(),
290 305 'tot_paid' => $status->amount,
306 + 'tot_fees' => $status->fees,
291 307 'log' => $status->log,
292 308 'transaction' => $status->transaction,
293 309 );
294 310
@@ -333,8 +349,28 @@
333 349 'log' => $status->log,
334 350 'transaction' => $status->transaction,
335 351 );
336 352 }, 10, 3);
353 +
354 + // manipulate response to be compliant with the off-session capturing requests
355 + add_action('payment_after_offsession_capture_vikbooking', function($payment, $status, &$response)
356 + {
357 + /**
358 + * Transaction property can be used to perform refunds, and it's collected
359 + * and returned during charge/capture transactions only.
360 + *
361 + * @since 1.8.0
362 + */
363 +
364 + // manipulate the response to be compliant with any platform
365 + $response = array(
366 + 'verified' => (int) $status->isVerified(),
367 + 'tot_paid' => $status->amount,
368 + 'tot_fees' => $status->fees ?? null,
369 + 'log' => $status->log ?? null,
370 + 'transaction' => $status->transaction ?? null,
371 + );
372 + }, 10, 3);
337 373 }
338 374
339 375 /**
340 376 * Registers all the widget contained within the modules folder.
@@ -530,8 +566,21 @@
530 566 * @throws Exception
531 567 */
532 568 add_action('vikbooking_before_import_backup', function($manifest, $path) use ($hasShortcodes)
533 569 {
570 + if (!function_exists('is_plugin_active')) {
571 + require_once ABSPATH . 'wp-admin/includes/plugin.php';
572 + }
573 +
574 + /**
575 + * Abort the backup import process in case Rank Math SEO plugin is installed and active.
576 + *
577 + * @since 1.8
578 + */
579 + if (is_plugin_active('seo-by-rank-math/rank-math.php')) {
580 + throw new Exception('The <strong>Rank Math SEO</strong> plugin appears to be installed on your website. Before proceeding with the restoration, it is necessary to deactivate this plugin. Once the data installation is complete, you will be able to re-enable it.', 409);
581 + }
582 +
534 583 // check whether the manifest includes the shortcodes installation
535 584 $manifest->shortcodes = $hasShortcodes($manifest);
536 585
537 586 if (empty($manifest->shortcodes))
@@ -591,28 +640,25 @@
591 640 * @throws Exception
592 641 */
593 642 add_action('vikbooking_after_import_backup', function($manifest, $path)
594 643 {
595 - if (empty($manifest->shortcodes))
644 + if (!empty($manifest->shortcodes))
596 645 {
597 - // shortcodes not included within the backup, do not install
598 - return;
599 - }
646 + // get shortcodes admin model
647 + $listModel = JModel::getInstance('vikbooking', 'shortcodes', 'admin');
600 648
601 - // get shortcodes admin model
602 - $listModel = JModel::getInstance('vikbooking', 'shortcodes', 'admin');
649 + // get all existing shortcodes
650 + $shortcodes = $listModel->all('id');
603 651
604 - // get all existing shortcodes
605 - $shortcodes = $listModel->all('id');
652 + // get shortcode admin model
653 + $model = JModel::getInstance('vikbooking', 'shortcode', 'admin');
606 654
607 - // get shortcode admin model
608 - $model = JModel::getInstance('vikbooking', 'shortcode', 'admin');
609 -
610 - // iterate all shortcodes found
611 - foreach ($shortcodes as $shortcode)
612 - {
613 - // assign the shortcode to a new page
614 - $model->addPage($shortcode->id);
655 + // iterate all shortcodes found
656 + foreach ($shortcodes as $shortcode)
657 + {
658 + // assign the shortcode to a new page
659 + $model->addPage($shortcode->id);
660 + }
615 661 }
616 662
617 663 // trigger full files mirroring
618 664 VikBookingUpdateManager::triggerUploadFullMirroring();