Skip to content

Commit

Permalink
bump 22.07.02
Browse files Browse the repository at this point in the history
- Fixed: Tweaks::cache_http_response() -> Default TTL.
- Fixed: Tweaks::wpservehappy() -> missing array key.
- Added: wp_cache_supports() function.
- Changed: Tweaks::cache_http_response() -> Use transient instead of wp_cache.
- Changed: Disable Auto update by default.
- Changed: Disable Advanced Post Cache by default.
- Tested up to 6.1.
  • Loading branch information
nawawi committed Dec 10, 2022
1 parent c75aedd commit f9fb85f
Show file tree
Hide file tree
Showing 32 changed files with 617 additions and 486 deletions.
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
= v22.07.02 (2022-12-10) =
- Fixed: Tweaks::cache_http_response() -> Default TTL.
- Fixed: Tweaks::wpservehappy() -> missing array key.
- Added: wp_cache_supports() function.
- Changed: Tweaks::cache_http_response() -> Use transient instead of wp_cache.
- Changed: Disable Auto update by default.
- Changed: Disable Advanced Post Cache by default.
- Tested up to 6.1.

= v22.07.01 (2022-07-15) =
- Fixed: Plugin:cleanuppost() -> Invalid index for trashbin.
- Fixed: MoCache() -> Add $entries, $headers properties to avoid warning on get_translations_for_domain.
Expand Down
Binary file modified dist/docket-cache.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions docket-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @wordpress-plugin
* Plugin Name: Docket Cache
* Plugin URI: https://docketcache.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
* Version: 22.07.01
* VerPrev: 21.08.11
* Version: 22.07.02
* VerPrev: 21.07.01
* Description: A persistent object cache stored as a plain PHP code, accelerates caching with OPcache backend.
* GitHub Plugin URI: https://github.com/nawawi/docket-cache
* Author: Nawawi Jamili
Expand Down
324 changes: 162 additions & 162 deletions includes/admin/config.php

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions includes/admin/cronbot.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,30 @@
<table class="form-table">
<?php
$title = esc_html__('Cron Events For Site', 'docket-cache');
$sites = $this->pt->get_network_sites();
if (is_multisite() && !empty($sites) && \is_array($sites) && \count($sites) > 1) :
?>
$sites = $this->pt->get_network_sites();
if (is_multisite() && !empty($sites) && \is_array($sites) && \count($sites) > 1) :
?>
<tr class="form-table-selection">
<th><?php echo $title; ?></th>
<td><select id="siteid" class="config-select">
<?php
$cronbot_siteid = (int) $this->pt->get_cron_siteid();
$cronbot_siteid = (int) $this->pt->get_cron_siteid();

foreach ($sites as $site) {
$site_id = (int) $site['id'];
$site_url = $site['url'];
$v = '['.$site_id.'] '.nwdcx_noscheme($site_url);
$url = $this->pt->action_query(
'selectsite-cronbot',
[
'idx' => 'cronbot',
'nv' => $site_id,
]
);
$selected = $site_id === $cronbot_siteid ? ' selected' : '';
echo '<option value="'.$site_id.'" data-action-link="'.$url.'"'.$selected.'>'.$v.'</option>';
}
?>
foreach ($sites as $site) {
$site_id = (int) $site['id'];
$site_url = $site['url'];
$v = '['.$site_id.'] '.nwdcx_noscheme($site_url);
$url = $this->pt->action_query(
'selectsite-cronbot',
[
'idx' => 'cronbot',
'nv' => $site_id,
]
);
$selected = $site_id === $cronbot_siteid ? ' selected' : '';
echo '<option value="'.$site_id.'" data-action-link="'.$url.'"'.$selected.'>'.$v.'</option>';
}
?>
</select>
<small>[SiteId] Hostname</small>
</td>
Expand All @@ -112,17 +112,17 @@
'idx' => 'cronbot',
]
);
?>
?>
" class="button button-secondary button-large btx-spinner"><?php esc_html_e('Run Scheduled Event', 'docket-cache'); ?></a>
<a href="
<?php
echo $this->pt->action_query(
'runeventnow-cronbot',
[
'idx' => 'cronbot',
]
);
?>
echo $this->pt->action_query(
'runeventnow-cronbot',
[
'idx' => 'cronbot',
]
);
?>
" class="button button-secondary button-large btx-spinner"><?php esc_html_e('Run All Now', 'docket-cache'); ?></a>
</div>

