Multi Device Switcher - Version 1.5.2

Version Description

  • fixed: fix setcookie()
Download this release

Release Info

Developer thingsym
Plugin Icon wp plugin Multi Device Switcher
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

multi-device-switcher.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Multi Device Switcher
4
  * Plugin URI: https://github.com/thingsym/multi-device-switcher
5
  * Description: This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game and custom).
6
- * Version: 1.5.1
7
  * Author: thingsym
8
  * Author URI: http://www.thingslabo.com/
9
  * License: GPL2
@@ -66,12 +66,12 @@ class Multi_Device_Switcher {
66
  public function switch_theme() {
67
 
68
  if ( isset( $_COOKIE[ $this->cookie_name_disable_switcher ] ) ) {
69
- setcookie( $this->cookie_name_disable_switcher, null, time() - 3600, '/' );
70
  }
71
 
72
  if ( $this->is_disable_switcher() ) {
73
- setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/' );
74
- setcookie( $this->cookie_name_disable_switcher, 1, null, '/' );
75
  return;
76
  }
77
 
@@ -112,10 +112,10 @@ class Multi_Device_Switcher {
112
  add_filter( 'template', array( $this, 'get_template' ) );
113
  add_action( 'wp_footer', array( $this, 'add_pc_switcher' ) );
114
 
115
- setcookie( $this->cookie_name_multi_device_switcher, preg_replace( '/^custom_switcher_/', '', $this->device ), null, '/' );
116
  }
117
  else {
118
- setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/' );
119
  }
120
 
121
  if ( isset( $_COOKIE[ $this->cookie_name_pc_switcher ] ) ) {
@@ -230,7 +230,7 @@ class Multi_Device_Switcher {
230
 
231
  public function session() {
232
  if ( isset( $_GET['pc-switcher'] ) ) {
233
- setcookie( $this->cookie_name_pc_switcher, $_GET['pc-switcher'] ? 1 : '', null, '/' );
234
 
235
  $uri = preg_replace( '/^(.+?)(\?.*)$/', '$1', $_SERVER['REQUEST_URI'] );
236
 
@@ -1125,4 +1125,4 @@ function is_disable_switcher() {
1125
  }
1126
  endif;
1127
 
1128
- ?>
3
  * Plugin Name: Multi Device Switcher
4
  * Plugin URI: https://github.com/thingsym/multi-device-switcher
5
  * Description: This WordPress plugin allows you to set a separate theme for device (Smart Phone, Tablet PC, Mobile Phone, Game and custom).
6
+ * Version: 1.5.2
7
  * Author: thingsym
8
  * Author URI: http://www.thingslabo.com/
9
  * License: GPL2
66
  public function switch_theme() {
67
 
68
  if ( isset( $_COOKIE[ $this->cookie_name_disable_switcher ] ) ) {
69
+ setcookie( $this->cookie_name_disable_switcher, null, time() - 3600, '/', '', is_ssl(), false );
70
  }
71
 
72
  if ( $this->is_disable_switcher() ) {
73
+ setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/', '', is_ssl(), false );
74
+ setcookie( $this->cookie_name_disable_switcher, 1, null, '/', '', is_ssl(), false );
75
  return;
76
  }
77
 
112
  add_filter( 'template', array( $this, 'get_template' ) );
113
  add_action( 'wp_footer', array( $this, 'add_pc_switcher' ) );
114
 
115
+ setcookie( $this->cookie_name_multi_device_switcher, preg_replace( '/^custom_switcher_/', '', $this->device ), null, '/', '', is_ssl(), false );
116
  }
117
  else {
118
+ setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/', '', is_ssl(), false );
119
  }
120
 
121
  if ( isset( $_COOKIE[ $this->cookie_name_pc_switcher ] ) ) {
230
 
231
  public function session() {
232
  if ( isset( $_GET['pc-switcher'] ) ) {
233
+ setcookie( $this->cookie_name_pc_switcher, $_GET['pc-switcher'] ? 1 : '', null, '/', '', is_ssl(), false );
234
 
235
  $uri = preg_replace( '/^(.+?)(\?.*)$/', '$1', $_SERVER['REQUEST_URI'] );
236
 
1125
  }
1126
  endif;
1127
 
1128
+ ?>
pc-switcher-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Widget Name: PC Switcher Widget
4
  * Plugin URI: https://github.com/thingsym/multi-device-switcher
5
  * Description: PC Switcher Widget add-on for the Multi Device Switcher. Use this widget to add the PC Switcher to a widget.
6
- * Version: 1.5.1
7
  * Author: thingsym
8
  * Author URI: http://www.thingslabo.com/
9
  * License: GPL2
3
  * Widget Name: PC Switcher Widget
4
  * Plugin URI: https://github.com/thingsym/multi-device-switcher
5
  * Description: PC Switcher Widget add-on for the Multi Device Switcher. Use this widget to add the PC Switcher to a widget.
6
+ * Version: 1.5.2
7
  * Author: thingsym
8
  * Author URI: http://www.thingslabo.com/
9
  * License: GPL2
readme.md CHANGED
@@ -401,6 +401,8 @@ You can send your own language pack to author.
401
 
402
  ## Changelog
403
 
 
 
404
  * Version 1.5.1
405
  * fixed: fix preg_split()
406
  * Version 1.5.0
401
 
402
  ## Changelog
403
 
404
+ * Version 1.5.2
405
+ * fixed: fix setcookie()
406
  * Version 1.5.1
407
  * fixed: fix preg_split()
408
  * Version 1.5.0
readme.txt CHANGED
@@ -5,8 +5,8 @@ Donate link: http://blog.thingslabo.com/archives/000251.html
5
  Link: https://github.com/thingsym/multi-device-switcher
6
  Tags: switcher, theme, ipad, iphone, android, tablet, mobile, game
7
  Requires at least: 3.4
8
- Tested up to: 4.5
9
- Stable tag: 1.5.1
10
  License: GPL2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -371,6 +371,8 @@ For more information about the Multi Device Switcher Command, see `wp help multi
371
 
372
  == Changelog ==
373
 
 
 
374
  = 1.5.1 =
375
  * fixed: fix preg_split()
376
  = 1.5.0 =
5
  Link: https://github.com/thingsym/multi-device-switcher
6
  Tags: switcher, theme, ipad, iphone, android, tablet, mobile, game
7
  Requires at least: 3.4
8
+ Tested up to: 4.6.1
9
+ Stable tag: 1.5.2
10
  License: GPL2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
371
 
372
  == Changelog ==
373
 
374
+ = 1.5.2 =
375
+ * fixed: fix setcookie()
376
  = 1.5.1 =
377
  * fixed: fix preg_split()
378
  = 1.5.0 =