From 25dc34390de39188c94fe24dd1692568a8c77489 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Apr 2026 21:12:22 +0000 Subject: [PATCH 1/2] Initial plan From e4915ad9eb3ced3af876e3fa2f11e8a8c12aee1e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Apr 2026 21:14:00 +0000 Subject: [PATCH 2/2] Fix warning on missing runtime.asset.php in production builds Agent-Logs-Url: https://github.com/humanmade/authorship/sessions/ed6902dd-413f-4287-942b-aa5ed41c78af Co-authored-by: kadamwhite <442115+kadamwhite@users.noreply.github.com> --- inc/namespace.php | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/inc/namespace.php b/inc/namespace.php index 9e16f68..d72a7a6 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -509,18 +509,23 @@ function enqueue_assets_for_post(): void { } // Hot-reloading support. - $runtime_asset = include plugin_dir_path( __DIR__ ) . 'build/runtime.asset.php'; - if ( ! empty( $runtime_asset ) && in_array( 'wp-react-refresh-runtime', $editor_asset['dependencies'] ?? [], true ) ) { - wp_register_script( - 'authorship-hmr-runtime', - plugins_url( 'build/runtime.js', __DIR__ ), - $runtime_asset['dependencies'], - $runtime_asset['version'], - [ - 'in_footer' => true, - ] - ); - $editor_asset['dependencies'][] = 'authorship-hmr-runtime'; + if ( in_array( 'wp-react-refresh-runtime', $editor_asset['dependencies'] ?? [], true ) ) { + $runtime_asset_file = plugin_dir_path( __DIR__ ) . 'build/runtime.asset.php'; + if ( is_readable( $runtime_asset_file ) ) { + $runtime_asset = include $runtime_asset_file; + if ( ! empty( $runtime_asset ) ) { + wp_register_script( + 'authorship-hmr-runtime', + plugins_url( 'build/runtime.js', __DIR__ ), + $runtime_asset['dependencies'], + $runtime_asset['version'], + [ + 'in_footer' => true, + ] + ); + $editor_asset['dependencies'][] = 'authorship-hmr-runtime'; + } + } } wp_enqueue_script(