diff --git a/.monorepo-source.json b/.monorepo-source.json index 705deea..e7c13c8 100644 --- a/.monorepo-source.json +++ b/.monorepo-source.json @@ -1,7 +1,7 @@ { "productId": "funkycommerce-headless", "repository": "coded-letter/superfunky-theme", - "source": "coded-letter/coded-letter-monorepo@d89347ac6f39bab8f73eec682e94460ceb48de93", + "source": "coded-letter/coded-letter-monorepo@3da686f04ce7ac7cc6f946c53d1044c3a2198619", "sourcePath": "workspace/backend/wordpress/themes/free/funkycommerce-headless", "installSlug": "funkycommerce-headless", "kind": "theme", diff --git a/functions.php b/functions.php index 7455a61..7621954 100644 --- a/functions.php +++ b/functions.php @@ -9,7 +9,7 @@ exit; } -define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.35' ); +define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.36' ); /** * Whether Superfunky Pro is active and licensed. diff --git a/inc/artifact-invalidation.php b/inc/artifact-invalidation.php index 79fd912..7d35412 100644 --- a/inc/artifact-invalidation.php +++ b/inc/artifact-invalidation.php @@ -307,7 +307,10 @@ function funkycommerce_collect_control_center_change( $old_value, $new_value ) { 'artifact_cache_ttl', 'artifact_retention_days', 'build_webhook_url', + 'build_provider', 'build_badge_id', + 'build_status_badge_url', + 'build_dashboard_url', 'periodic_rebuild', 'rebuild_interval', ); diff --git a/inc/build-webhooks.php b/inc/build-webhooks.php index 8fe5e1a..b820eb9 100644 --- a/inc/build-webhooks.php +++ b/inc/build-webhooks.php @@ -25,7 +25,10 @@ function funkycommerce_static_generation_config() { return array( 'frontendUrl' => (string) ( $settings['frontend_url'] ?? '' ), + 'buildProvider' => (string) ( $settings['build_provider'] ?? 'netlify' ), 'buildBadgeId' => (string) ( $settings['build_badge_id'] ?? '' ), + 'buildStatusBadgeUrl' => (string) ( $settings['build_status_badge_url'] ?? '' ), + 'buildDashboardUrl' => (string) ( $settings['build_dashboard_url'] ?? '' ), 'sitemapEnabled' => 'no' !== ( $settings['sitemap_enabled'] ?? 'yes' ), 'robotsEnabled' => 'no' !== ( $settings['robots_enabled'] ?? 'yes' ), 'robotsTxt' => (string) ( $settings['robots_txt'] ?? '' ), @@ -137,7 +140,7 @@ function funkycommerce_trigger_storefront_build( $reason = 'scheduled' ) { add_action( FUNKYCOMMERCE_BUILD_EVENT, 'funkycommerce_trigger_storefront_build' ); /** - * Add a manual storefront rebuild action and optional Netlify status badge. + * Add a manual storefront rebuild action and optional deployment status badge. * * @param WP_Admin_Bar $admin_bar Admin toolbar. */ @@ -147,19 +150,27 @@ function funkycommerce_build_admin_bar( $admin_bar ) { } $settings = funkycommerce_control_center_settings(); $webhook_url = trim( (string) ( $settings['build_webhook_url'] ?? '' ) ); + $provider = 'cloudflare-pages' === ( $settings['build_provider'] ?? 'netlify' ) ? 'cloudflare-pages' : 'netlify'; $site_id = trim( (string) ( $settings['build_badge_id'] ?? '' ) ); - if ( '' === $site_id ) { + $badge_url = 'cloudflare-pages' === $provider + ? trim( (string) ( $settings['build_status_badge_url'] ?? '' ) ) + : ( '' !== $site_id ? 'https://api.netlify.com/api/v1/badges/' . rawurlencode( $site_id ) . '/deploy-status' : '' ); + if ( '' === $badge_url ) { return; } + $provider_name = 'cloudflare-pages' === $provider ? __( 'Cloudflare Pages', 'funkycommerce-headless' ) : __( 'Netlify', 'funkycommerce-headless' ); + $dashboard_url = trim( (string) ( $settings['build_dashboard_url'] ?? '' ) ); + if ( '' === $dashboard_url ) { + $dashboard_url = 'cloudflare-pages' === $provider ? 'https://dash.cloudflare.com/' : 'https://app.netlify.com/'; + } $admin_bar->add_node( array( 'id' => 'funkycommerce-storefront-build-status', - 'title' => '' . esc_attr__( 'Netlify deploy status', 'funkycommerce-headless' ) . '', + 'title' => '' . esc_attr( sprintf( __( '%s deploy status', 'funkycommerce-headless' ), $provider_name ) ) . '', 'href' => admin_url( 'themes.php?page=funkycommerce-control-center' ), 'meta' => array( 'class' => 'menupop', - 'html' => true, 'title' => __( 'Open storefront build settings', 'funkycommerce-headless' ), ), ) @@ -184,14 +195,14 @@ function funkycommerce_build_admin_bar( $admin_bar ) { $admin_bar->add_node( array( - 'id' => 'funkycommerce-storefront-netlify-dashboard', + 'id' => 'funkycommerce-storefront-deployment-dashboard', 'parent' => 'funkycommerce-storefront-build-status', - 'title' => __( 'Netlify dashboard', 'funkycommerce-headless' ), - 'href' => 'https://app.netlify.com', + 'title' => sprintf( __( '%s dashboard', 'funkycommerce-headless' ), $provider_name ), + 'href' => $dashboard_url, 'meta' => array( 'target' => '_blank', 'rel' => 'noopener noreferrer', - 'title' => __( 'Open Netlify dashboard', 'funkycommerce-headless' ), + 'title' => sprintf( __( 'Open %s dashboard', 'funkycommerce-headless' ), $provider_name ), ), ) ); @@ -199,27 +210,27 @@ function funkycommerce_build_admin_bar( $admin_bar ) { add_action( 'admin_bar_menu', 'funkycommerce_build_admin_bar', 1000 ); /** - * Match the legacy top-level Netlify badge spacing and keep its status fresh. + * Match the legacy top-level badge spacing and keep its status fresh. */ function funkycommerce_build_admin_bar_assets() { if ( ! is_admin_bar_showing() || ! current_user_can( 'manage_options' ) ) { return; } - ?> - - - array( 'label' => __( 'Artifact signing secret', 'funkycommerce-headless' ), 'type' => 'password', 'tier' => 'free', 'default' => '', 'description' => __( 'At least 32 characters. Stored separately from public storefront settings and never returned by an API.', 'funkycommerce-headless' ) ), 'artifact_cache_ttl' => array( 'label' => __( 'Artifact shared-cache TTL (seconds)', 'funkycommerce-headless' ), 'type' => 'number', 'tier' => 'free', 'default' => '60', 'min' => '0', 'max' => '3600', 'step' => '1' ), 'artifact_retention_days' => array( 'label' => __( 'Artifact retention (days)', 'funkycommerce-headless' ), 'type' => 'number', 'tier' => 'free', 'default' => '30', 'min' => '1', 'max' => '365', 'step' => '1' ), + 'build_provider' => array( 'label' => __( 'Deployment provider', 'funkycommerce-headless' ), 'type' => 'select', 'tier' => 'free', 'default' => 'netlify', 'options' => array( 'netlify' => __( 'Netlify', 'funkycommerce-headless' ), 'cloudflare-pages' => __( 'Cloudflare Pages', 'funkycommerce-headless' ) ) ), 'build_webhook_url' => array( 'label' => __( 'Build webhook URL', 'funkycommerce-headless' ), 'type' => 'url', 'tier' => 'free', 'description' => __( 'Used by the Rebuild storefront action in the top admin bar. Static-first content changes are published only after this hook completes.', 'funkycommerce-headless' ) ), 'periodic_rebuild' => array( 'label' => __( 'Periodic rebuilds', 'funkycommerce-headless' ), 'type' => 'toggle', 'tier' => 'pro', 'default' => 'no', 'description' => __( 'Optional. Leave disabled for explicit, cost-controlled publishing through the admin-bar rebuild action.', 'funkycommerce-headless' ) ), 'rebuild_interval' => array( 'label' => __( 'Rebuild interval (hours)', 'funkycommerce-headless' ), 'type' => 'number', 'tier' => 'pro', 'default' => '12', 'min' => '1', 'max' => '168', 'step' => '1' ), - 'build_badge_id' => array( 'label' => __( 'Build status badge ID', 'funkycommerce-headless' ), 'type' => 'text', 'tier' => 'free', 'description' => __( 'For Netlify, enter the site ID to show its deploy status below Rebuild storefront in the admin bar.', 'funkycommerce-headless' ) ), + 'build_badge_id' => array( 'label' => __( 'Netlify status badge site ID', 'funkycommerce-headless' ), 'type' => 'text', 'tier' => 'free', 'description' => __( 'Existing Netlify sites can keep using their site ID. Cloudflare Pages uses the status badge URL below instead.', 'funkycommerce-headless' ) ), + 'build_status_badge_url' => array( 'label' => __( 'Cloudflare Pages status badge URL', 'funkycommerce-headless' ), 'type' => 'url', 'tier' => 'free', 'default' => '', 'description' => __( 'Optional SVG badge URL for the Cloudflare Pages project. It appears in the top admin bar and refreshes every minute.', 'funkycommerce-headless' ) ), + 'build_dashboard_url' => array( 'label' => __( 'Deployment dashboard URL', 'funkycommerce-headless' ), 'type' => 'url', 'tier' => 'free', 'default' => '', 'description' => __( 'Optional direct project dashboard URL. Netlify and Cloudflare Pages fall back to their provider dashboards.', 'funkycommerce-headless' ) ), 'backend_preview_enabled' => array( 'label' => __( 'Mirrored native previews', 'funkycommerce-headless' ), 'type' => 'toggle', 'tier' => 'free', 'default' => 'yes', 'description' => __( 'When an editor uses WordPress\' native Preview, style it with the current layout settings and show the real header/footer menus. Preview access itself always requires sign-in and edit permission, whether this is on or off.', 'funkycommerce-headless' ) ), 'backend_redirect_enabled' => array( 'label' => __( 'Redirect public backend requests to the frontend', 'funkycommerce-headless' ), 'type' => 'toggle', 'tier' => 'free', 'default' => 'no', 'description' => __( 'Sends ordinary (non-preview) visitors of this WordPress backend to their equivalent Frontend URL page. Admin, login, REST, GraphQL, cron, feeds, and native previews are never redirected.', 'funkycommerce-headless' ) ), ), diff --git a/inc/control-center.php b/inc/control-center.php index 9e51929..8d51f57 100644 --- a/inc/control-center.php +++ b/inc/control-center.php @@ -1418,8 +1418,8 @@ function funkycommerce_render_control_center() {
-
+
@@ -1447,12 +1447,20 @@ function funkycommerce_render_control_center() {
  • -
    STOREFRONT_ARTIFACT_MODE=artifact
    -STOREFRONT_ARTIFACT_DELIVERY=static-first
    -STOREFRONT_ARTIFACT_ORIGIN=
    -STOREFRONT_ARTIFACT_SITE_KEY=
    -STOREFRONT_ARTIFACT_SIGNING_SECRET=<same-secret-as-wordpress>
    -VITE_ARTIFACT_ROUTE_HYDRATION=true
    + ', + 'VITE_ARTIFACT_ROUTE_HYDRATION=true', + ) + ); + ?> +

    diff --git a/package-lock.json b/package-lock.json index a22607e..1192a3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "funkycommerce-headless-theme", - "version": "1.2.35", + "version": "1.2.36", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "funkycommerce-headless-theme", - "version": "1.2.35", + "version": "1.2.36", "devDependencies": { "autoprefixer": "^10.4.20", "esbuild": "^0.28.2", diff --git a/package.json b/package.json index 03955a0..852db13 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "funkycommerce-headless-theme", "private": true, - "version": "1.2.35", + "version": "1.2.36", "description": "Tailwind/build tooling for the FunkyCommerce Headless WordPress theme's native frontend assets (block templates, template parts, loader, and Spotify slot).", "scripts": { "build:css": "tailwindcss -i ./assets/css/theme-source.css -o ./assets/dist/theme.css --minify", diff --git a/readme.txt b/readme.txt index a467def..7b2f2e6 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: headless, woocommerce, wpgraphql, full-site-editing Requires at least: 6.7 Tested up to: 6.8 Requires PHP: 7.4 -Stable tag: 1.2.35 +Stable tag: 1.2.36 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -15,6 +15,11 @@ Control Center, the theme also ships a complete native WordPress rendering path "Native frontend theme" below) with accessible header/footer/navigation templates and core front/home/singular/archive/search/404 routes styled to match the storefront. +== 1.2.36 highlights == + +* Removes the stray admin-bar badge metadata output and adds Cloudflare Pages deployment controls. +* Places Superfunky Pro before submission inboxes and preserves environment-example line breaks. + == 1.2.35 highlights == * Adds a Studio product layout with top-section cross-sells and a full-width long description. diff --git a/style.css b/style.css index 36cdee1..5acc4ed 100644 --- a/style.css +++ b/style.css @@ -7,7 +7,7 @@ Description: A minimal, content-first block theme for polished WordPress preview Requires at least: 6.7 Tested up to: 6.8 Requires PHP: 7.4 -Version: 1.2.35 +Version: 1.2.36 Update URI: https://github.com/coded-letter/superfunky-theme License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html