| 1 |
<div class="lws_tk_tab_line lws_tk_tab_border lws_tk_tab_border_blue"> |
| 2 |
<div class="lws_tk_tab"> |
| 3 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/parametres.svg') ?>"> |
| 4 |
<span class="lws_tk_basic"><?php echo esc_html_e('Disconnect the session of every user excepted yourself.', 'lws-tools') ?></span> |
| 5 |
</div> |
| 6 |
|
| 7 |
<fieldset> |
| 8 |
<div class="lws_tk_tab_button"> |
| 9 |
<button class="lws_tk_update_button_blue" name="lws_tk_disconnect_all" id="lws_tk_disconnect_all" type="button"> |
| 10 |
<span class="" name="update"> |
| 11 |
<img class="lws_tk_image" width="19px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/deconnexion_blanc.svg') ?>"> |
| 12 |
<?php esc_html_e('Disconnect everyone', 'lws-tools') ?> |
| 13 |
</span> |
| 14 |
<span class="hidden" name="loading"> |
| 15 |
<img class="lws_tk_image" width="15px" height="15px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/loading.svg') ?>"> |
| 16 |
<span id="loading_1"><?php esc_html_e("Disconnexion...", "lws-tools"); ?></span> |
| 17 |
</span> |
| 18 |
<span class="hidden" name="validated"> |
| 19 |
<img class="lws_tk_image" width="18px" height="18px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/check_blanc.svg') ?>"> |
| 20 |
<?php esc_html_e('Disconnected', 'lws-tools'); ?> |
| 21 |
</span> |
| 22 |
</button> |
| 23 |
</div> |
| 24 |
</fieldset> |
| 25 |
</div> |
| 26 |
|
| 27 |
<!-- Revision --> |
| 28 |
<div class="lws_tk_tab_line lws_tk_tab_border <?php echo $revisions_amount == 0 ? esc_attr("lws_tk_tab_border_green") : esc_attr("lws_tk_tab_border_orange"); ?>"> |
| 29 |
<?php if ($revisions_amount > 0) : ?> |
| 30 |
<div class="lws_tk_tab"> |
| 31 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/warning.svg') ?>"> |
| 32 |
<span class="lws_tk_basic"> |
| 33 |
<?php printf(wp_kses(__('<strong>%d revision(s).</strong>', 'lws-tools'), $arr), $revisions_amount); ?> |
| 34 |
<?php esc_html_e('Remove every revisions older than', 'lws-tools'); ?> |
| 35 |
<input style="width:120px" id="lws_tk_select_days_revision" type="number" min="0" value="1" /> |
| 36 |
<?php esc_html_e(' day(s).', 'lws-tools'); ?> |
| 37 |
</span> |
| 38 |
</div> |
| 39 |
|
| 40 |
<div class="lws_tk_tab_button"> |
| 41 |
<button class="lws_tk_update_button" name="lws_tk_delete_revisions" id="lws_tk_delete_revisions"> |
| 42 |
<span class="" name="update"> |
| 43 |
<img class="lws_tk_image" width="19px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/supprimer.svg') ?>"> |
| 44 |
<?php printf(esc_html__('Delete revisions (%d)', 'lws-tools'), $revisions_amount); ?> |
| 45 |
</span> |
| 46 |
<span class="hidden" name="loading"> |
| 47 |
<img class="lws_tk_image" width="15px" height="15px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/loading.svg') ?>"> |
| 48 |
<span id="loading_1"><?php esc_html_e("Deletion...", "lws-tools"); ?></span> |
| 49 |
</span> |
| 50 |
<span class="hidden" name="validated"> |
| 51 |
<img class="lws_tk_image" width="18px" height="18px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/check_blanc.svg') ?>"> |
| 52 |
<?php esc_html_e('Deleted', 'lws-tools'); ?> |
| 53 |
</span> |
| 54 |
</button> |
| 55 |
</div> |
| 56 |
<?php else : ?> |
| 57 |
<div class="lws_tk_tab"> |
| 58 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/pouce.svg') ?>"> |
| 59 |
<span class="lws_tk_uptodate"><?php echo wp_kses(__('<strong>No revisions</strong> to delete', 'lws-tools'), $arr) ?></span> |
| 60 |
</div> |
| 61 |
|
| 62 |
<div class="lws_tk_tab_button"> |
| 63 |
<button class="lws_tk_green_update_button" name=""> |
| 64 |
<span class="" name=""> |
| 65 |
<img class="lws_tk_image" width="17px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/securiser.svg') ?>"> |
| 66 |
<?php esc_html_e('No revisions', 'lws-tools') ?> |
| 67 |
</span> |
| 68 |
</button> |
| 69 |
</div> |
| 70 |
<?php endif ?> |
| 71 |
</div> |
| 72 |
|
| 73 |
<!-- Comments Trashed --> |
| 74 |
<div class="lws_tk_tab_line lws_tk_tab_border <?php echo $trashed_comments == 0 ? esc_attr("lws_tk_tab_border_green") : esc_attr("lws_tk_tab_border_red"); ?>"> |
| 75 |
<?php if ($trashed_comments > 0) : ?> |
| 76 |
<div class="lws_tk_tab"> |
| 77 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/pouce_bas.svg') ?>"> |
| 78 |
<span class="lws_tk_basic"> |
| 79 |
<?php printf(wp_kses(__('<strong>%d comment(s)</strong> in the trash.', 'lws-tools'), $arr), $trashed_comments); ?> |
| 80 |
</span> |
| 81 |
</div> |
| 82 |
|
| 83 |
<div class="lws_tk_tab_button"> |
| 84 |
<button class="lws_tk_update_button" name="lws_tk_delete_trashed_comments" id="lws_tk_delete_trashed_comments"> |
| 85 |
<span class="" name="update"> |
| 86 |
<img class="lws_tk_image" width="19px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/supprimer.svg') ?>"> |
| 87 |
<?php printf(esc_html__('Delete comments in the trash (%d)', 'lws-tools'), $trashed_comments); ?> |
| 88 |
</span> |
| 89 |
<span class="hidden" name="loading"> |
| 90 |
<img class="lws_tk_image" width="15px" height="15px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/loading.svg') ?>"> |
| 91 |
<span id="loading_1"><?php esc_html_e("Deletion...", "lws-tools"); ?></span> |
| 92 |
</span> |
| 93 |
<span class="hidden" name="validated"> |
| 94 |
<img class="lws_tk_image" width="18px" height="18px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/check_blanc.svg') ?>"> |
| 95 |
<?php esc_html_e('Deleted', 'lws-tools'); ?> |
| 96 |
</span> |
| 97 |
</button> |
| 98 |
</div> |
| 99 |
<?php else : ?> |
| 100 |
<div class="lws_tk_tab"> |
| 101 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/pouce.svg') ?>"> |
| 102 |
<span class="lws_tk_uptodate"><?php echo wp_kses(__('<strong>No comments</strong> in the trash', 'lws-tools'), $arr) ?></span> |
| 103 |
</div> |
| 104 |
|
| 105 |
<div class="lws_tk_tab_button"> |
| 106 |
<button class="lws_tk_green_update_button" name=""> |
| 107 |
<span class="" name=""> |
| 108 |
<img class="lws_tk_image" width="17px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/securiser.svg') ?>"> |
| 109 |
<?php esc_html_e('No trashed comments', 'lws-tools') ?> |
| 110 |
</span> |
| 111 |
</button> |
| 112 |
</div> |
| 113 |
<?php endif ?> |
| 114 |
</div> |
| 115 |
|
| 116 |
<!-- Comments Spam --> |
| 117 |
<div class="lws_tk_tab_line lws_tk_tab_border <?php echo $spam_comments == 0 ? esc_attr("lws_tk_tab_border_green") : esc_attr("lws_tk_tab_border_red"); ?>"> |
| 118 |
<?php if ($spam_comments > 0) : ?> |
| 119 |
<div class="lws_tk_tab"> |
| 120 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/pouce_bas.svg') ?>"> |
| 121 |
<span class="lws_tk_basic"> |
| 122 |
<?php printf(wp_kses(__('<strong>%d spam comment(s)</strong>.', 'lws-tools'), $arr), $spam_comments); ?> |
| 123 |
</span> |
| 124 |
</div> |
| 125 |
|
| 126 |
<div class="lws_tk_tab_button"> |
| 127 |
<button class="lws_tk_update_button" name="lws_tk_delete_spam_comments" id="lws_tk_delete_spam_comments"> |
| 128 |
<span class="" name="update"> |
| 129 |
<img class="lws_tk_image" width="19px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/supprimer.svg') ?>"> |
| 130 |
<?php printf(esc_html__('Delete spam comments (%d)', 'lws-tools'), $spam_comments); ?> |
| 131 |
</span> |
| 132 |
<span class="hidden" name="loading"> |
| 133 |
<img class="lws_tk_image" width="15px" height="15px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/loading.svg') ?>"> |
| 134 |
<span id="loading_1"><?php esc_html_e("Deletion...", "lws-tools"); ?></span> |
| 135 |
</span> |
| 136 |
<span class="hidden" name="validated"> |
| 137 |
<img class="lws_tk_image" width="18px" height="18px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/check_blanc.svg') ?>"> |
| 138 |
<?php esc_html_e('Deleted', 'lws-tools'); ?> |
| 139 |
</span> |
| 140 |
</button> |
| 141 |
</div> |
| 142 |
<?php else : ?> |
| 143 |
<div class="lws_tk_tab"> |
| 144 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/pouce.svg') ?>"> |
| 145 |
<span class="lws_tk_uptodate"><?php echo wp_kses(__('<strong>No spam comments</strong>', 'lws-tools'), $arr) ?></span> |
| 146 |
</div> |
| 147 |
|
| 148 |
<div class="lws_tk_tab_button"> |
| 149 |
<button class="lws_tk_green_update_button" name=""> |
| 150 |
<span class="" name=""> |
| 151 |
<img class="lws_tk_image" width="17px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/securiser.svg') ?>"> |
| 152 |
<?php esc_html_e('No spam comments', 'lws-tools') ?> |
| 153 |
</span> |
| 154 |
</button> |
| 155 |
</div> |
| 156 |
<?php endif ?> |
| 157 |
</div> |
| 158 |
|
| 159 |
<!-- Transients --> |
| 160 |
<div class="lws_tk_tab_line lws_tk_tab_border lws_tk_tab_border_blue"> |
| 161 |
<div class="lws_tk_tab"> |
| 162 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/parametres.svg') ?>"> |
| 163 |
<span class="lws_tk_basic"><?php echo esc_html_e('Remove old temporary data (transients)', 'lws-tools') ?></span> |
| 164 |
</div> |
| 165 |
|
| 166 |
<fieldset> |
| 167 |
<div class="lws_tk_tab_button"> |
| 168 |
<button class="lws_tk_update_button_blue" name="lws_tk_delete_transients" id="lws_tk_delete_transients" type="button"> |
| 169 |
<span class="" name="update"> |
| 170 |
<img class="lws_tk_image" width="19px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/supprimer.svg') ?>"> |
| 171 |
<?php esc_html_e('Remove transients', 'lws-tools') ?> |
| 172 |
</span> |
| 173 |
<span class="hidden" name="loading"> |
| 174 |
<img class="lws_tk_image" width="15px" height="15px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/loading.svg') ?>"> |
| 175 |
<span id="loading_1"><?php esc_html_e("Removing...", "lws-tools"); ?></span> |
| 176 |
</span> |
| 177 |
<span class="hidden" name="validated"> |
| 178 |
<img class="lws_tk_image" width="18px" height="18px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/check_blanc.svg') ?>"> |
| 179 |
<?php esc_html_e('Removed', 'lws-tools'); ?> |
| 180 |
</span> |
| 181 |
</button> |
| 182 |
</div> |
| 183 |
</fieldset> |
| 184 |
</div> |
| 185 |
|
| 186 |
<!-- Reset --> |
| 187 |
<div class="lws_tk_tab_line lws_tk_tab_border lws_tk_tab_border_blue"> |
| 188 |
<div class="lws_tk_tab"> |
| 189 |
<img class="lws_tk_image" width="25px" height="22px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/parametres.svg') ?>"> |
| 190 |
<span class="lws_tk_basic"><?php echo esc_html_e('Reset the plugin configuration', 'lws-tools') ?></span> |
| 191 |
</div> |
| 192 |
|
| 193 |
<form method="POST"> |
| 194 |
<?php wp_nonce_field('lws_tk_reset_plugin', 'nonce_security_reset_nonce'); ?> |
| 195 |
<div class="lws_tk_tab_button"> |
| 196 |
<button class="lws_tk_update_button" name="lws_tk_reset_plugin" id="lws_tk_reset_plugin" type="submit"> |
| 197 |
<span class="" name="update"> |
| 198 |
<img class="lws_tk_image" width="19px" height="20px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/maj.svg') ?>"> |
| 199 |
<?php esc_html_e('Reset', 'lws-tools') ?> |
| 200 |
</span> |
| 201 |
<span class="hidden" name="loading"> |
| 202 |
<img class="lws_tk_image" width="15px" height="15px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/loading.svg') ?>"> |
| 203 |
<span id="loading_1"><?php esc_html_e("Resetting...", "lws-tools"); ?></span> |
| 204 |
</span> |
| 205 |
<span class="hidden" name="validated"> |
| 206 |
<img class="lws_tk_image" width="18px" height="18px" src="<?php echo esc_url(plugin_dir_url(__DIR__) . 'images/check_blanc.svg') ?>"> |
| 207 |
<?php esc_html_e('Reset', 'lws-tools'); ?> |
| 208 |
</span> |
| 209 |
</button> |
| 210 |
</div> |
| 211 |
</form> |
| 212 |
</div> |
| 213 |
|
| 214 |
<div class="lws_tk_tab_line"> |
| 215 |
<div class="lws_tk_tab"> |
| 216 |
<label for='lws_tk_keep_changes'> |
| 217 |
<input type="checkbox" class="lws_tk_checkboxes" id="lws_tk_keep_changes" name="lws_tk_keep_changes" <?php echo get_option('lws_tk_keep_data_on_delete') ? esc_attr('checked') : ''; ?>> |
| 218 |
<?php esc_html_e('Keep configuration even after deleting the plugin', 'lws-tools'); ?> |
| 219 |
</label> |
| 220 |
</div> |
| 221 |
</div> |
| 222 |
|
| 223 |
<script> |
| 224 |
jQuery('#lws_tk_disconnect_all').on('click', function() { |
| 225 |
let button = this; |
| 226 |
let button_id = this.id; |
| 227 |
console.log(this.children); |
| 228 |
button.children[0].classList.add('hidden'); |
| 229 |
button.children[2].classList.add('hidden'); |
| 230 |
button.children[1].classList.remove('hidden'); |
| 231 |
button.classList.remove('lws_tk_validated_button_tools'); |
| 232 |
button.setAttribute('disabled', true); |
| 233 |
var data = { |
| 234 |
_ajax_nonce: '<?php echo esc_attr(wp_create_nonce('disconnect_all_and_everyone')); ?>', |
| 235 |
action: "lwstools_disconnectall", |
| 236 |
}; |
| 237 |
jQuery.post(ajaxurl, data, function(response) { |
| 238 |
var button = jQuery('#' + button_id); |
| 239 |
button.children()[0].classList.add('hidden'); |
| 240 |
button.children()[2].classList.remove('hidden'); |
| 241 |
button.children()[1].classList.add('hidden'); |
| 242 |
button.addClass('lws_tk_validated_button_tools'); |
| 243 |
button.prop('disabled', false); |
| 244 |
}); |
| 245 |
}); |
| 246 |
|
| 247 |
jQuery('#lws_tk_delete_revisions').on('click', function() { |
| 248 |
let button = this; |
| 249 |
let button_id = this.id; |
| 250 |
console.log(this.children); |
| 251 |
button.children[0].classList.add('hidden'); |
| 252 |
button.children[2].classList.add('hidden'); |
| 253 |
button.children[1].classList.remove('hidden'); |
| 254 |
button.classList.remove('lws_tk_validated_button_tools'); |
| 255 |
button.setAttribute('disabled', true); |
| 256 |
var days = jQuery('#lws_tk_select_days_revision').val(); |
| 257 |
var data = { |
| 258 |
lws_tk_days_revisions: days, |
| 259 |
_ajax_nonce: '<?php echo esc_attr(wp_create_nonce('delete_all_revisions')); ?>', |
| 260 |
action: "lwstools_delete_revisions", |
| 261 |
}; |
| 262 |
jQuery.post(ajaxurl, data, function(response) { |
| 263 |
var button = jQuery('#' + button_id); |
| 264 |
button.children()[0].classList.add('hidden'); |
| 265 |
button.children()[2].classList.remove('hidden'); |
| 266 |
button.children()[1].classList.add('hidden'); |
| 267 |
button.addClass('lws_tk_validated_button_tools'); |
| 268 |
button.prop('disabled', false); |
| 269 |
}); |
| 270 |
}); |
| 271 |
|
| 272 |
|
| 273 |
jQuery('#lws_tk_reset_plugin').on('click', function() { |
| 274 |
let button = this; |
| 275 |
button.children[0].classList.add('hidden'); |
| 276 |
button.children[1].classList.remove('hidden'); |
| 277 |
}); |
| 278 |
|
| 279 |
jQuery('#lws_tk_delete_trashed_comments').on('click', function() { |
| 280 |
let button = this; |
| 281 |
let button_id = this.id; |
| 282 |
console.log(this.children); |
| 283 |
button.children[0].classList.add('hidden'); |
| 284 |
button.children[2].classList.add('hidden'); |
| 285 |
button.children[1].classList.remove('hidden'); |
| 286 |
button.classList.remove('lws_tk_validated_button_tools'); |
| 287 |
button.setAttribute('disabled', true); |
| 288 |
var data = { |
| 289 |
_ajax_nonce: '<?php echo esc_attr(wp_create_nonce('delete_all_trash_comments')); ?>', |
| 290 |
action: "lwstools_delete_trash_comments", |
| 291 |
}; |
| 292 |
jQuery.post(ajaxurl, data, function(response) { |
| 293 |
var button = jQuery('#' + button_id); |
| 294 |
button.children()[0].classList.add('hidden'); |
| 295 |
button.children()[2].classList.remove('hidden'); |
| 296 |
button.children()[1].classList.add('hidden'); |
| 297 |
button.addClass('lws_tk_validated_button_tools'); |
| 298 |
button.prop('disabled', false); |
| 299 |
}); |
| 300 |
}); |
| 301 |
|
| 302 |
jQuery('#lws_tk_delete_spam_comments').on('click', function() { |
| 303 |
let button = this; |
| 304 |
let button_id = this.id; |
| 305 |
console.log(this.children); |
| 306 |
button.children[0].classList.add('hidden'); |
| 307 |
button.children[2].classList.add('hidden'); |
| 308 |
button.children[1].classList.remove('hidden'); |
| 309 |
button.classList.remove('lws_tk_validated_button_tools'); |
| 310 |
button.setAttribute('disabled', true); |
| 311 |
var data = { |
| 312 |
_ajax_nonce: '<?php echo esc_attr(wp_create_nonce('delete_all_spam_comms')); ?>', |
| 313 |
action: "lwstools_delete_spam_comments", |
| 314 |
}; |
| 315 |
jQuery.post(ajaxurl, data, function(response) { |
| 316 |
var button = jQuery('#' + button_id); |
| 317 |
button.children()[0].classList.add('hidden'); |
| 318 |
button.children()[2].classList.remove('hidden'); |
| 319 |
button.children()[1].classList.add('hidden'); |
| 320 |
button.addClass('lws_tk_validated_button_tools'); |
| 321 |
button.prop('disabled', false); |
| 322 |
}); |
| 323 |
}); |
| 324 |
|
| 325 |
jQuery('#lws_tk_delete_transients').on('click', function() { |
| 326 |
let button = this; |
| 327 |
let button_id = this.id; |
| 328 |
console.log(this.children); |
| 329 |
button.children[0].classList.add('hidden'); |
| 330 |
button.children[2].classList.add('hidden'); |
| 331 |
button.children[1].classList.remove('hidden'); |
| 332 |
button.classList.remove('lws_tk_validated_button_tools'); |
| 333 |
button.setAttribute('disabled', true); |
| 334 |
var data = { |
| 335 |
_ajax_nonce: '<?php echo esc_attr(wp_create_nonce('delete_all_transients')); ?>', |
| 336 |
action: "lwstools_delete_transients", |
| 337 |
}; |
| 338 |
jQuery.post(ajaxurl, data, function(response) { |
| 339 |
var button = jQuery('#' + button_id); |
| 340 |
button.children()[0].classList.add('hidden'); |
| 341 |
button.children()[2].classList.remove('hidden'); |
| 342 |
button.children()[1].classList.add('hidden'); |
| 343 |
button.addClass('lws_tk_validated_button_tools'); |
| 344 |
button.prop('disabled', false); |
| 345 |
}); |
| 346 |
}); |
| 347 |
|
| 348 |
jQuery('#lws_tk_keep_changes').on('change', function() { |
| 349 |
var data = { |
| 350 |
_ajax_nonce: '<?php echo esc_attr(wp_create_nonce('keep_on_delete_change')); ?>', |
| 351 |
action: "lwstools_keep_changes", |
| 352 |
state: this.checked, |
| 353 |
}; |
| 354 |
jQuery.post(ajaxurl, data); |
| 355 |
|
| 356 |
}); |
| 357 |
</script> |