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
4 changes: 1 addition & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ agents (Claude, Cursor, Windsurf) point here. Read it before making changes.
An agentic WordPress starter: Bootstrap 5 + Gutenberg + an auto-registering ACF block factory.
Content is driven by ACF blocks and native Gutenberg patterns — not page templates.

**Hard dependency:** ACF Pro 6.0+. No fallback. `inc/dependencies.php` is the single source of
truth (`brmbh_has_acf_pro()`); it surfaces admin notices and aborts `wp brmbh` commands when
ACF Pro is missing.
**Hard dependency:** SCF 6.0+ (Secure Custom Fields — free, wordpress.org/plugins/secure-custom-fields). ACF Pro also works — both define `ACF_PRO=true`. No fallback. `inc/dependencies.php` is the single source of truth (`brmbh_has_acf_pro()`); it surfaces admin notices and aborts `wp brmbh` commands when SCF is missing.

## Skills — everything an agent can do here

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ Pro, vanilla WordPress, and a set of conventions that automate the repetitive pa
| Deploy + DB-sync tooling included | ✅ | — | — | — |
| Templating | vanilla PHP | vanilla PHP | vanilla PHP | Blade |
| Build toolchain | npm + Webpack + Sass | none | Gulp/npm | Bud + Composer |
| Requires ACF Pro | **yes** | no | no | no |
| Requires SCF | **yes (free)** | no | no | no |

**Use it when** you build content-driven WordPress sites with ACF blocks and want a coding
agent to do the repetitive block/scaffold/deploy work against a Bootstrap design system.
**Skip it when** you want a block-theme/FSE (`theme.json`-only) setup, a Tailwind/Blade stack,
or a theme with no ACF Pro dependency.
or a theme with no ACF dependency.

---

Expand Down Expand Up @@ -127,7 +127,7 @@ cd wp-content/themes/brmbh-agentic-wp-suite
npm install
npm run build # or: npm run watch (live rebuild)

# 3. Activate the theme in wp-admin (ACF Pro must be active).
# 3. Activate the theme in wp-admin (SCF must be active).
# It scaffolds starter pages + menus once on activation.

# 4. Re-run the scaffold any time — it's idempotent
Expand Down Expand Up @@ -175,7 +175,7 @@ codebase.

## Tech stack

WordPress 6.4+ · PHP 8.0+ · ACF Pro 6.0+ · Bootstrap 5.3 · GSAP · Webpack · Dart Sass ·
WordPress 6.4+ · PHP 8.0+ · SCF 6.0+ (free) · Bootstrap 5.3 · GSAP · Webpack · Dart Sass ·
Node 18+ · WP-CLI (`wp brmbh` namespace) · Inter / InterDisplay variable fonts ·
GPL-2.0-or-later.

Expand Down
34 changes: 19 additions & 15 deletions inc/dependencies.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php
/**
* Hard dependency check — Advanced Custom Fields PRO is MANDATORY.
* Hard dependency check — Secure Custom Fields (SCF) is MANDATORY.
*
* This theme is built around the ACF block factory. Without ACF Pro, the entire
* block layer fails to register, the scaffold can't be inserted, and the site
* renders empty. There is no "graceful degradation" path — if ACF Pro is not
* active, we surface that loudly everywhere the user might look.
* SCF is a free WordPress.org plugin (wordpress.org/plugins/secure-custom-fields).
* ACF Pro also works — both define ACF_PRO=true and share the identical API.
*
* This theme is built around the ACF block factory. Without SCF (or ACF Pro), the
* entire block layer fails to register, the scaffold can't be inserted, and the site
* renders empty. There is no "graceful degradation" path — if SCF is not active, we
* surface that loudly everywhere the user might look.
*
* Surfaces:
* 1. Admin notice (sticky, error-level, every wp-admin page)
Expand All @@ -23,17 +26,18 @@
}

/**
* Required ACF Pro minimum version.
* Required SCF/ACF minimum version.
*/
const BRMBH_REQUIRED_ACF_VERSION = '6.0.0';

