To Top - Version 1.5.2

Version Description

  • Bug Fixed: Default value of 'margin_x' in customizer ( Reported By: sherrif02 )
  • Bug Fixed: Condition check for CSS ( Reported By: sherrif02 )
  • Updated: Make image link protocolless http:// or https:// to // ( Reported By: pianoworld )
Download this release

Release Info

Developer catchthemes
Plugin Icon 128x128 To Top
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: catchthemes
3
  Donate link: https://catchthemes.com/wp-plugins/to-top/
4
  Tags: to-top, arrow, button, icon, link to top, scroll, back to top, scroll to top, scroll top, scroll up, simple scroll to top, simple back to top, smooth scroll
5
  Requires at least: 4.5
6
- Tested up to: 4.7.1
7
- Stable tag: 1.5.1
8
  License: GNU General Public License, version 3 (GPLv3)
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
10
 
@@ -57,6 +57,11 @@ You'll then see To Top dashboard from which you can enable or disable the button
57
 
58
  == Changelog ==
59
 
 
 
 
 
 
60
  = 1.5.1 =
61
  * Bug Fixed: array_merge issue in some php versions
62
 
3
  Donate link: https://catchthemes.com/wp-plugins/to-top/
4
  Tags: to-top, arrow, button, icon, link to top, scroll, back to top, scroll to top, scroll top, scroll up, simple scroll to top, simple back to top, smooth scroll
5
  Requires at least: 4.5
6
+ Tested up to: 4.7.4
7
+ Stable tag: 1.5.2
8
  License: GNU General Public License, version 3 (GPLv3)
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
10
 
57
 
58
  == Changelog ==
59
 
60
+ = 1.5.2 =
61
+ * Bug Fixed: Default value of 'margin_x' in customizer ( Reported By: sherrif02 )
62
+ * Bug Fixed: Condition check for CSS ( Reported By: sherrif02 )
63
+ * Updated: Make image link protocolless http:// or https:// to // ( Reported By: pianoworld )
64
+
65
  = 1.5.1 =
66
  * Bug Fixed: array_merge issue in some php versions
67
 
admin/class-to-top-admin.php CHANGED
@@ -544,7 +544,7 @@ class To_Top_Admin {
544
 
545
  $wp_customize->add_setting( 'to_top_options[margin_y]', array(
546
  'capability' => 'edit_theme_options',
547
- 'default' => $to_top_defaults['border_radius'],
548
  'type' => 'option',
549
  'transport' => 'postMessage',
550
  ) );
544
 
545
  $wp_customize->add_setting( 'to_top_options[margin_y]', array(
546
  'capability' => 'edit_theme_options',
547
+ 'default' => $to_top_defaults['margin_y'],
548
  'type' => 'option',
549
  'transport' => 'postMessage',
550
  ) );
languages/to-top.pot CHANGED
@@ -5,7 +5,7 @@ msgid ""
5
  msgstr ""
6
  "Project-Id-Version: To Top\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
8
- "POT-Creation-Date: 2017-01-29 10:47+0545\n"
9
  "PO-Revision-Date: 2016-12-07 23:04-0500\n"
10
  "Last-Translator: Sakin Shrestha <info@catchthemes.com>\n"
11
  "Language-Team: Catch Themes <info@catchthemes.com>\n"
@@ -14,7 +14,7 @@ msgstr ""
14
  "Content-Type: text/plain; charset=UTF-8\n"
15
  "Content-Transfer-Encoding: 8bit\n"
16
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
- "X-Generator: Poedit 1.8.11\n"
18
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;esc_attr_e;esc_attr__;_nx;"
19
  "esc_html__;esc_html_e\n"
20
  "X-Poedit-Basepath: .\n"
5
  msgstr ""
6
  "Project-Id-Version: To Top\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
8
+ "POT-Creation-Date: 2017-04-27 17:12+0545\n"
9
  "PO-Revision-Date: 2016-12-07 23:04-0500\n"
10
  "Last-Translator: Sakin Shrestha <info@catchthemes.com>\n"
11
  "Language-Team: Catch Themes <info@catchthemes.com>\n"
14
  "Content-Type: text/plain; charset=UTF-8\n"
15
  "Content-Transfer-Encoding: 8bit\n"
16
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Generator: Poedit 2.0.1\n"
18
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;esc_attr_e;esc_attr__;_nx;"
19
  "esc_html__;esc_html_e\n"
20
  "X-Poedit-Basepath: .\n"
public/class-to-top-public.php CHANGED
@@ -133,7 +133,7 @@ class To_Top_Public {
133
  }
134
 
135
  if ( 'icon' == $option['style'] ) {
136
- echo '<div id="to_top_scrollup" class="dashicons ' . esc_attr( $option['icon_type'] ) .'"><span class="screen-reader-text">' . __( 'Scroll Up', 'to-top' ) . '</span></div>' ;
137
  }
138
  else if ( 'genericon-icon' == $option['style'] ) {
139
  if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
@@ -146,7 +146,7 @@ class To_Top_Public {
146
  $class = 'genericon genericon-collapse';
147
  }
148
 
149
- echo '<div id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . __( 'Scroll Up', 'to-top' ) . '</span></div>' ;
150
  }
151
  else if ( 'font-awesome-icon' == $option['style'] ) {
152
  if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
@@ -159,10 +159,22 @@ class To_Top_Public {
159
  $class = 'fa fa-angle-up';
160
  }
161
 
162
- echo '<div id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . __( 'Scroll Up', 'to-top' ) . '</span></div>' ;
163
  }
164
  else {
165
- echo '<div id="to_top_scrollup"><img alt="' . esc_attr( $option['image_alt'] ) . '" src="' . esc_url( $option['image'] ) . '"/></div>' ;
 
 
 
 
 
 
 
 
 
 
 
 
166
  }
167
  }
