PluginProbe
MakeCommerce for WooCommerce / 3.0.12
MakeCommerce for WooCommerce v3.0.12
4.1.0 4.0.8 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 All 96 releases
← All changes | includes/makecommerce.php +14 -28 4.1.03.0.12 View file →
@@ -109,9 +109,9 @@
109 109 private function set_locale() {
110 110
111 111 $plugin_i18n = new MakeCommerce\i18n();
112 112
113 - $this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain' );
113 + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
114 114 }
115 115
116 116 /**
117 117 * Register all of the hooks related to cron functionality
@@ -150,14 +150,8 @@
150 150 //Add admin notice if api is not set up
151 151 if ( !\MakeCommerce::get_api() ) {
152 152 $this->loader->add_action( 'admin_notices', $api, 'api_info_missing' );
153 153 }
154 -
155 - //Add admin notice about Shipping+
156 - $this->loader->add_action( 'admin_notices', $api, 'shipping_api_notice' );
157 -
158 - //if API type is updated then refresh the cache
159 - $this->loader->add_action( 'update_option_mk_api_type', $api, 'mk_delete_api_cache' );
160 154
161 155 //add API access menu in woocommerce->settings->advanced (_api version is for WC <= 3.4.0)
162 156 $this->loader->add_action( 'woocommerce_get_sections_advanced', $api, 'add_woo_menu' );
163 157 $this->loader->add_action( 'woocommerce_get_sections_api', $api, 'add_woo_menu');
@@ -178,15 +172,8 @@
178 172 //adds settings link to plugins page
179 173 $this->loader->add_filter( 'plugin_action_links_makecommerce/makecommerce.php', $api, 'add_plugin_settings_link' );
180 174
181 175 $this->loader->add_filter( 'woocommerce_admin_field_api_javascript_ui', $api, 'api_javascript_ui' );
182 -
183 - // Shipping plus confirmation page in Admin panel and related hooks to it
184 - $this->loader->add_action('admin_enqueue_scripts', $api, 'enqueue_shipping_plus_assets');
185 - $this->loader->add_action('admin_menu', $api, 'add_shipping_plus_admin_page');
186 - $this->loader->add_action( 'admin_head', $api, 'remove_shipping_confirm_menu', 15 );
187 - $this->loader->add_action( 'admin_head', $api, 'hide_shipping_admin_notices' );
188 - $this->loader->add_action( 'admin_init', $api, 'save_shipping_plus_confirmation' );
189 176 }
190 177
191 178 /**
192 179 * Register all of the hooks related to the public-facing functionality
@@ -217,16 +204,9 @@
217 204 $this->loader->add_filter( 'posts_where', $plugin_shipping, 'shipping_filter', 10, 2 );
218 205
219 206 $this->loader->add_filter( 'woocommerce_order_status_processing', $plugin_shipping, 'register_shipment' );
220 207
221 - $this->loader->add_action( 'woocommerce_update_order', $plugin_shipping, 'set_parcel_machine_meta' );
222 - $this->loader->add_action( 'woocommerce_update_order', $plugin_shipping, 'update_courier_meta' );
223 -
224 - $this->loader->add_action( 'wp_ajax_update_map_center', $plugin_shipping, 'update_map_center' );
225 - $this->loader->add_action( 'wp_ajax_nopriv_update_map_center', $plugin_shipping, 'update_map_center' );
226 -
227 - $this->loader->add_action( 'update_option_mc_map_geocoding_api_key', $plugin_shipping, 'mc_check_api_key' );
228 - $this->loader->add_action( 'admin_notices', $plugin_shipping, 'invalid_api_key_notification' );
208 + $this->loader->add_action( 'save_post', $plugin_shipping, 'set_parcel_machine_meta' );
229 209 }
230 210
231 211 /**
232 212 * Run the loader to execute all of the hooks with WordPress.
@@ -383,8 +363,20 @@
383 363 );
384 364 }
385 365
386 366 /**
367 + * Notify that woocommerce version is not supported with our plugin
368 + *
369 + * @since 3.0.0
370 + */
371 + public function old_woocommerce_notice() {
372 +
373 + $class = 'notice notice-error';
374 + $message = sprintf( __( 'Makecommerce plugin needs at least <strong>WooCommerce 2.6</strong> to function correctly. Please update yours (currently %s)', 'wc_makecommerce_domain' ), $woocommerce->version );
375 + printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
376 + }
377 +
378 + /**
387 379 * Helpful tool for debugging
388 380 *
389 381 * @since 3.0.0
390 382 */
@@ -418,14 +410,8 @@
418 410 * @since 3.0.9
419 411 */
420 412 public static function mc_enqueue_script( $handle, $src, $data = [], $deps = [], $external = false ) {
421 413
422 - //check if the script is already enqueued. Fixes issue for misbehaving plugins who the queue again which causes inline script to be added more than once.
423 - //https://github.com/wp-media/wp-rocket/issues/3125
424 - if ( wp_script_is( $handle, 'enqueued' ) ) {
425 - return;
426 - }
427 -
428 414 $version = null;
429 415 if ( !$external ) {
430 416
431 417 $version = filemtime( $src );