PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 6.0.1
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v6.0.1
6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 5.6.1 All 34 releases
automatorwp / includes / admin / upgrades / 1.3.0.php

1.3.0.php in AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI 6.0.1, at includes/admin/upgrades/1.3.0.php

74 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * 1.3.0 Upgrades
4 *
5 * @package AutomatorWP\Admin\Upgrades\1.3.0
6 * @since 1.3.0
7 */
8 // Exit if accessed directly
9 if( !defined( 'ABSPATH' ) ) exit;
10
11 /**
12 * Return 1.3.0 as last required upgrade
13 *
14 * @return string
15 */
16 function automatorwp_130_is_last_required_upgrade() {
17
18 return '1.3.0';
19
20 }
21 add_filter( 'automatorwp_get_last_required_upgrade', 'automatorwp_130_is_last_required_upgrade', 130 );
22
23 /**
24 * Process 1.3.0 upgrades
25 *
26 * @param string $stored_version
27 *
28 * @return string
29 */
30 function automatorwp_130_upgrades( $stored_version ) {
31
32 // Already upgrade
33 if ( version_compare( $stored_version, '1.3.0', '>=' ) ) {
34 return $stored_version;
35 }
36
37 // Ensure that AutomatorWP tables have been created
38 if( automatorwp_database_table_exists( AutomatorWP()->db->automations ) ) {
39 // Process 1.3.0 upgrade
40 automatorwp_process_130_upgrade();
41
42 // There is nothing to update, so upgrade
43 $stored_version = '1.3.0';
44 }
45
46 return $stored_version;
47
48 }
49 add_filter( 'automatorwp_process_upgrades', 'automatorwp_130_upgrades', 130 );
50
51 /**
52 * Process 1.3.0 upgrades
53 */
54 function automatorwp_process_130_upgrade() {
55
56 global $wpdb;
57
58 ignore_user_abort( true );
59 set_time_limit( 0 );
60
61 // Bail if AutomatorWP tables haven't been created yet
62 if( ! automatorwp_database_table_exists( AutomatorWP()->db->automations ) ) {
63 return;
64 }
65
66 $automations = AutomatorWP()->db->automations;
67
68 // Update old automations type
69 $wpdb->query( "UPDATE {$automations} AS a SET a.type = 'user' WHERE a.type = ''" );
70
71 // Updated stored version
72 update_option( 'automatorwp_version', '1.3.0' );
73
74 }