PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Helpers/Installation.php +18 -11 2.1.43.2.6 View file →
@@ -34,9 +34,9 @@
34 34 *
35 35 * @return int|void
36 36 */
37 37 public static function check_version() {
38 - $version = ExtraSettings::instance()->get_option( 'rtsb_version' ) ?? get_option( 'rtsb_version' );
38 + $version = ExtraSettings::instance()->get_option( 'rtsb_version', '' ) ?? get_option( 'rtsb_version' );
39 39 if ( version_compare( $version, RTSB_VERSION, '<' ) ) {
40 40 if ( ! $version ) {
41 41 self::set_default_options();
42 42 if ( ! Fns::get_product() ) {
@@ -90,11 +90,25 @@
90 90 * @return void
91 91 */
92 92 public static function deactivation() {
93 93 delete_option( 'shopbuilder_permalinks_flushed' );
94 + self::clear_scheduled_events();
94 95 }
95 -
96 96 /**
97 + * Clear Scheduled Events
98 + *
99 + * @return void
100 + */
101 + public static function clear_scheduled_events() {
102 + $schedule = get_option( 'rtsb_cron_schedule_free', [] );
103 + if ( empty( $schedule ) ) {
104 + return;
105 + }
106 + foreach ( $schedule as $v ) {
107 + wp_clear_scheduled_hook( $v );
108 + }
109 + }
110 + /**
97 111 * Set default options.
98 112 *
99 113 * @return void
100 114 */
@@ -100,15 +114,14 @@
100 114 */
101 115 public static function set_default_options() {
102 116 $sections = Settings::instance()->get_sections();
103 117 foreach ( $sections as $sections_id => $section ) {
104 - $rawOptions = [];
105 118 if ( ! empty( $section['list'] ) ) {
106 119 foreach ( $section['list'] as $blocks_id => $blocks ) {
120 + $rawOptions = [];
107 121 if ( ! rtsb()->has_pro() && 'free' !== ( $blocks['package'] ?? '' ) ) {
108 122 continue;
109 123 }
110 -
111 124 $rawOptions['active'] = $blocks['active'] ?? null;
112 125
113 126 if ( ! empty( $blocks['fields'] ) ) {
114 127 foreach ( $blocks['fields'] as $field_id => $field ) {
@@ -115,9 +128,8 @@
115 128 $type = 'array' === gettype( $field['value'] ) ? [] : '';
116 129 $rawOptions[ $field_id ] = ! empty( $field['value'] ) ? $field['value'] : $type;
117 130 }
118 131 }
119 -
120 132 Fns::set_options( $sections_id, $blocks_id, $rawOptions );
121 133 }
122 134 }
123 135 }
@@ -128,9 +140,8 @@
128 140 *
129 141 * @return int
130 142 */
131 143 public static function create_wc_product() {
132 -
133 144 $product = new WC_Product_Simple();
134 145 $product->set_name( 'Confirm at least one product is created before deleting' );
135 146 $product->set_description( 'This is a ShopBuilder demo preview product' );
136 147 $product->set_short_description( 'This is a ShopBuilder product' );
@@ -139,12 +150,8 @@
139 150 $product->set_regular_price( 50 );
140 151 $product->set_sale_price( 49 );
141 152 $product->set_price( 49 );
142 153
143 - $product->set_sku( 'SAMPLE-001' );
144 -
145 - $product->set_manage_stock( false );
146 - $product->set_stock_status( 'instock' );
147 -
154 + $product->set_sku( '' );
148 155 return $product->save();
149 156 }
150 157 }