LanternWP Companion

Description

LanternWP Companion is the plugin of the LanternWP block theme for WooCommerce (https://wordpress.org/themes/lanternwp/). The theme works fully without it; the plugin brings what belongs to plugins rather than themes: demo import and store features WooCommerce does not have yet, as blocks that extend WooCommerce’s own.

Companion needs WooCommerce 11.1 or later: install and activate WooCommerce first, since WordPress does not activate Companion without it.

Demo import, in Appearance LanternWP Demos:

  • Any LanternWP demo store with its products, pages, menus, look and structure, again whenever you like, with its progress shown.
  • The demo’s look goes into Styles, so it stays without the plugin; Use the look only takes the look without the content.
  • The same import from WP-CLI: wp lanternwp demo import base.
  • Until the store has a demo, a notice you can dismiss points to the screen.

Store features, listed in Appearance LanternWP Features with their switch where they have one, whether each works and where it is set:

  • Product badges: Bestseller and New badges, set on the product or by rules.
  • Product swatches: a product’s colors as swatches on its card.
  • Second photo on hover: a product’s second photo on its card while the pointer rests on it.
  • Quick view: a product’s photos, options and Add to cart over the catalog.
  • Size & option guides: a link beside a product option, such as Size, that opens its guide.
  • How it fits: the cut and the model’s height and size, under a product’s sizes.
  • Fit in reviews: the review form asks how it fits, and the product page shows what reviewers say.
  • Product sets: products that go together, with a shoppable photo.
  • Back-in-stock emails: shoppers ask to hear when a sold-out product or option is back.
  • Free shipping progress: how far the cart is from free shipping.
  • Lowest price before a discount: the Omnibus Directive’s price line.
  • Dimensions: a product’s size in an in/cm table with its drawing.
  • Samples: fabric or finish samples of an attribute’s values, ordered from the product page.
  • Shipping times: how long a product takes to ship, from its shipping class.
  • Bot protection: Cloudflare Turnstile on sign-in, registration and forms.
  • Contact form: messages kept under WooCommerce Messages and emailed to the store.

With the LanternWP theme, the plugin also keeps Store pages (Settings Reading), Store phone (WooCommerce Settings General) and a post’s Shop the story products. WooCommerce’s sale badge reads the discount (−20%) instead of Sale.

Each feature has its page in the LanternWP handbook, with every setting and where it is: https://lanternwp.com/docs/

External services

The demo import downloads LanternWP demo stores from the demo store at lanternwp.com, run by LanternWP (Testica Iga Małłek, Poland). Nothing reaches lanternwp.com until a site administrator selects Show the demos from lanternwp.com in Appearance LanternWP Demos, which says first what that means; Stop loading from lanternwp.com on the same screen withdraws it. From then on, the plugin asks it for the list of demos when an administrator opens Demos (kept for an hour), and for a demo’s list of versions and files and the files themselves when an administrator runs an import or uses a demo’s look there, only its manifest for a look (https://lanternwp.com/api/demos/), which it checks against their checksums; the administrator’s browser also loads each demo’s logo or screenshot from lanternwp.com on the Demos screen. The WP-CLI command wp lanternwp demo import (and look) fetches the same files when someone runs it, as their own request, without the screen’s yes. The requests carry what every request from WordPress carries: the site’s IP address and WordPress’s user agent, which names the WordPress version and the site’s address. Nothing else is sent. Privacy policy: https://lanternwp.com/privacy, terms of use: https://lanternwp.com/terms

Bot protection, while a store has turned it on, uses Cloudflare Turnstile, run by Cloudflare, Inc. The visitor’s browser loads Turnstile’s script (https://challenges.cloudflare.com/turnstile/v0/api.js) on a page with a protected form (for back-in-stock requests, once their form shows), and Turnstile reads information about the browser and device to tell a person from a bot. When the form is sent, the site sends Cloudflare the form’s token, the store’s secret key and the visitor’s IP address to check it (https://challenges.cloudflare.com/turnstile/v0/siteverify); saving the settings sends the secret key with a test token. Once a site key is saved, opening Bot protection’s details in Appearance LanternWP Features also loads Turnstile’s script in the administrator’s browser, with that key, to check that Cloudflare accepts it before shoppers meet it, also while Bot protection is still off. Terms: https://www.cloudflare.com/website-terms/, privacy policy: https://www.cloudflare.com/privacypolicy/

The demo photographs are licensed under CC0 1.0.

Source code and build

The complete TypeScript and CSS sources are included in resources/, with the shared editor components in resources/editor-ui/. PHP and block stylesheets are used directly. The JavaScript and admin stylesheets in build/ are compiled from these sources with @wordpress/scripts (webpack).

Screenshots

Reviews

There are no reviews for this plugin.

Contributors & Developers

“LanternWP Companion” is open source software. The following people have contributed to this plugin.

Contributors

Translate “LanternWP Companion” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0.0

The first version in the WordPress.org plugin directory: demos load from lanternwp.com only once you allow it.
* New: Demos asks before anything is loaded from lanternwp.com: it says what the requests carry, Show the demos from lanternwp.com allows them, and Stop loading from lanternwp.com withdraws that.
* New: Plugins, Features and Demos say when WooCommerce is older than the 11.1 Companion needs, with a link to update it.
* Improved: Compatible with WooCommerce’s High-Performance Order Storage, and declared so.
* Improved: Works on servers without PHP’s mbstring extension.
* Improved: A demo import leaves WooCommerce’s own product sync in place and syncs the demo’s products once more when it finishes.
* Fixed: Without WooCommerce, the blocks that need it are not registered, so the editor shows no warnings about them and no failed block preview.
* Fixed: Page scrolling is locked only under Companion’s own dialogs, not under another plugin’s.
* Fixed: Features and a post’s Shop the story panel no longer log warnings in the browser console.
* Improved: Product sets, size and option guides, samples and back-in-stock requests show and accept only the products the signed-in account may see: another author’s private or draft product stays hidden, in the admin and in the editor.
* Improved: A product added to a post’s Shop the story must be one that the account saving the post may see.
* Improved: Deleting the plugin also removes the features’ settings, the state of a demo import with its working folder and, while WooCommerce is active, its waiting jobs. Caches kept per product expire within a day, and the store’s content stays.
* Improved: An attribute’s edit screen opened from an old address says that LanternWP’s fields are not on it, with a link that opens it again.
* Improved: Bot protection loads Cloudflare’s script again for a form after it failed to load, so one failed load does not stop the page’s other forms.
* Improved: How reviewers say a product fits is counted from its latest 500 answers and kept with the product, instead of counted on every page.
* Improved: Lowest price before a discount loads its stylesheet only on pages that show the line.
* Fixed: A back-in-stock confirmation link shows nothing of a product taken out of the store since the request.
* Fixed: Saving an attribute keeps its samples product when the field’s list no longer holds that product.
* Fixed: A demo import that cannot add a changed image leaves the store the image it had.
* Fixed: Appearance LanternWP Features opens while WooCommerce is inactive.
* Fixed: The set editor, the list of sets and a product’s Sets tab have their own styles back, and show prices without the text meant for screen readers.
* Fixed: Quick view keeps its product summary’s spacing in every look.

0.7.1

  • Fixed: A demo import that lost its turn to a newer one stops, instead of overwriting the newer import.
  • Fixed: Starting a demo you are not allowed to import no longer removes the files of that demo’s unfinished import.

0.7.0

A Product Set Hero block, and clearer feature details in Features.
* New: Product Set Hero block: one product set with its photo in a page’s hero; Product Sets shows several sets.
* Improved: An import gives the store its product photo shape, so a demo’s packshots are not cropped twice.
* Improved: Translations come from translate.wordpress.org; the plugin ships no translation files of its own.
* Improved: After activation no screen opens by itself; a notice you can dismiss points to Demos until the store has a demo.
* Improved: The contact form’s button turns on once its script is ready, so a message cannot be lost to a script that failed.
* Improved: The back-in-stock confirmation page is a template of its own, Back-in-Stock Confirmation in the Site Editor, between your header and footer with their blocks intact.
* Improved: A contact message about an order adds a note that says it came and links to it, and no longer copies the message into the order, so deleting the message deletes all of it.
* Improved: The Contact message received email starts with Hello, and does not repeat the name the sender typed.
* Improved: The import dialog says that a demo adds author and customer accounts.
* Improved: Bot protection checks the saved site key with Cloudflare when you open its details in Appearance LanternWP Features: a key Cloudflare refuses shows an error under its field, the feature says Needs setup, and forms are not checked until the key works, so a mistyped key does not lock shoppers out. The message names the missing key, and Forms it checks says which of them the store does not show.
* Improved: Product swatches says for each attribute what is missing (no color, a single color, terms without a color), names WooCommerce’s Color swatches for attributes setting only while no attribute has the Color / image type, with a link straight to it, and Products Attributes says why an attribute has no Type field.
* Improved: Free shipping progress shows its amount in Features (Free shipping over $50, or the lowest and highest across shipping zones) with a link to Shipping zones, says when every order ships free, and says Needs setup when zones have different amounts and the customer’s default location is empty; the shipping zone screens link back to Features.
* Improved: Contact form has details in Features: the contact page, the block’s heading and topics, Messages with the number of new ones, both emails, how long messages are kept and bot protection. The Contact Form block’s Heading is beside its Topics, Send a message by default, and the emails’ preview and test email show a sample message.
* Improved: WooCommerce Messages lists the date received and an Order column with the number the shopper typed, and a message is New until someone opens it, with a count beside Messages in the menu.
* Improved: Products Back-in-stock requests filters by product, with the number of requests for each product or option, says Not confirmed yet instead of Pending, and links to the feature’s details and to both emails, which link back to the list.
* Fixed: A contact form sent empty right after the page loads says which fields it needs, instead of being refused as too fast.