# Developers

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.

ItemValueText 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:

1. If Woo (or another plugin) already excluded the request, this plugin leaves that decision alone.
2. Settings are loaded from the option, then passed through `scsvm_allowlist_settings`.
3. Filter output is **re-sanitised** (non-arrays fall back to defaults) before evaluation.
4. The request is matched against presets, page/post IDs, post types, and taxonomies.
5. The boolean result is passed through `scsvm_is_request_public`.
6. Returning `true` excludes 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_types` and `taxonomy_allowlist` are intersected with registered **public** types/taxonomies.
- `product` and `attachment` are never kept in `post_types`.
- Non-array filter results fall back to defaults.

Return a normal settings array (see [Settings shape](#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:

KeyTypeNotes`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](https://storecrafted.com/document/site-visibility-manager-for-woocommerce/configuration/#public-sections).

## Settings REST

The React settings UI loads and saves via the plugin REST route (cookie auth + `X-WP-Nonce`).

ItemValue**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](https://wordpress.org/plugins/mcp-adapter/). Install MCP Adapter separately if you want MCP clients to call these abilities. Abilities remain gated by `manage_woocommerce`.

ItemValue**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).

AnnotationValue`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**.

AnnotationValue`readonly``false``destructive``false``idempotent``true`

**Input** is a full settings object (see [Settings shape](#settings-shape)).

KeyType`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.

## Next steps

- [Getting started](https://storecrafted.com/document/site-visibility-manager-for-woocommerce/getting-started/)
- [Configuration](https://storecrafted.com/document/site-visibility-manager-for-woocommerce/configuration/)
- [FAQ](https://storecrafted.com/document/site-visibility-manager-for-woocommerce/faq/)
- [Documentation hub](https://storecrafted.com/docs-category/site-visibility-manager-for-woocommerce/)