010009.php
7 months ago
010300.php
7 months ago
010306.php
7 months ago
010309.php
7 months ago
010402.php
7 months ago
010501.php
3 months ago
010802.php
7 months ago
010803.php
3 months ago
index.php
3 years ago
010402.php
53 lines
| 1 | <?php #comp-page builds: premium |
| 2 | |
| 3 | // Exit if accessed directly |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | exit; |
| 6 | } |
| 7 | |
| 8 | /** |
| 9 | * Updates for altering the table used to store statistics data. |
| 10 | * Adds new columns and renames existing ones in order to add support for the new social buttons. |
| 11 | */ |
| 12 | class WIOUpdate010402 extends Wbcr_Factory600_Update { |
| 13 | |
| 14 | /** |
| 15 | * {inherit} |
| 16 | * |
| 17 | * @since 1.3.9 |
| 18 | */ |
| 19 | public function install() { |
| 20 | |
| 21 | $db_version = RIO_Process_Queue::get_db_version(); |
| 22 | $plugin_version_in_db = $this->get_plugin_version_in_db(); |
| 23 | $current_plugin_version = $this->plugin->getPluginVersion(); |
| 24 | |
| 25 | $init_log_message = "Start plugin migration < %s.\r\n"; |
| 26 | $init_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-DB Version: {$db_version}\r\n"; |
| 27 | $init_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-Plugin Version in DB: {$plugin_version_in_db}\r\n"; |
| 28 | $init_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-Current Plugin Version: {$current_plugin_version}"; |
| 29 | |
| 30 | WRIO_Plugin::app()->logger->info( sprintf( $init_log_message, '1.4.2' ) ); |
| 31 | |
| 32 | if ( 'server_4' === WRIO_Plugin::app()->getOption( 'image_optimization_server' ) ) { |
| 33 | WRIO_Plugin::app()->updateOption( 'image_optimization_server', 'server_2' ); |
| 34 | } |
| 35 | |
| 36 | WRIO_Plugin::app()->logger->info( 'Plugin migration was successfull!' ); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Get previous plugin version |
| 41 | * |
| 42 | * @return number |
| 43 | * @since 1.3.9 |
| 44 | */ |
| 45 | public function get_plugin_version_in_db() { |
| 46 | if ( WRIO_Plugin::app()->isNetworkActive() ) { |
| 47 | return get_site_option( WRIO_Plugin::app()->getOptionName( 'plugin_version' ), 0 ); |
| 48 | } |
| 49 | |
| 50 | return get_option( WRIO_Plugin::app()->getOptionName( 'plugin_version' ), 0 ); |
| 51 | } |
| 52 | } |
| 53 |