Use Any Font - Version 6.0.4

Version Description

  • Fix count warning issue.
Download this release

Release Info

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

Code changes from version 6.0.3 to 6.0.4

includes/functions/uaf_admin_functions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  function uaf_create_menu() {
3
  add_menu_page( 'Use Any Font', 'Use Any Font', 'manage_options', 'use-any-font', 'uaf_interface', 'dashicons-editor-textcolor');
4
  }
@@ -149,16 +150,28 @@ function uaf_check_site_url(){
149
  }
150
 
151
  function uaf_save_options(){
152
- $all_fields = $_POST;
153
- unset($all_fields['save-uaf-options']); // REMOVE submit field
154
- foreach ($all_fields as $fieldname => $fieldvalue) {
155
- update_option($fieldname,stripslashes($fieldvalue));
156
- }
 
 
 
 
 
 
 
 
157
 
158
- uaf_get_options();
159
- uaf_write_css();
160
- $return['status'] = 'ok';
161
- $return['body'] = 'Settings Saved';
 
 
 
 
162
  return $return;
163
  }
164
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  function uaf_create_menu() {
4
  add_menu_page( 'Use Any Font', 'Use Any Font', 'manage_options', 'use-any-font', 'uaf_interface', 'dashicons-editor-textcolor');
5
  }
150
  }
151
 
152
  function uaf_save_options(){
153
+ if ( isset($_POST['uaf_nonce']) && wp_verify_nonce($_POST['uaf_nonce'], 'uaf_save_settings')) {
154
+ $all_fields_name = array(
155
+ 'uaf_server_url_type',
156
+ 'uaf_uploader_type',
157
+ 'uaf_use_absolute_font_path',
158
+ 'uaf_disbale_editor_font_list',
159
+ 'uaf_enable_multi_lang_support',
160
+ 'uaf_font_display_property'
161
+ );
162
+
163
+ foreach ($all_fields_name as $fieldname) {
164
+ update_option($fieldname,sanitize_text_field($_POST[$fieldname]));
165
+ }
166
 
167
+ uaf_get_options();
168
+ uaf_write_css();
169
+ $return['status'] = 'ok';
170
+ $return['body'] = 'Settings Saved';
171
+ } else {
172
+ $return['status'] = 'error';
173
+ $return['body'] = 'Sorry, your nonce did not verify. Please try again.';
174
+ }
175
  return $return;
176
  }
177
 
