Files
acrib.es/wp-content/plugins/wp-super-cache/rest/class.wp-super-cache-rest-preload.php
Malin 6daabcab65 feat: caching, optimization, legal pages & footer
- WP Super Cache enabled (PHP mode, gzip, Nginx compatible)
- Autoptimize: CSS/HTML minification + deferred JS + Google Fonts optimization
- Cookie Notice: GDPR/LOPD banner styled with brand colors (navy/burgundy/gold)
- Legal pages: Aviso Legal, Política de Privacidad, Política de Cookies (ES)
- MU-plugin: custom footer with legal links + Cloud Host credit
- Footer: copyright, legal nav, Hosted & Maintained by Cloud Host (cloudhost.es)
- Security: X-Frame-Options, X-Content-Type, Referrer-Policy headers
- Security: XML-RPC disabled, REST user enumeration blocked
- Performance: emoji scripts removed, post revisions limited to 3
2026-05-19 19:58:11 +02:00

32 lines
947 B
PHP

<?php
class WP_Super_Cache_Rest_Preload extends WP_REST_Controller {
/**
* Update the cache settings.
*
* @param WP_REST_Request $request Full data about the request.
* @return WP_Error|WP_REST_Response
*/
public function callback( $request ) {
$parameters = $request->get_json_params();
if ( defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
wp_cache_debug( 'WP_Super_Cache_Rest_Preload: preload disabled by admin' );
return rest_ensure_response( array( 'error' => 'preload disabled by admin' ) );
}
if ( isset( $parameters[ 'enable' ] ) ) {
if ( $parameters[ 'enable' ] == true ) {
wp_cache_debug( 'WP_Super_Cache_Rest_Preload: enable' );
wpsc_enable_preload();
return( rest_ensure_response( array( 'enabled' => true ) ) );
} else {
wp_cache_debug( 'WP_Super_Cache_Rest_Preload: cancel' );
wpsc_cancel_preload();
return( rest_ensure_response( array( 'enabled' => false ) ) );
}
}
}
}