| 1 |
<?php |
| 2 |
/** |
| 3 |
* Docket Cache. |
| 4 |
* |
| 5 |
* @author Nawawi Jamili |
| 6 |
* @license MIT |
| 7 |
* |
| 8 |
* @see https://github.com/nawawi/docket-cache |
| 9 |
*/ |
| 10 |
|
| 11 |
namespace Nawawi\DocketCache; |
| 12 |
|
| 13 |
\defined('ABSPATH') || exit; |
| 14 |
settings_errors(is_multisite() && is_network_admin() ? 'general' : ''); |
| 15 |
|
| 16 |
if (1 === $this->info->status_code && isset($this->pt->token)) { |
| 17 |
switch ($this->pt->token) { |
| 18 |
case 'docket-occache-flushed': |
| 19 |
$this->pt->flush_cache(); |
| 20 |
$this->do_preload = true; |
| 21 |
$this->do_flush = true; |
| 22 |
break; |
| 23 |
case 'docket-occache-enabled': |
| 24 |
$this->do_preload = true; |
| 25 |
$this->do_flush = true; |
| 26 |
break; |
| 27 |
case 'docket-log-flushed': |
| 28 |
$this->pt->flush_log(); |
| 29 |
$this->do_fetch = true; |
| 30 |
break; |
| 31 |
} |
| 32 |
if ($this->vcf()->is_dcfalse('PRELOAD') || 2 === $this->info->status_code) { |
| 33 |
$this->do_preload = false; |
| 34 |
} |
| 35 |
} |
| 36 |
?> |
| 37 |
<div class="wrap" id="docket-cache"> |
| 38 |
<?php $this->tab_nav(); ?> |
| 39 |
<div class="tab-content"> |
| 40 |
<?php |
| 41 |
$this->tab_content(); |
| 42 |
?> |
| 43 |
</div> |
| 44 |
<h1 style="display:none;"> |
| 45 |
<!-- notice message --> |
| 46 |
</h1> |
| 47 |
</div> |
| 48 |
<div id="docket-cache-overlay" style="display: none;"> |
| 49 |
<div id="wait-spinner" class="text" style="display: none;"><?php esc_html_e('Please wait..', 'docket-cache'); ?><img src="<?php echo Resc::spinner(); ?>"></div> |
| 50 |
</div> |
| 51 |
<?php |
| 52 |
if ($this->do_preload) : |
| 53 |
echo $this->pt->code_worker(['flush', 'preload']); |
| 54 |
elseif ($this->do_flush) : |
| 55 |
echo $this->pt->code_worker('flush'); |
| 56 |
elseif ($this->do_fetch) : |
| 57 |
echo $this->pt->code_worker('fetch'); |
| 58 |
endif; |
| 59 |
|
| 60 |
if (($this->tab_current('config') || $this->tab_current('log')) && !empty($_GET['nx'])) : |
| 61 |
echo $this->code_focus(); |
| 62 |
endif; |
| 63 |
|