===  Harvify Wishlist ===
Contributors: jethalal
Tags: wishlist, woocommerce, save for later, back in stock, ecommerce
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.18
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
WC requires at least: 8.0
WC tested up to: 10.8

Let customers save WooCommerce products to a wishlist — single + loop buttons, guest support, social sharing, and Pro reminders & insights.

== Description ==

Harvify Wishlist adds a clean "Add to Wishlist" experience to your WooCommerce store. Visitors can save products from product pages and shop/category listings, view their wishlist on a dedicated page, and add items to the cart in one click. Guests get a cookie-based wishlist that merges into their account when they log in.

**Free features:**

* "Add to Wishlist" button on single product pages and shop/category loops
* **Variable-product aware** — saves the exact selected variation (e.g. "Blue /
  XL"), not just the parent product
* Configurable button position (after add-to-cart, after meta, or on the
  thumbnail)
* **Appearance options** — choose the icon, corner radius and border, and show
  an icon only in the shop loop.
* [harvify_wishlist_button] shortcode and a "Wishlist Button" block for block
  themes
* One wishlist per user, stored in custom tables (not user meta)
* Guest wishlists (cookie-based) that merge into the account on login
* Wishlist page via the [harvify_wishlist] shortcode, with add-to-cart
* Social sharing (Facebook, X, WhatsApp)
* WooCommerce HPOS compatible

**Pro features (Harvify Pro Bundle):**

* Multiple named wishlists per user
* Public/private wishlists with shareable URLs
* Email reminders when a wishlisted product goes on sale or comes back in stock
* Store-owner insights: most-wishlisted products and total active wishlists
* "X shoppers wishlisted this" social-proof badge
* Wishlist insights CSV export
* Custom CSS for the wishlist button and page

= Setting up your wishlist =

1. Go to **Harvify → Wishlist**. The **Settings** tab opens.
2. Under **Behaviour**, click **Auto-create wishlist page**, or choose an existing
   page that contains the `[harvify_wishlist]` shortcode.
3. Under **Button & appearance**, set the button label, colour, icon, corner
   radius and border.
4. Under **Placement**, choose where the button appears on shop listings and on
   product pages.
5. Click **Save settings**.

The **Insights** tab shows how many wishlists shoppers have created and how many
products they have saved.

== Frequently Asked Questions ==

= Does the button work in block themes? =
Yes. WooCommerce's classic loop/single hooks do not fire inside block-based product templates, so the button is also available as a "Wishlist Button" block and as the `[harvify_wishlist_button]` shortcode. Place either one inside your product template.

= What happens to a guest's wishlist when they log in? =
On login, the guest's cookie wishlist is merged into their account wishlist (duplicates are ignored), the guest record is removed, and the cookie is cleared.

= Are wishlist reminder emails consent-based? =
Yes. Logged-in owners are emailed at their account address. Guests are only emailed if they explicitly provided an email and consent. Captured reminder emails are exportable and erasable via the WordPress privacy tools.

= Where is wishlist data stored? =
In two custom tables (`harvify_wishlists` and `harvify_wishlist_items`), which lets the Pro "most-wishlisted" insights run as a simple aggregate query.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/harvify-wishlist/`
2. Activate via **Plugins → Installed Plugins**
3. Go to **Harvify → Wishlist** to configure the button and create your wishlist page
4. Ensure WooCommerce is active

== Screenshots ==

1. Wishlist overview, with one-click creation of the wishlist page.
2. Saving and sharing is free; a licence adds back-in-stock and on-sale emails.
3. The Add to Wishlist button on a product page, in the position you choose.
4. The same button in the shop loop, so a shopper can save an item without
   opening it.
5. The wishlist page, where a shopper finds everything they saved.

== External services ==

This plugin connects to Freemius, the licensing and update service Harvify uses to
sell and deliver the Pro tier of its plugins.

Nothing is sent to Freemius unless you choose to send it. On activation you are shown
Freemius's standard opt-in screen. Until you answer it a fresh install makes no
outbound request at all, and if you choose Skip the free tier stays fully usable
and still sends nothing. Data is transmitted only when you take one of these
actions:

* **You click "Allow & Continue" on the Freemius opt-in screen.** This sends your
  site address, your administrator email address, and your WordPress, PHP and active
  plugin/theme details, so Harvify can provide support and know which environments to
  test against. Skipping that screen sends nothing and leaves the plugin working
  normally.
* **You enter a Pro Bundle licence key.** This sends the key together with your site
  address so the licence can be activated for that site. While a licence is active the
  site also re-checks periodically that it is still valid and whether a Pro update is
  available.

Service provided by Freemius, Inc. - https://freemius.com/
Terms of service: https://freemius.com/terms/
Privacy policy: https://freemius.com/privacy/

= Share buttons: Facebook, X and WhatsApp =

While "Social sharing" is switched on (it is on by default; switch it off under
**Harvify → Wishlist → Settings**), the wishlist page shows three share links, for
Facebook, X and WhatsApp. They are ordinary links. The plugin itself makes no request
to these services and sends them nothing.

Data reaches one of these services only when a visitor clicks its link. Their browser
then opens that service, which receives the address of the shop's wishlist page and
the text "Check out my wishlist", plus what any browser sends to a site it opens (such
as the visitor's IP address and that service's own cookies). Nothing is sent if nobody
clicks.

* **Facebook** (Meta Platforms, Inc.) -- to share the wishlist page on Facebook.
  Terms of service: https://www.facebook.com/terms.php --
  Privacy policy: https://www.facebook.com/privacy/policy/
* **X** (X Corp.) -- to post a link to the wishlist page on X.
  Terms of service: https://x.com/en/tos --
  Privacy policy: https://x.com/en/privacy
* **WhatsApp** (WhatsApp LLC) -- to send a link to the wishlist page in a WhatsApp
  message.
  Terms of service: https://www.whatsapp.com/legal/terms-of-service --
  Privacy policy: https://www.whatsapp.com/legal/privacy-policy

== Changelog ==

= 1.0.18 =

* Every piece of HTML the plugin prints is now escaped at the point it is printed,
  including the badge that other code can add to the Add to Wishlist button.
* The readme's External services section now says what each share button sends,
  when, and links to each service's terms and privacy policy.
* The Insights tab no longer shows "Pro" placeholders or a second upgrade card.
* The "complete activation" reminder now appears only on the plugin's own screen,
  never on the Dashboard or other WordPress screens.
* The Insights totals are read with prepared queries.

= 1.0.17 =

* **Internal names now start with `harvify_wishlist_`** instead of `hwl_`, as
  WordPress.org requires. Your settings are carried across automatically on the
  first page load after updating; nothing needs doing. Wishlists themselves were
  already stored under the new name and are untouched.
* **Custom CSS is now part of Pro.** WordPress.org does not accept plugins that save
  custom CSS in the free version. CSS you already saved is kept: with a Pro licence it
  keeps working, and without one it is stored but not added to your store.
* **Freemius now asks before connecting.** On activation you see Freemius's standard
  opt-in screen with a Skip button; skipping sends nothing and the plugin works as
  before. The External services section is updated to match.
* Readme: step-by-step instructions for setting up the wishlist.

= 1.0.16 =

* Added: a single **Support** entry in the Harvify menu, so you can reach us from
  inside WordPress. Until now no plugin offered a contact route at all. One entry for
  the whole suite rather than one per plugin.
* No behaviour changes.

= 1.0.15 =

* Added: an **External services** section to this readme, naming every third-party
  service the plugin can contact, exactly what is sent, when, and each provider's terms
  and privacy policy. Required for WordPress.org submission.
* Changed: the `Contributors` field now names the correct WordPress.org account.
* Added: the `Requires PHP` header to the main plugin file, matching the readme.
* No behaviour changes.

= 1.0.14 =

* Fixed: deactivating the plugin now cancels the reminder sweep even when the Pro
  features are not loaded. The cancellation lived in a Pro-only file, so on the
  free version -- and on a paid site whose licence had lapsed -- deactivating the
  plugin quietly left the sweep queued.

= 1.0.13 =

* Performance: the wishlist stylesheet and script now load only on pages that actually
  draw a wishlist. They were enqueued on every front-end page as soon as WooCommerce
  was active, including the home page and the cart. The button, the shortcode, the
  widget and the block all still bring in what they need.
* Fixed: asking for the wishlist page a second time no longer creates a second page.
  Both creation paths inserted one unconditionally, so a double-click made duplicates.
= 1.0.12 =
* Added: a single **Manage licence** link on the Plan screen, so an active customer can
  deactivate this site, change their licence key or re-check their licence without
  needing a URL from support. No per-plugin Account tab is added.
= 1.0.11 =
* **Fixed: updating the plugin did not update its database.** WordPress only runs a plugin's
  setup routine when you *activate* it, never when it updates - so a change to the plugin's own
  tables never reached sites that had simply updated. On those sites some features failed with a
  database error. The update now applies itself on the next page load.
* **One upgrade link instead of one per plugin.** With several Harvify plugins active the
  menu showed a row called "Upgrade" for each of them, all identically labelled, and it kept
  saying Upgrade to people who had already bought. They are replaced by a single **Plan**
  screen that says what the bundle costs, what it covers, and whether your licence is active.
* **The dashboard is quiet again.** Each plugin used to add its own "opt in to make this
  better" notice to the main WordPress dashboard, so five plugins meant five notices. Harvify
  plugins now share one queue: promotional notices appear only on Harvify's own screens, and
  only one at a time. Licence and account messages are never held back.
* **Fixed: the "Data & uninstall" box covered the page.** It was being drawn into the admin
  footer, which WordPress pins to the bottom of the screen, so it floated on top of whatever was
  underneath it. It now sits in the page like any other card. Saving it also tells you what it
  saved, instead of just reloading.
* **Fixed: the upgrade screen advertised the wrong number of sites.** Several plugins listed
  the Freelancer and Agency plans as covering 5 and 25 sites. They cover 3 and 10.

= 1.0.10 =
* **Uninstall no longer destroys your data by default.** Deleting the plugin used to remove
  everything it had stored, with no way to stop it -- so deleting it to troubleshoot took the lot
  with it. Now the default is to KEEP your data, and a new **Data & uninstall** control on the
  plugin's own screen lets you opt in to a full wipe if that is what you want. Scheduled jobs are
  always tidied up either way, and the wipe works with no internet connection.

= 1.0.9 =
* **Security fix: a shared wishlist link kept working after a licence lapsed.** With the Pro
  build installed but no valid licence, `?wishlist=<slug>` still resolved and rendered another
  shopper's list to any visitor holding the URL. The shared-wishlist page is now gated on a live
  licence, to the same standard as the ownership check on account downloads. A private list was,
  and remains, refused in every licence state.
* **Pro features now stop when a licence lapses**, instead of continuing on the installed premium
  build: the social-proof badge, shared wishlists, reminder emails and the insights export.
* **Your data is never touched by a lapse.** Extra wishlists stay exactly where they are and stay
  readable — you simply cannot create or delete one until the licence is renewed, which is also
  what stops a lapsed session deleting them. Nothing is removed, no visibility setting is
  rewritten, and renewing restores everything with nothing lost.
* WordPress's own privacy exporter and eraser keep working regardless of licence state: a data
  request does not lapse with a subscription.

= 1.0.8 =
* Redesigned the **on-sale and back-in-stock reminder emails**, after rendering them and looking
  at them for the first time. Four things were wrong:
* Fixed: the sale price arrived garbled. WooCommerce's page markup carries hidden screen-reader
  duplicates of every figure — harmless on a themed page, but email has no stylesheet, so
  customers read "₹100.00 Original price was: ₹100.00. ₹60.00 Current price is: ₹60.00."
  The old price is now simply struck through next to the new one.
* Fixed: no font was set, so the message arrived in the mail client's default serif.
* Fixed: the "Your wishlist" link fell back to your homepage when no wishlist page was
  configured. It is now left out entirely rather than sending shoppers somewhere unhelpful.
* The reminder now carries your store name, sits in a proper card, and gives the shopper one
  clear **View product** button.

= 1.0.7 =
* Fixed (Pro): **the email-reminder switch had no control anywhere in the settings screen.** It
  defaults to on, so reminders sent — but a shop owner had no way to turn them off. There is now
  an *Email reminders* checkbox next to the social-proof badge, and the save route honours it.
* Housekeeping: removed the pre-SPA Insights screen, which nothing could reach. It was the only
  place that switch used to live, which is how it went missing.

= 1.0.6 =
* Your licence is now manageable from the plugin itself. The Account screen was previously
  hidden, which also hid **Deactivate License** — so a licence could not be released from one
  site to move it to another without contacting support. It is visible again, along with the
  licence key, plan, Sync and Change License.
* **Harvify → Tools** now opens with a **Your licences** table: every installed Harvify plugin,
  the plan it is on, whether Pro features are actually running, and a link to its Account screen.
  Freemius gives each product its own separate Account page, so this is the one place that
  answers "what am I on" across the whole bundle.
* The repeated *"Opt in to make … better!"* admin notice no longer appears. Licence, plan and
  update notices are unaffected — only the opt-in prompt is suppressed.

= 1.0.5 =
* Change: License activation now uses per-plugin key entry — enter your bundle license key on each Pro plugin to unlock Pro. Improves activation reliability.

= 1.0.4 =
* New: appearance options — icon choice (heart / star / flag / none, with matching filled icons in the added state), corner radius, optional borderless style, and an icon-only mode for product loops (the label remains for screen readers).
* New: custom CSS box — appended to the wishlist styles on the front end for theme-perfect tweaks without extra plugins.

= 1.0.3 =
* Variable products: the wishlist button now saves the shopper's selected variation (e.g. "Blue / XL") instead of the parent product. It follows WooCommerce's variation selection live.

= 1.0.2 =
* New admin design system (Harvify Admin Kit): the settings screen is now a single-page app with a branded header, first-run onboarding, section navigation (Settings, Insights), skeleton loader, coaching empty states, an at-a-glance Insights panel (active wishlists, products saved, and a Pro most-wishlisted ranking with CSV export), and a contextual, dismissible upgrade card. Settings are saved via new admin REST routes. UI layer only — the wishlist button, capture and free/Pro gating are unchanged.

= 1.0.1 =
* Internal: uninstall cleanup now runs on Freemius's after_uninstall hook (removed uninstall.php) for Freemius Deployment compatibility. What gets removed on uninstall is unchanged.

= 1.0.0 =
* Initial release.
* Add-to-Wishlist button on single + loop, plus shortcode and block.
* Custom-table storage keyed by user or guest token; guest→user merge on login.
* Wishlist page shortcode with add-to-cart and social sharing.
* Pro: multiple named lists, public/private shareable URLs, sale/back-in-stock email reminders (consent-gated, privacy-erasable), most-wishlisted insights, social-proof badge, CSV export.
* WooCommerce HPOS compatible. Action Scheduler for reliable reminder delivery.