includes/functions/uaf_client_functions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  function uaf_client_assets() {
3
  $uaf_upload = wp_upload_dir();
4
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  function uaf_client_assets() {
4
  $uaf_upload = wp_upload_dir();
5
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
includes/functions/uaf_editor_functions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  // DEFAULT WORDPRESS EDITOR
3
  $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
4
  if ($uaf_disbale_editor_font_list_value != 1):
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  // DEFAULT WORDPRESS EDITOR
4
  $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
5
  if ($uaf_disbale_editor_font_list_value != 1):
includes/functions/uaf_font_functions.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
 
2
  function uaf_count_uploaded_fonts(){
3
  $count = 0;
4
  $fontsRawData = get_option('uaf_font_data');
5
- if (!empty($fontsRawData)){
6
  $fontsData = json_decode($fontsRawData, true);
7
  $count = count($fontsData);
8
  }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  function uaf_count_uploaded_fonts(){
4
  $count = 0;
5
  $fontsRawData = get_option('uaf_font_data');
6
+ if ((!empty($fontsRawData)) && ($fontsRawData != 'null')){
7
  $fontsData = json_decode($fontsRawData, true);
8
  $count = count($fontsData);
9
  }
includes/uaf_config.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
 
3
- $GLOBALS['uaf_current_version'] = '6.0.3';
4
 
5
 
6
  $GLOBALS['uaf_fix_settings'] = array(
@@ -28,6 +29,6 @@ $GLOBALS['uaf_user_settings'] = array(
28
  'uaf_font_display_property' => 'auto',
29
  'uaf_enable_multi_lang_support' => '0',
30
  'uaf_disbale_editor_font_list' => '0',
31
- 'uaf_use_absolute_font_path' => '1'
32
  );
33
  ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
+ $GLOBALS['uaf_current_version'] = '6.0.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
  );
34
  ?>
includes/views/uaf_api_interface.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="dcform">
2
  <form action="admin.php?page=use-any-font&tab=api" method="post" id="uaf_api_key_form" >
3
  <p>
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <div class="dcform">
3
  <form action="admin.php?page=use-any-font&tab=api" method="post" id="uaf_api_key_form" >
4
  <p>
includes/views/uaf_font_assign.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php $fontsData = uaf_get_uploaded_font_data(); ?>
 
 
2
 
3
  <p align="right"><input type="button" name="open_assign_font" onClick="open_assign_font();" class="button-primary" id="open_assign_font_button" value="Assign Font" /><br/></p>
4
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ $fontsData = uaf_get_uploaded_font_data(); ?>
4
 
5
  <p align="right"><input type="button" name="open_assign_font" onClick="open_assign_font();" class="button-primary" id="open_assign_font_button" value="Assign Font" /><br/></p>
6
 
includes/views/uaf_font_upload_js.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
2
 
3
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
3
 
4
 
includes/views/uaf_font_upload_php.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
2
 
3
  <div id="font-upload" style="display:none;">
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
3
 
4
  <div id="font-upload" style="display:none;">
includes/views/uaf_instructions.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="dcinstructions">
2
  <div class="instruct-head">
3
  Step 1 : Verify API Key
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <div class="dcinstructions">
3
  <div class="instruct-head">
4
  Step 1 : Verify API Key
includes/views/uaf_main.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  if (isset($_GET['tab'])){
3
  $currentTab = $_GET['tab'];
4
  } else {
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  if (isset($_GET['tab'])){
4
  $currentTab = $_GET['tab'];
5
  } else {
includes/views/uaf_settings.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="dcform">
2
  <form method="post" action="">
3
  <p>
@@ -69,6 +70,7 @@
69
  <p>
70
  <label>&nbsp;</label>
71
  <span class="field">
 
72
  <input type="submit" name="save-uaf-options" class="button-primary" value="Save Settings" />
73
  </span>
74
  </p>
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <div class="dcform">
3
  <form method="post" action="">
4
  <p>
70
  <p>
71
  <label>&nbsp;</label>
72
  <span class="field">
73
+ <?php wp_nonce_field( 'uaf_save_settings', 'uaf_nonce' ); ?>
74
  <input type="submit" name="save-uaf-options" class="button-primary" value="Save Settings" />
75
  </span>
76
  </p>
includes/views/uaf_sidebar.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php if(is_plugin_active( 'gravityforms/gravityforms.php' ) && !is_plugin_active( 'jquery-validation-for-gravity-form/jquery-validation-for-gravity-form.php' ) ) { ?>
 
 
2
  <div class="dcwidget">
3
  <div class="dcwidgetheader">
4
  jQuery Validation For Gravity Forms
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ if(is_plugin_active( 'gravityforms/gravityforms.php' ) && !is_plugin_active( 'jquery-validation-for-gravity-form/jquery-validation-for-gravity-form.php' ) ) { ?>
4
  <div class="dcwidget">
5
  <div class="dcwidgetheader">
6
  jQuery Validation For Gravity Forms
includes/views/uaf_uploaded_font_list.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php $fontsData = uaf_get_uploaded_font_data(); ?>
 
 
2
 
3
  <?php
4
  if (!empty($fontsData)):
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ $fontsData = uaf_get_uploaded_font_data(); ?>
4
 
5
  <?php
6
  if (!empty($fontsData)):
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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
6
- Stable tag: 6.0.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
 
@@ -143,7 +143,10 @@ Please do write us after integration and we will add it in our supported list.
143
 
144
  == Changelog ==
145
 
146
- = 6.0.3 =
 
 
 
147
  * Fix font not listing in page builders and themes typography.
148
 
149
  = 6.0.2 =
3
  Tags: custom fonts, font embed, font uploader, typography, install font
4
  Requires at least: 3.0
5
  Tested up to: 5.6
6
+ Stable tag: 6.0.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
 
143
 
144
  == Changelog ==
145
 
146
+ = 6.0.4 =
147
+ * Fix count warning issue.
148
+
149
+ = 6.0.4 =
150
  * Fix font not listing in page builders and themes typography.
151
 
152
  = 6.0.2 =
use-any-font.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
 
2
  /*
3
  Plugin Name: Use Any Font
4
  Plugin URI: https://dineshkarki.com.np/use-any-font
5
  Description: Embed any font in your website
6
  Author: Dnesscarkey
7
- Version: 6.0.3
8
  Author URI: https://dineshkarki.com.np/use-any-font
9
  */
10
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  /*
4
  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.0.4
9
  Author URI: https://dineshkarki.com.np/use-any-font
10
  */
11