Use Any Font - Version 6.2.1

Version Description

  • Fixed warning notice.
  • Fixed only 1 font showing in font list
  • Security Fixes.
Download this release

Release Info

Developer dnesscarkey
Plugin Icon 128x128 Use Any Font
Version 6.2.1
Comparing to
See all releases

Code changes from version 6.2 to 6.2.1

includes/functions/uaf_admin_functions.php CHANGED
@@ -216,94 +216,103 @@ function uaf_admin_notices(){
216
 
217
  function uaf_trigger_actions(){
218
  $actionReturn = array();
219
- $actionReturnNonceError = array(
220
- 'status' => 'error',
221
- 'body' => 'Sorry, your nonce did not verify. Please try again.'
222
- );
223
-
224
- if (isset($_POST['uaf_api_key_activate'])){
225
- if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_api_key_actions')) {
226
- $actionReturn = uaf_api_key_activate();
227
- } else {
228
- $actionReturn = $actionReturnNonceError;
229
- }
230
- }
 
 
231
 
232
- if (isset($_POST['uaf_api_key_deactivate'])){
233
- if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_api_key_actions')) {
234
- $actionReturn = uaf_api_key_deactivate();
235
- } else {
236
- $actionReturn = $actionReturnNonceError;
237
- }
238
- }
239
 
240
- if (isset($_POST['uaf_api_key_hide'])){
241
- if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_api_key_actions')) {
242
- $actionReturn = uaf_api_key_hide();
243
- } else {
244
- $actionReturn = $actionReturnNonceError;
245
- }
246
- }
247
 
248
- if (isset($_POST['submit-uaf-font-js'])){
249
- $font_weight = $font_style = '';
250
- if (isset($_POST['enable_font_variation'])){
251
- $font_weight = $_POST['font_weight'];
252
- $font_style = $_POST['font_style'];
253
- }
254
- $actionReturn = uaf_save_font_files($_POST['font_name'], $font_weight, $font_style, $_POST['convert_response']);
255
- }
256
 
257
- if (isset($_POST['submit-uaf-font-php'])){
258
- if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_font_upload_php')) {
259
- $actionReturn = uaf_upload_font_to_server();
260
- if ($actionReturn['status'] == 'success'){
261
- $font_weight = $font_style = '';
262
- if (isset($_POST['enable_font_variation'])){
263
- $font_weight = $_POST['font_weight'];
264
- $font_style = $_POST['font_style'];
 
 
265
  }
266
- $actionReturn = uaf_save_font_files($_POST['font_name'], $font_weight, $font_style, $actionReturn['body']);
267
- }
268
- } else {
269
- $actionReturn = $actionReturnNonceError;
270
  }
271
- }
272
 
273
- if (isset($_POST['submit-uaf-font-assign'])){
274
- if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_font_assign')) {
275
- $actionReturn = uaf_save_font_assign();
276
- } else {
277
- $actionReturn = $actionReturnNonceError;
 
278
  }
279
- }
280
 
281
- if (isset($_GET['delete_font_assign_key'])){
282
- if ( isset($_GET['uaf_nonce']) && wp_verify_nonce($_GET['uaf_nonce'], 'uaf_delete_font_assign')) {
283
- $actionReturn = uaf_delete_font_assign();
284
- } else {
285
- $actionReturn = $actionReturnNonceError;
286
- }
287
- }
288
 
289
- if (isset($_GET['delete_font_key'])){
290
- if ( isset($_GET['uaf_nonce']) && wp_verify_nonce($_GET['uaf_nonce'], 'uaf_delete_font')) {
291
- $actionReturn = uaf_delete_font();
292
- } else {
293
- $actionReturn = $actionReturnNonceError;
294
- }
295
- }
296
 
297
- if (isset($_POST['save-uaf-options'])){
298
- if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_save_settings')) {
299
- $actionReturn = uaf_save_options();
300
- } else {
301
- $actionReturn = $actionReturnNonceError;
302
- }
303
- }
304
 
