Use Any Font - Version 5.11.4

Version Description

  • Move js code to single file to avoid conflicts.
Download this release

Release Info

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

Code changes from version 5.11.3 to 5.11.4

includes/uaf_editor_setup.php CHANGED
@@ -1,5 +1,11 @@
1
  <?php
2
  // DEFAULT WORDPRESS EDITOR
 
 
 
 
 
 
3
  function uaf_mce_before_init( $init_array ) {
4
  $theme_advanced_fonts = '';
5
  $fontsData = uaf_get_uploaded_font_data();
1
  <?php
2
  // DEFAULT WORDPRESS EDITOR
3
+ $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
4
+ if ($uaf_disbale_editor_font_list_value != 1):
5
+ add_filter('mce_buttons_2', 'wp_editor_fontsize_filter');
6
+ add_filter('tiny_mce_before_init', 'uaf_mce_before_init' );
7
+ endif;
8
+
9
  function uaf_mce_before_init( $init_array ) {
10
  $theme_advanced_fonts = '';
11
  $fontsData = uaf_get_uploaded_font_data();
includes/uaf_font_upload_js.php CHANGED
@@ -11,7 +11,7 @@
11
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
12
 
13
  <div id="font-upload" style="display:none;">
14
- <form action="admin.php?page=uaf_settings_page" id="open_add_font_form" method="post" enctype="multipart/form-data">
15
  <table class="uaf_form">
16
  <tr>
17
  <td width="175">Font Name</td>
@@ -54,70 +54,4 @@
54
  </tr>
55
  </tbody>
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',
82
- data: new FormData( this ),
83
- processData: false,
84
- contentType: false,
85
- beforeSend : function(){
86
- jQuery('#submit-uaf-font').attr('disabled',true);
87
- jQuery('#font_upload_message').attr('class','ok');
88
- jQuery('#font_upload_message').html('Uploading Font. It might take few mins based on your font file size.');
89
- },
90
- success: function(data, textStatus, jqXHR)
91
- {
92
- var dataReturn = JSON.parse(data);
93
- status = dataReturn.global.status;
94
- msg = dataReturn.global.msg;
95
-
96
- if (status == 'error'){
97
- jQuery('#font_upload_message').attr('class',status);
98
- jQuery('#font_upload_message').html(msg);
99
- } else {
100
- woffStatus = dataReturn.woff.status;
101
- woff2Status = dataReturn.woff2.status;
102
- if (woffStatus == 'ok' && woff2Status == 'ok'){
103
- jQuery('#convert_response').val(data);
104
- jQuery('#font_upload_message').attr('class','ok');
105
- jQuery('#font_upload_message').html('Font Conversion Complete. Finalizing...');
106
- jQuery('#submit-uaf-font').attr('disabled',false);
107
- jQuery('#fontfile').remove();
108
- e.currentTarget.submit();
109
- } else {
110
- jQuery('#font_upload_message').attr('class','error');
111
- jQuery('#font_upload_message').html('Problem converting font to woff/woff2 formats. Please contact support.');
112
- }
113
- }
114
- },
115
- error: function(jqXHR, textStatus, errorThrown)
116
- {
117
- jQuery('#font_upload_message').attr('class','error');
118
- jQuery('#font_upload_message').html('Unexpected Error Occured.');
119
- jQuery('#submit-uaf-font').attr('disabled',false);
120
- }
121
- });
122
- });
123
- </script>
11
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
12
 
13
  <div id="font-upload" style="display:none;">
14
+ <form action="admin.php?page=uaf_settings_page" id="open_add_font_form_js" method="post" enctype="multipart/form-data">
15
  <table class="uaf_form">
16
  <tr>
17
  <td width="175">Font Name</td>
54
  </tr>
55
  </tbody>
56
  </table>
57
+ <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/uaf_font_upload_php.php CHANGED
@@ -10,7 +10,7 @@
10
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
11
 
12
  <div id="font-upload" style="display:none;">
13
- <form action="admin.php?page=uaf_settings_page" id="open_add_font_form" method="post" enctype="multipart/form-data">
14
  <table class="uaf_form">
15
  <tr>
16
  <td width="175">Font Name</td>
@@ -48,23 +48,6 @@
48
 
49
  <?php include('uaf_uploaded_font_list.php'); ?>
50
 
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>
70
  </tr>
10
  <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
11
 
12
  <div id="font-upload" style="display:none;">
13
+ <form action="admin.php?page=uaf_settings_page" id="open_add_font_form_php" method="post" enctype="multipart/form-data">
14
  <table class="uaf_form">
15
  <tr>
16
  <td width="175">Font Name</td>
48
 
49
  <?php include('uaf_uploaded_font_list.php'); ?>
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  <br/>
52
  </td>
53
  </tr>
