Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .monorepo-source.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions inc/artifact-invalidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
Expand Down
49 changes: 30 additions & 19 deletions inc/build-webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? '' ),
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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' => '<img id="netlify-admin-badge" src="' . esc_url( 'https://api.netlify.com/api/v1/badges/' . rawurlencode( $site_id ) . '/deploy-status' ) . '" alt="' . esc_attr__( 'Netlify deploy status', 'funkycommerce-headless' ) . '" style="height:20px;vertical-align:middle;cursor:pointer">',
'title' => '<img id="funkycommerce-build-status-badge" src="' . esc_url( $badge_url ) . '" alt="' . esc_attr( sprintf( __( '%s deploy status', 'funkycommerce-headless' ), $provider_name ) ) . '" style="height:20px;vertical-align:middle;cursor:pointer">',
'href' => admin_url( 'themes.php?page=funkycommerce-control-center' ),
'meta' => array(
'class' => 'menupop',
'html' => true,
'title' => __( 'Open storefront build settings', 'funkycommerce-headless' ),
),
)
Expand All @@ -184,42 +195,42 @@ 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 ),
),
)
);
}
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;
}
?>
<style>#netlify-admin-badge{padding:0 8px}</style>
<script>
window.addEventListener("DOMContentLoaded", function () {
var badge = document.getElementById("netlify-admin-badge");
wp_enqueue_script( 'jquery' );
wp_add_inline_style( 'admin-bar', '#funkycommerce-build-status-badge{padding:0 8px}' );
wp_add_inline_script(
'jquery',
'window.addEventListener("DOMContentLoaded", function () {
var badge = document.getElementById("funkycommerce-build-status-badge");
if (!badge) return;
window.setInterval(function () {
badge.src = badge.src.split("?")[0] + "?t=" + Date.now();
}, 60000);
});
</script>
<?php
});'
);
}
add_action( 'admin_footer', 'funkycommerce_build_admin_bar_assets' );
add_action( 'wp_footer', 'funkycommerce_build_admin_bar_assets' );
add_action( 'admin_enqueue_scripts', 'funkycommerce_build_admin_bar_assets' );
add_action( 'wp_enqueue_scripts', 'funkycommerce_build_admin_bar_assets' );

