70 lines
2.9 KiB
Markdown
70 lines
2.9 KiB
Markdown
# Setup
|
|
|
|
## Activation
|
|
|
|
Activate the plugin from **Plugins → Installed Plugins → Nolimit Reminder**.
|
|
On activation the plugin:
|
|
|
|
1. Creates three tables: `nlrem_carts`, `nlrem_steps`, `nlrem_sends`.
|
|
2. Registers the WooCommerce hooks that track cart state.
|
|
3. Schedules the cron events `nlrem_abandon_sweep`, `nlrem_send_sweep`, and
|
|
`nlrem_retention`.
|
|
4. Registers the admin menu page under the shared Nolimit family menu.
|
|
|
|
Deactivation removes the cron events but leaves the tables. Uninstall drops
|
|
the tables and deletes all `nlrem_` options.
|
|
|
|
## First-run configuration
|
|
|
|
After activation, open **Nolimit → Nolimit Reminder → Settings** and set:
|
|
|
|
- **Abandon threshold** (minutes): how long a cart sits before it is marked
|
|
abandoned. Default 30.
|
|
- **Sequence length**: number of emails in the reminder sequence. Default 3.
|
|
- **Email interval** (hours): gap between sequence steps. Default 24.
|
|
- **Discount code** (optional): a WooCommerce coupon code appended to the
|
|
final email.
|
|
- **Retention days**: how long completed or expired cart records are kept
|
|
before the retention sweep deletes them. Default 30.
|
|
- **From name** and **From email**: the sender identity for reminder emails.
|
|
Default to the site title and admin email.
|
|
|
|
## Cron
|
|
|
|
The plugin relies on WordPress cron for its three scheduled jobs:
|
|
|
|
| Hook | Default frequency | Purpose |
|
|
|------|-------------------|---------|
|
|
| `nlrem_abandon_sweep` | hourly | Marks carts abandoned past the threshold. |
|
|
| `nlrem_send_sweep` | hourly | Sends the next sequence step for due carts. |
|
|
| `nlrem_retention` | daily | Deletes cart records older than the retention window. |
|
|
|
|
If your site uses an external cron (WP-Cron-Disable, etc.), point it at
|
|
`wp-cron.php` or replace these with system cron. The sweeps are idempotent:
|
|
running them more often than scheduled does not duplicate sends because each
|
|
send is recorded in `nlrem_sends` before the cart is advanced.
|
|
|
|
## Email deliverability
|
|
|
|
Reminder emails use `wp_mail()`. No SMTP plugin is required, but if your host
|
|
blocks outbound mail on port 25 you will need an SMTP relay. The unsubscribe
|
|
link in each email is a plain `?nlrem_unsub=...` query argument on the shop
|
|
front; no JavaScript, no account, no tracking pixel.
|
|
|
|
## Multi-site
|
|
|
|
The plugin is network-agnostic: each site in a network has its own tables and
|
|
options. The shared menu appears on each site's admin separately.
|
|
|
|
## Troubleshooting
|
|
|
|
- **No emails sent:** check that `wp_mail()` works on your host (send a test
|
|
from Settings → General → site admin email). Check the Activity tab for
|
|
failed sends and their error string.
|
|
- **Carts not marked abandoned:** verify the threshold is not set to 0 and
|
|
that the `nlrem_abandon_sweep` cron has run (Activity tab shows the last
|
|
sweep timestamp).
|
|
- **Duplicate emails:** should not happen; the `nlrem_sends` table is
|
|
checked before each send. If you see duplicates, check for a second
|
|
installation of this plugin (e.g. a stale `mu-plugin` copy).
|