| @@ -2,9 +2,11 @@ | ||
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | 4 | * Activator for the Robin image optimizer |
| 5 | 5 | * |
| 6 | - * @see Factory600_Activator | |
| 6 | + * @author Webcraftic <wordpress.webraftic@gmail.com> | |
| 7 | + * @copyright (c) 09.09.2017, Webcraftic | |
| 8 | + * @see Factory469_Activator | |
| 7 | 9 | * @version 1.0 |
| 8 | 10 | */ |
| 9 | 11 | |
| 10 | 12 | // Exit if accessed directly |
| @@ -11,9 +13,9 @@ | ||
| 11 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | 14 | exit; |
| 13 | 15 | } |
| 14 | 16 | |
| 15 | -class WIO_Activation extends Wbcr_Factory600_Activator { | |
| 17 | +class WIO_Activation extends Wbcr_Factory469_Activator { | |
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * Runs activation actions. |
| 19 | 21 | * |
| @@ -22,20 +24,15 @@ | ||
| 22 | 24 | */ |
| 23 | 25 | public function activate() { |
| 24 | 26 | WRIO_Plugin::app()->logger->info( 'Parent plugin start installation!' ); |
| 25 | 27 | |
| 28 | + WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_server', 'server_1' ); | |
| 26 | 29 | WRIO_Plugin::app()->updatePopulateOption( 'backup_origin_images', 1 ); |
| 27 | 30 | WRIO_Plugin::app()->updatePopulateOption( 'save_exif_data', 1 ); |
| 28 | 31 | |
| 29 | - // Enable auto-optimize on upload by default for new installations only. | |
| 30 | - if ( 0 === $this->get_plugin_version_in_db() ) { | |
| 31 | - WRIO_Plugin::app()->updatePopulateOption( 'auto_optimize_when_upload', 1 ); | |
| 32 | - WRIO_Plugin::app()->updatePopulateOption( 'convert_webp_format', 1 ); | |
| 33 | - } | |
| 34 | - | |
| 35 | 32 | if ( function_exists( 'wrio_is_license_activate' ) && wrio_is_license_activate() ) { |
| 36 | 33 | WRIO_Plugin::app()->logger->info( 'Premium plugin start installation!' ); |
| 37 | - require_once WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php'; | |
| 34 | + require_once( WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php' ); | |
| 38 | 35 | wrio_premium_activate(); |
| 39 | 36 | WRIO_Plugin::app()->logger->info( 'Premium plugin installation complete!' ); |
| 40 | 37 | } |
| 41 | 38 | |
| @@ -42,9 +39,9 @@ | ||
| 42 | 39 | $db_version = RIO_Process_Queue::get_db_version(); |
| 43 | 40 | $plugin_version_in_db = $this->get_plugin_version_in_db(); |
| 44 | 41 | $current_plugin_version = $this->plugin->getPluginVersion(); |
| 45 | 42 | |
| 46 | - $create_table_log_message = "Plugin installation: try create plugin tables.\r\n"; | |
| 43 | + $create_table_log_message = "Plugin installation: try create plugin tables.\r\n"; | |
| 47 | 44 | $create_table_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"; |
| 48 | 45 | $create_table_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"; |
| 49 | 46 | $create_table_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}"; |
| 50 | 47 | |
| @@ -51,9 +48,9 @@ | ||
| 51 | 48 | WRIO_Plugin::app()->logger->info( $create_table_log_message ); |
| 52 | 49 | |
| 53 | 50 | RIO_Process_Queue::try_create_plugin_tables(); |
| 54 | 51 | |
| 55 | - WBCR\Factory_Templates_759\Helpers::flushPageCache(); | |
| 52 | + WBCR\Factory_Templates_118\Helpers::flushPageCache(); | |
| 56 | 53 | |
| 57 | 54 | WRIO_Plugin::app()->logger->info( 'Parent plugin installation complete!' ); |
| 58 | 55 | } |
| 59 | 56 | |
| @@ -59,8 +56,9 @@ | ||
| 59 | 56 | |
| 60 | 57 | /** |
| 61 | 58 | * Get previous plugin version |
| 62 | 59 | * |
| 60 | + * @author Alexander Kovalev <alex.kovalevv@gmail.com> | |
| 63 | 61 | * @since 1.3.8 |
| 64 | 62 | * @return number |
| 65 | 63 | */ |
| 66 | 64 | public function get_plugin_version_in_db() { |
| @@ -84,9 +82,9 @@ | ||
| 84 | 82 | } |
| 85 | 83 | |
| 86 | 84 | if ( function_exists( 'wrio_is_license_activate' ) && wrio_is_license_activate() ) { |
| 87 | 85 | WRIO_Plugin::app()->logger->info( 'Premium plugin start deactivation!' ); |
| 88 | - require_once WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php'; | |
| 86 | + require_once( WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php' ); | |
| 89 | 87 | wrio_premium_deactivate(); |
| 90 | 88 | WRIO_Plugin::app()->logger->info( 'Premium plugin deactivation complete!' ); |
| 91 | 89 | } |
| 92 | 90 | |