/**
* Handle the explicit administrator rebuild request.
Expand Down
5 changes: 4 additions & 1 deletion inc/control-center-schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,13 @@ function funkycommerce_control_center_sections() {
'artifact_signing_secret' => 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' ) ),
),
Expand Down
22 changes: 15 additions & 7 deletions inc/control-center.php
Original file line number Diff line number Diff line change
Expand Up @@ -1418,8 +1418,8 @@ function funkycommerce_render_control_center() {
<div><strong><?php esc_html_e( 'WPGraphQL SEO', 'funkycommerce-headless' ); ?></strong><span class="<?php echo esc_attr( defined( 'WPGRAPHQL_YOAST_SEO_VERSION' ) ? 'fc-active' : 'fc-inactive' ); ?>"><?php echo esc_html( defined( 'WPGRAPHQL_YOAST_SEO_VERSION' ) ? __( 'Connected', 'funkycommerce-headless' ) : __( 'Required for SEO integration', 'funkycommerce-headless' ) ); ?></span></div>
<div><strong><?php esc_html_e( 'WooCommerce Stripe Gateway', 'funkycommerce-headless' ); ?></strong><span class="<?php echo esc_attr( class_exists( 'WC_Stripe' ) ? 'fc-active' : 'fc-inactive' ); ?>"><?php echo esc_html( class_exists( 'WC_Stripe' ) ? __( 'Connected', 'funkycommerce-headless' ) : __( 'Required for Stripe payments', 'funkycommerce-headless' ) ); ?></span></div>
<div><strong><?php esc_html_e( 'Runtime coverage', 'funkycommerce-headless' ); ?></strong><span class="fc-active"><?php echo esc_html( $coverage['live'] ); ?> <?php esc_html_e( 'live', 'funkycommerce-headless' ); ?></span></div>
<div><strong><?php esc_html_e( 'Newsletter inbox', 'funkycommerce-headless' ); ?></strong><a href="<?php echo esc_url( add_query_arg( 'page', 'funkycommerce-newsletter-submissions', admin_url( 'admin.php' ) ) ); ?>"><?php echo esc_html( $newsletter_count ); ?> <?php esc_html_e( 'unread', 'funkycommerce-headless' ); ?></a></div>
<div><strong><?php esc_html_e( 'Superfunky Pro', 'funkycommerce-headless' ); ?></strong><?php if ( $superfunky_pro_active ) : ?><span class="fc-active"><?php esc_html_e( 'Connected', 'funkycommerce-headless' ); ?></span><?php else : ?><a class="fc-inactive" href="https://codedletter.com/products/theme-pro/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Get Pro', 'funkycommerce-headless' ); ?></a><?php endif; ?></div>
<div><strong><?php esc_html_e( 'Newsletter inbox', 'funkycommerce-headless' ); ?></strong><a href="<?php echo esc_url( add_query_arg( 'page', 'funkycommerce-newsletter-submissions', admin_url( 'admin.php' ) ) ); ?>"><?php echo esc_html( $newsletter_count ); ?> <?php esc_html_e( 'unread', 'funkycommerce-headless' ); ?></a></div>
<div><strong><?php esc_html_e( 'Form inbox', 'funkycommerce-headless' ); ?></strong><a href="<?php echo esc_url( add_query_arg( 'page', 'funkycommerce-form-submissions', admin_url( 'admin.php' ) ) ); ?>"><?php echo esc_html( $form_count ); ?> <?php esc_html_e( 'unread', 'funkycommerce-headless' ); ?></a></div>
</div>

Expand Down Expand Up @@ -1447,12 +1447,20 @@ function funkycommerce_render_control_center() {
<li><?php esc_html_e( 'Set Dynamic content delivery to Serve generated artifacts and configure the storefront variables shown below.', 'funkycommerce-headless' ); ?></li>
<li><?php esc_html_e( 'Configure a build webhook. After editing content, use Rebuild storefront in the top admin bar and wait for the deployment badge to succeed.', 'funkycommerce-headless' ); ?></li>
</ol>
<pre><code>STOREFRONT_ARTIFACT_MODE=artifact
STOREFRONT_ARTIFACT_DELIVERY=static-first
STOREFRONT_ARTIFACT_ORIGIN=<?php echo esc_html( untrailingslashit( home_url( '/' ) ) ); ?>
STOREFRONT_ARTIFACT_SITE_KEY=<?php echo esc_html( $settings['artifact_site_key'] ?: 'unique-site-key' ); ?>
STOREFRONT_ARTIFACT_SIGNING_SECRET=&lt;same-secret-as-wordpress&gt;
VITE_ARTIFACT_ROUTE_HYDRATION=true</code></pre>
<?php
$environment_example = implode(
"\n",
array(
'STOREFRONT_ARTIFACT_MODE=artifact',
'STOREFRONT_ARTIFACT_DELIVERY=static-first',
'STOREFRONT_ARTIFACT_ORIGIN=' . untrailingslashit( home_url( '/' ) ),
'STOREFRONT_ARTIFACT_SITE_KEY=' . ( $settings['artifact_site_key'] ?: 'unique-site-key' ),
'STOREFRONT_ARTIFACT_SIGNING_SECRET=<same-secret-as-wordpress>',
'VITE_ARTIFACT_ROUTE_HYDRATION=true',
)
);
?>
<pre><code><?php echo esc_html( $environment_example ); ?></code></pre>
<p><strong><?php esc_html_e( 'Freshness:', 'funkycommerce-headless' ); ?></strong> <?php esc_html_e( 'WordPress collects changes and regenerates artifacts automatically, but static-first public HTML changes only after a storefront build. Until then, visitors keep the previous known-good deployment.', 'funkycommerce-headless' ); ?></p>
<p><strong><?php esc_html_e( 'Rollback:', 'funkycommerce-headless' ); ?></strong> <?php esc_html_e( 'Restore the previous static deployment or set STOREFRONT_ARTIFACT_DELIVERY=proxy and rebuild. Never reuse one artifact site key across public sites.', 'funkycommerce-headless' ); ?></p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading