Use Any Font - Version 4.3.2

Version Description

  • Added relative font path settings.
  • Added Css version system.
Download this release

Release Info

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

Code changes from version 4.3.1 to 4.3.2

includes/uaf_font_upload_js.php CHANGED
@@ -40,7 +40,7 @@ if (isset($_POST['submit-uaf-font'])){
40
  endif;
41
  else:
42
  $fontUploadFinalStatus = 'error';
43
- $fontUploadFinalMsg = "Convert Response is Empty";
44
  endif;
45
  else:
46
  $fontUploadFinalStatus = 'error';
@@ -116,7 +116,7 @@ $fontsData = json_decode($fontsRawData, true);
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>
40
  endif;
41
  else:
42
  $fontUploadFinalStatus = 'error';
43
+ $fontUploadFinalMsg = "Convert Response is Empty. Please try again enabling alternative uploader from Additional settings below.";
44
  endif;
45
  else:
46
  $fontUploadFinalStatus = 'error';
116
  <table class="uaf_form">
117
  <tr>
118
  <td width="175">Font Name</td>
119
+ <td><input type="text" name="font_name" value="" maxlength="20" class="required" style="width:200px;" /></td>
120
  </tr>
121
  <tr>
122
  <td>Font File</td>
includes/uaf_font_upload_php.php CHANGED
@@ -148,7 +148,7 @@ $fontsData = json_decode($fontsRawData, true);
148
  <table class="uaf_form">
149
  <tr>
150
  <td width="175">Font Name</td>
151
- <td><input type="text" name="font_name" value="" maxlength="40" class="required" style="width:200px;" /></td>
152
  </tr>
153
  <tr>
154
  <td>Font File</td>
148
  <table class="uaf_form">
149
  <tr>
150
  <td width="175">Font Name</td>
151
+ <td><input type="text" name="font_name" value="" maxlength="20" class="required" style="width:200px;" /></td>
152
  </tr>
153
  <tr>
154
  <td>Font File</td>
includes/uaf_footer.php CHANGED
@@ -69,6 +69,12 @@ $server_message = get_option('uaf_server_msg');
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>
@@ -153,11 +159,11 @@ $server_message = get_option('uaf_server_msg');
153
  <tr>
154
  <td>
155
  <ul class="uaf_list">
156
- <li><a href="http://dineshkarki.com.np/use-any-font/instructions" target="_blank">View Setup Instructions</a></li>
157
- <li><a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">View Support Forum</a></li>
158
- <li><a href="http://dineshkarki.com.np/rectify-my-problem" target="_blank">Rectify My Problem</a></li>
159
- <li><a href="http://dineshkarki.com.np/use-any-font/use-any-font-known-issues" target="_blank">Check Known Issues</a></li>
160
- <li><a href="http://dineshkarki.com.np/contact" target="_blank">Contact Us</a></li>
161
  </ul>
162
  </td>
163
  </tr>
69
  </td>
70
  </tr>
71
 
72
+ <tr>
73
+ <td>
74
+ <input type="checkbox" name="uaf_use_relative_font_path" value="1" <?php echo $uaf_use_relative_font_path == 1?'checked=checked':''; ?> /> Use relative path for font (Needed when you have domain mapping).
75
+ </td>
76
+ </tr>
77
+
78
  <tr>
79
  <td><input type="submit" name="submit-uaf-settings" class="button-primary" value="Save Settings" /></td>
80
  </tr>
159
  <tr>
160
  <td>
161
  <ul class="uaf_list">
162
+ <li><a href="http://goo.gl/NYtZsX" target="_blank">Setup Instructions</a></li>
163
+ <li><a href="http://goo.gl/FcC7EL" target="_blank">Quick Virtual Support</a></li>
164
+ <li><a href="http://goo.gl/XgEqzn" target="_blank">Support Forum</a></li>
165
+ <li><a href="http://goo.gl/MKg7VS" target="_blank">Rectify My Problem</a></li>
166
+ <li><a href="http://goo.gl/Id7yAo" target="_blank">Contact Us</a></li>
167
  </ul>
168
  </td>
169
  </tr>
plugin_interface.php CHANGED
@@ -13,9 +13,18 @@ if (isset($_POST['submit-uaf-settings'])){
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
 
@@ -35,7 +44,7 @@ function uaf_client_css() {
35
  $uaf_upload = wp_upload_dir();
36
  $uaf_upload_url = $uaf_upload['baseurl'];
37
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
38
- wp_register_style( 'uaf_client_css', $uaf_upload_url.'uaf.css');
39
  wp_enqueue_style( 'uaf_client_css' );
40
  }
41
 
@@ -50,7 +59,7 @@ function adminCsslibs(){
50
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
51
  wp_register_style('uaf-admin-style', plugins_url('use-any-font/css/uaf_admin.css'));
52
  wp_enqueue_style('uaf-admin-style');
53
- wp_register_style('uaf-font-style', $uaf_upload_url.'admin-uaf.css');
54
  wp_enqueue_style('uaf-font-style');
55
  add_editor_style($uaf_upload_url.'admin-uaf.css');
56
  }
@@ -75,8 +84,8 @@ function uaf_activate(){
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.1'):
79
- update_option('uaf_current_version', '4.3.1');
80
  if ($uaf_version_check < 4.0):
81
  uaf_create_folder();
82
  uaf_move_file_to_newPath();
@@ -94,6 +103,7 @@ function uaf_settings_page() {
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){
@@ -143,6 +153,8 @@ function uaf_move_file_to_newPath(){
143
  }
144
 
145
  function uaf_write_css(){
 
 
146
  $uaf_upload = wp_upload_dir();
147
  $uaf_upload_dir = $uaf_upload['basedir'];
148
  $uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
@@ -150,6 +162,11 @@ function uaf_write_css(){
150
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
151
  $uaf_upload_url = preg_replace('#^https?:#', '', $uaf_upload_url);
152
 
 
 
 
 
 
153
  ob_start();
154
  $fontsRawData = get_option('uaf_font_data');
155
  $fontsData = json_decode($fontsRawData, true);
@@ -202,6 +219,7 @@ function uaf_write_css(){
202
  fwrite($fh, $uaf_style);
203
  fclose($fh);
204
  ob_end_clean();
 
205
  }
206
 
207
  include('includes/uaf_editor_setup.php');
13
  $uaf_use_curl_uploader = '';
14
  }
15
 
16
+ if (isset($_POST['uaf_use_relative_font_path'])){
17
+ $uaf_use_relative_font_path = 1;
18
+ } else {
19
+ $uaf_use_relative_font_path = '';
20
+ }
21
+
22
  update_option('uaf_disbale_editor_font_list', $uaf_disbale_editor_font_list);
23
  update_option('uaf_use_curl_uploader', $uaf_use_curl_uploader);
24
+ update_option('uaf_use_relative_font_path', $uaf_use_relative_font_path);
25
  $settings_message = 'Settings Saved';
26
+
27
+ uaf_write_css(); // Need to rewrite css for uaf_use_relative_font_path setting change
28
  }
29
 
30
 
44
  $uaf_upload = wp_upload_dir();
45
  $uaf_upload_url = $uaf_upload['baseurl'];
46
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
47
+ wp_register_style( 'uaf_client_css', $uaf_upload_url.'uaf.css', array(),get_option('uaf_css_updated_timestamp'));
48
  wp_enqueue_style( 'uaf_client_css' );
49
  }
50
 
59
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
60
  wp_register_style('uaf-admin-style', plugins_url('use-any-font/css/uaf_admin.css'));
61
  wp_enqueue_style('uaf-admin-style');
62
+ wp_register_style('uaf-font-style', $uaf_upload_url.'admin-uaf.css', array(), get_option('uaf_css_updated_timestamp'));
63
  wp_enqueue_style('uaf-font-style');
64
  add_editor_style($uaf_upload_url.'admin-uaf.css');
65
  }
84
 
85
  function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
86
  $uaf_version_check = get_option('uaf_current_version');
87
+ if ($uaf_version_check != '4.3.2'):
88
+ update_option('uaf_current_version', '4.3.2');
89
  if ($uaf_version_check < 4.0):
90
  uaf_create_folder();
91
  uaf_move_file_to_newPath();
103
 
104
  $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
105
  $uaf_use_curl_uploader_value = get_option('uaf_use_curl_uploader');
106
+ $uaf_use_relative_font_path = get_option('uaf_use_relative_font_path');
107
 
108
  include('includes/uaf_header.php');
109
  if ($uaf_use_curl_uploader_value == 1){
153
  }
154
 
155
  function uaf_write_css(){
156
+ $uaf_use_relative_font_path = get_option('uaf_use_relative_font_path'); // Check if user want to use relative font path.
157
+
158
  $uaf_upload = wp_upload_dir();
159
  $uaf_upload_dir = $uaf_upload['basedir'];
160
  $uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
162
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
163
  $uaf_upload_url = preg_replace('#^https?:#', '', $uaf_upload_url);
164
 
165
+ if ($uaf_use_relative_font_path == 1){ // If user use relative path
166
+ $url_parts = parse_url($uaf_upload_url);
167
+ $uaf_upload_url = "$url_parts[path]$url_parts[query]$url_parts[fragment]";
168
+ }
169
+
170
  ob_start();
171
  $fontsRawData = get_option('uaf_font_data');
172
  $fontsData = json_decode($fontsRawData, true);
219
  fwrite($fh, $uaf_style);
220
  fclose($fh);
221
  ob_end_clean();
222
+ update_option('uaf_css_updated_timestamp', time()); // Time entry for stylesheet version
223
  }
224
 
225
  include('includes/uaf_editor_setup.php');
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.1.1
6
- Stable tag: 4.3.1
7
 
8
  Embed any font in your website
9
 
@@ -31,7 +31,10 @@ Features
31
 
32
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
33
 
34
- Offer your contribution (Free, $10 to $100) and get the API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>.
 
 
 
35
 
36
  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 conversion is done.
37
 
@@ -106,6 +109,10 @@ You can check our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts"
106
 
107
  == Changelog ==
108
 
 
 
 
 
109
  = 4.3.1 =
110
  * Add js extension validation for font file.
111
 
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.2.2
6
+ Stable tag: 4.3.2
7
 
8
  Embed any font in your website
9
 
31
 
32
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
33
 
34
+ Offer your contribution (Free for 1 font, $10 to $100) and get the API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>.
35
+
36
+ <strong>Installation Video</strong>
37
+ [youtube http://www.youtube.com/watch?v=QzGaWIPVwEk]
38
 
39
  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 conversion is done.
40
 
109
 
110
  == Changelog ==
111
 
112
+ = 4.3.2 =
113
+ * Added relative font path settings.
114
+ * Added Css version system.
115
+
116
  = 4.3.1 =
117
  * Add js extension validation for font file.
118
 
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.3.1
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.2
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10