This page covers how StoreCrafted Site Visibility Manager for WooCommerce decides whether a front-end request is public while WooCommerce Coming Soon would otherwise show the Coming Soon template.
It hooks woocommerce_coming_soon_exclude only. It does not alter REST or Store API visibility.
| Item | Value |
|---|---|
| Text domain | storecrafted-site-visibility-manager |
| Option key | storecrafted_site_visibility_manager_settings |
| PHP namespace | StoreCraftedSiteVisibilityManager |
| Settings REST | storecrafted-site-visibility-manager/v1 |
Evaluation order
When Woo would show Coming Soon for the current request:
- If Woo (or another plugin) already excluded the request, this plugin leaves that decision alone.
- Settings are loaded from the option, then passed through
scsvm_allowlist_settings. - Filter output is re-sanitised (non-arrays fall back to defaults) before evaluation.
- The request is matched against presets, page/post IDs, post types, and taxonomies.
- The boolean result is passed through
scsvm_is_request_public. - Returning
trueexcludes the request from Coming Soon (the page renders normally).
WooCommerce’s own admin and private-link bypasses run outside this plugin and still apply.
`scsvm_allowlist_settings`
Filter the resolved settings array before evaluation.
declare(strict_types=1);
add_filter( 'scsvm_allowlist_settings', function ( array $settings ): array {
$settings['presets'][] = 'homepage';
return $settings;
} );
Important: After this filter runs, the plugin runs AllowlistSettings::sanitize() again. Companion code cannot widen the allowlist with unexpected shapes:
- Unknown preset slugs are dropped.
- Page/post IDs must be positive integers.
post_typesandtaxonomy_allowlistare intersected with registered public types/taxonomies.productandattachmentare never kept inpost_types.- Non-array filter results fall back to defaults.
Return a normal settings array (see Settings shape). Prefer known preset slugs and real public type/taxonomy names.
`scsvm_is_request_public`
Override the boolean public decision for the current request.
declare(strict_types=1);
add_filter( 'scsvm_is_request_public', function ( bool $is_public, array $settings ): bool {
if ( is_page( 'press' ) ) {
return true;
}
return $is_public;
}, 10, 2 );
Returning true excludes the request from Coming Soon. Returning false leaves Woo’s Coming Soon behaviour in place for that request (subject to Woo’s own bypasses).
Settings shape
Sanitised settings always include:
| Key | Type | Notes |
|---|---|---|
presets | string[] | Known slugs only: homepage, blog_index, blog_posts, blog_taxonomies, shop, products, product_taxonomies, cart, checkout, account |
page_ids | int[] | Exact published page IDs |
post_ids | int[] | Exact published post IDs |
post_types | string[] | Registered public post types; never product or attachment |
taxonomy_allowlist | string[] | Registered public taxonomies |
delete_data_on_uninstall | bool | Default false |
Merchant-facing labels for presets are listed under Configuration: Public sections.
Settings REST
The React settings UI loads and saves via the plugin REST route (cookie auth + X-WP-Nonce).
| Item | Value |
|---|---|
| Namespace | storecrafted-site-visibility-manager/v1 |
| Route | GET / POST /wp-json/storecrafted-site-visibility-manager/v1/settings |
| Capability | manage_woocommerce |
POST bodies are sanitised with the same rules as the option. Invalid (non-array) bodies return scsvm_invalid_settings (HTTP 400).
Permissions: Only users who can manage WooCommerce can read or update settings through this route.
Full-body replace on POST: omitted keys sanitise to empty arrays / false. Send a complete settings object, not a partial patch.
Abilities API
WordPress Abilities (WP 7.0+) expose the same allowlist surface to agents and other clients. Registration lives in StoreCraftedSiteVisibilityManagerAbilitiesRegistrar.
This plugin does not require MCP Adapter. Install MCP Adapter separately if you want MCP clients to call these abilities. Abilities remain gated by manage_woocommerce.
| Item | Value |
|---|---|
| Category ID | storecrafted-site-visibility-manager |
| Capability | manage_woocommerce (same gate as settings REST) |
| REST exposure | meta.show_in_rest: true → visible under wp-abilities/v1 |
| MCP public | meta.mcp.public: true → eligible for the default MCP Adapter server when that plugin is installed |
`storecrafted-site-visibility-manager/get-allowlist-status`
Read-only. Returns the same payload shape as GET …/settings (settings, Coming Soon status, links, selected titles, catalogs, presets).
| Annotation | Value |
|---|---|
readonly | true |
destructive | false |
idempotent | true |
No input. Execute delegates to SettingsController::get_settings().
`storecrafted-site-visibility-manager/update-allowlist-settings`
Write. Persists through SettingsController::normalize_update_body → AllowlistSettings::sanitize → option storecrafted_site_visibility_manager_settings — the same path as the React settings Save.
| Annotation | Value |
|---|---|
readonly | false |
destructive | false |
idempotent | true |
Input is a full settings object (see Settings shape).
| Key | Type |
|---|---|
presets | string[] |
page_ids | int[] |
post_ids | int[] |
post_types | string[] |
taxonomy_allowlist | string[] |
delete_data_on_uninstall | bool |
Full-body replace: omitted keys sanitise to empty arrays / false. Non-array input returns WP_Error code scsvm_invalid_settings.
Output matches the get-allowlist-status payload after save.