=== ShopCurator ===
Contributors: mszaman
Tags: woocommerce, mega menu, quick view, product swatches, sms
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Storefront blocks, a usable My Account area, stock-aware size filtering and phone-number sign-in for WooCommerce block themes.

== Description ==

A WooCommerce shop on a block theme is missing four things that neither WordPress nor WooCommerce ships. ShopCurator adds all four, in one free plugin, with no companion theme and no build step.

= 1. Storefront blocks that sell =

22 blocks, each rendered in PHP, so updating the plugin never breaks a saved page:

* **Mega menu** inside the core Navigation block, opened by pointer, keyboard or touch.
* **Search overlay** with live product suggestions, recent and trending searches.
* **Quick view** and **card actions** on product cards: see a product, pick a size and add it to the cart without leaving the list.
* **Product swatches**, a percentage **discount badge** and a **sold count**.
* **Review summary** with a five-bar breakdown, and store-wide **customer reviews** as a grid or a scrolling band.
* **Size chart** in a dialog beside the size choices.
* **Slider**, **collection tabs**, **testimonials**, **announcement bar**, **collection rail**, **contact form**, **newsletter**, **Instagram strip** and a click-to-load **map**.

Starter block patterns compose these into ready sections — a homepage, a product page, a contact block, a header strip — so you insert a whole section, not one block at a time.

= 2. A My Account area a customer can use =

Order cards with a three-step timeline, order detail, cancellation while an order is still being prepared, Order Again, addresses, and a code-verified phone change. The signed-in screens are replaced by hook, with no template fork. The sign-in, registration and password reset screens are WooCommerce's own templates, redesigned, and a theme's override still wins.

= 3. Stock that tells the truth =

The size filter counts only the sizes in stock, sold-out sizes show as unavailable on the product page, and sold-out products carry a badge.

= 4. Phone-first sign-in, with real verification =

Customers sign in and register with a mobile number. Optional SMS one-time codes confirm a new account, reset a password, confirm a cash-on-delivery order from a number the shop has not seen before, and confirm a phone change. In cash-on-delivery markets a fake order costs the shop the courier fee both ways; holding it for a code stops that. Codes go out through any SMS provider with an HTTP API, described in the settings without code. Popular Bangladesh gateways have a ready preset that fills the request for you.

= Settings =

Everything is under the ShopCurator menu. ShopCurator > Settings holds the catalogue attributes, the sign-in image, each storefront change (each can be turned off), Open Graph and Twitter tags (off by default, and silent beside Yoast SEO, Rank Math and All in One SEO), security headers, the SMS sender and its four code flows, and whether to remove the plugin's data when it is deleted. ShopCurator > Dashboard shows cash-on-delivery orders waiting for a code, newsletter subscribers, the SMS sender's state and what is switched on, and a checklist of what is set up and what is left, each item linking to its setting.

ShopCurator > Blocks lists every block with where it belongs, how to add it and where your store already uses it. A switch on each block turns it off: it leaves the inserter and stops loading, and comes back as it was when switched on. A block in use asks first and names the pages it would leave. ShopCurator > Help answers the common questions and gives a system summary to paste into a support request.

== Installation ==

1. Install and activate WooCommerce (9.9 or later) on a block theme such as Twenty Twenty-Five.
2. Install ShopCurator from Plugins > Add New, or upload the zip, and activate it.
3. Open ShopCurator > Dashboard for the setup checklist: it shows what is set up and what is left, with a link to each setting.
4. Add blocks from the "ShopCurator" category in the inserter, or insert a whole ready section from the ShopCurator block patterns. The mega menu goes inside a Navigation block.
5. To send SMS codes, choose a sender under the SMS section — pick your provider from the preset list to fill the request, or describe it yourself — send a test message, then turn on the code flows you want.

== Frequently Asked Questions ==

= Does it need a particular theme? =

