wp easy-svg share create
Make a share link for one collection, valid for 1, 24 or 168 hours, and print it once so another site can import the collection.
WP-CLI command, Easy SVG Pro, Status: Stable
A share link hands one collection to another site without a file. This command makes the link and prints it. The other site imports it with wp easy-svg pack import-link or Paste URL on its Templates screen. The link is shown only now: this site keeps a hash of its secret, never the link itself.
Usage
wp easy-svg share create <collection> [--hours=<hours>]
When to use it
- You want to give a client site or a colleague one collection, and a ZIP by mail is one step too many.
- A script on the agency site prepares links that client sites pull in.
Parameters
The collection's slug, as wp easy-svg pack list prints it. Every collection that can be exported can be shared, icon sets included.
How long the link works: 1, 24 or 168. Any other value stops with Choose one of the offered lifetimes.
Return value
Two lines. First the link alone on its line, then Success: Link made, shown only now. It expires 2026-11-02 14:30 UTC. On a German site: Link erstellt, nur jetzt angezeigt. Er läuft ab am 2026-11-02 14:30 UTC.
0 when the link was made. 1 when the license, the free plugin's icon library, the WP-CLI feature or the Share links feature is off, the collection does not exist (No such collection.), --hours is not 1, 24 or 168, or the site already has 50 live links (This site already has 50 live share links. Revoke one first.).
Default
--hours=24.
Examples
A link for one day
wp easy-svg share create house-icons
https://agency.example/wp-json/easy-svg-pro/v1/share/a1b2c3d4e5f6.Qm9yZWQgeWV0PyBUaGlzIGlzIG5vdCBhIHJlYWwgc2VjcmV0Lg
Success: Link made, shown only now. It expires 2026-11-02 14:30 UTC.
Keep only the link in a variable
url="$(wp easy-svg share create house-icons --hours=1 | head -n 1)"
How it works
- Guard: license, WP-CLI feature, Share links feature.
- The collection must be in the export index, the same list
wp easy-svg pack listprints. - A link id (12 hex characters) and a random secret are made. The site stores the id, a SHA-256 hash of the secret, the collection, the creation time and the expiry in the option
easy_svg_pro_share_links. - The link is the site's REST URL of
easy-svg-pro/v1/share/<id>.<secret>. Whoever has it can download the pack until it expires or is revoked, without logging in.
Pitfalls
- Shown once. Neither
wp easy-svg share listnor anything else can show the link again. Lost it? Revoke it and make a new one. - The link is a key. Anyone who gets it can download the collection while it lives. Send it the way you would send a password, and pick the shortest lifetime that works.
- The pack is built when it is fetched. The other site gets the collection as it is at that moment, not as it was when the link was made.
- Share links must stay on. Switching the Share links feature off makes every link answer as expired.