Expand Down
20 changes: 10 additions & 10 deletions includes/admin/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'quiet' => 1,
]
);
?>
?>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -72,22 +72,22 @@
<th class="border-b"><?php echo $this->has_vcache() ? esc_html__('Cache Size', 'docket-cache') : esc_html__('Log Size', 'docket-cache'); ?></th>
<td>
<?php
echo $log->log_size.' / '.($this->has_vcache() ? $this->cache_max_size : $this->log_max_size);
?>
echo $log->log_size.' / '.($this->has_vcache() ? $this->cache_max_size : $this->log_max_size);
?>
</td>
</tr>
<tr>
<td colspan="2">
<?php if ($this->has_vcache()) : ?>
<a href="
<?php
echo $this->pt->action_query(
'flush-ocfile',
[
'idx' => 'log',
'idxv' => $this->idx_vcache(),
]
);
echo $this->pt->action_query(
'flush-ocfile',
[
'idx' => 'log',
'idxv' => $this->idx_vcache(),
]
);
?>
" class="button button-primary button-small bt-fx"><?php esc_html_e('Flush', 'docket-cache'); ?></a>
<a href="<?php echo $this->tab_query('log'); ?>" class="button button-primary button-small bt-fx"><?php esc_html_e('Close', 'docket-cache'); ?></a>
Expand Down
70 changes: 35 additions & 35 deletions includes/admin/opcviewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</tr>
<?php
++$lcnt;
endforeach;
endforeach;
?>

<tr>
Expand Down Expand Up @@ -94,14 +94,14 @@
<a href="<?php echo $this->pt->get_page(['idx' => 'opcviewer']); ?>" class="button button-primary"><?php esc_html_e('Dismiss', 'docket-cache'); ?></a>
</p>
<?php
endif; // empty config
else :
?>
endif; // empty config
else :
?>

<?php $this->tab_title(esc_html__('OPcache Usage', 'docket-cache')); ?>
<?php
if (!$this->pt->is_opcache_enable()) :
echo Resc::boxmsg(__('OPcache not available.', 'docket-cache'), 'warning', false, true, false);
if (!$this->pt->is_opcache_enable()) :
echo Resc::boxmsg(__('OPcache not available.', 'docket-cache'), 'warning', false, true, false);
elseif (!\is_object($opcache_view)) :
echo Resc::boxmsg(__('Failed to load OPcacheList()', 'docket-cache'), 'error', false, true, false);
else :
Expand Down Expand Up @@ -196,12 +196,12 @@
<a href="<?php echo $this->pt->action_query('flush-opcache', ['idx' => 'opcviewer']); ?>" class="button button-primary button-large btx-spinner"><?php esc_html_e('Flush OPcache', 'docket-cache'); ?></a>
<a href="
<?php
echo $this->pt->get_page(
[
'idx' => 'opcviewer',
'adx' => 'cnf',
]
);
echo $this->pt->get_page(
[
'idx' => 'opcviewer',
'adx' => 'cnf',
]
);
?>
" class="button button-secondary button-large btx-spinner"><?php esc_html_e('Display Config', 'docket-cache'); ?></a>
</p>
Expand All @@ -215,35 +215,35 @@
<select id="statsop" name="sf" class="config-filter">
<?php
$sort_sf = !empty($_GET['sf']) ? sanitize_text_field($_GET['sf']) : 'obc';
$opts = [
'obc' => __('Object Cache Files', 'docket-cache'),
'wpc' => __('Other Files', 'docket-cache'),
'dfc' => __('Stale Files', 'docket-cache'),
'all' => __('All', 'docket-cache'),
];
$opts = [
'obc' => __('Object Cache Files', 'docket-cache'),
'wpc' => __('Other Files', 'docket-cache'),
'dfc' => __('Stale Files', 'docket-cache'),
'all' => __('All', 'docket-cache'),
];

if (!empty($stats->file_cache_only)) {
unset($opts['dfc']);
}
if (!empty($stats->file_cache_only)) {
unset($opts['dfc']);
}

foreach ($opts as $k => $n) {
echo '<option value="'.$k.'"'.($sort_sf === $k ? ' selected' : '').'>'.$n.'</option>';
}
?>
foreach ($opts as $k => $n) {
echo '<option value="'.$k.'"'.($sort_sf === $k ? ' selected' : '').'>'.$n.'</option>';
}
?>
</select>

