PageRenderTime 40ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/use-any-font/includes/uaf_footer.php

https://gitlab.com/mattswann/launch-housing
PHP | 231 lines | 221 code | 10 blank | 0 comment | 18 complexity | c228f1c94c14870525fa276fa63119c3 MD5 | raw file
  1. <?php
  2. $server_status = get_option('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, 'http://dnesscarkey.xyz/font-convertor/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. }
  41. $server_status = get_option('uaf_server_status');
  42. $server_message = get_option('uaf_server_msg');
  43. ?>
  44. <?php if (!empty($settings_message)):?>
  45. <div class="updated" id="message"><p><?php echo $settings_message ?></p></div>
  46. <?php endif; ?>
  47. <br/>
  48. <table class="wp-list-table widefat fixed bookmarks">
  49. <thead>
  50. <tr>
  51. <th>Additional Settings (Usually not required)</th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. <form method="post" action="">
  56. <tr>
  57. <td>
  58. <input type="checkbox" name="uaf_disbale_editor_font_list" value="1" <?php echo $uaf_disbale_editor_font_list_value == 1?'checked=checked':''; ?> /> Disable Font list in wordpress editor.
  59. </td>
  60. </tr>
  61. <tr>
  62. <td>
  63. <input type="checkbox" name="uaf_use_curl_uploader" value="1" <?php echo $uaf_use_curl_uploader_value == 1?'checked=checked':''; ?> /> Use alternative uploader (Need PHP Curl).
  64. </td>
  65. </tr>
  66. <tr>
  67. <td>
  68. <input type="checkbox" name="uaf_use_relative_font_path" value="1" <?php echo $uaf_use_relative_font_path == 1?'checked=checked':''; ?> /> Use relative path for font (Needed when you have domain mapping).
  69. </td>
  70. </tr>
  71. <tr>
  72. <td><input type="submit" name="submit-uaf-settings" class="button-primary" value="Save Settings" /></td>
  73. </tr>
  74. </form>
  75. </tbody>
  76. </table>
  77. <br/>
  78. <table class="wp-list-table widefat fixed bookmarks">
  79. <thead>
  80. <tr>
  81. <th>Instructions</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <tr>
  86. <td>
  87. <ol>
  88. <li>Get API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>. You can offer your contribution from (Free to $100) and get the API key. All API key comes with lifetime validity.<br/>
  89. <em><strong>Note:</strong> API key is needed to connect to our server for font conversion.</em>
  90. </li>
  91. <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.
  92. <em><strong>Note:</strong> We don't store any font in our server. We delete the temporary files after conversion has been done.</em>
  93. </li>
  94. <li>Assign your font to you html elements from <strong>Assign Font</strong> section.</li>
  95. <li>You can also assign uploaded font directly from Post/Page Wordpress Editor.</li>
  96. <li>If you are fond of visual instructions, you can check it <a href="http://dineshkarki.com.np/use-any-font/instructions" target="_blank">here</a>.</li>
  97. <li>You are ready now. If you still have any problem visit our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">support forum</a> or you can write to us directly using our contact form.</li>
  98. </ol>
  99. </td>
  100. </tr>
  101. </tbody>
  102. </table>
  103. </td>
  104. <td width="15">&nbsp;</td>
  105. <td width="250" valign="top">
  106. <?php if ($uaf_use_curl_uploader_value == 1): ?>
  107. <table class="wp-list-table widefat fixed bookmarks">
  108. <thead>
  109. <tr>
  110. <th>Server Connectivity Test</th>
  111. </tr>
  112. </thead>
  113. <tbody>
  114. <tr>
  115. <td>
  116. <div id="server_status" class="<?php echo $server_status; ?>">
  117. <?php echo str_replace('_',' ',$server_status); ?>
  118. </div>
  119. <?php if ($server_status == 'test_error'): ?>
  120. <div class="uaf_test_msg"><?php echo $server_message; ?></div>
  121. <?php endif; ?>
  122. <form action="admin.php?page=uaf_settings_page" method="post">
  123. <p align="center">
  124. <input type="submit" value="Test Again" class="button-primary" name="test_server" />
  125. </p>
  126. </form>
  127. </td>
  128. </tr>
  129. </tbody>
  130. </table>
  131. <br/>
  132. <?php endif; ?>
  133. <table class="wp-list-table widefat fixed bookmarks">
  134. <thead>
  135. <tr>
  136. <th>Have Problem ?</th>
  137. </tr>
  138. </thead>
  139. <tbody>
  140. <tr>
  141. <td>
  142. <ul class="uaf_list">
  143. <li><a href="http://goo.gl/NYtZsX" target="_blank">Setup Instructions</a></li>
  144. <li><a href="http://goo.gl/FcC7EL" target="_blank">Quick Virtual Support</a></li>
  145. <li><a href="http://goo.gl/XgEqzn" target="_blank">Support Forum</a></li>
  146. <li><a href="http://goo.gl/MKg7VS" target="_blank">Rectify My Problem</a></li>
  147. <li><a href="http://goo.gl/Id7yAo" target="_blank">Contact Us</a></li>
  148. </ul>
  149. </td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. <br/>
  154. <table class="wp-list-table widefat fixed bookmarks">
  155. <thead>
  156. <tr>
  157. <th>Recently Added Plugin</th>
  158. </tr>
  159. </thead>
  160. <tbody>
  161. <tr>
  162. <td style="padding:4px;">
  163. <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>
  164. </td>
  165. </tr>
  166. </tbody>
  167. </table>
  168. <br/>
  169. <table class="wp-list-table widefat fixed bookmarks">
  170. <thead>
  171. <tr>
  172. <th>Plugins You May Like</th>
  173. </tr>
  174. </thead>
  175. <tbody>
  176. <tr>
  177. <td>
  178. <ul class="uaf_list">
  179. <li><a href="http://goo.gl/3XDDzi" target="_blank">WP Masonry Layout</a></li>
  180. <li><a href="http://wordpress.org/extend/plugins/any-mobile-theme-switcher/" target="_blank">Any Mobile Theme Switcher</a></li>
  181. <li><a href="http://wordpress.org/extend/plugins/jquery-validation-for-contact-form-7/" target="_blank">Jquery Validation For Contact Form 7</a></li>
  182. <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
  183. <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
  184. <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
  185. <li><a href="http://wordpress.org/extend/plugins/remove-admin-bar-for-client/" target="_blank">Remove Admin Bar</a></li>
  186. <li><a href="http://wordpress.org/extend/plugins/html-in-category-and-pages/" target="_blank">.html in category and page url</a></li>
  187. </ul>
  188. </td>
  189. </tr>
  190. </tbody>
  191. </table>
  192. <br/>
  193. <table class="wp-list-table widefat fixed bookmarks">
  194. <thead>
  195. <tr>
  196. <th>Facebook</th>
  197. </tr>
  198. </thead>
  199. <tbody>
  200. <tr>
  201. <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>
  202. </td>
  203. </tr>
  204. </tbody>
  205. </table>
  206. <br/>
  207. </td>
  208. </tr>
  209. </table>
  210. </div>