Version Description
This maintenance update is for compatibility with WordPress 5.0.2 and PHP 7.3. It also includes performance updates to the plugin framework.
Download this release
Release Info
Developer | a3rev |
Plugin | a3 Lazy Load |
Version | 1.9.2 |
Comparing to | |
See all releases |
Code changes from version 1.9.1 to 1.9.2
- a3-lazy-load.php +5 -4
- admin/admin-interface.php +58 -2
- admin/admin-ui.php +102 -4
- admin/assets/css/admin-ui-style.css +2 -1
- admin/assets/css/admin-ui-style.min.css +2 -1
- admin/assets/js/admin-ui-script.js +6 -0
- admin/includes/fonts_face.php +11 -2
- admin/less/sass.php +14 -3
- readme.txt +17 -2
a3-lazy-load.php
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
/*
|
3 |
Plugin Name: a3 Lazy Load
|
4 |
Description: Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.
|
5 |
-
Version: 1.9.
|
6 |
Author: a3rev Software
|
7 |
Author URI: https://a3rev.com/
|
8 |
Requires at least: 4.0
|
9 |
-
Tested up to:
|
10 |
Text Domain: a3-lazy-load
|
11 |
Domain Path: /languages
|
12 |
WC requires at least: 2.0.0
|
13 |
-
WC tested up to: 3.
|
14 |
License: GPLv2 or later
|
15 |
Copyright © 2011 a3 Revolution Software Development team
|
16 |
a3 Revolution Software Development team
|
@@ -32,7 +32,8 @@ define('A3_LAZY_LOAD_CSS_URL', A3_LAZY_LOAD_URL . '/assets/css');
|
|
32 |
define('A3_LAZY_LOAD_IMAGES_URL', A3_LAZY_LOAD_URL . '/assets/images');
|
33 |
|
34 |
define( 'A3_LAZY_LOAD_KEY', 'a3_lazy_load' );
|
35 |
-
define( 'A3_LAZY_VERSION', '1.9.
|
|
|
36 |
|
37 |
/**
|
38 |
* Load Localisation files.
|
2 |
/*
|
3 |
Plugin Name: a3 Lazy Load
|
4 |
Description: Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.
|
5 |
+
Version: 1.9.2
|
6 |
Author: a3rev Software
|
7 |
Author URI: https://a3rev.com/
|
8 |
Requires at least: 4.0
|
9 |
+
Tested up to: 5.0.2
|
10 |
Text Domain: a3-lazy-load
|
11 |
Domain Path: /languages
|
12 |
WC requires at least: 2.0.0
|
13 |
+
WC tested up to: 3.5.3
|
14 |
License: GPLv2 or later
|
15 |
Copyright © 2011 a3 Revolution Software Development team
|
16 |
a3 Revolution Software Development team
|
32 |
define('A3_LAZY_LOAD_IMAGES_URL', A3_LAZY_LOAD_URL . '/assets/images');
|
33 |
|
34 |
define( 'A3_LAZY_LOAD_KEY', 'a3_lazy_load' );
|
35 |
+
define( 'A3_LAZY_VERSION', '1.9.2' );
|
36 |
+
define( 'A3_LAZY_LOAD_G_FONTS', false );
|
37 |
|
38 |
/**
|
39 |
* Load Localisation files.
|
admin/admin-interface.php
CHANGED
@@ -384,7 +384,7 @@ class A3_Lazy_Load_Admin_Interface extends A3_Lazy_Load_Admin_UI
|
|
384 |
|
385 |
default :
|
386 |
// Do not include when it's separate option
|
387 |
-
if ( isset( $value['separate_option'] ) && $value['separate_option'] != false )
|
388 |
|
389 |
// Remove [, ] characters from id argument
|
390 |
if ( strstr( $value['id'], '[' ) ) {
|
@@ -1144,7 +1144,7 @@ class A3_Lazy_Load_Admin_Interface extends A3_Lazy_Load_Admin_UI
|
|
1144 |
* @return void
|
1145 |
* ========================================================================
|
1146 |
* Option Array Structure :
|
1147 |
-
* type => row | column | heading | ajax_submit | ajax_multi_submit | google_api_key | onoff_toggle_box
|
1148 |
* | text | email | number | password | color | bg_color | textarea | select | multiselect | radio | onoff_radio | checkbox | onoff_checkbox
|
1149 |
* | switcher_checkbox | image_size | single_select_page | typography | border | border_styles | border_corner | box_shadow
|
1150 |
* | slider | upload | wp_editor | array_textfields | time_picker
|
@@ -1834,6 +1834,62 @@ class A3_Lazy_Load_Admin_Interface extends A3_Lazy_Load_Admin_UI
|
|
1834 |
|
1835 |
break;
|
1836 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1837 |
// Manual Check New Version when click on the button instead of wait for daily
|
1838 |
case 'manual_check_version':
|
1839 |
|
384 |
|
385 |
default :
|
386 |
// Do not include when it's separate option
|
387 |
+
if ( isset( $value['separate_option'] ) && $value['separate_option'] != false ) break;
|
388 |
|
389 |
// Remove [, ] characters from id argument
|
390 |
if ( strstr( $value['id'], '[' ) ) {
|
1144 |
* @return void
|
1145 |
* ========================================================================
|
1146 |
* Option Array Structure :
|
1147 |
+
* type => row | column | heading | ajax_submit | ajax_multi_submit | google_api_key | google_map_api_key | onoff_toggle_box
|
1148 |
* | text | email | number | password | color | bg_color | textarea | select | multiselect | radio | onoff_radio | checkbox | onoff_checkbox
|
1149 |
* | switcher_checkbox | image_size | single_select_page | typography | border | border_styles | border_corner | box_shadow
|
1150 |
* | slider | upload | wp_editor | array_textfields | time_picker
|
1834 |
|
1835 |
break;
|
1836 |
|
1837 |
+
// Google Map API Key input
|
1838 |
+
case 'google_map_api_key':
|
1839 |
+
|
1840 |
+
$google_map_api_key = $this->settings_get_option( $this->google_map_api_key_option );
|
1841 |
+
$google_map_api_key_enable = $this->settings_get_option( $this->google_map_api_key_option . '_enable', 0 );
|
1842 |
+
if ( ! isset( $value['checked_label'] ) ) $value['checked_label'] = __( 'ON', 'a3-lazy-load' );
|
1843 |
+
if ( ! isset( $value['unchecked_label'] ) ) $value['unchecked_label'] = __( 'OFF', 'a3-lazy-load' );
|
1844 |
+
|
1845 |
+
?><tr valign="top">
|
1846 |
+
<th scope="row" class="titledesc">
|
1847 |
+
<?php echo $tip; ?>
|
1848 |
+
<label for="<?php echo $this->google_map_api_key_option; ?>"><?php echo __( 'Google Maps API', 'a3-lazy-load' ); ?></label>
|
1849 |
+
</th>
|
1850 |
+
<td class="forminp forminp-onoff_checkbox forminp-<?php echo sanitize_title( $value['type'] ) ?>">
|
1851 |
+
<input
|
1852 |
+
name="<?php echo $this->google_map_api_key_option; ?>_enable"
|
1853 |
+
id="<?php echo $this->google_map_api_key_option; ?>_enable"
|
1854 |
+
class="a3rev-ui-onoff_checkbox a3rev-ui-onoff_google_api_key_enable"
|
1855 |
+
checked_label="<?php echo esc_html( $value['checked_label'] ); ?>"
|
1856 |
+
unchecked_label="<?php echo esc_html( $value['unchecked_label'] ); ?>"
|
1857 |
+
type="checkbox"
|
1858 |
+
value="1"
|
1859 |
+
<?php checked( $google_map_api_key_enable, 1 ); ?>
|
1860 |
+
/> <span class="description" style="margin-left:5px;"><?php echo __( 'Switch ON to connect to Google Maps API', 'a3-lazy-load' ); ?></span>
|
1861 |
+
|
1862 |
+
<div> </div>
|
1863 |
+
<div class="a3rev-ui-google-api-key-container" style="<?php if( 1 != $google_map_api_key_enable ) { echo 'display: none;'; } ?>">
|
1864 |
+
<div class="a3rev-ui-google-api-key-description"><?php echo sprintf( __( "Enter your existing Google Map API Key below. Don't have a key? Visit <a href='%s' target='_blank'>Google Maps API</a> to create a key", 'a3-lazy-load' ), 'https://developers.google.com/maps/documentation/javascript/get-api-key' ); ?></div>
|
1865 |
+
<div class="a3rev-ui-google-api-key-inside
|
1866 |
+
<?php
|
1867 |
+
if ( $this->is_valid_google_map_api_key() ) {
|
1868 |
+
echo 'a3rev-ui-google-valid-key';
|
1869 |
+
} elseif ( '' != $google_map_api_key ) {
|
1870 |
+
echo 'a3rev-ui-google-unvalid-key';
|
1871 |
+
}
|
1872 |
+
?>
|
1873 |
+
">
|
1874 |
+
<input
|
1875 |
+
name="<?php echo $this->google_map_api_key_option; ?>"
|
1876 |
+
id="<?php echo $this->google_map_api_key_option; ?>"
|
1877 |
+
type="text"
|
1878 |
+
style="<?php echo esc_attr( $value['css'] ); ?>"
|
1879 |
+
value="<?php echo esc_attr( $google_map_api_key ); ?>"
|
1880 |
+
class="a3rev-ui-text a3rev-ui-<?php echo sanitize_title( $value['type'] ) ?> <?php echo esc_attr( $value['class'] ); ?>"
|
1881 |
+
placeholder="<?php echo __( 'Google Map API Key', 'a3-lazy-load' ); ?>"
|
1882 |
+
<?php echo implode( ' ', $custom_attributes ); ?>
|
1883 |
+
/>
|
1884 |
+
<p class="a3rev-ui-google-valid-key-message"><?php echo __( 'Your Google API Key is valid and automatic font updates are enabled.', 'a3-lazy-load' ); ?></p>
|
1885 |
+
<p class="a3rev-ui-google-unvalid-key-message"><?php echo __( 'Please enter a valid Google API Key.', 'a3-lazy-load' ); ?></p>
|
1886 |
+
</div>
|
1887 |
+
</div>
|
1888 |
+
</td>
|
1889 |
+
</tr><?php
|
1890 |
+
|
1891 |
+
break;
|
1892 |
+
|
1893 |
// Manual Check New Version when click on the button instead of wait for daily
|
1894 |
case 'manual_check_version':
|
1895 |
|
admin/admin-ui.php
CHANGED
@@ -31,13 +31,15 @@ class A3_Lazy_Load_Admin_UI
|
|
31 |
* You must change to correct plugin name that you are working
|
32 |
*/
|
33 |
|
34 |
-
public $framework_version = '2.0
|
35 |
public $plugin_name = A3_LAZY_LOAD_KEY;
|
36 |
public $plugin_path = A3_LAZY_LOAD_NAME;
|
37 |
public $google_api_key_option = '';
|
|
|
38 |
public $toggle_box_open_option = '';
|
39 |
public $version_transient = '';
|
40 |
public $is_free_plugin = true;
|
|
|
41 |
|
42 |
public $support_url = '';
|
43 |
|
@@ -71,11 +73,18 @@ class A3_Lazy_Load_Admin_UI
|
|
71 |
public $admin_pages = array( 'a3-lazy-load', 'a3-lazy-load-add' );
|
72 |
|
73 |
public function __construct() {
|
74 |
-
$this->google_api_key_option
|
75 |
-
$this->
|
76 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
$this->support_url = 'https://wordpress.org/support/plugin/a3-lazy-load/';
|
|
|
|
|
79 |
}
|
80 |
|
81 |
|
@@ -104,6 +113,95 @@ class A3_Lazy_Load_Admin_UI
|
|
104 |
return (array)$admin_pages;
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
/**
|
108 |
* get_premium_video_data()
|
109 |
* return array
|
31 |
* You must change to correct plugin name that you are working
|
32 |
*/
|
33 |
|
34 |
+
public $framework_version = '2.1.0';
|
35 |
public $plugin_name = A3_LAZY_LOAD_KEY;
|
36 |
public $plugin_path = A3_LAZY_LOAD_NAME;
|
37 |
public $google_api_key_option = '';
|
38 |
+
public $google_map_api_key_option = '';
|
39 |
public $toggle_box_open_option = '';
|
40 |
public $version_transient = '';
|
41 |
public $is_free_plugin = true;
|
42 |
+
public $is_load_google_fonts = true;
|
43 |
|
44 |
public $support_url = '';
|
45 |
|
73 |
public $admin_pages = array( 'a3-lazy-load', 'a3-lazy-load-add' );
|
74 |
|
75 |
public function __construct() {
|
76 |
+
$this->google_api_key_option = A3_LAZY_LOAD_KEY . '_google_api_key';
|
77 |
+
$this->google_map_api_key_option = A3_LAZY_LOAD_KEY . '_google_map_api_key';
|
78 |
+
$this->toggle_box_open_option = A3_LAZY_LOAD_KEY . '_toggle_box_open';
|
79 |
+
$this->version_transient = A3_LAZY_LOAD_KEY . '_licinfo';
|
80 |
+
|
81 |
+
if ( defined( 'A3_LAZY_LOAD_G_FONTS' ) ) {
|
82 |
+
$this->is_load_google_fonts = (boolean) A3_LAZY_LOAD_G_FONTS;
|
83 |
+
}
|
84 |
|
85 |
$this->support_url = 'https://wordpress.org/support/plugin/a3-lazy-load/';
|
86 |
+
|
87 |
+
$this->update_google_map_api_key();
|
88 |
}
|
89 |
|
90 |
|
113 |
return (array)$admin_pages;
|
114 |
}
|
115 |
|
116 |
+
public function is_valid_google_map_api_key( $cache=true ) {
|
117 |
+
$is_valid = false;
|
118 |
+
|
119 |
+
$this->google_map_api_key = get_option( $this->google_map_api_key_option, '' );
|
120 |
+
$google_map_api_key_enable = get_option( $this->google_map_api_key_option . '_enable', 0 );
|
121 |
+
|
122 |
+
if ( '' != trim( $this->google_map_api_key ) && 1 == $google_map_api_key_enable ) {
|
123 |
+
|
124 |
+
$google_map_api_key_status = get_transient( $this->google_map_api_key_option . '_status' );
|
125 |
+
|
126 |
+
if ( ! $cache ) {
|
127 |
+
$google_map_api_key_status = null;
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( ! $google_map_api_key_status ) {
|
131 |
+
$respone_api = wp_remote_get( "https://maps.googleapis.com/maps/api/geocode/json?address=Australia&key=" . trim( $this->google_map_api_key ),
|
132 |
+
array(
|
133 |
+
'sslverify' => false,
|
134 |
+
'timeout' => 45
|
135 |
+
)
|
136 |
+
);
|
137 |
+
|
138 |
+
$response_map = array();
|
139 |
+
|
140 |
+
// Check it is a valid request
|
141 |
+
if ( ! is_wp_error( $respone_api ) ) {
|
142 |
+
|
143 |
+
$json_string = get_magic_quotes_gpc() ? stripslashes( $respone_api['body'] ) : $respone_api['body'];
|
144 |
+
$response_map = json_decode( $json_string, true );
|
145 |
+
|
146 |
+
// Make sure that the valid response from google is not an error message
|
147 |
+
if ( ! isset( $response_map['error_message'] ) ) {
|
148 |
+
$google_map_api_key_status = 'valid';
|
149 |
+
} else {
|
150 |
+
$google_map_api_key_status = 'invalid';
|
151 |
+
}
|
152 |
+
|
153 |
+
} else {
|
154 |
+
$google_map_api_key_status = 'invalid';
|
155 |
+
}
|
156 |
+
|
157 |
+
//caching google map api status for 24 hours
|
158 |
+
set_transient( $this->google_map_api_key_option . '_status', $google_map_api_key_status, 86400 );
|
159 |
+
}
|
160 |
+
|
161 |
+
if ( 'valid' == $google_map_api_key_status ) {
|
162 |
+
$is_valid = true;
|
163 |
+
}
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
return $is_valid;
|
168 |
+
}
|
169 |
+
|
170 |
+
public function update_google_map_api_key() {
|
171 |
+
// Enable Google Map API Key
|
172 |
+
if ( isset( $_POST[ $this->google_map_api_key_option . '_enable' ] ) ) {
|
173 |
+
$old_google_map_api_key_enable = get_option( $this->google_map_api_key_option . '_enable', 0 );
|
174 |
+
|
175 |
+
update_option( $this->google_map_api_key_option . '_enable', 1 );
|
176 |
+
|
177 |
+
$option_value = trim( $_POST[ $this->google_map_api_key_option ] );
|
178 |
+
|
179 |
+
$old_google_map_api_key_option = get_option( $this->google_map_api_key_option );
|
180 |
+
|
181 |
+
if ( 1 != $old_google_map_api_key_enable || $option_value != $old_google_map_api_key_option ) {
|
182 |
+
|
183 |
+
update_option( $this->google_map_api_key_option, $option_value );
|
184 |
+
|
185 |
+
// Clear cached of google map api key status
|
186 |
+
delete_transient( $this->google_map_api_key_option . '_status' );
|
187 |
+
}
|
188 |
+
|
189 |
+
// Disable Google Map API Key
|
190 |
+
} elseif ( isset( $_POST[ $this->google_map_api_key_option ] ) ) {
|
191 |
+
$old_google_map_api_key_enable = get_option( $this->google_map_api_key_option . '_enable', 0 );
|
192 |
+
|
193 |
+
update_option( $this->google_map_api_key_option . '_enable', 0 );
|
194 |
+
|
195 |
+
$option_value = trim( $_POST[ $this->google_map_api_key_option ] );
|
196 |
+
update_option( $this->google_map_api_key_option, $option_value );
|
197 |
+
|
198 |
+
if ( 0 != $old_google_map_api_key_enable ) {
|
199 |
+
// Clear cached of google map api key status
|
200 |
+
delete_transient( $this->google_map_api_key_option . '_status' );
|
201 |
+
}
|
202 |
+
}
|
203 |
+
}
|
204 |
+
|
205 |
/**
|
206 |
* get_premium_video_data()
|
207 |
* return array
|
admin/assets/css/admin-ui-style.css
CHANGED
@@ -248,7 +248,8 @@
|
|
248 |
.a3rev_panel_container .a3rev-ui-password { width:300px; max-width:70%; }
|
249 |
|
250 |
/* Google API KEY Control */
|
251 |
-
.a3rev_panel_container .a3rev-ui-google_api_key
|
|
|
252 |
.a3rev_panel_container .a3rev-ui-google-api-key-inside { margin-top: 10px; }
|
253 |
.a3rev_panel_container .a3rev-ui-google-valid-key-message,
|
254 |
.a3rev_panel_container .a3rev-ui-google-unvalid-key-message { display: none; }
|
248 |
.a3rev_panel_container .a3rev-ui-password { width:300px; max-width:70%; }
|
249 |
|
250 |
/* Google API KEY Control */
|
251 |
+
.a3rev_panel_container .a3rev-ui-google_api_key,
|
252 |
+
.a3rev_panel_container .a3rev-ui-google_map_api_key { width:350px; max-width: 100%; }
|
253 |
.a3rev_panel_container .a3rev-ui-google-api-key-inside { margin-top: 10px; }
|
254 |
.a3rev_panel_container .a3rev-ui-google-valid-key-message,
|
255 |
.a3rev_panel_container .a3rev-ui-google-unvalid-key-message { display: none; }
|
admin/assets/css/admin-ui-style.min.css
CHANGED
@@ -93,7 +93,8 @@
|
|
93 |
.a3rev_panel_container .a3rev-ui-password{width:300px;max-width:70%;}
|
94 |
|
95 |
/* Google API KEY Control */
|
96 |
-
.a3rev_panel_container .a3rev-ui-google_api_key
|
|
|
97 |
.a3rev_panel_container .a3rev-ui-google-api-key-inside{margin-top:10px;}
|
98 |
.a3rev_panel_container .a3rev-ui-google-valid-key-message,
|
99 |
.a3rev_panel_container .a3rev-ui-google-unvalid-key-message{display:none;}
|
93 |
.a3rev_panel_container .a3rev-ui-password{width:300px;max-width:70%;}
|
94 |
|
95 |
/* Google API KEY Control */
|
96 |
+
.a3rev_panel_container .a3rev-ui-google_api_key,
|
97 |
+
.a3rev_panel_container .a3rev-ui-google_map_api_key{width:350px;max-width:100%;}
|
98 |
.a3rev_panel_container .a3rev-ui-google-api-key-inside{margin-top:10px;}
|
99 |
.a3rev_panel_container .a3rev-ui-google-valid-key-message,
|
100 |
.a3rev_panel_container .a3rev-ui-google-unvalid-key-message{display:none;}
|
admin/assets/js/admin-ui-script.js
CHANGED
@@ -102,12 +102,18 @@
|
|
102 |
|
103 |
/* Apply for Google API Key */
|
104 |
elem.parents('.forminp-google_api_key').find('.a3rev-ui-google-api-key-container').slideDown();
|
|
|
|
|
|
|
105 |
} else {
|
106 |
/* Apply for Border Corner */
|
107 |
elem.parents('.a3rev-ui-settings-control').find('.a3rev-ui-border-corner-value-container').slideUp();
|
108 |
|
109 |
/* Apply for Google API Key */
|
110 |
elem.parents('.forminp-google_api_key').find('.a3rev-ui-google-api-key-container').slideUp();
|
|
|
|
|
|
|
111 |
}
|
112 |
|
113 |
$('input[name="' + input_name + '"]').trigger("a3rev-ui-onoff_checkbox-switch", [elem.val(), status]);
|
102 |
|
103 |
/* Apply for Google API Key */
|
104 |
elem.parents('.forminp-google_api_key').find('.a3rev-ui-google-api-key-container').slideDown();
|
105 |
+
|
106 |
+
/* Apply for Google Map API Key */
|
107 |
+
elem.parents('.forminp-google_map_api_key').find('.a3rev-ui-google-api-key-container').slideDown();
|
108 |
} else {
|
109 |
/* Apply for Border Corner */
|
110 |
elem.parents('.a3rev-ui-settings-control').find('.a3rev-ui-border-corner-value-container').slideUp();
|
111 |
|
112 |
/* Apply for Google API Key */
|
113 |
elem.parents('.forminp-google_api_key').find('.a3rev-ui-google-api-key-container').slideUp();
|
114 |
+
|
115 |
+
/* Apply for Google Map API Key */
|
116 |
+
elem.parents('.forminp-google_map_api_key').find('.a3rev-ui-google-api-key-container').slideUp();
|
117 |
}
|
118 |
|
119 |
$('input[name="' + input_name + '"]').trigger("a3rev-ui-onoff_checkbox-switch", [elem.val(), status]);
|
admin/includes/fonts_face.php
CHANGED
@@ -357,6 +357,11 @@ class A3_Lazy_Load_Fonts_Face extends A3_Lazy_Load_Admin_UI
|
|
357 |
public function __construct() {
|
358 |
parent::__construct();
|
359 |
|
|
|
|
|
|
|
|
|
|
|
360 |
// Enable Google Font API Key
|
361 |
if ( isset( $_POST[ $this->google_api_key_option . '_enable' ] ) ) {
|
362 |
$old_google_api_key_enable = get_option( $this->google_api_key_option . '_enable', 0 );
|
@@ -415,6 +420,10 @@ class A3_Lazy_Load_Fonts_Face extends A3_Lazy_Load_Admin_UI
|
|
415 |
public function is_valid_google_api_key( $cache=true ) {
|
416 |
$is_valid = false;
|
417 |
|
|
|
|
|
|
|
|
|
418 |
$this->google_api_key = get_option( $this->google_api_key_option, '' );
|
419 |
$google_api_key_enable = get_option( $this->google_api_key_option . '_enable', 0 );
|
420 |
|
@@ -456,7 +465,7 @@ class A3_Lazy_Load_Fonts_Face extends A3_Lazy_Load_Admin_UI
|
|
456 |
|
457 |
// Get font list from default webfonts.json file of plugin
|
458 |
if ( 'invalid' == $google_api_key_status && file_exists( $this->admin_plugin_dir() . '/assets/webfonts/webfonts.json' ) ) {
|
459 |
-
$webfonts =
|
460 |
if ( false != $webfonts ) {
|
461 |
$json_string = get_magic_quotes_gpc() ? stripslashes( $webfonts ) : $webfonts;
|
462 |
$response_fonts = json_decode( $json_string, true );
|
@@ -509,7 +518,7 @@ class A3_Lazy_Load_Fonts_Face extends A3_Lazy_Load_Admin_UI
|
|
509 |
|
510 |
// Get font list from default webfonts.json file of plugin
|
511 |
if ( file_exists( $this->admin_plugin_dir() . '/assets/webfonts/webfonts.json' ) ) {
|
512 |
-
$webfonts =
|
513 |
if ( false != $webfonts ) {
|
514 |
$json_string = get_magic_quotes_gpc() ? stripslashes( $webfonts ) : $webfonts;
|
515 |
$response_fonts = json_decode( $json_string, true );
|
357 |
public function __construct() {
|
358 |
parent::__construct();
|
359 |
|
360 |
+
if ( ! $this->is_load_google_fonts ) {
|
361 |
+
$this->google_fonts = array();
|
362 |
+
return;
|
363 |
+
}
|
364 |
+
|
365 |
// Enable Google Font API Key
|
366 |
if ( isset( $_POST[ $this->google_api_key_option . '_enable' ] ) ) {
|
367 |
$old_google_api_key_enable = get_option( $this->google_api_key_option . '_enable', 0 );
|
420 |
public function is_valid_google_api_key( $cache=true ) {
|
421 |
$is_valid = false;
|
422 |
|
423 |
+
if ( ! $this->is_load_google_fonts ) {
|
424 |
+
return false;
|
425 |
+
}
|
426 |
+
|
427 |
$this->google_api_key = get_option( $this->google_api_key_option, '' );
|
428 |
$google_api_key_enable = get_option( $this->google_api_key_option . '_enable', 0 );
|
429 |
|
465 |
|
466 |
// Get font list from default webfonts.json file of plugin
|
467 |
if ( 'invalid' == $google_api_key_status && file_exists( $this->admin_plugin_dir() . '/assets/webfonts/webfonts.json' ) ) {
|
468 |
+
$webfonts = file_get_contents( $this->admin_plugin_dir() . '/assets/webfonts/webfonts.json' );
|
469 |
if ( false != $webfonts ) {
|
470 |
$json_string = get_magic_quotes_gpc() ? stripslashes( $webfonts ) : $webfonts;
|
471 |
$response_fonts = json_decode( $json_string, true );
|
518 |
|
519 |
// Get font list from default webfonts.json file of plugin
|
520 |
if ( file_exists( $this->admin_plugin_dir() . '/assets/webfonts/webfonts.json' ) ) {
|
521 |
+
$webfonts = file_get_contents( $this->admin_plugin_dir() . '/assets/webfonts/webfonts.json' );
|
522 |
if ( false != $webfonts ) {
|
523 |
$json_string = get_magic_quotes_gpc() ? stripslashes( $webfonts ) : $webfonts;
|
524 |
$response_fonts = json_decode( $json_string, true );
|
admin/less/sass.php
CHANGED
@@ -19,11 +19,22 @@ class A3_Lazy_Load_Less
|
|
19 |
add_action( 'wp_enqueue_scripts', array ($this, 'apply_style_css_fontend') , 12 );
|
20 |
}
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
public function apply_style_css_fontend()
|
23 |
{
|
24 |
-
|
25 |
-
|
26 |
-
wp_enqueue_style( 'a3' . $this->css_file_name, str_replace( array('http:','https:'), '', $_upload_dir['baseurl'] ) . '/sass/' . $this->css_file_name . '.min.css', array(), $this->get_css_file_version() );
|
27 |
}
|
28 |
}
|
29 |
|
19 |
add_action( 'wp_enqueue_scripts', array ($this, 'apply_style_css_fontend') , 12 );
|
20 |
}
|
21 |
|
22 |
+
public function register_dynamic_style_file()
|
23 |
+
{
|
24 |
+
$_upload_dir = wp_upload_dir();
|
25 |
+
if ( file_exists( $_upload_dir['basedir'] . '/sass/' . $this->css_file_name . '.min.css' ) ) {
|
26 |
+
wp_register_style( 'a3' . $this->css_file_name, str_replace( array('http:','https:'), '', $_upload_dir['baseurl'] ) . '/sass/' . $this->css_file_name . '.min.css', array(), $this->get_css_file_version() );
|
27 |
+
|
28 |
+
return true;
|
29 |
+
}
|
30 |
+
|
31 |
+
return false;
|
32 |
+
}
|
33 |
+
|
34 |
public function apply_style_css_fontend()
|
35 |
{
|
36 |
+
if ( $this->register_dynamic_style_file() ) {
|
37 |
+
wp_enqueue_style( 'a3' . $this->css_file_name );
|
|
|
38 |
}
|
39 |
}
|
40 |
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: a3rev, a3rev Software, nguyencongtuan
|
3 |
Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
|
4 |
Requires at least: 4.5
|
5 |
-
Tested up to:
|
6 |
-
Stable tag: 1.9.
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -194,6 +194,18 @@ Filter tags to add to class name of theme to exclude lazy load on images or vide
|
|
194 |
|
195 |
== Changelog ==
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
= 1.9.1 - 2018/08/10 =
|
198 |
* This maintenance update resolves 2 issues from the v 1.9.0 upgrade
|
199 |
* Fix - Set min-width of placeholder to resolve any image tag that does not have width or height not showing the spinner effect. Example Gutenberg image block.
|
@@ -406,6 +418,9 @@ Filter tags to add to class name of theme to exclude lazy load on images or vide
|
|
406 |
|
407 |
== Upgrade Notice ==
|
408 |
|
|
|
|
|
|
|
409 |
= 1.9.1 =
|
410 |
This maintenance update resolves 2 issues from the v 1.9.0 upgrade
|
411 |
|
2 |
Contributors: a3rev, a3rev Software, nguyencongtuan
|
3 |
Tags: a3 lazy load, Lazy Loading , image lazy load, lazyload
|
4 |
Requires at least: 4.5
|
5 |
+
Tested up to: 5.0.2
|
6 |
+
Stable tag: 1.9.2
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
194 |
|
195 |
== Changelog ==
|
196 |
|
197 |
+
= 1.9.2 - 2019/01/02 =
|
198 |
+
* This maintenance update is for compatibility with WordPress 5.0.2 and PHP 7.3. It also includes performance updates to the plugin framework.
|
199 |
+
* Tweak - Test for compatibility with WordPress 5.0.2 and WordPress 4.9.9
|
200 |
+
* Tweak - Create new structure for future development of Gutenberg Blocks
|
201 |
+
* Framework - Performance improvement. Replace wp_remote_fopen with file_get_contents for get web fonts
|
202 |
+
* Framework - Performance improvement. Define new variable `is_load_google_fonts` if admin does not require to load google fonts
|
203 |
+
* Credit - Props to Derek for alerting us to the framework google fonts performance issue
|
204 |
+
* Framework - Register style name for dynamic style of plugin for use with Gutenberg block
|
205 |
+
* Framework - Update Modal script and style to version 4.1.1
|
206 |
+
* Framework - Update a3rev Plugin Framework to version 2.1.0
|
207 |
+
* Framework - Test and update for compatibility with PHP 7.3
|
208 |
+
|
209 |
= 1.9.1 - 2018/08/10 =
|
210 |
* This maintenance update resolves 2 issues from the v 1.9.0 upgrade
|
211 |
* Fix - Set min-width of placeholder to resolve any image tag that does not have width or height not showing the spinner effect. Example Gutenberg image block.
|
418 |
|
419 |
== Upgrade Notice ==
|
420 |
|
421 |
+
= 1.9.2 =
|
422 |
+
This maintenance update is for compatibility with WordPress 5.0.2 and PHP 7.3. It also includes performance updates to the plugin framework.
|
423 |
+
|
424 |
= 1.9.1 =
|
425 |
This maintenance update resolves 2 issues from the v 1.9.0 upgrade
|
426 |
|