/**
* Single source of truth: is ACF Pro present and meeting version requirement?
* Single source of truth: is SCF (or ACF Pro) present and meeting version requirement?
* Both plugins define ACF_PRO=true — this check works for either.
*
* @return bool
*/
function brmbh_has_acf_pro(): bool {
// ACF Pro defines this constant; free ACF does not.
// Both SCF and ACF Pro define this constant; free ACF does not.
if ( ! defined( 'ACF_PRO' ) || ! ACF_PRO ) {
return false;
}
Expand All @@ -50,21 +54,21 @@ function brmbh_has_acf_pro(): bool {
function brmbh_acf_dependency_message(): string {
if ( ! defined( 'ACF_PRO' ) ) {
return sprintf(
/* translators: %s: required ACF Pro version */
__( '<strong>brmbh-agentic-wp-suite</strong> requires <strong>Advanced Custom Fields PRO %s or higher</strong>. ACF Pro is not installed or not active. Get it at <a href="https://www.advancedcustomfields.com/pro/" target="_blank" rel="noopener">advancedcustomfields.com/pro</a>.', 'brmbh-agentic-wp-suite' ),
/* translators: %s: required SCF version */
__( '<strong>brmbh-agentic-wp-suite</strong> requires <strong>Secure Custom Fields (SCF) %s or higher</strong>. SCF is not installed or not active. Install it free at <a href="https://wordpress.org/plugins/secure-custom-fields/" target="_blank" rel="noopener">wordpress.org/plugins/secure-custom-fields</a>. ACF Pro also works.', 'brmbh-agentic-wp-suite' ),
BRMBH_REQUIRED_ACF_VERSION
);
}
if ( function_exists( 'acf_get_setting' ) ) {
$version = acf_get_setting( 'version' );
return sprintf(
/* translators: 1: installed ACF version, 2: required ACF Pro version */
__( '<strong>brmbh-agentic-wp-suite</strong> requires Advanced Custom Fields PRO <strong>%2$s</strong> or higher. Installed version: <strong>%1$s</strong>. Please update ACF Pro.', 'brmbh-agentic-wp-suite' ),
/* translators: 1: installed SCF/ACF version, 2: required version */
__( '<strong>brmbh-agentic-wp-suite</strong> requires Secure Custom Fields (SCF) <strong>%2$s</strong> or higher. Installed version: <strong>%1$s</strong>. Please update SCF.', 'brmbh-agentic-wp-suite' ),
esc_html( $version ),
BRMBH_REQUIRED_ACF_VERSION
);
}
return __( '<strong>brmbh-agentic-wp-suite</strong> requires Advanced Custom Fields PRO. ACF Pro is installed but not loaded — check the plugin is active.', 'brmbh-agentic-wp-suite' );
return __( '<strong>brmbh-agentic-wp-suite</strong> requires Secure Custom Fields (SCF). SCF is installed but not loaded — check the plugin is active.', 'brmbh-agentic-wp-suite' );
}

/**
Expand Down Expand Up @@ -100,7 +104,7 @@ function brmbh_acf_dependency_post_activate_notice(): void {
}
delete_transient( 'brmbh_acf_missing_on_activate' );
echo '<div class="notice notice-error is-dismissible">';
echo '<p><strong>⚠️ ' . esc_html__( 'Theme activated, but ACF Pro is missing.', 'brmbh-agentic-wp-suite' ) . '</strong></p>';
echo '<p><strong>⚠️ ' . esc_html__( 'Theme activated, but Secure Custom Fields (SCF) is missing.', 'brmbh-agentic-wp-suite' ) . '</strong></p>';
echo '<p>' . wp_kses_post( brmbh_acf_dependency_message() ) . '</p>';
echo '</div>';
}
Expand All @@ -109,7 +113,7 @@ function brmbh_acf_dependency_post_activate_notice(): void {
/**
* Surface 3 — Hard error in WP-CLI.
*
* Any `wp brmbh` subcommand aborts with a clear message if ACF Pro is missing.
* Any `wp brmbh` subcommand aborts with a clear message if SCF/ACF is missing.
* Called by inc/cli.php at the top of each subcommand.
*/
function brmbh_acf_dependency_cli_guard(): void {
Expand Down