WooCommerce Menu Cart - Version 2.8.1

Version Description

  • Fix: Assets versioning
Download this release

Release Info

Developer wpovernight
Plugin Icon 128x128 WooCommerce Menu Cart
Version 2.8.1
Comparing to
See all releases

Code changes from version 2.8.0 to 2.8.1

Files changed (3) hide show
  1. includes/wpmenucart-settings.php +2 -4
  2. readme.txt +4 -1
  3. wp-menu-cart.php +25 -17
includes/wpmenucart-settings.php CHANGED
@@ -307,10 +307,8 @@ class WpMenuCart_Settings {
307
  * Styles for settings page
308
  */
309
  public function wpmenucart_admin_styles() {
310
- wp_register_style( 'wpmenucart-admin', plugins_url( 'css/wpmenucart-icons.css', dirname(__FILE__) ), array(), '', 'all' );
311
- wp_enqueue_style( 'wpmenucart-admin' );
312
- wp_register_style( 'wpmenucart-fontawesome', plugins_url( '/css/wpmenucart-fontawesome.css', dirname(__FILE__) ), array(), '', 'all' );
313
- wp_enqueue_style( 'wpmenucart-fontawesome' );
314
  }
315
 
316
  /**
307
  * Styles for settings page
308
  */
309
  public function wpmenucart_admin_styles() {
310
+ wp_enqueue_style( 'wpmenucart-admin', plugins_url( 'css/wpmenucart-icons.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
311
+ wp_enqueue_style( 'wpmenucart-font', plugins_url( '/css/wpmenucart-font.css', dirname(__FILE__) ), array(), WPMENUCART_VERSION, 'all' );
 
 
312
  }
313
 
314
  /**
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce, menu, bar, cart, basket, header, shopping cart, navigation, e
5
  Requires at least: 3.4
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
- Stable tag: 2.8.0
9
 
10
  Automatically displays a shopping cart in your menu bar. Works with WooCommerce, WP-Ecommerce, EDD, Eshop and Jigoshop
11
 
@@ -85,6 +85,9 @@ Once the plugin is activated navigate to Settings > Menu Cart Setup. Select your
85
 
86
  == Changelog ==
87
 
 
 
 
88
  = 2.8.0 =
89
  * Improved: Drastically reduced font filesize for faster page loading
90
  * New: filter to enable legacy custom ajax setting
5
  Requires at least: 3.4
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
+ Stable tag: 2.8.1
9
 
10
  Automatically displays a shopping cart in your menu bar. Works with WooCommerce, WP-Ecommerce, EDD, Eshop and Jigoshop
11
 
85
 
86
  == Changelog ==
87
 
88
+ = 2.8.1 =
89
+ * Fix: Assets versioning
90
+
91
  = 2.8.0 =
92
  * Improved: Drastically reduced font filesize for faster page loading
93
  * New: filter to enable legacy custom ajax setting
wp-menu-cart.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Menu Cart
4
  * Plugin URI: www.wpovernight.com/plugins
5
  * Description: Extension for your e-commerce plugin (WooCommerce, WP-Ecommerce, Easy Digital Downloads, Eshop or Jigoshop) that places a cart icon with number of items and total cost in the menu bar. Activate the plugin, set your options and you're ready to go! Will automatically conform to your theme styles.
6
- * Version: 2.8.0
7
  * Author: Jeremiah Prummer, Ewout Fernhout
8
  * Author URI: www.wpovernight.com/
9
  * License: GPL2
@@ -14,6 +14,7 @@
14
 
15
  class WpMenuCart {
16
 
 
17
  public static $plugin_slug;
18
  public static $plugin_basename;
19
 
@@ -26,6 +27,8 @@ class WpMenuCart {
26
 
27
  $this->options = get_option('wpmenucart');
28
 
 
 
29
  // load the localisation & classes
30
  add_action( 'plugins_loaded', array( &$this, 'languages' ), 0 ); // or use init?
31
  add_filter( 'load_textdomain_mofile', array( $this, 'textdomain_fallback' ), 10, 2 );
@@ -42,6 +45,17 @@ class WpMenuCart {
42
  // $this->filter_nav_menus();
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Load classes
47
  * @return void
@@ -50,7 +64,7 @@ class WpMenuCart {
50
  include_once( 'includes/wpmenucart-settings.php' );
51
  $this->settings = new WpMenuCart_Settings();
52
 
53
- if ( $this->good_to_go() ) {
54
  if (isset($this->options['shop_plugin'])) {
55
  if ( false === $this->is_shop_active( $this->options['shop_plugin'] ) ) {
56
  return;
@@ -312,7 +326,6 @@ class WpMenuCart {
312
  }
313
  }
314
 
315
-
316
  /**
317
  * Load custom ajax
318
  */
@@ -321,7 +334,7 @@ class WpMenuCart {
321
  'wpmenucart',
322
  plugins_url( '/javascript/wpmenucart.js' , __FILE__ ),
323
  array( 'jquery' ),
324
- '2.8.0',
325
  true
326
  );
327
 
@@ -351,7 +364,7 @@ class WpMenuCart {
351
  'wpmenucart-edd-ajax',
352
  plugins_url( '/javascript/wpmenucart-edd-ajax.js', __FILE__ ),
353
  array( 'jquery' ),
354
- '2.8.0'
355
  );
356
 
357
  wp_localize_script(
@@ -371,18 +384,14 @@ class WpMenuCart {
371
  */
372
  public function load_scripts_styles() {
373
  if (isset($this->options['icon_display'])) {
374
- wp_register_style( 'wpmenucart-icons', plugins_url( '/css/wpmenucart-icons.css', __FILE__ ), array(), '', 'all' );
375
- wp_enqueue_style( 'wpmenucart-icons' );
376
- wp_register_style( 'wpmenucart-font', plugins_url( '/css/wpmenucart-font.css', __FILE__ ), array(), '', 'all' );
377
- wp_enqueue_style( 'wpmenucart-font' );
378
  }
379
 
380
  $css = file_exists( get_stylesheet_directory() . '/wpmenucart-main.css' )
381
  ? get_stylesheet_directory_uri() . '/wpmenucart-main.css'
382
  : plugins_url( '/css/wpmenucart-main.css', __FILE__ );
383
-
384
- wp_register_style( 'wpmenucart', $css, array(), '', 'all' );
385
- wp_enqueue_style( 'wpmenucart' );
386
 
387
  // Hide built-in theme carts
388
  if ( isset($this->options['hide_theme_cart']) ) {
@@ -391,21 +400,20 @@ class WpMenuCart {
391
 
392
  //Load Stylesheet if twentytwelve is active
393
  if ( wp_get_theme() == 'Twenty Twelve' ) {
394
- wp_register_style( 'wpmenucart-twentytwelve', plugins_url( '/css/wpmenucart-twentytwelve.css', __FILE__ ), array(), '', 'all' );
395
- wp_enqueue_style( 'wpmenucart-twentytwelve' );
396
  }
397
 
398
  //Load Stylesheet if twentyfourteen is active
399
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
400
- wp_register_style( 'wpmenucart-twentyfourteen', plugins_url( '/css/wpmenucart-twentyfourteen.css', __FILE__ ), array(), '', 'all' );
401
- wp_enqueue_style( 'wpmenucart-twentyfourteen' );
402
  }
403
 
404
  // extra script that improves AJAX behavior when 'Always display cart' is disabled
405
  wp_enqueue_script(
406
  'wpmenucart-ajax-assist',
407
  plugins_url( '/javascript/wpmenucart-ajax-assist.js', __FILE__ ),
408
- array( 'jquery' )
 
409
  );
410
  wp_localize_script(
411
  'wpmenucart-ajax-assist',
3
  * Plugin Name: WooCommerce Menu Cart
4
  * Plugin URI: www.wpovernight.com/plugins
5
  * Description: Extension for your e-commerce plugin (WooCommerce, WP-Ecommerce, Easy Digital Downloads, Eshop or Jigoshop) that places a cart icon with number of items and total cost in the menu bar. Activate the plugin, set your options and you're ready to go! Will automatically conform to your theme styles.
6
+ * Version: 2.8.1
7
  * Author: Jeremiah Prummer, Ewout Fernhout
8
  * Author URI: www.wpovernight.com/
9
  * License: GPL2
14
 
15
  class WpMenuCart {
16
 
17
+ protected $plugin_version = '2.8.1';
18
  public static $plugin_slug;
19
  public static $plugin_basename;
20
 
27
 
28
  $this->options = get_option('wpmenucart');
29
 
30
+ $this->define( 'WPMENUCART_VERSION', $this->plugin_version );
31
+
32
  // load the localisation & classes
33
  add_action( 'plugins_loaded', array( &$this, 'languages' ), 0 ); // or use init?
34
  add_filter( 'load_textdomain_mofile', array( $this, 'textdomain_fallback' ), 10, 2 );
45
  // $this->filter_nav_menus();
46
  }
47
 
48
+ /**
49
+ * Define constant if not already set
50
+ * @param string $name
51
+ * @param string|bool $value
52
+ */
53
+ private function define( $name, $value ) {
54
+ if ( ! defined( $name ) ) {
55
+ define( $name, $value );
56
+ }
57
+ }
58
+
59
  /**
60
  * Load classes
61
  * @return void
64
  include_once( 'includes/wpmenucart-settings.php' );
65
  $this->settings = new WpMenuCart_Settings();
66
 
67
+ if ( $this->good_to_go() ) {
68
  if (isset($this->options['shop_plugin'])) {
69
  if ( false === $this->is_shop_active( $this->options['shop_plugin'] ) ) {
70
  return;
326
  }
327
  }
328
 
 
329
  /**
330
  * Load custom ajax
331
  */
334
  'wpmenucart',
335
  plugins_url( '/javascript/wpmenucart.js' , __FILE__ ),
336
  array( 'jquery' ),
337
+ WPMENUCART_VERSION,
338
  true
339
  );
340
 
364
  'wpmenucart-edd-ajax',
365
  plugins_url( '/javascript/wpmenucart-edd-ajax.js', __FILE__ ),
366
  array( 'jquery' ),
367
+ WPMENUCART_VERSION
368
  );
369
 
370
  wp_localize_script(
384
  */
385
  public function load_scripts_styles() {
386
  if (isset($this->options['icon_display'])) {
387
+ wp_enqueue_style( 'wpmenucart-icons', plugins_url( '/css/wpmenucart-icons.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
388
+ wp_enqueue_style( 'wpmenucart-font', plugins_url( '/css/wpmenucart-font.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
 
 
389
  }
390
 
391
  $css = file_exists( get_stylesheet_directory() . '/wpmenucart-main.css' )
392
  ? get_stylesheet_directory_uri() . '/wpmenucart-main.css'
393
  : plugins_url( '/css/wpmenucart-main.css', __FILE__ );
394
+ wp_enqueue_style( 'wpmenucart', $css, array(), WPMENUCART_VERSION, 'all' );
 
 
395
 
396
  // Hide built-in theme carts
397
  if ( isset($this->options['hide_theme_cart']) ) {
400
 
401
  //Load Stylesheet if twentytwelve is active
402
  if ( wp_get_theme() == 'Twenty Twelve' ) {
403
+ wp_enqueue_style( 'wpmenucart-twentytwelve', plugins_url( '/css/wpmenucart-twentytwelve.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
 
404
  }
405
 
406
  //Load Stylesheet if twentyfourteen is active
407
  if ( wp_get_theme() == 'Twenty Fourteen' ) {
408
+ wp_enqueue_style( 'wpmenucart-twentyfourteen', plugins_url( '/css/wpmenucart-twentyfourteen.css', __FILE__ ), array(), WPMENUCART_VERSION, 'all' );
 
409
  }
410
 
411
  // extra script that improves AJAX behavior when 'Always display cart' is disabled
412
  wp_enqueue_script(
413
  'wpmenucart-ajax-assist',
414
  plugins_url( '/javascript/wpmenucart-ajax-assist.js', __FILE__ ),
415
+ array( 'jquery' ),
416
+ WPMENUCART_VERSION
417
  );
418
  wp_localize_script(
419
  'wpmenucart-ajax-assist',