No. It is complete on a stock block theme. Twenty Twenty-Five and Twenty Twenty-Four are the reference themes.

= Which SMS providers work? =

Any provider that sends a message with one HTTP request. You give the request URL, method, headers and body, with placeholders for the number, the message, an API key and a sender ID. A "Provider preset" fills those fields for a known gateway (BulkSMSBD and Alpha SMS ship, and are listed only on a Bangladesh store; more can be added through the `shopcurator_sms_presets` filter). A development site uses a log sender, and a live site sends nothing until you choose a sender.

= Does it work with Yoast SEO, Rank Math or All in One SEO? =

Yes. Its own social tags are off by default, and while one of those plugins is active they stay silent even if turned on.

= What happens to my data if I delete the plugin? =

Nothing is removed unless "Remove data on delete" is on under Advanced. With it on, the plugin's settings, newsletter sign-ups, verified phone numbers and cached data are removed. Orders and their notes are always kept.

= Developer: which hooks can I use? =

Every seam below is called on a path the plugin itself walks, and is stable from 1.0.

* `shopcurator_loaded` (action): after the plugin has booted. `add_action( 'shopcurator_loaded', fn() => my_addon_boot() );`
* `SHOPCURATOR_VERSION` (constant): the plugin's version, for version gating.
* `Shopcurator\Support\Phone`: `normalise()`, `display()`, `is_valid()`, `find_user()`, `is_taken()`. `$e164 = \Shopcurator\Support\Phone::normalise( '01712345678', 'BD' );`
* `shopcurator_phone_rules`, `shopcurator_phone_rule` (filters): add or change a country's number rule. `add_filter( 'shopcurator_phone_rules', fn( $rules ) => $rules );`
* `shopcurator_sms_senders` (filter): add a sender to the SMS section's list. `add_filter( 'shopcurator_sms_senders', fn( $senders ) => $senders + array( 'my-sms' => new My_Sender() ) );`
* `shopcurator_sms_sender` (filter): force one sender. `add_filter( 'shopcurator_sms_sender', fn() => 'my-sms' );`
* `shopcurator_sms_presets` (filter): add a gateway to the SMS section's "Provider preset" list. `add_filter( 'shopcurator_sms_presets', fn( $p ) => $p + array( 'acme' => array( 'label' => 'Acme', 'url' => 'https://api.acme.test/send', 'method' => 'POST', 'body' => 'to={to_digits}&text={message}&key={api_key}' ) ) );`
* `shopcurator_account_alerts` (action): print a notice at the top of every account screen. `add_action( 'shopcurator_account_alerts', fn() => print '<div class="my-alert">…</div>' );`
* `shopcurator_order_actions` (action): add a button beside an order's own actions. `add_action( 'shopcurator_order_actions', fn( $order ) => print '<a href="…">Track</a>' );`
* `shopcurator_lost_password_form_mode` (filter) and `shopcurator_lost_password_code_form` (action): the password reset screen's mode and its code form.
* `shopcurator_phone_change_handled` (filter, default false): return true to take a phone-change request yourself.
* `woocommerce_get_sections_shopcurator`, `woocommerce_get_settings_shopcurator` (filters): add a section or fields to the ShopCurator settings tab.
* `shopcurator_purge_urls`, `shopcurator_purge_all` (actions): clear a page cache when products or templates change. `add_action( 'shopcurator_purge_urls', fn( $urls ) => my_cache_purge( $urls ) );`
* `shopcurator_order_held_for_code` (action): an order was held for its confirmation code. `shopcurator_held_order_admin_notification` and `shopcurator_held_order_customer_notification` (actions) send the two emails.
* `shopcurator_otp_ttl`, `shopcurator_otp_cooldown`, `shopcurator_otp_daily_cap` (filters): a code's lifetime, the wait before another, and the daily limit per number. `add_filter( 'shopcurator_otp_cooldown', fn() => 90 );`
* `shopcurator_login_throttle`, `shopcurator_login_throttle_max`, `shopcurator_login_client_ip` (filters): turn the sign-in lockout off, set the failed sign-ins before it, and the address a connection is counted under. The count is per address and per name tried.
* `shopcurator_sms_calling_codes` (filter): the calling codes a one-time code may be sent to, by default only the store's base country. On a shared plan the base country's own part only: a US store's `1` does not reach the Caribbean numbers on +1 (add `1876` for Jamaica), nor a Russian store's `7` Kazakhstan. `add_filter( 'shopcurator_sms_calling_codes', fn( $codes ) => array_merge( $codes, array( '44' ) ) );`
* `shopcurator_send_hsts`, `shopcurator_abilities_gate`, `shopcurator_allowed_abilities` (filters): override the HSTS and Abilities settings, and let named abilities through the gate.
* `shopcurator_og_default_image` (filter): the attachment ID of the default share image.
* `shopcurator_tokens` (filter): the design tokens the plugin's styles read.

