=== Linkvyn Image Studio ===
Contributors: linkvyn
Tags: image editor, webp, background remover, watermark, featured image
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Free image studio in your Media Library: templates, text, shapes, logos, background removal, and bulk WebP, resize and watermark.

== Description ==

Linkvyn Image Studio is a free design tool and image optimiser that lives entirely on your WordPress site. No account, no limits, no external services: your images and fonts never leave your server, and nothing is added to the pages your visitors see.

**Design (Media > Image Studio)**

* Start from a "Create a new design" screen: canvas sizes up front (square, story, landscape, portrait, presentation), sizes for Instagram, Facebook, LinkedIn, YouTube, Pinterest, TikTok and X, a custom size in pixels, inches or centimetres with an aspect-ratio lock, your recent designs, your saved templates, or a photo uploaded from your computer.
* A contextual toolbar above the canvas shows the right controls for whatever you select: text, photo, shape, line or several layers.
* Right-click menu with layer order, copy and paste, duplicate, lock, hide, group, align, distribute, rotate and flip.
* Smart guides: layers snap to the canvas centre and edges, to each other's edges and centres, and to equal spacing, with red guide lines. Hold Ctrl or ⌘ to move freely, or turn snapping off.
* Rotation snaps to 45° steps (15° with Shift) and shows the angle as you turn.
* Crop a photo right on the canvas: double-click it, drag the photo or the frame, press Enter. Crops stay editable.
* Zoom with Ctrl or ⌘ + scroll, trackpad pinch or two fingers on a touch screen. Hold Space and drag to move around.
* Editable text effects: curved, arched, circular, radial, wave and vertical text, plus glow and a rounded background. The words stay editable after saving.
* Colour picker with transparency, hex, eyedropper, the colours already in your design, your brand colours and recently used colours.
* Draw freehand with a pen, marker or highlighter, and add a drawn or typed signature (it can be remembered for your account only).
* Erase parts of a photo with a soft brush, with a Restore brush and a one-click reset to the original.
* Keyboard shortcuts for everything common (press ? in the editor to see them all), including Ctrl+A, copy and paste between designs, and paste text or images from other apps.
* 28 starter templates for LinkedIn, Instagram posts and Stories, blog headers, YouTube thumbnails, product promotions and website banners. Drop your own photos into the slots.
* Save any design as a template. Templates are private to you; editors and administrators can share them with the team.
* Canvas sizes for Open Graph link previews, blog featured images, Instagram, Stories, Pinterest, YouTube, LinkedIn, X and Facebook.
* Crop to any shape: free, original, 1:1, 1.91:1, 16:9, 4:3, 3:2, 4:5, 2:3 and 9:16.
* Text with 32 bundled fonts, your theme's fonts, fonts installed in the WordPress Font Library, and your own uploaded brand fonts. Weight, alignment, line height, letter spacing, outline, highlight and shadow.
* Solid colours, linear and radial gradients with up to four colours, and Canva-style colour and gradient presets, for backgrounds, text and shapes.
* Add your logo or any image, with rounded or circle corners, brightness, contrast, saturation, blur and black-and-white.
* Remove a background colour from logos and product shots in one click. Add the cut-out to your Media Library only if you want to.
* More than 60 shapes: basics, stars and badges, arrows, lines, callouts, labels and frames, with solid, dashed or dotted strokes.
* More than 2,000 searchable line icons.
* Every emoji, searchable by name, with recently used ones kept handy.
* Opacity, align and distribute, layers you can drag to reorder, rename, hide and lock, undo and redo.
* Safe-zone guides so WhatsApp and Slack link previews don't cut off your headline.
* Designs keep their layers, so you can open them again, change the text, and update the same image or save a new copy.
* Designs and templates only use images stored on your own site, so a template can never load anything from elsewhere.

**Optimise (Media > Bulk Optimise)**

* The same app as the designer: filter your images on the left, pick photos in the grid (Shift+click for a range), and choose what to do on the right with a preview and the expected saving. Open any photo in the designer from the grid.
* Optimisation report: library size, images not yet in WebP, estimated savings, oversized images and images missing alt text.
* Bulk convert existing JPEG and PNG images to WebP. Old image links keep working and your posts switch to the WebP versions automatically.
* Bulk resize oversized photos.
* Bulk brightness and contrast, with a before-and-after preview.
* Bulk add your logo or watermark, with position, size, opacity and margin, and a live preview. The logo goes on the full-size original and every thumbnail size.
* Restore originals at any time, byte for byte. Originals are kept in a protected folder. If something else changed an image since, you are warned instead of having those changes overwritten.
* Optionally convert new JPEG and PNG uploads to WebP as they arrive (off until you turn it on). Originals are kept by default, copyright and camera details are preserved, and very large photos are converted in the background.

**Fast by design**

* Nothing is added to your public pages: no scripts, styles or fonts.
* The editor loads only on its own admin screens.
* Text is drawn into the image, so visitors never download a font.
* Bulk work runs two or three images at a time from your browser (or one at a time in safe mode), can be resumed if the page is closed, and never works on the same image twice at once.

== External services ==

None. The plugin does not connect to any external service. Fonts are bundled with the plugin or come from your own site.

On its own settings and Bulk Optimise screens, at most once a week, the plugin requests a small test file from your own site to check that protected files cannot be opened directly. That request goes only to your own site.

== Installation ==

1. Upload the plugin and activate it.
2. Go to Media > Image Studio to design, or Media > Bulk Optimise to optimise existing images.
3. Optional: adjust WebP quality and upload conversion under Settings > Image Studio.

== Frequently Asked Questions ==

= Is it really free? =

Yes. Every feature is free, with no limits and no account.

= Will this slow down my site? =

No. The plugin adds nothing to the pages your visitors see. If you convert images to WebP, a tiny filter points your posts at the WebP files; it only runs for converted images.

= What happens to my originals? =

Bulk changes and WebP conversion keep your originals in a protected folder (uploads/linkvyn-image-studio/private-…) with random file names, and "Restore originals" puts them back exactly. Upload conversion is off until you turn it on; when on, originals are kept unless you choose otherwise in Settings > Image Studio.

= Can visitors open the protected folder? =

On Apache, LiteSpeed and IIS the folder refuses all direct requests. Nginx ignores .htaccess files, so the plugin checks whether your server really refuses these files. If it does not, or the check gets no clear answer, the plugin shows a warning with the exact rule for your site, for example:

`location ~* /wp-content/uploads/linkvyn-image-studio/private- { deny all; }`

Add it to the site's Nginx server block, reload Nginx, then click "Check again".

= Who can see my templates? =

Only you, unless you share them. Editors and administrators can share a template with everyone who uses Image Studio; developers can change who may share with the `lvis_share_capability` filter.

= How do I use my brand font? =

In Image Studio, open Text, then upload your font files (.woff2, .woff, .ttf or .otf) under Fonts, with an optional licence note. Uploaded fonts are stored privately and are only sent to signed-in users who can use the studio; they are never publicly downloadable. Fonts installed in Appearance > Editor > Styles > Typography, and fonts your theme ships, appear automatically.

= What does my server need? =

WordPress 6.0 or newer. WebP conversion needs WebP support in GD or Imagick, which most hosts have. Adding logos in bulk needs GD.

= My images are on a CDN or offloaded to cloud storage =

That works. Designs may use any image from your Media Library, even when a plugin serves it from cloud storage or a CDN: the plugin accepts exactly the addresses WordPress gives for that Media Library image, and nothing else on that host. To use image files from another host that are not in the Media Library, list the host under Settings > Image Studio > Trusted image hosts (HTTPS only, no wildcards). Any other outside address is refused. The CDN must allow cross-origin access so designs can be exported.

= Where is my saved signature kept? =

Only if you tick "Remember it for next time", it is stored with your own WordPress user account and only you can use it. Other users never see it. "Forget it" deletes it at any time, and uninstalling the plugin removes it.

= What happens if I uninstall? =

Settings, brand fonts, brand colours, saved signatures and templates are removed. Designs you saved stay in your Media Library as images, but their editable layers are removed, so they can no longer be opened as layers in the studio. Image backups are kept so you can still restore originals if you reinstall. Restore first if you want the originals back.

== Source code ==

The editor ships minified for speed. The full, readable source is included next to it: assets/js/studio.js and assets/js/bulk.js (minified with Terser). Set SCRIPT_DEBUG to true to load the readable files.

== Third-party resources ==

* Fabric.js 5.3.0, MIT licence, https://github.com/fabricjs/fabric.js
* 32 fonts from Google Fonts (via Fontsource), SIL Open Font License 1.1. Licence files are in assets/fonts/licenses.
* Lucide icons, ISC licence, https://lucide.dev
* Template previews and designs: original work, GPLv2 or later.
* Emoji names from unicode-emoji-json, MIT licence, https://github.com/muan/unicode-emoji-json

== Screenshots ==

1. Start a design from a canvas size, a social media size, a template or your own photo.
2. The editor: a starter template with a photo from your Media Library, the toolbar for the selected text, and layers.
3. Editable text effects such as arched, curved and circular text.
4. Right-click menu with layer order, align, rotate, lock, crop and more.
5. Bulk Optimise: filter your library, pick photos and see the likely saving before converting to WebP.
6. Add your logo to many images at once, with a live preview.
7. Settings for upload conversion, WebP quality and protected originals.

== Changelog ==

= 1.5.5 =
* Protected files (kept originals, backups and brand fonts) are always stored in the uploads folder. The option to move them elsewhere was removed.
* The protection warning is now also shown when the plugin cannot confirm that protected files are blocked, and the Nginx rule it shows uses your site's real uploads path.
* Security: all icon output is escaped.

= 1.5.4 =
* Fix: in Bulk Optimise, Shift+click to pick a range of photos also selected the page's text, covering the cards in a blue highlight.
* Readme: screenshots added.

= 1.5.3 =
* Fix: a long template name, brand font name or font licence in a non-Latin script (Japanese, Greek, accented letters and so on) was cut in the middle of a character. The template then could not be saved, and the font seemed to upload but never appeared in the list. Names are now shortened by whole characters.
* Fix: if a brand font's details cannot be saved, the upload now says so and does not leave the font file behind.
* Fix: a design could not be saved when a photo's Media Library title was very long, or when a layer was renamed to a long name in a non-Latin script. Layer names taken from photo titles are now shortened to 120 characters, the same limit as renaming.
* Fix: titles with apostrophes, quotes, ampersands or double dashes showed as codes such as &#8217; under Recent designs, in layer names and in the Save dialog, and those codes could end up in a saved title. Titles now show exactly as typed.
* Fix: "Restore anyway" could not bring back a photo converted to WebP when another optimiser (for example EWWW Image Optimizer with background optimisation) had re-saved its original JPEGs afterwards. It now puts those JPEGs back as they are now, as long as they are still images. Restore without "anyway" still warns first, and originals kept in protected storage are still restored byte for byte.
* Change: the check for whether protected files can be downloaded follows WordPress's own setting for requests a site makes to itself (https_local_ssl_verify), like WordPress's built-in checks.

= 1.5.2 =
* Fix: dragging a straight line or arrow from its middle could catch a hidden top or bottom handle and stretch it by millions, after which the design could not be saved. Lines no longer offer those handles, typing a height for a line leaves it unchanged, and no layer can be stretched past 10,000x.
* Fix: when the same design was open in two tabs (or by two people), the later save silently replaced the earlier one. It is now refused with an explanation, and you can save your version as a copy.
* Fix: a tab left open for many hours could no longer save ("Cookie check failed"). The editor keeps its WordPress login token fresh and retries once; if you have been logged out, it says so and keeps your design open.
* Fix: Ctrl+S on a design that was deleted elsewhere now opens "Save as a new design" instead of only showing an error.
* Fix: uninstalling also removes cached file sizes, two temporary settings and photo cut-outs that only design layers used. The FAQ now says that saved designs stay as images but lose their editable layers.

= 1.5.1 =
* Fix: locked layers could still be moved, resized or turned when selected together with other layers. A selection that holds a locked layer now stays put.
* Fix: undo right after cropping a photo on the canvas brought back a hidden copy of the photo and an extra layer. One undo now returns the uncropped photo. Ctrl+Z inside the crop tool cancels the crop; inside the eraser it explains how to paint parts back.
* Fix: the top bar kept saying "Saved" after further edits. It now shows "Unsaved changes", and edits made while a save is uploading are no longer counted as saved.
* Fix: Ctrl + mouse wheel zoomed about 2x per notch. Each notch now zooms about 25%; trackpad pinch is unchanged.
* Fix: at window widths of 1280 px and below, toolbar buttons such as Effects, Position, Crop and Erase showed no icon.
* Fix: at 1024 px and below, the "Create a new design" screen slid under the WordPress menu and covered the editor's top bar.
* Fix: the Design / Optimise switch in the editor looked like plain links.
* Fix: End and Home after double-clicking a word now go to the end or start of the line.
* Fix: an arrow added from the + menu now shows its arrowhead in the settings panel straight away.
* Fix: the colour pop-up's opacity box cut off "100", and the save dialog emptied its title right after saving.
* Fix: notices on the settings page no longer push the page header apart.
* New: "Custom colour…" button next to the current colour, for the full picker with transparency, eyedropper and brand colours.

