Version Description
(Released: August 05, 2021) = * Added: aria-hidden attribute (Requested by flberger) * Added: async attribute to script tag (Requested by llubder) * Compatibility check up to version 5.8
Download this release
Release Info
Developer | catchthemes |
Plugin | To Top |
Version | 2.2.2 |
Comparing to | |
See all releases |
Code changes from version 2.2.1 to 2.2.2
- README.txt +7 -1
- includes/class-to-top.php +1 -0
- languages/to-top-fr_FR.mo +0 -0
- languages/to-top-fr_FR.po +5 -5
- languages/to-top.pot +5 -5
- public/class-to-top-public.php +16 -7
- to-top.php +2 -2
README.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: catchplugins, catchthemes, sakinshrestha, pratikshrestha, maheshma
|
|
3 |
Donate link: https://catchplugins.com/plugins/to-top/
|
4 |
Tags: to top, scroll up, 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.8
|
6 |
-
Tested up to: 5.
|
7 |
Stable tag: trunk
|
8 |
License: GNU General Public License, version 3 (GPLv3)
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
@@ -56,6 +56,12 @@ You'll then see To Top dashboard from which you can enable or disable the button
|
|
56 |
5. Reset Settings
|
57 |
|
58 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
= 2.2.1 (Released: March 07, 2021) =
|
60 |
* Compatibility check up to version 5.7
|
61 |
|
3 |
Donate link: https://catchplugins.com/plugins/to-top/
|
4 |
Tags: to top, scroll up, 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.8
|
6 |
+
Tested up to: 5.8
|
7 |
Stable tag: trunk
|
8 |
License: GNU General Public License, version 3 (GPLv3)
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
56 |
5. Reset Settings
|
57 |
|
58 |
== Changelog ==
|
59 |
+
|
60 |
+
= 2.2.2 (Released: August 05, 2021) =
|
61 |
+
* Added: aria-hidden attribute (Requested by flberger)
|
62 |
+
* Added: async attribute to script tag (Requested by llubder)
|
63 |
+
* Compatibility check up to version 5.8
|
64 |
+
|
65 |
= 2.2.1 (Released: March 07, 2021) =
|
66 |
* Compatibility check up to version 5.7
|
67 |
|
includes/class-to-top.php
CHANGED
@@ -190,6 +190,7 @@ class To_Top {
|
|
190 |
|
191 |
$this->loader->add_action( 'wp_footer', $plugin_public, 'public_display' );
|
192 |
$this->loader->add_action( 'admin_footer', $plugin_public, 'public_display' );
|
|
|
193 |
}
|
194 |
|
195 |
/**
|
190 |
|
191 |
$this->loader->add_action( 'wp_footer', $plugin_public, 'public_display' );
|
192 |
$this->loader->add_action( 'admin_footer', $plugin_public, 'public_display' );
|
193 |
+
$this->loader->add_filter( 'script_loader_tag', $plugin_public, 'make_script_async', 10, 3 );
|
194 |
}
|
195 |
|
196 |
/**
|
languages/to-top-fr_FR.mo
CHANGED
Binary file
|
languages/to-top-fr_FR.po
CHANGED
@@ -4,8 +4,8 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: To Top\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
|
7 |
-
"POT-Creation-Date: 2021-
|
8 |
-
"PO-Revision-Date: 2021-
|
9 |
"Last-Translator: Hubert Desrues <hubert.desrues@gmail.com>\n"
|
10 |
"Language-Team: Français\n"
|
11 |
"Language: fr_FR\n"
|
@@ -13,7 +13,7 @@ msgstr ""
|
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
16 |
-
"X-Generator: Poedit 2.4.
|
17 |
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;esc_attr_e;esc_attr__;_nx;"
|
18 |
"esc_html__;esc_html_e\n"
|
19 |
"X-Poedit-Basepath: .\n"
|
@@ -470,7 +470,7 @@ msgstr "Réinitialiser tous les réglages"
|
|
470 |
msgid "Caution: All data will be lost"
|
471 |
msgstr "Attention : toutes les données vont être perdues"
|
472 |
|
473 |
-
#: ../public/class-to-top-public.php:
|
474 |
-
#: ../public/class-to-top-public.php:
|
475 |
msgid "Scroll Up"
|
476 |
msgstr "Défiler vers le haut"
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: To Top\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
|
7 |
+
"POT-Creation-Date: 2021-08-05 10:48-0700\n"
|
8 |
+
"PO-Revision-Date: 2021-08-05 10:48-0700\n"
|
9 |
"Last-Translator: Hubert Desrues <hubert.desrues@gmail.com>\n"
|
10 |
"Language-Team: Français\n"
|
11 |
"Language: fr_FR\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
16 |
+
"X-Generator: Poedit 2.4.3\n"
|
17 |
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;esc_attr_e;esc_attr__;_nx;"
|
18 |
"esc_html__;esc_html_e\n"
|
19 |
"X-Poedit-Basepath: .\n"
|
470 |
msgid "Caution: All data will be lost"
|
471 |
msgstr "Attention : toutes les données vont être perdues"
|
472 |
|
473 |
+
#: ../public/class-to-top-public.php:145 ../public/class-to-top-public.php:158
|
474 |
+
#: ../public/class-to-top-public.php:171
|
475 |
msgid "Scroll Up"
|
476 |
msgstr "Défiler vers le haut"
|
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: 2021-
|
9 |
"PO-Revision-Date: 2016-12-07 23:04-0500\n"
|
10 |
"Last-Translator: Sakin Shrestha <info@catchplugins.com>\n"
|
11 |
"Language-Team: Catch Plugins <info@catchplugins.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 2.4.
|
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"
|
@@ -441,8 +441,8 @@ msgstr ""
|
|
441 |
msgid "Caution: All data will be lost"
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: ../public/class-to-top-public.php:
|
445 |
-
#: ../public/class-to-top-public.php:
|
446 |
-
#: ../public/class-to-top-public.php:
|
447 |
msgid "Scroll Up"
|
448 |
msgstr ""
|
5 |
msgstr ""
|
6 |
"Project-Id-Version: To Top\n"
|
7 |
"Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
|
8 |
+
"POT-Creation-Date: 2021-08-05 10:48-0700\n"
|
9 |
"PO-Revision-Date: 2016-12-07 23:04-0500\n"
|
10 |
"Last-Translator: Sakin Shrestha <info@catchplugins.com>\n"
|
11 |
"Language-Team: Catch Plugins <info@catchplugins.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.4.3\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"
|
441 |
msgid "Caution: All data will be lost"
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: ../public/class-to-top-public.php:145
|
445 |
+
#: ../public/class-to-top-public.php:158
|
446 |
+
#: ../public/class-to-top-public.php:171
|
447 |
msgid "Scroll Up"
|
448 |
msgstr ""
|
public/class-to-top-public.php
CHANGED
@@ -78,7 +78,8 @@ class To_Top_Public {
|
|
78 |
$dependency = array();
|
79 |
|
80 |
if ( 'icon' == $option['style'] ) {
|
81 |
-
|
|
|
82 |
}
|
83 |
else if ( 'genericon-icon' == $option['style'] ) {
|
84 |
$dependency[] = 'genericons';
|
@@ -86,15 +87,24 @@ class To_Top_Public {
|
|
86 |
wp_register_style( 'genericons', plugin_dir_url( __FILE__ ) . 'css/genericons/genericons.css', false, '3.4.1' );
|
87 |
}
|
88 |
else if ( 'font-awesome-icon' == $option['style'] ) {
|
89 |
-
$dependency[] = 'font-awesome';
|
90 |
|
91 |
-
wp_register_style( 'font-awesome', plugin_dir_url( __FILE__ ) . 'css/font-awesome/css/font-awesome.min.css', false, '4.5.0' );
|
92 |
|
93 |
}
|
94 |
|
95 |
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/to-top-public.css', $dependency, $this->version, 'all' );
|
96 |
}
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
/**
|
99 |
* Register the JavaScript for the public-facing side of the site.
|
100 |
*
|
@@ -126,14 +136,13 @@ class To_Top_Public {
|
|
126 |
public function public_display() {
|
127 |
|
128 |
$option = to_top_get_options();
|
129 |
-
|
130 |
if ( is_admin() && !$option['show_on_admin'] ) {
|
131 |
//Bail early if in admin and show on admin is disabled
|
132 |
return;
|
133 |
}
|
134 |
|
135 |
if ( 'icon' == $option['style'] ) {
|
136 |
-
echo '<span id="to_top_scrollup" class="dashicons ' . esc_attr( $option['icon_type'] ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></span>' ;
|
137 |
}
|
138 |
else if ( 'genericon-icon' == $option['style'] ) {
|
139 |
if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
|
@@ -146,7 +155,7 @@ class To_Top_Public {
|
|
146 |
$class = 'genericon genericon-collapse';
|
147 |
}
|
148 |
|
149 |
-
echo '<span id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></span>' ;
|
150 |
}
|
151 |
else if ( 'font-awesome-icon' == $option['style'] ) {
|
152 |
if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
|
@@ -159,7 +168,7 @@ class To_Top_Public {
|
|
159 |
$class = 'fa fa-angle-up';
|
160 |
}
|
161 |
|
162 |
-
echo '<span id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></span>' ;
|
163 |
}
|
164 |
else {
|
165 |
if( '' != $option['image'] ){
|
78 |
$dependency = array();
|
79 |
|
80 |
if ( 'icon' == $option['style'] ) {
|
81 |
+
wp_enqueue_style( 'dashicons' );
|
82 |
+
// $dependency[] = 'dashicons';
|
83 |
}
|
84 |
else if ( 'genericon-icon' == $option['style'] ) {
|
85 |
$dependency[] = 'genericons';
|
87 |
wp_register_style( 'genericons', plugin_dir_url( __FILE__ ) . 'css/genericons/genericons.css', false, '3.4.1' );
|
88 |
}
|
89 |
else if ( 'font-awesome-icon' == $option['style'] ) {
|
90 |
+
$dependency[] = 'to-top-font-awesome';
|
91 |
|
92 |
+
wp_register_style( 'to-top-font-awesome', plugin_dir_url( __FILE__ ) . 'css/font-awesome/css/font-awesome.min.css', false, '4.5.0' );
|
93 |
|
94 |
}
|
95 |
|
96 |
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/to-top-public.css', $dependency, $this->version, 'all' );
|
97 |
}
|
98 |
|
99 |
+
function make_script_async( $tag, $handle, $src )
|
100 |
+
{
|
101 |
+
if ( $this->plugin_name != $handle ) {
|
102 |
+
return $tag;
|
103 |
+
}
|
104 |
+
|
105 |
+
return str_replace( '<script', '<script async', $tag );
|
106 |
+
}
|
107 |
+
|
108 |
/**
|
109 |
* Register the JavaScript for the public-facing side of the site.
|
110 |
*
|
136 |
public function public_display() {
|
137 |
|
138 |
$option = to_top_get_options();
|
|
|
139 |
if ( is_admin() && !$option['show_on_admin'] ) {
|
140 |
//Bail early if in admin and show on admin is disabled
|
141 |
return;
|
142 |
}
|
143 |
|
144 |
if ( 'icon' == $option['style'] ) {
|
145 |
+
echo '<span aria-hidden="true" id="to_top_scrollup" class="dashicons ' . esc_attr( $option['icon_type'] ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></span>' ;
|
146 |
}
|
147 |
else if ( 'genericon-icon' == $option['style'] ) {
|
148 |
if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
|
155 |
$class = 'genericon genericon-collapse';
|
156 |
}
|
157 |
|
158 |
+
echo '<span aria-hidden="true" id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></span>' ;
|
159 |
}
|
160 |
else if ( 'font-awesome-icon' == $option['style'] ) {
|
161 |
if ( 'dashicons-arrow-up' == $option['icon_type'] ) {
|
168 |
$class = 'fa fa-angle-up';
|
169 |
}
|
170 |
|
171 |
+
echo '<span aria-hidden="true" id="to_top_scrollup" class="' . esc_attr( $class ) .'"><span class="screen-reader-text">' . esc_html__( 'Scroll Up', 'to-top' ) . '</span></span>' ;
|
172 |
}
|
173 |
else {
|
174 |
if( '' != $option['image'] ){
|
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 Plugins
|
7 |
* Author URI: https://catchplugins.com/
|
8 |
-
* Version: 2.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
|
@@ -38,7 +38,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
38 |
}
|
39 |
|
40 |
// Define Version
|
41 |
-
define( 'TOTOP_VERSION', '2.2.
|
42 |
|
43 |
// The URL of the directory that contains the plugin
|
44 |
if ( ! defined( 'TOTOP_URL' ) ) {
|
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 Plugins
|
7 |
* Author URI: https://catchplugins.com/
|
8 |
+
* Version: 2.2.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
|
38 |
}
|
39 |
|
40 |
// Define Version
|
41 |
+
define( 'TOTOP_VERSION', '2.2.2' );
|
42 |
|
43 |
// The URL of the directory that contains the plugin
|
44 |
if ( ! defined( 'TOTOP_URL' ) ) {
|