WPtouch - Version 4.2.1

Version Description

Download this release

Release Info

Developer bravenewcode
Plugin Icon 128x128 WPtouch
Version 4.2.1
Comparing to
See all releases

Code changes from version 4.2 to 4.2.1

admin/customizer/wptouch-customizer-switch.js CHANGED
@@ -1,7 +1,7 @@
1
  //TODO: localize!
2
  // Setup Customizer Switch between mobile and desktop themes
3
  (function( exports, $ ){
4
- var current = jQuery.cookie( 'wptouch_customizer_use' ) || 'desktop';
5
 
6
  jQuery( '#customize-info .accordion-section-title' ).append( '<div><button style="margin-top: 10px;" id="switch_to" class="button">' + WPtouchCustomizerSwitch.mobile_switch + '</button></div>' );
7
 
@@ -18,7 +18,7 @@
18
  jQuery( '#switch_to' ).click( function( e ) {
19
  e.preventDefault();
20
  e.stopImmediatePropagation();
21
- jQuery.cookie( 'wptouch_customizer_use', next, { expires: false, path: '/' } );
22
  window.location.reload();
23
  });
24
 
1
  //TODO: localize!
2
  // Setup Customizer Switch between mobile and desktop themes
3
  (function( exports, $ ){
4
+ var current = jQuery.cookie( 'wptouch_customizer_mode' ) || 'desktop';
5
 
6
  jQuery( '#customize-info .accordion-section-title' ).append( '<div><button style="margin-top: 10px;" id="switch_to" class="button">' + WPtouchCustomizerSwitch.mobile_switch + '</button></div>' );
7
 
18
  jQuery( '#switch_to' ).click( function( e ) {
19
  e.preventDefault();
20
  e.stopImmediatePropagation();
21
+ jQuery.cookie( 'wptouch_customizer_mode', next, { expires: false, path: '/' } );
22
  window.location.reload();
23
  });
24
 
admin/customizer/wptouch-customizer.php CHANGED
@@ -64,8 +64,8 @@ if ( $current_theme && wptouch_admin_use_customizer() ) {
64
  }
65
 
66
  // Initialize the device switcher cookie. Values are toggled between 'desktop' and 'mobile' and used to control theme overrides.
67
- if ( is_admin() && current_user_can( 'manage_options' ) && !isset( $_COOKIE[ 'wptouch_customizer_use' ] ) ) {
68
- setcookie( 'wptouch_customizer_use', 'desktop', 0, '/' );
69
  }
70
 
71
  // Domains whose settings should be stored by the Customizer in site options instead of theme mods.
@@ -729,10 +729,10 @@ function wptouch_customizer_override_settings( $settings, $domain ) {
729
  }
730
 
731
  function wptouch_is_customizing() {
732
- if ( !isset( $_COOKIE[ 'wptouch_customizer_use' ] ) ) {
733
  return false;
734
  } else {
735
- if ( $_COOKIE[ 'wptouch_customizer_use' ] == 'desktop' ) {
736
  return false;
737
  } else {
738
  global $wp_customize;
@@ -746,7 +746,7 @@ function wptouch_is_customizing_mobile( $skip_override = false ) {
746
  return true;
747
  }
748
 
749
- if ( wptouch_is_customizing() && $_COOKIE[ 'wptouch_customizer_use' ] == 'mobile' ) {
750
  return true;
751
  } else {
752
  return false;
64
  }
65
 
66
  // Initialize the device switcher cookie. Values are toggled between 'desktop' and 'mobile' and used to control theme overrides.
67
+ if ( is_admin() && current_user_can( 'manage_options' ) && !isset( $_COOKIE[ 'wptouch_customizer_mode' ] ) ) {
68
+ setcookie( 'wptouch_customizer_mode', 'desktop', 0, '/' );
69
  }
70
 
71
  // Domains whose settings should be stored by the Customizer in site options instead of theme mods.
729
  }
730
 
731
  function wptouch_is_customizing() {
732
+ if ( !isset( $_COOKIE[ 'wptouch_customizer_mode' ] ) ) {
733
  return false;
734
  } else {
735
+ if ( $_COOKIE[ 'wptouch_customizer_mode' ] == 'desktop' ) {
736
  return false;
737
  } else {
738
  global $wp_customize;
746
  return true;
747
  }
748
 
749
+ if ( wptouch_is_customizing() && $_COOKIE[ 'wptouch_customizer_mode' ] == 'mobile' ) {
750
  return true;
751
  } else {
752
  return false;
admin/js/wptouch-admin-4.js CHANGED
@@ -472,7 +472,7 @@ function wptouchHandleMultilineFields() {
472
 
473
  function wptouchHandleCustomizerLink() {
474
  jQuery( '#foundation-page-theme-customizer' ).click( 'a', function( e ) {
475
- jQuery.cookie( 'wptouch_customizer_use', 'mobile', { expires: 0, path: '/' } );
476
  });
477
  }
478
 
472
 
473
  function wptouchHandleCustomizerLink() {
474
  jQuery( '#foundation-page-theme-customizer' ).click( 'a', function( e ) {
475
+ jQuery.cookie( 'wptouch_customizer_mode', 'mobile', { expires: 0, path: '/' } );
476
  });
477
  }
478
 
admin/js/wptouch-admin-wizard.js CHANGED
@@ -142,7 +142,7 @@ function wptouchDoWizard(){
142
  return true;
143
  }
144
  });
145
-
146
  // Now make it visible ;p
147
  wizardContainer.css( 'visibility', 'visible' );
148
  }
@@ -172,7 +172,7 @@ function wptouchLove(){
172
  if ( !jQuery( this ).prop( 'checked' ) ) {
173
  jQuery( 'i.heartbeat' ).removeClass( 'icon-heart' ).addClass( 'icon-heart-broken' );
174
  } else {
175
- jQuery( 'i.heartbeat' ).addClass( 'icon-heart' ).removeClass( 'icon-heart-broken' );
176
  }
177
  });
178
  }
@@ -198,7 +198,7 @@ function wptouchWizardLicense(){
198
  wptouchAdminAjax( 'activate-license-key', ajaxParams, function( result ) {
199
  if ( result == '1' ) {
200
  // license success
201
- bncHasLicense = 1;
202
  wptouchReload();
203
 
204
  } else {
@@ -242,7 +242,7 @@ function wptouchWizardThemeSelect(){
242
  function wptouchWizardSetupComplete(){
243
  jQuery( '#exit_wizard_customizer, #exit_wizard_settings' ).on( 'click', function(){
244
  jQuery.cookie( 'jQu3ry_5teps_St@te_wptouch-wizard-container', '1', { expires: -1 } );
245
- jQuery.cookie( 'wptouch_customizer_use', 'mobile', { expires: 0, path: '/' } );
246
  });
247
  }
248
 
142
  return true;
143
  }
144
  });
145
+
146
  // Now make it visible ;p
147
  wizardContainer.css( 'visibility', 'visible' );
148
  }
172
  if ( !jQuery( this ).prop( 'checked' ) ) {
173
  jQuery( 'i.heartbeat' ).removeClass( 'icon-heart' ).addClass( 'icon-heart-broken' );
174
  } else {
175
+ jQuery( 'i.heartbeat' ).addClass( 'icon-heart' ).removeClass( 'icon-heart-broken' );
176
  }
177
  });
178
  }
198
  wptouchAdminAjax( 'activate-license-key', ajaxParams, function( result ) {
199
  if ( result == '1' ) {
200
  // license success
201
+ bncHasLicense = 1;
202
  wptouchReload();
203
 
204
  } else {
242
  function wptouchWizardSetupComplete(){
243
  jQuery( '#exit_wizard_customizer, #exit_wizard_settings' ).on( 'click', function(){
244
  jQuery.cookie( 'jQu3ry_5teps_St@te_wptouch-wizard-container', '1', { expires: -1 } );
245
+ jQuery.cookie( 'wptouch_customizer_mode', 'mobile', { expires: 0, path: '/' } );
246
  });
247
  }
248
 
lang/wptouch.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the WPtouch Mobile Plugin package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPtouch Mobile Plugin 4.2\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wptouch\n"
7
- "POT-Creation-Date: 2016-08-03 19:10:12+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -2375,11 +2375,11 @@ msgstr ""
2375
  msgid "Page"
2376
  msgstr ""
2377
 
2378
- #: wptouch.php:155 wptouch.php:162
2379
  msgid "%sSign-up to to get WPtouch new on updates and changes via email:%s"
2380
  msgstr ""
2381
 
2382
- #: wptouch.php:161
2383
  msgid ""
2384
  "%sNEW! WPtouch now supports live editing in the WordPress Customizer!%s "
2385
  "Check it out: <a href=\"%s?"
2
  # This file is distributed under the same license as the WPtouch Mobile Plugin package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPtouch Mobile Plugin 4.2.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wptouch\n"
7
+ "POT-Creation-Date: 2016-08-05 18:04:40+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2375
  msgid "Page"
2376
  msgstr ""
2377
 
2378
+ #: wptouch.php:157 wptouch.php:164
2379
  msgid "%sSign-up to to get WPtouch new on updates and changes via email:%s"
2380
  msgstr ""
2381
 
2382
+ #: wptouch.php:163
2383
  msgid ""
2384
  "%sNEW! WPtouch now supports live editing in the WordPress Customizer!%s "
2385
  "Check it out: <a href=\"%s?"
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: bravenewcode, duanestorey, dalemugford, adamdipardo
3
  Tags: wptouch, iphone, ipod, bravenewcode, mobile, mobile-friendly, android, blackberry, smartphone, responsive, design, mobile plugin, ios, mobile theme
4
  Requires at least: 4.2
5
- Stable tag: 4.2
6
  Tested up to: 4.6
7
  License: GPLv2
8
 
@@ -33,6 +33,12 @@ For more information visit [WPtouch.com](http://www.wptouch.com/?utm_campaign=wp
33
 
34
  == Changelog ==
35
 
 
 
 
 
 
 
36
  = Version 4.2 (August 3, 2016) =
37
 
38
  * Added: NEW! Change theme settings in the WordPress Customizer!
2
  Contributors: bravenewcode, duanestorey, dalemugford, adamdipardo
3
  Tags: wptouch, iphone, ipod, bravenewcode, mobile, mobile-friendly, android, blackberry, smartphone, responsive, design, mobile plugin, ios, mobile theme
4
  Requires at least: 4.2
5
+ Stable tag: 4.2.1
6
  Tested up to: 4.6
7
  License: GPLv2
8
 
33
 
34
  == Changelog ==
35
 
36
+
37
+ = Version 4.2.1 (August 5, 2016) =
38
+
39
+ * Fixed: An issue which could prevent the Customizer from switching between desktop and mobile
40
+ * Fixed: New admin notifications showing for non-admin users
41
+
42
  = Version 4.2 (August 3, 2016) =
43
 
44
  * Added: NEW! Change theme settings in the WordPress Customizer!
wptouch.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: WPtouch Mobile Plugin
4
  Plugin URI: http://www.wptouch.com/
5
- Version: 4.2
6
  Description: Make a beautiful mobile-friendly version of your website with just a few clicks
7
  Author: BraveNewCode Inc.
8
  Author URI: http://www.bravenewcode.com/
@@ -14,7 +14,7 @@
14
 
15
  function wptouch_create_four_object() {
16
  if ( !defined( 'WPTOUCH_IS_PRO' ) ) {
17
- define( 'WPTOUCH_VERSION', '4.2' );
18
 
19
  define( 'WPTOUCH_BASE_NAME', basename( __FILE__, '.php' ) . '.php' );
20
  define( 'WPTOUCH_DIR', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . basename( __FILE__, '.php' ) );
@@ -144,26 +144,29 @@ function wptouch_free_admin_notice() {
144
  global $current_user;
145
  $user_id = $current_user->ID;
146
 
147
- //delete_user_meta( $user_id, 'wptouch_free_message_419' );
148
- $random_num = wptouch_free_get_random_site( 2 );
149
-
150
- if ( !get_user_meta( $user_id, 'wptouch_free_message_419' ) ) {
151
- echo '<div style="position:relative;" class="notice notice-success">';
152
- switch( $random_num ) {
153
- case 0:
154
- $current_user = wp_get_current_user();
155
- echo '<p><form action="http://wptouch.createsend.com/t/t/s/xurhlk/" method="post" id="subForm"><input id="fieldName" name="cm-name" type="hidden" value="' . $current_user->first_name . ' ' . $current_user->last_name . '" /><input id="fieldEmail" name="cm-xurhlk-xurhlk" type="hidden" value="' . $current_user->user_email . '" />' . sprintf( __( '%sSign-up to to get WPtouch new on updates and changes via email:%s', 'wptouch' ), '<strong>', '</strong>' ) . '<button class="button button-secondary" type="submit" style="margin-left: 10px; margin-top:-5px;">Subscribe &rarr;</button></form></p>';
156
- echo '<a style="text-decoration:none;" class="notice-dismiss" href="?wptouch_free_message_419=1"></a>';
157
- break;
158
- case 1:
159
- $current_user = wp_get_current_user();
160
- $customizer_url = admin_url( 'customize.php' );
161
- echo '<p>' . sprintf( __( '%sNEW! WPtouch now supports live editing in the WordPress Customizer!%s Check it out: <a href="%s?wptouch_free_message_419=1&utm_source=free_admin&utm_medium=website&utm_term=dale&utm_campaign=admin_notice">Customize WPtouch Now &rarr;</a> %s', 'wptouch' ), '<strong>', '</strong>', $customizer_url, '<a style="text-decoration:none;" class="notice-dismiss" href="?wptouch_free_message_419=1"></a>' ) . '</p>';
162
- echo '<p><form action="http://wptouch.createsend.com/t/t/s/xurhlk/" method="post" id="subForm"><input id="fieldName" name="cm-name" type="hidden" value="' . $current_user->first_name . ' ' . $current_user->last_name . '" /><input id="fieldEmail" name="cm-xurhlk-xurhlk" type="hidden" value="' . $current_user->user_email . '" />' . sprintf( __( '%sSign-up to to get WPtouch new on updates and changes via email:%s', 'wptouch' ), '<strong>', '</strong>' ) . '<button class="button button-secondary" type="submit" style="margin-left: 10px; margin-top:-5px;">Subscribe &rarr;</button></form></p>';
163
- echo '<a style="text-decoration:none;" class="notice-dismiss" href="?wptouch_free_message_419=1"></a>';
164
- break;
 
 
 
 
165
  }
166
- echo '</div>';
167
  }
168
  }
169
 
@@ -173,9 +176,10 @@ function wptouch_free_admin_notice_dismiss() {
173
 
174
  /* If user clicks to ignore the notice, add that to their user meta */
175
  if ( isset( $_GET['wptouch_free_message_419'] ) && $_GET['wptouch_free_message_419'] == '1' ) {
176
- setcookie( 'wptouch_customizer_use', 'mobile' );
177
  add_user_meta( $user_id, 'wptouch_free_message_419', '1' );
178
  }
 
179
  }
180
 
181
  add_action( 'admin_init', 'wptouch_free_admin_notice_dismiss' );
2
  /*
3
  Plugin Name: WPtouch Mobile Plugin
4
  Plugin URI: http://www.wptouch.com/
5
+ Version: 4.2.1
6
  Description: Make a beautiful mobile-friendly version of your website with just a few clicks
7
  Author: BraveNewCode Inc.
8
  Author URI: http://www.bravenewcode.com/
14
 
15
  function wptouch_create_four_object() {
16
  if ( !defined( 'WPTOUCH_IS_PRO' ) ) {
17
+ define( 'WPTOUCH_VERSION', '4.2.1' );
18
 
19
  define( 'WPTOUCH_BASE_NAME', basename( __FILE__, '.php' ) . '.php' );
20
  define( 'WPTOUCH_DIR', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . basename( __FILE__, '.php' ) );
144
  global $current_user;
145
  $user_id = $current_user->ID;
146
 
147
+ if ( current_user_can( 'administrator' ) ) {
148
+
149
+ //delete_user_meta( $user_id, 'wptouch_free_message_419' );
150
+ $random_num = wptouch_free_get_random_site( 2 );
151
+
152
+ if ( !get_user_meta( $user_id, 'wptouch_free_message_419' ) ) {
153
+ echo '<div style="position:relative;" class="notice notice-success">';
154
+ switch( $random_num ) {
155
+ case 0:
156
+ $current_user = wp_get_current_user();
157
+ echo '<p><form action="http://wptouch.createsend.com/t/t/s/xurhlk/" method="post" id="subForm"><input id="fieldName" name="cm-name" type="hidden" value="' . $current_user->first_name . ' ' . $current_user->last_name . '" /><input id="fieldEmail" name="cm-xurhlk-xurhlk" type="hidden" value="' . $current_user->user_email . '" />' . sprintf( __( '%sSign-up to to get WPtouch new on updates and changes via email:%s', 'wptouch' ), '<strong>', '</strong>' ) . '<button class="button button-secondary" type="submit" style="margin-left: 10px; margin-top:-5px;">Subscribe &rarr;</button></form></p>';
158
+ echo '<a style="text-decoration:none;" class="notice-dismiss" href="?wptouch_free_message_419=1"></a>';
159
+ break;
160
+ case 1:
161
+ $current_user = wp_get_current_user();
162
+ $customizer_url = admin_url( 'customize.php' );
163
+ echo '<p>' . sprintf( __( '%sNEW! WPtouch now supports live editing in the WordPress Customizer!%s Check it out: <a href="%s?wptouch_free_message_419=1&utm_source=free_admin&utm_medium=website&utm_term=dale&utm_campaign=admin_notice">Customize WPtouch Now &rarr;</a> %s', 'wptouch' ), '<strong>', '</strong>', $customizer_url, '<a style="text-decoration:none;" class="notice-dismiss" href="?wptouch_free_message_419=1"></a>' ) . '</p>';
164
+ echo '<p><form action="http://wptouch.createsend.com/t/t/s/xurhlk/" method="post" id="subForm"><input id="fieldName" name="cm-name" type="hidden" value="' . $current_user->first_name . ' ' . $current_user->last_name . '" /><input id="fieldEmail" name="cm-xurhlk-xurhlk" type="hidden" value="' . $current_user->user_email . '" />' . sprintf( __( '%sSign-up to to get WPtouch new on updates and changes via email:%s', 'wptouch' ), '<strong>', '</strong>' ) . '<button class="button button-secondary" type="submit" style="margin-left: 10px; margin-top:-5px;">Subscribe &rarr;</button></form></p>';
165
+ echo '<a style="text-decoration:none;" class="notice-dismiss" href="?wptouch_free_message_419=1"></a>';
166
+ break;
167
+ }
168
+ echo '</div>';
169
  }
 
170
  }
171
  }
172
 
176
 
177
  /* If user clicks to ignore the notice, add that to their user meta */
178
  if ( isset( $_GET['wptouch_free_message_419'] ) && $_GET['wptouch_free_message_419'] == '1' ) {
179
+ setcookie( 'wptouch_customizer_mode', 'mobile', 0, '/' );
180
  add_user_meta( $user_id, 'wptouch_free_message_419', '1' );
181
  }
182
+
183
  }
184
 
185
  add_action( 'admin_init', 'wptouch_free_admin_notice_dismiss' );