PluginProbe
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF / 2.0.7
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF v2.0.7
2.0.7 2.0.6 2.0.5 trunk 1.3.7 1.4.0 1.4.1 1.4.2 1.4.6 1.5.0 1.5.3 1.5.6 1.5.8 1.6.5 1.6.6 1.6.9 1.7.0 1.7.4 1.8.1 1.8.2 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 All 26 releases
robin-image-optimizer / migrations / 010402.php
010402.php
53 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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