array( * 'date' => 'YYYY-MM-DD', * 'headline' => 'One-line summary of the release.', * 'items' => array( array( 'title', 'text', 'tier' => ''|'Pro' ), ... ), * ) * * @return array */ public static function releases() { return array( '2.12.1' => array( 'date' => '2026-10-27', 'headline' => __( 'Critical fix: two copies of the plugin can no longer crash your site.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Duplicate plugin copies no longer take the site down', 'ai-siteark' ), 'text' => __( 'If AI-SiteArk and the older “AI-SiteVault” ended up installed and active at the same time (which could happen after a migration), your site could crash with a “Cannot redeclare” error. Now the plugin notices the duplicate, keeps your site running, and shows a notice asking you to remove the extra copy — and a restore no longer brings that second copy along in the first place.', 'ai-siteark' ), ), ), ), '2.12.0' => array( 'date' => '2026-10-25', 'headline' => __( 'Restore & migration, made much safer on large sites.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'A restore can no longer take your site down', 'ai-siteark' ), 'text' => __( 'If a restore is interrupted part-way, your site used to risk a blank white screen. Now it shows a short “being updated” page, your dashboard stays reachable, and the restore keeps finishing in the background — it can’t be knocked over by a plugin whose files aren’t back yet.', 'ai-siteark' ), ), array( 'title' => __( 'Files restored first, database last', 'ai-siteark' ), 'text' => __( 'Your files are now restored before the database. That means if a restore stops during the long file stage, your current site keeps working as it was — and when the database does come in, everything it needs is already in place.', 'ai-siteark' ), ), array( 'title' => __( 'Safer, clearer migrations (Pro)', 'ai-siteark' ), 'text' => __( 'A backup pulled from another site is now fully checked before any restore begins, so a broken transfer can never touch your site. Both sites log the migration so you can see what happened, and if the other site has no backup yet you can ask it to make one and then pull it.', 'ai-siteark' ), ), ), ), '2.11.1' => array( 'date' => '2026-10-24', 'headline' => __( 'Fix: restoring a backup from an older AI-SiteVault site works again.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Fixed: “missing a valid manifest” when restoring across the rename', 'ai-siteark' ), 'text' => __( 'If a site was updated in place from the older AI-SiteVault, its backups were tagged with the old name — and restoring, uploading or pulling one of them into AI-SiteArk (including a site-to-site migration) wrongly failed as “missing a valid manifest.” AI-SiteArk now recognises backups from both names, since they’re the same product.', 'ai-siteark' ), ), ), ), '2.11.0' => array( 'date' => '2026-09-24', 'headline' => __( 'A refreshed, modern look across every AI-SiteArk screen.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'New: redesigned admin interface', 'ai-siteark' ), 'text' => __( 'AI-SiteArk has a cleaner, more modern design — a bold header, clearer tab navigation, tidier cards and tables, and easier-to-read progress while a backup or restore runs. It’s a visual refresh only: everything works exactly as before, in the same places.', 'ai-siteark' ), ), ), ), '2.10.1' => array( 'date' => '2026-09-10', 'headline' => __( 'Big-site reliability: multi-gigabyte migrations and backups no longer stall.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Fixed: large site-to-site migrations no longer stop partway (Pro)', 'ai-siteark' ), 'text' => __( 'Pulling a big backup from another site could stop after about the first gigabyte with “The transfer was interrupted.” The source was throttling its own transfer. It now streams the whole backup straight through, in larger pieces, and keeps going until it is done.', 'ai-siteark' ), ), array( 'title' => __( 'Fixed: backing up a very large site no longer times out while finishing', 'ai-siteark' ), 'text' => __( 'On a large site the final “Finishing…” step could end in a server timeout. That step now runs in small, resumable pieces so it can’t stall. For a single very large archive it finishes the backup without the optional integrity checksum (noted in the backup’s history) rather than failing — turn on “Split archive into parts” in Settings if you want a checksum on every piece.', 'ai-siteark' ), ), ), ), '2.10.0' => array( 'date' => '2026-09-04', 'headline' => __( 'Move a whole site in a couple of clicks, and upload zipped backups.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'New (Pro): migrate straight from another site', 'ai-siteark' ), 'text' => __( 'If both sites run AI-SiteArk Pro, you can now pull a backup directly from one into the other — no exporting, downloading or re-uploading a file by hand. On the old site, create a short-lived migration token (Restore & Migrate → “Let another site pull from here”); on the new site, paste the old site’s address and the token, pick a backup, and it streams straight across, resuming if the connection drops. Tokens are read-only, expire, and can be revoked at any time, and nothing on the new site changes until you confirm the restore.', 'ai-siteark' ), ), array( 'title' => __( 'New: upload a zipped or gzipped backup', 'ai-siteark' ), 'text' => __( 'When restoring from an uploaded file (or a URL), you can now hand AI-SiteArk a `.zip` or `.gz` that contains a backup, not just a raw `.aisv` — it safely extracts the backup for you. Handy when your host or download already compressed the file. Large uploads still resume after a hiccup, and the extraction runs as its own step so it never trips a timeout.', 'ai-siteark' ), ), ), ), '2.8.1' => array( 'date' => '2026-08-15', 'headline' => __( 'The AI-* plugins now sit together in one block in the admin sidebar.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Improved: AI-SiteArk’s place in the admin menu', 'ai-siteark' ), 'text' => __( 'AI-SiteArk used to appear just below Tools, separated from the other AtoZ plugins. Every AI-* plugin now shares one adjacent block directly above Appearance, so they read as one family. No screen address changed — your bookmarks and links still work.', 'ai-siteark' ), ), ), ), '2.4.15' => array( 'date' => '2026-07-16', 'headline' => __( 'AI-SiteArk can no longer take your site down — whatever goes wrong.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Safe mode: a fatal error can never cost you your site', 'ai-siteark' ), 'text' => __( 'If AI-SiteArk ever hits a fatal error while your site is loading — for any reason, not just the missing files 2.4.14 covered — it records what happened and switches itself into safe mode. From the very next request it loads but runs nothing, so your site stays up, and a notice tells you the exact error and how to fix it: reinstall, then deactivate and reactivate to clear safe mode. The worst case is now “backups are paused until you reinstall” — never a site that’s down. This is limited to errors while the site loads: a problem inside a backup or restore job fails only that job and will never silently switch your backups off, and another plugin’s fatal never trips it.', 'ai-siteark' ), ), ), ), '2.4.14' => array( 'date' => '2026-07-16', 'headline' => __( 'Critical: an interrupted update can no longer take your whole site down.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'A half-installed copy can’t crash your site', 'ai-siteark' ), 'text' => __( 'If an update was cut short after WordPress deleted the old plugin folder but before it finished writing the new one — common on shared hosting when the request hits the host’s time limit — AI-SiteArk was left incomplete. WordPress only checks the plugin’s main file, so it loaded it anyway and the first missing class threw a fatal that white-screened the entire site, front end and admin. AI-SiteArk now verifies its own files first: an incomplete copy switches itself off and shows a notice telling you to reinstall, instead of crashing the site. Your backups are never affected.', 'ai-siteark' ), ), array( 'title' => __( 'Updating AI-SiteArk won’t half-install itself', 'ai-siteark' ), 'text' => __( 'With “back up before an update” enabled, updating AI-SiteArk itself ran a full site backup inside the same request WordPress then uses to replace AI-SiteArk’s own folder — so on a host with a hard request limit the update could be killed mid-write. It now skips the pre-update backup only when the plugin being updated is itself (it holds no site data, and reinstalling restores it). Backups still run before every other plugin, theme and core update.', 'ai-siteark' ), ), ), ), '2.4.13' => array( 'date' => '2026-07-16', 'headline' => __( 'New (Pro): OneDrive now prunes old backups and can restore straight from the cloud.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'OneDrive remote retention + restore-from-cloud', 'ai-siteark' ), 'text' => __( 'OneDrive backups are now pruned to your “keep newest N” limit like local and Amazon S3 ones, so off-site storage can’t fill up silently — and the recurring “OneDrive does not support listing backups yet” note is gone. The Restore screen can also list and one-click restore a backup straight from OneDrive. Uploading already worked; this adds listing, downloading and safe pruning via Microsoft Graph. Pruning only ever removes the surplus beyond your keep count, and only files AI-SiteArk put in its own OneDrive backups folder.', 'ai-siteark' ), ), ), ), '2.4.12' => array( 'date' => '2026-07-13', 'headline' => __( 'Critical fix: a migration no longer stalls at “Rewriting site URLs” or leaves the plugin off.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Migrations run to completion', 'ai-siteark' ), 'text' => __( 'When the backed-up site had AI-SiteArk under a different folder name (e.g. “ai-siteark-1”), importing its active-plugins list dropped AI-SiteArk’s real folder — so the next request stopped loading the plugin, the background worker that finishes a restore couldn’t run, and the restore froze near the end with the plugin switched off and permalinks unset. AI-SiteArk now keeps itself active under its real folder after every step of a restore, so it always reaches the finish: permalinks set to “Post name”, plugin still active, no stall. (The 2.4.10/2.4.11 versions of this fix only ran at the very last step, which this kind of migration never reached.)', 'ai-siteark' ), ), ), ), '2.4.11' => array( 'date' => '2026-07-11', 'headline' => __( 'Cleaner restores: no false errors, Post-name permalinks, and a nicer confirm dialog.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'No more false “failed” after a restore', 'ai-siteark' ), 'text' => __( 'A restore keeps running on the server even if the browser tab’s request is interrupted — a timeout, a server restart, or a brief signed-out moment. Before, that showed a “server error 400” and froze near the end even though the restore had actually completed. The Restore screen now checks with the server before giving up: it shows 100% and success when the restore really finished, waits and says so while it’s still working, and only reports an error — with the real reason — when it truly failed.', 'ai-siteark' ), ), array( 'title' => __( 'Permalinks set to “Post name” after a restore', 'ai-siteark' ), 'text' => __( 'Migrated sites often carry a custom, hashed permalink structure (left by a security or obfuscation plugin) that breaks pretty URLs — sometimes hiding a real tag inside the hash, so the old check missed it. A restore now always sets the clean “/%postname%/” structure so posts and inner pages just work. You can still change it afterwards under Settings → Permalinks.', 'ai-siteark' ), ), array( 'title' => __( 'A friendlier restore confirmation', 'ai-siteark' ), 'text' => __( 'The “REPLACE this site with the backup” confirmation now appears as AI-SiteArk’s own on-page dialog instead of the browser’s plain system popup.', 'ai-siteark' ), ), ), ), '2.4.10' => array( 'date' => '2026-07-11', 'headline' => __( 'Fix: AI-SiteArk no longer shows as deactivated after migrating a site.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Stays active after a migration', 'ai-siteark' ), 'text' => __( 'If the site you backed up had AI-SiteArk in a differently-named folder (such as “ai-siteark-1”, which WordPress creates on a double upload), the restored active-plugins list pointed at a folder that isn’t there — AI-SiteArk never duplicates its own folder — so WordPress switched it off with “Plugin file does not exist”. It was always only this plugin, because it’s the only one a restore skips re-writing. A restore now keeps AI-SiteArk active under the folder it’s really installed in and drops the stray entry, leaving every other plugin exactly as restored.', 'ai-siteark' ), ), ), ), '2.4.9' => array( 'date' => '2026-07-11', 'headline' => __( 'Critical fix: migrations no longer sign you out with a 400 at “Rewriting site URLs”.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Stay signed in through a cross-site migration', 'ai-siteark' ), 'text' => __( 'When restoring a backup from another domain, importing the database briefly changed this site’s address to the source site’s URL. WordPress builds your login cookie’s name from that address, so the next request arrived logged-out and the restore stopped with a “server error 400”, usually at the search-replace step. AI-SiteArk now keeps this site’s address pinned to its real URL for the whole restore, so you stay signed in from start to finish — while the old URL is still rewritten everywhere else as normal.', 'ai-siteark' ), ), ), ), '2.4.8' => array( 'date' => '2026-07-11', 'headline' => __( 'Restore, your way: exact-copy restores, a safety backup first, and self-healing permalinks.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Replace all files (exact copy)', 'ai-siteark' ), 'text' => __( 'A restore normally adds and overwrites the files in your backup but leaves anything not in it in place — so a plugin or theme that only exists here survives. The Restore screen now has an opt-in “Replace all files” checkbox that first empties the folders being restored (uploads, themes, plugins, must-use plugins) so the site becomes an exact copy of the backup, removing whatever isn’t in it. It’s off by default and clearly marked irreversible; WordPress core, your stored backups and AI-SiteArk itself are always kept, and it respects your “What to restore” selection.', 'ai-siteark' ), ), array( 'title' => __( 'Back up the current site before restoring', 'ai-siteark' ), 'text' => __( 'A new opt-in checkbox on the Restore screen takes a full backup of the site as it is now, then only starts the restore once that backup has finished — so a restore that goes wrong can be rolled straight back. If the safety backup fails, the restore is cancelled and your current site is left untouched.', 'ai-siteark' ), ), array( 'title' => __( 'Permalinks that don’t break after a restore', 'ai-siteark' ), 'text' => __( 'If a restored backup carried a custom “tagless” permalink structure (for example a hashed one like “/{e59df6…}/” left by a security plugin), every post used to resolve to the same URL and the site returned 404s. A restore now detects a structure with no real permalink tag and safely falls back to “Post name”, with nothing to fix by hand. Normal and “Plain” structures are left exactly as they were.', 'ai-siteark' ), ), ), ), '2.4.7' => array( 'date' => '2026-07-11', 'headline' => __( 'Fix: uploading a backup to restore no longer gets stuck at 0% on tight hosts.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Backup uploads now fit your host', 'ai-siteark' ), 'text' => __( 'The uploader used a fixed 5 MB chunk, which many hosts reject (they cap uploads at 2 MB), so uploads stalled at 0%. It now sizes each chunk to what your server actually accepts, and if a chunk is still too big it tells you the host limit instead of failing silently.', 'ai-siteark' ), ), ), ), '2.4.6' => array( 'date' => '2026-07-11', 'headline' => __( 'Fix: a restore could leave a duplicate copy of AI-SiteArk on the Plugins screen.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'No more duplicate plugin after a restore', 'ai-siteark' ), 'text' => __( 'A restore now skips every copy of AI-SiteArk — the installed one and any “ai-siteark-1” style variant a backup might contain — so it can never drop a second copy beside the one you’re running. Your other plugins still restore as normal. If you already see two, keep the newer one and delete the older folder; backups and settings are shared, so nothing is lost.', 'ai-siteark' ), ), ), ), '2.4.5' => array( 'date' => '2026-07-10', 'headline' => __( 'Rebuild a dead site with no WordPress — a one-click recovery installer.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Recovery installer for a bare server', 'ai-siteark' ), 'text' => __( 'Download it from Help & guide, upload it with your .aisv backup to a new or broken server, open it in a browser, and give it an empty database and the new address. It imports the database, extracts your files, fetches the matching WordPress core, rewrites every URL, and writes wp-config.php — no working WordPress required. Encrypted and split backups supported.', 'ai-siteark' ), ), ), ), '2.4.4' => array( 'date' => '2026-07-10', 'headline' => __( 'Recover a backup without WordPress, back up before updates, restore from the cloud, and slimmer backups.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Open a backup without WordPress or this plugin', 'ai-siteark' ), 'text' => __( 'A new tools/aisv-extract.txt script unpacks any .aisv archive into a database.sql and a files/ folder using just PHP — so a backup is recoverable even if WordPress is gone. See the Help & guide page.', 'ai-siteark' ), ), array( 'title' => __( 'Back up right before an update', 'ai-siteark' ), 'text' => __( 'Turn on a snapshot taken immediately before a core, plugin or theme update — the copy you want if the update breaks something.', 'ai-siteark' ), 'tier' => 'Pro', ), array( 'title' => __( 'Restore straight from the cloud', 'ai-siteark' ), 'text' => __( 'The Restore screen lists the backups on your connected destination; one click downloads and restores one, with no manual re-upload. Available now for FTP/SFTP and Amazon S3.', 'ai-siteark' ), 'tier' => 'Pro', ), array( 'title' => __( 'Remote retention', 'ai-siteark' ), 'text' => __( 'Old backups on a cloud destination are pruned to the same keep-newest-N limit as local ones, so off-site storage never fills up silently.', 'ai-siteark' ), 'tier' => 'Pro', ), array( 'title' => __( 'Slim down the database, and a disk-space check', 'ai-siteark' ), 'text' => __( 'Optionally skip post revisions, transients and spam comments, or exclude whole tables. Backups and restores also now check free disk space up front instead of failing halfway.', 'ai-siteark' ), ), array( 'title' => __( 'Restores survive a closed tab', 'ai-siteark' ), 'text' => __( 'A restore now keeps going on the server even if you close the browser, and the Restore page has a “Resume now” button for hosts that block background requests.', 'ai-siteark' ), ), ), ), '2.4.3' => array( 'date' => '2026-07-10', 'headline' => __( 'Permalinks now just work after a migration — no more “save permalinks” step.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Fix: posts and inner pages 404 after migrating a site', 'ai-siteark' ), 'text' => __( 'After restoring a backup from another site, WordPress was still using the destination site’s old rewrite rules while the restored site’s permalink structure was in place, so links 404’d until you opened Settings → Permalinks and pressed Save. AI-SiteArk now rebuilds the rewrite rules (and the WordPress block in .htaccess) automatically at the end of every restore.', 'ai-siteark' ), ), ), ), '2.4.2' => array( 'date' => '2026-07-10', 'headline' => __( 'Migrating a backup from another site now finishes instead of stopping at “Backup file not found.”', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Fix: restore stopped near the end with “Backup file not found.”', 'ai-siteark' ), 'text' => __( 'Your backups folder is named after a value stored in the database. When a restore imported the backup’s database, the folder quietly took on the other site’s name — so the restore lost track of its own progress and of the archive it was reading. The folder is now held fixed for the whole restore.', 'ai-siteark' ), ), array( 'title' => __( 'Backups that “disappeared” after a failed restore come back', 'ai-siteark' ), 'text' => __( 'If an earlier restore stranded your backups and recovery points in an old folder, AI-SiteArk now finds and re-adopts them automatically.', 'ai-siteark' ), ), ), ), '2.4.1' => array( 'date' => '2026-07-10', 'headline' => __( 'Restore fixes — no more 503 errors, and your site never gets stuck in maintenance mode.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Fix: restore failed with a 503 and left the site “briefly unavailable”', 'ai-siteark' ), 'text' => __( 'Starting a restore used WordPress’s own maintenance file, which blocks every request — including the dashboard and the restore’s own background steps — so the restore stopped immediately and the site was locked out for 10 minutes. Visitors are now shown a maintenance page by AI-SiteArk itself, while your dashboard and the restore keep working normally.', 'ai-siteark' ), ), array( 'title' => __( 'Fix: a restore could sign you out halfway through', 'ai-siteark' ), 'text' => __( 'Restoring the database replaces the users table, which could invalidate your login mid-restore and strand the job just before it finished. Your session is now carried across the restore, so it runs to completion.', 'ai-siteark' ), ), ), ), '2.4.0' => array( 'date' => '2026-07-08', 'headline' => __( 'A clearer off-site setup, a Basic vs Pro split, and this What’s New screen.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Redesigned off-site destinations', 'ai-siteark' ), 'text' => __( 'Settings → Destinations now lets you pick a Primary and an optional Secondary destination, and choose how they’re used: “Failover” (try the primary, fall back to the secondary) or “Send to both” (upload every backup to both for redundancy). Connect Google Drive, OneDrive, Dropbox, Amazon S3 or FTP once, and they become selectable above.', 'ai-siteark' ), 'tier' => 'Pro', ), array( 'title' => __( 'Basic vs Pro, made clear', 'ai-siteark' ), 'text' => __( 'Every screen now shows what’s included free and what’s Pro, with an upgrade prompt where a Pro feature would be. Free keeps unlimited manual full-site backups, restore, migration, local storage and encryption; Pro adds scheduling, off-site upload, incremental backups, recovery points, notifications, role-based access and the full audit trail.', 'ai-siteark' ), ), array( 'title' => __( '“What’s New” screen', 'ai-siteark' ), 'text' => __( 'This page. Every AI-SiteArk update now lists exactly what changed, version by version, right inside your dashboard — and a one-time banner points you here after each update so you never miss a new feature.', 'ai-siteark' ), ), array( 'title' => __( 'Audit log: free recent view, Pro full trail', 'ai-siteark' ), 'text' => __( 'The Activity & tasks log now shows the recent activity on the free plan; Pro unlocks the full 300-event audit trail with the user’s IP address for each action.', 'ai-siteark' ), 'tier' => 'Pro', ), ), ), '2.3.8' => array( 'date' => '2026-07-07', 'headline' => __( 'See where each backup is stored, right in the Restore list.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Destination shown per backup', 'ai-siteark' ), 'text' => __( 'The Restore & Migrate list now shows each backup’s destination (local server, Google Drive, S3, …) so you can tell at a glance where a copy lives before you restore it.', 'ai-siteark' ), ), ), ), '2.3.7' => array( 'date' => '2026-07-07', 'headline' => __( 'A new Activity & tasks page — an audit log and a running-task manager.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Audit log (who / what / when)', 'ai-siteark' ), 'text' => __( 'A dedicated Activity & tasks page records who did what and when — backups, restores, settings changes, and cloud connect/disconnect.', 'ai-siteark' ), ), array( 'title' => __( 'Running-task manager', 'ai-siteark' ), 'text' => __( 'See what’s running right now and Cancel, Pause or Resume a backup or upload — or clear a stuck restore — without leaving the page.', 'ai-siteark' ), ), ), ), '2.3.5' => array( 'date' => '2026-07-07', 'headline' => __( 'Back up all of wp-content, so nothing is silently left out.', 'ai-siteark' ), 'items' => array( array( 'title' => __( 'Complete wp-content backup', 'ai-siteark' ), 'text' => __( 'Backups now include everything under wp-content — languages, drop-ins and any custom folders — via the “Other wp-content” option, closing the gap that made an AI-SiteArk archive smaller than a full-site export.', 'ai-siteark' ), ), ), ), ); } /** * The newest release version in the history. * * @return string */ public static function latest_version() { $versions = array_keys( self::releases() ); return $versions ? (string) $versions[0] : ''; } /** * Version the user has already acknowledged ('' if never). * * @return string */ public static function seen_version() { return (string) get_option( self::SEEN_OPTION, '' ); } /** * Whether there are release notes newer than what the user has seen. * * @return bool */ public static function has_unseen() { $latest = self::latest_version(); if ( '' === $latest ) { return false; } $seen = self::seen_version(); return '' === $seen || version_compare( $latest, $seen, '>' ); } /** * Mark the latest release as seen. * * @return void */ public static function mark_seen() { update_option( self::SEEN_OPTION, self::latest_version(), false ); } /** * Add the What's New submenu (with an "unseen" bubble when applicable). * * @return void */ public function menu() { $label = __( 'What’s New', 'ai-siteark' ); if ( self::has_unseen() ) { $label .= ' '; } add_submenu_page( 'ai-siteark', __( 'What’s New', 'ai-siteark' ), $label, Capabilities::MANAGE, self::SLUG, array( $this, 'render' ) ); } /** * Render the What's New page. Viewing it clears the "unseen" state. * * @return void */ public function render() { if ( ! current_user_can( Capabilities::MANAGE ) ) { wp_die( esc_html__( 'You do not have permission to view this page.', 'ai-siteark' ) ); } $aisiteark_releases = self::releases(); self::mark_seen(); require AISITEARK_DIR . 'admin/views/whats-new.php'; } /** * One-time notice on AI-SiteArk screens after the plugin is updated. * * @return void */ public function upgrade_notice() { if ( ! current_user_can( Capabilities::MANAGE ) || ! self::has_unseen() ) { return; } // Only on AI-SiteArk screens, and never on the What's New page itself. $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( ! $screen || false === strpos( (string) $screen->id, 'ai-siteark' ) ) { return; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( self::SLUG === ( isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '' ) ) { return; } $view = admin_url( 'admin.php?page=' . self::SLUG ); $dismiss = wp_nonce_url( add_query_arg( 'action', 'aisiteark_dismiss_whats_new', admin_url( 'admin-post.php' ) ), 'aisiteark_dismiss_whats_new' ); echo '

'; printf( /* translators: 1: version, 2: What's New link, 3: dismiss link. */ wp_kses_post( __( 'AI-SiteArk updated to %1$s. See what’s new or dismiss.', 'ai-siteark' ) ), esc_html( self::latest_version() ), esc_url( $view ), esc_url( $dismiss ) ); echo '

'; } /** * Dismiss the update notice (mark latest as seen), then go back. * * @return void */ public function handle_dismiss() { if ( ! current_user_can( Capabilities::MANAGE ) ) { wp_die( esc_html__( 'You do not have permission to perform this action.', 'ai-siteark' ) ); } check_admin_referer( 'aisiteark_dismiss_whats_new' ); self::mark_seen(); wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'admin.php?page=ai-siteark' ) ); exit; } }