PageRenderTime 99ms CodeModel.GetById 31ms RepoModel.GetById 9ms app.codeStats 0ms

/wp-content/plugins/duplicator/views/packages/main/s2.scan2.php

https://bitbucket.org/devqanh/tintuc.devqanh.info
PHP | 118 lines | 96 code | 13 blank | 9 comment | 5 complexity | 5e4f836976fa2fa9b6371adba54a6773 MD5 | raw file
Possible License(s): GPL-2.0
  1. <!-- ================================================================
  2. SERVER -->
  3. <div class="details-title">
  4. <i class="fa fa-hdd-o"></i> <?php _e("Server", 'duplicator'); ?>
  5. <div class="dup-more-details" title="<?php _e('Show Diagnostics', 'duplicator');?>">
  6. <a href="?page=duplicator-tools&tab=diagnostics" target="_blank"><i class="fa fa-microchip"></i></a>
  7. </div>
  8. </div>
  9. <!-- ============
  10. PHP SETTINGS -->
  11. <div class="scan-item">
  12. <div class='title' onclick="Duplicator.Pack.toggleScanItem(this);">
  13. <div class="text"><i class="fa fa-caret-right"></i> <?php _e('Setup', 'duplicator');?></div>
  14. <div id="data-srv-php-all"></div>
  15. </div>
  16. <div class="info">
  17. <?php
  18. //WEB SERVER
  19. $web_servers = implode(', ', $GLOBALS['DUPLICATOR_SERVER_LIST']);
  20. echo '<span id="data-srv-php-websrv"></span>&nbsp;<b>' . __('Web Server', 'duplicator') . ":</b>&nbsp; '{$_SERVER['SERVER_SOFTWARE']}' <br/>";
  21. _e("Supported web servers: ", 'duplicator');
  22. echo "<i>{$web_servers}</i>";
  23. //PHP VERSION
  24. echo '<hr size="1" /><span id="data-srv-php-version"></span>&nbsp;<b>' . __('PHP Version', 'duplicator') . "</b> <br/>";
  25. _e('The minimum PHP version supported by Duplicator is 5.2.9. It is highly recommended to use PHP 5.3+ for improved stability. For international language support please use PHP 7.0+.', 'duplicator');
  26. //OPEN_BASEDIR
  27. $test = ini_get("open_basedir");
  28. $test = ($test) ? 'ON' : 'OFF';
  29. echo '<hr size="1" /><span id="data-srv-php-openbase"></span>&nbsp;<b>' . __('PHP Open Base Dir', 'duplicator') . ":</b>&nbsp; '{$test}' <br/>";
  30. _e('Issues might occur when [open_basedir] is enabled. Work with your server admin to disable this value in the php.ini file if you’re having issues building a package.', 'duplicator');
  31. echo "&nbsp;<i><a href='http://www.php.net/manual/en/ini.core.php#ini.open-basedir' target='_blank'>[" . __('details', 'duplicator') . "]</a></i><br/>";
  32. //MAX_EXECUTION_TIME
  33. $test = (@set_time_limit(0)) ? 0 : ini_get("max_execution_time");
  34. echo '<hr size="1" /><span id="data-srv-php-maxtime"></span>&nbsp;<b>' . __('PHP Max Execution Time', 'duplicator') . ":</b>&nbsp; '{$test}' <br/>";
  35. _e('Timeouts may occur for larger packages when [max_execution_time] time in the php.ini is too low. A value of 0 (recommended) indicates that PHP has no time limits. '
  36. . 'An attempt is made to override this value if the server allows it.', 'duplicator');
  37. echo '<br/><br/>';
  38. _e('Note: Timeouts can also be set at the web server layer, so if the PHP max timeout passes and you still see a build interrupt messages, then your web server could be killing '
  39. . 'the process. If you are on a budget host and limited on processing time, consider using the database or file filters to shrink the size of your overall package. '
  40. . 'However use caution as excluding the wrong resources can cause your install to not work properly.', 'duplicator');
  41. echo "&nbsp;<i><a href='http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time' target='_blank'>[" . __('details', 'duplicator') . "]</a></i>";
  42. if ($zip_check != null) {
  43. echo '<br/><br/>';
  44. echo '<span style="font-weight:bold">';
  45. _e('Get faster builds with Duplicator Pro with access to shell_exec zip.', 'duplicator');
  46. echo '</span>';
  47. echo "&nbsp;<i><a href='https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_max_execution_time_warn&utm_campaign=duplicator_pro' target='_blank'>[" . __('details', 'duplicator') . "]</a></i>";
  48. }
  49. ?>
  50. </div>
  51. </div>
  52. <!-- ============
  53. WP SETTINGS -->
  54. <div class="scan-item scan-item-last">
  55. <div class="title" onclick="Duplicator.Pack.toggleScanItem(this);">
  56. <div class="text"><i class="fa fa-caret-right"></i> <?php _e('WordPress', 'duplicator');?></div>
  57. <div id="data-srv-wp-all"></div>
  58. </div>
  59. <div class="info">
  60. <?php
  61. //VERSION CHECK
  62. echo '<span id="data-srv-wp-version"></span>&nbsp;<b>' . __('WordPress Version', 'duplicator') . ":</b>&nbsp; '{$wp_version}' <br/>";
  63. printf(__('It is recommended to have a version of WordPress that is greater than %1$s', 'duplicator'), DUPLICATOR_SCAN_MIN_WP);
  64. //CORE FILES
  65. echo '<hr size="1" /><span id="data-srv-wp-core"></span>&nbsp;<b>' . __('Core Files', 'duplicator') . "</b> <br/>";
  66. _e("If the scanner is unable to locate the wp-config.php file in the root directory, then you will need to manually copy it to its new location.", 'duplicator');
  67. //CACHE DIR
  68. $cache_path = $cache_path = DUP_Util::safePath(WP_CONTENT_DIR) . '/cache';
  69. $cache_size = DUP_Util::byteSize(DUP_Util::getDirectorySize($cache_path));
  70. echo '<hr size="1" /><span id="data-srv-wp-cache"></span>&nbsp;<b>' . __('Cache Path', 'duplicator') . ":</b>&nbsp; '{$cache_path}' ({$cache_size}) <br/>";
  71. _e("Cached data will lead to issues at install time and increases your archive size. Empty your cache directory before building the package by using "
  72. . "your cache plugins clear cache feature. Use caution if manually removing files the cache folder. The cache "
  73. . "size minimum threshold that triggers this warning is currently set at ", 'duplicator');
  74. echo DUP_Util::byteSize(DUPLICATOR_SCAN_CACHESIZE) . '.';
  75. //MU SITE
  76. if (is_multisite()) {
  77. echo '<hr size="1" /><span><div class="scan-warn"><i class="fa fa-exclamation-triangle"></i></div></span>&nbsp;<b>' . __('Multisite: Unsupported', 'duplicator') . "</b> <br/>";
  78. _e('Duplicator does not officially support Multisite. However, Duplicator Pro supports duplication of a full Multisite network and also has the ability to install a Multisite subsite as a standalone site.', 'duplicator');
  79. echo "&nbsp;<i><a href='https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_is_mu_warn&utm_campaign=duplicator_pro' target='_blank'>[" . __('details', 'duplicator') . "]</a></i>";
  80. } else {
  81. echo '<hr size="1" /><span><div class="scan-good"><i class="fa fa-check"></i></div></span>&nbsp;<b>' . __('Multisite: N/A', 'duplicator') . "</b> <br/>";
  82. _e('This is not a Multisite install so duplication will proceed without issue. Duplicator does not officially support Multisite. However, Duplicator Pro supports duplication of a full Multisite network and also has the ability to install a Multisite subsite as a standalone site.', 'duplicator');
  83. echo "&nbsp;<i><a href='https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_is_mu_warn&utm_campaign=duplicator_pro' target='_blank'>[" . __('details', 'duplicator') . "]</a></i>";
  84. }
  85. ?>
  86. </div>
  87. </div>
  88. <script>
  89. (function($){
  90. //Ints the various server data responses from the scan results
  91. Duplicator.Pack.intServerData= function(data)
  92. {
  93. $('#data-srv-php-websrv').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.websrv));
  94. $('#data-srv-php-openbase').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.openbase));
  95. $('#data-srv-php-maxtime').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.maxtime));
  96. $('#data-srv-php-version').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.version));
  97. $('#data-srv-php-openssl').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.openssl));
  98. $('#data-srv-php-all').html(Duplicator.Pack.setScanStatus(data.SRV.PHP.ALL));
  99. $('#data-srv-wp-version').html(Duplicator.Pack.setScanStatus(data.SRV.WP.version));
  100. $('#data-srv-wp-core').html(Duplicator.Pack.setScanStatus(data.SRV.WP.core));
  101. $('#data-srv-wp-cache').html(Duplicator.Pack.setScanStatus(data.SRV.WP.cache));
  102. $('#data-srv-wp-all').html(Duplicator.Pack.setScanStatus(data.SRV.WP.ALL));
  103. }
  104. })(jQuery);
  105. </script>