Version Description
- Added Font demo in admin panel
- Added extra pre defined elements.
Download this release
Release Info
Developer | dnesscarkey |
Plugin | Use Any Font |
Version | 5.11 |
Comparing to | |
See all releases |
Code changes from version 5.10 to 5.11
- css/uaf_admin.css +9 -0
- images/wp_masonry_layout.gif +0 -0
- includes/uaf_editor_setup.php +0 -2
- includes/uaf_font_implement.php +57 -31
- includes/uaf_font_upload_js.php +22 -28
- includes/uaf_font_upload_php.php +16 -20
- includes/uaf_footer.php +36 -33
- includes/uaf_functions.php +23 -16
- includes/uaf_header.php +9 -0
- includes/uaf_uploaded_font_list.php +27 -29
- js/jquery.validate.min.js +0 -4
- plugin_interface.php +18 -10
- readme.txt +40 -39
- use-any-font.php +3 -3
css/uaf_admin.css
CHANGED
@@ -9,3 +9,12 @@ ul.uaf_list{ list-style-type:square;margin-left: 2em;}
|
|
9 |
|
10 |
#font_upload_message.ok{ background:#060 url(../images/ajax-loader.gif) no-repeat 5px center; color:#fff; padding:5px 10px; border:none; margin:5px 0px;-webkit-border-radius: 3px;border-radius: 3px; padding-left:40px;}
|
11 |
#font_upload_message.error{background:#900; color:#fff;padding:5px 10px; border:none;margin:5px 0px;-webkit-border-radius: 3px;border-radius: 3px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
#font_upload_message.ok{ background:#060 url(../images/ajax-loader.gif) no-repeat 5px center; color:#fff; padding:5px 10px; border:none; margin:5px 0px;-webkit-border-radius: 3px;border-radius: 3px; padding-left:40px;}
|
11 |
#font_upload_message.error{background:#900; color:#fff;padding:5px 10px; border:none;margin:5px 0px;-webkit-border-radius: 3px;border-radius: 3px;}
|
12 |
+
|
13 |
+
.font_holder{background: #fff;border-radius: 5px;border: 1px solid #dadce0;}
|
14 |
+
.font_holder{ padding: 10px; margin: 0px 0px 10px 0px; }
|
15 |
+
.font_holder .font_meta .font_name{font-weight: bold; float: left;}
|
16 |
+
.font_holder .font_meta .delete_link{ float: right; }
|
17 |
+
.font_holder .font_demo{ clear: both; padding-top: 10px; font-size: 25px !important; line-height: 30px !important; }
|
18 |
+
.font_holder .fontclassname{text-align: right; float: right;}
|
19 |
+
|
20 |
+
.elements_holder{ float: left; width: 220px; display: block; }
|
images/wp_masonry_layout.gif
DELETED
Binary file
|
includes/uaf_editor_setup.php
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
<?php
|
2 |
-
add_action('enqueue_block_editor_assets', 'uaf_client_css'); // FOR GUTENBERG EDITOR
|
3 |
-
|
4 |
// DEFAULT WORDPRESS EDITOR
|
5 |
function uaf_mce_before_init( $init_array ) {
|
6 |
$theme_advanced_fonts = '';
|
1 |
<?php
|
|
|
|
|
2 |
// DEFAULT WORDPRESS EDITOR
|
3 |
function uaf_mce_before_init( $init_array ) {
|
4 |
$theme_advanced_fonts = '';
|
includes/uaf_font_implement.php
CHANGED
@@ -13,7 +13,7 @@ if (isset($_POST['submit-uaf-implement'])){
|
|
13 |
$finalElements = join(', ', $fontElements);
|
14 |
$finalElements = uaf_langutizse_elements($finalElements);
|
15 |
|
16 |
-
if (!empty($finalElements)){
|
17 |
$fontsImplementData[date('ymdhis')] = array(
|
18 |
'font_key' => $_POST['font_key'],
|
19 |
'font_elements' => $finalElements
|
@@ -24,7 +24,8 @@ if (isset($_POST['submit-uaf-implement'])){
|
|
24 |
$implementMsg = 'Font Assigned';
|
25 |
|
26 |
} else {
|
27 |
-
$implementMsg
|
|
|
28 |
}
|
29 |
|
30 |
}
|
@@ -38,6 +39,7 @@ if (isset($_GET['delete_implement_key'])):
|
|
38 |
update_option('uaf_font_implement',$updateFontsImplementData);
|
39 |
uaf_write_css();
|
40 |
$implementMsg = 'Font assign removed';
|
|
|
41 |
endif;
|
42 |
?>
|
43 |
|
@@ -52,7 +54,7 @@ endif;
|
|
52 |
<td>
|
53 |
|
54 |
<?php if (!empty($implementMsg)):?>
|
55 |
-
<div class="updated" id="message"><p><?php echo $implementMsg ?></p></div>
|
56 |
<?php endif; ?>
|
57 |
|
58 |
<?php
|
@@ -69,7 +71,7 @@ $fontsData = json_decode($fontsRawData, true);
|
|
69 |
<tr>
|
70 |
<td width="175">Select Font</td>
|
71 |
<td>
|
72 |
-
<select name="font_key" class="
|
73 |
<option value="">- Select -</option>
|
74 |
<?php
|
75 |
if (!empty($fontsData)):
|
@@ -95,32 +97,57 @@ $fontsData = json_decode($fontsRawData, true);
|
|
95 |
<tr>
|
96 |
<td valign="top">Select elements to assign</td>
|
97 |
<td>
|
98 |
-
|
99 |
-
<
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
124 |
</td>
|
125 |
</tr>
|
126 |
<tr>
|
@@ -185,8 +212,7 @@ $fontsImplementData = json_decode($fontsImplementRawData, true);
|
|
185 |
<script>
|
186 |
function open_assign_font(){
|
187 |
jQuery('#open_assign_font').toggle('fast');
|
188 |
-
|
189 |
-
}
|
190 |
</script>
|
191 |
|
192 |
<br/>
|
13 |
$finalElements = join(', ', $fontElements);
|
14 |
$finalElements = uaf_langutizse_elements($finalElements);
|
15 |
|
16 |
+
if (!empty($finalElements) && !empty($_POST['font_key'])){
|
17 |
$fontsImplementData[date('ymdhis')] = array(
|
18 |
'font_key' => $_POST['font_key'],
|
19 |
'font_elements' => $finalElements
|
24 |
$implementMsg = 'Font Assigned';
|
25 |
|
26 |
} else {
|
27 |
+
$implementMsg = "Couldn't assign font. Please select font and atleast one element or add a custom element";
|
28 |
+
$MsgTypeClass = "error";
|
29 |
}
|
30 |
|
31 |
}
|
39 |
update_option('uaf_font_implement',$updateFontsImplementData);
|
40 |
uaf_write_css();
|
41 |
$implementMsg = 'Font assign removed';
|
42 |
+
$MsgTypeClass = "updated";
|
43 |
endif;
|
44 |
?>
|
45 |
|
54 |
<td>
|
55 |
|
56 |
<?php if (!empty($implementMsg)):?>
|
57 |
+
<div class="updated <?php echo $MsgTypeClass; ?>" id="message"><p><?php echo $implementMsg ?></p></div>
|
58 |
<?php endif; ?>
|
59 |
|
60 |
<?php
|
71 |
<tr>
|
72 |
<td width="175">Select Font</td>
|
73 |
<td>
|
74 |
+
<select name="font_key" class="uaf_required" style="width:200px;">
|
75 |
<option value="">- Select -</option>
|
76 |
<?php
|
77 |
if (!empty($fontsData)):
|
97 |
<tr>
|
98 |
<td valign="top">Select elements to assign</td>
|
99 |
<td>
|
100 |
+
|
101 |
+
<div class="elements_holder">
|
102 |
+
<p><b>Headings And Titles </b></p>
|
103 |
+
<input name="elements[]" value="h1" type="checkbox" /> Headline 1 (h1 tags)<br/>
|
104 |
+
<input name="elements[]" value="h2" type="checkbox" /> Headline 2 (h2 tags)<br/>
|
105 |
+
<input name="elements[]" value="h3" type="checkbox" /> Headline 3 (h3 tags)<br/>
|
106 |
+
<input name="elements[]" value="h4" type="checkbox" /> Headline 4 (h4 tags)<br/>
|
107 |
+
<input name="elements[]" value="h5" type="checkbox" /> Headline 5 (h5 tags)<br/>
|
108 |
+
<input name="elements[]" value="h6" type="checkbox" /> Headline 6 (h6 tags)<br/>
|
109 |
+
<input name="elements[]" value=".entry-title" type="checkbox" /> Post,Page&Category Title<br/>
|
110 |
+
<input name="elements[]" value="body.single-post .entry-title" type="checkbox" /> Post Title Only<br/>
|
111 |
+
<input name="elements[]" value="body.page .entry-title" type="checkbox" /> Page Title Only<br/>
|
112 |
+
<input name="elements[]" value="body.category .entry-title" type="checkbox" /> Category Title Only<br/>
|
113 |
+
<input name="elements[]" value=".widget-title" type="checkbox" /> Widget Title<br/>
|
114 |
+
|
115 |
+
</div>
|
116 |
+
|
117 |
+
<div class="elements_holder">
|
118 |
+
<p><b>Site Identity</b></p>
|
119 |
+
<input name="elements[]" value=".site-title" type="checkbox" /> Site Title<br/>
|
120 |
+
<input name="elements[]" value=".site-description" type="checkbox" /> Site Description<br/>
|
121 |
+
|
122 |
+
<p><br/><b>Body</b></p>
|
123 |
+
<input name="elements[]" value="body" type="checkbox" /> Body (body tags)<br/>
|
124 |
+
<input name="elements[]" value="p" type="checkbox" /> Paragraphs (p tags)<br/>
|
125 |
+
<input name="elements[]" value="blockquote" type="checkbox" /> Blockquotes<br/>
|
126 |
+
<input name="elements[]" value="li" type="checkbox" /> Lists (li tags)<br/>
|
127 |
+
<input name="elements[]" value="a" type="checkbox" /> Hyperlink (a tags)<br/>
|
128 |
+
<input name="elements[]" value="strong, b" type="checkbox" /> Bold (strong tags )<br/>
|
129 |
+
<input name="elements[]" value="i, em" type="checkbox" /> Italic (em tags )<br/>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<div class="elements_holder">
|
133 |
+
<p><b>Menus</b></p>
|
134 |
+
<?php
|
135 |
+
$menus = get_terms('nav_menu');
|
136 |
+
if (!empty($menus)){
|
137 |
+
foreach($menus as $menu){
|
138 |
+
?>
|
139 |
+
<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/>
|
140 |
+
<?php
|
141 |
+
}
|
142 |
+
} else {
|
143 |
+
echo 'No Menus Found<br/>';
|
144 |
}
|
145 |
+
?>
|
146 |
+
</div>
|
147 |
+
|
148 |
+
|
149 |
+
|
150 |
+
|
151 |
</td>
|
152 |
</tr>
|
153 |
<tr>
|
212 |
<script>
|
213 |
function open_assign_font(){
|
214 |
jQuery('#open_assign_font').toggle('fast');
|
215 |
+
}
|
|
|
216 |
</script>
|
217 |
|
218 |
<br/>
|
includes/uaf_font_upload_js.php
CHANGED
@@ -1,15 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
if (isset($_POST['submit-uaf-font'])){
|
3 |
-
$fontSaveResponse = uaf_save_font_files($_POST['font_name'], $_POST['convert_response']);
|
4 |
-
$operationStatus = $fontSaveResponse['status'];
|
5 |
-
$operationMsg = $fontSaveResponse['body'];
|
6 |
-
}
|
7 |
-
?>
|
8 |
-
|
9 |
-
<?php if (!empty($operationMsg)):?>
|
10 |
-
<div class="updated <?php echo $operationStatus; ?>" id="message"><p><?php echo $operationMsg ?></p></div>
|
11 |
-
<?php endif; ?>
|
12 |
-
|
13 |
<table class="wp-list-table widefat fixed bookmarks">
|
14 |
<thead>
|
15 |
<tr>
|
@@ -27,11 +15,11 @@ if (isset($_POST['submit-uaf-font'])){
|
|
27 |
<table class="uaf_form">
|
28 |
<tr>
|
29 |
<td width="175">Font Name</td>
|
30 |
-
<td><input type="text" name="font_name" value="" maxlength="20" class="
|
31 |
</tr>
|
32 |
<tr>
|
33 |
<td>Font File</td>
|
34 |
-
<td><input type="file" id="fontfile" name="fontfile" value="" class="
|
35 |
<?php
|
36 |
|
37 |
?>
|
@@ -48,8 +36,8 @@ if (isset($_POST['submit-uaf-font'])){
|
|
48 |
<input type="hidden" name="api_key" value="<?php echo $GLOBALS['uaf_api_key']; ?>" />
|
49 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
50 |
<input type="hidden" name="convert_response" id="convert_response" value="" />
|
51 |
-
<input type="hidden" name="submit-uaf-font" id="submit-uaf-font" value="Upload" />
|
52 |
-
<input type="submit" name="submit-uaf-font" id="submit-uaf-font" class="button-primary" value="Upload" />
|
53 |
|
54 |
<div id="font_upload_message" class=""></div>
|
55 |
<p>By clicking on Upload, you confirm that you have rights to use this font.</p>
|
@@ -61,13 +49,6 @@ if (isset($_POST['submit-uaf-font'])){
|
|
61 |
</div>
|
62 |
|
63 |
<?php include('uaf_uploaded_font_list.php'); ?>
|
64 |
-
|
65 |
-
<script>
|
66 |
-
function open_add_font(){
|
67 |
-
jQuery('#font-upload').toggle('fast');
|
68 |
-
jQuery("#open_add_font_form").validate();
|
69 |
-
}
|
70 |
-
</script>
|
71 |
<br/>
|
72 |
</td>
|
73 |
</tr>
|
@@ -75,13 +56,26 @@ if (isset($_POST['submit-uaf-font'])){
|
|
75 |
</table>
|
76 |
<br/>
|
77 |
<script>
|
78 |
-
jQuery('#open_add_font_form').submit(function(e){
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
|
|
|
|
85 |
jQuery.ajax( {
|
86 |
url: '<?php echo uaf_get_server_url(); ?>/uaf_convertor/convert.php',
|
87 |
type: 'POST',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<table class="wp-list-table widefat fixed bookmarks">
|
2 |
<thead>
|
3 |
<tr>
|
15 |
<table class="uaf_form">
|
16 |
<tr>
|
17 |
<td width="175">Font Name</td>
|
18 |
+
<td><input type="text" name="font_name" value="" maxlength="20" class="uaf_required" style="width:200px;" /></td>
|
19 |
</tr>
|
20 |
<tr>
|
21 |
<td>Font File</td>
|
22 |
+
<td><input type="file" id="fontfile" name="fontfile" value="" class="uaf_required" accept=".woff,.ttf,.otf" /><br/>
|
23 |
<?php
|
24 |
|
25 |
?>
|
36 |
<input type="hidden" name="api_key" value="<?php echo $GLOBALS['uaf_api_key']; ?>" />
|
37 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
38 |
<input type="hidden" name="convert_response" id="convert_response" value="" />
|
39 |
+
<input type="hidden" name="submit-uaf-font-js" id="submit-uaf-font" value="Upload" />
|
40 |
+
<input type="submit" name="submit-uaf-font-js" id="submit-uaf-font" class="button-primary" value="Upload" />
|
41 |
|
42 |
<div id="font_upload_message" class=""></div>
|
43 |
<p>By clicking on Upload, you confirm that you have rights to use this font.</p>
|
49 |
</div>
|
50 |
|
51 |
<?php include('uaf_uploaded_font_list.php'); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
<br/>
|
53 |
</td>
|
54 |
</tr>
|
56 |
</table>
|
57 |
<br/>
|
58 |
<script>
|
|
|
59 |
|
60 |
+
function open_add_font(){
|
61 |
+
jQuery('#font-upload').toggle('fast');
|
62 |
+
}
|
63 |
+
|
64 |
+
jQuery('#open_add_font_form').submit(function(e){
|
65 |
+
|
66 |
+
e.preventDefault();
|
67 |
+
|
68 |
+
breakValidation = false;
|
69 |
+
jQuery('#open_add_font_form .uaf_required').each(function(){
|
70 |
+
if(!jQuery(this).val()){
|
71 |
+
jQuery(this).focus();
|
72 |
+
breakValidation = true;
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
});
|
76 |
|
77 |
+
if(breakValidation){return false;}
|
78 |
+
|
79 |
jQuery.ajax( {
|
80 |
url: '<?php echo uaf_get_server_url(); ?>/uaf_convertor/convert.php',
|
81 |
type: 'POST',
|
includes/uaf_font_upload_php.php
CHANGED
@@ -1,18 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
if (isset($_POST['submit-uaf-font'])){
|
3 |
-
$fontUploadResponse = uaf_upload_font_to_server();
|
4 |
-
if ($fontUploadResponse['status'] == 'success'){
|
5 |
-
$fontUploadResponse = uaf_save_font_files($_POST['font_name'], $fontUploadResponse['body']);
|
6 |
-
}
|
7 |
-
$operationStatus = $fontUploadResponse['status'];
|
8 |
-
$operationMsg = $fontUploadResponse['body'];
|
9 |
-
}
|
10 |
-
?>
|
11 |
-
|
12 |
-
<?php if (!empty($operationMsg)):?>
|
13 |
-
<div class="updated <?php echo $operationStatus; ?>" id="message"><p><?php echo $operationMsg ?></p></div>
|
14 |
-
<?php endif; ?>
|
15 |
-
|
16 |
<table class="wp-list-table widefat fixed bookmarks">
|
17 |
<thead>
|
18 |
<tr>
|
@@ -29,11 +14,11 @@ if (isset($_POST['submit-uaf-font'])){
|
|
29 |
<table class="uaf_form">
|
30 |
<tr>
|
31 |
<td width="175">Font Name</td>
|
32 |
-
<td><input type="text" name="font_name" value="" maxlength="20" class="
|
33 |
</tr>
|
34 |
<tr>
|
35 |
<td>Font File</td>
|
36 |
-
<td><input type="file" name="font_file" id="font_file" value="" class="
|
37 |
<?php
|
38 |
|
39 |
?>
|
@@ -50,7 +35,7 @@ if (isset($_POST['submit-uaf-font'])){
|
|
50 |
<input type="hidden" name="url" value="<?php echo home_url(); ?>" />
|
51 |
<input type="hidden" name="api_key" value="<?php echo $uaf_api_key; ?>" />
|
52 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
53 |
-
<input type="submit" name="submit-uaf-font" class="button-primary" value="Upload" />
|
54 |
|
55 |
|
56 |
<p>By clicking on Upload, you confirm that you have rights to use this font.</p>
|
@@ -66,8 +51,19 @@ if (isset($_POST['submit-uaf-font'])){
|
|
66 |
<script>
|
67 |
function open_add_font(){
|
68 |
jQuery('#font-upload').toggle('fast');
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
</script>
|
72 |
<br/>
|
73 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<table class="wp-list-table widefat fixed bookmarks">
|
2 |
<thead>
|
3 |
<tr>
|
14 |
<table class="uaf_form">
|
15 |
<tr>
|
16 |
<td width="175">Font Name</td>
|
17 |
+
<td><input type="text" name="font_name" value="" maxlength="20" class="uaf_required" style="width:200px;" /></td>
|
18 |
</tr>
|
19 |
<tr>
|
20 |
<td>Font File</td>
|
21 |
+
<td><input type="file" name="font_file" id="font_file" value="" class="uaf_required" accept=".woff,.ttf,.otf" /><br/>
|
22 |
<?php
|
23 |
|
24 |
?>
|
35 |
<input type="hidden" name="url" value="<?php echo home_url(); ?>" />
|
36 |
<input type="hidden" name="api_key" value="<?php echo $uaf_api_key; ?>" />
|
37 |
<input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
|
38 |
+
<input type="submit" name="submit-uaf-font-php" class="button-primary" value="Upload" />
|
39 |
|
40 |
|
41 |
<p>By clicking on Upload, you confirm that you have rights to use this font.</p>
|
51 |
<script>
|
52 |
function open_add_font(){
|
53 |
jQuery('#font-upload').toggle('fast');
|
54 |
+
}
|
55 |
+
|
56 |
+
jQuery('#open_add_font_form').submit(function(){
|
57 |
+
breakValidation = false;
|
58 |
+
jQuery('#open_add_font_form .uaf_required').each(function(){
|
59 |
+
if(!jQuery(this).val()){
|
60 |
+
jQuery(this).focus();
|
61 |
+
breakValidation = true;
|
62 |
+
return false;
|
63 |
+
}
|
64 |
+
});
|
65 |
+
if(breakValidation){return false;}
|
66 |
+
});
|
67 |
</script>
|
68 |
<br/>
|
69 |
</td>
|
includes/uaf_footer.php
CHANGED
@@ -1,9 +1,4 @@
|
|
1 |
<?php
|
2 |
-
if (isset($_POST['submit-uaf-settings'])){
|
3 |
-
uaf_save_settings();
|
4 |
-
$settings_message = 'Settings Saved';
|
5 |
-
}
|
6 |
-
|
7 |
$server_status = $GLOBALS['uaf_server_status'];
|
8 |
if (isset($_POST['test_server']) || empty($server_status)){
|
9 |
if (in_array ('curl', get_loaded_extensions())) {
|
@@ -45,13 +40,7 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
45 |
$GLOBALS['uaf_server_status'] = $server_err_stat;
|
46 |
$GLOBALS['uaf_server_msg'] = $server_err_msg;
|
47 |
}
|
48 |
-
?>
|
49 |
-
|
50 |
-
<?php if (!empty($settings_message)):?>
|
51 |
-
<div class="updated" id="message"><p><?php echo $settings_message ?></p></div>
|
52 |
-
<?php endif; ?>
|
53 |
-
|
54 |
-
|
55 |
<br/>
|
56 |
<table class="wp-list-table widefat fixed bookmarks uaf_form">
|
57 |
<thead>
|
@@ -69,13 +58,13 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
69 |
|
70 |
<tr>
|
71 |
<td>
|
72 |
-
<input type="checkbox" name="uaf_use_curl_uploader" value="1" <?php echo $GLOBALS['uaf_use_curl_uploader'] == 1?'checked=checked':''; ?> /> Use PHP uploader. <em>Need PHP Curl
|
73 |
</td>
|
74 |
</tr>
|
75 |
|
76 |
<tr>
|
77 |
<td>
|
78 |
-
<input type="checkbox" name="uaf_use_absolute_font_path" value="1" <?php echo $GLOBALS['uaf_use_absolute_font_path'] == 1?'checked=checked':''; ?> /> Use absolute path for font.
|
79 |
</td>
|
80 |
</tr>
|
81 |
|
@@ -154,7 +143,7 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
154 |
<table class="wp-list-table widefat fixed bookmarks">
|
155 |
<thead>
|
156 |
<tr>
|
157 |
-
<th>Server Connectivity Test</th>
|
158 |
</tr>
|
159 |
</thead>
|
160 |
<tbody>
|
@@ -180,10 +169,35 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
180 |
</table>
|
181 |
<br/>
|
182 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
<table class="wp-list-table widefat fixed bookmarks">
|
184 |
<thead>
|
185 |
<tr>
|
186 |
-
<th>Have Problem ?</th>
|
187 |
</tr>
|
188 |
</thead>
|
189 |
<tbody>
|
@@ -191,7 +205,6 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
191 |
<td>
|
192 |
<ul class="uaf_list">
|
193 |
<li><a href="http://goo.gl/NYtZsX" target="_blank">Setup Instructions</a></li>
|
194 |
-
<li><a href="http://goo.gl/FcC7EL" target="_blank">Quick Virtual Support</a></li>
|
195 |
<li><a href="http://goo.gl/XgEqzn" target="_blank">Support Forum</a></li>
|
196 |
<li><a href="http://goo.gl/MKg7VS" target="_blank">Rectify My Problem / Contact Us</a></li>
|
197 |
<li><a href="https://bit.ly/2wYjOyj" target="_blank">Download Free Fonts</a></li>
|
@@ -201,6 +214,7 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
201 |
</tbody>
|
202 |
</table>
|
203 |
<br/>
|
|
|
204 |
<table class="wp-list-table widefat fixed bookmarks">
|
205 |
<thead>
|
206 |
<tr>
|
@@ -215,12 +229,14 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
215 |
</tr>
|
216 |
</tbody>
|
217 |
</table>
|
218 |
-
<br
|
|
|
|
|
219 |
|
220 |
<table class="wp-list-table widefat fixed bookmarks">
|
221 |
<thead>
|
222 |
<tr>
|
223 |
-
<th>Plugins You May Like</th>
|
224 |
</tr>
|
225 |
</thead>
|
226 |
<tbody>
|
@@ -241,20 +257,7 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
241 |
</tbody>
|
242 |
</table>
|
243 |
<br/>
|
244 |
-
|
245 |
-
<thead>
|
246 |
-
<tr>
|
247 |
-
<th>Facebook</th>
|
248 |
-
</tr>
|
249 |
-
</thead>
|
250 |
-
<tbody>
|
251 |
-
<tr>
|
252 |
-
<td><iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FDnessCarKey%2F77553779916&width=185&height=180&show_faces=true&colorscheme=light&stream=false&border_color=%23f9f9f9&header=false&appId=215419415167468" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:240px; height:180px;" allowTransparency="true"></iframe>
|
253 |
-
</td>
|
254 |
-
</tr>
|
255 |
-
</tbody>
|
256 |
-
</table>
|
257 |
-
<br/>
|
258 |
|
259 |
</td>
|
260 |
</tr>
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
$server_status = $GLOBALS['uaf_server_status'];
|
3 |
if (isset($_POST['test_server']) || empty($server_status)){
|
4 |
if (in_array ('curl', get_loaded_extensions())) {
|
40 |
$GLOBALS['uaf_server_status'] = $server_err_stat;
|
41 |
$GLOBALS['uaf_server_msg'] = $server_err_msg;
|
42 |
}
|
43 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
<br/>
|
45 |
<table class="wp-list-table widefat fixed bookmarks uaf_form">
|
46 |
<thead>
|
58 |
|
59 |
<tr>
|
60 |
<td>
|
61 |
+
<input type="checkbox" name="uaf_use_curl_uploader" value="1" <?php echo $GLOBALS['uaf_use_curl_uploader'] == 1?'checked=checked':''; ?> /> Use PHP uploader. <em>Need PHP Curl. </em><strong><em>( Only if default javascript uploader doesn't work. )</em></strong>
|
62 |
</td>
|
63 |
</tr>
|
64 |
|
65 |
<tr>
|
66 |
<td>
|
67 |
+
<input type="checkbox" name="uaf_use_absolute_font_path" value="1" <?php echo $GLOBALS['uaf_use_absolute_font_path'] == 1?'checked=checked':''; ?> /> Use absolute path for font. <strong><em>( Better to enable if you are using Cache or Minify plugins. )</em></strong>
|
68 |
</td>
|
69 |
</tr>
|
70 |
|
143 |
<table class="wp-list-table widefat fixed bookmarks">
|
144 |
<thead>
|
145 |
<tr>
|
146 |
+
<th><strong>Server Connectivity Test</strong><strong></th>
|
147 |
</tr>
|
148 |
</thead>
|
149 |
<tbody>
|
169 |
</table>
|
170 |
<br/>
|
171 |
<?php endif; ?>
|
172 |
+
<table class="wp-list-table widefat fixed bookmarks">
|
173 |
+
<thead>
|
174 |
+
<tr>
|
175 |
+
<th><strong>Deliverability Email Validation</strong></th>
|
176 |
+
</tr>
|
177 |
+
</thead>
|
178 |
+
<tbody>
|
179 |
+
<tr>
|
180 |
+
<td>
|
181 |
+
Advance email validation that verifies genuine email address. <strong>Stop fake emails, block spam submission and save your real users from email typos.</strong>
|
182 |
+
<br/><br/>
|
183 |
+
<strong>It Works With.</strong>
|
184 |
+
<ul class="uaf_list">
|
185 |
+
<li>Contact Form 7, Ninja Forms, Gravity Forms, Wp Forms</li>
|
186 |
+
<li>WordPress Registration, WordPress Comments, BBPress Wordpress Forum</li>
|
187 |
+
<li>WooCommerce, Easy Digital Downloads (EDD)</li>
|
188 |
+
<li>Any many more which uses is_email wordpress function.</li>
|
189 |
+
</ul>
|
190 |
+
<p align="right"><a href="https://bit.ly/3cTcvqM" target="_blank" class="button-primary">Check Demo</a><p>
|
191 |
+
</td>
|
192 |
+
</tr>
|
193 |
+
</tbody>
|
194 |
+
</table>
|
195 |
+
<br/>
|
196 |
+
|
197 |
<table class="wp-list-table widefat fixed bookmarks">
|
198 |
<thead>
|
199 |
<tr>
|
200 |
+
<th><strong>Have Problem ?</strong></th>
|
201 |
</tr>
|
202 |
</thead>
|
203 |
<tbody>
|
205 |
<td>
|
206 |
<ul class="uaf_list">
|
207 |
<li><a href="http://goo.gl/NYtZsX" target="_blank">Setup Instructions</a></li>
|
|
|
208 |
<li><a href="http://goo.gl/XgEqzn" target="_blank">Support Forum</a></li>
|
209 |
<li><a href="http://goo.gl/MKg7VS" target="_blank">Rectify My Problem / Contact Us</a></li>
|
210 |
<li><a href="https://bit.ly/2wYjOyj" target="_blank">Download Free Fonts</a></li>
|
214 |
</tbody>
|
215 |
</table>
|
216 |
<br/>
|
217 |
+
<!--
|
218 |
<table class="wp-list-table widefat fixed bookmarks">
|
219 |
<thead>
|
220 |
<tr>
|
229 |
</tr>
|
230 |
</tbody>
|
231 |
</table>
|
232 |
+
<br/>-->
|
233 |
+
|
234 |
+
|
235 |
|
236 |
<table class="wp-list-table widefat fixed bookmarks">
|
237 |
<thead>
|
238 |
<tr>
|
239 |
+
<th><strong>Plugins You May Like</strong></th>
|
240 |
</tr>
|
241 |
</thead>
|
242 |
<tbody>
|
257 |
</tbody>
|
258 |
</table>
|
259 |
<br/>
|
260 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
|
262 |
</td>
|
263 |
</tr>
|
includes/uaf_functions.php
CHANGED
@@ -96,6 +96,8 @@ function uaf_write_css(){
|
|
96 |
<?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
|
97 |
}
|
98 |
|
|
|
|
|
99 |
.et_gf_<?php echo $fontData['font_name'] ?>{background:none !important;font-family:<?php echo $fontData['font_name'] ?>;text-indent:0 !important;font-size:25px;}
|
100 |
|
101 |
<?php
|
@@ -117,8 +119,8 @@ function uaf_write_css(){
|
|
117 |
|
118 |
function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
|
119 |
$uaf_version_check = get_option('uaf_current_version');
|
120 |
-
if ($uaf_version_check != '5.
|
121 |
-
update_option('uaf_current_version', '5.
|
122 |
if ($uaf_version_check < 4.0):
|
123 |
uaf_create_folder();
|
124 |
uaf_move_file_to_newPath();
|
@@ -224,7 +226,7 @@ function uaf_upload_font_to_server(){
|
|
224 |
|
225 |
function uaf_save_font_files($font_name, $convertResponse){
|
226 |
$uafPath = uaf_path_details();
|
227 |
-
$fontNameToStore = sanitize_file_name(
|
228 |
|
229 |
$convertResponseArray = json_decode(stripslashes($convertResponse), true);
|
230 |
if ($convertResponseArray['global']['status'] == 'ok'):
|
@@ -319,19 +321,24 @@ function uaf_count_uploaded_fonts(){
|
|
319 |
|
320 |
function uaf_key_activate(){
|
321 |
$uaf_api_key = trim($_POST['uaf_api_key']);
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
|
|
|
|
|
|
|
|
332 |
}
|
333 |
-
|
334 |
-
|
|
|
335 |
}
|
336 |
return $return;
|
337 |
}
|
@@ -408,7 +415,7 @@ function uaf_get_language_selector(){
|
|
408 |
break;
|
409 |
}
|
410 |
|
411 |
-
$returnSelectHTML = '<select style="width:200px;" class="
|
412 |
foreach ($lang_select_data as $locale => $lang_name) {
|
413 |
//$returnSelectHTML .= '<option value="body.language-'.$locale.'">'.$lang_name.'</option>';
|
414 |
$returnSelectHTML .= '<option value="html:lang('.$locale.')">'.$lang_name.'</option>';
|
96 |
<?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
|
97 |
}
|
98 |
|
99 |
+
.<?php echo $fontData['font_name'] ?>{font-family: '<?php echo $fontData['font_name'] ?>' !important;}
|
100 |
+
|
101 |
.et_gf_<?php echo $fontData['font_name'] ?>{background:none !important;font-family:<?php echo $fontData['font_name'] ?>;text-indent:0 !important;font-size:25px;}
|
102 |
|
103 |
<?php
|
119 |
|
120 |
function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
|
121 |
$uaf_version_check = get_option('uaf_current_version');
|
122 |
+
if ($uaf_version_check != '5.11'):
|
123 |
+
update_option('uaf_current_version', '5.11');
|
124 |
if ($uaf_version_check < 4.0):
|
125 |
uaf_create_folder();
|
126 |
uaf_move_file_to_newPath();
|
226 |
|
227 |
function uaf_save_font_files($font_name, $convertResponse){
|
228 |
$uafPath = uaf_path_details();
|
229 |
+
$fontNameToStore = sanitize_file_name(rand(0,9999).$font_name);
|
230 |
|
231 |
$convertResponseArray = json_decode(stripslashes($convertResponse), true);
|
232 |
if ($convertResponseArray['global']['status'] == 'ok'):
|
321 |
|
322 |
function uaf_key_activate(){
|
323 |
$uaf_api_key = trim($_POST['uaf_api_key']);
|
324 |
+
if (!empty($uaf_api_key)){
|
325 |
+
$api_key_return = wp_remote_get( uaf_get_server_url().'/uaf_convertor/validate_key.php?license_key='.$uaf_api_key.'&url='.home_url(), array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
|
326 |
+
if ( is_wp_error( $api_key_return ) ) {
|
327 |
+
$error_message = $api_key_return->get_error_message();
|
328 |
+
$return['body'] = "Something went wrong: $error_message";
|
329 |
+
$return['status'] = 'error';
|
330 |
+
} else {
|
331 |
+
$api_key_return = json_decode($api_key_return['body']);
|
332 |
+
if ($api_key_return->status == 'success'){
|
333 |
+
update_option('uaf_api_key', $uaf_api_key);
|
334 |
+
$GLOBALS['uaf_api_key'] = $uaf_api_key;
|
335 |
+
}
|
336 |
+
$return['body'] = $api_key_return->msg;
|
337 |
+
$return['status'] = $api_key_return->status;
|
338 |
}
|
339 |
+
} else {
|
340 |
+
$return['body'] = 'Please keep API key to activate.';
|
341 |
+
$return['status'] = 'error';
|
342 |
}
|
343 |
return $return;
|
344 |
}
|
415 |
break;
|
416 |
}
|
417 |
|
418 |
+
$returnSelectHTML = '<select style="width:200px;" class="uaf_required" name="language"><option selected="selected" value="">- Select - </option><option value="all_lang">All Languages</option>';
|
419 |
foreach ($lang_select_data as $locale => $lang_name) {
|
420 |
//$returnSelectHTML .= '<option value="body.language-'.$locale.'">'.$lang_name.'</option>';
|
421 |
$returnSelectHTML .= '<option value="html:lang('.$locale.')">'.$lang_name.'</option>';
|
includes/uaf_header.php
CHANGED
@@ -16,8 +16,17 @@ if (isset($_GET['delete_font_key'])):
|
|
16 |
$operationMsg = $fontDeleteRetun['body'];
|
17 |
$operationStatus = $fontDeleteRetun['status'];
|
18 |
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
?>
|
20 |
|
|
|
|
|
|
|
21 |
|
22 |
<div class="wrap">
|
23 |
<h2>Use Any Font</h2>
|
16 |
$operationMsg = $fontDeleteRetun['body'];
|
17 |
$operationStatus = $fontDeleteRetun['status'];
|
18 |
endif;
|
19 |
+
|
20 |
+
if (isset($_POST['submit-uaf-settings'])){
|
21 |
+
uaf_save_settings();
|
22 |
+
$operationMsg = 'Settings Saved';
|
23 |
+
$operationStatus = 'updated';
|
24 |
+
}
|
25 |
?>
|
26 |
|
27 |
+
<?php if (!empty($operationMsg)):?>
|
28 |
+
<div class="updated <?php echo $operationStatus; ?>" id="message"><p><?php echo $operationMsg ?></p></div>
|
29 |
+
<?php endif; ?>
|
30 |
|
31 |
<div class="wrap">
|
32 |
<h2>Use Any Font</h2>
|
includes/uaf_uploaded_font_list.php
CHANGED
@@ -1,30 +1,28 @@
|
|
1 |
<?php $fontsData = uaf_get_uploaded_font_data(); ?>
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
</tbody>
|
30 |
-
</table>
|
1 |
<?php $fontsData = uaf_get_uploaded_font_data(); ?>
|
2 |
+
|
3 |
+
<?php
|
4 |
+
if (!empty($fontsData)):
|
5 |
+
$sn = 0;
|
6 |
+
foreach ($fontsData as $key=>$fontData):
|
7 |
+
$sn++
|
8 |
+
?>
|
9 |
+
<div class="font_holder">
|
10 |
+
<div class="font_meta">
|
11 |
+
<div class="font_name"><?php echo ucfirst($fontData['font_name']); ?></div>
|
12 |
+
<?php /* <div class="class_name"><?php echo $fontData['font_name'] ?></div> */ ?>
|
13 |
+
<div class="delete_link"><a onclick="if (!confirm('Are you sure ?')){return false;}" href="admin.php?page=uaf_settings_page&delete_font_key=<?php echo $key; ?>">Delete</a></div>
|
14 |
+
</div>
|
15 |
+
|
16 |
+
<div class="font_demo">
|
17 |
+
<span class="<?php echo $fontData['font_name'] ?>">The quick brown fox jumps over the lazy dog</span>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="fontclassname">Class to use this font : <em><strong><?php echo $fontData['font_name']; ?></strong></em></div>
|
21 |
+
<br style="clear:both;" />
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<?php endforeach; ?>
|
25 |
+
|
26 |
+
<?php else: ?>
|
27 |
+
<p>No font found. Please click on Add Fonts to add font</p>
|
28 |
+
<?php endif; ?>
|
|
|
|
js/jquery.validate.min.js
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
/*! jQuery Validation Plugin - v1.15.0 - 2/24/2016
|
2 |
-
* http://jqueryvalidation.org/
|
3 |
-
* Copyright (c) 2016 Jörn Zaefferer; Licensed MIT */
|
4 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){if(this.length){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||-1!==a.inArray(c.keyCode,d)||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable]",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=h&&g.check(e)))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)a[b]&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=a(this).closest("form")[0]),d in c||!b.objectLength(a(this).rules())?!1:(c[d]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type;return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=b.hasAttribute("contenteditable")?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);if("function"==typeof f.normalizer){if(i=f.normalizer.call(b,i),"string"!=typeof i)throw new TypeError("The normalizer should return a string value.");delete f.normalizer}for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e=a(c).attr("type"),f="Step attribute on input type "+e+" is not supported.",g=["text","number","range"],h=new RegExp("\\b"+e+"\\b"),i=e&&!h.test(g.join());if(i)throw new Error(f);return this.optional(c)||b%d===0},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)})});
|
|
|
|
|
|
|
|
plugin_interface.php
CHANGED
@@ -1,15 +1,25 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
add_action('admin_menu', 'uaf_create_menu');
|
3 |
-
add_action("admin_print_scripts", 'adminjslibs');
|
4 |
add_action("admin_print_styles", 'adminCsslibs');
|
5 |
add_action('wp_enqueue_scripts', 'uaf_client_css');
|
6 |
add_action('plugins_loaded', 'uaf_update_check');
|
7 |
add_action('init', 'uaf_editor_setup');
|
8 |
|
9 |
-
if (isset($_GET['uaf_api_notification_hide']) == 1){
|
10 |
-
update_option('uaf_api_notification_hide','yes_2');
|
11 |
-
}
|
12 |
-
|
13 |
$uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
|
14 |
if ($uaf_disbale_editor_font_list_value != 1):
|
15 |
add_filter('mce_buttons_2', 'wp_editor_fontsize_filter');
|
@@ -24,11 +34,6 @@ function uaf_client_css() {
|
|
24 |
wp_enqueue_style( 'uaf_client_css' );
|
25 |
}
|
26 |
|
27 |
-
function adminjslibs(){
|
28 |
-
wp_register_script('uaf_validate_js',plugins_url("use-any-font/js/jquery.validate.min.js"));
|
29 |
-
wp_enqueue_script('uaf_validate_js');
|
30 |
-
}
|
31 |
-
|
32 |
function adminCsslibs(){
|
33 |
$uaf_upload = wp_upload_dir();
|
34 |
$uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
|
@@ -50,6 +55,9 @@ function uaf_activate(){
|
|
50 |
}
|
51 |
|
52 |
function uaf_settings_page() {
|
|
|
|
|
|
|
53 |
include('includes/uaf_header.php');
|
54 |
if ($GLOBALS['uaf_use_curl_uploader'] == 1){
|
55 |
include('includes/uaf_font_upload_php.php');
|
1 |
<?php
|
2 |
+
if (isset($_POST['submit-uaf-font-php'])){
|
3 |
+
$fontUploadResponse = uaf_upload_font_to_server();
|
4 |
+
if ($fontUploadResponse['status'] == 'success'){
|
5 |
+
$fontUploadResponse = uaf_save_font_files($_POST['font_name'], $fontUploadResponse['body']);
|
6 |
+
}
|
7 |
+
$operationStatus = $fontUploadResponse['status'];
|
8 |
+
$operationMsg = $fontUploadResponse['body'];
|
9 |
+
}
|
10 |
+
|
11 |
+
if (isset($_POST['submit-uaf-font-js'])){
|
12 |
+
$fontSaveResponse = uaf_save_font_files($_POST['font_name'], $_POST['convert_response']);
|
13 |
+
$operationStatus = $fontSaveResponse['status'];
|
14 |
+
$operationMsg = $fontSaveResponse['body'];
|
15 |
+
}
|
16 |
+
|
17 |
add_action('admin_menu', 'uaf_create_menu');
|
|
|
18 |
add_action("admin_print_styles", 'adminCsslibs');
|
19 |
add_action('wp_enqueue_scripts', 'uaf_client_css');
|
20 |
add_action('plugins_loaded', 'uaf_update_check');
|
21 |
add_action('init', 'uaf_editor_setup');
|
22 |
|
|
|
|
|
|
|
|
|
23 |
$uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
|
24 |
if ($uaf_disbale_editor_font_list_value != 1):
|
25 |
add_filter('mce_buttons_2', 'wp_editor_fontsize_filter');
|
34 |
wp_enqueue_style( 'uaf_client_css' );
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
function adminCsslibs(){
|
38 |
$uaf_upload = wp_upload_dir();
|
39 |
$uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
|
55 |
}
|
56 |
|
57 |
function uaf_settings_page() {
|
58 |
+
global $operationStatus;
|
59 |
+
global $operationMsg;
|
60 |
+
|
61 |
include('includes/uaf_header.php');
|
62 |
if ($GLOBALS['uaf_use_curl_uploader'] == 1){
|
63 |
include('includes/uaf_font_upload_php.php');
|
readme.txt
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
=== Use Any Font | Custom Font
|
2 |
Contributors: dnesscarkey
|
3 |
-
Tags: custom fonts, font embed, font uploader,
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.4.1
|
6 |
-
Stable tag: 5.
|
7 |
|
8 |
-
Embed any custom font
|
9 |
|
10 |
== Description ==
|
11 |
-
|
12 |
|
13 |
-
Click <a href="
|
14 |
|
15 |
-
Use Any Font gives you freedom to
|
16 |
|
17 |
<strong>Features</strong>
|
18 |
|
19 |
-
* Quick and easy to setup.
|
20 |
-
* Support all major browsers including IE, Firefox, Chrome, Safari, IOS, Andriod, Opera and more.
|
21 |
-
* Font conversion within the
|
22 |
* Use uploaded custom fonts directly from Wordpress Editor, Gutenberg Editor,
|
23 |
<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=39880" target="_blank">Divi Builder</a>,
|
24 |
<a href="https://wordpress.org/plugins/siteorigin-panels/" target="_blank">Site Origin Page Buider</a>,
|
@@ -32,28 +32,25 @@ Use Any Font gives you freedom to use custom fonts in your website. It is not li
|
|
32 |
<a href="https://bit.ly/3auJKzt" target="_blank">Revolution Slider</a>,
|
33 |
and any visual builder using the class.
|
34 |
* Custom fonts uploaded can be directly used from Theme options panel for major themeforest themes like <a href="https://bit.ly/3auJKzt" target="_blank">Avada, X Theme, Flatsome, Salient, Porto, Shopkeeper, Oshine, WPLMS Learning Management System Theme, KLEO, WoodMart, ListingPro, SimpleMag, ROSA 1, 907, Voice, Grand Restaurant, LeadEngine, Service Finder, MagPlus, Hostiko, Adifier, Puca, GreenMart, Reco, VidoRev, Halena and many more known themes. (1000+). Check out full list here.</a>
|
35 |
-
* Supports font format including ttf, otf, woff.
|
36 |
* Accepts custom font file upto 25 MB.
|
37 |
* Embed fonts using @font-face css. SEO friendly and quick loading due to woff2 compression.
|
38 |
* Multiple custom fonts can be used.
|
39 |
* Faster load time as your custom fonts are stored on your own server.
|
40 |
* Supports font assign based on language for WPML and Polylang multi language plugin.
|
|
|
41 |
|
42 |
<strong>Support</strong>
|
43 |
|
44 |
-
* <a href="
|
45 |
-
* <a href="
|
46 |
|
47 |
-
You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
|
48 |
-
|
49 |
-
You can get key from <a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank">here</a>. You can also generate Lite / Test API key from button at top of the plugin page. <strong>Note : </strong> Lite / Test API only allow single font conversion.
|
50 |
|
51 |
<strong>Installation Video</strong>
|
52 |
[youtube http://www.youtube.com/watch?v=QzGaWIPVwEk]
|
53 |
|
54 |
-
Note : We don't store your fonts in our server neither any of your information except the API key details. Our server deletes the temporary file after the
|
55 |
-
|
56 |
-
We don't respond to support tickets created here. Please visit our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">support forum</a> for your issues.
|
57 |
|
58 |
<strong>Integration for Themes / Plugin Developers</strong>
|
59 |
|
@@ -67,12 +64,12 @@ Please do write us after integration and we will add it in our supported list an
|
|
67 |
|
68 |
== Installation ==
|
69 |
|
70 |
-
1.
|
71 |
1. Activate the use-any-font plugin through the 'Plugins' menu in WordPress.
|
72 |
1. Get the API key and verify it (Needed to connect to server for font conversion).
|
73 |
1. Select Use Any Font under Settings
|
74 |
-
1. Upload
|
75 |
-
1. Assign your font to
|
76 |
1. You can also assign the custom font directly from wordpress page/post editor.
|
77 |
1. Your fonts are working in your site now.
|
78 |
1. You may refer to Screenshots tab for visual instructions.
|
@@ -81,11 +78,11 @@ Please do write us after integration and we will add it in our supported list an
|
|
81 |
|
82 |
= Which font format does plugin accepts and the font size ? =
|
83 |
|
84 |
-
Currently, ttf, otf, woff font format are accepted. Font file upto 25MB is acceptable. However, we suggest you to use smaller ones as far as possible. The font file size directly affects your site load time.
|
85 |
|
86 |
= From where can i get the font files ? =
|
87 |
|
88 |
-
Mostly you can download the font files from internet. There are many sites that offer fonts. One of font directory we really like is <a href="https://bit.ly/2wYjOyj" target="_blank">Ultimate Fonts</a>. They only have free fonts which are even free for commercial use.
|
89 |
|
90 |
= Does it works with multiple fonts ? =
|
91 |
|
@@ -93,7 +90,7 @@ Ya, it works with multiple fonts. For multiple font conversion request, you need
|
|
93 |
|
94 |
= Do i need to manually convert fonts ? =
|
95 |
|
96 |
-
No, you don't need to do it yourself. Just upload your font(supports most of the font format), and the plugin does the rest.
|
97 |
|
98 |
= Does it work with Visual Builder like Divi Builder ? =
|
99 |
|
@@ -108,11 +105,12 @@ You can check video for more details.
|
|
108 |
Its built-in Font Upload and Font assign section allows you to assign custom fonts to any theme. However, for popular themes like <a href="https://bit.ly/3auJKzt" target="_blank">Avada, X Theme, Flatsome, Salient, Porto, Shopkeeper, Oshine, WPLMS Learning Management System Theme, KLEO, WoodMart, ListingPro, SimpleMag, ROSA 1, 907, Voice, Grand Restaurant, LeadEngine, Service Finder, MagPlus, Hostiko, Adifier, Puca, GreenMart, Reco, VidoRev, Halena and many more known themes. (1000+). Check out full list here.</a>, we have added extra features that allows you to assign the custom font to your theme using the theme options panel.
|
109 |
|
110 |
= Can I assign font based on language ? =
|
111 |
-
|
|
|
112 |
|
113 |
= Where are my fonts stored ? =
|
114 |
|
115 |
-
All the fonts are stored in your own server. Our server only convert the fonts and sends back.
|
116 |
|
117 |
= Does my font depends upon plugin's server uptime ? =
|
118 |
|
@@ -120,11 +118,11 @@ No, our server is needed during font conversion only. After that all fonts are s
|
|
120 |
|
121 |
= Not working for me. What can i do ? =
|
122 |
|
123 |
-
<a href="
|
124 |
-
<a href="
|
125 |
-
<a href="http://dineshkarki.com.np/rectify-my-problem" target="_blank">Rectify My Problem</a> for personal assitance.
|
126 |
|
127 |
= How can theme / plugin developer integrate Use Any Font ? =
|
|
|
128 |
You can use <strong>uaf_get_font_families();</strong> function to get the list of custom fonts uploaded with Use Any Font. You can add it in your font family select box or list.
|
129 |
|
130 |
<em>if (function_exists('uaf_get_font_families')){
|
@@ -144,6 +142,10 @@ Please do write us after integration and we will add it in our supported list.
|
|
144 |
|
145 |
== Changelog ==
|
146 |
|
|
|
|
|
|
|
|
|
147 |
= 5.10 =
|
148 |
* Added support for Gutenberg Editor using class.
|
149 |
* Added support for Revolution Slider. Now you can select font family directly from Revolution slider to assign font.
|
@@ -153,14 +155,14 @@ Please do write us after integration and we will add it in our supported list.
|
|
153 |
|
154 |
= 5.6 =
|
155 |
* Added support for Generate Press, Astra and Ocean WP Theme.
|
156 |
-
* Added setting For Font Display (swap, fallback, block)
|
157 |
|
158 |
= 5.5 =
|
159 |
* Assign font based on language for WPML & Polylang multi lingual plugins.
|
160 |
|
161 |
= 5.4 =
|
162 |
-
*
|
163 |
-
*
|
164 |
|
165 |
= 5.3 =
|
166 |
* Fixed domain verification issue.
|
@@ -215,12 +217,11 @@ Please do write us after integration and we will add it in our supported list.
|
|
215 |
= 4.4.1 =
|
216 |
* Fixed SSL API key issue
|
217 |
|
218 |
-
|
219 |
= 4.3.7 =
|
220 |
-
* Secure file upload URL for Default Js Uploader
|
221 |
|
222 |
= 4.3.6 =
|
223 |
-
* Fixed validation for PHP uploader
|
224 |
* Sanitize font name
|
225 |
* Test with 4.3.1
|
226 |
|
@@ -243,16 +244,16 @@ Please do write us after integration and we will add it in our supported list.
|
|
243 |
* Add js extension validation for font file.
|
244 |
|
245 |
= 4.3 =
|
246 |
-
* Ajax Font Upload
|
247 |
* Fixed Couldn't receive font file for conversion issue.
|
248 |
|
249 |
= 4.2.4 =
|
250 |
-
* Font size increase
|
251 |
* Fixed js validation issue.
|
252 |
* Add server side validation for font file.
|
253 |
|
254 |
= 4.2.3 =
|
255 |
-
* Removed rarely used font formats from being upload. They were making font
|
256 |
* Fixed name validation issue
|
257 |
|
258 |
= 4.2.2 =
|
1 |
+
=== Use Any Font | Custom Font Uploader ===
|
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.4.1
|
6 |
+
Stable tag: 5.11
|
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 |
|
10 |
== Description ==
|
11 |
+
Upload any custom fonts you wish and give your site a elegant look. Quickly change font without need of css knowledge.
|
12 |
|
13 |
+
Click <a href="https://dineshkarki.com.np/use-any-font/demo" target="_blank">HERE</a> for Use Any Font working demo.
|
14 |
|
15 |
+
Use Any Font gives you freedom to intall custom fonts in your wordpress website. It is different than other font embed services which gives you countable number of fonts to select from neither the one that stores your custom font in remote server. You can use any custom fonts if you have its font format (ttf,otf,woff) without being dependent to other's server uptime. You can just upload one format and the rest needed formats to work in all browsers are automatically converted even in woff2 compressed format for latest browsers and faster load time.
|
16 |
|
17 |
<strong>Features</strong>
|
18 |
|
19 |
+
* Quick and easy to setup. Change font with ease.
|
20 |
+
* Support all major browsers including IE, Edge, Firefox, Chrome, Safari, IOS, Andriod, Opera and more.
|
21 |
+
* Font conversion within the font uploader and quick font assign interface. You can select pre defined html tags or assign it to custom css.
|
22 |
* Use uploaded custom fonts directly from Wordpress Editor, Gutenberg Editor,
|
23 |
<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=39880" target="_blank">Divi Builder</a>,
|
24 |
<a href="https://wordpress.org/plugins/siteorigin-panels/" target="_blank">Site Origin Page Buider</a>,
|
32 |
<a href="https://bit.ly/3auJKzt" target="_blank">Revolution Slider</a>,
|
33 |
and any visual builder using the class.
|
34 |
* Custom fonts uploaded can be directly used from Theme options panel for major themeforest themes like <a href="https://bit.ly/3auJKzt" target="_blank">Avada, X Theme, Flatsome, Salient, Porto, Shopkeeper, Oshine, WPLMS Learning Management System Theme, KLEO, WoodMart, ListingPro, SimpleMag, ROSA 1, 907, Voice, Grand Restaurant, LeadEngine, Service Finder, MagPlus, Hostiko, Adifier, Puca, GreenMart, Reco, VidoRev, Halena and many more known themes. (1000+). Check out full list here.</a>
|
35 |
+
* Supports font format including ttf, otf, woff but you only need to upload font in 1 format. Other required fonts are converted automatically by our font convertor.
|
36 |
* Accepts custom font file upto 25 MB.
|
37 |
* Embed fonts using @font-face css. SEO friendly and quick loading due to woff2 compression.
|
38 |
* Multiple custom fonts can be used.
|
39 |
* Faster load time as your custom fonts are stored on your own server.
|
40 |
* Supports font assign based on language for WPML and Polylang multi language plugin.
|
41 |
+
* Added font display property in @font-face
|
42 |
|
43 |
<strong>Support</strong>
|
44 |
|
45 |
+
* <a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">Support Forum</a> to quickly resolve your issues.
|
46 |
+
* Or you can also send msg using Facebook Msg widget from our website. <a href="https://dineshkarki.com.np">https://dineshkarki.com.np</a>
|
47 |
|
48 |
+
You need API key to connect to our server for font conversion. Our server converts your font and sends it back. You can get key from <a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank">here</a>. You can also generate Lite / Test API key from button at top of the plugin page. <strong>Note : </strong> Lite / Test API only allow single font conversion.
|
|
|
|
|
49 |
|
50 |
<strong>Installation Video</strong>
|
51 |
[youtube http://www.youtube.com/watch?v=QzGaWIPVwEk]
|
52 |
|
53 |
+
Note : We don't store your fonts in our server neither any of your information except the API key details. Our server deletes the temporary file after the font upload is complete.
|
|
|
|
|
54 |
|
55 |
<strong>Integration for Themes / Plugin Developers</strong>
|
56 |
|
64 |
|
65 |
== Installation ==
|
66 |
|
67 |
+
1. Search Use Any Font and click on Install.
|
68 |
1. Activate the use-any-font plugin through the 'Plugins' menu in WordPress.
|
69 |
1. Get the API key and verify it (Needed to connect to server for font conversion).
|
70 |
1. Select Use Any Font under Settings
|
71 |
+
1. Upload / Add custom font.
|
72 |
+
1. Assign your custom font to elements.
|
73 |
1. You can also assign the custom font directly from wordpress page/post editor.
|
74 |
1. Your fonts are working in your site now.
|
75 |
1. You may refer to Screenshots tab for visual instructions.
|
78 |
|
79 |
= Which font format does plugin accepts and the font size ? =
|
80 |
|
81 |
+
Currently, ttf, otf, woff font format are accepted but you only need to upload font in 1 format other needed formats to work in all browser are auto generated by our font convertor. Font file upto 25MB is acceptable. However, we suggest you to use smaller ones as far as possible. The font file size directly affects your site load time.
|
82 |
|
83 |
= From where can i get the font files ? =
|
84 |
|
85 |
+
Mostly you can download the font files from internet. There are many sites that offer fonts. One of font directory we really like is <a href="https://bit.ly/2wYjOyj" target="_blank">Ultimate Fonts</a>. They only have free fonts which are even free for commercial use. So you can install font and use in any website.
|
86 |
|
87 |
= Does it works with multiple fonts ? =
|
88 |
|
90 |
|
91 |
= Do i need to manually convert fonts ? =
|
92 |
|
93 |
+
No, you don't need to do it yourself. Just upload your font (supports most of the font format), and the plugin's font convertor does the rest.
|
94 |
|
95 |
= Does it work with Visual Builder like Divi Builder ? =
|
96 |
|
105 |
Its built-in Font Upload and Font assign section allows you to assign custom fonts to any theme. However, for popular themes like <a href="https://bit.ly/3auJKzt" target="_blank">Avada, X Theme, Flatsome, Salient, Porto, Shopkeeper, Oshine, WPLMS Learning Management System Theme, KLEO, WoodMart, ListingPro, SimpleMag, ROSA 1, 907, Voice, Grand Restaurant, LeadEngine, Service Finder, MagPlus, Hostiko, Adifier, Puca, GreenMart, Reco, VidoRev, Halena and many more known themes. (1000+). Check out full list here.</a>, we have added extra features that allows you to assign the custom font to your theme using the theme options panel.
|
106 |
|
107 |
= Can I assign font based on language ? =
|
108 |
+
|
109 |
+
Ya, Our plugin allows you to assign font based on language. It currently supports WPML and Polylang. Quick font changer based on language used. If you are using some others multi lingual plugin, please do contact us and we will try to integrate with our plugin.
|
110 |
|
111 |
= Where are my fonts stored ? =
|
112 |
|
113 |
+
All the fonts are stored in your own server. Our server only convert the fonts and sends back. It is stored in wp-content/uploads/useanyfont folder. So there won't be different fonts path and will be indentical to your siteurl.
|
114 |
|
115 |
= Does my font depends upon plugin's server uptime ? =
|
116 |
|
118 |
|
119 |
= Not working for me. What can i do ? =
|
120 |
|
121 |
+
* <a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">Support Forum</a> to quickly resolve your issues.
|
122 |
+
* Or you can also send msg using Facebook Msg widget from our website. <a href="https://dineshkarki.com.np">https://dineshkarki.com.np</a>
|
|
|
123 |
|
124 |
= How can theme / plugin developer integrate Use Any Font ? =
|
125 |
+
|
126 |
You can use <strong>uaf_get_font_families();</strong> function to get the list of custom fonts uploaded with Use Any Font. You can add it in your font family select box or list.
|
127 |
|
128 |
<em>if (function_exists('uaf_get_font_families')){
|
142 |
|
143 |
== Changelog ==
|
144 |
|
145 |
+
= 5.11 =
|
146 |
+
* Added Font demo in admin panel
|
147 |
+
* Added extra pre defined elements.
|
148 |
+
|
149 |
= 5.10 =
|
150 |
* Added support for Gutenberg Editor using class.
|
151 |
* Added support for Revolution Slider. Now you can select font family directly from Revolution slider to assign font.
|
155 |
|
156 |
= 5.6 =
|
157 |
* Added support for Generate Press, Astra and Ocean WP Theme.
|
158 |
+
* Added setting For Font Display (swap, fallback, block) for @font-face
|
159 |
|
160 |
= 5.5 =
|
161 |
* Assign font based on language for WPML & Polylang multi lingual plugins.
|
162 |
|
163 |
= 5.4 =
|
164 |
+
* Install font upto 25 MB.
|
165 |
+
* Font convertor uses woff2 compression for better and faster font loading.
|
166 |
|
167 |
= 5.3 =
|
168 |
* Fixed domain verification issue.
|
217 |
= 4.4.1 =
|
218 |
* Fixed SSL API key issue
|
219 |
|
|
|
220 |
= 4.3.7 =
|
221 |
+
* Secure file upload URL for Default Js font Uploader
|
222 |
|
223 |
= 4.3.6 =
|
224 |
+
* Fixed validation for PHP font uploader
|
225 |
* Sanitize font name
|
226 |
* Test with 4.3.1
|
227 |
|
244 |
* Add js extension validation for font file.
|
245 |
|
246 |
= 4.3 =
|
247 |
+
* Add font using Ajax Font Upload.
|
248 |
* Fixed Couldn't receive font file for conversion issue.
|
249 |
|
250 |
= 4.2.4 =
|
251 |
+
* Font size increase upto 10 MB
|
252 |
* Fixed js validation issue.
|
253 |
* Add server side validation for font file.
|
254 |
|
255 |
= 4.2.3 =
|
256 |
+
* Removed rarely used font formats from being upload. They were making font convertor server down repeatedly.
|
257 |
* Fixed name validation issue
|
258 |
|
259 |
= 4.2.2 =
|
use-any-font.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
Plugin Name: Use Any Font
|
4 |
Plugin URI: http://dineshkarki.com.np/use-any-font
|
5 |
Description: Embed any font in your website
|
6 |
-
Author:
|
7 |
-
Version: 5.
|
8 |
-
Author URI:
|
9 |
*/
|
10 |
|
11 |
/* Copyright 2012 Dinesh Karki (email : dnesskarki@gmail.com)
|
3 |
Plugin Name: Use Any Font
|
4 |
Plugin URI: http://dineshkarki.com.np/use-any-font
|
5 |
Description: Embed any font in your website
|
6 |
+
Author: Dnesscarkey
|
7 |
+
Version: 5.11
|
8 |
+
Author URI: https://www.dineshkarki.com.np
|
9 |
*/
|
10 |
|
11 |
/* Copyright 2012 Dinesh Karki (email : dnesskarki@gmail.com)
|