Version Description
- Added hide key button.
- Fixed cache being cleared for multi language sites when language was changed.
Download this release
Release Info
Developer | dnesscarkey |
Plugin | Use Any Font |
Version | 6.1.4 |
Comparing to | |
See all releases |
Code changes from version 6.1.3 to 6.1.4
- includes/functions/uaf_admin_functions.php +22 -9
- includes/functions/uaf_font_functions.php +2 -2
- includes/uaf_config.php +3 -2
- includes/views/uaf_api_interface.php +19 -4
- readme.txt +7 -2
- use-any-font.php +1 -1
includes/functions/uaf_admin_functions.php
CHANGED
@@ -48,9 +48,9 @@ function uaf_get_options(){
|
|
48 |
$GLOBALS['uaf_user_settings']['uaf_server_url'] = $GLOBALS['uaf_fix_settings']['serverUrl'][$GLOBALS['uaf_user_settings']['uaf_server_url_type']];
|
49 |
}
|
50 |
|
51 |
-
function
|
52 |
$uaf_api_key = trim($_POST['uaf_api_key']);
|
53 |
-
$uaf_site_url =
|
54 |
if (!empty($uaf_api_key)){
|
55 |
$api_key_return = wp_remote_get($GLOBALS['uaf_user_settings']['uaf_server_url'].'/uaf_convertor/validate_key.php?license_key='.$uaf_api_key.'&url='.$uaf_site_url, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
|
56 |
if ( is_wp_error( $api_key_return ) ) {
|
@@ -62,6 +62,7 @@ function ucf_api_key_activate(){
|
|
62 |
if ($api_key_return->status == 'success'){
|
63 |
update_option('uaf_api_key', $uaf_api_key);
|
64 |
update_option('uaf_activated_url', base64_encode($uaf_site_url));
|
|
|
65 |
uaf_get_options();
|
66 |
uaf_write_css();
|
67 |
}
|
@@ -76,7 +77,7 @@ function ucf_api_key_activate(){
|
|
76 |
}
|
77 |
|
78 |
|
79 |
-
function
|
80 |
$uaf_api_key = $GLOBALS['uaf_user_settings']['uaf_api_key'];
|
81 |
$uaf_activated_url = base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']);
|
82 |
|
@@ -99,12 +100,20 @@ function ucf_api_key_deactivate(){
|
|
99 |
return $return;
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
function uaf_plugin_initialize(){
|
103 |
if (get_option('uaf_current_version') != $GLOBALS['uaf_current_version']){
|
104 |
add_option('uaf_install_date', date('Y-m-d'));
|
105 |
|
106 |
if (!empty(trim(get_option('uaf_api_key')))){
|
107 |
-
update_option('uaf_activated_url',base64_encode(
|
108 |
}
|
109 |
|
110 |
uaf_create_folder();
|
@@ -147,7 +156,7 @@ function uaf_max_upload_size_for_php($sendinbytes = false){
|
|
147 |
function uaf_check_site_url(){
|
148 |
$uaf_api_key = $GLOBALS['uaf_user_settings']['uaf_api_key'];
|
149 |
$uaf_site_url = $GLOBALS['uaf_user_settings']['uaf_site_url'];
|
150 |
-
$uaf_current_url = base64_encode(
|
151 |
|
152 |
if (!empty($uaf_api_key) && ($uaf_site_url != $uaf_current_url)){
|
153 |
uaf_write_css();
|
@@ -214,12 +223,16 @@ function uaf_admin_notices(){
|
|
214 |
function uaf_trigger_actions(){
|
215 |
$actionReturn = array();
|
216 |
|
217 |
-
if (isset($_POST['
|
218 |
-
$actionReturn =
|
|
|
|
|
|
|
|
|
219 |
}
|
220 |
|
221 |
-
if (isset($_POST['
|
222 |
-
$actionReturn =
|
223 |
}
|
224 |
|
225 |
if (isset($_POST['submit-uaf-font-js'])){
|
48 |
$GLOBALS['uaf_user_settings']['uaf_server_url'] = $GLOBALS['uaf_fix_settings']['serverUrl'][$GLOBALS['uaf_user_settings']['uaf_server_url_type']];
|
49 |
}
|
50 |
|
51 |
+
function uaf_api_key_activate(){
|
52 |
$uaf_api_key = trim($_POST['uaf_api_key']);
|
53 |
+
$uaf_site_url = site_url();
|
54 |
if (!empty($uaf_api_key)){
|
55 |
$api_key_return = wp_remote_get($GLOBALS['uaf_user_settings']['uaf_server_url'].'/uaf_convertor/validate_key.php?license_key='.$uaf_api_key.'&url='.$uaf_site_url, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
|
56 |
if ( is_wp_error( $api_key_return ) ) {
|
62 |
if ($api_key_return->status == 'success'){
|
63 |
update_option('uaf_api_key', $uaf_api_key);
|
64 |
update_option('uaf_activated_url', base64_encode($uaf_site_url));
|
65 |
+
update_option('uaf_hide_key', 'no');
|
66 |
uaf_get_options();
|
67 |
uaf_write_css();
|
68 |
}
|
77 |
}
|
78 |
|
79 |
|
80 |
+
function uaf_api_key_deactivate(){
|
81 |
$uaf_api_key = $GLOBALS['uaf_user_settings']['uaf_api_key'];
|
82 |
$uaf_activated_url = base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']);
|
83 |
|
100 |
return $return;
|
101 |
}
|
102 |
|
103 |
+
function uaf_api_key_hide(){
|
104 |
+
update_option('uaf_hide_key','yes');
|
105 |
+
$return['status'] = 'success';
|
106 |
+
$return['body'] = 'Key hidden. You must remove the key and add again to see it back.';
|
107 |
+
uaf_get_options();
|
108 |
+
return $return;
|
109 |
+
}
|
110 |
+
|
111 |
function uaf_plugin_initialize(){
|
112 |
if (get_option('uaf_current_version') != $GLOBALS['uaf_current_version']){
|
113 |
add_option('uaf_install_date', date('Y-m-d'));
|
114 |
|
115 |
if (!empty(trim(get_option('uaf_api_key')))){
|
116 |
+
update_option('uaf_activated_url',base64_encode(site_url()));
|
117 |
}
|
118 |
|
119 |
uaf_create_folder();
|
156 |
function uaf_check_site_url(){
|
157 |
$uaf_api_key = $GLOBALS['uaf_user_settings']['uaf_api_key'];
|
158 |
$uaf_site_url = $GLOBALS['uaf_user_settings']['uaf_site_url'];
|
159 |
+
$uaf_current_url = base64_encode(site_url());
|
160 |
|
161 |
if (!empty($uaf_api_key) && ($uaf_site_url != $uaf_current_url)){
|
162 |
uaf_write_css();
|
223 |
function uaf_trigger_actions(){
|
224 |
$actionReturn = array();
|
225 |
|
226 |
+
if (isset($_POST['uaf_api_key_activate'])){
|
227 |
+
$actionReturn = uaf_api_key_activate();
|
228 |
+
}
|
229 |
+
|
230 |
+
if (isset($_POST['uaf_api_key_deactivate'])){
|
231 |
+
$actionReturn = uaf_api_key_deactivate();
|
232 |
}
|
233 |
|
234 |
+
if (isset($_POST['uaf_api_key_hide'])){
|
235 |
+
$actionReturn = uaf_api_key_hide();
|
236 |
}
|
237 |
|
238 |
if (isset($_POST['submit-uaf-font-js'])){
|
includes/functions/uaf_font_functions.php
CHANGED
@@ -249,8 +249,8 @@ function uaf_write_css(){
|
|
249 |
fclose($fh);
|
250 |
ob_end_clean();
|
251 |
update_option('uaf_css_updated_timestamp', time()); // Time entry for stylesheet version
|
252 |
-
update_option('uaf_site_url', base64_encode(
|
253 |
-
uaf_clear_plugins_cache(); // CLEAN plugin's cache.
|
254 |
}
|
255 |
|
256 |
|
249 |
fclose($fh);
|
250 |
ob_end_clean();
|
251 |
update_option('uaf_css_updated_timestamp', time()); // Time entry for stylesheet version
|
252 |
+
update_option('uaf_site_url', base64_encode(site_url()));
|
253 |
+
uaf_clear_plugins_cache(); // CLEAN plugin's cache.
|
254 |
}
|
255 |
|
256 |
|
includes/uaf_config.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
|
4 |
-
$GLOBALS['uaf_current_version'] = '6.1.
|
5 |
|
6 |
|
7 |
$GLOBALS['uaf_fix_settings'] = array(
|
@@ -29,6 +29,7 @@ $GLOBALS['uaf_user_settings'] = array(
|
|
29 |
'uaf_font_display_property' => 'auto',
|
30 |
'uaf_enable_multi_lang_support' => '0',
|
31 |
'uaf_disbale_editor_font_list' => '0',
|
32 |
-
'uaf_use_absolute_font_path' => '0'
|
|
|
33 |
);
|
34 |
?>
|
1 |
<?php
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
|
4 |
+
$GLOBALS['uaf_current_version'] = '6.1.4';
|
5 |
|
6 |
|
7 |
$GLOBALS['uaf_fix_settings'] = array(
|
29 |
'uaf_font_display_property' => 'auto',
|
30 |
'uaf_enable_multi_lang_support' => '0',
|
31 |
'uaf_disbale_editor_font_list' => '0',
|
32 |
+
'uaf_use_absolute_font_path' => '0',
|
33 |
+
'uaf_hide_key' => 'no'
|
34 |
);
|
35 |
?>
|
includes/views/uaf_api_interface.php
CHANGED
@@ -8,15 +8,30 @@
|
|
8 |
<?php if (empty($GLOBALS['uaf_user_settings']['uaf_api_key'])): ?>
|
9 |
<input name="uaf_api_key" id="uaf_api_key" type="text" class="large" style="max-width: 400px; width: 100%;" />
|
10 |
<br/><br/>
|
11 |
-
<input type="submit" name="
|
12 |
<input type="button" name="uaf_api_key_generate" id="uaf_api_key_generate" class="button-primary" value="Generate Free Lite / Test API Key" onclick="uaf_lite_api_key_generate();" />
|
13 |
<a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank" class="button-primary">Get Premium Key</a>
|
14 |
<?php else: ?>
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
<?php endif;?>
|
17 |
</span>
|
18 |
-
</p>
|
19 |
-
|
20 |
|
21 |
<p>
|
22 |
<br/><br/>
|
8 |
<?php if (empty($GLOBALS['uaf_user_settings']['uaf_api_key'])): ?>
|
9 |
<input name="uaf_api_key" id="uaf_api_key" type="text" class="large" style="max-width: 400px; width: 100%;" />
|
10 |
<br/><br/>
|
11 |
+
<input type="submit" name="uaf_api_key_activate" class="button-primary" value="Verify" />
|
12 |
<input type="button" name="uaf_api_key_generate" id="uaf_api_key_generate" class="button-primary" value="Generate Free Lite / Test API Key" onclick="uaf_lite_api_key_generate();" />
|
13 |
<a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank" class="button-primary">Get Premium Key</a>
|
14 |
<?php else: ?>
|
15 |
+
|
16 |
+
<span class="active_key">
|
17 |
+
|
18 |
+
<?php
|
19 |
+
if ($GLOBALS['uaf_user_settings']['uaf_hide_key'] == 'yes'){
|
20 |
+
echo '##############################';
|
21 |
+
} else {
|
22 |
+
echo $GLOBALS['uaf_user_settings']['uaf_api_key'];
|
23 |
+
} ?>
|
24 |
+
|
25 |
+
- Active</span>
|
26 |
+
|
27 |
+
<input type="submit" name="uaf_api_key_deactivate" class="button-primary" value="Remove Key" onclick="if(!confirm('Are you sure ?')){return false;}" />
|
28 |
+
|
29 |
+
<?php if ($GLOBALS['uaf_user_settings']['uaf_hide_key'] != 'yes'){ ?>
|
30 |
+
<input type="submit" name="uaf_api_key_hide" class="button-primary" value="Hide Key" onclick="if(!confirm('Are you sure ? You can only see the key, when you remove the key and add it again.')){return false;}" />
|
31 |
+
<?php }?>
|
32 |
<?php endif;?>
|
33 |
</span>
|
34 |
+
</p>
|
|
|
35 |
|
36 |
<p>
|
37 |
<br/><br/>
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: dnesscarkey
|
3 |
Tags: custom fonts, font embed, font uploader, typography, install font
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 6.1.
|
7 |
|
8 |
Embed any custom font using font uploader and assign to elements. Upload font in 1 format and other needed formats are auto converted even woff2.
|
9 |
|
@@ -142,6 +142,11 @@ Please do write us after integration and we will add it in our supported list.
|
|
142 |
1. Screenshot #6. Assign fonts to custom elements.
|
143 |
|
144 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
145 |
= 6.1.3 =
|
146 |
* Add is_ssl check for Aboslute Font path.
|
147 |
|
2 |
Contributors: dnesscarkey
|
3 |
Tags: custom fonts, font embed, font uploader, typography, install font
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 5.8
|
6 |
+
Stable tag: 6.1.4
|
7 |
|
8 |
Embed any custom font using font uploader and assign to elements. Upload font in 1 format and other needed formats are auto converted even woff2.
|
9 |
|
142 |
1. Screenshot #6. Assign fonts to custom elements.
|
143 |
|
144 |
== Changelog ==
|
145 |
+
|
146 |
+
= 6.1.4 =
|
147 |
+
* Added hide key button.
|
148 |
+
* Fixed cache being cleared for multi language sites when language was changed.
|
149 |
+
|
150 |
= 6.1.3 =
|
151 |
* Add is_ssl check for Aboslute Font path.
|
152 |
|
use-any-font.php
CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Use Any Font
|
|
5 |
Plugin URI: https://dineshkarki.com.np/use-any-font
|
6 |
Description: Embed any font in your website
|
7 |
Author: Dnesscarkey
|
8 |
-
Version: 6.1.
|
9 |
Author URI: https://dineshkarki.com.np/use-any-font
|
10 |
*/
|
11 |
|
5 |
Plugin URI: https://dineshkarki.com.np/use-any-font
|
6 |
Description: Embed any font in your website
|
7 |
Author: Dnesscarkey
|
8 |
+
Version: 6.1.4
|
9 |
Author URI: https://dineshkarki.com.np/use-any-font
|
10 |
*/
|
11 |
|