404 ) ); } public static function copy_protection() { if ( is_user_logged_in() ) { return; } wp_register_style( 'svabg-copy', false, array(), SOFTVOLT_AI_BODYGUARD_VERSION ); wp_enqueue_style( 'svabg-copy' ); wp_add_inline_style( 'svabg-copy', 'body{-webkit-user-select:none;user-select:none}input,textarea,[contenteditable]{-webkit-user-select:text;user-select:text}' ); wp_register_script( 'svabg-copy', false, array(), SOFTVOLT_AI_BODYGUARD_VERSION, true ); wp_enqueue_script( 'svabg-copy' ); wp_add_inline_script( 'svabg-copy', "(function(){function f(e){var t=e.target;if(t&&t.closest&&t.closest('input,textarea,[contenteditable]')){return;}e.preventDefault();}['contextmenu','copy','cut','dragstart','selectstart'].forEach(function(n){document.addEventListener(n,f);});})();" ); } /** * Visitors get a short "back soon" page with 503 and Retry-After; administrators and editors see the site. */ public static function maintenance() { if ( current_user_can( 'edit_posts' ) || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || wp_doing_ajax() || wp_doing_cron() ) { return; } // One maintenance page: the one designed in Tools › Maintenance, with its own exceptions. if ( class_exists( 'Softvolt_Ai_Bodyguard_Maintenance' ) ) { if ( is_robots() || is_favicon() || Softvolt_Ai_Bodyguard_Maintenance::lets_through() ) { return; } Softvolt_Ai_Bodyguard_Maintenance::render( array_merge( Softvolt_Ai_Bodyguard_Maintenance::get(), array( 'mode' => 'maintenance' ) ) ); exit; } status_header( 503 ); nocache_headers(); header( 'Retry-After: 3600' ); header( 'Content-Type: text/html; charset=utf-8' ); $site = esc_html( wp_specialchars_decode( (string) get_option( 'blogname' ), ENT_QUOTES ) ); echo '
' . esc_html__( 'The site is being updated. Please check back in a little while.', 'ai-guardwall' ) . '