Use Any Font - Version 6.0

Version Description

  • New UI interface
  • Fixed CDN issue.
Download this release

Release Info

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

Code changes from version 5.11.5 to 6.0

css/uaf.css DELETED
File without changes
css/uaf_admin.css DELETED
@@ -1,20 +0,0 @@
1
- table.uaf_form td{ border:none !important;}
2
- table.uaf_form td label.error{ color:#900; padding-left:5px;}
3
- span.active_key{ padding-left:50px; font-weight:bold; color:#060;}
4
- #server_status{text-align:center; font-size:14px;-webkit-border-radius: 3px;border-radius: 3px; text-transform:capitalize; padding:5px; margin-bottom:10px;}
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;}
12
-
13
- .font_holder{background: #fff;border-radius: 5px;border: 1px solid #dadce0;}
14
- .font_holder{ padding: 10px; margin: 0px 0px 10px 0px; }
15
- .font_holder .font_meta .font_name{font-weight: bold; float: left;}
16
- .font_holder .font_meta .delete_link{ float: right; }
17
- .font_holder .font_demo{ clear: both; padding-top: 10px; font-size: 25px !important; line-height: 30px !important; }
18
- .font_holder .fontclassname{text-align: right; float: right;}
19
-
20
- .elements_holder{ float: left; width: 220px; display: block; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/assets/css/uaf_admin.css ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #font_upload_message.ok{display: block; background:#060 url(../img/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;}
2
+ #font_upload_message.error{display: block;background:#900; color:#fff;padding:5px 10px; border:none;margin:5px 0px;-webkit-border-radius: 3px;border-radius: 3px;}
3
+ span.active_key{font-weight:bold; color:#060; padding-right: 20px;}
4
+ .font_holder{background: #fff;border-radius: 5px;border: 1px solid #dadce0;}
5
+ .font_holder{ padding: 10px; margin: 0px 0px 10px 0px; }
6
+ .font_holder .font_meta .font_name{font-weight: bold; float: left;}
7
+ .font_holder .font_meta .delete_link{ float: right; }
8
+ .font_holder .font_demo{ clear: both; padding-top: 10px; font-size: 25px !important; line-height: 30px !important; }
9
+ .font_holder .fontclassname{text-align: right; float: right;}
10
+ .elements_holder{ float: left; width: 220px; display: block; }
11
+ .dcform{}
12
+ .dclisttable{ margin-top: 20px;}
13
+ .dclisttable th{ font-weight: 600; }
14
+ .dclisttable td.yes-show span{ font-weight: 600;}
15
+ .dclisttable td.no-show span{ display: none;}
16
+ .dcform .capitalizse{ text-transform: capitalize; }
17
+ .dcform p{ display: table; }
18
+ .dcform p label{ width: 300px; vertical-align: top;padding-top: 4px;display: table-cell; font-weight: 500;}
19
+ .dcform p span.field{ display: table-cell;}
20
+ .dcform p label.error{ color: #900; padding-left: 5px; }
21
+ .dcform p label .required{ color: #900; font-weight: bold; }
22
+ .dcform p input.large, .dcform p textarea.large{ max-width: 500px; width: 100%;}
23
+ .dcform p input.medium, .dcform p textarea.medium{ max-width: 300px; width: 100%;}
24
+ .dcform p input.small{ max-width: 85px;}
25
+ .dcinstructions{border:1px solid #ccd0d4;background: #fff;margin-top: 20px; }
26
+ .dcinstructions .instruct-head{border-bottom:1px solid #ccd0d4; font-size: 14px; padding: 10px; font-weight: 600; cursor: pointer;}
27
+ .dcinstructions .instruct-content{padding: 10px; font-size: 14px; line-height: 1.5em; color: #555;}
28
+ .dcinstructions .instruct-content img{width: 100%; max-width: 650px; }
29
+ .dcinstructions .instruct-content.hidden{display: none;}
30
+ .dcinstructions .instruct-content p{ font-size: inherit; }
31
+ .dcinstructions .instruct-content ul{ padding-left: 10px; }
32
+ .dcinstructions .instruct-content ul li{ list-style: square; margin-left: 10px;}
33
+ .dcinfo{background: #fff;border: 1px solid #04a2c7;border-left-width: 4px;box-shadow: 0 1px 1px rgba(0,0,0,.04);padding: 1px 12px; margin-bottom: 10px;}
34
+ .dcwidget .dcwidgetbody ul{ padding-left: 10px; }
35
+ .dcwidget .dcwidgetbody ul li{ list-style: square; margin-left: 10px }
36
+ .dcwidget .dcwidgetbody ul li a{ text-decoration: none; }
37
+ .dcwrap h1{color: #062f4f;}
38
+ .dcwrap .button-primary{ background: #04a2c7; border-color:#04a2c7; }
39
+ .dcwrap .nav-tab-wrapper{ border-bottom:none; }
40
+ .dcwrap .tab-content{}
41
+ .dcwrap .tab-content table.noborder{ border-collapse: collapse; border:none; }
42
+ .dcwrap .nav-tab{ background: #04a2c7; border:none; color: #fff; padding: 8px 16px; border-radius: 5px 5px 0px 0px; margin: 0 0.5em 0 0.5em; font-weight: normal; font-size: 13px;}
43
+ .dcwrap .tab-content .leftcontent{ background: #fff; padding: 5px 20px;border-radius: 5px; box-shadow: 0px 0px 10px -7px #000;}
44
+ .dcwrap .nav-tab-active{ background: #fff; border-bottom: 1px solid #fff; color: #062f4f;box-shadow: 0px -1px 5px -4px #000; font-weight: 600;}
45
+ .dcwidget{box-shadow:0px 0px 10px -7px #000;}
46
+ .dcwidget .dcwidgetheader{ background: #04a2c7; color: #fff !important; padding: 15px 10px; border-radius: 5px 5px 0px 0px; font-size: 14px;}
47
+ .dcwidget .dcwidgetbody{ background: #fff; border-radius: 0px 0px 5px 5px;padding:10px; margin-bottom: 20px;}
48
+ span.field_error{ display: none; color: #900; }
49
+ @media ( max-width: 768px) { .dchideMobile { display : none; } }
{images → includes/assets/img}/ajax-loader.gif RENAMED
File without changes
{js → includes/assets/js}/uaf_admin.js RENAMED
@@ -1,5 +1,5 @@
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
  },
@@ -18,6 +18,15 @@ 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){
@@ -27,7 +36,7 @@ jQuery('document').ready(function(){
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
  }
@@ -36,7 +45,7 @@ jQuery('document').ready(function(){
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,
@@ -85,7 +94,7 @@ jQuery('document').ready(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
  }
1
  function uaf_lite_api_key_generate(){
2
+ jQuery.ajax({url: uaf_server_url+'/uaf_convertor/generate_lite_key.php',
3
  beforeSend : function(){
4
  jQuery('#uaf_api_key_generate').val('Generating...');
5
  },
18
  jQuery('#font-upload').toggle('fast');
19
  }
20
 
21
+ function open_assign_font(){
22
+ jQuery('#open_assign_font').toggle('fast');
23
+ if (jQuery('#open_assign_font_button').val() == 'Assign Font'){
24
+ jQuery('#open_assign_font_button').val('Close Assign Font');
25
+ } else {
26
+ jQuery('#open_assign_font_button').val('Assign Font');
27
+ }
28
+ }
29
+
30
  jQuery('document').ready(function(){
31
  /* JS UPLOADER */
32
  jQuery('#open_add_font_form_js').submit(function(e){
36
  breakValidation = false;
37
  jQuery('#open_add_font_form_js .uaf_required').each(function(){
38
  if(!jQuery(this).val()){
39
+ jQuery(this).next('.field_error').show();
40
  breakValidation = true;
41
  return false;
42
  }
45
  if(breakValidation){return false;}
46
 
47
  jQuery.ajax( {
48
+ url: uaf_server_url+'/uaf_convertor/convert.php',
49
  type: 'POST',
50
  data: new FormData( this ),
51
  processData: false,
94
  breakValidation = false;
95
  jQuery('#open_add_font_form_php .uaf_required').each(function(){
96
  if(!jQuery(this).val()){
97
+ jQuery(this).next('.field_error').show();
98
  breakValidation = true;
99
  return false;
100
  }
includes/functions/uaf_admin_functions.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function uaf_create_menu() {
3
+ add_menu_page( 'Use Any Font', 'Use Any Font', 'manage_options', 'use-any-font', 'uaf_interface', 'dashicons-editor-textcolor');
4
+ }
5
+
6
+ function uaf_admin_assets(){
7
+ wp_register_style('uaf_admin_css', plugins_url('use-any-font/includes/assets/css/uaf_admin.css'),'', $GLOBALS['uaf_current_version']);
8
+ wp_enqueue_style('uaf_admin_css');
9
+
10
+ $uaf_upload = wp_upload_dir();
11
+ $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
12
+ $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
13
+ wp_register_style('uaf-font-style', $uaf_upload_url.'admin-uaf.css', array(), get_option('uaf_css_updated_timestamp'));
14
+ wp_enqueue_style('uaf-font-style');
15
+ add_editor_style($uaf_upload_url.'admin-uaf.css');
16
+
17
+ wp_register_script('uaf_admin_js', plugins_url('use-any-font/includes/assets/js/uaf_admin.js'), '', $GLOBALS['uaf_current_version'], true);
18
+ $uaf_server_url = $GLOBALS['uaf_user_settings']['uaf_server_url'];
19
+ wp_localize_script( 'uaf_admin_js', 'uaf_server_url', $uaf_server_url );
20
+ wp_enqueue_script( 'uaf_admin_js' );
21
+ }
22
+
23
+ function uaf_interface(){
24
+ $uaf_tabs = array(
25
+ 'api' => array('name'=>'API Key','path'=>'uaf_api_interface.php'),
26
+ 'font_upload' => array('name'=>'Upload Font','path'=>'uaf_font_upload_'.$GLOBALS['uaf_user_settings']['uaf_uploader_type'].'.php'),
27
+ 'font_assign' => array('name'=>'Assign Font','path'=>'uaf_font_assign.php'),
28
+ 'settings' => array('name'=>"Settings",'path'=>'uaf_settings.php'),
29
+ 'instructions' => array('name'=>"Instructions",'path'=>'uaf_instructions.php')
30
+ );
31
+
32
+ $uaf_tabs = apply_filters( 'uaf_tabs_filter', $uaf_tabs);
33
+
34
+ include UAF_FILE_PATH.'includes/views/uaf_main.php';
35
+ }
36
+
37
+ function uaf_get_options(){
38
+ $uaf_user_settings = $GLOBALS['uaf_user_settings'];
39
+ foreach ($uaf_user_settings as $option_name => $option_value) {
40
+ $GLOBALS['uaf_user_settings'][$option_name] = get_option($option_name, $option_value);
41
+ }
42
+ $GLOBALS['uaf_user_settings']['uaf_server_url'] = $GLOBALS['uaf_fix_settings']['serverUrl'][$GLOBALS['uaf_user_settings']['uaf_server_url_type']];
43
+ }
44
+
45
+ function ucf_api_key_activate(){
46
+ $uaf_api_key = trim($_POST['uaf_api_key']);
47
+ $uaf_site_url = home_url();
48
+ if (!empty($uaf_api_key)){
49
+ $api_key_return = wp_remote_get($GLOBALS['uaf_user_settings']['uaf_server_url'].'/uaf_convertor/validate_key.php?license_key='.$uaf_api_key.'&url='.$uaf_site_url, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
50
+ if ( is_wp_error( $api_key_return ) ) {
51
+ $error_message = $api_key_return->get_error_message();
52
+ $return['body'] = "Something went wrong: $error_message";
53
+ $return['status'] = 'error';
54
+ } else {
55
+ $api_key_return = json_decode($api_key_return['body']);
56
+ if ($api_key_return->status == 'success'){
57
+ update_option('uaf_api_key', $uaf_api_key);
58
+ update_option('uaf_activated_url', base64_encode($uaf_site_url));
59
+ uaf_get_options();
60
+ uaf_write_css();
61
+ }
62
+ $return['body'] = $api_key_return->msg;
63
+ $return['status'] = $api_key_return->status;
64
+ }
65
+ } else {
66
+ $return['body'] = 'Please keep API key to activate.';
67
+ $return['status'] = 'error';
68
+ }
69
+ return $return;
70
+ }
71
+
72
+
73
+ function ucf_api_key_deactivate(){
74
+ $uaf_api_key = $GLOBALS['uaf_user_settings']['uaf_api_key'];
75
+ $uaf_activated_url = base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']);
76
+
77
+ $api_key_return = wp_remote_get($GLOBALS['uaf_user_settings']['uaf_server_url'].'/uaf_convertor/deactivate_key.php?license_key='.$uaf_api_key.'&url='.$uaf_activated_url, array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
78
+ if ( is_wp_error( $api_key_return ) ) {
79
+ $error_message = $api_key_return->get_error_message();
80
+ $return['body'] = "Something went wrong: $error_message";
81
+ $return['status'] = 'error';
82
+ } else {
83
+ $api_key_return = json_decode($api_key_return['body']);
84
+ if ($api_key_return->status == 'success'){
85
+ update_option('uaf_api_key', '');
86
+ update_option('uaf_activated_url', '');
87
+ uaf_get_options();
88
+ uaf_write_css();
89
+ }
90
+ $return['status'] = $api_key_return->status;
91
+ $return['body'] = $api_key_return->msg;
92
+ }
93
+ return $return;
94
+ }
95
+
96
+ function uaf_plugin_initialize(){
97
+ if (get_option('uaf_current_version') != $GLOBALS['uaf_current_version']){
98
+ add_option('uaf_install_date', date('Y-m-d'));
99
+
100
+ if (!empty(trim(get_option('uaf_api_key')))){
101
+ update_option('uaf_activated_url',base64_encode(home_url()));
102
+ }
103
+
104
+ uaf_create_folder();
105
+ uaf_write_css();
106
+
107
+ update_option('uaf_current_version', $GLOBALS['uaf_current_version']);
108
+
109
+ $uaf_user_settings = $GLOBALS['uaf_user_settings'];
110
+ foreach ($uaf_user_settings as $option_name => $option_value) {
111
+ add_option($option_name, $option_value);
112
+ }
113
+ }
114
+ uaf_get_options();
115
+ uaf_trigger_actions();
116
+ uaf_check_site_url();
117
+ }
118
+
119
+ function uaf_max_upload_size_for_php($sendinbytes = false){
120
+ $maxUploadSizeForPHP = $GLOBALS['uaf_fix_settings']['allowedFontSize'];
121
+ $wpAllowedMaxSize = wp_max_upload_size();
122
+ $wpAllowedMaxSizeToMB = $wpAllowedMaxSize / 1048576 ;
123
+ if ($wpAllowedMaxSizeToMB < $GLOBALS['uaf_fix_settings']['allowedFontSize']){
124
+ $maxUploadSizeForPHP = $wpAllowedMaxSizeToMB;
125
+ }
126
+ if ($sendinbytes) {
127
+ return $maxUploadSizeForPHP * 1048576;
128
+ } else {
129
+ return $maxUploadSizeForPHP;
130
+ }
131
+ }
132
+
133
+ function uaf_check_site_url(){
134
+ $uaf_api_key = $GLOBALS['uaf_user_settings']['uaf_api_key'];
135
+ $uaf_site_url = $GLOBALS['uaf_user_settings']['uaf_site_url'];
136
+ $uaf_current_url = base64_encode(home_url());
137
+
138
+ if (!empty($uaf_api_key) && ($uaf_site_url != $uaf_current_url)){
139
+ uaf_write_css();
140
+ }
141
+ }
142
+
143
+ function uaf_save_options(){
144
+ $all_fields = $_POST;
145
+ unset($all_fields['save-uaf-options']); // REMOVE submit field
146
+ foreach ($all_fields as $fieldname => $fieldvalue) {
147
+ update_option($fieldname,stripslashes($fieldvalue));
148
+ }
149
+
150
+ uaf_get_options();
151
+ uaf_write_css();
152
+ $return['status'] = 'ok';
153
+ $return['body'] = 'Settings Saved';
154
+ return $return;
155
+ }
156
+
157
+
158
+ function uaf_admin_notices(){
159
+ // ASKING FOR REVIEW
160
+ if (isset($_GET['uaf_reviews_notice_hide']) == 1){
161
+ update_option('uaf_reviews_notice_hide','yes');
162
+ }
163
+
164
+ if (get_option('uaf_reviews_notice_hide') != 'yes'){
165
+ $installedDate = strtotime(get_option('uaf_install_date'));
166
+ $todayDate = time();
167
+ $installedDays = round(($todayDate - $installedDate) / (60 * 60 * 24));
168
+ $fonts_uploaded = uaf_count_uploaded_fonts();
169
+
170
+
171
+ if ($installedDays > 30 && $fonts_uploaded > 1){
172
+ echo '<div class="updated success" style="padding:10px; font-size:16px; line-height:1.6;color:#205225;">
173
+ Hey, You have been using Use Any Font for more than 30 days - that’s awesome! Could you please do us a BIG favor and give it a 5-star rating on WordPress ? Just to help us spread the word and boost our motivation.<br/>
174
+
175
+ <ul style="padding-left:50px;list-style-type: square;">
176
+ <li><a href="https://wordpress.org/support/plugin/use-any-font/reviews/?filter=5" target="_blank">Ok, you deserve it</a></li>
177
+ <li><a href="https://dineshkarki.com.np/contact" target="_blank">I still have problem !!</a></li>
178
+ <li><a href="?uaf_reviews_notice_hide=1">I already did</a></li>
179
+ <li><a href="?uaf_reviews_notice_hide=1">Hide this message</a></li>
180
+ </ul>
181
+
182
+ </div>';
183
+ }
184
+ }
185
+ // EOF ASKING FOR REVIEW
186
+ }
187
+
188
+ function uaf_trigger_actions(){
189
+ $actionReturn = array();
190
+
191
+ if (isset($_POST['ucf_api_key_activate'])){
192
+ $actionReturn = ucf_api_key_activate();
193
+ }
194
+
195
+ if (isset($_POST['ucf_api_key_deactivate'])){
196
+ $actionReturn = ucf_api_key_deactivate();
197
+ }
198
+
199
+ if (isset($_POST['submit-uaf-font-js'])){
200
+ $actionReturn = uaf_save_font_files($_POST['font_name'], $_POST['convert_response']);
201
+ }
202
+
203
+ if (isset($_POST['submit-uaf-font-php'])){
204
+ $actionReturn = uaf_upload_font_to_server();
205
+ if ($actionReturn['status'] == 'success'){
206
+ $actionReturn = uaf_save_font_files($_POST['font_name'], $actionReturn['body']);
207
+ }
208
+ }
209
+
210
+ if (isset($_POST['submit-uaf-font-assign'])){
211
+ $actionReturn = uaf_save_font_assign();
212
+ }
213
+
214
+ if (isset($_GET['delete_font_assign_key'])){
215
+ $actionReturn = uaf_delete_font_assign();
216
+ }
217
+
218
+ if (isset($_GET['delete_font_key'])){
219
+ $actionReturn = uaf_delete_font();
220
+ }
221
+
222
+ if (isset($_POST['save-uaf-options'])){
223
+ $actionReturn = uaf_save_options();
224
+ }
225
+ $GLOBALS['uaf_action_return'] = $actionReturn;
226
+ }
includes/functions/uaf_client_functions.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function uaf_client_assets() {
3
+ $uaf_upload = wp_upload_dir();
4
+ $uaf_upload_url = set_url_scheme($uaf_upload['baseurl']);
5
+ $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
6
+ wp_register_style( 'uaf_client_css', $uaf_upload_url.'uaf.css', array(),get_option('uaf_css_updated_timestamp'));
7
+ wp_enqueue_style( 'uaf_client_css' );
8
+ }
includes/{uaf_editor_setup.php → functions/uaf_editor_functions.php} RENAMED
File without changes
includes/{uaf_functions.php → functions/uaf_font_functions.php} RENAMED
@@ -1,230 +1,17 @@
1
  <?php
2
- // MOVING OLD FONTFILE PATH TO NEW PATH
3
- function uaf_move_file_to_newPath(){
4
- $uaf_upload = wp_upload_dir();
5
- $uaf_upload_dir = $uaf_upload['basedir'];
6
- $uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
7
- $fontsRawData = get_option('uaf_font_data');
8
- $fontsData = json_decode($fontsRawData, true);
9
- if (!empty($fontsData)):
10
- foreach ($fontsData as $key=>$fontData):
11
-
12
- $oldFilePathInfo = pathinfo($fontData['font_path']);
13
- $parsedPath = parse_url($fontData['font_path']);
14
- $relativeFilePath = $_SERVER['DOCUMENT_ROOT'].$parsedPath['path'];
15
- $oldfilename = $oldFilePathInfo['filename'];
16
-
17
- if (file_exists($relativeFilePath.'.woff')){
18
-
19
- $woffFileContent = file_get_contents($relativeFilePath.'.woff');
20
- $eotFileContent = file_get_contents($relativeFilePath.'.eot');
21
-
22
- $fhWoff = fopen($uaf_upload_dir.'/'.$oldfilename.'.woff' , 'w') or die("can't open file. Make sure you have write permission to your upload folder");
23
- fwrite($fhWoff, $woffFileContent);
24
- fclose($fhWoff);
25
-
26
- $fhEot = fopen($uaf_upload_dir.'/'.$oldfilename.'.eot' , 'w') or die("can't open file. Make sure you have write permission to your upload folder");
27
- fwrite($fhEot, $eotFileContent);
28
- fclose($fhEot);
29
-
30
- $fontsData[$key]['font_path'] = $oldfilename;
31
- }
32
- endforeach;
33
- endif;
34
-
35
- $updateFontData = json_encode($fontsData);
36
- update_option('uaf_font_data',$updateFontData);
37
- }
38
-
39
- function uaf_write_css(){
40
- $uaf_use_absolute_font_path = $GLOBALS['uaf_use_absolute_font_path']; // Check if user want to use absolute font path.
41
-
42
- if (empty($uaf_use_absolute_font_path)){
43
- $uaf_use_absolute_font_path = 0;
44
- }
45
-
46
- $uaf_upload_path = uaf_path_details();
47
- $uaf_upload_dir = $uaf_upload_path['dir'];
48
- $uaf_upload_url = preg_replace('#^https?:#', '', $uaf_upload_path['url']);
49
-
50
- if ($uaf_use_absolute_font_path == 0){ // If user use relative path
51
- $url_parts = parse_url($uaf_upload_url);
52
- @$uaf_upload_url = "$url_parts[path]$url_parts[query]$url_parts[fragment]";
53
- }
54
-
55
- ob_start();
56
- $fontsData = uaf_get_uploaded_font_data();
57
- if (!empty($fontsData)):
58
- foreach ($fontsData as $key=>$fontData): ?>
59
- @font-face {
60
- font-family: '<?php echo $fontData['font_name'] ?>';
61
- src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff2') format('woff2'),
62
- <?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
63
- font-display: <?php echo $GLOBALS['uaf_font_display_property']; ?>;
64
- }
65
-
66
- .<?php echo $fontData['font_name'] ?>{font-family: '<?php echo $fontData['font_name'] ?>' !important;}
67
-
68
- <?php
69
- endforeach;
70
- endif;
71
-
72
- $fontsImplementRawData = get_option('uaf_font_implement');
73
- $fontsImplementData = json_decode($fontsImplementRawData, true);
74
- if (!empty($fontsImplementData)):
75
- foreach ($fontsImplementData as $key=>$fontImplementData): ?>
76
- <?php echo $fontImplementData['font_elements']; ?>{
77
- font-family: '<?php echo $fontsData[$fontImplementData['font_key']]['font_name']; ?>' !important;
78
- }
79
- <?php
80
- endforeach;
81
- endif;
82
- $uaf_style = ob_get_contents();
83
- $uafStyleSheetPath = $uaf_upload_path['dir'].'/uaf.css';
84
- $fh = fopen($uafStyleSheetPath, 'w') or die("Can't open file");
85
- fwrite($fh, $uaf_style);
86
- fclose($fh);
87
- ob_end_clean();
88
-
89
- ob_start();
90
- $fontsData = uaf_get_uploaded_font_data();
91
- if (!empty($fontsData)):
92
- foreach ($fontsData as $key=>$fontData): ?>
93
- @font-face {
94
- font-family: '<?php echo $fontData['font_name'] ?>';
95
- src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff2') format('woff2'),
96
- <?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
97
- }
98
-
99
- .<?php echo $fontData['font_name'] ?>{font-family: '<?php echo $fontData['font_name'] ?>' !important;}
100
-
101
- .et_gf_<?php echo $fontData['font_name'] ?>{background:none !important;font-family:<?php echo $fontData['font_name'] ?>;text-indent:0 !important;font-size:25px;}
102
-
103
- <?php
104
- endforeach;
105
- endif;
106
- $uaf_style = ob_get_contents();
107
- $uafStyleSheetPath = $uaf_upload_path['dir'].'/admin-uaf.css';
108
- $fh = fopen($uafStyleSheetPath, 'w') or die("Can't open file");
109
- fwrite($fh, $uaf_style);
110
- fclose($fh);
111
-
112
- $uafStyleSheetPath = $uaf_upload_path['dir'].'/admin-uaf-rtl.css';
113
- $fh = fopen($uafStyleSheetPath, 'w') or die("Can't open file");
114
- fwrite($fh, $uaf_style);
115
- fclose($fh);
116
- ob_end_clean();
117
- update_option('uaf_css_updated_timestamp', time()); // Time entry for stylesheet version
118
- }
119
-
120
- function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
121
- $uaf_version_check = get_option('uaf_current_version');
122
- if ($uaf_version_check != '5.11'):
123
- update_option('uaf_current_version', '5.11');
124
- if ($uaf_version_check < 4.0):
125
- uaf_create_folder();
126
- uaf_move_file_to_newPath();
127
- endif;
128
- uaf_default_settings();
129
- uaf_write_css();
130
- endif;
131
- }
132
-
133
- function uaf_default_settings(){
134
- add_option('uaf_font_display_property','auto');
135
- $GLOBALS['uaf_font_display_property'] = get_option('uaf_font_display_property');
136
- }
137
-
138
- function uaf_get_server_url(){
139
- $uaf_use_alternative_server = $GLOBALS['uaf_use_alternative_server'];
140
- if ($uaf_use_alternative_server == 1){
141
- return $GLOBALS['serverUrl']['alternative'];
142
- } else {
143
- return $GLOBALS['serverUrl']['default'];
144
- }
145
- }
146
-
147
- function uaf_create_folder() {
148
- $uaf_upload_path = uaf_path_details();
149
- if (! is_dir($uaf_upload_path['dir'])) {
150
- mkdir( $uaf_upload_path['dir'], 0755 );
151
- }
152
- }
153
-
154
- function uaf_max_upload_size_for_php($sendinbytes = false){
155
- $maxUploadSizeForPHP = $GLOBALS['allowedFontSize'];
156
- $wpAllowedMaxSize = wp_max_upload_size();
157
- $wpAllowedMaxSizeToMB = $wpAllowedMaxSize / 1048576 ;
158
- if ($wpAllowedMaxSizeToMB < $GLOBALS['allowedFontSize']){
159
- $maxUploadSizeForPHP = $wpAllowedMaxSizeToMB;
160
- }
161
- if ($sendinbytes) {
162
- return $maxUploadSizeForPHP * 1048576;
163
- } else {
164
- return $maxUploadSizeForPHP;
165
- }
166
- }
167
-
168
- function uaf_path_details(){
169
- $uaf_upload = wp_upload_dir();
170
- $uaf_upload_dir = $uaf_upload['basedir'];
171
- $uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
172
- $uaf_upload_url = $uaf_upload['baseurl'];
173
- $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
174
-
175
- $pathReturn['dir'] = $uaf_upload_dir;
176
- $pathReturn['url'] = $uaf_upload_url;
177
- return $pathReturn;
178
  }
179
 
180
- function uaf_upload_font_to_server(){
181
- $font_file_details = pathinfo($_FILES['font_file']['name']);
182
- $file_extension = strtolower($font_file_details['extension']);
183
- $font_size = $_FILES['font_file']['size'];
184
-
185
- if ((in_array($file_extension, $GLOBALS['allowedFontFormats'])) && ($font_size <= uaf_max_upload_size_for_php(true))){
186
- @set_time_limit(0);
187
- $ch = curl_init();
188
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
189
- curl_setopt($ch, CURLOPT_URL, uaf_get_server_url().'/uaf_convertor/convert.php');
190
- curl_setopt($ch, CURLOPT_POST, true);
191
- curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
192
- $post = array(
193
- 'fontfile' => new CURLFile($_FILES['font_file']['tmp_name']),
194
- 'fontfileext' => pathinfo($_FILES['font_file']['name'], PATHINFO_EXTENSION),
195
- 'api_key' => $GLOBALS['uaf_api_key'],
196
- 'url' => $_POST['url'],
197
- 'font_count' => $_POST['font_count']
198
- );
199
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
200
- $convertResponse = curl_exec($ch);
201
- if(curl_errno($ch)) {
202
- $fontUploadResponse['status'] = 'error';
203
- $fontUploadResponse['body'] = 'Error: ' . curl_error($ch);
204
- } else {
205
- $CrulStatinfo = curl_getinfo($ch);
206
- if ($CrulStatinfo['http_code'] == '200'):
207
- $convertResponseArray = json_decode($convertResponse, true);
208
- if ($convertResponseArray['global']['status'] == 'error'):
209
- $fontUploadResponse['status'] = 'error';
210
- $fontUploadResponse['body'] = $convertResponseArray['global']['msg'];
211
- else:
212
- $fontUploadResponse['status'] = 'success';
213
- $fontUploadResponse['body'] = $convertResponse;
214
- endif;
215
- else:
216
- $fontUploadResponse['status'] = 'error';
217
- $fontUploadResponse['body'] = $convertResponse;
218
- endif;
219
- }
220
- } else {
221
- $fontUploadResponse['status'] = 'error';
222
- $fontUploadResponse['body'] = 'Only '.join(", ",$GLOBALS['allowedFontFormats']).' format and font less than '.uaf_max_upload_size_for_php().' MB accepted';
223
- }
224
- return $fontUploadResponse;
225
  }
226
 
227
  function uaf_save_font_files($font_name, $convertResponse){
 
228
  $uafPath = uaf_path_details();
229
  $fontNameToStore = sanitize_file_name(rand(0,9999).$font_name);
230
 
@@ -284,6 +71,72 @@ function uaf_save_font_files($font_name, $convertResponse){
284
  return $fontUploadFinalResponse;
285
  }
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  function uaf_save_font_entry_to_db($font_name, $font_path){
288
  $fontsRawData = get_option('uaf_font_data');
289
  $fontsData = json_decode($fontsRawData, true);
@@ -297,109 +150,97 @@ function uaf_save_font_entry_to_db($font_name, $font_path){
297
  uaf_write_css();
298
  }
299
 
300
- function uaf_get_uploaded_font_data(){
301
- $fontsRawData = get_option('uaf_font_data');
302
- return json_decode($fontsRawData, true);
303
- }
304
-
305
- function uaf_get_font_families(){
306
- $fontsData = uaf_get_uploaded_font_data();
307
- $fonts_uaf = array();
308
- if (!empty($fontsData)):
309
- foreach ($fontsData as $key=>$fontData):
310
- $fonts_uaf[] = $fontData['font_name'];
311
- endforeach;
312
- endif;
313
- return $fonts_uaf;
314
- }
315
-
316
- function uaf_count_uploaded_fonts(){
317
- $fontsRawData = get_option('uaf_font_data');
318
- $fontsData = json_decode($fontsRawData, true);
319
- return count($fontsData);
320
- }
321
-
322
- function uaf_key_activate(){
323
- $uaf_api_key = trim($_POST['uaf_api_key']);
324
- if (!empty($uaf_api_key)){
325
- $api_key_return = wp_remote_get( uaf_get_server_url().'/uaf_convertor/validate_key.php?license_key='.$uaf_api_key.'&url='.home_url(), array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
326
- if ( is_wp_error( $api_key_return ) ) {
327
- $error_message = $api_key_return->get_error_message();
328
- $return['body'] = "Something went wrong: $error_message";
329
- $return['status'] = 'error';
330
- } else {
331
- $api_key_return = json_decode($api_key_return['body']);
332
- if ($api_key_return->status == 'success'){
333
- update_option('uaf_api_key', $uaf_api_key);
334
- $GLOBALS['uaf_api_key'] = $uaf_api_key;
335
- }
336
- $return['body'] = $api_key_return->msg;
337
- $return['status'] = $api_key_return->status;
338
- }
339
- } else {
340
- $return['body'] = 'Please keep API key to activate.';
341
- $return['status'] = 'error';
342
  }
343
- return $return;
344
- }
 
 
 
 
345
 
 
 
 
 
346
 
347
- function uaf_key_deactivate(){
348
- $uaf_api_key = $GLOBALS['uaf_api_key'];
349
- $api_key_return = wp_remote_get( uaf_get_server_url().'/uaf_convertor/deactivate_key.php?license_key='.$uaf_api_key.'&url='.home_url(), array('timeout'=>300,'sslverify'=>false,'user-agent'=>get_bloginfo( 'url' )));
350
- if ( is_wp_error( $api_key_return ) ) {
351
- $error_message = $api_key_return->get_error_message();
352
- $return['body'] = "Something went wrong: $error_message";
353
- $return['status'] = 'error';
354
- } else {
355
- $api_key_return = json_decode($api_key_return['body']);
356
- if ($api_key_return->status == 'success'){
357
- delete_option('uaf_api_key');
358
- $GLOBALS['uaf_api_key'] = '';
359
- }
360
- $return['status'] = $api_key_return->status;
361
- $return['body'] = $api_key_return->msg;
362
- }
363
- return $return;
364
- }
365
 
366
- function uaf_delete_font(){
367
- $uaf_paths = uaf_path_details();
368
 
369
- $fontsData = uaf_get_uploaded_font_data();
370
- $key_to_delete = $_GET['delete_font_key'];
371
-
372
- @unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff2'));
373
- @unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff'));
374
- @unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.eot'));
375
- unset($fontsData[$key_to_delete]);
376
- $updateFontData = json_encode($fontsData);
377
- update_option('uaf_font_data',$updateFontData);
 
 
 
 
 
 
 
 
 
 
 
378
 
379
- $fontsImplementRawData = get_option('uaf_font_implement');
380
- $fontsImplementData = json_decode($fontsImplementRawData, true);
 
 
 
 
 
 
 
381
 
382
- foreach ($fontsImplementData as $implement_key => $font_assign_array) {
383
- if ($key_to_delete == $font_assign_array['font_key']){
384
- unset($fontsImplementData[$implement_key]);
385
- }
386
- }
387
 
388
- $updatefontsImplementData = json_encode($fontsImplementData);
389
- update_option('uaf_font_implement',$updatefontsImplementData);
390
-
391
- $return['status'] = 'success';
392
- $return['body'] = 'Font Deleted';
393
- uaf_write_css();
394
- return $return;
 
 
 
 
 
 
 
 
 
 
 
395
  }
396
 
 
397
  function uaf_get_language_selector(){
398
  $enableMultiLang = '';
399
  $returnSelectHTML = '';
400
- if ($GLOBALS['uaf_enable_multi_lang_support'] == 1){
401
  $enableMultiLang = TRUE;
402
- $supported_multi_lang_plugins = $GLOBALS['supported_multi_lang_plugins'];
403
  foreach ($supported_multi_lang_plugins as $key => $plugin_name) {
404
  if (is_plugin_active($plugin_name)){
405
  $active_multi_lang_plugin = $plugin_name;
@@ -446,65 +287,6 @@ function uaf_get_language_selector(){
446
  return $return;
447
  }
448
 
449
- function uaf_langutizse_elements($finalElements){
450
- if (isset($_POST['language']) && ($_POST['language'] != 'all_lang')){
451
- $finalElementArray = explode(',', $finalElements);
452
- $finalElementArray = array_map('trim', $finalElementArray);
453
- $prefixed_array = preg_filter('/^/', $_POST['language'].' ', $finalElementArray);
454
- $finalElements = join(', ', $prefixed_array);
455
- }
456
- return $finalElements;
457
- }
458
-
459
- function uaf_save_settings(){
460
- if (isset($_POST['uaf_disbale_editor_font_list'])){
461
- $uaf_disbale_editor_font_list = 1;
462
- } else {
463
- $uaf_disbale_editor_font_list = '';
464
- }
465
-
466
- if (isset($_POST['uaf_use_curl_uploader'])){
467
- $uaf_use_curl_uploader = 1;
468
- } else {
469
- $uaf_use_curl_uploader = '';
470
- }
471
-
472
- if (isset($_POST['uaf_use_absolute_font_path'])){
473
- $uaf_use_absolute_font_path = 1;
474
- } else {
475
- $uaf_use_absolute_font_path = '';
476
- }
477
-
478
- if (isset($_POST['uaf_use_alternative_server'])){
479
- $uaf_use_alternative_server = 1;
480
- } else {
481
- $uaf_use_alternative_server = '';
482
- }
483
-
484
- if (isset($_POST['uaf_enable_multi_lang_support'])){
485
- $uaf_enable_multi_lang_support = 1;
486
- } else {
487
- $uaf_enable_multi_lang_support = '';
488
- }
489
-
490
- $uaf_font_display_property = $_POST['uaf_font_display_property'];
491
-
492
- update_option('uaf_disbale_editor_font_list', $uaf_disbale_editor_font_list);
493
- update_option('uaf_use_curl_uploader', $uaf_use_curl_uploader);
494
- update_option('uaf_use_absolute_font_path', $uaf_use_absolute_font_path);
495
- update_option('uaf_use_alternative_server', $uaf_use_alternative_server);
496
- update_option('uaf_enable_multi_lang_support', $uaf_enable_multi_lang_support);
497
- update_option('uaf_font_display_property', $uaf_font_display_property);
498
-
499
- $GLOBALS['uaf_disbale_editor_font_list'] = $uaf_disbale_editor_font_list;
500
- $GLOBALS['uaf_use_curl_uploader'] = $uaf_use_curl_uploader;
501
- $GLOBALS['uaf_use_absolute_font_path'] = $uaf_use_absolute_font_path;
502
- $GLOBALS['uaf_use_alternative_server'] = $uaf_use_alternative_server;
503
- $GLOBALS['uaf_enable_multi_lang_support'] = $uaf_enable_multi_lang_support;
504
- $GLOBALS['uaf_font_display_property'] = $uaf_font_display_property;
505
- uaf_write_css(); // Need to rewrite css for uaf_use_relative_font_path setting change
506
- }
507
-
508
  function uaf_save_font_assign(){
509
  $fontsImplementRawData = get_option('uaf_font_implement');
510
  $fontsImplementData = json_decode($fontsImplementRawData, true);
@@ -536,10 +318,53 @@ function uaf_save_font_assign(){
536
  return $return;
537
  }
538
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  function uaf_delete_font_assign(){
540
  $fontsImplementRawData = get_option('uaf_font_implement');
541
  $fontsImplementData = json_decode($fontsImplementRawData, true);
542
- $key_to_delete = $_GET['delete_implement_key'];
543
  unset($fontsImplementData[$key_to_delete]);
544
  $updateFontsImplementData = json_encode($fontsImplementData);
545
  update_option('uaf_font_implement',$updateFontsImplementData);
@@ -547,13 +372,4 @@ function uaf_delete_font_assign(){
547
  $return['status'] = 'success';
548
  $return['body'] = 'Font assign removed';
549
  return $return;
550
- }
551
-
552
- if (!function_exists('array_key_first')) { // FOR OLDER VERSION PHP SUPPORT
553
- function array_key_first(array $arr) {
554
- foreach($arr as $key => $unused) {
555
- return $key;
556
- }
557
- return NULL;
558
- }
559
  }
1
  <?php
2
+ function uaf_count_uploaded_fonts(){
3
+ $fontsRawData = get_option('uaf_font_data');
4
+ $fontsData = json_decode($fontsRawData, true);
5
+ return count($fontsData);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
7
 
8
+ function uaf_get_uploaded_font_data(){
9
+ $fontsRawData = get_option('uaf_font_data');
10
+ return json_decode($fontsRawData, true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  }
12
 
13
  function uaf_save_font_files($font_name, $convertResponse){
14
+ uaf_create_folder(); // CREATE FOLDER IF DOESN"T EXISTS
15
  $uafPath = uaf_path_details();
16
  $fontNameToStore = sanitize_file_name(rand(0,9999).$font_name);
17
 
71
  return $fontUploadFinalResponse;
72
  }
73
 
74
+ function uaf_upload_font_to_server(){
75
+ $font_file_details = pathinfo($_FILES['font_file']['name']);
76
+ $file_extension = strtolower($font_file_details['extension']);
77
+ $font_size = $_FILES['font_file']['size'];
78
+
79
+ if ((in_array($file_extension, $GLOBALS['uaf_fix_settings']['allowedFontFormats'])) && ($font_size <= uaf_max_upload_size_for_php(true))){
80
+ @set_time_limit(0);
81
+ $ch = curl_init();
82
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
83
+ curl_setopt($ch, CURLOPT_URL, $GLOBALS['uaf_user_settings']['uaf_server_url'].'/uaf_convertor/convert.php');
84
+ curl_setopt($ch, CURLOPT_POST, true);
85
+ curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
86
+ $post = array(
87
+ 'fontfile' => new CURLFile($_FILES['font_file']['tmp_name']),
88
+ 'fontfileext' => pathinfo($_FILES['font_file']['name'], PATHINFO_EXTENSION),
89
+ 'api_key' => $GLOBALS['uaf_user_settings']['uaf_api_key'],
90
+ 'url' => $_POST['url'],
91
+ 'font_count' => $_POST['font_count']
92
+ );
93
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
94
+ $convertResponse = curl_exec($ch);
95
+ if(curl_errno($ch)) {
96
+ $fontUploadResponse['status'] = 'error';
97
+ $fontUploadResponse['body'] = 'Error: ' . curl_error($ch);
98
+ } else {
99
+ $CrulStatinfo = curl_getinfo($ch);
100
+ if ($CrulStatinfo['http_code'] == '200'):
101
+ $convertResponseArray = json_decode($convertResponse, true);
102
+ if ($convertResponseArray['global']['status'] == 'error'):
103
+ $fontUploadResponse['status'] = 'error';
104
+ $fontUploadResponse['body'] = $convertResponseArray['global']['msg'];
105
+ else:
106
+ $fontUploadResponse['status'] = 'success';
107
+ $fontUploadResponse['body'] = $convertResponse;
108
+ endif;
109
+ else:
110
+ $fontUploadResponse['status'] = 'error';
111
+ $fontUploadResponse['body'] = $convertResponse;
112
+ endif;
113
+ }
114
+ } else {
115
+ $fontUploadResponse['status'] = 'error';
116
+ $fontUploadResponse['body'] = 'Only '.join(", ",$GLOBALS['uaf_fix_settings']['allowedFontFormats']).' format and font less than '.uaf_max_upload_size_for_php().' MB accepted';
117
+ }
118
+ return $fontUploadResponse;
119
+ }
120
+
121
+ function uaf_path_details(){
122
+ $uaf_upload = wp_upload_dir();
123
+ $uaf_upload_dir = $uaf_upload['basedir'];
124
+ $uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
125
+ $uaf_upload_url = $uaf_upload['baseurl'];
126
+ $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
127
+
128
+ $pathReturn['dir'] = $uaf_upload_dir;
129
+ $pathReturn['url'] = $uaf_upload_url;
130
+ return $pathReturn;
131
+ }
132
+
133
+ function uaf_create_folder() {
134
+ $uaf_upload_path = uaf_path_details();
135
+ if (! is_dir($uaf_upload_path['dir'])) {
136
+ mkdir( $uaf_upload_path['dir'], 0755 );
137
+ }
138
+ }
139
+
140
  function uaf_save_font_entry_to_db($font_name, $font_path){
141
  $fontsRawData = get_option('uaf_font_data');
142
  $fontsData = json_decode($fontsRawData, true);
150
  uaf_write_css();
151
  }
152
 
153
+ function uaf_write_css(){
154
+ $uaf_use_absolute_font_path = $GLOBALS['uaf_user_settings']['uaf_use_absolute_font_path']; // Check if user want to use absolute font path.
155
+
156
+ if (empty($uaf_use_absolute_font_path)){
157
+ $uaf_use_absolute_font_path = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
+
160
+ $uaf_upload_path = uaf_path_details();
161
+ $uaf_upload_dir = $uaf_upload_path['dir'];
162
+ $uaf_upload_url = $uaf_upload_path['url'];
163
+ //$uaf_upload_url = preg_replace('#^https?:#', '', $uaf_upload_path['url']);
164
+
165
 
166
+ if ($uaf_use_absolute_font_path == 0){ // If user use relative path
167
+ $url_parts = parse_url($uaf_upload_url);
168
+ @$uaf_upload_url = "$url_parts[path]$url_parts[query]$url_parts[fragment]";
169
+ }
170
 
171
+ ob_start();
172
+ $fontsData = uaf_get_uploaded_font_data();
173
+ if (!empty($fontsData)):
174
+ foreach ($fontsData as $key=>$fontData): ?>
175
+ @font-face {
176
+ font-family: '<?php echo $fontData['font_name'] ?>';
177
+ src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff2') format('woff2'),
178
+ <?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
179
+ font-display: <?php echo $GLOBALS['uaf_user_settings']['uaf_font_display_property']; ?>;
180
+ }
 
 
 
 
 
 
 
 
181
 
182
+ .<?php echo $fontData['font_name'] ?>{font-family: '<?php echo $fontData['font_name'] ?>' !important;}
 
183
 
184
+ <?php
185
+ endforeach;
186
+ endif;
187
+
188
+ $fontsImplementRawData = get_option('uaf_font_implement');
189
+ $fontsImplementData = json_decode($fontsImplementRawData, true);
190
+ if (!empty($fontsImplementData)):
191
+ foreach ($fontsImplementData as $key=>$fontImplementData): ?>
192
+ <?php echo $fontImplementData['font_elements']; ?>{
193
+ font-family: '<?php echo $fontsData[$fontImplementData['font_key']]['font_name']; ?>' !important;
194
+ }
195
+ <?php
196
+ endforeach;
197
+ endif;
198
+ $uaf_style = ob_get_contents();
199
+ $uafStyleSheetPath = $uaf_upload_path['dir'].'/uaf.css';
200
+ $fh = fopen($uafStyleSheetPath, 'w') or die("Can't open file");
201
+ fwrite($fh, $uaf_style);
202
+ fclose($fh);
203
+ ob_end_clean();
204
 
205
+ ob_start();
206
+ $fontsData = uaf_get_uploaded_font_data();
207
+ if (!empty($fontsData)):
208
+ foreach ($fontsData as $key=>$fontData): ?>
209
+ @font-face {
210
+ font-family: '<?php echo $fontData['font_name'] ?>';
211
+ src: <?php if (file_exists($uaf_upload_dir.$fontData['font_path'].'.woff2')){ ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff2') format('woff2'),
212
+ <?php } ?>url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
213
+ }
214
 
215
+ .<?php echo $fontData['font_name'] ?>{font-family: '<?php echo $fontData['font_name'] ?>' !important;}
 
 
 
 
216
 
217
+ .et_gf_<?php echo $fontData['font_name'] ?>{background:none !important;font-family:<?php echo $fontData['font_name'] ?>;text-indent:0 !important;font-size:25px;}
218
+
219
+ <?php
220
+ endforeach;
221
+ endif;
222
+ $uaf_style = ob_get_contents();
223
+ $uafStyleSheetPath = $uaf_upload_path['dir'].'/admin-uaf.css';
224
+ $fh = fopen($uafStyleSheetPath, 'w') or die("Can't open file");
225
+ fwrite($fh, $uaf_style);
226
+ fclose($fh);
227
+
228
+ $uafStyleSheetPath = $uaf_upload_path['dir'].'/admin-uaf-rtl.css';
229
+ $fh = fopen($uafStyleSheetPath, 'w') or die("Can't open file");
230
+ fwrite($fh, $uaf_style);
231
+ fclose($fh);
232
+ ob_end_clean();
233
+ update_option('uaf_css_updated_timestamp', time()); // Time entry for stylesheet version
234
+ update_option('uaf_site_url', base64_encode(home_url()));
235
  }
236
 
237
+
238
  function uaf_get_language_selector(){
239
  $enableMultiLang = '';
240
  $returnSelectHTML = '';
241
+ if ($GLOBALS['uaf_user_settings']['uaf_enable_multi_lang_support'] == 1){
242
  $enableMultiLang = TRUE;
243
+ $supported_multi_lang_plugins = $GLOBALS['uaf_fix_settings']['supported_multi_lang_plugins'];
244
  foreach ($supported_multi_lang_plugins as $key => $plugin_name) {
245
  if (is_plugin_active($plugin_name)){
246
  $active_multi_lang_plugin = $plugin_name;
287
  return $return;
288
  }
289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  function uaf_save_font_assign(){
291
  $fontsImplementRawData = get_option('uaf_font_implement');
292
  $fontsImplementData = json_decode($fontsImplementRawData, true);
318
  return $return;
319
  }
320
 
321
+ function uaf_langutizse_elements($finalElements){
322
+ if (isset($_POST['language']) && ($_POST['language'] != 'all_lang')){
323
+ $finalElementArray = explode(',', $finalElements);
324
+ $finalElementArray = array_map('trim', $finalElementArray);
325
+ $prefixed_array = preg_filter('/^/', $_POST['language'].' ', $finalElementArray);
326
+ $finalElements = join(', ', $prefixed_array);
327
+ }
328
+ return $finalElements;
329
+ }
330
+
331
+ function uaf_delete_font(){
332
+ $uaf_paths = uaf_path_details();
333
+
334
+ $fontsData = uaf_get_uploaded_font_data();
335
+ $key_to_delete = $_GET['delete_font_key'];
336
+
337
+ @unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff2'));
338
+ @unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.woff'));
339
+ @unlink(realpath($uaf_paths['dir'].$fontsData[$key_to_delete]['font_path'].'.eot'));
340
+ unset($fontsData[$key_to_delete]);
341
+ $updateFontData = json_encode($fontsData);
342
+ update_option('uaf_font_data',$updateFontData);
343
+
344
+ $fontsImplementRawData = get_option('uaf_font_implement');
345
+ $fontsImplementData = json_decode($fontsImplementRawData, true);
346
+
347
+ if (!empty($fontsImplementData)){
348
+ foreach ($fontsImplementData as $implement_key => $font_assign_array) {
349
+ if ($key_to_delete == $font_assign_array['font_key']){
350
+ unset($fontsImplementData[$implement_key]);
351
+ }
352
+ }
353
+
354
+ $updatefontsImplementData = json_encode($fontsImplementData);
355
+ update_option('uaf_font_implement',$updatefontsImplementData);
356
+ }
357
+
358
+ $return['status'] = 'success';
359
+ $return['body'] = 'Font Deleted';
360
+ uaf_write_css();
361
+ return $return;
362
+ }
363
+
364
  function uaf_delete_font_assign(){
365
  $fontsImplementRawData = get_option('uaf_font_implement');
366
  $fontsImplementData = json_decode($fontsImplementRawData, true);
367
+ $key_to_delete = $_GET['delete_font_assign_key'];
368
  unset($fontsImplementData[$key_to_delete]);
369
  $updateFontsImplementData = json_encode($fontsImplementData);
370
  update_option('uaf_font_implement',$updateFontsImplementData);
372
  $return['status'] = 'success';
373
  $return['body'] = 'Font assign removed';
374
  return $return;
 
 
 
 
 
 
 
 
 
375
  }
includes/uaf_config.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $GLOBALS['uaf_current_version'] = '6.0';
4
+
5
+
6
+ $GLOBALS['uaf_fix_settings'] = array(
7
+ 'allowedFontFormats' => array ('ttf','otf','woff'),
8
+ 'allowedFontSize' => 25, // IN MB
9
+ 'serverUrl' => array(
10
+ 'default' => 'https://server2.dnesscarkey.org',
11
+ 'alternative' => 'https://server3.dnesscarkey.org'
12
+ ),
13
+ 'supported_multi_lang_plugins' => array(
14
+ 'polylang/polylang.php', // POLYLANG
15
+ 'polylang-pro/polylang.php', // POLYLANG PRO
16
+ 'sitepress-multilingual-cms/sitepress.php' //WPML
17
+ )
18
+
19
+ );
20
+
21
+
22
+ $GLOBALS['uaf_user_settings'] = array(
23
+ 'uaf_api_key' => '',
24
+ 'uaf_server_url_type' => 'default',
25
+ 'uaf_activated_url' => '',
26
+ 'uaf_site_url' => '',
27
+ 'uaf_uploader_type' => 'js', // js or php (all small)
28
+ 'uaf_font_display_property' => 'auto',
29
+ 'uaf_enable_multi_lang_support' => '0',
30
+ 'uaf_disbale_editor_font_list' => '0',
31
+ 'uaf_use_absolute_font_path' => '1'
32
+ );
33
+ ?>
includes/uaf_font_upload_js.php DELETED
@@ -1,57 +0,0 @@
1
- <table class="wp-list-table widefat fixed bookmarks">
2
- <thead>
3
- <tr>
4
- <th><strong>Upload Fonts</strong></th>
5
- </tr>
6
- </thead>
7
- <tbody>
8
- <tr>
9
- <td>
10
-
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>
18
- <td><input type="text" name="font_name" value="" maxlength="20" class="uaf_required" style="width:200px;" /></td>
19
- </tr>
20
- <tr>
21
- <td>Font File</td>
22
- <td><input type="file" id="fontfile" name="fontfile" value="" class="uaf_required" accept=".woff,.ttf,.otf" /><br/>
23
- <?php
24
-
25
- ?>
26
- <em>Accepted Font Format : <?php echo join(", ",$GLOBALS['allowedFontFormats']); ?> | Font Size: Upto <?php echo $GLOBALS['allowedFontSize'] ?> MB</em><br/>
27
-
28
- </td>
29
- </tr>
30
- <tr>
31
- <td>&nbsp;
32
-
33
- </td>
34
- <td>
35
- <input type="hidden" name="url" value="<?php echo home_url(); ?>" />
36
- <input type="hidden" name="api_key" value="<?php echo $GLOBALS['uaf_api_key']; ?>" />
37
- <input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
38
- <input type="hidden" name="convert_response" id="convert_response" value="" />
39
- <input type="hidden" name="submit-uaf-font-js" id="submit-uaf-font" value="Upload" />
40
- <input type="submit" name="submit-uaf-font-js" id="submit-uaf-font" class="button-primary" value="Upload" />
41
-
42
- <div id="font_upload_message" class=""></div>
43
- <p>By clicking on Upload, you confirm that you have rights to use this font.</p>
44
- </td>
45
- </tr>
46
- </table>
47
- </form>
48
- <br/><br/>
49
- </div>
50
-
51
- <?php include('uaf_uploaded_font_list.php'); ?>
52
- <br/>
53
- </td>
54
- </tr>
55
- </tbody>
56
- </table>
57
- <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/uaf_font_upload_php.php DELETED
@@ -1,55 +0,0 @@
1
- <table class="wp-list-table widefat fixed bookmarks">
2
- <thead>
3
- <tr>
4
- <th><strong>Upload Fonts</strong></th>
5
- </tr>
6
- </thead>
7
- <tbody>
8
- <tr>
9
- <td>
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>
17
- <td><input type="text" name="font_name" value="" maxlength="20" class="uaf_required" style="width:200px;" /></td>
18
- </tr>
19
- <tr>
20
- <td>Font File</td>
21
- <td><input type="file" name="font_file" id="font_file" value="" class="uaf_required" accept=".woff,.ttf,.otf" /><br/>
22
- <?php
23
-
24
- ?>
25
- <em>Accepted Font Format : <?php echo join(", ",$GLOBALS['allowedFontFormats']); ?> | Font Size: Upto <?php echo uaf_max_upload_size_for_php(); ?>MB</em><br/>
26
-
27
- </td>
28
- </tr>
29
- <tr>
30
- <td>&nbsp;
31
-
32
- </td>
33
- <td>
34
-
35
- <input type="hidden" name="url" value="<?php echo home_url(); ?>" />
36
- <input type="hidden" name="api_key" value="<?php echo $uaf_api_key; ?>" />
37
- <input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
38
- <input type="submit" name="submit-uaf-font-php" class="button-primary" value="Upload" />
39
-
40
-
41
- <p>By clicking on Upload, you confirm that you have rights to use this font.</p>
42
- </td>
43
- </tr>
44
- </table>
45
- </form>
46
- <br/><br/>
47
- </div>
48
-
49
- <?php include('uaf_uploaded_font_list.php'); ?>
50
-
51
- <br/>
52
- </td>
53
- </tr>
54
- </tbody>
55
- </table><br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/uaf_footer.php DELETED
@@ -1,266 +0,0 @@
1
- <?php
2
- $server_status = $GLOBALS['uaf_server_status'];
3
- if (isset($_POST['test_server']) || empty($server_status)){
4
- if (in_array ('curl', get_loaded_extensions())) {
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_get_server_url().'/uaf_convertor/php_server_check.php');
9
- curl_setopt($ch_test, CURLOPT_POST, true);
10
- $post = array(
11
- 'test_code' => $test_code
12
- );
13
- curl_setopt($ch_test, CURLOPT_POSTFIELDS, $post);
14
- $response = curl_exec($ch_test);
15
- if(curl_errno($ch_test)) {
16
- $server_err_stat = 'test_error';
17
- $server_err_msg = '<strong>Error</strong>: ' . curl_error($ch_test);
18
- }
19
- else {
20
- $http_code = curl_getinfo($ch_test, CURLINFO_HTTP_CODE);
21
- if ($http_code == 200) {
22
- if ($test_code == $response){
23
- $server_err_stat = 'test_successfull';
24
- $server_err_msg = '';
25
- } else {
26
- $server_err_stat = 'test_error';
27
- $server_err_msg = '<strong>Error</strong>: Sorry couldnot get response back from the server.';
28
- }
29
- } else {
30
- $server_err_stat = 'test_error';
31
- $server_err_msg = '<strong>Error</strong>: ' .$response;
32
- }
33
- }
34
- } else {
35
- $server_err_stat = 'test_error';
36
- $server_err_msg = '<strong>Error</strong>: Curl not enabled in your server.';
37
- }
38
- update_option('uaf_server_status', $server_err_stat);
39
- update_option('uaf_server_msg', $server_err_msg);
40
- $GLOBALS['uaf_server_status'] = $server_err_stat;
41
- $GLOBALS['uaf_server_msg'] = $server_err_msg;
42
- }
43
- ?>
44
- <br/>
45
- <table class="wp-list-table widefat fixed bookmarks uaf_form">
46
- <thead>
47
- <tr>
48
- <th><strong>Additional Settings (Usually not required)</strong></th>
49
- </tr>
50
- </thead>
51
- <tbody>
52
- <form method="post" action="">
53
- <tr>
54
- <td>
55
- <input type="checkbox" name="uaf_use_alternative_server" value="1" <?php echo $GLOBALS['uaf_use_alternative_server'] == 1?'checked=checked':''; ?> /> Use alternative server. <strong><em>( When you are unable to upload the font using both Default Js and PHP Uploader or verify API key. )</em></strong>
56
- </td>
57
- </tr>
58
-
59
- <tr>
60
- <td>
61
- <input type="checkbox" name="uaf_use_curl_uploader" value="1" <?php echo $GLOBALS['uaf_use_curl_uploader'] == 1?'checked=checked':''; ?> /> Use PHP uploader. <em>Need PHP Curl. </em><strong><em>( Only if default javascript uploader doesn't work. )</em></strong>
62
- </td>
63
- </tr>
64
-
65
- <tr>
66
- <td>
67
- <input type="checkbox" name="uaf_use_absolute_font_path" value="1" <?php echo $GLOBALS['uaf_use_absolute_font_path'] == 1?'checked=checked':''; ?> /> Use absolute path for font. <strong><em>( Better to enable if you are using Cache or Minify plugins. )</em></strong>
68
- </td>
69
- </tr>
70
-
71
- <tr>
72
- <td>
73
- <input type="checkbox" name="uaf_disbale_editor_font_list" value="1" <?php echo $GLOBALS['uaf_disbale_editor_font_list'] == 1?'checked=checked':''; ?> /> Disable Font list in wordpress editor. <strong><em>( When you have conflict with wordpress editor. )</em></strong>
74
- </td>
75
- </tr>
76
-
77
- <tr>
78
- <td>
79
- <input type="checkbox" name="uaf_enable_multi_lang_support" value="1" <?php echo $GLOBALS['uaf_enable_multi_lang_support'] == 1?'checked=checked':''; ?> />Enable Multi Language Font Support <strong><em>( When you are using multi language and need to set different font based on language. Currently Supported : WPML & Polylang )</em></strong>
80
- </td>
81
- </tr>
82
-
83
- <tr>
84
-
85
- <td>
86
- <select name="uaf_font_display_property">
87
- <option value="auto" <?php echo $GLOBALS['uaf_font_display_property'] == "auto"?'selected=selected':''; ?>>auto</option>
88
- <option value="block" <?php echo $GLOBALS['uaf_font_display_property'] == "block"?'selected=selected':''; ?>>block</option>
89
- <option value="swap" <?php echo $GLOBALS['uaf_font_display_property'] == "swap"?'selected=selected':''; ?>>swap</option>
90
- <option value="fallback" <?php echo $GLOBALS['uaf_font_display_property'] == "fallback"?'selected=selected':''; ?>>fallback</option>
91
- </select>
92
- Font Display Property
93
- </td>
94
- </tr>
95
-
96
-
97
- <tr>
98
- <td><input type="submit" name="submit-uaf-settings" class="button-primary" value="Save Settings" /></td>
99
- </tr>
100
- </form>
101
-
102
- </tbody>
103
- </table>
104
-
105
- <br/>
106
- <table class="wp-list-table widefat fixed bookmarks">
107
- <thead>
108
- <tr>
109
- <th><strong>Instructions</strong></th>
110
- </tr>
111
- </thead>
112
- <tbody>
113
- <tr>
114
- <td>
115
- <ol>
116
- <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/>
117
- <em><strong>Note:</strong> API key is needed to connect to our server for font conversion.</em>
118
- </li>
119
-
120
- <li>Upload your font in supported format from <strong>Upload Fonts</strong> section. The required font format will be converted automatically by the plugin and stores in your server.
121
- <em><strong>Note:</strong> We don't store any font in our server. We delete the temporary files after conversion has been done.</em>
122
- </li>
123
-
124
- <li>Assign your font to you html elements from <strong>Assign Font</strong> section.</li>
125
-
126
- <li>You can also assign uploaded font directly from Post/Page Wordpress Editor.</li>
127
-
128
- <li>If you still have any problem visit our <a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">support forum</a> or you can write to us directly using our contact form.</li>
129
-
130
- </ol>
131
- </td>
132
- </tr>
133
- </tbody>
134
- </table>
135
-
136
- </td>
137
- <td width="15">&nbsp;</td>
138
- <td width="250" valign="top">
139
- <?php if ($GLOBALS['uaf_use_curl_uploader'] == 1): ?>
140
- <table class="wp-list-table widefat fixed bookmarks">
141
- <thead>
142
- <tr>
143
- <th><strong>Server Connectivity Test</strong><strong></th>
144
- </tr>
145
- </thead>
146
- <tbody>
147
- <tr>
148
- <td>
149
- <div id="server_status" class="<?php echo $GLOBALS['uaf_server_status']; ?>">
150
- <?php echo str_replace('_',' ',$GLOBALS['uaf_server_status']); ?>
151
- </div>
152
-
153
- <?php if ($GLOBALS['uaf_server_status'] == 'test_error'): ?>
154
- <div class="uaf_test_msg"><?php echo $GLOBALS['uaf_server_msg']; ?></div>
155
- <?php endif; ?>
156
-
157
-
158
- <form action="admin.php?page=uaf_settings_page" method="post">
159
- <p align="center">
160
- <input type="submit" value="Test Again" class="button-primary" name="test_server" />
161
- </p>
162
- </form>
163
- </td>
164
- </tr>
165
- </tbody>
166
- </table>
167
- <br/>
168
- <?php endif; ?>
169
- <table class="wp-list-table widefat fixed bookmarks">
170
- <thead>
171
- <tr>
172
- <th><strong>WP Armour - Anti Spam Plugin</strong></th>
173
- </tr>
174
- </thead>
175
- <tbody>
176
- <tr>
177
- <td>
178
- Block spam bots effectively in your forms, comments without using Captcha verification.
179
- <br/><br/>
180
- <strong>It Works With.</strong>
181
- <ul class="uaf_list">
182
- <li>WP Comments, Registraton</li>
183
- <li>Contact Form 7, Ninja Forms</li>
184
- <li>Gravity Forms, WPForms</li>
185
- <li>BBPress Forums, Caldera Forms</li>
186
- <li>Formidable Forms</li>
187
- </ul>
188
-
189
- Just install and activate to block spams. No additional settings required.
190
-
191
- <p align="right"><br/><a href="<?php echo admin_url('plugin-install.php?s=WP+Armour&tab=search'); ?>" target="_blank" class="button-primary">Install Now ( Free )</a><p>
192
- </td>
193
- </tr>
194
- </tbody>
195
- </table>
196
- <br/>
197
-
198
- <table class="wp-list-table widefat fixed bookmarks">
199
- <thead>
200
- <tr>
201
- <th><strong>Have Problem ?</strong></th>
202
- </tr>
203
- </thead>
204
- <tbody>
205
- <tr>
206
- <td>
207
- <ul class="uaf_list">
208
- <li><a href="https://dineshkarki.com.np/use-any-font/instructions" target="_blank">Setup Instructions</a></li>
209
- <li><a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">Support Forum</a></li>
210
- <li><a href="https://dineshkarki.com.np/contact" target="_blank">Rectify My Problem / Contact Us</a></li>
211
- <li><a href="https://bit.ly/2wYjOyj" target="_blank">Download Free Fonts</a></li>
212
- </ul>
213
- </td>
214
- </tr>
215
- </tbody>
216
- </table>
217
- <br/>
218
- <!--
219
- <table class="wp-list-table widefat fixed bookmarks">
220
- <thead>
221
- <tr>
222
- <th>Some Other Plugins</th>
223
- </tr>
224
- </thead>
225
- <tbody>
226
- <tr>
227
- <td style="padding:4px;">
228
- <a href="http://goo.gl/3XDDzi" target="_blank"><img width="240" alt="Create Masonry Brick Shortcode" src="<?php echo plugins_url("use-any-font/images/wp_masonry_layout.gif"); ?>" class="aligncenter size-full wp-image-426"></a>
229
- </td>
230
- </tr>
231
- </tbody>
232
- </table>
233
- <br/>-->
234
-
235
-
236
-
237
- <table class="wp-list-table widefat fixed bookmarks">
238
- <thead>
239
- <tr>
240
- <th><strong>Plugins You May Like</strong></th>
241
- </tr>
242
- </thead>
243
- <tbody>
244
- <tr>
245
- <td>
246
- <ul class="uaf_list">
247
- <li><a href="http://goo.gl/3XDDzi" target="_blank">WP Masonry Layout</a></li>
248
- <li><a href="http://wordpress.org/extend/plugins/any-mobile-theme-switcher/" target="_blank">Any Mobile Theme Switcher</a></li>
249
- <li><a href="http://wordpress.org/extend/plugins/jquery-validation-for-contact-form-7/" target="_blank">Jquery Validation For Contact Form 7</a></li>
250
- <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
251
- <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
252
- <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
253
- <li><a href="http://wordpress.org/extend/plugins/remove-admin-bar-for-client/" target="_blank">Remove Admin Bar</a></li>
254
- <li><a href="http://wordpress.org/extend/plugins/html-in-category-and-pages/" target="_blank">.html in category and page url</a></li>
255
- </ul>
256
- </td>
257
- </tr>
258
- </tbody>
259
- </table>
260
- <br/>
261
-
262
-
263
- </td>
264
- </tr>
265
- </table>
266
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/uaf_header.php DELETED
@@ -1,42 +0,0 @@
1
- <?php if (!empty($operationMsg)):?>
2
- <div class="updated <?php echo $operationStatus; ?>" id="message"><p><?php echo $operationMsg ?></p></div>
3
- <?php endif; ?>
4
-
5
- <div class="wrap">
6
- <h2>Use Any Font</h2>
7
- <table width="100%">
8
- <tr>
9
- <td valign="top">
10
- <table class="wp-list-table widefat fixed bookmarks">
11
- <thead>
12
- <tr>
13
- <th><strong>API KEY</strong></th>
14
- </tr>
15
- </thead>
16
- <tbody>
17
- <tr>
18
- <td>
19
- <form action="admin.php?page=uaf_settings_page" method="post" id="uaf_api_key_form" >
20
- API KEY :
21
- <?php if (empty($GLOBALS['uaf_api_key'])): ?>
22
- <input name="uaf_api_key" id="uaf_api_key" type="text" style="width:325px; margin-left:50px;" />
23
- <input type="submit" name="ucf_api_key_submit" class="button-primary" value="Verify" />
24
- <input type="button" name="uaf_api_key_generate" id="uaf_api_key_generate" class="button-primary" value="Generate Free Lite / Test API Key" onclick="uaf_lite_api_key_generate();" />
25
- <a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank" class="button-primary">Get Premium Key</a>
26
-
27
- <br/> <br/>
28
- 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.
29
- <br/>
30
- <?php else: ?>
31
- <span class="active_key"><?php echo $GLOBALS['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('Are you sure ?')){return false;}" />
32
- <?php endif;?>
33
- </form>
34
- <br/>
35
- <strong>Note</strong> : API key is need to connect to our server for font conversion. Our server converts your fonts to required types and sends it back.
36
- <br/><br/>
37
- </td>
38
-
39
- </tr>
40
- </tbody>
41
- </table>
42
- <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/uaf_trigger_actions.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
- if (isset($_POST['submit-uaf-font-php'])){
3
- $fontUploadResponse = uaf_upload_font_to_server();
4
- if ($fontUploadResponse['status'] == 'success'){
5
- $fontUploadResponse = uaf_save_font_files($_POST['font_name'], $fontUploadResponse['body']);
6
- }
7
- $operationStatus = $fontUploadResponse['status'];
8
- $operationMsg = $fontUploadResponse['body'];
9
- }
10
-
11
- if (isset($_POST['submit-uaf-font-js'])){
12
- $fontSaveResponse = uaf_save_font_files($_POST['font_name'], $_POST['convert_response']);
13
- $operationStatus = $fontSaveResponse['status'];
14
- $operationMsg = $fontSaveResponse['body'];
15
- }
16
-
17
- if (isset($_POST['ucf_api_key_submit'])){
18
- $activationRetun = uaf_key_activate();
19
- $operationMsg = $activationRetun['body'];
20
- $operationStatus = $activationRetun['status'];
21
- }
22
-
23
- if (isset($_POST['ucf_api_key_remove'])){
24
- $deactivationRetun = uaf_key_deactivate();
25
- $operationMsg = $deactivationRetun['body'];
26
- $operationStatus = $deactivationRetun['status'];
27
- }
28
-
29
- if (isset($_GET['delete_font_key'])):
30
- $fontDeleteRetun = uaf_delete_font();
31
- $operationMsg = $fontDeleteRetun['body'];
32
- $operationStatus = $fontDeleteRetun['status'];
33
- endif;
34
-
35
- if (isset($_POST['submit-uaf-settings'])){
36
- uaf_save_settings();
37
- $operationMsg = 'Settings Saved';
38
- $operationStatus = 'updated';
39
- }
40
-
41
- if (isset($_POST['submit-uaf-implement'])){
42
- $fontAssignReturn = uaf_save_font_assign();
43
- $operationMsg = $fontAssignReturn['body'];
44
- $operationStatus = $fontAssignReturn['status'];
45
- }
46
-
47
- if (isset($_GET['delete_implement_key'])):
48
- $fontAssignDeleteReturn = uaf_delete_font_assign();
49
- $operationMsg = $fontAssignDeleteReturn['body'];
50
- $operationStatus = $fontAssignDeleteReturn['status'];
51
- endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/views/uaf_api_interface.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="dcform">
2
+ <form action="admin.php?page=use-any-font&tab=api" method="post" id="uaf_api_key_form" >
3
+ <p>
4
+ <label>API Key</label>
5
+
6
+ <span class="field">
7
+ <?php if (empty($GLOBALS['uaf_user_settings']['uaf_api_key'])): ?>
8
+ <input name="uaf_api_key" id="uaf_api_key" type="text" class="large" style="max-width: 400px; width: 100%;" />
9
+ <br/><br/>
10
+ <input type="submit" name="ucf_api_key_activate" class="button-primary" value="Verify" />
11
+ <input type="button" name="uaf_api_key_generate" id="uaf_api_key_generate" class="button-primary" value="Generate Free Lite / Test API Key" onclick="uaf_lite_api_key_generate();" />
12
+ <a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank" class="button-primary">Get Premium Key</a>
13
+ <?php else: ?>
14
+ <span class="active_key"><?php echo $GLOBALS['uaf_user_settings']['uaf_api_key']; ?> - Active</span> <input type="submit" name="ucf_api_key_deactivate" class="button-primary" value="Remove Key" onclick="if(!confirm('Are you sure ?')){return false;}" />
15
+ <?php endif;?>
16
+ </span>
17
+ </p>
18
+
19
+
20
+ <p>
21
+ <br/><br/>
22
+ <strong>Note</strong> : API key is needed to connect to our server for font conversion. Our server converts your fonts to required types and sends it back. 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. Lite / Test API only allow single font conversion.
23
+ </p>
24
+ </form>
25
+ </div>
includes/{uaf_font_implement.php → views/uaf_font_assign.php} RENAMED
@@ -1,21 +1,9 @@
1
- <table class="wp-list-table widefat fixed bookmarks">
2
- <thead>
3
- <tr>
4
- <th><strong>Assign Font</strong></th>
5
- </tr>
6
- </thead>
7
- <tbody>
8
- <tr>
9
- <td>
10
- <?php
11
- $fontsRawData = get_option('uaf_font_data');
12
- $fontsData = json_decode($fontsRawData, true);
13
- ?>
14
 
15
  <p align="right"><input type="button" name="open_assign_font" onClick="open_assign_font();" class="button-primary" id="open_assign_font_button" value="Assign Font" /><br/></p>
16
 
17
  <div id="open_assign_font" style="display:none;">
18
- <form action="admin.php?page=uaf_settings_page" id="open_assign_font_form" method="post">
19
  <table class="uaf_form">
20
 
21
  <tr>
@@ -112,7 +100,7 @@ $fontsData = json_decode($fontsRawData, true);
112
  </tr>
113
  <tr>
114
  <td>&nbsp;</td>
115
- <td><input type="submit" name="submit-uaf-implement" class="button-primary" value="Assign Font" /></td>
116
  </tr>
117
  </table>
118
  </form>
@@ -145,7 +133,7 @@ $fontsImplementData = json_decode($fontsImplementRawData, true);
145
  <td><?php echo $sn; ?></td>
146
  <td><?php echo @$fontsData[$fontImplementData['font_key']]['font_name']; ?></td>
147
  <td><?php echo $fontImplementData['font_elements'] ?></td>
148
- <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>
149
  </tr>
150
  <?php endforeach; ?>
151
  <?php else: ?>
@@ -155,21 +143,4 @@ $fontsImplementData = json_decode($fontsImplementRawData, true);
155
  <?php endif; ?>
156
  </tbody>
157
 
158
- </table>
159
-
160
- <script>
161
- function open_assign_font(){
162
- jQuery('#open_assign_font').toggle('fast');
163
- if (jQuery('#open_assign_font_button').val() == 'Assign Font'){
164
- jQuery('#open_assign_font_button').val('Close Assign Font');
165
- } else {
166
- jQuery('#open_assign_font_button').val('Assign Font');
167
- }
168
- }
169
- </script>
170
-
171
- <br/>
172
- </td>
173
- </tr>
174
- </tbody>
175
  </table>
1
+ <?php $fontsData = uaf_get_uploaded_font_data(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  <p align="right"><input type="button" name="open_assign_font" onClick="open_assign_font();" class="button-primary" id="open_assign_font_button" value="Assign Font" /><br/></p>
4
 
5
  <div id="open_assign_font" style="display:none;">
6
+ <form action="admin.php?page=use-any-font&tab=font_assign" id="open_assign_font_form" method="post">
7
  <table class="uaf_form">
8
 
9
  <tr>
100
  </tr>
101
  <tr>
102
  <td>&nbsp;</td>
103
+ <td><input type="submit" name="submit-uaf-font-assign" class="button-primary" value="Assign Font" /></td>
104
  </tr>
105
  </table>
106
  </form>
133
  <td><?php echo $sn; ?></td>
134
  <td><?php echo @$fontsData[$fontImplementData['font_key']]['font_name']; ?></td>
135
  <td><?php echo $fontImplementData['font_elements'] ?></td>
136
+ <td><a onclick="if (!confirm('Are you sure ?')){return false;}" href="admin.php?page=use-any-font&tab=font_assign&delete_font_assign_key=<?php echo $key; ?>">Delete</a></td>
137
  </tr>
138
  <?php endforeach; ?>
139
  <?php else: ?>
143
  <?php endif; ?>
144
  </tbody>
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  </table>
includes/views/uaf_font_upload_js.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
2
+
3
+
4
+ <div id="font-upload" style="display:none;">
5
+ <div class="dcform">
6
+ <?php if (!empty($GLOBALS['uaf_user_settings']['uaf_api_key'])) : ?>
7
+ <form action="admin.php?page=use-any-font&tab=font_upload" id="open_add_font_form_js" method="post" enctype="multipart/form-data">
8
+ <p>
9
+ <label>Font Name *</label>
10
+ <span class="field">
11
+ <input type="text" name="font_name" value="" maxlength="20" class="uaf_required medium"/>
12
+ <span class="field_error">Please give font name.</span>
13
+ </span>
14
+ </p>
15
+
16
+ <p>
17
+ <label>Font File *</label>
18
+ <span class="field">
19
+ <input type="file" id="fontfile" name="fontfile" value="" class="uaf_required" accept=".woff,.ttf,.otf" />
20
+ <span class="field_error">Please select font file.</span>
21
+ <br/>
22
+ <em>Accepted Font Format : <?php echo join(", ",$GLOBALS['uaf_fix_settings']['allowedFontFormats']); ?> | Font Size: Upto <?php echo $GLOBALS['uaf_fix_settings']['allowedFontSize'] ?> MB</em><br/>
23
+ </span>
24
+ </p>
25
+ <p>
26
+ <label>&nbsp;</label>
27
+ <span class="field">
28
+ <span id="font_upload_message" class=""></span>
29
+ <input type="hidden" name="url" value="<?php echo base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']); ?>" />
30
+ <input type="hidden" name="api_key" value="<?php echo $GLOBALS['uaf_user_settings']['uaf_api_key']; ?>" />
31
+ <input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
32
+ <input type="hidden" name="convert_response" id="convert_response" value="" />
33
+ <input type="hidden" name="submit-uaf-font-js" id="submit-uaf-font" value="Upload" />
34
+ <input type="submit" name="submit-uaf-font-js" id="submit-uaf-font" class="button-primary" value="Upload" />
35
+
36
+ <br/>
37
+ <span>By clicking on Upload, you confirm that you have rights to use this font.</span>
38
+ </span>
39
+ </p>
40
+ </form>
41
+ <?php else: ?>
42
+ <div class="dcinfo"><p>You need to add API key in <a href="admin.php?page=use-any-font&tab=api">API key</a> section to upload the fonts.</p></div>
43
+ <?php endif; ?>
44
+ </div>
45
+ </div>
46
+
47
+ <?php include('uaf_uploaded_font_list.php'); ?>
includes/views/uaf_font_upload_php.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="right"><input type="button" name="open_add_font" onClick="open_add_font();" class="button-primary" value="Add Fonts" /><br/></p>
2
+
3
+ <div id="font-upload" style="display:none;">
4
+ <div class="dcform">
5
+
6
+ <?php if (!empty($GLOBALS['uaf_user_settings']['uaf_api_key'])) : ?>
7
+ <form action="admin.php?page=use-any-font&tab=font_upload" id="open_add_font_form_php" method="post" enctype="multipart/form-data">
8
+
9
+ <p>
10
+ <label>Font Name *</label>
11
+ <span class="field">
12
+ <input type="text" name="font_name" value="" maxlength="20" class="uaf_required medium"/>
13
+ <span class="field_error">Please give font name.</span>
14
+ </span>
15
+ </p>
16
+ <p>
17
+ <label>Font File *</label>
18
+ <span class="field">
19
+ <input type="file" name="font_file" id="font_file" value="" class="uaf_required" accept=".woff,.ttf,.otf" />
20
+ <span class="field_error">Please select font file.</span>
21
+ <br/>
22
+ <em>Accepted Font Format : <?php echo join(", ",$GLOBALS['uaf_fix_settings']['allowedFontFormats']); ?> | Font Size: Upto <?php echo uaf_max_upload_size_for_php(); ?>MB</em>
23
+ </span>
24
+ </p>
25
+
26
+ <p>
27
+ <label>&nbsp;</label>
28
+ <span class="field">
29
+ <input type="hidden" name="url" value="<?php echo base64_decode($GLOBALS['uaf_user_settings']['uaf_activated_url']); ?>" />
30
+ <input type="hidden" name="api_key" value="<?php echo $GLOBALS['uaf_user_settings']['uaf_api_key']; ?>" />
31
+ <input type="hidden" name="font_count" value="<?php echo uaf_count_uploaded_fonts(); ?>" />
32
+ <input type="submit" name="submit-uaf-font-php" class="button-primary" value="Upload" />
33
+ <br/>
34
+ <span>By clicking on Upload, you confirm that you have rights to use this font.</span>
35
+ </span>
36
+
37
+ </p>
38
+ </form>
39
+ <?php else: ?>
40
+ <div class="dcinfo"><p>You need to add API key in <a href="admin.php?page=use-any-font&tab=api">API key</a> section to upload the fonts.</p></div>
41
+ <?php endif; ?>
42
+ </div>
43
+ </div>
44
+ <?php include('uaf_uploaded_font_list.php'); ?>
includes/views/uaf_instructions.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="dcinstructions">
2
+ <div class="instruct-head">
3
+ Step 1 : Verify API Key
4
+ </div>
5
+
6
+ <div class="instruct-content show">
7
+ You need API key to connect to our server for font upload. From API Key tab, you can generate the Free / Test API key. It allows you to upload single font. For multiple font upload, you can purchase the premium key from <a href="https://dineshkarki.com.np/use-any-font/api-key" target="_blank">here</a>.<br/><br/>
8
+ <em>Note : API key is needed to connect to our server to convert the fonts. Our server converts the fonts to required formats and sends back.</em>
9
+
10
+ </div>
11
+ </div>
12
+
13
+
14
+ <div class="dcinstructions">
15
+ <div class="instruct-head">
16
+ Step 2 : Upload Your Custom Font
17
+ </div>
18
+
19
+ <div class="instruct-content">
20
+ After API key verification is done, you can upload the font.
21
+ <ul>
22
+ <li>Goto Upload Font Tab</li>
23
+ <li>Keep The Font Name as Reference</li>
24
+ <li>Select The font file.</li>
25
+ <li>Click On Upload</li>
26
+ </ul>
27
+ </div>
28
+ </div>
29
+
30
+ <div class="dcinstructions">
31
+ <div class="instruct-head">
32
+ Step 3 : Assign Font to elements
33
+ </div>
34
+
35
+ <div class="instruct-content">
36
+ After you have uploaded the font, you can assign the font to your elements as per needed
37
+ <ul>
38
+ <li>You can assign the font using our Assign Font Tab</li>
39
+ <li>You can select the font and predefined elements to assign the fonts</li>
40
+ <li>Also, our plugin supports most of the popular page builder. You can use those page builders to assign the font as well.</li>
41
+ <li>You can also, enable Multi Language support from Settings Tab if you want to assign the font based on the language. (Currently supported for WPML and Polylang only)</li>
42
+ </ul>
43
+ </div>
44
+ </div>
45
+
46
+ <div class="dcinstructions">
47
+ <div class="instruct-head">
48
+ Still Having Issue ?
49
+ </div>
50
+
51
+ <div class="instruct-content">
52
+ We love to support our plugin as much as developing it. You can contact us using the followin medium.
53
+ <ul>
54
+ <li><a href="https://www.messenger.com/t/77553779916/" target="_blank">Facebook Page Chat</a></li>
55
+ <li><a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">Wordpress.org Support Forum</a></li>
56
+ <li><a href="https://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">Dnesscarkey's Support Forum</a></li>
57
+ <li><a href="https://dineshkarki.com.np/contact" target="_blank">Contact Us</a></li>
58
+ </ul>
59
+ </div>
60
+ </div>
61
+
62
+ <script type="text/javascript">
63
+ jQuery(document).ready(function(){
64
+ jQuery('.instruct-head').click(function(){
65
+ jQuery(this).next('.instruct-content').slideToggle('medium');
66
+ })
67
+ });
68
+ </script>
includes/views/uaf_main.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (isset($_GET['tab'])){
3
+ $currentTab = $_GET['tab'];
4
+ } else {
5
+ $currentTab = 'api';
6
+ }
7
+ ?>
8
+
9
+ <?php
10
+ if (!empty($GLOBALS['uaf_action_return'])):
11
+ $actionReturn = $GLOBALS['uaf_action_return'];
12
+ ?>
13
+ <div class="updated <?php echo $actionReturn['status']; ?>" id="message"><p><?php echo $actionReturn['body']; ?></p></div>
14
+ <?php
15
+ endif;
16
+ ?>
17
+
18
+ <div class="wrap dcwrap">
19
+
20
+ <h1>Use Any Font</h1>
21
+
22
+ <nav class="nav-tab-wrapper">
23
+ <?php foreach ($uaf_tabs as $tabKey => $tabData) { ?>
24
+ <a href="?page=use-any-font&tab=<?php echo $tabKey; ?>" class="nav-tab <?php echo $currentTab == $tabKey?'nav-tab-active':''; ?>"><?php echo $tabData['name']; ?></a>
25
+ <?php } ?>
26
+ </nav>
27
+
28
+ <div class="tab-content">
29
+ <table width="100%" class="noborder">
30
+ <tr>
31
+ <td valign="top" class="leftcontent">
32
+ <?php include($uaf_tabs[$currentTab]['path']); ?>
33
+ </td>
34
+ <td width="15">&nbsp;</td>
35
+ <td width="250" valign="top"><?php include('uaf_sidebar.php'); ?></td>
36
+ </tr>
37
+ </table>
38
+ </div>
39
+
40
+ </div>
includes/views/uaf_settings.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="dcform">
2
+ <form method="post" action="">
3
+ <p>
4
+ <label>Use Alternative Server</label>
5
+ <span class="field">
6
+ <select name="uaf_server_url_type">
7
+ <option value="alternative" <?php echo $GLOBALS['uaf_user_settings']['uaf_server_url_type'] == "alternative"?'selected=selected':''; ?>>Yes</option>
8
+ <option value="default" <?php echo $GLOBALS['uaf_user_settings']['uaf_server_url_type'] == "default"?'selected=selected':''; ?>>No</option>
9
+ </select>
10
+ ( When you are unable to upload the font using both Default Js and PHP Uploader or verify API key. )
11
+ </span>
12
+ </p>
13
+
14
+ <p>
15
+ <label>Use PHP Uploader</label>
16
+ <span class="field">
17
+ <select name="uaf_uploader_type">
18
+ <option value="php" <?php echo $GLOBALS['uaf_user_settings']['uaf_uploader_type'] == "php"?'selected=selected':''; ?>>Yes</option>
19
+ <option value="js" <?php echo $GLOBALS['uaf_user_settings']['uaf_uploader_type'] == "js"?'selected=selected':''; ?>>No</option>
20
+ </select>
21
+ ( Only if default javascript uploader doesn't work. <em>Need PHP Curl. </em> )
22
+ </span>
23
+ </p>
24
+
25
+ <p>
26
+ <label>Use Absolute Font Path</label>
27
+ <span class="field">
28
+ <select name="uaf_use_absolute_font_path">
29
+ <option value="1" <?php echo $GLOBALS['uaf_user_settings']['uaf_use_absolute_font_path'] == "1"?'selected=selected':''; ?>>Yes</option>
30
+ <option value="0" <?php echo $GLOBALS['uaf_user_settings']['uaf_use_absolute_font_path'] == "0"?'selected=selected':''; ?>>No</option>
31
+ </select>
32
+ ( Select No if you want to use relative font path. )
33
+ </span>
34
+ </p>
35
+
36
+ <p>
37
+ <label>Disable Font List in Wordpress Editor</label>
38
+ <span class="field">
39
+ <select name="uaf_disbale_editor_font_list">
40
+ <option value="1" <?php echo $GLOBALS['uaf_user_settings']['uaf_disbale_editor_font_list'] == "1"?'selected=selected':''; ?>>Yes</option>
41
+ <option value="0" <?php echo $GLOBALS['uaf_user_settings']['uaf_disbale_editor_font_list'] == "0"?'selected=selected':''; ?>>No</option>
42
+ </select>
43
+ ( When you have conflict with wordpress editor. )
44
+ </span>
45
+ </p>
46
+
47
+ <p>
48
+ <label>Enable Multi Language Support</label>
49
+ <span class="field">
50
+ <select name="uaf_enable_multi_lang_support">
51
+ <option value="1" <?php echo $GLOBALS['uaf_user_settings']['uaf_enable_multi_lang_support'] == "1"?'selected=selected':''; ?>>Yes</option>
52
+ <option value="0" <?php echo $GLOBALS['uaf_user_settings']['uaf_enable_multi_lang_support'] == "0"?'selected=selected':''; ?>>No</option>
53
+ </select>
54
+ ( When you are using multi language and need to set different font based on language. Currently Supported : WPML & Polylang )
55
+ </span>
56
+ </p>
57
+
58
+ <p>
59
+ <label>Font Display Property</label>
60
+ <span class="field">
61
+ <select name="uaf_font_display_property">
62
+ <option value="auto" <?php echo $GLOBALS['uaf_user_settings']['uaf_font_display_property'] == "auto"?'selected=selected':''; ?>>auto</option>
63
+ <option value="block" <?php echo $GLOBALS['uaf_user_settings']['uaf_font_display_property'] == "block"?'selected=selected':''; ?>>block</option>
64
+ <option value="swap" <?php echo $GLOBALS['uaf_user_settings']['uaf_font_display_property'] == "swap"?'selected=selected':''; ?>>swap</option>
65
+ <option value="fallback" <?php echo $GLOBALS['uaf_user_settings']['uaf_font_display_property'] == "fallback"?'selected=selected':''; ?>>fallback</option>
66
+ </select>
67
+ </span>
68
+ </p>
69
+ <p>
70
+ <label>&nbsp;</label>
71
+ <span class="field">
72
+ <input type="submit" name="save-uaf-options" class="button-primary" value="Save Settings" />
73
+ </span>
74
+ </p>
75
+ </form>
76
+ </div>
includes/views/uaf_sidebar.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(is_plugin_active( 'gravityforms/gravityforms.php' ) && !is_plugin_active( 'jquery-validation-for-gravity-form/jquery-validation-for-gravity-form.php' ) ) { ?>
2
+ <div class="dcwidget">
3
+ <div class="dcwidgetheader">
4
+ jQuery Validation For Gravity Forms
5
+ </div>
6
+ <div class="dcwidgetbody">
7
+ Instant javascript validation for your Gravity Forms.<br>
8
+
9
+ <a href="https://demos.dnesscarkey.com/jquery-validation-for-gravity-forms/" target="_blank">
10
+ <img src="//146140-421025-1-raikfcquaxqncofqfm.stackpathdns.com/wp-content/uploads/2020/10/jquery-validation-gravity.gif" style="max-width: 100%" />
11
+ </a>
12
+ <strong>Key Features</strong>
13
+ <ul class="uaf_list">
14
+ <li>Additional Validation rules</li>
15
+ <li>Custom Code Validation</li>
16
+ <li>Custom Regex Validation</li>
17
+ <li>4 validation error theme</li>
18
+ <li>& more</li>
19
+ </ul>
20
+ <p align="right">
21
+ <a href="https://demos.dnesscarkey.com/jquery-validation-for-gravity-forms/" target="_blank" class="button-primary">Demo</a>
22
+ <a href="https://dineshkarki.com.np/jquery-validation-for-gravity-forms" target="_blank" class="button-primary">Learn More</a>
23
+ </p>
24
+ </div>
25
+ </div>
26
+ <?php } else { ?>
27
+ <div class="dcwidget">
28
+ <div class="dcwidgetheader">
29
+ WP Armour - Anti Spam Plugin
30
+ </div>
31
+ <div class="dcwidgetbody">
32
+ Block spam bots effectively in your forms, comments without using Captcha verification.
33
+ <br/><br/>
34
+ <strong>It Works With.</strong>
35
+ <ul class="uaf_list">
36
+ <li>WP Comments, Registraton</li>
37
+ <li>Contact Form 7, Ninja Forms</li>
38
+ <li>Gravity Forms, WPForms</li>
39
+ <li>BBPress Forums, Caldera Forms</li>
40
+ <li>Formidable Forms</li>
41
+ </ul>
42
+
43
+ Just install and activate to block spams. No additional settings required.
44
+
45
+ <p align="right"><br/><a href="<?php echo admin_url('plugin-install.php?s=WP+Armour&tab=search'); ?>" target="_blank" class="button-primary">Install Now ( Free )</a><p>
46
+ </div>
47
+ </div>
48
+ <?php } ?>
49
+ <!--
50
+ <div class="dcwidget">
51
+ <div class="dcwidgetheader">
52
+ Plugins You May Like
53
+ </div>
54
+ <div class="dcwidgetbody">
55
+ <ul class="uaf_list">
56
+ <li><a href="http://goo.gl/3XDDzi" target="_blank">WP Masonry Layout</a></li>
57
+ <li><a href="http://wordpress.org/extend/plugins/any-mobile-theme-switcher/" target="_blank">Any Mobile Theme Switcher</a></li>
58
+ <li><a href="http://wordpress.org/extend/plugins/jquery-validation-for-contact-form-7/" target="_blank">Jquery Validation For Contact Form 7</a></li>
59
+ <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
60
+ <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
61
+ <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
62
+ <li><a href="http://wordpress.org/extend/plugins/remove-admin-bar-for-client/" target="_blank">Remove Admin Bar</a></li>
63
+ <li><a href="http://wordpress.org/extend/plugins/html-in-category-and-pages/" target="_blank">.html in category and page url</a></li>
64
+ </ul>
65
+ </div>
66
+
67
+ </div>
68
+ -->
69
+
70
+ <div class="dcwidget">
71
+ <div class="dcwidgetheader">
72
+ Having Issue ?
73
+ </div>
74
+ <div class="dcwidgetbody">
75
+ <ul class="uaf_list">
76
+ <li><a href="https://www.messenger.com/t/77553779916/" target="_blank">Facebook Page Chat</a></li>
77
+ <li><a href="https://wordpress.org/support/plugin/use-any-font/" target="_blank">Wordpress.org Support Forum</a></li>
78
+ <li><a href="https://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">Dnesscarkey's Support Forum</a></li>
79
+ <li><a href="https://dineshkarki.com.np/contact" target="_blank">Contact Us</a></li>
80
+ </ul>
81
+ </div>
82
+
83
+ </div>
includes/{uaf_uploaded_font_list.php → views/uaf_uploaded_font_list.php} RENAMED
@@ -10,7 +10,7 @@ if (!empty($fontsData)):
10
  <div class="font_meta">
11
  <div class="font_name"><?php echo ucfirst($fontData['font_name']); ?></div>
12
  <?php /* <div class="class_name"><?php echo $fontData['font_name'] ?></div> */ ?>
13
- <div class="delete_link"><a onclick="if (!confirm('Are you sure ?')){return false;}" href="admin.php?page=uaf_settings_page&delete_font_key=<?php echo $key; ?>">Delete</a></div>
14
  </div>
15
 
16
  <div class="font_demo">
@@ -24,5 +24,5 @@ if (!empty($fontsData)):
24
  <?php endforeach; ?>
25
 
26
  <?php else: ?>
27
- <p>No font found. Please click on Add Fonts to add font</p>
28
  <?php endif; ?>
10
  <div class="font_meta">
11
  <div class="font_name"><?php echo ucfirst($fontData['font_name']); ?></div>
12
  <?php /* <div class="class_name"><?php echo $fontData['font_name'] ?></div> */ ?>
13
+ <div class="delete_link"><a onclick="if (!confirm('Are you sure ?')){return false;}" href="admin.php?page=use-any-font&tab=font_upload&delete_font_key=<?php echo $key; ?>">Delete</a></div>
14
  </div>
15
 
16
  <div class="font_demo">
24
  <?php endforeach; ?>
25
 
26
  <?php else: ?>
27
+ <div class="dcinfo"><p>No font found. Please click on Add Fonts to upload font</p></div>
28
  <?php endif; ?>
plugin_interface.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
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']);
14
- $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
15
- wp_register_style( 'uaf_client_css', $uaf_upload_url.'uaf.css', array(),get_option('uaf_css_updated_timestamp'));
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/';
29
- wp_register_style('uaf-admin-style', plugins_url('use-any-font/css/uaf_admin.css'));
30
- wp_enqueue_style('uaf-admin-style');
31
- wp_register_style('uaf-font-style', $uaf_upload_url.'admin-uaf.css', array(), get_option('uaf_css_updated_timestamp'));
32
- wp_enqueue_style('uaf-font-style');
33
- add_editor_style($uaf_upload_url.'admin-uaf.css');
34
- }
35
-
36
- function uaf_create_menu() {
37
- add_menu_page( 'Use Any Font', 'Use Any Font', 'manage_options', 'uaf_settings_page', 'uaf_settings_page', 'dashicons-editor-textcolor');
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
- }
45
-
46
- function uaf_settings_page() {
47
- global $operationStatus;
48
- global $operationMsg;
49
-
50
- include('includes/uaf_header.php');
51
- if ($GLOBALS['uaf_use_curl_uploader'] == 1){
52
- include('includes/uaf_font_upload_php.php');
53
- } else {
54
- include('includes/uaf_font_upload_js.php');
55
- }
56
- include('includes/uaf_font_implement.php');
57
- include('includes/uaf_footer.php');
58
- }
59
-
60
-
61
- function uaf_editor_setup(){
62
- include('includes/uaf_editor_setup.php');
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1
6
- Stable tag: 5.11.5
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,10 @@ Please do write us after integration and we will add it in our supported list.
143
 
144
  == Changelog ==
145
 
 
 
 
 
146
  = 5.11.5 =
147
  * Remove optional option from font display property
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.6
6
+ Stable tag: 6.0
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
+ = 6.0 =
147
+ * New UI interface
148
+ * Fixed CDN issue.
149
+
150
  = 5.11.5 =
151
  * Remove optional option from font display property
152
 
uaf_config.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- $GLOBALS['allowedFontFormats'] = array ('ttf','otf','woff');
3
- $GLOBALS['allowedFontSize'] = 25;
4
- $GLOBALS['serverUrl']['default'] = 'https://server2.dnesscarkey.org';
5
- $GLOBALS['serverUrl']['alternative'] = 'https://server3.dnesscarkey.org';
6
- $GLOBALS['supported_multi_lang_plugins'] = array(
7
- 'polylang/polylang.php', // POLYLANG
8
- 'polylang-pro/polylang.php', // POLYLANG PRO
9
- 'sitepress-multilingual-cms/sitepress.php' //WPML
10
- );
11
-
12
- // FROM DATABASE RECORDS
13
- $GLOBALS['uaf_api_key'] = get_option('uaf_api_key');
14
- $GLOBALS['uaf_disbale_editor_font_list'] = get_option('uaf_disbale_editor_font_list');
15
- $GLOBALS['uaf_use_curl_uploader'] = get_option('uaf_use_curl_uploader');
16
- $GLOBALS['uaf_use_absolute_font_path'] = get_option('uaf_use_absolute_font_path');
17
- $GLOBALS['uaf_use_alternative_server'] = get_option('uaf_use_alternative_server');
18
- $GLOBALS['uaf_enable_multi_lang_support'] = get_option('uaf_enable_multi_lang_support');
19
- $GLOBALS['uaf_server_status'] = get_option('uaf_server_status');
20
- $GLOBALS['uaf_server_msg'] = get_option('uaf_server_msg');
21
- $GLOBALS['uaf_font_display_property'] = get_option('uaf_font_display_property');
22
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
use-any-font.php CHANGED
@@ -1,31 +1,23 @@
1
  <?php
2
- /*
3
  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.5
8
- Author URI: https://www.dineshkarki.com.np
9
  */
10
 
11
- /* Copyright 2012 Dinesh Karki (email : dnesskarki@gmail.com)
12
 
13
- This program is free software; you can redistribute it and/or modify
14
- it under the terms of the GNU General Public License, version 2, as
15
- published by the Free Software Foundation.
 
 
16
 
17
- This program is distributed in the hope that it will be useful,
18
- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- GNU General Public License for more details.
21
-
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- include('uaf_config.php');
28
- include('includes/uaf_functions.php');
29
- include('plugin_interface.php');
30
- register_activation_hook( __FILE__, 'uaf_activate' );
31
- ?>
1
  <?php
2
+ /*
3
  Plugin Name: Use Any Font
4
+ Plugin URI: https://dineshkarki.com.np/use-any-font
5
  Description: Embed any font in your website
6
  Author: Dnesscarkey
7
+ Version: 6.0
8
+ Author URI: https://dineshkarki.com.np/use-any-font
9
  */
10
 
11
+ define ( 'UAF_FILE_PATH', plugin_dir_path( __FILE__ ) );
12
 
13
+ include UAF_FILE_PATH.'includes/uaf_config.php';
14
+ include UAF_FILE_PATH.'includes/functions/uaf_admin_functions.php';
15
+ include UAF_FILE_PATH.'includes/functions/uaf_client_functions.php';
16
+ include UAF_FILE_PATH.'includes/functions/uaf_font_functions.php';
17
+ include UAF_FILE_PATH.'includes/functions/uaf_editor_functions.php';
18
 
19
+ add_action('init', 'uaf_plugin_initialize');
20
+ add_action('admin_menu', 'uaf_create_menu');
21
+ add_action('admin_enqueue_scripts', 'uaf_admin_assets');
22
+ add_action('wp_enqueue_scripts', 'uaf_client_assets');
23
+ add_action('admin_notices', 'uaf_admin_notices');