PluginProbe
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN / 1.3.2
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN v1.3.2
1.3.3 1.3.2 1.3.1 1.3.0 1.2.4 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 All 29 releases
← All changes | includes/class-cache-meta-box.php +28 -0 1.2.41.3.2 View file →
@@ -88,8 +88,36 @@
88 88 <p style="font-size:12px;color:#666;margin:-4px 0 0;">
89 89 <?php esc_html_e( 'Override the global cache expiry for this post (1–720 hours). Leave at 0 to inherit the site default.', 'xspeed' ); ?>
90 90 </p>
91 91 <?php
92 + self::render_purge_action( $post );
93 + }
94 +
95 + /**
96 + * "Purge this post's cache" under the rules.
97 + *
98 + * Shown only for a published, publicly viewable post — a draft has no
99 + * cached page to clear, so the button could only ever report that it
100 + * removed nothing. It leaves the editor rather than submitting the post
101 + * form, so an unsaved draft is never silently published by a purge.
102 + */
103 + private static function render_purge_action( \WP_Post $post ): void {
104 + if ( ! Purge_Ui::user_can_purge() ) {
105 + return;
106 + }
107 + if ( '' === Purge_Ui::permalink_of( (int) $post->ID ) ) {
108 + return;
109 + }
110 + ?>
111 + <p style="margin:14px 0 0;padding-top:12px;border-top:1px solid #dcdcde;">
112 + <a href="<?php echo esc_url( Purge_Ui::post_purge_link( (int) $post->ID ) ); ?>" class="button button-secondary">
113 + <?php esc_html_e( 'Purge this post’s cache', 'xspeed' ); ?>
114 + </a>
115 + </p>
116 + <p style="font-size:12px;color:#666;margin:6px 0 0;">
117 + <?php esc_html_e( 'Clears this post and the pages that list it — the homepage, its archive and the neighbouring posts. The rest of the site keeps its cache.', 'xspeed' ); ?>
118 + </p>
119 + <?php
92 120 }
93 121
94 122 /**
95 123 * @param int $post_id