PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/wordfence/views/dashboard/options-group-general.php

https://bitbucket.org/Hollyw00d/msblogs.mattjennings.net
PHP | 141 lines | 131 code | 2 blank | 8 comment | 9 complexity | e64a2d0c5e508f2f17591fe0997acc77 MD5 | raw file
Possible License(s): Apache-2.0, GPL-2.0, GPL-3.0, 0BSD
  1. <?php
  2. if (!defined('WORDFENCE_VERSION')) { exit; }
  3. /**
  4. * Presents the General Options group.
  5. *
  6. * Expects $stateKey.
  7. *
  8. * @var string $stateKey The key under which the collapse state is stored.
  9. * @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
  10. */
  11. if (!isset($collapseable)) {
  12. $collapseable = true;
  13. }
  14. ?>
  15. <div class="wf-row">
  16. <div class="wf-col-xs-12">
  17. <div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
  18. <div class="wf-block-header">
  19. <div class="wf-block-header-content">
  20. <div class="wf-block-title">
  21. <strong><?php _e('General Wordfence Options', 'wordfence'); ?></strong>
  22. </div>
  23. <?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
  24. </div>
  25. </div>
  26. <div class="wf-block-content">
  27. <ul class="wf-block-list">
  28. <li>
  29. <?php
  30. $subtitle = __('Automatically updates Wordfence to the newest version within 24 hours of a new release.', 'wordfence');
  31. if (!wfConfig::get('other_bypassLitespeedNoabort', false) && getenv('noabort') != '1' && stristr($_SERVER['SERVER_SOFTWARE'], 'litespeed') !== false) {
  32. $subtitle .= '<br><br>';
  33. $subtitle .= __('<span class="wf-red-dark">Warning:</span> You are running the LiteSpeed web server and Wordfence can\'t determine whether "noabort" is set. Please verify that the environmental variable "noabort" is set for the local site, or the server\'s global External Application Abort is set to "No Abort".', 'wordfence');
  34. $subtitle .= '<br>';
  35. $subtitle .= '<a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_LITESPEED_WARNING) . '" target="_blank" rel="noopener noreferrer">' . __('Please read this article in our FAQ to make an important change that will ensure your site stability during an update.', 'wordfence') . '</a>';
  36. }
  37. echo wfView::create('options/option-toggled', array(
  38. 'optionName' => 'autoUpdate',
  39. 'enabledValue' => 1,
  40. 'disabledValue' => 0,
  41. 'value' => wfConfig::get('autoUpdate') ? 1 : 0,
  42. 'title' => __('Update Wordfence automatically when a new version is released?', 'wordfence'),
  43. 'subtitleHTML' => $subtitle,
  44. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_AUTOMATIC_UPDATE),
  45. ))->render();
  46. ?>
  47. </li>
  48. <li>
  49. <?php
  50. echo wfView::create('options/option-text', array(
  51. 'textOptionName' => 'alertEmails',
  52. 'textValue' => wfConfig::get('alertEmails'),
  53. 'title' => __('Where to email alerts', 'wordfence'),
  54. 'placeholder' => __('Separate multiple addresses with commas', 'wordfence'),
  55. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_ALERT_EMAILS),
  56. ))->render();
  57. ?>
  58. </li>
  59. <li>
  60. <?php
  61. echo wfView::create('dashboard/option-howgetips')->render();
  62. ?>
  63. </li>
  64. <li>
  65. <?php
  66. echo wfView::create('options/option-toggled', array(
  67. 'optionName' => 'other_hideWPVersion',
  68. 'enabledValue' => 1,
  69. 'disabledValue' => 0,
  70. 'value' => wfConfig::get('other_hideWPVersion') ? 1 : 0,
  71. 'title' => __('Hide WordPress version', 'wordfence'),
  72. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_HIDE_VERSION),
  73. ))->render();
  74. ?>
  75. </li>
  76. <li>
  77. <?php
  78. echo wfView::create('options/option-toggled', array(
  79. 'optionName' => 'disableCodeExecutionUploads',
  80. 'enabledValue' => 1,
  81. 'disabledValue' => 0,
  82. 'value' => wfConfig::get('disableCodeExecutionUploads') ? 1 : 0,
  83. 'title' => __('Disable Code Execution for Uploads directory', 'wordfence'),
  84. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_DISABLE_UPLOADS_EXECUTION),
  85. ))->render();
  86. ?>
  87. </li>
  88. <li>
  89. <?php
  90. echo wfView::create('options/option-toggled', array(
  91. 'optionName' => 'liveActivityPauseEnabled',
  92. 'enabledValue' => 1,
  93. 'disabledValue' => 0,
  94. 'value' => wfConfig::get('liveActivityPauseEnabled') ? 1 : 0,
  95. 'title' => __('Pause live updates when window loses focus', 'wordfence'),
  96. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_PAUSE_LIVE_UPDATES),
  97. ))->render();
  98. ?>
  99. </li>
  100. <li>
  101. <?php
  102. echo wfView::create('options/option-text', array(
  103. 'textOptionName' => 'actUpdateInterval',
  104. 'textValue' => wfConfig::get('actUpdateInterval'),
  105. 'title' => __('Update interval in seconds', 'wordfence'),
  106. 'subtitle' => __('Setting higher will reduce browser traffic but slow scan starts, live traffic &amp; status updates.', 'wordfence'),
  107. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_UPDATE_INTERVAL),
  108. ))->render();
  109. ?>
  110. </li>
  111. <li>
  112. <?php
  113. echo wfView::create('options/option-toggled', array(
  114. 'optionName' => 'other_bypassLitespeedNoabort',
  115. 'enabledValue' => 1,
  116. 'disabledValue' => 0,
  117. 'value' => wfConfig::get('other_bypassLitespeedNoabort') ? 1 : 0,
  118. 'title' => __('Bypass the LiteSpeed "noabort" check', 'wordfence'),
  119. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_BYPASS_LITESPEED_CHECK),
  120. ))->render();
  121. ?>
  122. </li>
  123. <li>
  124. <?php
  125. echo wfView::create('options/option-toggled', array(
  126. 'optionName' => 'deleteTablesOnDeact',
  127. 'enabledValue' => 1,
  128. 'disabledValue' => 0,
  129. 'value' => wfConfig::get('deleteTablesOnDeact') ? 1 : 0,
  130. 'title' => __('Delete Wordfence tables and data on deactivation', 'wordfence'),
  131. 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_DELETE_DEACTIVATION),
  132. ))->render();
  133. ?>
  134. </li>
  135. </ul>
  136. </div>
  137. </div>
  138. </div>
  139. </div> <!-- end general options -->