Version Description
Download this release
Release Info
Developer | dnesscarkey |
Plugin | Use Any Font |
Version | 6.2.2 |
Comparing to | |
See all releases |
Code changes from version 6.2.1 to 6.2.2
- includes/assets/img/jquery-validation-gravity.gif +0 -0
- includes/functions/uaf_admin_functions.php +7 -7
- includes/functions/uaf_editor_functions.php +3 -3
- includes/functions/uaf_font_functions.php +18 -18
- includes/uaf_config.php +1 -1
- includes/views/uaf_api_interface.php +1 -1
- includes/views/uaf_font_assign.php +7 -7
- includes/views/uaf_font_upload_js.php +3 -3
- includes/views/uaf_font_upload_php.php +3 -3
- includes/views/uaf_main.php +3 -3
- includes/views/uaf_sidebar.php +2 -2
- includes/views/uaf_uploaded_font_list.php +4 -4
- readme.txt +4 -1
- use-any-font.php +1 -1
includes/assets/img/jquery-validation-gravity.gif
ADDED
Binary file
|
includes/functions/uaf_admin_functions.php
CHANGED
@@ -5,7 +5,7 @@ function uaf_create_menu() {
|
|
5 |
}
|
6 |
|
7 |
function uaf_admin_assets(){
|
8 |
-
wp_register_style('uaf_admin_css', plugins_url('
|
9 |
wp_enqueue_style('uaf_admin_css');
|
10 |
|
11 |
$uaf_upload = wp_upload_dir();
|
@@ -15,7 +15,7 @@ function uaf_admin_assets(){
|
|
15 |
wp_enqueue_style('uaf-font-style');
|
16 |
add_editor_style($uaf_upload_url.'admin-uaf.css');
|
17 |
|
18 |
-
wp_register_script('uaf_admin_js', plugins_url('
|
19 |
$uaf_server_url = array($GLOBALS['uaf_user_settings']['uaf_server_url']);
|
20 |
wp_localize_script( 'uaf_admin_js', 'uaf_server_url', $uaf_server_url );
|
21 |
wp_enqueue_script( 'uaf_admin_js' );
|
@@ -49,7 +49,7 @@ function uaf_get_options(){
|
|
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' )));
|
@@ -250,8 +250,8 @@ function uaf_trigger_actions(){
|
|
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 |
}
|
@@ -262,8 +262,8 @@ function uaf_trigger_actions(){
|
|
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 |
}
|
5 |
}
|
6 |
|
7 |
function uaf_admin_assets(){
|
8 |
+
wp_register_style('uaf_admin_css', plugins_url('../assets/css/uaf_admin.css', __FILE__),'', $GLOBALS['uaf_current_version']);
|
9 |
wp_enqueue_style('uaf_admin_css');
|
10 |
|
11 |
$uaf_upload = wp_upload_dir();
|
15 |
wp_enqueue_style('uaf-font-style');
|
16 |
add_editor_style($uaf_upload_url.'admin-uaf.css');
|
17 |
|
18 |
+
wp_register_script('uaf_admin_js', plugins_url('../assets/js/uaf_admin.js', __FILE__), '', $GLOBALS['uaf_current_version'], true);
|
19 |
$uaf_server_url = array($GLOBALS['uaf_user_settings']['uaf_server_url']);
|
20 |
wp_localize_script( 'uaf_admin_js', 'uaf_server_url', $uaf_server_url );
|
21 |
wp_enqueue_script( 'uaf_admin_js' );
|
49 |
}
|
50 |
|
51 |
function uaf_api_key_activate(){
|
52 |
+
$uaf_api_key = trim(sanitize_key($_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' )));
|
250 |
if (isset($_POST['submit-uaf-font-js'])){
|
251 |
$font_weight = $font_style = '';
|
252 |
if (isset($_POST['enable_font_variation'])){
|
253 |
+
$font_weight = sanitize_key($_POST['font_weight']);
|
254 |
+
$font_style = sanitize_key($_POST['font_style']);
|
255 |
}
|
256 |
$actionReturn = uaf_save_font_files($_POST['font_name'], $font_weight, $font_style, $_POST['convert_response']);
|
257 |
}
|
262 |
if ($actionReturn['status'] == 'success'){
|
263 |
$font_weight = $font_style = '';
|
264 |
if (isset($_POST['enable_font_variation'])){
|
265 |
+
$font_weight = sanitize_key($_POST['font_weight']);
|
266 |
+
$font_style = sanitize_key($_POST['font_style']);
|
267 |
}
|
268 |
$actionReturn = uaf_save_font_files($_POST['font_name'], $font_weight, $font_style, $actionReturn['body']);
|
269 |
}
|
includes/functions/uaf_editor_functions.php
CHANGED
@@ -155,9 +155,9 @@ function uaf_astra_customizer_font_list( $value ) {
|
|
155 |
$fontsData = uaf_group_fontdata_by_fontname(uaf_get_uploaded_font_data());
|
156 |
$fonts_uaf = array();
|
157 |
if (!empty($fontsData)):
|
158 |
-
echo '<optgroup label="Use Any Font">';
|
159 |
foreach ($fontsData as $fontName=>$fontData):
|
160 |
-
echo '<option value="' .$fontName. '">' . $fontName. '</option>';
|
161 |
endforeach;
|
162 |
endif;
|
163 |
}
|
@@ -177,7 +177,7 @@ function uaf_oxygen_builder_font_list() {
|
|
177 |
$fonts_uaf = uaf_get_font_families();
|
178 |
$output = json_encode( $fonts_uaf );
|
179 |
$output = htmlspecialchars( $output, ENT_QUOTES );
|
180 |
-
echo "elegantCustomFonts=$output;";
|
181 |
}
|
182 |
|
183 |
// KIRKI CUSTOMIZER FRAMEWORK //Like FLATSOME THEME
|
155 |
$fontsData = uaf_group_fontdata_by_fontname(uaf_get_uploaded_font_data());
|
156 |
$fonts_uaf = array();
|
157 |
if (!empty($fontsData)):
|
158 |
+
echo esc_html('<optgroup label="Use Any Font">');
|
159 |
foreach ($fontsData as $fontName=>$fontData):
|
160 |
+
echo esc_html('<option value="' .$fontName. '">' . $fontName. '</option>');
|
161 |
endforeach;
|
162 |
endif;
|
163 |
}
|
177 |
$fonts_uaf = uaf_get_font_families();
|
178 |
$output = json_encode( $fonts_uaf );
|
179 |
$output = htmlspecialchars( $output, ENT_QUOTES );
|
180 |
+
echo esc_html("elegantCustomFonts=$output;");
|
181 |
}
|
182 |
|
183 |
// KIRKI CUSTOMIZER FRAMEWORK //Like FLATSOME THEME
|
includes/functions/uaf_font_functions.php
CHANGED
@@ -94,7 +94,7 @@ function uaf_upload_font_to_server(){
|
|
94 |
|
95 |
if ((in_array($file_extension, $GLOBALS['uaf_fix_settings']['allowedFontFormats'])) && ($font_size <= uaf_max_upload_size_for_php(true))){
|
96 |
@set_time_limit(0);
|
97 |
-
$ch = curl_init();
|
98 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
99 |
curl_setopt($ch, CURLOPT_URL, $GLOBALS['uaf_user_settings']['uaf_server_url'].'/uaf_convertor/convert.php');
|
100 |
curl_setopt($ch, CURLOPT_POST, true);
|
@@ -103,8 +103,8 @@ function uaf_upload_font_to_server(){
|
|
103 |
'fontfile' => new CURLFile($_FILES['font_file']['tmp_name']),
|
104 |
'fontfileext' => pathinfo($_FILES['font_file']['name'], PATHINFO_EXTENSION),
|
105 |
'api_key' => $GLOBALS['uaf_user_settings']['uaf_api_key'],
|
106 |
-
'url' => $_POST['url'],
|
107 |
-
'font_count' => $_POST['font_count']
|
108 |
);
|
109 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
110 |
$convertResponse = curl_exec($ch);
|
@@ -206,13 +206,13 @@ function uaf_write_css(){
|
|
206 |
if (!empty($fontsData)):
|
207 |
foreach ($fontsData as $key=>$fontData): ?>
|
208 |
@font-face {
|
209 |
-
font-family: '<?php echo $fontData['font_name'] ?>';
|
210 |
-
src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff2') format('woff2'),
|
211 |
-
<?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
|
212 |
-
<?php echo array_key_exists('font_weight',$fontData)?'font-weight: '
|
213 |
}
|
214 |
|
215 |
-
.<?php echo $fontData['font_name'] ?>{font-family: '<?php echo $fontData['font_name'] ?>' !important;}
|
216 |
|
217 |
<?php
|
218 |
endforeach;
|
@@ -227,8 +227,8 @@ function uaf_write_css(){
|
|
227 |
} else {
|
228 |
$font_name = $fontsData[$fontImplementData['font_key']]['font_name'];
|
229 |
}?>
|
230 |
-
<?php echo $fontImplementData['font_elements']; ?>{
|
231 |
-
font-family: '<?php echo $font_name; ?>' !important;
|
232 |
}
|
233 |
<?php
|
234 |
endforeach;
|
@@ -245,15 +245,15 @@ function uaf_write_css(){
|
|
245 |
if (!empty($fontsData)):
|
246 |
foreach ($fontsData as $key=>$fontData): ?>
|
247 |
@font-face {
|
248 |
-
font-family: '<?php echo $fontData['font_name'] ?>';
|
249 |
-
src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff2') format('woff2'),
|
250 |
-
<?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
|
251 |
-
<?php echo array_key_exists('font_weight',$fontData)?'font-weight: '
|
252 |
}
|
253 |
|
254 |
-
.<?php echo $fontData['font_name'] ?>{font-family: '<?php echo $fontData['font_name'] ?>' !important;}
|
255 |
|
256 |
-
.et_gf_<?php echo $fontData['font_name'] ?>{background:none !important;font-family:<?php echo $fontData['font_name'] ?>;text-indent:0 !important;font-size:25px;}
|
257 |
|
258 |
<?php
|
259 |
endforeach;
|
@@ -376,7 +376,7 @@ function uaf_delete_font(){
|
|
376 |
$uaf_paths = uaf_path_details();
|
377 |
|
378 |
$fontsData = uaf_get_uploaded_font_data();
|
379 |
-
$key_to_delete = $_GET['delete_font_key'];
|
380 |
|
381 |
@unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff2'));
|
382 |
@unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff'));
|
@@ -408,7 +408,7 @@ function uaf_delete_font(){
|
|
408 |
function uaf_delete_font_assign(){
|
409 |
$fontsImplementRawData = get_option('uaf_font_implement');
|
410 |
$fontsImplementData = json_decode($fontsImplementRawData, true);
|
411 |
-
$key_to_delete = $_GET['delete_font_assign_key'];
|
412 |
unset($fontsImplementData[$key_to_delete]);
|
413 |
$updateFontsImplementData = json_encode($fontsImplementData);
|
414 |
update_option('uaf_font_implement',$updateFontsImplementData);
|
94 |
|
95 |
if ((in_array($file_extension, $GLOBALS['uaf_fix_settings']['allowedFontFormats'])) && ($font_size <= uaf_max_upload_size_for_php(true))){
|
96 |
@set_time_limit(0);
|
97 |
+
$ch = curl_init(); // Unable to send file to API endpoint in $_FILES using wp_remote_post, so using CURL
|
98 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
99 |
curl_setopt($ch, CURLOPT_URL, $GLOBALS['uaf_user_settings']['uaf_server_url'].'/uaf_convertor/convert.php');
|
100 |
curl_setopt($ch, CURLOPT_POST, true);
|
103 |
'fontfile' => new CURLFile($_FILES['font_file']['tmp_name']),
|
104 |
'fontfileext' => pathinfo($_FILES['font_file']['name'], PATHINFO_EXTENSION),
|
105 |
'api_key' => $GLOBALS['uaf_user_settings']['uaf_api_key'],
|
106 |
+
'url' => sanitize_url($_POST['url']),
|
107 |
+
'font_count' => sanitize_key($_POST['font_count'])
|
108 |
);
|
109 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
110 |
$convertResponse = curl_exec($ch);
|
206 |
if (!empty($fontsData)):
|
207 |
foreach ($fontsData as $key=>$fontData): ?>
|
208 |
@font-face {
|
209 |
+
font-family: '<?php echo esc_html($fontData['font_name']) ?>';
|
210 |
+
src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo esc_url($uaf_upload_url.$fontData['font_path']) ?>.woff2') format('woff2'),
|
211 |
+
<?php } ?>url('<?php echo esc_url($uaf_upload_url.$fontData['font_path']) ?>.woff') format('woff');
|
212 |
+
<?php echo array_key_exists('font_weight',$fontData)?'font-weight: '.esc_html($fontData['font_weight']).';':''; ?> <?php echo array_key_exists('font_style',$fontData)?'font-style: '.esc_html($fontData['font_style']).';':''; ?> font-display: <?php echo esc_html($GLOBALS['uaf_user_settings']['uaf_font_display_property']); ?>;
|
213 |
}
|
214 |
|
215 |
+
.<?php echo esc_html($fontData['font_name']) ?>{font-family: '<?php echo esc_html($fontData['font_name']) ?>' !important;}
|
216 |
|
217 |
<?php
|
218 |
endforeach;
|
227 |
} else {
|
228 |
$font_name = $fontsData[$fontImplementData['font_key']]['font_name'];
|
229 |
}?>
|
230 |
+
<?php echo esc_html($fontImplementData['font_elements']); ?>{
|
231 |
+
font-family: '<?php echo esc_html($font_name); ?>' !important;
|
232 |
}
|
233 |
<?php
|
234 |
endforeach;
|
245 |
if (!empty($fontsData)):
|
246 |
foreach ($fontsData as $key=>$fontData): ?>
|
247 |
@font-face {
|
248 |
+
font-family: '<?php echo esc_html($fontData['font_name']) ?>';
|
249 |
+
src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo esc_url($uaf_upload_url.$fontData['font_path']) ?>.woff2') format('woff2'),
|
250 |
+
<?php } ?>url('<?php echo esc_url($uaf_upload_url.$fontData['font_path']) ?>.woff') format('woff');
|
251 |
+
<?php echo array_key_exists('font_weight',$fontData)?'font-weight: '.esc_html($fontData['font_weight']).';':''; ?> <?php echo array_key_exists('font_style',$fontData)?'font-style: '.esc_html($fontData['font_style']).';':''; ?> font-display: <?php echo esc_html($GLOBALS['uaf_user_settings']['uaf_font_display_property']); ?>;
|
252 |
}
|
253 |
|
254 |
+
.<?php echo esc_html($fontData['font_name']) ?>{font-family: '<?php echo esc_html($fontData['font_name']) ?>' !important;}
|
255 |
|
256 |
+
.et_gf_<?php echo esc_html($fontData['font_name']) ?>{background:none !important;font-family:<?php echo esc_html($fontData['font_name']) ?>;text-indent:0 !important;font-size:25px;}
|
257 |
|
258 |
<?php
|
259 |
endforeach;
|
376 |
$uaf_paths = uaf_path_details();
|
377 |
|
378 |
$fontsData = uaf_get_uploaded_font_data();
|
379 |
+
$key_to_delete = sanitize_key($_GET['delete_font_key']);
|
380 |
|
381 |
@unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff2'));
|
382 |
@unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff'));
|
408 |
function uaf_delete_font_assign(){
|
409 |
$fontsImplementRawData = get_option('uaf_font_implement');
|
410 |
$fontsImplementData = json_decode($fontsImplementRawData, true);
|
411 |
+
$key_to_delete = sanitize_key($_GET['delete_font_assign_key']);
|
412 |
unset($fontsImplementData[$key_to_delete]);
|
413 |
$updateFontsImplementData = json_encode($fontsImplementData);
|
414 |
update_option('uaf_font_implement',$updateFontsImplementData);
|
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.2';
|
5 |
|
6 |
|
7 |
$GLOBALS['uaf_fix_settings'] = array(
|
includes/views/uaf_api_interface.php
CHANGED
@@ -19,7 +19,7 @@
|
|
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>
|
19 |
if ($GLOBALS['uaf_user_settings']['uaf_hide_key'] == 'yes'){
|
20 |
echo '##############################';
|
21 |
} else {
|
22 |
+
echo esc_html($GLOBALS['uaf_user_settings']['uaf_api_key']);
|
23 |
} ?>
|
24 |
|
25 |
- Active</span>
|
includes/views/uaf_font_assign.php
CHANGED
@@ -18,7 +18,7 @@ $fontsDataWithVariations = uaf_group_fontdata_by_fontname($fontsData);
|
|
18 |
<?php
|
19 |
if (!empty($fontsDataWithVariations)):
|
20 |
foreach ($fontsDataWithVariations as $key=>$fontDataVariation) : ?>
|
21 |
-
<option value="<?php echo array_key_first($fontDataVariation); ?>"><?php echo $key ?></option>
|
22 |
<?php endforeach;
|
23 |
endif;
|
24 |
?>
|
@@ -31,7 +31,7 @@ $fontsDataWithVariations = uaf_group_fontdata_by_fontname($fontsData);
|
|
31 |
if ($languageSelector['enableMultiLang'] == TRUE ): ?>
|
32 |
<tr>
|
33 |
<td width="175">Select Language</td>
|
34 |
-
<td><?php echo $languageSelector['selectHTML']; ?></td>
|
35 |
</tr>
|
36 |
<?php endif; ?>
|
37 |
<tr>
|
@@ -75,7 +75,7 @@ $fontsDataWithVariations = uaf_group_fontdata_by_fontname($fontsData);
|
|
75 |
if (!empty($menus)){
|
76 |
foreach($menus as $menu){
|
77 |
?>
|
78 |
-
<input name="elements[]" value=".menu-<?php echo $menu->slug; ?>-container li a, .menu-<?php echo $menu->slug; ?>-container li span, #menu-<?php echo $menu->slug; ?> li a, #menu-<?php echo $menu->slug; ?> li span" type="checkbox" /> <?php echo $menu->name; ?><br/>
|
79 |
<?php
|
80 |
}
|
81 |
} else {
|
@@ -133,17 +133,17 @@ $fontsImplementData = json_decode($fontsImplementRawData, true);
|
|
133 |
$sn++
|
134 |
?>
|
135 |
<tr>
|
136 |
-
<td><?php echo $sn; ?></td>
|
137 |
<td>
|
138 |
<?php
|
139 |
if (isset($fontImplementData['font_name']) && !empty(trim($fontImplementData['font_name']))){
|
140 |
-
echo $fontImplementData['font_name'];
|
141 |
} else {
|
142 |
-
echo
|
143 |
}
|
144 |
?>
|
145 |
</td>
|
146 |
-
<td><?php echo $fontImplementData['font_elements'] ?></td>
|
147 |
<td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="<?php echo wp_nonce_url( 'admin.php?page=use-any-font&tab=font_assign&delete_font_assign_key='.$key, 'uaf_delete_font_assign', 'uaf_nonce' ); ?>">Delete</a></td>
|
148 |
</tr>
|
149 |
<?php endforeach; ?>
|
18 |
<?php
|
19 |
if (!empty($fontsDataWithVariations)):
|
20 |
foreach ($fontsDataWithVariations as $key=>$fontDataVariation) : ?>
|
21 |
+
<option value="<?php echo array_key_first($fontDataVariation); ?>"><?php echo esc_attr($key) ?></option>
|
22 |
<?php endforeach;
|
23 |
endif;
|
24 |
?>
|
31 |
if ($languageSelector['enableMultiLang'] == TRUE ): ?>
|
32 |
<tr>
|
33 |
<td width="175">Select Language</td>
|
34 |
+
<td><?php echo esc_html($languageSelector['selectHTML']); ?></td>
|
35 |
</tr>
|
36 |
<?php endif; ?>
|
37 |
<tr>
|
75 |
if (!empty($menus)){
|
76 |
foreach($menus as $menu){
|
77 |
?>
|
78 |
+
<input name="elements[]" value=".menu-<?php echo esc_attr($menu->slug); ?>-container li a, .menu-<?php echo esc_attr($menu->slug); ?>-container li span, #menu-<?php echo esc_attr($menu->slug); ?> li a, #menu-<?php echo esc_attr($menu->slug); ?> li span" type="checkbox" /> <?php echo esc_html($menu->name); ?><br/>
|
79 |
<?php
|
80 |
}
|
81 |
} else {
|
133 |
$sn++
|
134 |
?>
|
135 |
<tr>
|
136 |
+
<td><?php echo esc_html($sn); ?></td>
|
137 |
<td>
|
138 |
<?php
|
139 |
if (isset($fontImplementData['font_name']) && !empty(trim($fontImplementData['font_name']))){
|
140 |
+
echo esc_html($fontImplementData['font_name']);
|
141 |
} else {
|
142 |
+
echo @esc_html($fontsData[$fontImplementData['font_key']]['font_name']);
|
143 |
}
|
144 |
?>
|
145 |
</td>
|
146 |
+
<td><?php echo esc_html($fontImplementData['font_elements']) ?></td>
|
147 |
<td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="<?php echo wp_nonce_url( 'admin.php?page=use-any-font&tab=font_assign&delete_font_assign_key='.$key, 'uaf_delete_font_assign', 'uaf_nonce' ); ?>">Delete</a></td>
|
148 |
</tr>
|
149 |
<?php endforeach; ?>
|
includes/views/uaf_font_upload_js.php
CHANGED
@@ -32,7 +32,7 @@ add_thickbox();
|
|
32 |
<span class="field">
|
33 |
<select name="font_weight" class="medium">
|
34 |
<?php foreach ($GLOBALS['uaf_fix_settings']['font_weight_variations'] as $variation => $variation_label): ?>
|
35 |
-
<option value="<?php echo $variation ?>"><?php echo $variation_label; ?></option>
|
36 |
<?php endforeach; ?>
|
37 |
</select>
|
38 |
</span>
|
@@ -53,7 +53,7 @@ add_thickbox();
|
|
53 |
<input type="file" id="fontfile" name="fontfile" value="" class="uaf_required" accept=".woff,.ttf,.otf" />
|
54 |
<span class="field_error">Please select font file.</span>
|
55 |
<br/>
|
56 |
-
<em>Accepted Font Format : <?php echo join(", ",$GLOBALS['uaf_fix_settings']['allowedFontFormats']); ?> | Font Size: Upto <?php echo $GLOBALS['uaf_fix_settings']['allowedFontSize'] ?> MB</em><br/>
|
57 |
</span>
|
58 |
</p>
|
59 |
<p>
|
@@ -61,7 +61,7 @@ add_thickbox();
|
|
61 |
<span class="field">
|
62 |
<span id="font_upload_message" class=""></span>
|
63 |
<input type="hidden" name="url" value="<?php echo base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']); ?>" />
|
64 |
-
<input type="hidden" name="api_key" value="<?php echo $GLOBALS['uaf_user_settings']['uaf_api_key']; ?>" />
|
65 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
66 |
<input type="hidden" name="convert_response" id="convert_response" value="" />
|
67 |
<input type="hidden" name="submit-uaf-font-js" id="submit-uaf-font" value="Upload" />
|
32 |
<span class="field">
|
33 |
<select name="font_weight" class="medium">
|
34 |
<?php foreach ($GLOBALS['uaf_fix_settings']['font_weight_variations'] as $variation => $variation_label): ?>
|
35 |
+
<option value="<?php echo esc_attr($variation) ?>"><?php echo esc_html($variation_label); ?></option>
|
36 |
<?php endforeach; ?>
|
37 |
</select>
|
38 |
</span>
|
53 |
<input type="file" id="fontfile" name="fontfile" value="" class="uaf_required" accept=".woff,.ttf,.otf" />
|
54 |
<span class="field_error">Please select font file.</span>
|
55 |
<br/>
|
56 |
+
<em>Accepted Font Format : <?php echo esc_html(join(", ",$GLOBALS['uaf_fix_settings']['allowedFontFormats'])); ?> | Font Size: Upto <?php echo esc_html($GLOBALS['uaf_fix_settings']['allowedFontSize']) ?> MB</em><br/>
|
57 |
</span>
|
58 |
</p>
|
59 |
<p>
|
61 |
<span class="field">
|
62 |
<span id="font_upload_message" class=""></span>
|
63 |
<input type="hidden" name="url" value="<?php echo base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']); ?>" />
|
64 |
+
<input type="hidden" name="api_key" value="<?php echo esc_attr($GLOBALS['uaf_user_settings']['uaf_api_key']); ?>" />
|
65 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
66 |
<input type="hidden" name="convert_response" id="convert_response" value="" />
|
67 |
<input type="hidden" name="submit-uaf-font-js" id="submit-uaf-font" value="Upload" />
|
includes/views/uaf_font_upload_php.php
CHANGED
@@ -32,7 +32,7 @@ add_thickbox();
|
|
32 |
<span class="field">
|
33 |
<select name="font_weight" class="medium">
|
34 |
<?php foreach ($GLOBALS['uaf_fix_settings']['font_weight_variations'] as $variation => $variation_label): ?>
|
35 |
-
<option value="<?php echo $variation ?>"><?php echo $variation_label; ?></option>
|
36 |
<?php endforeach; ?>
|
37 |
</select>
|
38 |
</span>
|
@@ -53,7 +53,7 @@ add_thickbox();
|
|
53 |
<input type="file" name="font_file" id="font_file" value="" class="uaf_required" accept=".woff,.ttf,.otf" />
|
54 |
<span class="field_error">Please select font file.</span>
|
55 |
<br/>
|
56 |
-
<em>Accepted Font Format : <?php echo join(", ",$GLOBALS['uaf_fix_settings']['allowedFontFormats']); ?> | Font Size: Upto <?php echo uaf_max_upload_size_for_php(); ?>MB</em>
|
57 |
</span>
|
58 |
</p>
|
59 |
|
@@ -61,7 +61,7 @@ add_thickbox();
|
|
61 |
<label> </label>
|
62 |
<span class="field">
|
63 |
<input type="hidden" name="url" value="<?php echo base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']); ?>" />
|
64 |
-
<input type="hidden" name="api_key" value="<?php echo $GLOBALS['uaf_user_settings']['uaf_api_key']; ?>" />
|
65 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
66 |
<input type="submit" name="submit-uaf-font-php" class="button-primary" value="Upload" />
|
67 |
<?php wp_nonce_field( 'uaf_font_upload_php', 'uaf_nonce' ); ?>
|
32 |
<span class="field">
|
33 |
<select name="font_weight" class="medium">
|
34 |
<?php foreach ($GLOBALS['uaf_fix_settings']['font_weight_variations'] as $variation => $variation_label): ?>
|
35 |
+
<option value="<?php echo esc_attr($variation) ?>"><?php echo esc_html($variation_label); ?></option>
|
36 |
<?php endforeach; ?>
|
37 |
</select>
|
38 |
</span>
|
53 |
<input type="file" name="font_file" id="font_file" value="" class="uaf_required" accept=".woff,.ttf,.otf" />
|
54 |
<span class="field_error">Please select font file.</span>
|
55 |
<br/>
|
56 |
+
<em>Accepted Font Format : <?php echo esc_html(join(", ",$GLOBALS['uaf_fix_settings']['allowedFontFormats'])); ?> | Font Size: Upto <?php echo esc_html(uaf_max_upload_size_for_php()); ?>MB</em>
|
57 |
</span>
|
58 |
</p>
|
59 |
|
61 |
<label> </label>
|
62 |
<span class="field">
|
63 |
<input type="hidden" name="url" value="<?php echo base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']); ?>" />
|
64 |
+
<input type="hidden" name="api_key" value="<?php echo esc_attr($GLOBALS['uaf_user_settings']['uaf_api_key']); ?>" />
|
65 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
66 |
<input type="submit" name="submit-uaf-font-php" class="button-primary" value="Upload" />
|
67 |
<?php wp_nonce_field( 'uaf_font_upload_php', 'uaf_nonce' ); ?>
|
includes/views/uaf_main.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
if (isset($_GET['tab'])){
|
4 |
-
$currentTab = $_GET['tab'];
|
5 |
} else {
|
6 |
$currentTab = 'api';
|
7 |
}
|
@@ -11,7 +11,7 @@ if (isset($_GET['tab'])){
|
|
11 |
if (!empty($GLOBALS['uaf_action_return'])):
|
12 |
$actionReturn = $GLOBALS['uaf_action_return'];
|
13 |
?>
|
14 |
-
<div class="updated <?php echo $actionReturn['status']; ?>" id="message"><p><?php echo $actionReturn['body']; ?></p></div>
|
15 |
<?php
|
16 |
endif;
|
17 |
?>
|
@@ -22,7 +22,7 @@ if (isset($_GET['tab'])){
|
|
22 |
|
23 |
<nav class="nav-tab-wrapper">
|
24 |
<?php foreach ($uaf_tabs as $tabKey => $tabData) { ?>
|
25 |
-
<a href="?page=use-any-font&tab=<?php echo $tabKey; ?>" class="nav-tab <?php echo $currentTab == $tabKey?'nav-tab-active':''; ?>"><?php echo $tabData['name']; ?></a>
|
26 |
<?php } ?>
|
27 |
</nav>
|
28 |
|
1 |
<?php
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
if (isset($_GET['tab'])){
|
4 |
+
$currentTab = sanitize_key($_GET['tab']);
|
5 |
} else {
|
6 |
$currentTab = 'api';
|
7 |
}
|
11 |
if (!empty($GLOBALS['uaf_action_return'])):
|
12 |
$actionReturn = $GLOBALS['uaf_action_return'];
|
13 |
?>
|
14 |
+
<div class="updated <?php echo esc_attr($actionReturn['status']); ?>" id="message"><p><?php echo esc_html($actionReturn['body']); ?></p></div>
|
15 |
<?php
|
16 |
endif;
|
17 |
?>
|
22 |
|
23 |
<nav class="nav-tab-wrapper">
|
24 |
<?php foreach ($uaf_tabs as $tabKey => $tabData) { ?>
|
25 |
+
<a href="?page=use-any-font&tab=<?php echo esc_attr($tabKey); ?>" class="nav-tab <?php echo $currentTab == $tabKey?'nav-tab-active':''; ?>"><?php echo esc_html($tabData['name']); ?></a>
|
26 |
<?php } ?>
|
27 |
</nav>
|
28 |
|
includes/views/uaf_sidebar.php
CHANGED
@@ -9,8 +9,8 @@ if(is_plugin_active( 'gravityforms/gravityforms.php' ) && !is_plugin_active( 'jq
|
|
9 |
Instant javascript validation for your Gravity Forms.<br>
|
10 |
|
11 |
<a href="https://demos.dnesscarkey.com/jquery-validation-for-gravity-forms/" target="_blank">
|
12 |
-
<img src="
|
13 |
-
</a>
|
14 |
<strong>Key Features</strong>
|
15 |
<ul class="uaf_list">
|
16 |
<li>Additional Validation rules</li>
|
9 |
Instant javascript validation for your Gravity Forms.<br>
|
10 |
|
11 |
<a href="https://demos.dnesscarkey.com/jquery-validation-for-gravity-forms/" target="_blank">
|
12 |
+
<img src="<?php plugins_url('../assets/img/jquery-validation-gravity.gif', __FILE__) ?>" style="max-width: 100%" />
|
13 |
+
</a>
|
14 |
<strong>Key Features</strong>
|
15 |
<ul class="uaf_list">
|
16 |
<li>Additional Validation rules</li>
|
includes/views/uaf_uploaded_font_list.php
CHANGED
@@ -11,8 +11,8 @@ if (!empty($fontsData)):
|
|
11 |
?>
|
12 |
<div class="font_holder">
|
13 |
<div class="font_meta">
|
14 |
-
<div class="font_name"><?php echo ucfirst($fontName); ?></div>
|
15 |
-
<div class="fontclassname">Class to use this font : <em><strong><?php echo $fontName; ?></strong></em></div>
|
16 |
</div>
|
17 |
|
18 |
<?php
|
@@ -26,11 +26,11 @@ if (!empty($fontsData)):
|
|
26 |
if (isset($fontData['font_weight']) && !empty(trim($fontData['font_weight']))):
|
27 |
?>
|
28 |
<div class="font-weight-style">
|
29 |
-
<?php echo $GLOBALS['uaf_fix_settings']['font_weight_variations'][$fontData['font_weight']]; ?> <?php echo $fontData['font_style']; ?>
|
30 |
</div>
|
31 |
<?php endif; ?>
|
32 |
|
33 |
-
<span class="<?php echo $fontData['font_name'] ?>" style="font-weight:<?php echo $fontData['font_weight']; ?>; font-style: <?php echo $fontData['font_style']; ?>;">The quick brown fox jumps over the lazy dog</span>
|
34 |
|
35 |
<div class="delete_link"><a onclick="if (!confirm('Are you sure ?')){return false;}" href="<?php echo wp_nonce_url( 'admin.php?page=use-any-font&tab=font_upload&delete_font_key='.$key, 'uaf_delete_font', 'uaf_nonce' ); ?>">Delete</a></div>
|
36 |
</div>
|
11 |
?>
|
12 |
<div class="font_holder">
|
13 |
<div class="font_meta">
|
14 |
+
<div class="font_name"><?php echo esc_html(ucfirst($fontName)); ?></div>
|
15 |
+
<div class="fontclassname">Class to use this font : <em><strong><?php echo esc_html($fontName); ?></strong></em></div>
|
16 |
</div>
|
17 |
|
18 |
<?php
|
26 |
if (isset($fontData['font_weight']) && !empty(trim($fontData['font_weight']))):
|
27 |
?>
|
28 |
<div class="font-weight-style">
|
29 |
+
<?php echo esc_html($GLOBALS['uaf_fix_settings']['font_weight_variations'][$fontData['font_weight']]); ?> <?php echo esc_html($fontData['font_style']); ?>
|
30 |
</div>
|
31 |
<?php endif; ?>
|
32 |
|
33 |
+
<span class="<?php echo esc_attr($fontData['font_name']) ?>" style="font-weight:<?php echo esc_attr($fontData['font_weight']); ?>; font-style: <?php echo esc_attr($fontData['font_style']); ?>;">The quick brown fox jumps over the lazy dog</span>
|
34 |
|
35 |
<div class="delete_link"><a onclick="if (!confirm('Are you sure ?')){return false;}" href="<?php echo wp_nonce_url( 'admin.php?page=use-any-font&tab=font_upload&delete_font_key='.$key, 'uaf_delete_font', 'uaf_nonce' ); ?>">Delete</a></div>
|
36 |
</div>
|
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.9
|
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 |
|
@@ -144,6 +144,9 @@ Please do write us after integration and we will add it in our supported list.
|
|
144 |
== Changelog ==
|
145 |
|
146 |
= 6.2.1 =
|
|
|
|
|
|
|
147 |
* Fixed warning notice.
|
148 |
* Fixed only 1 font showing in font list
|
149 |
* Security Fixes.
|
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.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 |
|
144 |
== Changelog ==
|
145 |
|
146 |
= 6.2.1 =
|
147 |
+
|
148 |
+
* Security Fixes.
|
149 |
+
|
150 |
* Fixed warning notice.
|
151 |
* Fixed only 1 font showing in font list
|
152 |
* Security Fixes.
|
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.2
|
9 |
Author URI: https://dineshkarki.com.np/use-any-font
|
10 |
*/
|
11 |
|