should_delay( $handle ) ) { return $tag; } // Move src out of the way and mark the tag as delayed. $tag = preg_replace( '/\ssrc=/', ' data-ablocks-src=', $tag, 1 ); $tag = preg_replace( '/^handles(), true ) ) { return true; } return (bool) preg_match( '/^ablocks-.+-block-static-script$/', (string) $handle ); } /** * Print the tiny vanilla loader that activates delayed scripts on interaction. */ public function print_loader() { $timeout = (int) Helper::get_settings( 'perf_delay_js_timeout', 5000 ); $timeout = max( 0, $timeout ); ?>