== External services ==

The plugin talks to an outside service only in these cases, each one set up by the shop:

* **Google Maps**: the Map block shows a Google Maps embed of the address you type (https://www.google.com/maps). With "Ask before loading" on, the default, nothing is requested from Google until the visitor presses "Show map". Google's terms: https://policies.google.com/terms, privacy: https://policies.google.com/privacy.
* **Instagram**: only after you paste an access token under Integrations (or set `SHOPCURATOR_INSTAGRAM_TOKEN`), the Instagram block reads your recent posts from the Instagram API (https://graph.instagram.com), sending the token. The token is refreshed daily. Meta's terms: https://www.facebook.com/terms.php, privacy: https://www.facebook.com/privacy/policy/.
* **Your SMS provider**: only after you choose the HTTP sender and describe your provider, each code is sent to the request URL you entered, with the customer's mobile number, the message, and your API key and sender ID where your templates place them. The provider's own terms and privacy policy apply. Two presets fill in a provider for you; neither is contacted unless you choose it:
* **BulkSMSBD** (preset): the code message, the customer's mobile number, your API key and sender ID go to https://bulksmsbd.net/api/smsapi each time a code is sent. BulkSMSBD publishes no public terms or privacy page; they are in its customer portal at https://bulksmsbd.net after you sign in.
* **Alpha SMS** (preset): the code message, the customer's mobile number, your API key and sender ID go to https://api.sms.net.bd/sendsms each time a code is sent. Alpha SMS's terms: https://sms.bd/Terms_Condition/ (it publishes no separate privacy page).

= Nextend Social Login =

When Nextend Social Login is active and a provider (Google or Facebook) is set up in it, the sign-in and registration screens show that provider's button in ShopCurator's design. The sign-in itself is Nextend's: the button links to Nextend's own login URL, and no request goes to Google or Facebook from ShopCurator.

= Quick view and WooCommerce's cart =

Adding to the cart from a card's size tray uses WooCommerce's Interactivity cart store, which WooCommerce marks as private and may change without notice. On WooCommerce 9.9 to 10.x, and whenever the store is unavailable, the card falls back to the quick view dialog, whose form posts to WooCommerce like any product page.

== Screenshots ==

1. The mega menu inside the core Navigation block.
2. The search overlay's live suggestions.
3. Quick view on a product card.
4. Product cards with the discount badge, sold count and swatches.
5. The size filter, counting only sizes in stock.
6. The review summary with its five-bar breakdown.
7. The My Account overview with the latest order's timeline.
8. An order's detail and timeline.
9. Signing in with a mobile number.
10. A cash-on-delivery order waiting for its code.

== Changelog ==

= 1.0.0 =
* First stable release: 22 server-rendered blocks, a redesigned My Account area, phone-first sign-in, optional SMS one-time codes, and a ShopCurator admin menu with Dashboard, Settings, Blocks and Help.

== Upgrade Notice ==

= 1.0.0 =
First stable release.
