PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / vendor / wp-media / mcp-oauth / inc / Auth / Http404Trait.php

Http404Trait.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF trunk, at vendor/wp-media/mcp-oauth/inc/Auth/Http404Trait.php

31 lines 695 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Shared 404 helper for OAuth request handlers.
4 */
5
6 declare( strict_types=1 );
7
8 namespace WPMedia\MCP\OAuth\Auth;
9
10 /**
11 * Provides a clean 404 response for stale OAuth/discovery rewrite rules.
12 */
13 trait Http404Trait {
14
15 /**
16 * Force a clean 404 response.
17 *
18 * Used when a stale rewrite rule still routes a request to an OAuth or
19 * discovery endpoint after the OAuth server has been disabled, before
20 * rewrite rules have been flushed. Without this, WordPress's main query
21 * would fall through to the homepage instead of returning a 404.
22 *
23 * @return void
24 */
25 private function force_404(): void {
26 global $wp_query;
27 $wp_query->set_404();
28 status_header( 404 );
29 }
30 }
31