Use Any Font - Version 6.1.4

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 Icon 128x128 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 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 ucf_api_key_activate(){
52
  $uaf_api_key = trim($_POST['uaf_api_key']);
53
- $uaf_site_url = home_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 ucf_api_key_deactivate(){
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(home_url()));
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(home_url());
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['ucf_api_key_activate'])){
218
- $actionReturn = ucf_api_key_activate();
 
 
 
 
219
  }
220
 
221
- if (isset($_POST['ucf_api_key_deactivate'])){
222
- $actionReturn = ucf_api_key_deactivate();
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(home_url()));
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.3';
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="ucf_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
- <span class="active_key"><?php echo $GLOBALS['uaf_user_settings']['uaf_api_key']; ?> - Active</span> <input type="submit" name="ucf_api_key_deactivate" class="button-primary" value="Remove Key" onclick="if(!confirm('Are you sure ?')){return false;}" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.7.1
6
- Stable tag: 6.1.3
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.3
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