=== Storefill – Demo Content Importer ===
Contributors: som9663
Tags: demo import, demo content, one click demo, woocommerce, theme demo
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Import your theme's demo store in one click: products, categories, pages, a menu and the homepage. Remove exactly what was added whenever you like.

== Description ==

A new store looks empty until it has products. Storefill fills it with the demo content your theme
was designed around, so you can see every section working and then swap the demo products for your
own.

Open **Appearance → Import demo**, check the requirements, and click **Import demo content**.
For Vitrena, eBasket, Luma, Unishop and Gadgetix, Storefill first installs or updates and activates
WooCommerce when needed. Plugin setup runs on this screen, with activation redirects suppressed,
before any content is imported.
If setup fails, the import stops and offers **Try again**.
Storefill adds:

* Products, with photos, prices, sale prices, stock, specifications, variations and reviews
* Product categories with images, brands and filterable attributes
* Pages and blog posts
* A navigation menu
* The demo's look: one of the theme's own style variations for block themes (Twenty Twenty-Five
  imports in its Noon style), and Customizer settings and widgets for classic themes
* The demo homepage and blog page (optional)

= Safe on a store that already has content =

* Your own content is never changed or deleted. If a product, page or category with the same name
  already exists, Storefill uses it as it is.
* Every item Storefill adds, and the previous value of every setting it changes, is recorded.
  **Remove demo content** deletes exactly those items and restores those settings. Content you
  added yourself is kept.
* Your store's visibility, title, address, currency, payments and shipping are left alone unless
  you tick "This is a public demo site".

= For theme demo sites =

Tick **This is a public demo site** (or use `--demo-site` on the command line) to also set the site
title and store address, switch store visibility to Live, turn on pretty permalinks, unpublish
WordPress's sample post and page, and add a demo checkout: a payment method that takes no money and
delivery methods, so visitors can place a test order. Never use this option on a real store.

= WP-CLI =

    wp storefill packs
    wp storefill import unishop --demo-site
    wp storefill status unishop
    wp storefill remove unishop --yes

= Supported themes =

Demo packs are available for Twenty Twenty-Five (the default WordPress theme), Unishop, eBasket,
Luma, Vitrena, Gadgetix and Yantra. Packs for more themes are added to the demo library over time; Storefill
finds them without an update.

= For theme developers =

A demo pack is a few JSON files (content, dashboard settings, Customizer settings and widgets)
and a folder of photos in the public
[demo-pack repository](https://github.com/som3669/demo-pack). Its README documents the format.
Nothing in a pack is executed: Storefill only reads data and imports images through the WordPress
media library. Pack text is treated as plain text (any HTML is stripped), and a pack can only change
a fixed list of store and site-identity settings, never accounts, roles, URLs or security settings.

A pack may declare `required_plugins`, with each entry specifying a WordPress.org `slug`, display
`name`, plugin entry `file` (for example, `woocommerce/woocommerce.php`) and `minimum_version`.
The admin importer prepares these plugins before importing content. Plugin downloads come only
from WordPress.org; a pack cannot supply a plugin download URL or executable code.

== Installation ==

1. In your dashboard, go to **Plugins → Add New Plugin**, search for "Storefill", then install and
   activate it. Or upload the `storefill-demo-content-importer` folder to `/wp-content/plugins/`
   and activate it on the **Plugins** screen.
2. Activate a theme that has a demo pack. Vitrena, eBasket, Luma, Unishop and Gadgetix install and
   activate WooCommerce during import;
   other store packs still require manual setup unless they declare required plugins.
3. Go to **Appearance → Import demo** and click **Import demo content**.

== External services ==

Storefill downloads demo packs from the public demo-pack repository on GitHub, published with
GitHub Pages at `som3669.github.io`.

* **What is requested:** the pack index (`index.json`), the pack for your active theme
  (`pack.json`) and that pack's photos.
* **When:** when you open Appearance → Import demo (the index and the pack are then cached for six
  hours), and when you import (the photos).
* **What is sent:** nothing about your site or its users. The requests are plain file downloads.
  Like any web request, they reveal your server's IP address to GitHub.

GitHub is operated by GitHub, Inc.:
[Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service),
[Privacy Statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement).

To use another host, define `STOREFILL_SOURCE` in `wp-config.php` with its base URL. To read packs
from a folder on the server without requesting pack files remotely, define `STOREFILL_LOCAL_PACKS`
with the folder path. Required plugins may still be downloaded from WordPress.org during import.

When you click **Import demo content** for a pack with required plugins, Storefill uses the
WordPress.org plugin API (`api.wordpress.org`) to check plugin information and downloads missing
or updated plugins from `downloads.wordpress.org`. These requests include the plugin slug and
locale, and WordPress's default user agent includes the WordPress version and site URL. Your
server's IP address is also visible to the service. Plugins are activated only with the current
administrator's plugin-management permissions.

If a required plugin needs an update, Storefill requests WordPress's standard plugin update
check from `api.wordpress.org`. WordPress sends installed plugin headers and versions, active
plugins, plugin translations and available site languages, plus its version and site URL in the
user agent. Only the selected demo's required plugin is updated.
[WordPress.org Privacy Policy](https://wordpress.org/about/privacy/).

== Frequently Asked Questions ==

= Will importing overwrite my products or pages? =

No. Storefill only adds. When something with the same name already exists, it is used as it is and
never changed, and removal never deletes it.

= How do I remove the demo content? =

Appearance → Import demo, click **Remove demo content**, and confirm. Or run
`wp storefill remove <pack>`.

= Will importing change my site's design? =

Yes, to match the demo. A block theme switches to the style variation its demo uses, if it names
one, and a classic theme gets the demo's Customizer settings and widgets. Storefill records your own
styles and settings first, and removing the demo puts them back exactly.

= What happens if the import stops half way? =

Open Appearance → Import demo again and click **Finish the import**, or click **Try again** on the
step that stopped. Every step picks up where it left off without duplicating anything.

= What happens to the demo content if I uninstall Storefill? =

It stays on your site. Storefill keeps its record of what it imported, so if you install it again
you can still remove the demo content. Remove the demo first if you want it gone.

= Does it work without WooCommerce? =

Packs that build a store need WooCommerce, and the import screen says so. Packs with only pages,
posts and a menu work without it. Vitrena, eBasket, Luma, Unishop and Gadgetix prepare WooCommerce
automatically when you import.

== Screenshots ==

1. The import screen: a preview, what the pack adds, the requirements, and the two options.
2. The import running: the overall progress and the step in progress.
3. The import finished: a success popup with confetti, what was added, and a link to the store.
4. After the import: the date, the next steps, and Remove demo content.
5. Removing the demo content asks for confirmation first.

== Changelog ==

= 1.1.0 =
* Read demo packs that build their pages from the theme's own block patterns, with buttons linked to the demo's pages.
* Import more than one menu, lists of links and recent posts as a simple list; Customizer settings can link to the demo's pages and posts.
* Apply page templates that a theme keeps in a subfolder.
* Remove the brand banner from the import screen.
* Add the Gadgetix and Yantra demo packs to the library.

= 1.0.1 =
* Install or update and activate required plugins before importing Vitrena, eBasket, Luma and Unishop demos.
* Explain automatic plugin setup on the import screen and keep activation redirects out of the import flow.
* Add the Vitrena, eBasket and Luma demo packs to the library.
* Import product tags and prevent image attachments from being mistaken for existing products or pages.
* Refresh the Storefill logo and banner in the importer and on WordPress.org.

= 1.0.0 =
* Initial release.