305
- if (isset($_GET['predefinedfontid'])){
306
- $actionReturn = uaf_add_pre_defined_font($_GET['predefinedfontid']);
 
 
 
 
 
 
 
307
  }
308
 
309
  $GLOBALS['uaf_action_return'] = $actionReturn;
216
 
217
  function uaf_trigger_actions(){
218
  $actionReturn = array();
219
+ if (current_user_can('manage_options')){
220
+
221
+ $actionReturnNonceError = array(
222
+ 'status' => 'error',
223
+ 'body' => 'Sorry, your nonce did not verify. Please try again.'
224
+ );
225
+
226
+ if (isset($_POST['uaf_api_key_activate'])){
227
+ if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_api_key_actions')) {
228
+ $actionReturn = uaf_api_key_activate();
229
+ } else {
230
+ $actionReturn = $actionReturnNonceError;
231
+ }
232
+ }
233
 
234
+ if (isset($_POST['uaf_api_key_deactivate'])){
235
+ if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_api_key_actions')) {
236
+ $actionReturn = uaf_api_key_deactivate();
237
+ } else {
238
+ $actionReturn = $actionReturnNonceError;
239
+ }
240
+ }
241
 
242
+ if (isset($_POST['uaf_api_key_hide'])){
243
+ if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_api_key_actions')) {
244
+ $actionReturn = uaf_api_key_hide();
245
+ } else {
246
+ $actionReturn = $actionReturnNonceError;
247
+ }
248
+ }
249
 
250
+ if (isset($_POST['submit-uaf-font-js'])){
251
+ $font_weight = $font_style = '';
252
+ if (isset($_POST['enable_font_variation'])){
253
+ $font_weight = $_POST['font_weight'];
254
+ $font_style = $_POST['font_style'];
255
+ }
256
+ $actionReturn = uaf_save_font_files($_POST['font_name'], $font_weight, $font_style, $_POST['convert_response']);
257
+ }
258
 
259
+ if (isset($_POST['submit-uaf-font-php'])){
260
+ if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_font_upload_php')) {
261
+ $actionReturn = uaf_upload_font_to_server();
262
+ if ($actionReturn['status'] == 'success'){
263
+ $font_weight = $font_style = '';
264
+ if (isset($_POST['enable_font_variation'])){
265
+ $font_weight = $_POST['font_weight'];
266
+ $font_style = $_POST['font_style'];
267
+ }
268
+ $actionReturn = uaf_save_font_files($_POST['font_name'], $font_weight, $font_style, $actionReturn['body']);
269
  }
270
+ } else {
271
+ $actionReturn = $actionReturnNonceError;
272
+ }
 
273
  }
 
274
 
275
+ if (isset($_POST['submit-uaf-font-assign'])){
276
+ if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_font_assign')) {
277
+ $actionReturn = uaf_save_font_assign();
278
+ } else {
279
+ $actionReturn = $actionReturnNonceError;
280
+ }
281
  }
 
282
 
283
+ if (isset($_GET['delete_font_assign_key'])){
284
+ if ( isset($_GET['uaf_nonce']) && wp_verify_nonce($_GET['uaf_nonce'], 'uaf_delete_font_assign')) {
285
+ $actionReturn = uaf_delete_font_assign();
286
+ } else {
287
+ $actionReturn = $actionReturnNonceError;
288
+ }
289
+ }
290
 
291
+ if (isset($_GET['delete_font_key'])){
292
+ if ( isset($_GET['uaf_nonce']) && wp_verify_nonce($_GET['uaf_nonce'], 'uaf_delete_font')) {
293
+ $actionReturn = uaf_delete_font();
294
+ } else {
295
+ $actionReturn = $actionReturnNonceError;
296
+ }
297
+ }
298
 
299
+ if (isset($_POST['save-uaf-options'])){
300
+ if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_save_settings')) {
301
+ $actionReturn = uaf_save_options();
302
+ } else {
303
+ $actionReturn = $actionReturnNonceError;
304
+ }
305
+ }
306
 
