Use Any Font - Version 4.7

Version Description

  • Full Support For Divi Admin Visual Builder
  • Use of relative path as default nowonwards
  • Alternative server selection for font upload and API verification.
Download this release

Release Info

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

Code changes from version 4.6 to 4.7

includes/uaf_font_implement.php CHANGED
@@ -43,7 +43,7 @@ endif;
43
  <table class="wp-list-table widefat fixed bookmarks">
44
  <thead>
45
  <tr>
46
- <th>Assign Font</th>
47
  </tr>
48
  </thead>
49
  <tbody>
43
  <table class="wp-list-table widefat fixed bookmarks">
44
  <thead>
45
  <tr>
46
+ <th><strong>Assign Font</strong></th>
47
  </tr>
48
  </thead>
49
  <tbody>
includes/uaf_font_upload_js.php CHANGED
@@ -93,7 +93,7 @@ endif;
93
  <table class="wp-list-table widefat fixed bookmarks">
94
  <thead>
95
  <tr>
96
- <th>Upload Fonts</th>
97
  </tr>
98
  </thead>
99
  <tbody>
@@ -196,7 +196,7 @@ jQuery('#open_add_font_form')
196
  if(! $formValid.valid()) return false;
197
 
198
  jQuery.ajax( {
199
- url: 'https://dnesscarkey.xyz/font-convertor/convertor/convert.php',
200
  type: 'POST',
201
  data: new FormData( this ),
202
  processData: false,
93
  <table class="wp-list-table widefat fixed bookmarks">
94
  <thead>
95
  <tr>
96
+ <th><strong>Upload Fonts</strong></th>
97
  </tr>
98
  </thead>
99
  <tbody>
196
  if(! $formValid.valid()) return false;
197
 
198
  jQuery.ajax( {
199
+ url: '<?php echo $uaf_font_convert_server_url; ?>/font-convertor/convertor/convert.php',
200
  type: 'POST',
201
  data: new FormData( this ),
202
  processData: false,
includes/uaf_font_upload_php.php CHANGED
@@ -26,7 +26,7 @@ if (isset($_POST['submit-uaf-font'])){
26
  @set_time_limit(0);
27
  $ch = curl_init();
28
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
29
- curl_setopt($ch, CURLOPT_URL, 'http://dnesscarkey.xyz/font-convertor/convertor/convert.php');
30
  curl_setopt($ch, CURLOPT_POST, true);
31
  $post = array(
32
  'fontfile' => "@".$_FILES['font_file']['tmp_name'],
@@ -126,7 +126,7 @@ endif;
126
  <table class="wp-list-table widefat fixed bookmarks">
127
  <thead>
128
  <tr>
129
- <th>Upload Fonts</th>
130
  </tr>
131
  </thead>
132
  <tbody>
26
  @set_time_limit(0);
27
  $ch = curl_init();
28
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
29
+ curl_setopt($ch, CURLOPT_URL, $uaf_font_convert_server_url.'/font-convertor/convertor/convert.php');
30
  curl_setopt($ch, CURLOPT_POST, true);
31
  $post = array(
32
  'fontfile' => "@".$_FILES['font_file']['tmp_name'],
126
  <table class="wp-list-table widefat fixed bookmarks">
127
  <thead>
128
  <tr>
129
+ <th><strong>Upload Fonts</strong></th>
130
  </tr>
131
  </thead>
132
  <tbody>
includes/uaf_footer.php CHANGED
@@ -5,7 +5,7 @@ if (isset($_POST['test_server']) || empty($server_status)){
5
  $test_code = date('ymdhis');
6
  $ch_test = curl_init();
7
  curl_setopt($ch_test, CURLOPT_RETURNTRANSFER, true);
8
- curl_setopt($ch_test, CURLOPT_URL, 'http://dnesscarkey.xyz/font-convertor/server/check.php');
9
  curl_setopt($ch_test, CURLOPT_POST, true);
10
  $post = array(
11
  'test_code' => $test_code
@@ -52,29 +52,39 @@ $server_message = get_option('uaf_server_msg');
52
  <table class="wp-list-table widefat fixed bookmarks">
53
  <thead>
54
  <tr>
55
- <th>Additional Settings (Usually not required)</th>
56
  </tr>
57
  </thead>
58
  <tbody>
59
  <form method="post" action="">
60
  <tr>
61
  <td>
62
- <input type="checkbox" name="uaf_disbale_editor_font_list" value="1" <?php echo $uaf_disbale_editor_font_list_value == 1?'checked=checked':''; ?> /> Disable Font list in wordpress editor.
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>
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>
@@ -87,7 +97,7 @@ $server_message = get_option('uaf_server_msg');
87
  <table class="wp-list-table widefat fixed bookmarks">
88
  <thead>
89
  <tr>
90
- <th>Instructions</th>
91
  </tr>
92
  </thead>
93
  <tbody>
5
  $test_code = date('ymdhis');
6
  $ch_test = curl_init();
7
  curl_setopt($ch_test, CURLOPT_RETURNTRANSFER, true);
8
+ curl_setopt($ch_test, CURLOPT_URL, $uaf_font_convert_server_url.'/font-convertor/server/check.php');
9
  curl_setopt($ch_test, CURLOPT_POST, true);
10
  $post = array(
11
  'test_code' => $test_code
52
  <table class="wp-list-table widefat fixed bookmarks">
53
  <thead>
54
  <tr>
55
+ <th><strong>Additional Settings (Usually not required)</strong></th>
56
  </tr>
57
  </thead>
58
  <tbody>
59
  <form method="post" action="">
60
  <tr>
61
  <td>
62
+ <input type="checkbox" name="uaf_use_alternative_server" value="1" <?php echo $uaf_use_alternative_server == 1?'checked=checked':''; ?> /> Use alternative server. <em>Only use when you are unable to upload the font using both Default Js and PHP Uploader or verify API key.</em>
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 PHP uploader. <em>Need PHP Curl.</em>
69
  </td>
70
  </tr>
71
 
72
  <tr>
73
  <td>
74
+ <input type="checkbox" name="uaf_use_absolute_font_path" value="1" <?php echo $uaf_use_absolute_font_path == 1?'checked=checked':''; ?> /> Use absolute path for font.
75
  </td>
76
  </tr>
77
 
78
+ <tr>
79
+ <td>
80
+ <input type="checkbox" name="uaf_disbale_editor_font_list" value="1" <?php echo $uaf_disbale_editor_font_list_value == 1?'checked=checked':''; ?> /> Disable Font list in wordpress editor. <em>When you have conflict with wordpress editor.</em>
81
+ </td>
82
+ </tr>
83
+
84
+
85
+
86
+
87
+
88
  <tr>
89
  <td><input type="submit" name="submit-uaf-settings" class="button-primary" value="Save Settings" /></td>
90
  </tr>
97
  <table class="wp-list-table widefat fixed bookmarks">
98
  <thead>
99
  <tr>
100
+ <th><strong>Instructions</strong></th>
101
  </tr>
102
  </thead>
103
  <tbody>
includes/uaf_header.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if (isset($_POST['ucf_api_key_submit'])){
3
  $uaf_api_key = trim($_POST['uaf_api_key']);
4
- $api_key_return = wp_remote_get('http://dnesscarkey.xyz/font-convertor/api/validate_key.php?license_key='.$uaf_api_key, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
5
  if ( is_wp_error( $api_key_return ) ) {
6
  $error_message = $api_key_return->get_error_message();
7
  $api_message = "Something went wrong: $error_message";
@@ -19,7 +19,7 @@ if (isset($_POST['ucf_api_key_submit'])){
19
 
20
  if (isset($_POST['ucf_api_key_remove'])){
21
  $uaf_api_key = get_option('uaf_api_key');
22
- $api_key_return = wp_remote_get('https://dnesscarkey.xyz/font-convertor/api/deactivate_key.php?license_key='.$uaf_api_key, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
23
  if ( is_wp_error( $api_key_return ) ) {
24
  $error_message = $api_key_return->get_error_message();
25
  $api_message = "Something went wrong: $error_message";
@@ -54,7 +54,7 @@ if ($uaf_api_package == 'lite'){
54
  <table class="wp-list-table widefat fixed bookmarks">
55
  <thead>
56
  <tr>
57
- <th>API KEY</th>
58
  </tr>
59
  </thead>
60
  <tbody>
1
  <?php
2
  if (isset($_POST['ucf_api_key_submit'])){
3
  $uaf_api_key = trim($_POST['uaf_api_key']);
4
+ $api_key_return = wp_remote_get($uaf_font_convert_server_url.'/font-convertor/api/validate_key.php?license_key='.$uaf_api_key, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
5
  if ( is_wp_error( $api_key_return ) ) {
6
  $error_message = $api_key_return->get_error_message();
7
  $api_message = "Something went wrong: $error_message";
19
 
20
  if (isset($_POST['ucf_api_key_remove'])){
21
  $uaf_api_key = get_option('uaf_api_key');
22
+ $api_key_return = wp_remote_get($uaf_font_convert_server_url.'/font-convertor/api/deactivate_key.php?license_key='.$uaf_api_key, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
23
  if ( is_wp_error( $api_key_return ) ) {
24
  $error_message = $api_key_return->get_error_message();
25
  $api_message = "Something went wrong: $error_message";
54
  <table class="wp-list-table widefat fixed bookmarks">
55
  <thead>
56
  <tr>
57
+ <th><strong>API KEY</strong></th>
58
  </tr>
59
  </thead>
60
  <tbody>
plugin_interface.php CHANGED
@@ -13,15 +13,22 @@ if (isset($_POST['submit-uaf-settings'])){
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
@@ -40,6 +47,23 @@ if ($uaf_disbale_editor_font_list_value != 1):
40
  add_filter('tiny_mce_before_init', 'uaf_mce_before_init' );
41
  endif;
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  function uaf_client_css() {
44
  $uaf_upload = wp_upload_dir();
45
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
@@ -84,8 +108,8 @@ function uaf_activate(){
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.6'):
88
- update_option('uaf_current_version', '4.6');
89
  if ($uaf_version_check < 4.0):
90
  uaf_create_folder();
91
  uaf_move_file_to_newPath();
@@ -103,7 +127,14 @@ function uaf_settings_page() {
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,7 +184,11 @@ function uaf_move_file_to_newPath(){
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'];
@@ -162,7 +197,7 @@ function uaf_write_css(){
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
  }
@@ -213,6 +248,9 @@ function uaf_write_css(){
213
  src: url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot');
214
  src: local('<?php echo $fontData['font_name'] ?>'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot') format('embedded-opentype'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
215
  }
 
 
 
216
  <?php
217
  endforeach;
218
  endif;
13
  $uaf_use_curl_uploader = '';
14
  }
15
 
16
+ if (isset($_POST['uaf_use_absolute_font_path'])){
17
+ $uaf_use_absolute_font_path = 1;
18
  } else {
19
+ $uaf_use_absolute_font_path = '';
20
+ }
21
+
22
+ if (isset($_POST['uaf_use_alternative_server'])){
23
+ $uaf_use_alternative_server = 1;
24
+ } else {
25
+ $uaf_use_alternative_server = '';
26
  }
27
 
28
  update_option('uaf_disbale_editor_font_list', $uaf_disbale_editor_font_list);
29
  update_option('uaf_use_curl_uploader', $uaf_use_curl_uploader);
30
+ update_option('uaf_use_absolute_font_path', $uaf_use_absolute_font_path);
31
+ update_option('uaf_use_alternative_server', $uaf_use_alternative_server);
32
  $settings_message = 'Settings Saved';
33
 
34
  uaf_write_css(); // Need to rewrite css for uaf_use_relative_font_path setting change
47
  add_filter('tiny_mce_before_init', 'uaf_mce_before_init' );
48
  endif;
49
 
50
+ // ADD FONTS to DIVI editor font List
51
+ add_filter('et_websafe_fonts', 'uaf_send_fonts_divi_list',10,2);
52
+ function uaf_send_fonts_divi_list($fonts){
53
+ $fontsRawData = get_option('uaf_font_data');
54
+ $fontsData = json_decode($fontsRawData, true);
55
+ if (!empty($fontsData)):
56
+ foreach ($fontsData as $key=>$fontData):
57
+ $fonts_uaf[$fontData['font_name']] = array(
58
+ 'styles' => '400',
59
+ 'character_set' => 'cyrillic,greek,latin',
60
+ 'type' => 'serif'
61
+ );
62
+ endforeach;
63
+ endif;
64
+ return array_merge($fonts_uaf,$fonts);
65
+ }
66
+
67
  function uaf_client_css() {
68
  $uaf_upload = wp_upload_dir();
69
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
108
 
109
  function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
110
  $uaf_version_check = get_option('uaf_current_version');
111
+ if ($uaf_version_check != '4.7'):
112
+ update_option('uaf_current_version', '4.7');
113
  if ($uaf_version_check < 4.0):
114
  uaf_create_folder();
115
  uaf_move_file_to_newPath();
127
 
128
  $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
129
  $uaf_use_curl_uploader_value = get_option('uaf_use_curl_uploader');
130
+ $uaf_use_absolute_font_path = get_option('uaf_use_absolute_font_path');
131
+ $uaf_use_alternative_server = get_option('uaf_use_alternative_server');
132
+
133
+ if ($uaf_use_alternative_server == 1){
134
+ $uaf_font_convert_server_url = 'https://dnesscarkey.com';
135
+ } else {
136
+ $uaf_font_convert_server_url = 'https://dnesscarkey.xyz';
137
+ }
138
 
139
  include('includes/uaf_header.php');
140
  if ($uaf_use_curl_uploader_value == 1){
184
  }
185
 
186
  function uaf_write_css(){
187
+ $uaf_use_absolute_font_path = get_option('uaf_use_absolute_font_path'); // Check if user want to use absolute font path.
188
+
189
+ if (empty($uaf_use_absolute_font_path)){
190
+ $uaf_use_absolute_font_path = 0;
191
+ }
192
 
193
  $uaf_upload = wp_upload_dir();
194
  $uaf_upload_dir = $uaf_upload['basedir'];
197
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
198
  $uaf_upload_url = preg_replace('#^https?:#', '', $uaf_upload_url);
199
 
200
+ if ($uaf_use_absolute_font_path == 0){ // If user use relative path
201
  $url_parts = parse_url($uaf_upload_url);
202
  $uaf_upload_url = "$url_parts[path]$url_parts[query]$url_parts[fragment]";
203
  }
248
  src: url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot');
249
  src: local('<?php echo $fontData['font_name'] ?>'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot') format('embedded-opentype'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
250
  }
251
+
252
+ .et_gf_<?php echo $fontData['font_name'] ?>{background:none !important;font-family:<?php echo $fontData['font_name'] ?>;text-indent:0 !important;font-size:25px;}
253
+
254
  <?php
255
  endforeach;
256
  endif;
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.1
6
- Stable tag: 4.6
7
 
8
  Embed any font in your website
9
 
@@ -110,6 +110,11 @@ You can check our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts"
110
 
111
  == Changelog ==
112
 
 
 
 
 
 
113
  = 4.6 =
114
  * Directly assign font to element using the class identical to font name.
115
 
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.7.3
6
+ Stable tag: 4.7
7
 
8
  Embed any font in your website
9
 
110
 
111
  == Changelog ==
112
 
113
+ = 4.7 =
114
+ * Full Support For Divi Admin Visual Builder
115
+ * Use of relative path as default nowonwards
116
+ * Alternative server selection for font upload and API verification.
117
+
118
  = 4.6 =
119
  * Directly assign font to element using the class identical to font name.
120
 
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.6
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.7
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10