$asenha_flush_mu_file = __FILE__;
$asenha_delete_cache_flush_mu_plugin = function () use ( $asenha_flush_mu_file ) {
	if ( is_string( $asenha_flush_mu_file ) && '' !== $asenha_flush_mu_file && file_exists( $asenha_flush_mu_file ) ) {
		@unlink( $asenha_flush_mu_file ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
	}
};
register_shutdown_function( $asenha_delete_cache_flush_mu_plugin );
add_action( 'shutdown', $asenha_delete_cache_flush_mu_plugin, 999 );
$asenha_run_cache_flush = function () {
	$asenha_groups = array( 'posts', 'post_meta', 'counts', 'options' );

	if ( function_exists( 'wp_cache_flush' ) ) {
		wp_cache_flush();
	}
	if ( function_exists( 'wp_cache_flush_group' ) ) {
		foreach ( $asenha_groups as $asenha_group ) {
			wp_cache_flush_group( $asenha_group );
		}
	}
	if ( function_exists( 'wp_cache_delete' ) ) {
		wp_cache_delete( 'alloptions', 'options' );
		wp_cache_delete( 'notoptions', 'options' );
	}
	global $wp_object_cache;
	if ( is_object( $wp_object_cache ) ) {
		foreach ( array( 'local_cache', 'cache' ) as $asenha_oc_prop ) {
			try {
				if ( ! property_exists( $wp_object_cache, $asenha_oc_prop ) ) {
					continue;
				}
				$asenha_readable = method_exists( $wp_object_cache, '__get' );
				if ( ! $asenha_readable ) {
					$asenha_ref = new ReflectionProperty( $wp_object_cache, $asenha_oc_prop );
					$asenha_readable = $asenha_ref->isPublic();
				}
				if ( ! $asenha_readable ) {
					continue;
				}
				$asenha_val = $wp_object_cache->{$asenha_oc_prop};
				if ( ! is_array( $asenha_val ) ) {
					continue;
				}
				foreach ( $asenha_groups as $asenha_group ) {
					if ( isset( $asenha_val[ $asenha_group ] ) ) {
						unset( $asenha_val[ $asenha_group ] );
					}
				}
				$asenha_writable = method_exists( $wp_object_cache, '__set' );
				if ( ! $asenha_writable ) {
					$asenha_ref = new ReflectionProperty( $wp_object_cache, $asenha_oc_prop );
					$asenha_writable = $asenha_ref->isPublic();
				}
				if ( ! $asenha_writable ) {
					continue;
				}
				$wp_object_cache->{$asenha_oc_prop} = $asenha_val;
			} catch ( Throwable $asenha_e ) {
				// Best-effort only; wp_cache_flush() already ran.
			}
		}
	}
};
$asenha_run_cache_flush();
add_action( 'init', $asenha_run_cache_flush, 0 );
