=== Clearyvo Site Backup ===
Contributors: kishollo001
Tags: backup, images, miniatures
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.7.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WordPress backups in small, resumable steps, with a site size report, Full / Compact / Structure types and a standalone restorer.

== Description ==

Part of the Clearyvo plugin family: focused plugins that each check one part of your site and share one "Site Toolkit" menu with a Site health score. The Site Toolkit plugin has every checker in one plugin, switched on one by one; when it is installed, this plugin's settings and results are shared with it. More at wp-sitechecker.com.

== Installation ==
1. Install ZIP via Plugins > Add New > Upload Plugin.
2. Open Site Backup in the admin menu: under Site Toolkit when another Site Toolkit plugin is active, otherwise as its own menu item (on multisite: Network Admin, network-activate the plugin).
3. Optionally measure the site, choose Full (recommended), Content + compact media or Structure, then create the backup.
4. Download the backup and keep an independent off-site copy.

== Important limitations ==
Test on staging sites until validated on your hosting stack.
Restore with the restorer (Site Backup page, step 5): a single PHP file with the site's restore key built in. Upload it with the archive into the site folder, open it in the browser, enter the key. It checks the archive (CRC of every file), restores the files and the database in small steps, changes the address and the table prefix when the site moves (serialized data too), points wp-config.php to the database, and deletes itself at the end. With SSH: wp backupchecker restore <archive.zip>. Archives re-packed on a Mac (subfolder, __MACOSX) are accepted.
Miniature generation needs an image editor (GD or Imagick). PHP must be 64-bit with the hash and zlib extensions. ZipArchive is optional (used for the final verification).
The backup runs in short steps. While the plugin page is open the browser drives it; in the background WP-Cron continues it (for reliable unattended backups configure a real server cron that calls wp-cron.php). If it stops, press Resume; Cancel discards it.
The backup is not a consistent snapshot: the site keeps running while files and tables are read. Use maintenance mode for critical backups.
Backups contain wp-config.php and password hashes. They are stored in wp-content/backupchecker-private-<random>. Apache and IIS rules are written automatically; on Nginx add an explicit deny rule or move backups out of the web root.
Excluded by default: wp-content/cache, upgrade, updraft, ai1wm-backups, backups, and the archive folders of other backup plugins (JetBackup, BackWPup, WPvivid, Duplicator, Backup Migration, BackupBuddy, WP Staging). Compact and Structure also leave out the original copies kept by Imagify (uploads/backup) and ShortPixel (uploads/ShortpixelBackups). Change with the wbc_exclude_paths filter. Only files below the WordPress root folder (ABSPATH) are included.
Files that vanish or are unreadable during the backup are skipped; the backup is still published and the skipped files are listed in wbc-complete.json inside the archive (and counted in the backup list).
Tables without a primary or unique key are exported in a plain order; rows changed during the backup may be duplicated or missed there (listed in wbc-complete.json).
Miniatures apply only to jpg/png/webp files in the uploads folder (max. 640 px, irreversible). A file is only replaced when the reduced copy is smaller. Animated, very large or very memory-hungry images are stored unchanged. Every reduced file is listed in wbc-shrunk.jsonl.
"Exclude regenerable thumbnails" leaves out generated size files (name-300x200.jpg) whose original (name.jpg) is in the same folder and whose pixel size matches the file name. They are listed in wbc-excluded-thumbnails.txt. Regenerate thumbnails after a restore.
On multisite the backup covers the whole network and is available to super admins only.
Uninstalling keeps finished backups. To remove everything, define WBC_REMOVE_DATA_ON_UNINSTALL as true in wp-config.php before deleting the plugin.
Structure, Compact and any custom rule that leaves out or reduces something produce a REBUILD copy, not a disaster-recovery backup. Keep a complete server-level backup (host snapshots, JetBackup or similar) for that.
Poster frames need ffmpeg (checked automatically); WebP needs an image editor with WebP support. Both options are disabled when unavailable.
Media-only incremental sets compare size and modification time with an index kept in the protected backup folder. Deleting or losing an earlier media set does not reset it; use "Forget media history" to include every file again. Attachment IDs in the manifest are read from the main site's media library.
The size report and its estimates are approximate; the database figure is the size on disk.

== Archive format ==
wordpress/...                       site files (ABSPATH relative)
schema/<urlencoded table>.sql       SHOW CREATE TABLE output
database/<urlencoded table>/NNNNNNNN.json   JSON array; each item = base64( PHP serialize( row ) ), in primary-key order
wbc-manifest.json, wbc-complete.json, wbc-shrunk.jsonl (miniature mode), wbc-excluded-thumbnails.txt (if used)
The archive is a standard ZIP (ZIP64 where needed) written by the plugin itself, so it opens with any unzip tool.

== Free and Pro ==
Everything in this plugin is free. Clearyvo Pro is one add-on for the Pro features of the whole family (image optimisation, AI ALT texts, alerts by email, white-label reports); this checker has none of its own.

== Frequently Asked Questions ==

= What is the /wp-json/clearyvo/v1/app/ address? =
A read-only REST route for the Clearyvo Site Inspector Mac app. It shows the Site health score of the Clearyvo plugins to a signed-in administrator (for example with a WordPress Application Password) and changes nothing. It sends nothing anywhere: the app asks, the site answers.

== Changelog ==
= 1.7.5 =
* Shared Clearyvo framework 2.3.1: the SEO checker is listed as Clearyvo SEO (formerly Image Alt & SEO) everywhere, whichever Clearyvo plugin loads the framework.

= 1.7.4 =
* Database: every query goes through $wpdb->prepare(), with %i placeholders for table and column names.
* Request handlers check their nonce where they read the request.

= 1.7.3 =
* New icons: one design for the whole Clearyvo family, with a colour per group of checkers.

= 1.7.2 =
* The other checkers in the shared menu have their new names (SSL Checker, Security Checker, Indexing Checker and the rest).

= 1.7.1 =
* The plugin links point to wp-sitechecker.com again, until the site has moved to clearyvo.com.

= 1.7.0 =
* New: read-only connection for the Clearyvo Site Inspector Mac app (Site health as data, for administrators with an Application Password).

= 1.6.1 =
* Links to the new home of the Clearyvo WordPress plugins: clearyvo.com/wordpress.

= 1.6.0 =
* First release under the Clearyvo name (folder and text domain: clearyvo-site-backup). Settings and results of the earlier versions are kept; activating this plugin switches the earlier copy off.
