diff --git a/src/integrations/third-party/wordproof.php b/src/integrations/third-party/wordproof.php index c9d63ba1d4b..2928bd1bdca 100644 --- a/src/integrations/third-party/wordproof.php +++ b/src/integrations/third-party/wordproof.php @@ -89,10 +89,19 @@ public function register_hooks() { */ \add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_assets' ], 10, 0 ); - /** - * Add async to the wordproof scripts. - */ - \add_filter( 'script_loader_tag', [ $this, 'add_async_to_script' ], 10, 3 ); + if ( version_compare( strtok( get_bloginfo( 'version' ), '-' ), '6.3', '>=' ) ) { + \add_action( + 'wp_enqueue_scripts', + function() { + \wp_script_add_data( WPSEO_Admin_Asset_Manager::PREFIX . 'wordproof-uikit', 'strategy', 'async' ); + }, + 11, + 0 + ); + } + else { + \add_filter( 'script_loader_tag', [ $this, 'add_async_to_script' ], 10, 3 ); + } /** * Removes the post meta timestamp key for the old privacy page.