Use Any Font - Version 2.0

Version Description

  • Added server connectivity test.
Download this release

Release Info

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

Code changes from version 1.1 to 2.0

css/uaf_admin.css CHANGED
@@ -1,3 +1,8 @@
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;}
 
 
 
 
 
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;}
includes/uaf_footer.php CHANGED
@@ -1,3 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <br/>
2
  <table class="wp-list-table widefat fixed bookmarks">
3
  <thead>
@@ -33,12 +80,45 @@
33
  <table class="wp-list-table widefat fixed bookmarks">
34
  <thead>
35
  <tr>
36
- <th>Support</th>
37
  </tr>
38
  </thead>
39
  <tbody>
40
  <tr>
41
- <td>If you have any issues, click <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">here</a> to visit our support forum</td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  </tr>
43
  </tbody>
44
  </table>
@@ -52,14 +132,15 @@
52
  <tbody>
53
  <tr>
54
  <td>
55
- <ol>
56
- <li><a href="http://wordpress.org/extend/plugins/any-mobile-theme-switcher/" target="_blank">Any Mobile Theme Switcher</a></li>
 
57
  <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
58
  <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
59
  <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
60
  <li><a href="http://wordpress.org/extend/plugins/remove-admin-bar-for-client/" target="_blank">Remove Admin Bar</a></li>
61
  <li><a href="http://wordpress.org/extend/plugins/html-in-category-and-pages/" target="_blank">.html in category and page url</a></li>
62
- </ol>
63
  </td>
64
  </tr>
65
  </tbody>
@@ -73,7 +154,7 @@
73
  </thead>
74
  <tbody>
75
  <tr>
76
- <td><iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FDnessCarKey%2F77553779916&amp;width=185&amp;height=258&amp;show_faces=true&amp;colorscheme=light&amp;stream=false&amp;border_color=%23f9f9f9&amp;header=false&amp;appId=215419415167468" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:240px; height:258px;" allowTransparency="true"></iframe>
77
  </td>
78
  </tr>
79
  </tbody>
1
+ <?php
2
+ $server_status = get_option('uaf_server_status');
3
+ if ($_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_HEADER, 0);
8
+ curl_setopt($ch_test, CURLOPT_VERBOSE, 0);
9
+ curl_setopt($ch_test, CURLOPT_RETURNTRANSFER, true);
10
+ curl_setopt($ch_test, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data"));
11
+ curl_setopt($ch_test, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0Mozilla/4.0 (compatible;)");
12
+ curl_setopt($ch_test, CURLOPT_URL, 'http://dineshkarki.com.np/font-convertor/server/check.php');
13
+ curl_setopt($ch_test, CURLOPT_POST, true);
14
+ $post = array(
15
+ 'test_code' => $test_code
16
+ );
17
+ curl_setopt($ch_test, CURLOPT_POSTFIELDS, $post);
18
+ $response = curl_exec($ch_test);
19
+ if(curl_errno($ch_test)) {
20
+ $server_err_stat = 'test_error';
21
+ $server_err_msg = '<strong>Error</strong>: ' . curl_error($ch_test);
22
+ }
23
+ else {
24
+ $http_code = curl_getinfo($ch_test, CURLINFO_HTTP_CODE);
25
+ if ($http_code == 200) {
26
+ if ($test_code == $response){
27
+ $server_err_stat = 'test_successfull';
28
+ $server_err_msg = '';
29
+ } else {
30
+ $server_err_stat = 'test_error';
31
+ $server_err_msg = '<strong>Error</strong>: Sorry couldnot get response back from the server.';
32
+ }
33
+ } else {
34
+ $server_err_stat = 'test_error';
35
+ $server_err_msg = '<strong>Error</strong>: ' .$response;
36
+ }
37
+ }
38
+ } else {
39
+ $server_err_stat = 'test_error';
40
+ $server_err_msg = '<strong>Error</strong>: Curl not enabled in your server.';
41
+ }
42
+ update_option('uaf_server_status', $server_err_stat);
43
+ update_option('uaf_server_msg', $server_err_msg);
44
+ }
45
+ $server_status = get_option('uaf_server_status');
46
+ $server_message = get_option('uaf_server_msg');
47
+ ?>
48
  <br/>
49
  <table class="wp-list-table widefat fixed bookmarks">
50
  <thead>
80
  <table class="wp-list-table widefat fixed bookmarks">
81
  <thead>
82
  <tr>
83
+ <th>Server Connectivity Test</th>
84
  </tr>
85
  </thead>
86
  <tbody>
87
  <tr>
