[ Avaa Bypassed ]




Upload:

Command:

www-data@3.144.158.54: ~ $
<?php
/**
 * Update class.
 *
 * @package Magazine Blocks
 */

namespace MagazineBlocks;

defined( 'ABSPATH' ) || exit;

use MagazineBlocks\Traits\Singleton;

/**
 * Update class.
 */
class Update {

	use Singleton;

	/**
	 * {@inheritDoc}
	 */
	protected function __construct() {
		add_action( 'magazine_blocks_version_update', array( $this, 'on_update' ), 10, 2 );
	}

	/**
	 * On update.
	 *
	 * @param string $new_version Current version.
	 * @param string $old_version Old version.
	 * d previous version.
	 *
	 * @return void
	 */
	public function on_update( string $new_version, string $old_version ) {
		if ( version_compare( $old_version, '2.0.0', '<' ) ) {
			$this->update_to_2_0_0();
		}
		if ( version_compare( $old_version, '2.0.0.1', '<' ) ) {
			$this->update_to_2_0_0_1();
		}
		if ( version_compare( $old_version, '2.0.7', '<' ) ) {
			$this->update_to_2_0_7();
		}
	}

	/**
	 * Update to version 2.0.0.
	 *
	 * @return void
	 */
	private function update_to_2_0_0() {
		global $wpdb;

		// Delete old meta keys.
		$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_magazine_blocks_css' OR meta_key = '_magazine_blocks_active'" );

		// Delete old options.
		delete_option( '_magazine_blocks_widget_css' );
	}

	/**
	 * Update to version 2.0.0.1.
	 *
	 * @return void
	 */
	private function update_to_2_0_0_1() {
		global $wpdb;
		$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_magazine_blocks_blocks_css'" );
		delete_option( '_magazine_blocks_blocks_css' );
	}

	/**
	 * Update to version 2.0.7.
	 *
	 * @return void
	 */
	private function update_to_2_0_7() {
		$setting              = magazine_blocks_get_setting();
		$old_css_print_method = get_option( '_magazine_blocks_dynamic_css_print_method', 'internal-css' );
		if ( 'external-css-file' === $old_css_print_method ) {
			$setting->set( 'asset-generation.external-file', true );
			$setting->save();
		}
		delete_option( '_magazine_blocks_dynamic_css_print_method' );
	}
}

Filemanager

Name Type Size Permission Actions
BlockTypes Folder 0777
Helpers Folder 0777
RestApi Folder 0777
traits Folder 0777
Activation.php File 477 B 0644
Admin.php File 5.58 KB 0644
Ajax.php File 2.27 KB 0644
BlockStyles.php File 34.87 KB 0644
Blocks.php File 13.08 KB 0644
Deactivation.php File 564 B 0644
Functions.php File 2.29 KB 0644
Helper.php File 3.32 KB 0644
Icon.php File 3.86 KB 0644
MagazineBlocks.php File 2.83 KB 0644
MaintenanceMode.php File 3.1 KB 0644
Review.php File 6.64 KB 0644
ScriptStyle.php File 10.25 KB 0644
Setting.php File 5.57 KB 0644
Update.php File 1.93 KB 0644
Utils.php File 5.77 KB 0644
WebFontLoader.php File 17.23 KB 0644