168
 
@@ -207,7 +219,7 @@ class To_Top_Public {
207
  $custom_css .= 'opacity: ' . esc_attr( $option['icon_opacity'] / 100 ) . ';';
208
  }
209
 
210
- if ( $default['location'] != $option['location'] || $default['margin_x'] != $option['margin_x'] || $default['margin_x'] != $option['margin_x'] ) {
211
  $offset = explode( '-', $option['location'] );
212
  $offset1 = $offset[0];
213
  $offset2 = $offset[1];
133
  }
134
 
135
  if ( 'icon' == $option['style'] ) {
136
+ echo '<div id="to_top_scrollup" class="dashicons ' . esc_attr( $option['icon_type'] ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></div>' ;
137
  }
138
  else if ( 'genericon-icon' == $option['style'] ) {
139
  if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
146
  $class = 'genericon genericon-collapse';
147
  }
148
 
149
+ echo '<div id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></div>' ;
150
  }
151
  else if ( 'font-awesome-icon' == $option['style'] ) {
152
  if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
159
  $class = 'fa fa-angle-up';
160
  }
161
 
162
+ echo '<div id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></div>' ;
163
  }
164
  else {
165
+ if( '' != $option['image'] ){
166
+ /**
167
+ * make image link protocolless
168
+ * http:// or https:// to //
169
+ */
170
+ $image = explode( ':', $option['image'] );
171
+
172
+ unset( $image[0] );
173
+
174
+ $image = implode( '', $image );
175
+
176
+ echo '<div id="to_top_scrollup"><img alt="' . esc_attr( $option['image_alt'] ) . '" src="' . esc_url( $image ) . '"/></div>' ;
177
+ }
178
  }
179
  }
180
 
219
  $custom_css .= 'opacity: ' . esc_attr( $option['icon_opacity'] / 100 ) . ';';
220
  }
221
 
222
+ if ( $default['location'] != $option['location'] || $default['margin_x'] != $option['margin_x'] || $default['margin_y'] != $option['margin_y'] ) {
223
  $offset = explode( '-', $option['location'] );
224
  $offset1 = $offset[0];
225
  $offset2 = $offset[1];
to-top.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: To Top plugin allows the visitor as well as admin to easily scroll back to the top of the page, with fully customizable options and ability to use image.
6
  * Author: Catch Themes
7
  * Author URI: https://catchthemes.com/
8
- * Version: 1.5.1
9
  * License: GNU General Public License, version 3 (GPLv3)
10
  * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
11
  * Text Domain: to-top
5
  * Description: To Top plugin allows the visitor as well as admin to easily scroll back to the top of the page, with fully customizable options and ability to use image.
6
  * Author: Catch Themes
7
  * Author URI: https://catchthemes.com/
8
+ * Version: 1.5.2
9
  * License: GNU General Public License, version 3 (GPLv3)
10
  * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
11
  * Text Domain: to-top