Changeset 2907319
- Timestamp:
- 05/03/2023 07:28:48 AM (3 years ago)
- Location:
- thrivedesk
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.13 (copied) (copied from thrivedesk/trunk)
-
tags/1.0.13/database/Scripts/MigrationScript.php (modified) (3 diffs)
-
tags/1.0.13/readme.txt (modified) (2 diffs)
-
tags/1.0.13/thrivedesk.php (modified) (2 diffs)
-
trunk/database/Scripts/MigrationScript.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/thrivedesk.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
thrivedesk/tags/1.0.13/database/Scripts/MigrationScript.php
r2907273 r2907319 8 8 9 9 public function __construct() { 10 register_activation_hook( THRIVEDESK_FILE, array( $this, 'run' )); 10 register_activation_hook( THRIVEDESK_FILE, [ $this, 'run' ] ); 11 add_action( 'upgrader_process_complete', 'wp_td_update_completed', 10, 2 ); 11 12 } 12 13 13 14 public static function instance(): MigrationScript { 14 if ( ! isset(self::$instance) ) {15 if ( ! isset( self::$instance ) ) { 15 16 self::$instance = new self(); 16 17 } … … 19 20 } 20 21 22 public function wp_td_update_completed( $upgrader_object, $options ) { 23 if ( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) { 24 foreach ( $options['plugins'] as $plugin ) { 25 if ( $plugin == plugin_basename( THRIVEDESK_FILE ) ) { 26 $this->run(); 27 break; 28 } 29 } 30 } 31 } 32 21 33 public function run() { 22 34 $this->runMigrationScript(); 23 35 } 24 36 25 private function runMigrationScript( ) {37 private function runMigrationScript() { 26 38 $this->migratePostSyncOption(); 27 39 } 28 40 29 private function migratePostSyncOption( ) {41 private function migratePostSyncOption() { 30 42 $old_post_sync_option = get_option( 'thrivedesk_post_type_sync_option' ); 31 43 … … 34 46 } 35 47 36 37 48 $td_helpdesk_settings = get_td_helpdesk_options(); 38 49 39 if (!array_key_exists('td_helpdesk_post_sync', $td_helpdesk_settings)40 || !$td_helpdesk_settings['td_helpdesk_post_sync']) {50 if ( ! array_key_exists( 'td_helpdesk_post_sync', $td_helpdesk_settings ) || 51 ! $td_helpdesk_settings['td_helpdesk_post_sync'] ) { 41 52 $td_helpdesk_settings['td_helpdesk_post_sync'] = $old_post_sync_option; 42 53 update_option( 'td_helpdesk_settings', $td_helpdesk_settings ); -
thrivedesk/tags/1.0.13/readme.txt
r2907273 r2907319 4 4 Requires at least: 4.9 5 5 Tested up to: 6.2 6 Stable Tag: 1.0.1 26 Stable Tag: 1.0.13 7 7 Requires PHP: 5.5 8 8 License: GNU General Public License v2.0 or later … … 224 224 225 225 == Changelog == 226 = 1.0.13 = 227 - Update: Migration Script 228 226 229 = 1.0.12 = 227 230 - Fix: Legacy post types support for WPPostSync integration -
thrivedesk/tags/1.0.13/thrivedesk.php
r2907273 r2907319 6 6 * Plugin URI: https://www.thrivedesk.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 7 7 * Tags: live chat, helpdesk, free live chat, knowledge base, thrivedesk 8 * Version: 1.0.1 28 * Version: 1.0.13 9 9 * Author: ThriveDesk 10 10 * Author URI: https://profiles.wordpress.org/thrivedesk/ … … 50 50 * @var string 51 51 */ 52 public $version = '1.0.1 2';52 public $version = '1.0.13'; 53 53 54 54 /** -
thrivedesk/trunk/database/Scripts/MigrationScript.php
r2907273 r2907319 8 8 9 9 public function __construct() { 10 register_activation_hook( THRIVEDESK_FILE, array( $this, 'run' )); 10 register_activation_hook( THRIVEDESK_FILE, [ $this, 'run' ] ); 11 add_action( 'upgrader_process_complete', 'wp_td_update_completed', 10, 2 ); 11 12 } 12 13 13 14 public static function instance(): MigrationScript { 14 if ( ! isset(self::$instance) ) {15 if ( ! isset( self::$instance ) ) { 15 16 self::$instance = new self(); 16 17 } … … 19 20 } 20 21 22 public function wp_td_update_completed( $upgrader_object, $options ) { 23 if ( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) { 24 foreach ( $options['plugins'] as $plugin ) { 25 if ( $plugin == plugin_basename( THRIVEDESK_FILE ) ) { 26 $this->run(); 27 break; 28 } 29 } 30 } 31 } 32 21 33 public function run() { 22 34 $this->runMigrationScript(); 23 35 } 24 36 25 private function runMigrationScript( ) {37 private function runMigrationScript() { 26 38 $this->migratePostSyncOption(); 27 39 } 28 40 29 private function migratePostSyncOption( ) {41 private function migratePostSyncOption() { 30 42 $old_post_sync_option = get_option( 'thrivedesk_post_type_sync_option' ); 31 43 … … 34 46 } 35 47 36 37 48 $td_helpdesk_settings = get_td_helpdesk_options(); 38 49 39 if (!array_key_exists('td_helpdesk_post_sync', $td_helpdesk_settings)40 || !$td_helpdesk_settings['td_helpdesk_post_sync']) {50 if ( ! array_key_exists( 'td_helpdesk_post_sync', $td_helpdesk_settings ) || 51 ! $td_helpdesk_settings['td_helpdesk_post_sync'] ) { 41 52 $td_helpdesk_settings['td_helpdesk_post_sync'] = $old_post_sync_option; 42 53 update_option( 'td_helpdesk_settings', $td_helpdesk_settings ); -
thrivedesk/trunk/readme.txt
r2907273 r2907319 4 4 Requires at least: 4.9 5 5 Tested up to: 6.2 6 Stable Tag: 1.0.1 26 Stable Tag: 1.0.13 7 7 Requires PHP: 5.5 8 8 License: GNU General Public License v2.0 or later … … 224 224 225 225 == Changelog == 226 = 1.0.13 = 227 - Update: Migration Script 228 226 229 = 1.0.12 = 227 230 - Fix: Legacy post types support for WPPostSync integration -
thrivedesk/trunk/thrivedesk.php
r2907273 r2907319 6 6 * Plugin URI: https://www.thrivedesk.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 7 7 * Tags: live chat, helpdesk, free live chat, knowledge base, thrivedesk 8 * Version: 1.0.1 28 * Version: 1.0.13 9 9 * Author: ThriveDesk 10 10 * Author URI: https://profiles.wordpress.org/thrivedesk/ … … 50 50 * @var string 51 51 */ 52 public $version = '1.0.1 2';52 public $version = '1.0.13'; 53 53 54 54 /**
Note: See TracChangeset
for help on using the changeset viewer.