= 1.5.0 =
* New: "Create a new design" screen with canvas size cards, social media sizes, custom sizes in pixels, inches or centimetres with an aspect-ratio lock, recent designs, saved templates and uploading a photo to start.
* New: save icon (Ctrl+S) that updates a design in place after the first save, a file menu with Save as a copy, New design and Open, and a + menu to add images from your computer or Media Library, text, shapes, lines, arrows, drawings and signatures. Opening a design no longer leaves the editor.
* New: contextual toolbar for text, photos, shapes, lines and multiple selections.
* New: right-click menu, and one set of commands shared by the menu, the toolbar, the layers panel and keyboard shortcuts (Ctrl+A, copy, cut, paste, group, layer order, lock, hide, flip, zoom and more).
* New: layers can be dragged to reorder, renamed, duplicated and deleted from the panel. Locked layers can no longer be changed or deleted.
* New: smart guides and magnetic snapping to the canvas, other layers and equal spacing; rotation snapping with an angle readout; clearer rotation handle and cursors.
* New: crop photos on the canvas; zoom with Ctrl + scroll, trackpad or touch pinch; pan with Space + drag; drop or paste images onto the canvas.
* New: editable text effects (curve, arch, circle, radial, wave, vertical), glow and a rounded text background.
* New: colour picker with transparency, eyedropper, design colours, brand colours and recent colours. Shadows now keep their transparency when you change the colour, and have distance and direction controls.
* New: freehand drawing, signatures, a pixel eraser with restore, photo borders, line arrowheads, and download as PNG, JPG or WebP at 0.5× to 3× with an optional transparent background.
* New: Bulk Optimise redesigned to match the editor, with filters, a photo grid and an actions panel. All existing behaviour (parallel work, safe mode, resume, retries, conflict handling) is unchanged.
* Fix: on the editor and Bulk Optimise screens, WordPress no longer swaps emoji and symbols for images from s.w.org, so these screens make no outside requests in any browser.
* Designs made with earlier versions open and export exactly as before. Nothing new is loaded on public pages.

= 1.4.2 =
* Change: requires WordPress 6.0 or later. WordPress 5.8 and 5.9 lack the image hook used to point existing posts at the converted WebP files.
* Fix: the per-image lock is now a renewable lease with an owner token. Long changes renew it at every step, so a second request can no longer take over an image that is still being changed, and a request can only release its own lock.
* Fix: moving brand fonts and 1.3-era backups into protected storage is now safe to interrupt at any point; leftovers are cleaned up on the next run.
* Fix: an interrupted rebuild of the converted-image list is redone automatically on the next admin page.

= 1.4.1 =
* Security: the plugin now confirms through your real web server that protected files cannot be downloaded, with a "check again" button after you fix it. Protected files can be kept outside the web root with LVIS_PRIVATE_DIR; existing files are moved and checked automatically.
* New: designs can use Media Library images served from a CDN or cloud storage (only the exact addresses WordPress gives for those images), plus optional trusted image hosts (HTTPS, no wildcards).
* Fix: when several images were converted at the same time, some were not switched to WebP on public pages. The list is now rebuilt safely.
* Fix: background conversions that crash PHP now count as an attempt, so they stop after three tries instead of retrying forever; the next run is booked before work starts, so a crash or server restart never stalls the queue.
* Faster: pages with many converted images load their data in one query; archive pages make fewer queries than without the plugin.

= 1.4.0 =
Security, data-safety and performance release. Existing designs, templates, Media Library images and backups keep working.