88
+ <td>
89
+ <div id="server_status" class="<?php echo $server_status; ?>">
90
+ <?php echo str_replace('_',' ',$server_status); ?>
91
+ </div>
92
+
93
+ <?php if ($server_status == 'test_error'): ?>
94
+ <div class="uaf_test_msg"><?php echo $server_message; ?></div>
95
+ <?php endif; ?>
96
+
97
+
98
+ <form action="options-general.php?page=use-any-font/plugin_interface.php" method="post">
99
+ <p align="center">
100
+ <input type="submit" value="Test Again" class="button-primary" name="test_server" />
101
+ </p>
102
+ </form>
103
+ </td>
104
+ </tr>
105
+ </tbody>
106
+ </table>
107
+ <br/>
108
+ <table class="wp-list-table widefat fixed bookmarks">
109
+ <thead>
110
+ <tr>
111
+ <th>Have Problem ?</th>
112
+ </tr>
113
+ </thead>
114
+ <tbody>
115
+ <tr>
116
+ <td>
117
+ <ul class="uaf_list">
118
+ <li><a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">View Support Forum</a></li>
119
+ <li><a href="http://dineshkarki.com.np/rectify-my-problem" target="_blank">Rectify My Problem</a></li>
120
+ </ul>
121
+ </td>
122
  </tr>
123
  </tbody>
124
  </table>
132
  <tbody>
133
  <tr>
134
  <td>
135
+ <ul class="uaf_list">
136
+ <li><a href="http://wordpress.org/extend/plugins/sms/" target="_blank">SMS</a></li>
137
+ <li><a href="http://wordpress.org/extend/plugins/any-mobile-theme-switcher/" target="_blank">Any Mobile Theme Switcher</a></li>
138
  <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
139
  <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
140
  <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
141
  <li><a href="http://wordpress.org/extend/plugins/remove-admin-bar-for-client/" target="_blank">Remove Admin Bar</a></li>
142
  <li><a href="http://wordpress.org/extend/plugins/html-in-category-and-pages/" target="_blank">.html in category and page url</a></li>
143
+ </ul>
144
  </td>
145
  </tr>
146
  </tbody>
154
  </thead>
155
  <tbody>
156
  <tr>
157
+ <td><iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FDnessCarKey%2F77553779916&amp;width=185&amp;height=180&amp;show_faces=true&amp;colorscheme=light&amp;stream=false&amp;border_color=%23f9f9f9&amp;header=false&amp;appId=215419415167468" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:240px; height:180px;" allowTransparency="true"></iframe>
158
  </td>
159
  </tr>
160
  </tbody>
plugin_interface.php CHANGED
@@ -23,6 +23,10 @@ function uaf_create_menu() {
23
  add_options_page('Use Any Font', 'Use Any Font', 'administrator', __FILE__, 'uaf_settings_page');
24
  }
25
 
 
 
 
 
26
  function uaf_settings_page() {
27
  include('includes/uaf_header.php');
28
  include('includes/uaf_font_upload.php');
23
  add_options_page('Use Any Font', 'Use Any Font', 'administrator', __FILE__, 'uaf_settings_page');
24
  }
25
 
26
+ function uaf_activate(){
27
+ uaf_write_css(); //rewrite css when plugin is activated after update or somethingelse......
28
+ }
29
+
30
  function uaf_settings_page() {
31
  include('includes/uaf_header.php');
32
  include('includes/uaf_font_upload.php');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: dnesscarkey
3
  Tags: use any font, any font, embed any font, font embed
4
  Requires at least: 3.0
5
  Tested up to: 3.5
6
- Stable tag: 1.1
7
 
8
  Embed any font in your website
9
 
@@ -23,6 +23,7 @@ Features
23
  * Faster load time as your fonts are stored on your own server.
24
  * Quick font assign interface. You can select pre defined html tags or assign it to custom css.
25
  * <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">Support Forum</a> to quickly resolve your issues.
 
26
 
27
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
28
 
@@ -56,6 +57,9 @@ No, you don't need to do it yourself. Just upload your font in tff font format,
56
 
57
  == Changelog ==
58
 
 
 
 
59
  = 1.1 =
60
  * Fixed font not loading issue when there is space in font file name.
61
  * Added Instructions in Plugin Interface.
3
  Tags: use any font, any font, embed any font, font embed
4
  Requires at least: 3.0
5
  Tested up to: 3.5
6
+ Stable tag: 2.0
7
 
8
  Embed any font in your website
9
 
23
  * Faster load time as your fonts are stored on your own server.
24
  * Quick font assign interface. You can select pre defined html tags or assign it to custom css.
25
  * <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">Support Forum</a> to quickly resolve your issues.
26
+ * <a href="http://dineshkarki.com.np/rectify-my-problem" target="_blank">Rectify My Problem</a> for personal assitance.
27
 
28
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
29
 
57
 
58
  == Changelog ==
59
 
60
+ = 2.0 =
61
+ * Added server connectivity test.
62
+
63
  = 1.1 =
64
  * Fixed font not loading issue when there is space in font file name.
65
  * Added Instructions in Plugin Interface.
use-any-font.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Use Any Font
4
  Plugin URI: http://dineshkarki.com.np/use-any-font
5
  Description: Embed any font in your website
6
  Author: Dinesh Karki
7
- Version: 1.1
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
@@ -24,4 +24,5 @@ Author URI: http://www.dineshkarki.com.np
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
  include('plugin_interface.php');
 
27
  ?>
4
  Plugin URI: http://dineshkarki.com.np/use-any-font
5
  Description: Embed any font in your website
6
  Author: Dinesh Karki
7
+ Version: 2.0
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
  include('plugin_interface.php');
27
+ register_activation_hook( __FILE__, 'uaf_activate' );
28
  ?>