=== WPSitePort ===
Contributors: infraacademy
Tags: migration, studio, page builder, visual editor, import
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Import pages built with no-code tools such as STUDIO into WordPress and keep editing them in a visual editor.

== Description ==

WPSitePort copies a published page into WordPress – texts, pictures, videos, fonts and layout for every screen size – and opens it in a no-code visual editor, so you can keep editing the page in WordPress after leaving the no-code tool.

* **Editable import for STUDIO pages.** The page is rebuilt as editor elements with their own styles for each device (desktop, tablet, mobile and every breakpoint the page uses), so texts, pictures and layout can be changed per device, as in STUDIO.
* **Faithful copy for other sites.** The source HTML / CSS is kept and your edits are added on top, so the page looks exactly like the original.
* **Assets are copied.** Pictures, videos and font files are downloaded to this site; internal links are converted to the new addresses.
* **Visual check.** After an import, screenshots of the source and the copy are compared for each device and the differences are shown in the report.
* **Forms keep working.** Contact forms are received by this site: submissions are stored under "Site Migrator → Form submissions". For each form you set, in the admin, what visitors see after sending (a message or a thank-you page), who gets the notification mail and with which subject, and an optional confirmation mail to the sender – with placeholders such as {fields}, {form} and the names of the fields.
* **Visual editor.** Add and arrange boxes, texts, pictures, icons, videos, embeds, loops, carousels and form parts; set hover / appear / scroll styles, scroll animations, click actions, web fonts and per-device visibility; keep a revision history and publish when ready.
* **Or copy as code.** Instead of a page for the visual editor, the copy can be plain HTML, CSS and JavaScript files that read like hand-written code – class names from the page structure, one stylesheet per page grouped by section and screen size – published at the page's address and edited over SFTP / Git or as a ZIP.

Only one page is imported per registration; the plugin does not crawl whole sites.

= Before you copy a site =

Only copy sites that you own or that you have permission to copy and change. The copy form asks you to confirm this. Fonts that are licensed to the source site (for example the TypeSquare / Morisawa fonts STUDIO provides to its own sites) are **never** copied or linked: the imported page keeps the font name and shows the closest open font (Noto Sans JP, Shippori Mincho B1 …). To use the original fonts, subscribe to the font service yourself and add it in the editor (Styles → Web fonts → By name).

This plugin is not affiliated with, endorsed by or sponsored by STUDIO Inc. "STUDIO" is a trademark of its owner.

= Copy as code =

Choose "Copy as: Code" when copying a site to get files instead of an editor page. They look and behave like the visual copy (both are made from the same captured page).

* **Where:** wp-content/vsm-sites/<destination>/ (on multisite: vsm-sites/site-<id>/<destination>/). WordPress serves the folder at the destination address; the HTML follows the page's status (drafts only for editors and preview links).
* **Files:** index.html (class names such as hero__title, indented wherever whitespace does not render); css/style.css (one rule per element class, grouped by section, screen sizes in @media (max-width: …); the layout most elements share is the class "box"; !important only where the carousel / loop script needs it); css/base.css (reset, uploaded fonts); css/source/ (the source stylesheets of faithful copies, in their original order); js/vsm-runtime.js (scroll-in animations, loops, carousels, menus, forms – driven by data-vsm-* attributes); js/main.js (your scripts); assets/ (pictures, videos, fonts); README.md.
* **Editing:** edit the folder on the server, or download it as a ZIP from the project screen (Code), edit it and upload the ZIP – all files, or just the ones you changed. The folder is backed up before each upload (the last 5 backups can be downloaded).
* **Safety:** only files of web types are taken from a ZIP and served (HTML, CSS, JavaScript, pictures, fonts, videos …; never PHP), dot files and paths outside the folder are refused, and uploading needs the manage_options and unfiltered_html capabilities. On Apache, an .htaccess file also keeps scripts from running there.
* Re-importing rebuilds the folder (the previous one stays in the backups). Sites copied as code are not opened in the visual editor.

= Free version and license =

The free version copies one page. It can be opened in the visual editor and changed, but the edits are not saved or published (nor can a site copied as code be updated with a ZIP). With a license from the sales site you copy any number of pages, save and publish your edits, and get updates of the plugin.

Enter the license key under Site Migrator → Settings → License. Activating uses one site of the license; "Release from this site" frees it for another site. The license is checked once a day; if the sales site cannot be reached, the plugin keeps working for the grace period the sales site sets. Published pages never depend on the license or on the sales site.

= Capture worker =

Many no-code sites (including STUDIO) draw their pages in the browser with JavaScript, so the page has to be rendered in a real browser before it can be copied. This is done by the **capture worker**, a separate open-source program that you run yourself – as a Docker container / Node.js service on your own server, or as a Cloudflare Worker in your own Cloudflare account. Enter its URL and shared secret in Site Migrator → Settings. Without a worker, only pages whose HTML already contains the content can be copied.

== External services ==

This plugin connects to the following services. No data is sent anywhere until you start an import or use the features described below.

= The sales site (license) =

When you activate a license, once a day afterwards and when WordPress checks for plugin updates, the plugin sends the license key, a random ID of this installation, this site's address and the versions of the plugin, WordPress and PHP to the WPSitePort sales site (https://wptoollab.site), which issued the license, to check the license and to offer updates. Nothing is sent while no license key is entered. Deleting the plugin releases the site from its license.

= Your capture worker =

When you import a page or run a visual check, WordPress sends the worker the address of the page to copy, the screen widths to capture and – for the visual check – the address of the WordPress preview of the copy. Requests are signed with the shared secret. The worker is run by you (on your server or your Cloudflare account), so the data stays with services you control; if you deploy it on Cloudflare, Cloudflare's terms (https://www.cloudflare.com/website-terms/) and privacy policy (https://www.cloudflare.com/privacypolicy/) apply to that account.

