PageRenderTime 56ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/content/plugins/w3-total-cache/inc/lightbox/self_test.php

https://gitlab.com/GeneralistDev/danielparker.com.au-wordpress
PHP | 321 lines | 288 code | 33 blank | 0 comment | 29 complexity | 7ad5c39a01d300b4e378521dcc65cdba MD5 | raw file
  1. <?php
  2. if (!defined('W3TC'))
  3. die();
  4. w3_require_once(W3TC_INC_DIR . '/functions/file.php');
  5. w3_require_once(W3TC_INC_DIR . '/functions/rule.php');
  6. ?>
  7. <h3><?php _e('Compatibility Test', 'w3-total-cache'); ?></h3>
  8. <fieldset>
  9. <legend><?php _e('Legend', 'w3-total-cache'); ?></legend>
  10. <p>
  11. <?php _e('<code>Installed</code>: Functionality will work properly.', 'w3-total-cache'); ?><br />
  12. <?php _e('<code>Not detected</code>: May be installed, but cannot be automatically confirmed.', 'w3-total-cache'); ?><br />
  13. <?php _e('<code>Ok</code>: Current value is acceptable.', 'w3-total-cache'); ?><br />
  14. <?php _e('<code>Yes / No</code>: The value was successful detected.', 'w3-total-cache'); ?>
  15. </p>
  16. </fieldset>
  17. <div id="w3tc-self-test">
  18. <h4 style="margin-top: 0;"><?php _e('Server Modules &amp; Resources:', 'w3-total-cache'); ?></h4>
  19. <ul>
  20. <li>
  21. <?php _e('Plugin Version:', 'w3-total-cache'); ?> <code><?php echo W3TC_VERSION; ?></code>
  22. </li>
  23. <li>
  24. <?php _e('PHP Version:', 'w3-total-cache'); ?>
  25. <code><?php echo PHP_VERSION; ?></code>;
  26. </li>
  27. <li>
  28. Web Server:
  29. <?php if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') !== false): ?>
  30. <code>Apache</code>
  31. <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false): ?>
  32. <code>Lite Speed</code>
  33. <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false): ?>
  34. <code>nginx</code>
  35. <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false): ?>
  36. <code>lighttpd</code>
  37. <?php elseif (stristr($_SERVER['SERVER_SOFTWARE'], 'iis') !== false): ?>
  38. <code>Microsoft IIS</code>
  39. <?php else: ?>
  40. <code>Not detected</code>
  41. <?php endif; ?>
  42. </li>
  43. <li>
  44. FTP functions:
  45. <?php if (function_exists('ftp_connect')): ?>
  46. <code>Installed</code>
  47. <?php else: ?>
  48. <code>Not installed</code>
  49. <?php endif; ?>
  50. <span class="w3tc-self-test-hint"><?php _e('(required for Self-hosted (<acronym title="File Transfer Protocol">FTP</acronym>) <acronym title="Content Delivery Network">CDN</acronym> support)', 'w3-total-cache'); ?></span>
  51. </li>
  52. <li>
  53. <?php _e('Multibyte String support:', 'w3-total-cache'); ?>
  54. <?php if (function_exists('mb_substr')): ?>
  55. <code><?php _e('Installed', 'w3-total-cache'); ?></code>
  56. <?php else: ?>
  57. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  58. <?php endif; ?>
  59. <span class="w3tc-self-test-hint"><?php _e('(required for Rackspace Cloud Files support)', 'w3-total-cache'); ?></span>
  60. </li>
  61. <li>
  62. <?php _e('cURL extension:', 'w3-total-cache'); ?>
  63. <?php if (function_exists('curl_init')): ?>
  64. <code><?php _e('Installed', 'w3-total-cache'); ?></code>
  65. <?php else: ?>
  66. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  67. <?php endif; ?>
  68. <span class="w3tc-self-test-hint"><?php _e('(required for Amazon S3, Amazon CloudFront, Rackspace CloudFiles support)', 'w3-total-cache'); ?></span>
  69. </li>
  70. <li>
  71. zlib extension:
  72. <?php if (function_exists('gzencode')): ?>
  73. <code><?php _e('Installed', 'w3-total-cache'); ?></code>
  74. <?php else: ?>
  75. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  76. <?php endif; ?>
  77. <span class="w3tc-self-test-hint"><?php _e('(required for compression support)', 'w3-total-cache'); ?></span>
  78. </li>
  79. <li>
  80. Opcode cache:
  81. <?php if (function_exists('apc_store')): ?>
  82. <code><?php _e('Installed (APC)', 'w3-total-cache'); ?></code>
  83. <?php elseif (function_exists('eaccelerator_put')): ?>
  84. <code><?php _e('Installed (eAccelerator)', 'w3-total-cache'); ?></code>
  85. <?php elseif (function_exists('xcache_set')): ?>
  86. <code><?php _e('Installed (XCache)', 'w3-total-cache'); ?></code>
  87. <?php elseif (PHP_VERSION >= 6): ?>
  88. <code><?php _e('PHP6', 'w3-total-cache'); ?></code>
  89. <?php else: ?>
  90. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  91. <?php endif; ?>
  92. </li>
  93. <li>
  94. <?php _e('Memcache extension:', 'w3-total-cache'); ?>
  95. <?php if (class_exists('Memcache')): ?>
  96. <code><?php _e('Installed', 'w3-total-cache'); ?></code>
  97. <?php else: ?>
  98. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  99. <?php endif; ?>
  100. </li>
  101. <li>
  102. <?php _e('HTML Tidy extension:', 'w3-total-cache'); ?>
  103. <?php if (class_exists('tidy')): ?>
  104. <code><?php _e('Installed', 'w3-total-cache'); ?></code>
  105. <?php else: ?>
  106. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  107. <?php endif; ?>
  108. <span class="w3tc-self-test-hint"><?php _e('(required for HTML Tidy minifier suppport)', 'w3-total-cache'); ?></span>
  109. </li>
  110. <li>
  111. <?php _e('Mime type detection:', 'w3-total-cache'); ?>
  112. <?php if (function_exists('finfo_open')): ?>
  113. <code><?php _e('Installed (Fileinfo)', 'w3-total-cache'); ?></code>
  114. <?php elseif (function_exists('mime_content_type')): ?>
  115. <code><?php _e('Installed (mime_content_type)', 'w3-total-cache'); ?></code>
  116. <?php else: ?>
  117. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  118. <?php endif; ?>
  119. <span class="w3tc-self-test-hint"><?php _e('(required for <acronym title="Content Delivery Network">CDN</acronym> support)', 'w3-total-cache'); ?></span>
  120. </li>
  121. <li>
  122. <?php _e('Hash function:', 'w3-total-cache'); ?>
  123. <?php if (function_exists('hash')): ?>
  124. <code><?php _e('Installed (hash)', 'w3-total-cache'); ?></code>
  125. <?php elseif (function_exists('mhash')): ?>
  126. <code><?php _e('Installed (mhash)', 'w3-total-cache'); ?></code>
  127. <?php else: ?>
  128. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  129. <?php endif; ?>
  130. <span class="w3tc-self-test-hint"><?php _e('(required for NetDNA / MaxCDN <acronym title="Content Delivery Network">CDN</acronym> purge support)', 'w3-total-cache'); ?></span>
  131. </li>
  132. <li>
  133. <?php _e('Safe mode:', 'w3-total-cache'); ?>
  134. <?php if (w3_to_boolean(ini_get('safe_mode'))): ?>
  135. <code><?php _e('On', 'w3-total-cache'); ?></code>
  136. <?php else: ?>
  137. <code><?php _e('Off', 'w3-total-cache'); ?></code>
  138. <?php endif; ?>
  139. </li>
  140. <li>
  141. <?php _e('Open basedir:', 'w3-total-cache'); ?>
  142. <?php $open_basedir = ini_get('open_basedir'); if ($open_basedir): ?>
  143. <code><?php _e('On:', 'w3-total-cache'); ?> <?php echo htmlspecialchars($open_basedir); ?></code>
  144. <?php else: ?>
  145. <code><?php _e('Off', 'w3-total-cache'); ?></code>
  146. <?php endif; ?>
  147. </li>
  148. <li>
  149. <?php _e('zlib output compression:', 'w3-total-cache'); ?>
  150. <?php if (w3_to_boolean(ini_get('zlib.output_compression'))): ?>
  151. <code><?php _e('On', 'w3-total-cache'); ?></code>
  152. <?php else: ?>
  153. <code><?php _e('Off', 'w3-total-cache'); ?></code>
  154. <?php endif; ?>
  155. </li>
  156. <li>
  157. <?php _e('set_time_limit:', 'w3-total-cache'); ?>
  158. <?php if (function_exists('set_time_limit')): ?>
  159. <code><?php _e('Available', 'w3-total-cache'); ?></code>
  160. <?php else: ?>
  161. <code><?php _e('Not available', 'w3-total-cache'); ?></code>
  162. <?php endif; ?>
  163. </li>
  164. <?php
  165. if (w3_is_apache()):
  166. $apache_modules = (function_exists('apache_get_modules') ? apache_get_modules() : false);
  167. $modules = array(
  168. 'mod_deflate',
  169. 'mod_env',
  170. 'mod_expires',
  171. 'mod_headers',
  172. 'mod_mime',
  173. 'mod_rewrite',
  174. 'mod_setenvif'
  175. );
  176. ?>
  177. <?php foreach ($modules as $module): ?>
  178. <li>
  179. <?php echo $module; ?>:
  180. <?php if ($apache_modules): ?>
  181. <?php if (in_array($module, $apache_modules)): ?>
  182. <code><?php _e('Installed', 'w3-total-cache'); ?></code>
  183. <?php else: ?>
  184. <code><?php _e('Not installed', 'w3-total-cache'); ?></code>
  185. <?php endif; ?>
  186. <?php else: ?>
  187. <code><?php _e('Not detected', 'w3-total-cache'); ?></code>
  188. <?php endif; ?>
  189. <span class="w3tc-self-test-hint"><?php _e('(required for disk enhanced Page Cache and Browser Cache)', 'w3-total-cache'); ?></span>
  190. </li>
  191. <?php endforeach; ?>
  192. <?php endif; ?>
  193. </ul>
  194. <?php $additional_checks = apply_filters('w3tc_compatibility_test', __return_empty_array());
  195. if ($additional_checks):?>
  196. <h4><?php _e('Additional Server Modules','w3-total-cache')?></h4>
  197. <ul>
  198. <?php
  199. foreach($additional_checks as $check)
  200. echo '<li>', $check, '</li>';
  201. ?>
  202. </ul>
  203. <?php
  204. endif;
  205. ?>
  206. <h4><?php _e('WordPress Resources', 'w3-total-cache'); ?></h4>
  207. <ul>
  208. <?php
  209. $paths = array_unique(array(
  210. w3_get_pgcache_rules_core_path(),
  211. w3_get_browsercache_rules_cache_path(),
  212. w3_get_browsercache_rules_no404wp_path()
  213. ));
  214. ?>
  215. <?php foreach ($paths as $path): if ($path): ?>
  216. <li>
  217. <?php echo htmlspecialchars($path); ?>:
  218. <?php if (file_exists($path)): ?>
  219. <?php if (w3_is_writable($path)): ?>
  220. <code><?php _e('OK', 'w3-total-cache'); ?></code>
  221. <?php else: ?>
  222. <code><?php _e('Not write-able', 'w3-total-cache'); ?></code>
  223. <?php endif; ?>
  224. <?php else: ?>
  225. <?php if (w3_is_writable_dir(dirname($path))): ?>
  226. <code><?php _e('Write-able', 'w3-total-cache'); ?></code>
  227. <?php else: ?>
  228. <code><?php _e('Not write-able', 'w3-total-cache'); ?></code>
  229. <?php endif; ?>
  230. <?php endif; ?>
  231. </li>
  232. <?php endif; endforeach; ?>
  233. <li>
  234. <?php echo w3_path(WP_CONTENT_DIR); ?>:
  235. <?php if (w3_is_writable_dir(WP_CONTENT_DIR)): ?>
  236. <code><?php _e('OK', 'w3-total-cache'); ?></code>
  237. <?php else: ?>
  238. <code><?php _e('Not write-able', 'w3-total-cache'); ?></code>
  239. <?php endif; ?>
  240. </li>
  241. <li>
  242. <?php $uploads_dir = @wp_upload_dir(); ?>
  243. <?php echo htmlspecialchars($uploads_dir['path']); ?>:
  244. <?php if (!empty($uploads_dir['error'])): ?>
  245. <code><?php _e('Error:', 'w3-total-cache'); ?> <?php echo htmlspecialchars($uploads_dir['error']); ?></code>
  246. <?php elseif (!w3_is_writable_dir($uploads_dir['path'])): ?>
  247. <code><?php _e('Not write-able', 'w3-total-cache'); ?></code>
  248. <?php else: ?>
  249. <code><?php _e('OK', 'w3-total-cache'); ?></code>
  250. <?php endif; ?>
  251. </li>
  252. <li>
  253. <?php _e('Fancy permalinks:', 'w3-total-cache'); ?>
  254. <?php $permalink_structure = get_option('permalink_structure'); if ($permalink_structure): ?>
  255. <code><?php echo htmlspecialchars($permalink_structure); ?></code>
  256. <?php else: ?>
  257. <code><?php _e('Disabled', 'w3-total-cache'); ?></code>
  258. <?php endif; ?>
  259. </li>
  260. <li>
  261. <?php _e('WP_CACHE define:', 'w3-total-cache'); ?>
  262. <?php if (defined('WP_CACHE')): ?>
  263. <code><?php _e('Defined', 'w3-total-cache'); ?> (<?php echo (WP_CACHE ? 'true' : 'false'); ?>)</code>
  264. <?php else: ?>
  265. <code><?php _e('Not defined', 'w3-total-cache'); ?></code>
  266. <?php endif; ?>
  267. </li>
  268. <li>
  269. <?php _e('URL rewrite:', 'w3-total-cache'); ?>
  270. <?php if (w3_can_check_rules()): ?>
  271. <code><?php _e('Enabled', 'w3-total-cache'); ?></code>
  272. <?php else: ?>
  273. <code><?php _e('Disabled', 'w3-total-cache'); ?></code>
  274. <?php endif; ?>
  275. </li>
  276. <li>
  277. <?php _e('Network mode:', 'w3-total-cache'); ?>
  278. <?php if (w3_is_network()): ?>
  279. <code><?php _e('Yes', 'w3-total-cache'); ?> (<?php echo (w3_is_subdomain_install() ? 'subdomain' : 'subdir'); ?>)</code>
  280. <?php else: ?>
  281. <code><?php _e('No', 'w3-total-cache'); ?></code>
  282. <?php endif; ?>
  283. </li>
  284. </ul>
  285. </div>
  286. <div id="w3tc-self-test-bottom">
  287. <input class="button-primary" type="button" value="<?php _e('Close', 'w3-total-cache'); ?>" />
  288. </div>