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
This commit is contained in:
71
wp-content/plugins/cookie-notice/js/admin-plugins.js
Normal file
71
wp-content/plugins/cookie-notice/js/admin-plugins.js
Normal file
@@ -0,0 +1,71 @@
|
||||
( function( $ ) {
|
||||
|
||||
// ready event
|
||||
$( function() {
|
||||
// cancel deactivation
|
||||
$( document ).on( 'click', '.cn-deactivate-plugin-cancel', function( e ) {
|
||||
tb_remove();
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
// simple deactivation
|
||||
$( document ).on( 'click', '.cn-deactivate-plugin-simple', function( e ) {
|
||||
// display spinner
|
||||
$( '#cn-deactivation-footer .spinner' ).addClass( 'is-active' );
|
||||
} );
|
||||
|
||||
// deactivation with sending data
|
||||
$( document ).on( 'click', '.cn-deactivate-plugin-data', function( e ) {
|
||||
var spinner = $( '#cn-deactivation-footer .spinner' );
|
||||
var url = $( this ).attr( 'href' );
|
||||
|
||||
// display spinner
|
||||
spinner.addClass( 'is-active' );
|
||||
|
||||
// submit data
|
||||
$.post( ajaxurl, {
|
||||
action: 'cn-deactivate-plugin',
|
||||
option_id: $( 'input[name="cn_deactivation_option"]:checked' ).val(),
|
||||
other: $( 'textarea[name="cn_deactivation_other"]' ).val(),
|
||||
nonce: cnArgsPlugins.nonce
|
||||
} ).done( function( response ) {
|
||||
// deactivate plugin
|
||||
window.location.href = url;
|
||||
} ).fail( function() {
|
||||
// deactivate plugin
|
||||
window.location.href = url;
|
||||
} );
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
// click on deactivation link
|
||||
$( document ).on( 'click', '.cn-deactivate-plugin-modal', function( e ) {
|
||||
tb_show( cnArgsPlugins.deactivate, '#TB_inline?inlineId=cn-deactivation-modal&modal=false' );
|
||||
|
||||
setTimeout( function() {
|
||||
var modalBox = $( '#cn-deactivation-container' ).closest( '#TB_window' );
|
||||
|
||||
if ( modalBox.length > 0 ) {
|
||||
$( modalBox ).addClass( 'cn-deactivation-modal' );
|
||||
|
||||
}
|
||||
}, 0 );
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
// change radio
|
||||
$( document ).on( 'change', 'input[name="cn_deactivation_option"]', function( e ) {
|
||||
var last = $( 'input[name="cn_deactivation_option"]' ).last().get( 0 );
|
||||
|
||||
// last element?
|
||||
if ( $( this ).get( 0 ) === last )
|
||||
$( '.cn-deactivation-textarea textarea' ).prop( 'disabled', false );
|
||||
else
|
||||
$( '.cn-deactivation-textarea textarea' ).prop( 'disabled', true );
|
||||
} );
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
Reference in New Issue
Block a user