= The site you copy =

The importer downloads the page, its stylesheets, pictures, videos and font files from the address you enter (and the hosts that page loads them from). These requests are made by your server when you start an import.

= Google Fonts =

Google Fonts are used for the fonts you choose in the editor and as open substitutes for licensed fonts.

* In the editor, the font picker and the canvas load font stylesheets and files from fonts.googleapis.com and fonts.gstatic.com in your browser (the font names and, for previews, the sample text).
* On published pages, by default the fonts are copied to this site once (your server downloads them from fonts.googleapis.com / fonts.gstatic.com) and served from this site, so visitors make no requests to Google. If you choose "Load from fonts.googleapis.com" in Settings, visitors' browsers load the fonts from Google instead.

Google Fonts terms: https://developers.google.com/fonts/terms – Google privacy policy: https://policies.google.com/privacy

= Content you add =

Embeds (YouTube, Google Maps …), Lottie animation files, web font services and custom head code that you add to a page load from the services you chose, under their terms.

== Privacy ==

* Form submissions are stored as private posts ("Form submissions") with the page, the form name, the submitted fields and a one-way hash of the sender's IP address (used only for the rate limit), and emailed to the form's notification address. They are included in WordPress's personal data export and erase tools (Tools → Export / Erase Personal Data) by email address. The plugin suggests a paragraph for your privacy policy (Settings → Privacy).
* Published pages load no tracking scripts. Scripts of the source site (analytics, chat widgets …) are not copied; add the ones you need again under the project's custom head code.

== Installation ==

1. Upload the plugin and activate it.
2. Set up the capture worker (see "Capture worker") and enter its URL and shared secret in Site Migrator → Settings. Use "Test connection" to check it.
3. Go to Site Migrator → Copy a site, enter the address of the page to copy and where it should live in this WordPress, confirm that you have the rights to copy it, and start.
4. When the import is done, open the page in the visual editor from the project screen.

== Frequently Asked Questions ==

= Which pages can be imported? =

Published pages that can be opened without logging in. The method is chosen automatically: STUDIO pages are rebuilt as editable elements; other pages are copied faithfully (their HTML / CSS is kept and your edits are applied on top). When the editable import fails, the page is copied faithfully instead.

= Do I need the capture worker? =

For STUDIO and other pages that are drawn with JavaScript, yes. It is a separate program that you run yourself; the plugin never sends pages to a service run by the plugin authors.

= Why does my imported page use a different font? =

Fonts licensed to the source site are not copied. The page shows an open substitute until you add your own subscription to the font service (Styles → Web fonts → By name, with the service's tag in the project's custom head code).

= Will the copied page look exactly like the original? =

Faithful copies usually match to within a fraction of a percent. Editable imports are rebuilt from the page's styles, so small differences (for example in scroll-linked animations or where substitute fonts are wider) can appear; the report shows the difference for each device.

= Where do form submissions go? =

Forms without an action of another service are received by this site: see Site Migrator → Form submissions. Under Form submissions → Form settings you set, for each form, the message or the page shown after sending, the notification addresses (the site administrator when empty) and subject, and whether the sender gets a confirmation mail. Replying to a notification answers the sender. Submissions are limited to 5 per visitor and page per 10 minutes.

= What can the free version do? =

It copies one page and opens it in the visual editor, where you can try every tool; the edits are not saved or published. Enter a license key under Site Migrator → Settings → License to copy more pages, save and publish edits, and get updates.

= How do I delete a migrated site? =

In Site Migrator → Migrated sites, point at the site and click Delete, or tick several sites, choose Delete under Bulk actions and click Apply – as on the Posts screen. Deleting removes the site's published pages, its edit history and copied files (and the folder of a site copied as code) and cannot be undone, so you are asked to confirm. Only administrators (manage_options) can delete sites.

= Can I edit the copy as HTML / CSS / JavaScript? =

Yes: choose "Copy as: Code" when copying the site (see "Copy as code"). The files are published at the page's address; edit them on the server or upload a ZIP of your changes from the project screen.

= The ZIP upload says the file is too large =

The server limits uploads (upload_max_filesize / post_max_size in PHP; the project screen shows the limit). Upload a ZIP of just the files you changed – they update the folder and the other files stay – or edit the folder over SFTP.

= What happens when I uninstall the plugin? =

The plugin's tables, settings and form submissions are deleted. Published pages (WordPress pages), copied files and the folders of sites copied as code (wp-content/vsm-sites) are kept unless the constant VSM_UNINSTALL_REMOVE_FILES is set to true in wp-config.php.

== Changelog ==

= 1.0.0 =
First release.

* Copy a published page into WordPress by its address: texts, links, pictures, videos, web fonts, the layout of every screen size, scroll-in animations, loops and carousels, forms, title / description / OGP. Pages of supported no-code tools become editable elements per device; other pages keep their own HTML / CSS.
* Visual editor: layers, typed style panels (text, box, transform, settings), per-device styles and visibility, hover / appear / scroll styles and animations, click actions, web fonts, undo / redo, revision history, preview and publish.
* Visual check: the source and the copy are compared at three screen widths and the differences are reported.
* Copy as code: plain HTML, CSS and JavaScript files published at the page's address, edited over SFTP / Git or as a ZIP.
* Forms are received by this site, with the message or thank-you page after sending, notification mail and confirmation mail set in the admin.
* Free version: one page can be copied and edited without saving. A license from the sales site unlocks saving, publishing, more pages and plugin updates.