* Security: designs and templates can only use images from your own Media Library (including media offloaded to a CDN) or hosts you list as trusted. Outside addresses, data: addresses, traversal tricks and symlinks are refused on the server and filtered in the editor, so a template can never make your browser load something from elsewhere.
* Security: templates are now private to their creator. Sharing with the team is explicit and limited to editors and administrators by default. Every read, change and delete checks ownership.
* Security: brand fonts are stored in a protected folder with random names and only served to signed-in users who can use the studio. Fonts uploaded with older versions are moved automatically. Licence notes can be stored with each font.
* Security: originals and backups are moved to a protected folder with random names and deny rules for Apache, LiteSpeed and IIS. Older public backup copies are moved on the next scan. The plugin checks whether the server really refuses these files; on Nginx it shows the rule to add, or the folder can be moved outside the web root with LVIS_PRIVATE_DIR.
* Fix: bulk logos and brightness/contrast now apply to the full-size original, the scaled image and every thumbnail (including cropped ones), so no unmarked copy stays public. Any failure undoes the whole change.
* New: Update this design or Save as a new design when saving an existing design.
* New: background-removal cut-outs no longer create Media Library items unless you tick "Also add to Media Library".
* New: restore checks that files have not changed since Image Studio edited them, warns you instead of overwriting, and offers the original as a download.
* Change: WebP conversion of new uploads is now off until you turn it on, keeps originals by default, keeps copyright and camera details, and converts very large photos in the background with visible status.
* Faster: bulk tools run two to three images at a time with a safe mode, retries and timeouts, resume after the page is closed, and never process the same image twice at once.
* Faster: site fonts and bulk scan sizes are cached and refreshed when they change. Template previews are isolated, so one broken template cannot stall the gallery.
* Faster: no extra database queries on public pages for images that were not converted; archive pages with converted images make fewer queries than before.
* Reliability: background conversions survive crashes and server restarts, never run twice on the same image, and are retried up to three times.

= 1.3.0 =
* New: 28 starter templates for LinkedIn, Instagram, Stories, blogs, YouTube, product promos and website banners, with photo slots.
* New: Save any design as a reusable template.
* New: Outline (hollow) shapes.
* New: Exact width and height for any object, and scaling the whole design to a new size.
* New: Bulk brightness and contrast.
* Improved: Lighter undo history and faster icon and emoji search.

= 1.2.0 =
* New: Redesigned studio, Bulk Optimise and Settings screens.
* New: Shape library with more than 60 shapes, lines, callouts and frames.
* New: More than 2,000 searchable icons.
* New: Every emoji, with search and recently used.

= 1.1.0 =
* New: Bulk Optimise with report, bulk WebP conversion, resizing, logo/watermark and restore.
* New: Background colour remover.
* New: Gradients and colour presets for backgrounds, text and shapes.
* New: Theme fonts, Font Library fonts and brand font uploads.
* New: Arrow lines, double arrows, dashed and dotted strokes.
* Changed: Fonts are now bundled; the plugin makes no external requests.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.5.5 =
Protected files always stay in the uploads folder, and the protection warning is shown whenever blocking cannot be confirmed.

= 1.5.4 =
Fixes the text highlight when Shift+clicking photos in Bulk Optimise. Includes every fix from 1.5.3.

= 1.5.3 =
Fixes saving with long names in non-Latin scripts and titles that showed codes such as &#8217;. Tested with Elementor, WooCommerce, Yoast SEO, Wordfence, Smush and LiteSpeed Cache.

= 1.5.2 =
Stability release: no more unsaveable designs after dragging a line, no silent overwrites from a second tab, and saving keeps working in a tab left open for hours. Recommended for everyone on 1.5.x.

= 1.5.1 =
Fixes found in an end-to-end check of the 1.5 editor: locked layers in a multiple selection, undo after cropping, the save status, mouse-wheel zoom speed and layouts on smaller screens. Recommended for everyone on 1.5.0.

= 1.5.0 =
A big editor upgrade: new design screen, contextual toolbar, right-click menu, smart guides, on-canvas crop, text effects, drawing, signatures and a redesigned Bulk Optimise. Existing designs are unchanged.

= 1.4.2 =
Makes image locks and data migrations safe under long-running jobs and interruptions. Recommended for everyone.

= 1.4.1 =
Recommended for everyone on 1.4.0: fixes WebP switching after parallel conversions and makes background jobs crash-safe. Adds CDN support and server protection checks.

= 1.4.0 =
Important security and data-safety update: private templates, protected backups and brand fonts, complete watermarking, and safer restores. Upload conversion stays on if you had it on, now keeping originals by default.
