HEX
Server: Apache
System: Linux p3plzcpnl505785.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: xuvi7odgswsg (6947073)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //home/xuvi7odgswsg/www/wp-content/plugins/bb-ultimate-addon/classes/class-uabb-update.php
<?php
/**
 * Update and backward compatibility.
 *
 * @since 1.5.0
 * @package Update and Backward
 */

if ( ! class_exists( 'UABB_Plugin_Update' ) ) {

	/**
	 * UABB_Plugin_Update initial setup
	 *
	 * @since 1.5.0
	 */
	class UABB_Plugin_Update {

		/**
		 * Class instance.
		 *
		 * @access private
		 * @var $instance Class instance.
		 */
		private static $instance;

		/**
		 * Initiator
		 */
		public static function get_instance() {
			if ( ! isset( self::$instance ) ) {
				self::$instance = new self();
			}
			return self::$instance;
		}

		/**
		 *  Constructor
		 */
		public function __construct() {

			// UABB Updates.
			add_action( 'init', __CLASS__ . '::init' );

		}

		/**
		 * Implement UABB update logic.
		 *
		 * @since 1.5.0
		 * @return void
		 */
		public static function init() {

			// Get saved version number.
			$saved_version = get_option( '_uabb_saved_version', '0' );

			if ( '0' === $saved_version ) {
				update_option( '_uabb_1_7_2_ver', 'yes' );
			}
			// If matches the current version then skip the next steps.
			if ( version_compare( $saved_version, BB_ULTIMATE_ADDON_VER, '=' ) ) {
				return;
			}

			$old_jrn_details = get_option( '_journey_details', '0' );

			if ( '0' === $old_jrn_details ) {
				$old_jrn_details = array();
			}

			$new_jrn_details = array(
				'previous_version' => $saved_version,
				'current_version'  => BB_ULTIMATE_ADDON_VER,
			);

			array_push( $old_jrn_details, $new_jrn_details );

			update_option( '_journey_details', $old_jrn_details );

			do_action( 'uabb_update_version_before' );
			// Update saved version number.
			update_option( '_uabb_saved_version', BB_ULTIMATE_ADDON_VER );

			// Flush the rewrite rules.
			flush_rewrite_rules();

			do_action( 'uabb_update_version_after' );
		}

	}
}
UABB_Plugin_Update::get_instance();