PageRenderTime 48ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/duplicator/files/log-view.php

https://bitbucket.org/zachisit/zachis.it-m
PHP | 123 lines | 100 code | 17 blank | 6 comment | 6 complexity | 6d994cf7c614aef7ed7c3f0a7ed9e8fb MD5 | raw file
  1. <?php
  2. /** WordPress Administration Bootstrap
  3. see: http://codex.wordpress.org/Roles_and_Capabilities#export
  4. Must be logged in from the WordPress Admin */
  5. require_once('../../../../wp-admin/admin.php');
  6. if (! current_user_can('level_8') ) {
  7. die("You must be a WordPress Administrator to view the Duplicator logs.");
  8. }
  9. $logs = glob(DUPLICATOR_SSDIR_PATH . '/*.log') ;
  10. if (count($logs)) {
  11. usort($logs, create_function('$a,$b', 'return filemtime($a) - filemtime($b);'));
  12. }
  13. $logname = basename($logs[0]);
  14. $logurl = get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/' . $logname;
  15. $plugins_url = plugins_url();
  16. $admin_url = admin_url();
  17. ?>
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19. <head>
  20. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  21. <meta name="robots" content="noindex,nofollow">
  22. <link rel="stylesheet" href="<?php echo $admin_url; ?>/load-styles.php?c=0&amp;dir=ltr&amp;load=admin-bar,wp-jquery-ui-dialog,wp-admin&amp;ver=63e8d12bee407fb9bdf078f542ef8b29" type="text/css" media="all">
  23. <link rel="stylesheet" id="colors-css" href="<?php echo $admin_url; ?>/css/colors-fresh.css?ver=20111206" type="text/css" media="all">
  24. <link rel="stylesheet" id="jquery-ui-css" href="<?php echo $plugins_url; ?>/duplicator/css/jquery-ui.css?ver=3.3.2" type="text/css" media="all">
  25. <link rel="stylesheet" id="duplicator_style-css" href="<?php echo $plugins_url; ?>/duplicator/css/style.css?ver=3.3.2" type="text/css" media="all">
  26. <style type="text/css">
  27. iframe#log-data {
  28. background-color:#efefef;
  29. box-shadow: 4px 4px 3px #888;
  30. border:1px solid silver;
  31. border-radius:5px;
  32. width:98%; height:86%;
  33. }
  34. span#spanCount {display:inline-block !important; padding:0px 3px 0px 3px; width:15px; white-space:nowrap;}
  35. </style>
  36. <script type="text/javascript" src="<?php echo $admin_url; ?>/load-scripts.php?c=0&amp;load=jquery,utils&amp;ver=edec3fab0cb6297ea474806db1895fa7"></script>
  37. <script type="text/javascript" src="<?php echo $plugins_url; ?>/duplicator/js/jquery-ui.min.js?ver=1.8.21"></script>
  38. <script type="text/javascript">
  39. jQuery.noConflict()(function($) {
  40. jQuery(document).ready(function() {
  41. //Refresh Button
  42. $("#Refresh").click(function() {
  43. $("#log-data").attr("src", "log-read.php") ;
  44. //Scroll to Bottom
  45. $("#log-data").load(function () {
  46. var $contents = $('#log-data').contents();
  47. $contents.scrollTop($contents.height());
  48. });
  49. });
  50. //Refresh Checkbox
  51. $("#AutoRefresh").click(function() {
  52. if ( $("#AutoRefresh").is(":checked")) {
  53. startTimer();
  54. }
  55. });
  56. var duration = 10;
  57. var count = duration;
  58. var timerInterval;
  59. function timer() {
  60. count = count - 1;
  61. $("#spanCount").html(count.toString());
  62. if (! $("#AutoRefresh").is(":checked")) {
  63. clearInterval(timerInterval);
  64. $("#spanCount").html(count.toString());
  65. return;
  66. }
  67. if (count <= 0) {
  68. count = duration + 1;
  69. $('#Refresh').trigger('click');
  70. }
  71. }
  72. function startTimer() {
  73. timerInterval = setInterval(timer, 1000);
  74. }
  75. $("#spanCount").html(duration.toString());
  76. });
  77. });
  78. </script>
  79. </head>
  80. <body style="overflow:hidden">
  81. <div style="padding:0px 20px 10px 20px;">
  82. <table style="width:99%" border="0">
  83. <tr>
  84. <td><div id="icon-tools" class="icon32" style="height:34px; width:34px">&nbsp;</div></td>
  85. <td style='white-space:nowrap'>
  86. <b style='font-size:18px'><?php _e("Duplicator: Create Package Log", 'wpduplicator') ?></b> <br/>
  87. <i style='font-size:12px'>
  88. <?php _e("Processing may take several minutes, please wait for progress bar to complete on the main status bar", 'wpduplicator') ?>.<br/>
  89. <?php echo "log: {$logurl}" ?>
  90. </i>
  91. </td>
  92. <td style='width:100%; text-align:right; padding-right:20px; white-space:nowrap'>
  93. <input type='checkbox' id="AutoRefresh" /> <label for="AutoRefresh" style='white-space:nowrap'><?php _e("Auto Refresh", 'wpduplicator') ?> [<span id="spanCount"></span>]</label> <br/>
  94. <button id="Refresh" style="margin: 8px 5px 0px 0px"><?php _e("Refresh", 'wpduplicator') ?></button>
  95. </td>
  96. </tr>
  97. <tr><td colspan='3'><hr size='1' /></td></tr>
  98. </table>
  99. <iframe id="log-data" name="logData" src="log-read.php"></iframe><br/><br/>
  100. <i style='font-size:12px'>
  101. <a href="<?php echo DUPLICATOR_HELPLINK ?>" target="_blank"><?php _e("Support Center", 'wpduplicator') ?></a> &nbsp;
  102. <?php _e("Do NOT post this data to public sites like the WordPress.org forums as it contains sensitive data.", 'wpduplicator') ?>
  103. </i>
  104. </div>
  105. </body>
  106. </html>