307
+ if (isset($_GET['predefinedfontid'])){
308
+ $actionReturn = uaf_add_pre_defined_font($_GET['predefinedfontid']);
309
+ }
310
+
311
+ } else {
312
+ $actionReturn = array(
313
+ 'status' => 'error',
314
+ 'body' => 'Sorry, Something went wrong !'
315
+ );
316
  }
317
 
318
  $GLOBALS['uaf_action_return'] = $actionReturn;
includes/functions/uaf_editor_functions.php CHANGED
@@ -187,7 +187,7 @@ function uaf_kirki_custom_fonts($standard_fonts) {
187
  $fonts_uaf = array();
188
  if (!empty($fontsData)):
189
  foreach ($fontsData as $fontName=>$fontData):
190
- $fonts_uaf[$fontData['font_name']] = array(
191
  'label' => $fontName.' [Use Any Font]',
192
  'variants' => array('regular'),
193
  'stack' => $fontName
187
  $fonts_uaf = array();
188
  if (!empty($fontsData)):
189
  foreach ($fontsData as $fontName=>$fontData):
190
+ $fonts_uaf[$fontName] = array(
191
  'label' => $fontName.' [Use Any Font]',
192
  'variants' => array('regular'),
193
  'stack' => $fontName
includes/functions/uaf_font_functions.php CHANGED
@@ -346,9 +346,9 @@ function uaf_save_font_assign(){
346
 
347
  if (!empty($finalElements) && !empty($_POST['font_key'])){
348
  $fontsImplementData[date('ymdhis')] = array(
349
- 'font_key' => $_POST['font_key'],
350
- 'font_name' => $font_name,
351
- 'font_elements' => $finalElements
352
  );
353
  $updateFontsImplementData = json_encode($fontsImplementData);
354
  update_option('uaf_font_implement',$updateFontsImplementData);
@@ -466,9 +466,11 @@ function uaf_add_pre_defined_font($fontId){
466
 
467
  function uaf_group_fontdata_by_fontname($fontDatas){
468
  $returnArray = array();
469
- foreach($fontDatas as $key => $value){
470
- $returnArray[$value['font_name']][$key] = $value;
471
- }
 
 
472
  return $returnArray;
473
  }
474
 
346
 
347
  if (!empty($finalElements) && !empty($_POST['font_key'])){
348
  $fontsImplementData[date('ymdhis')] = array(
349
+ 'font_key' => sanitize_title($_POST['font_key']),
350
+ 'font_name' => sanitize_title($font_name),
351
+ 'font_elements' => sanitize_text_field($finalElements)
352
  );
353
  $updateFontsImplementData = json_encode($fontsImplementData);
354
  update_option('uaf_font_implement',$updateFontsImplementData);
466
 
467
  function uaf_group_fontdata_by_fontname($fontDatas){
468
  $returnArray = array();
469
+ if (!empty($fontDatas)){
470
+ foreach($fontDatas as $key => $value){
471
+ $returnArray[$value['font_name']][$key] = $value;
472
+ }
473
+ }
474
  return $returnArray;
475
  }
476
 
includes/uaf_config.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
- $GLOBALS['uaf_current_version'] = '6.2';
5
 
6
 
7
  $GLOBALS['uaf_fix_settings'] = array(
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
+ $GLOBALS['uaf_current_version'] = '6.2.1';
5
 
6
 
7
  $GLOBALS['uaf_fix_settings'] = array(
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.8.3
6
- Stable tag: 6.2
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
 
@@ -143,6 +143,11 @@ Please do write us after integration and we will add it in our supported list.
143
 
144
  == Changelog ==
145
 
 
 
 
 
 
146
  = 6.2 =
147
  * Added multi variation font support.
148
 
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.9
6
+ Stable tag: 6.2.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
 
143
 
144
  == Changelog ==
145
 
146
+ = 6.2.1 =
147
+ * Fixed warning notice.
148
+ * Fixed only 1 font showing in font list
149
+ * Security Fixes.
150
+
151
  = 6.2 =
152
  * Added multi variation font support.
153
 
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.2
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.2.1
9
  Author URI: https://dineshkarki.com.np/use-any-font
10
  */
11