Version Description
- Ajax Font Upload
- Fixed Couldn't receive font file for conversion issue.
Download this release
Release Info
Developer | dnesscarkey |
Plugin | Use Any Font |
Version | 4.3 |
Comparing to | |
See all releases |
Code changes from version 4.2.4 to 4.3
- css/uaf_admin.css +4 -1
- images/ajax-loader.gif +0 -0
- includes/uaf_font_implement.php +2 -2
- includes/uaf_font_upload_js.php +246 -0
- includes/{uaf_font_upload.php → uaf_font_upload_php.php} +2 -2
- includes/uaf_footer.php +10 -13
- includes/uaf_header.php +1 -1
- plugin_interface.php +32 -4
- readme.txt +6 -2
- use-any-font.php +1 -1
css/uaf_admin.css
CHANGED
@@ -5,4 +5,7 @@ span.active_key{ padding-left:50px; font-weight:bold; color:#060;}
|
|
5 |
#server_status.test_successfull{ background-color:#090; color:#fff; }
|
6 |
#server_status.test_error{ background-color:#900; color:#fff; }
|
7 |
.uaf_test_msg{ font-size:11px; padding-bottom:10px; color:#454545;}
|
8 |
-
ul.uaf_list{ list-style-type:square;margin-left: 2em;}
|
|
|
|
|
|
5 |
#server_status.test_successfull{ background-color:#090; color:#fff; }
|
6 |
#server_status.test_error{ background-color:#900; color:#fff; }
|
7 |
.uaf_test_msg{ font-size:11px; padding-bottom:10px; color:#454545;}
|
8 |
+
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;}
|
images/ajax-loader.gif
ADDED
Binary file
|
includes/uaf_font_implement.php
CHANGED
@@ -62,7 +62,7 @@ $fontsData = json_decode($fontsRawData, true);
|
|
62 |
<p align="right"><input type="button" name="open_assign_font" onClick="open_assign_font();" class="button-primary" value="Assign Font" /><br/></p>
|
63 |
|
64 |
<div id="open_assign_font" style="display:none;">
|
65 |
-
<form action="
|
66 |
<table class="uaf_form">
|
67 |
<tr>
|
68 |
<td width="175">Select Font</td>
|
@@ -142,7 +142,7 @@ $fontsImplementData = json_decode($fontsImplementRawData, true);
|
|
142 |
<td><?php echo $sn; ?></td>
|
143 |
<td><?php echo $fontsData[$fontImplementData['font_key']]['font_name']; ?></td>
|
144 |
<td><?php echo $fontImplementData['font_elements'] ?></td>
|
145 |
-
<td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="
|
146 |
</tr>
|
147 |
<?php endforeach; ?>
|
148 |
<?php else: ?>
|
62 |
<p align="right"><input type="button" name="open_assign_font" onClick="open_assign_font();" class="button-primary" value="Assign Font" /><br/></p>
|
63 |
|
64 |
<div id="open_assign_font" style="display:none;">
|
65 |
+
<form action="admin.php?page=uaf_settings_page" id="open_assign_font_form" method="post">
|
66 |
<table class="uaf_form">
|
67 |
<tr>
|
68 |
<td width="175">Select Font</td>
|
142 |
<td><?php echo $sn; ?></td>
|
143 |
<td><?php echo $fontsData[$fontImplementData['font_key']]['font_name']; ?></td>
|
144 |
<td><?php echo $fontImplementData['font_elements'] ?></td>
|
145 |
+
<td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="admin.php?page=uaf_settings_page&delete_implement_key=<?php echo $key; ?>">Delete</a></td>
|
146 |
</tr>
|
147 |
<?php endforeach; ?>
|
148 |
<?php else: ?>
|
includes/uaf_font_upload_js.php
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$allowedFontFormats = array ('ttf','otf');
|
3 |
+
$uaf_api_key = get_option('uaf_api_key');
|
4 |
+
|
5 |
+
if (isset($_POST['submit-uaf-font'])){
|
6 |
+
$fontUploadFinalMsg = '';
|
7 |
+
$fontUploadFinalStatus = 'updated';
|
8 |
+
|
9 |
+
if (!empty($_POST['font_name'])):
|
10 |
+
$fontNameToStore = sanitize_file_name(date('ymdhis').$_POST['font_name']);
|
11 |
+
$fontNameToStoreWithUrl = $fontNameToStore;
|
12 |
+
if (!empty($_POST['convert_response'])):
|
13 |
+
$convertResponseArray = json_decode(stripslashes($_POST['convert_response']), true);
|
14 |
+
if ($convertResponseArray['global']['status'] == 'ok'):
|
15 |
+
$neededFontFormats = array('woff','eot');
|
16 |
+
foreach ($neededFontFormats as $neededFontFormat):
|
17 |
+
if ($convertResponseArray[$neededFontFormat]['status'] == 'ok'):
|
18 |
+
$fontFileContent = '';
|
19 |
+
$fontFileContent = wp_remote_fopen($convertResponseArray[$neededFontFormat]['filename']);
|
20 |
+
if (!empty($fontFileContent)):
|
21 |
+
$newFileName = $fontNameToStore.'.'.$neededFontFormat;
|
22 |
+
$newFilePath = $uaf_upload_dir.$newFileName;
|
23 |
+
$fh = fopen($newFilePath, 'w') or die("can't open file. Make sure you have write permission to your upload folder");
|
24 |
+
fwrite($fh, $fontFileContent);
|
25 |
+
fclose($fh);
|
26 |
+
$fontUploadMsg[$neededFontFormat]['status'] = 'ok';
|
27 |
+
$fontUploadMsg[$neededFontFormat]['text'] = "Done";
|
28 |
+
else:
|
29 |
+
$fontUploadMsg[$neededFontFormat]['status'] = 'error';
|
30 |
+
$fontUploadMsg[$neededFontFormat]['text'] = "Couldn't receive $neededFontFormat file";
|
31 |
+
endif;
|
32 |
+
else:
|
33 |
+
$fontUploadMsg[$neededFontFormat]['status'] = 'error';
|
34 |
+
$fontUploadMsg[$neededFontFormat]['text'] = "Problem converting to $neededFontFormat format";
|
35 |
+
endif;
|
36 |
+
endforeach;
|
37 |
+
else:
|
38 |
+
$fontUploadFinalStatus = 'error';
|
39 |
+
$fontUploadFinalMsg .= $convertResponseArray['global']['msg'].'<br/>';
|
40 |
+
endif;
|
41 |
+
else:
|
42 |
+
$fontUploadFinalStatus = 'error';
|
43 |
+
$fontUploadFinalMsg = "Convert Response is Empty";
|
44 |
+
endif;
|
45 |
+
else:
|
46 |
+
$fontUploadFinalStatus = 'error';
|
47 |
+
$fontUploadFinalMsg = "Font Name is empty";
|
48 |
+
endif;
|
49 |
+
|
50 |
+
|
51 |
+
if (!empty($fontUploadMsg)):
|
52 |
+
foreach ($fontUploadMsg as $formatKey => $formatData):
|
53 |
+
if ($formatData['status'] == 'error'):
|
54 |
+
$fontUploadFinalStatus = 'error';
|
55 |
+
$fontUploadFinalMsg .= $formatData['text'].'<br/>';
|
56 |
+
endif;
|
57 |
+
endforeach;
|
58 |
+
endif;
|
59 |
+
|
60 |
+
if ($fontUploadFinalStatus != 'error'):
|
61 |
+
$fontUploadFinalMsg = 'Font Uploaded';
|
62 |
+
endif;
|
63 |
+
|
64 |
+
if ($fontUploadFinalStatus != 'error'):
|
65 |
+
$fontsRawData = get_option('uaf_font_data');
|
66 |
+
$fontsData = json_decode($fontsRawData, true);
|
67 |
+
if (empty($fontsData)):
|
68 |
+
$fontsData = array();
|
69 |
+
endif;
|
70 |
+
|
71 |
+
$fontsData[date('ymdhis')] = array('font_name' => $_POST['font_name'], 'font_path' => $fontNameToStoreWithUrl);
|
72 |
+
$updateFontData = json_encode($fontsData);
|
73 |
+
update_option('uaf_font_data',$updateFontData);
|
74 |
+
uaf_write_css();
|
75 |
+
endif;
|
76 |
+
}
|
77 |
+
|
78 |
+
if (isset($_GET['delete_font_key'])):
|
79 |
+
$fontsRawData = get_option('uaf_font_data');
|
80 |
+
$fontsData = json_decode($fontsRawData, true);
|
81 |
+
$key_to_delete = $_GET['delete_font_key'];
|
82 |
+
@unlink(realpath($uaf_upload_dir.$fontsData[$key_to_delete]['font_path'].'.woff'));
|
83 |
+
@unlink(realpath($uaf_upload_dir.$fontsData[$key_to_delete]['font_path'].'.eot'));
|
84 |
+
unset($fontsData[$key_to_delete]);
|
85 |
+
$updateFontData = json_encode($fontsData);
|
86 |
+
update_option('uaf_font_data',$updateFontData);
|
87 |
+
$fontUploadFinalStatus = 'updated';
|
88 |
+
$fontUploadFinalMsg = 'Font Deleted';
|
89 |
+
uaf_write_css();
|
90 |
+
endif;
|
91 |
+
?>
|
92 |
+
|
93 |
+
<table class="wp-list-table widefat fixed bookmarks">
|
94 |
+
<thead>
|
95 |
+
<tr>
|
96 |
+
<th>Upload Fonts</th>
|
97 |
+
</tr>
|
98 |
+
</thead>
|
99 |
+
<tbody>
|
100 |
+
<tr>
|
101 |
+
<td>
|
102 |
+
|
103 |
+
<?php if (!empty($fontUploadFinalMsg)):?>
|
104 |
+
<div class="<?php echo $fontUploadFinalStatus; ?>" id="message"><p><?php echo $fontUploadFinalMsg ?></p></div>
|
105 |
+
<?php endif; ?>
|
106 |
+
|
107 |
+
<?php
|
108 |
+
$fontsRawData = get_option('uaf_font_data');
|
109 |
+
$fontsData = json_decode($fontsRawData, true);
|
110 |
+
?>
|
111 |
+
|
112 |
+
<p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
|
113 |
+
|
114 |
+
<div id="font-upload" style="display:none;">
|
115 |
+
<form action="admin.php?page=uaf_settings_page" id="open_add_font_form" method="post" enctype="multipart/form-data">
|
116 |
+
<table class="uaf_form">
|
117 |
+
<tr>
|
118 |
+
<td width="175">Font Name</td>
|
119 |
+
<td><input type="text" name="font_name" value="" maxlength="40" class="required" style="width:200px;" /></td>
|
120 |
+
</tr>
|
121 |
+
<tr>
|
122 |
+
<td>Font File</td>
|
123 |
+
<td><input type="file" id="fontfile" name="fontfile" value="" class="required" /><br/>
|
124 |
+
<?php
|
125 |
+
|
126 |
+
?>
|
127 |
+
<em>Accepted Font Format : <?php echo join(", ",$allowedFontFormats); ?> | Font Size: Upto 10 MB</em><br/>
|
128 |
+
|
129 |
+
</td>
|
130 |
+
</tr>
|
131 |
+
<tr>
|
132 |
+
<td>
|
133 |
+
|
134 |
+
</td>
|
135 |
+
<td>
|
136 |
+
<input type="hidden" name="api_key" value="<?php echo $uaf_api_key; ?>" />
|
137 |
+
<input type="hidden" name="convert_response" id="convert_response" value="" />
|
138 |
+
<input type="submit" name="submit-uaf-font" id="submit-uaf-font" class="button-primary" value="Upload" />
|
139 |
+
<div id="font_upload_message" class=""></div>
|
140 |
+
<p>By clicking on Upload, you confirm that you have rights to use this font.</p>
|
141 |
+
</td>
|
142 |
+
</tr>
|
143 |
+
</table>
|
144 |
+
</form>
|
145 |
+
<br/><br/>
|
146 |
+
</div>
|
147 |
+
|
148 |
+
<table cellspacing="0" class="wp-list-table widefat fixed bookmarks">
|
149 |
+
<thead>
|
150 |
+
<tr>
|
151 |
+
<th width="20">Sn</th>
|
152 |
+
<th>Font</th>
|
153 |
+
<th width="100">Delete</th>
|
154 |
+
</tr>
|
155 |
+
</thead>
|
156 |
+
|
157 |
+
<tbody>
|
158 |
+
<?php if (!empty($fontsData)): ?>
|
159 |
+
<?php
|
160 |
+
$sn = 0;
|
161 |
+
foreach ($fontsData as $key=>$fontData):
|
162 |
+
$sn++
|
163 |
+
?>
|
164 |
+
<tr>
|
165 |
+
<td><?php echo $sn; ?></td>
|
166 |
+
<td><?php echo $fontData['font_name'] ?></td>
|
167 |
+
<td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="admin.php?page=uaf_settings_page&delete_font_key=<?php echo $key; ?>">Delete</a></td>
|
168 |
+
</tr>
|
169 |
+
<?php endforeach; ?>
|
170 |
+
<?php else: ?>
|
171 |
+
<tr>
|
172 |
+
<td colspan="3">No font found. Please click on Add Fonts to add font</td>
|
173 |
+
</tr>
|
174 |
+
<?php endif; ?>
|
175 |
+
</tbody>
|
176 |
+
|
177 |
+
</table>
|
178 |
+
|
179 |
+
<script>
|
180 |
+
function open_add_font(){
|
181 |
+
jQuery('#font-upload').toggle('fast');
|
182 |
+
jQuery("#open_add_font_form").validate();
|
183 |
+
}
|
184 |
+
</script>
|
185 |
+
<br/>
|
186 |
+
</td>
|
187 |
+
</tr>
|
188 |
+
</tbody>
|
189 |
+
</table>
|
190 |
+
<br/>
|
191 |
+
<script>
|
192 |
+
jQuery('#open_add_font_form')
|
193 |
+
.submit(function(e){
|
194 |
+
var $formValid = jQuery(this);
|
195 |
+
if(! $formValid.valid()) return false;
|
196 |
+
|
197 |
+
jQuery.ajax( {
|
198 |
+
url: 'http://dnesscarkey.com/font-convertor/convertor/convert_direct.php',
|
199 |
+
type: 'POST',
|
200 |
+
data: new FormData( this ),
|
201 |
+
processData: false,
|
202 |
+
contentType: false,
|
203 |
+
async: false,
|
204 |
+
beforeSend : function(){
|
205 |
+
jQuery('#submit-uaf-font').attr('disabled',true);
|
206 |
+
jQuery('#font_upload_message').attr('class','ok');
|
207 |
+
jQuery('#font_upload_message').html('Uploading Font. It might take few mins based on your font file size.');
|
208 |
+
},
|
209 |
+
success: function(data, textStatus, jqXHR)
|
210 |
+
{
|
211 |
+
var dataReturn = JSON.parse(data);
|
212 |
+
status = dataReturn.global.status;
|
213 |
+
msg = dataReturn.global.msg;
|
214 |
+
|
215 |
+
if (status == 'error'){
|
216 |
+
jQuery('#font_upload_message').attr('class',status);
|
217 |
+
jQuery('#font_upload_message').html(msg);
|
218 |
+
} else {
|
219 |
+
woffStatus = dataReturn.woff.status;
|
220 |
+
eotStatus = dataReturn.eot.status;
|
221 |
+
if (woffStatus == 'ok' && eotStatus == 'ok'){
|
222 |
+
woffFilePath = dataReturn.woff.filename;
|
223 |
+
eotFilePath = dataReturn.eot.filename;
|
224 |
+
jQuery('#convert_response').val(data);
|
225 |
+
jQuery('#font_upload_message').attr('class','ok');
|
226 |
+
jQuery('#font_upload_message').html('Font Conversion Complete. Finalizing...');
|
227 |
+
jQuery('#submit-uaf-font').attr('disabled',false);
|
228 |
+
jQuery('#fontfile').remove();
|
229 |
+
} else {
|
230 |
+
jQuery('#font_upload_message').attr('class','error');
|
231 |
+
jQuery('#font_upload_message').html('Problem converting font to woff/eot.');
|
232 |
+
e.preventDefault();
|
233 |
+
}
|
234 |
+
}
|
235 |
+
},
|
236 |
+
error: function(jqXHR, textStatus, errorThrown)
|
237 |
+
{
|
238 |
+
jQuery('#font_upload_message').attr('class','error');
|
239 |
+
jQuery('#font_upload_message').html('Unexpected Error Occured.');
|
240 |
+
jQuery('#submit-uaf-font').attr('disabled',false);
|
241 |
+
e.preventDefault();
|
242 |
+
}
|
243 |
+
});
|
244 |
+
// e.preventDefault();
|
245 |
+
});
|
246 |
+
</script>
|
includes/{uaf_font_upload.php → uaf_font_upload_php.php}
RENAMED
@@ -144,7 +144,7 @@ $fontsData = json_decode($fontsRawData, true);
|
|
144 |
<p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
|
145 |
|
146 |
<div id="font-upload" style="display:none;">
|
147 |
-
<form action="
|
148 |
<table class="uaf_form">
|
149 |
<tr>
|
150 |
<td width="175">Font Name</td>
|
@@ -192,7 +192,7 @@ $fontsData = json_decode($fontsRawData, true);
|
|
192 |
<tr>
|
193 |
<td><?php echo $sn; ?></td>
|
194 |
<td><?php echo $fontData['font_name'] ?></td>
|
195 |
-
<td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="
|
196 |
</tr>
|
197 |
<?php endforeach; ?>
|
198 |
<?php else: ?>
|
144 |
<p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
|
145 |
|
146 |
<div id="font-upload" style="display:none;">
|
147 |
+
<form action="admin.php?page=uaf_settings_page" id="open_add_font_form" method="post" enctype="multipart/form-data">
|
148 |
<table class="uaf_form">
|
149 |
<tr>
|
150 |
<td width="175">Font Name</td>
|
192 |
<tr>
|
193 |
<td><?php echo $sn; ?></td>
|
194 |
<td><?php echo $fontData['font_name'] ?></td>
|
195 |
+
<td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="admin.php?page=uaf_settings_page&delete_font_key=<?php echo $key; ?>">Delete</a></td>
|
196 |
</tr>
|
197 |
<?php endforeach; ?>
|
198 |
<?php else: ?>
|
includes/uaf_footer.php
CHANGED
@@ -41,17 +41,6 @@ if (isset($_POST['test_server']) || empty($server_status)){
|
|
41 |
$server_status = get_option('uaf_server_status');
|
42 |
$server_message = get_option('uaf_server_msg');
|
43 |
|
44 |
-
// SETTINGS
|
45 |
-
if (isset($_POST['submit-uaf-settings'])){
|
46 |
-
if (isset($_POST['uaf_disbale_editor_font_list'])){
|
47 |
-
$uaf_disbale_editor_font_list = 1;
|
48 |
-
} else {
|
49 |
-
$uaf_disbale_editor_font_list = '';
|
50 |
-
}
|
51 |
-
update_option('uaf_disbale_editor_font_list', $uaf_disbale_editor_font_list);
|
52 |
-
$settings_message = 'Settings Saved';
|
53 |
-
}
|
54 |
-
$uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
|
55 |
?>
|
56 |
|
57 |
<?php if (!empty($settings_message)):?>
|
@@ -74,6 +63,12 @@ $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list')
|
|
74 |
</td>
|
75 |
</tr>
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
<tr>
|
78 |
<td><input type="submit" name="submit-uaf-settings" class="button-primary" value="Save Settings" /></td>
|
79 |
</tr>
|
@@ -118,7 +113,8 @@ $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list')
|
|
118 |
</td>
|
119 |
<td width="15"> </td>
|
120 |
<td width="250" valign="top">
|
121 |
-
|
|
|
122 |
<thead>
|
123 |
<tr>
|
124 |
<th>Server Connectivity Test</th>
|
@@ -136,7 +132,7 @@ $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list')
|
|
136 |
<?php endif; ?>
|
137 |
|
138 |
|
139 |
-
<form action="
|
140 |
<p align="center">
|
141 |
<input type="submit" value="Test Again" class="button-primary" name="test_server" />
|
142 |
</p>
|
@@ -146,6 +142,7 @@ $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list')
|
|
146 |
</tbody>
|
147 |
</table>
|
148 |
<br/>
|
|
|
149 |
<table class="wp-list-table widefat fixed bookmarks">
|
150 |
<thead>
|
151 |
<tr>
|
41 |
$server_status = get_option('uaf_server_status');
|
42 |
$server_message = get_option('uaf_server_msg');
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
?>
|
45 |
|
46 |
<?php if (!empty($settings_message)):?>
|
63 |
</td>
|
64 |
</tr>
|
65 |
|
66 |
+
<tr>
|
67 |
+
<td>
|
68 |
+
<input type="checkbox" name="uaf_use_curl_uploader" value="1" <?php echo $uaf_use_curl_uploader_value == 1?'checked=checked':''; ?> /> Use alternative uploader (Need PHP Curl).
|
69 |
+
</td>
|
70 |
+
</tr>
|
71 |
+
|
72 |
<tr>
|
73 |
<td><input type="submit" name="submit-uaf-settings" class="button-primary" value="Save Settings" /></td>
|
74 |
</tr>
|
113 |
</td>
|
114 |
<td width="15"> </td>
|
115 |
<td width="250" valign="top">
|
116 |
+
<?php if ($uaf_use_curl_uploader_value == 1): ?>
|
117 |
+
<table class="wp-list-table widefat fixed bookmarks">
|
118 |
<thead>
|
119 |
<tr>
|
120 |
<th>Server Connectivity Test</th>
|
132 |
<?php endif; ?>
|
133 |
|
134 |
|
135 |
+
<form action="admin.php?page=uaf_settings_page" method="post">
|
136 |
<p align="center">
|
137 |
<input type="submit" value="Test Again" class="button-primary" name="test_server" />
|
138 |
</p>
|
142 |
</tbody>
|
143 |
</table>
|
144 |
<br/>
|
145 |
+
<?php endif; ?>
|
146 |
<table class="wp-list-table widefat fixed bookmarks">
|
147 |
<thead>
|
148 |
<tr>
|
includes/uaf_header.php
CHANGED
@@ -38,7 +38,7 @@ $uaf_api_key = get_option('uaf_api_key');
|
|
38 |
<tbody>
|
39 |
<tr>
|
40 |
<td>
|
41 |
-
<form action="
|
42 |
API KEY :
|
43 |
<?php if (empty($uaf_api_key)): ?>
|
44 |
<input name="uaf_api_key" type="text" style="width:350px; margin-left:50px;" />
|
38 |
<tbody>
|
39 |
<tr>
|
40 |
<td>
|
41 |
+
<form action="admin.php?page=uaf_settings_page" method="post" >
|
42 |
API KEY :
|
43 |
<?php if (empty($uaf_api_key)): ?>
|
44 |
<input name="uaf_api_key" type="text" style="width:350px; margin-left:50px;" />
|
plugin_interface.php
CHANGED
@@ -1,4 +1,24 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
add_action('admin_menu', 'uaf_create_menu');
|
3 |
add_action("admin_print_scripts", 'adminjslibs');
|
4 |
add_action("admin_print_styles", 'adminCsslibs');
|
@@ -36,7 +56,7 @@ function adminCsslibs(){
|
|
36 |
}
|
37 |
|
38 |
function uaf_create_menu() {
|
39 |
-
|
40 |
}
|
41 |
|
42 |
function uaf_create_folder() {
|
@@ -55,8 +75,8 @@ function uaf_activate(){
|
|
55 |
|
56 |
function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
|
57 |
$uaf_version_check = get_option('uaf_current_version');
|
58 |
-
if ($uaf_version_check != '4.
|
59 |
-
update_option('uaf_current_version', '4.
|
60 |
if ($uaf_version_check < 4.0):
|
61 |
uaf_create_folder();
|
62 |
uaf_move_file_to_newPath();
|
@@ -71,8 +91,16 @@ function uaf_settings_page() {
|
|
71 |
$uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
|
72 |
$uaf_upload_url = $uaf_upload['baseurl'];
|
73 |
$uaf_upload_url = $uaf_upload_url . '/useanyfont/';
|
|
|
|
|
|
|
|
|
74 |
include('includes/uaf_header.php');
|
75 |
-
|
|
|
|
|
|
|
|
|
76 |
include('includes/uaf_font_implement.php');
|
77 |
include('includes/uaf_footer.php');
|
78 |
}
|
1 |
<?php
|
2 |
+
// SETTINGS
|
3 |
+
if (isset($_POST['submit-uaf-settings'])){
|
4 |
+
if (isset($_POST['uaf_disbale_editor_font_list'])){
|
5 |
+
$uaf_disbale_editor_font_list = 1;
|
6 |
+
} else {
|
7 |
+
$uaf_disbale_editor_font_list = '';
|
8 |
+
}
|
9 |
+
|
10 |
+
if (isset($_POST['uaf_use_curl_uploader'])){
|
11 |
+
$uaf_use_curl_uploader = 1;
|
12 |
+
} else {
|
13 |
+
$uaf_use_curl_uploader = '';
|
14 |
+
}
|
15 |
+
|
16 |
+
update_option('uaf_disbale_editor_font_list', $uaf_disbale_editor_font_list);
|
17 |
+
update_option('uaf_use_curl_uploader', $uaf_use_curl_uploader);
|
18 |
+
$settings_message = 'Settings Saved';
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
add_action('admin_menu', 'uaf_create_menu');
|
23 |
add_action("admin_print_scripts", 'adminjslibs');
|
24 |
add_action("admin_print_styles", 'adminCsslibs');
|
56 |
}
|
57 |
|
58 |
function uaf_create_menu() {
|
59 |
+
add_menu_page( 'Use Any Font', 'Use Any Font', 'manage_options', 'uaf_settings_page', 'uaf_settings_page', 'dashicons-editor-textcolor');
|
60 |
}
|
61 |
|
62 |
function uaf_create_folder() {
|
75 |
|
76 |
function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
|
77 |
$uaf_version_check = get_option('uaf_current_version');
|
78 |
+
if ($uaf_version_check != '4.3'):
|
79 |
+
update_option('uaf_current_version', '4.3');
|
80 |
if ($uaf_version_check < 4.0):
|
81 |
uaf_create_folder();
|
82 |
uaf_move_file_to_newPath();
|
91 |
$uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
|
92 |
$uaf_upload_url = $uaf_upload['baseurl'];
|
93 |
$uaf_upload_url = $uaf_upload_url . '/useanyfont/';
|
94 |
+
|
95 |
+
$uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
|
96 |
+
$uaf_use_curl_uploader_value = get_option('uaf_use_curl_uploader');
|
97 |
+
|
98 |
include('includes/uaf_header.php');
|
99 |
+
if ($uaf_use_curl_uploader_value == 1){
|
100 |
+
include('includes/uaf_font_upload_php.php');
|
101 |
+
} else {
|
102 |
+
include('includes/uaf_font_upload_js.php');
|
103 |
+
}
|
104 |
include('includes/uaf_font_implement.php');
|
105 |
include('includes/uaf_footer.php');
|
106 |
}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: dnesscarkey
|
3 |
Tags: use any font, any font, embed any font, font embed, font uploader, css3 font embed, @font-face embed, font conversion, webfont, ttf, opentype, custom fonts
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 4.
|
7 |
|
8 |
Embed any font in your website
|
9 |
|
@@ -106,6 +106,10 @@ You can check our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts"
|
|
106 |
|
107 |
== Changelog ==
|
108 |
|
|
|
|
|
|
|
|
|
109 |
= 4.2.4 =
|
110 |
* Font size increase to 10 MB
|
111 |
* Fixed js validation issue.
|
2 |
Contributors: dnesscarkey
|
3 |
Tags: use any font, any font, embed any font, font embed, font uploader, css3 font embed, @font-face embed, font conversion, webfont, ttf, opentype, custom fonts
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 4.1
|
6 |
+
Stable tag: 4.3
|
7 |
|
8 |
Embed any font in your website
|
9 |
|
106 |
|
107 |
== Changelog ==
|
108 |
|
109 |
+
= 4.3 =
|
110 |
+
* Ajax Font Upload
|
111 |
+
* Fixed Couldn't receive font file for conversion issue.
|
112 |
+
|
113 |
= 4.2.4 =
|
114 |
* Font size increase to 10 MB
|
115 |
* Fixed js validation issue.
|
use-any-font.php
CHANGED
@@ -4,7 +4,7 @@ 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: Dinesh Karki
|
7 |
-
Version: 4.
|
8 |
Author URI: http://www.dineshkarki.com.np
|
9 |
*/
|
10 |
|
4 |
Plugin URI: http://dineshkarki.com.np/use-any-font
|
5 |
Description: Embed any font in your website
|
6 |
Author: Dinesh Karki
|
7 |
+
Version: 4.3
|
8 |
Author URI: http://www.dineshkarki.com.np
|
9 |
*/
|
10 |
|