<select id="statslm" name="sm" class="config-filter">
<?php
$sort_sm = !empty($_GET['sm']) ? sanitize_text_field($_GET['sm']) : '1k';
foreach ([
'1k' => __('< 1000 Items', 'docket-cache'),
'5k' => __('< 5000 Items', 'docket-cache'),
'10k' => __('< 10000 Items', 'docket-cache'),
'all' => __('> All Items', 'docket-cache'),
] as $k => $n) {
echo '<option value="'.$k.'"'.($sort_sm === $k ? ' selected' : '').'>'.$n.'</option>';
}
?>
$sort_sm = !empty($_GET['sm']) ? sanitize_text_field($_GET['sm']) : '1k';
foreach ([
'1k' => __('< 1000 Items', 'docket-cache'),
'5k' => __('< 5000 Items', 'docket-cache'),
'10k' => __('< 10000 Items', 'docket-cache'),
'all' => __('> All Items', 'docket-cache'),
] as $k => $n) {
echo '<option value="'.$k.'"'.($sort_sm === $k ? ' selected' : '').'>'.$n.'</option>';
}
?>
</select>
</form>
</div>
Expand Down
10 changes: 5 additions & 5 deletions includes/admin/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<td id="objectcache-stats">
<?php
echo $this->info->status_text_stats;
?>
?>
</td>
</tr>
<tr>
Expand All @@ -77,16 +77,16 @@
<th><?php esc_html_e('Object Cache', 'docket-cache'); ?></th>
<td id="objectcache-stats">
<?php
echo 1 === $this->info->status_code && !empty($this->info->status_text_stats) ? $this->info->status_text_stats : $this->info->status_text;
?>
echo 1 === $this->info->status_code && !empty($this->info->status_text_stats) ? $this->info->status_text_stats : $this->info->status_text;
?>
</td>
</tr>
<tr>
<th class="border-b"><?php esc_html_e('Zend OPcache', 'docket-cache'); ?></th>
<td id="opcache-stats0">
<?php
echo 1 === $this->info->opcache_code && !empty($this->info->opcache_text_stats) ? $this->info->opcache_text_stats : $this->info->opcache_text;
?>
echo 1 === $this->info->opcache_code && !empty($this->info->opcache_text_stats) ? $this->info->opcache_text_stats : $this->info->opcache_text;
?>
</td>
</tr>
<?php endif; ?>
Expand Down
42 changes: 21 additions & 21 deletions includes/admin/resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
</p>
<?php
$sites = $this->pt->get_network_sites();
if (is_multisite() && !empty($sites) && \is_array($sites) && \count($sites) > 1) :
$current_siteid = (int) $this->pt->get_current_select_siteid();
?>
if (is_multisite() && !empty($sites) && \is_array($sites) && \count($sites) > 1) :
$current_siteid = (int) $this->pt->get_current_select_siteid();
?>
<label for="siteid"><?php esc_html_e('For Site:', 'docket-cache'); ?></label>
<select id="siteid">
<option value='0' <?php echo 0 === $current_siteid ? ' selected' : ''; ?>><?php esc_html_e('all', 'docket-cache'); ?></option>
<?php
foreach ($sites as $site) {
$site_id = (int) $site['id'];
$site_url = $site['url'];
$v = nwdcx_noscheme($site_url);
$selected = $site_id > 0 && $site_id === $current_siteid ? ' selected' : '';
echo '<option value="'.$site_id.'"'.$selected.'>'.$v.'</option>';
}
?>
foreach ($sites as $site) {
$site_id = (int) $site['id'];
$site_url = $site['url'];
$v = nwdcx_noscheme($site_url);
$selected = $site_id > 0 && $site_id === $current_siteid ? ' selected' : '';
echo '<option value="'.$site_id.'"'.$selected.'>'.$v.'</option>';
}
?>
</select>
<?php endif; ?>
<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>
Expand Down Expand Up @@ -100,16 +100,16 @@
<a href="
<?php
$is_install = WpConfig::is_runtimefalse();
$act = $is_install ? esc_html__('Install Runtime Code', 'docket-cache') : esc_html__('Update Runtime Code', 'docket-cache');
$actc = $is_install ? 'button-primary' : 'button-secondary';
echo $this->pt->get_page(
[
'idx' => 'config',
'adx' => 'rtcnf',
'st' => time(),
]
);
?>
$act = $is_install ? esc_html__('Install Runtime Code', 'docket-cache') : esc_html__('Update Runtime Code', 'docket-cache');
$actc = $is_install ? 'button-primary' : 'button-secondary';
echo $this->pt->get_page(
[
'idx' => 'config',
'adx' => 'rtcnf',
'st' => time(),
]
);
?>
" class="button <?php echo $actc; ?> button-large btx-spinner"><?php echo $act; ?></a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/wrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Nawawi\DocketCache;

\defined('ABSPATH') || exit;
settings_errors((is_multisite() && is_network_admin() ? 'general' : ''));
settings_errors(is_multisite() && is_network_admin() ? 'general' : '');

if (1 === $this->info->status_code && isset($this->pt->token)) {
switch ($this->pt->token) {
Expand Down Expand Up @@ -39,7 +39,7 @@
<div class="tab-content">
<?php
$this->tab_content();
?>
?>
</div>
<h1 style="display:none;">
<!-- notice message -->
Expand Down
Loading

0 comments on commit f9fb85f

Please sign in to comment.