| 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 |
?> |
| 15 |
<?php $this->tab_title(esc_html__('Actions', 'docket-cache')); ?> |
| 16 |
<div class="qact"> |
| 17 |
<div class="cmd"> |
| 18 |
<h4><?php esc_html_e('Cleanup Post', 'docket-cache'); ?></h4> |
| 19 |
<p> |
| 20 |
<?php esc_html_e('Cleanup Revisions, Auto Draft, Trash Bin.', 'docket-cache'); ?> |
| 21 |
</p> |
| 22 |
<?php |
| 23 |
$sites = $this->pt->get_network_sites(); |
| 24 |
if (is_multisite() && !empty($sites) && \is_array($sites) && \count($sites) > 1) : |
| 25 |
$current_siteid = (int) $this->pt->get_current_select_siteid(); |
| 26 |
?> |
| 27 |
<label for="siteid"><?php esc_html_e('For Site:', 'docket-cache'); ?></label> |
| 28 |
<select id="siteid"> |
| 29 |
<option value='0' <?php echo 0 === $current_siteid ? ' selected' : ''; ?>><?php esc_html_e('all', 'docket-cache'); ?></option> |
| 30 |
<?php |
| 31 |
foreach ($sites as $site) { |
| 32 |
$site_id = (int) $site['id']; |
| 33 |
$site_url = $site['url']; |
| 34 |
$v = nwdcx_noscheme($site_url); |
| 35 |
$selected = $site_id > 0 && $site_id === $current_siteid ? ' selected' : ''; |
| 36 |
echo '<option value="'.$site_id.'"'.$selected.'>'.$v.'</option>'; |
| 37 |
} |
| 38 |
?> |
| 39 |
</select> |
| 40 |
<?php endif; ?> |
| 41 |
<a href="<?php echo $this->pt->action_query('cleanuppost', ['idx' => 'config']); ?>" class="button button-primary button-large btx-spinner btx-cleanuppost"><?php esc_html_e('Cleanup Post', 'docket-cache'); ?></a> |
| 42 |
|
| 43 |
<?php if ($this->vcf()->is_dctrue('FLUSHACTION')) : ?> |
| 44 |
<?php if ($this->vcf()->is_dctrue('ADVCPOST')) : ?> |
| 45 |
<hr> |
| 46 |
<h4><?php esc_html_e('Advanced Post Cache Files', 'docket-cache'); ?></h4> |
| 47 |
<p> |
| 48 |
<?php esc_html_e('Remove Advanced Post Cache files.', 'docket-cache'); ?> |
| 49 |
</p> |
| 50 |
<a href="<?php echo $this->pt->action_query('flush-advcpost', ['idx' => 'config']); ?>" class="button button-primary button-large btx-spinner"><?php esc_html_e('Flush Advanced Post Cache', 'docket-cache'); ?></a> |
| 51 |
<?php endif; ?> |
| 52 |
|
| 53 |
<?php if ($this->vcf()->is_dctrue('PRECACHE')) : ?> |
| 54 |
<hr> |
| 55 |
<h4><?php esc_html_e('Object Precache Files', 'docket-cache'); ?></h4> |
| 56 |
<p> |
| 57 |
<?php esc_html_e('Remove Object Cache Precaching files.', 'docket-cache'); ?> |
| 58 |
</p> |
| 59 |
<a href="<?php echo $this->pt->action_query('flush-ocprecache', ['idx' => 'config']); ?>" class="button button-primary button-large btx-spinner"><?php esc_html_e('Flush Object Precache', 'docket-cache'); ?></a> |
| 60 |
<?php endif; ?> |
| 61 |
|
| 62 |
<hr> |
| 63 |
<h4><?php esc_html_e('Transient Cache Files', 'docket-cache'); ?></h4> |
| 64 |
<p> |
| 65 |
<?php esc_html_e('Remove transient cache files.', 'docket-cache'); ?> |
| 66 |
</p> |
| 67 |
<a href="<?php echo $this->pt->action_query('flush-transient', ['idx' => 'config']); ?>" class="button button-primary button-large btx-spinner"><?php esc_html_e('Flush Transient Cache', 'docket-cache'); ?></a> |
| 68 |
|
| 69 |
<?php if ($this->vcf()->is_dctrue('MENUCACHE')) : ?> |
| 70 |
<hr> |
| 71 |
<h4><?php esc_html_e('Menu Cache Files', 'docket-cache'); ?></h4> |
| 72 |
<p> |
| 73 |
<?php esc_html_e('Remove menu cache files.', 'docket-cache'); ?> |
| 74 |
</p> |
| 75 |
<a href="<?php echo $this->pt->action_query('flush-menucache', ['idx' => 'config']); ?>" class="button button-primary button-large btx-spinner"><?php esc_html_e('Flush Menu Cache', 'docket-cache'); ?></a> |
| 76 |
<?php endif; ?> |
| 77 |
|
| 78 |
<?php if ($this->vcf()->is_dctrue('MOCACHE')) : ?> |
| 79 |
<hr> |
| 80 |
<h4><?php esc_html_e('Translation Cache Files', 'docket-cache'); ?></h4> |
| 81 |
<p> |
| 82 |
<?php esc_html_e('Remove translation cache files.', 'docket-cache'); ?> |
| 83 |
</p> |
| 84 |
<a href="<?php echo $this->pt->action_query('flush-mocache', ['idx' => 'config']); ?>" class="button button-primary button-large btx-spinner"><?php esc_html_e('Flush Translation Cache', 'docket-cache'); ?></a> |
| 85 |
<?php endif; ?> |
| 86 |
|
| 87 |
<?php endif; // flushaction?> |
| 88 |
<hr> |
| 89 |
<h4><?php esc_html_e('Config Reset', 'docket-cache'); ?></h4> |
| 90 |
<p> |
| 91 |
<?php esc_html_e('Reset all configuration to default.', 'docket-cache'); ?> |
| 92 |
</p> |
| 93 |
<a href="<?php echo $this->pt->action_query('configreset', ['idx' => 'config']); ?>" class="button button-primary button-large btx-spinner"><?php esc_html_e('Reset to default', 'docket-cache'); ?></a> |
| 94 |
|
| 95 |
<?php if (is_main_network()) : ?> |
| 96 |
<hr> |
| 97 |
<h4><?php esc_html_e('Runtime Code', 'docket-cache'); ?></h4> |
| 98 |
<p> |
| 99 |
<?php esc_html_e('Code to handles WordPress constants.', 'docket-cache'); ?> |
| 100 |
</p> |
| 101 |
<a href=" |
| 102 |
<?php |
| 103 |
$is_install = WpConfig::is_runtimefalse(); |
| 104 |
$act = $is_install ? esc_html__('Install Runtime Code', 'docket-cache') : esc_html__('Update Runtime Code', 'docket-cache'); |
| 105 |
$actc = $is_install ? 'button-primary' : 'button-secondary'; |
| 106 |
echo $this->pt->get_page( |
| 107 |
[ |
| 108 |
'idx' => 'config', |
| 109 |
'adx' => 'rtcnf', |
| 110 |
'st' => time(), |
| 111 |
] |
| 112 |
); |
| 113 |
?> |
| 114 |
" class="button <?php echo $actc; ?> button-large btx-spinner"><?php echo $act; ?></a> |
| 115 |
<?php endif; // is_main_network?> |
| 116 |
|
| 117 |
</div> |
| 118 |
</div> |
| 119 |
<?php $this->tab_title(esc_html__('Resources', 'docket-cache')); ?> |
| 120 |
<div class="postbox"> |
| 121 |
<div class="inside"> |
| 122 |
<div> |
| 123 |
<p> |
| 124 |
<strong><?php esc_html_e('DOCUMENTATION', 'docket-cache'); ?></strong><br class="break"> |
| 125 |
<?php esc_html_e('To adjust the plugin behaviour and manage through a command line.', 'docket-cache'); ?> |
| 126 |
<a href="https://docs.docketcache.com/?utm_source=wp-plugins&utm_campaign=docs-uri&utm_medium=dc-config" class="button button-secondary button-small bt-cx" rel="noopener" target="new"><?php esc_html_e('Documentation', 'docket-cache'); ?></a> |
| 127 |
</p> |
| 128 |
<hr> |
| 129 |
<p> |
| 130 |
<strong><?php esc_html_e('FEEDBACK', 'docket-cache'); ?></strong><br class="break"> |
| 131 |
<?php esc_html_e('Write a review of your experience using this plugin.', 'docket-cache'); ?> |
| 132 |
<a href="https://docketcache.com/feedback/?utm_source=wp-plugins&utm_campaign=reviews-uri&utm_medium=dc-config" class="button button-secondary button-small bt-cx" rel="noopener" target="new"><?php esc_html_e('Submit Review', 'docket-cache'); ?></a> |
| 133 |
</p> |
| 134 |
<?php if (!apply_filters('docketcache/filter/view/nosponsor', false)) : ?> |
| 135 |
<hr> |
| 136 |
<p> |
| 137 |
<strong><?php esc_html_e('SPONSOR', 'docket-cache'); ?></strong><br class="break"> |
| 138 |
<?php esc_html_e('Fund Docket Cache one-off or recurring payment to support our open-source development efforts.', 'docket-cache'); ?> |
| 139 |
<a href="https://docketcache.com/sponsorship/?utm_source=wp-plugins&utm_campaign=sponsor-uri&utm_medium=dc-config" class="button button-secondary button-small bt-cx" rel="noopener" target="new"><?php esc_html_e('Become Sponsor', 'docket-cache'); ?></a> |
| 140 |
</p> |
| 141 |
<?php endif; ?> |
| 142 |
<?php do_action('docketcache/action/view/resources'); ?> |
| 143 |
</div> |
| 144 |
</div> |
| 145 |
</div> |
| 146 |
|