Use Any Font - Version 5.0

Version Description

  • New API Key system, Lite / Test API key generation from plugin page.
Download this release

Release Info

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

Code changes from version 4.9.2 to 5.0

includes/uaf_font_upload_js.php CHANGED
@@ -133,6 +133,7 @@ $fontsData = json_decode($fontsRawData, true);
133
 
134
  </td>
135
  <td>
 
136
  <input type="hidden" name="api_key" value="<?php echo $uaf_api_key; ?>" />
137
  <input type="hidden" name="font_count" value="<?php echo count($fontsData); ?>" />
138
  <input type="hidden" name="convert_response" id="convert_response" value="" />
@@ -196,7 +197,7 @@ jQuery('#open_add_font_form')
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,
133
 
134
  </td>
135
  <td>
136
+ <input type="hidden" name="url" value="<?php echo home_url(); ?>" />
137
  <input type="hidden" name="api_key" value="<?php echo $uaf_api_key; ?>" />
138
  <input type="hidden" name="font_count" value="<?php echo count($fontsData); ?>" />
139
  <input type="hidden" name="convert_response" id="convert_response" value="" />
197
  if(! $formValid.valid()) return false;
198
 
199
  jQuery.ajax( {
200
+ url: '<?php echo $uaf_font_convert_server_url; ?>/font-convertor/convertor/edd_convert.php',
201
  type: 'POST',
202
  data: new FormData( this ),
203
  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, $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'],
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/edd_convert.php');
30
  curl_setopt($ch, CURLOPT_POST, true);
31
  $post = array(
32
  'fontfile' => "@".$_FILES['font_file']['tmp_name'],
includes/uaf_footer.php CHANGED
@@ -104,7 +104,7 @@ $server_message = get_option('uaf_server_msg');
104
  <tr>
105
  <td>
106
  <ol>
107
- <li>Get API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>. Offer your contribution (Free for 1 font, $20 to $100) and get the API key. All API key comes with lifetime validity.<br/>
108
  <em><strong>Note:</strong> API key is needed to connect to our server for font conversion.</em>
109
  </li>
110
 
104
  <tr>
105
  <td>
106
  <ol>
107
+ <li>Get the premium 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 above. <strong>Note : </strong> Lite / Test API only allow single font conversion.<br/>
108
  <em><strong>Note:</strong> API key is needed to connect to our server for font conversion.</em>
109
  </li>
110
 
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($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,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($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";
@@ -38,9 +38,6 @@ if (isset($_POST['ucf_api_key_remove'])){
38
  $uaf_api_key = get_option('uaf_api_key');
39
  $uaf_api_package = get_option('uaf_api_package');
40
  $delete_confirmation_msg = 'Are you sure ?';
41
- if ($uaf_api_package == 'lite'){
42
- $delete_confirmation_msg = "Are you sure ? Since you are using lite(Free) key, deactivating it will delete the key record from our server as well and you won\'t be able to upgrade it.";
43
- }
44
 
45
  ?>
46
  <?php if (!empty($api_message)):?>
@@ -60,13 +57,15 @@ if ($uaf_api_package == 'lite'){
60
  <tbody>
61
  <tr>
62
  <td>
63
- <form action="admin.php?page=uaf_settings_page" method="post" >
64
  API KEY :
65
  <?php if (empty($uaf_api_key)): ?>
66
- <input name="uaf_api_key" type="text" style="width:350px; margin-left:50px;" />
67
  <input type="submit" name="ucf_api_key_submit" class="button-primary" value="Verify" style="padding:2px;" />
68
- <br/> <br/>
69
- Please keep the API key to start using this plugin. Offer your contribution (Free for 1 font, $20 to $100) and get the API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>.<br/>
 
 
70
  <?php else: ?>
71
  <span class="active_key"><?php echo $uaf_api_key; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Active</span> <input type="submit" name="ucf_api_key_remove" class="button-primary" value="Remove Key" style="padding:2px; margin-left:20px;" onclick="if(!confirm('<?php echo $delete_confirmation_msg; ?>')){return false;}" />
72
  <?php endif;?>
@@ -79,4 +78,21 @@ if ($uaf_api_package == 'lite'){
79
  </tr>
80
  </tbody>
81
  </table>
82
- <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/edd_validate_key.php?license_key='.$uaf_api_key.'&url='.home_url(), 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/edd_deactivate_key.php?license_key='.$uaf_api_key.'&url='.home_url(), 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";
38
  $uaf_api_key = get_option('uaf_api_key');
39
  $uaf_api_package = get_option('uaf_api_package');
40
  $delete_confirmation_msg = 'Are you sure ?';
 
 
 
41
 
42
  ?>
43
  <?php if (!empty($api_message)):?>
57
  <tbody>
58
  <tr>
59
  <td>
60
+ <form action="admin.php?page=uaf_settings_page" method="post" id="uaf_api_key_form" >
61
  API KEY :
62
  <?php if (empty($uaf_api_key)): ?>
63
+ <input name="uaf_api_key" id="uaf_api_key" type="text" style="width:350px; margin-left:50px;" />
64
  <input type="submit" name="ucf_api_key_submit" class="button-primary" value="Verify" style="padding:2px;" />
65
+ <input type="button" name="uaf_api_key_generate" id="uaf_api_key_generate" class="button-primary" value="Generate Test API Key" style="padding:2px;" onclick="uaf_lite_api_key_generate();" />
66
+ <br/> <br/>
67
+ Use Any Font need API key to upload the font. You can get the premium 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 above. <strong>Note : </strong> Lite / Test API only allow single font conversion.
68
+ <br/>
69
  <?php else: ?>
70
  <span class="active_key"><?php echo $uaf_api_key; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Active</span> <input type="submit" name="ucf_api_key_remove" class="button-primary" value="Remove Key" style="padding:2px; margin-left:20px;" onclick="if(!confirm('<?php echo $delete_confirmation_msg; ?>')){return false;}" />
71
  <?php endif;?>
78
  </tr>
79
  </tbody>
80
  </table>
81
+ <br/>
82
+ <script>
83
+ function uaf_lite_api_key_generate(){
84
+ jQuery.ajax({url: "<?php echo $uaf_font_convert_server_url.'/font-convertor/convertor/generate_lite_key.php'; ?>",
85
+ beforeSend : function(){
86
+ jQuery('#uaf_api_key_generate').val('Generating...');
87
+ },
88
+ error: function(){
89
+ jQuery('#uaf_api_key_generate').val('Error!');
90
+ },
91
+ success: function(result){
92
+ var dataReturn = JSON.parse(result);
93
+ key = dataReturn.key;
94
+ jQuery('#uaf_api_key').val(key);
95
+ jQuery('#uaf_api_key_generate').val('Click Verify to Complete');
96
+ }});
97
+ }
98
+ </script>
plugin_interface.php CHANGED
@@ -41,6 +41,22 @@ add_action("admin_print_styles", 'adminCsslibs');
41
  add_action('wp_enqueue_scripts', 'uaf_client_css');
42
  add_action('plugins_loaded', 'uaf_update_check');
43
  add_action('init', 'uaf_editor_setup');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
46
  if ($uaf_disbale_editor_font_list_value != 1):
@@ -92,8 +108,8 @@ function uaf_activate(){
92
 
93
  function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
94
  $uaf_version_check = get_option('uaf_current_version');
95
- if ($uaf_version_check != '4.9.2'):
96
- update_option('uaf_current_version', '4.9.2');
97
  if ($uaf_version_check < 4.0):
98
  uaf_create_folder();
99
  uaf_move_file_to_newPath();
41
  add_action('wp_enqueue_scripts', 'uaf_client_css');
42
  add_action('plugins_loaded', 'uaf_update_check');
43
  add_action('init', 'uaf_editor_setup');
44
+ add_action('admin_notices', 'uaf_api_notification');
45
+
46
+ if (isset($_GET['uaf_api_notification_hide']) == 1){
47
+ update_option('uaf_api_notification_hide','yes_2');
48
+ }
49
+
50
+ function uaf_api_notification(){
51
+ if (get_option('uaf_api_notification_hide') != 'yes_2'){
52
+ echo '<div class="updated">
53
+ <p style="color:#900;"><b>Use Any Font</b></p>
54
+ <p>
55
+ Premium Key that were bought before 24th Sep, 2018 will no longer work in Use Any Font 5.0. So please get your replacement key <a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank"><b>here</b></a>. You do not need to pay again. Use your old Premium Key as Discount Coupon and it will apply 100% discount. We are sorry for the inconvenience caused.</p><p>
56
+ <a style="display:block;text-align:right;" href="admin.php?page=uaf_settings_page&uaf_api_notification_hide=1">Hide This Message</a></p>
57
+ </div>';
58
+ }
59
+ }
60
 
61
  $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
62
  if ($uaf_disbale_editor_font_list_value != 1):
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 != '5.0'):
112
+ update_option('uaf_current_version', '5.0');
113
  if ($uaf_version_check < 4.0):
114
  uaf_create_folder();
115
  uaf_move_file_to_newPath();
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === Use Any Font ===
2
  Contributors: dnesscarkey
3
  Tags: custom fonts, font embed, font uploader, any font, embed any font, font uploader, css3 font embed, @font-face embed, font conversion, webfont, ttf, opentype
4
  Requires at least: 3.0
5
- Tested up to: 4.9.2
6
- Stable tag: 4.9.2
7
 
8
  Embed any custom font in your website. #1 Rated custom fonts plugin by WPMUDev.org.
9
 
@@ -40,7 +40,7 @@ Use Any Font gives you freedom to use custom fonts in your website. It is not li
40
 
41
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
42
 
43
- Offer your contribution (Free for 1 font, $20 to $100) and get the API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>.
44
 
45
  <strong>Installation Video</strong>
46
  [youtube http://www.youtube.com/watch?v=QzGaWIPVwEk]
@@ -113,6 +113,9 @@ No, our server is needed during font conversion only. After that all fonts are s
113
 
114
  == Changelog ==
115
 
 
 
 
116
  = 4.9.2 =
117
  * Adds custom fonts to typography of Themify and Beaver Page Builder
118
 
1
+ === Use Any Font [ Freemium ] ===
2
  Contributors: dnesscarkey
3
  Tags: custom fonts, font embed, font uploader, any font, embed any font, font uploader, css3 font embed, @font-face embed, font conversion, webfont, ttf, opentype
4
  Requires at least: 3.0
5
+ Tested up to: 4.9.8
6
+ Stable tag: 5.0
7
 
8
  Embed any custom font in your website. #1 Rated custom fonts plugin by WPMUDev.org.
9
 
40
 
41
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
42
 
43
+ 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.
44
 
45
  <strong>Installation Video</strong>
46
  [youtube http://www.youtube.com/watch?v=QzGaWIPVwEk]
113
 
114
  == Changelog ==
115
 
116
+ = 5.0 =
117
+ * New API Key system, Lite / Test API key generation from plugin page.
118
+
119
  = 4.9.2 =
120
  * Adds custom fonts to typography of Themify and Beaver Page Builder
121
 
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.9.2
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: 5.0
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10