includes/uaf_footer.php CHANGED
@@ -206,9 +206,9 @@ if (isset($_POST['test_server']) || empty($server_status)){
206
  <tr>
207
  <td>
208
  <ul class="uaf_list">
209
- <li><a href="http://goo.gl/NYtZsX" target="_blank">Setup Instructions</a></li>
210
  <li><a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">Support Forum</a></li>
211
- <li><a href="http://goo.gl/MKg7VS" target="_blank">Rectify My Problem / Contact Us</a></li>
212
  <li><a href="https://bit.ly/2wYjOyj" target="_blank">Download Free Fonts</a></li>
213
  </ul>
214
  </td>
206
  <tr>
207
  <td>
208
  <ul class="uaf_list">
209
+ <li><a href="https://dineshkarki.com.np/use-any-font/instructions" target="_blank">Setup Instructions</a></li>
210
  <li><a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">Support Forum</a></li>
211
+ <li><a href="https://dineshkarki.com.np/contact" target="_blank">Rectify My Problem / Contact Us</a></li>
212
  <li><a href="https://bit.ly/2wYjOyj" target="_blank">Download Free Fonts</a></li>
213
  </ul>
214
  </td>
includes/uaf_header.php CHANGED
@@ -39,21 +39,4 @@
39
  </tr>
40
  </tbody>
41
  </table>
42
- <br/>
43
- <script>
44
- function uaf_lite_api_key_generate(){
45
- jQuery.ajax({url: "<?php echo uaf_get_server_url().'/uaf_convertor/generate_lite_key.php'; ?>",
46
- beforeSend : function(){
47
- jQuery('#uaf_api_key_generate').val('Generating...');
48
- },
49
- error: function(){
50
- jQuery('#uaf_api_key_generate').val(' Error ! ');
51
- },
52
- success: function(result){
53
- var dataReturn = JSON.parse(result);
54
- key = dataReturn.key;
55
- jQuery('#uaf_api_key').val(key);
56
- jQuery('#uaf_api_key_generate').val('Click Verify to Complete');
57
- }});
58
- }
59
- </script>
39
  </tr>
40
  </tbody>
41
  </table>
42
+ <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/uaf_admin.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function uaf_lite_api_key_generate(){
2
+ jQuery.ajax({url: uaf_get_server_url+'/uaf_convertor/generate_lite_key.php',
3
+ beforeSend : function(){
4
+ jQuery('#uaf_api_key_generate').val('Generating...');
5
+ },
6
+ error: function(){
7
+ jQuery('#uaf_api_key_generate').val(' Error ! ');
8
+ },
9
+ success: function(result){
10
+ var dataReturn = JSON.parse(result);
11
+ key = dataReturn.key;
12
+ jQuery('#uaf_api_key').val(key);
13
+ jQuery('#uaf_api_key_generate').val('Click Verify to Complete');
14
+ }});
15
+ }
16
+
17
+ function open_add_font(){
18
+ jQuery('#font-upload').toggle('fast');
19
+ }
20
+
21
+ jQuery('document').ready(function(){
22
+ /* JS UPLOADER */
23
+ jQuery('#open_add_font_form_js').submit(function(e){
24
+
25
+ e.preventDefault();
26
+
27
+ breakValidation = false;
28
+ jQuery('#open_add_font_form_js .uaf_required').each(function(){
29
+ if(!jQuery(this).val()){
30
+ jQuery(this).focus();
31
+ breakValidation = true;
32
+ return false;
33
+ }
34
+ });
35
+
36
+ if(breakValidation){return false;}
37
+
38
+ jQuery.ajax( {
39
+ url: uaf_get_server_url+'/uaf_convertor/convert.php',
40
+ type: 'POST',
41
+ data: new FormData( this ),
42
+ processData: false,
43
+ contentType: false,
44
+ beforeSend : function(){
45
+ jQuery('#submit-uaf-font').attr('disabled',true);
46
+ jQuery('#font_upload_message').attr('class','ok');
47
+ jQuery('#font_upload_message').html('Uploading Font. It might take few mins based on your font file size.');
48
+ },
49
+ success: function(data, textStatus, jqXHR)
50
+ {
51
+ var dataReturn = JSON.parse(data);
52
+ status = dataReturn.global.status;
53
+ msg = dataReturn.global.msg;
54
+
55
+ if (status == 'error'){
56
+ jQuery('#font_upload_message').attr('class',status);
57
+ jQuery('#font_upload_message').html(msg);
58
+ } else {
59
+ woffStatus = dataReturn.woff.status;
60
+ woff2Status = dataReturn.woff2.status;
61
+ if (woffStatus == 'ok' && woff2Status == 'ok'){
62
+ jQuery('#convert_response').val(data);
63
+ jQuery('#font_upload_message').attr('class','ok');
64
+ jQuery('#font_upload_message').html('Font Conversion Complete. Finalizing...');
65
+ jQuery('#submit-uaf-font').attr('disabled',false);
66
+ jQuery('#fontfile').remove();
67
+ e.currentTarget.submit();
68
+ } else {
69
+ jQuery('#font_upload_message').attr('class','error');
70
+ jQuery('#font_upload_message').html('Problem converting font to woff/woff2 formats. Please contact support.');
71
+ }
72
+ }
73
+ },
74
+ error: function(jqXHR, textStatus, errorThrown)
75
+ {
76
+ jQuery('#font_upload_message').attr('class','error');
77
+ jQuery('#font_upload_message').html('Unexpected Error Occured.');
78
+ jQuery('#submit-uaf-font').attr('disabled',false);
79
+ }
80
+ });
81
+ });
82
+
83
+ /* PHP UPLOADER */
84
+ jQuery('#open_add_font_form_php').submit(function(){
85
+ breakValidation = false;
86
+ jQuery('#open_add_font_form_php .uaf_required').each(function(){
87
+ if(!jQuery(this).val()){
88
+ jQuery(this).focus();
89
+ breakValidation = true;
90
+ return false;
91
+ }
92
+ });
93
+ if(breakValidation){return false;}
94
+ });
95
+ });
plugin_interface.php CHANGED
@@ -2,17 +2,12 @@
2
  include('includes/uaf_trigger_actions.php');
3
 
4
  add_action('admin_menu', 'uaf_create_menu');
5
- add_action("admin_print_styles", 'adminCsslibs');
 
6
  add_action('wp_enqueue_scripts', 'uaf_client_css');
7
  add_action('plugins_loaded', 'uaf_update_check');
8
  add_action('init', 'uaf_editor_setup');
9
 
10
- $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
11
- if ($uaf_disbale_editor_font_list_value != 1):
12
- add_filter('mce_buttons_2', 'wp_editor_fontsize_filter');
13
- add_filter('tiny_mce_before_init', 'uaf_mce_before_init' );
14
- endif;
15
-
16
  function uaf_client_css() {
17
  $uaf_upload = wp_upload_dir();
18
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
@@ -21,7 +16,13 @@ function uaf_client_css() {
21
  wp_enqueue_style( 'uaf_client_css' );
22
  }
23
 
24
- function adminCsslibs(){
 
 
 
 
 
 
25
  $uaf_upload = wp_upload_dir();
26
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
27
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
@@ -37,6 +38,7 @@ function uaf_create_menu() {
37
  }
38
 
39
  function uaf_activate(){
 
40
  uaf_create_folder(); // CREATE FOLDER
41
  uaf_write_css(); //rewrite css when plugin is activated after update or somethingelse......
42
  }
2
  include('includes/uaf_trigger_actions.php');
3
 
4
  add_action('admin_menu', 'uaf_create_menu');
5
+ add_action("admin_print_styles", 'uaf_admin_css');
6
+ add_action("admin_enqueue_scripts", 'uaf_admin_js');
7
  add_action('wp_enqueue_scripts', 'uaf_client_css');
8
  add_action('plugins_loaded', 'uaf_update_check');
9
  add_action('init', 'uaf_editor_setup');
10
 
 
 
 
 
 
 
11
  function uaf_client_css() {
12
  $uaf_upload = wp_upload_dir();
13
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
16
  wp_enqueue_style( 'uaf_client_css' );
17
  }
18
 
19
+ function uaf_admin_js() {
20
+ echo '<script type="text/javascript">uaf_get_server_url = "'.uaf_get_server_url().'";</script>';
21
+ wp_register_script( 'uaf-admin-js', plugins_url('use-any-font/js/uaf_admin.js'), array('jquery'), false, true );
22
+ wp_enqueue_script( 'uaf-admin-js' );
23
+ }
24
+
25
+ function uaf_admin_css(){
26
  $uaf_upload = wp_upload_dir();
27
  $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
28
  $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
38
  }
39
 
40
  function uaf_activate(){
41
+ add_option('uaf_install_date',date('Y-m-d'));
42
  uaf_create_folder(); // CREATE FOLDER
43
  uaf_write_css(); //rewrite css when plugin is activated after update or somethingelse......
44
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.5
6
- Stable tag: 5.11.3
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
 
@@ -143,6 +143,9 @@ Please do write us after integration and we will add it in our supported list.
143
 
144
  == Changelog ==
145
 
 
 
 
146
  = 5.11.3 =
147
  * Removed i from italic tags so that it won't affect icons.
148
 
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.5.1
6
+ Stable tag: 5.11.4
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
 
143
 
144
  == Changelog ==
145
 
146
+ = 5.11.4 =
147
+ * Move js code to single file to avoid conflicts.
148
+
149
  = 5.11.3 =
150
  * Removed i from italic tags so that it won't affect icons.
151
 
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: Dnesscarkey
7
- Version: 5.11.3
8
  Author URI: https://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: Dnesscarkey
7
+ Version: 5.11.4
8
  Author URI: https://www.dineshkarki.com.np
9
  */
10