# SleekRank 2.0: Safer Data Sources and Faster Page Groups

SleekRank 2.0 is a major release built on the new shared foundation of every
SleekWP plugin. Remote data sources are handled more safely, large page groups
open quickly, generated pages render more precisely, and page groups move into
SleekRank's own database table.

## Safer remote data

- JSON URL, CSV URL and REST API sources fetch only addresses WordPress accepts
  as safe, so an address in a private or local network is refused unless the
  `http_request_host_is_external` filter allows its host.
- A REST API source sends only GET or POST, the methods its editor offers.
- A data source's authentication token is never shown again once saved; leave
  the field blank to keep it. A saved Google Sheets API key is no longer sent
  back to the browser, and Agent Sync files no longer carry tokens or request
  headers.
- A CSV file that is missing or outside the theme fails the reload instead of
  emptying the page group, and quoted CSV cells may span lines.

## Large page groups open quickly

The Data view and the preview read a page group's rows fifty at a time and
search them on the server, so groups with many rows open quickly. Reload Data
and `wp sleek rank reload` now report a failing data source instead of success,
and say how many rows were skipped because an earlier row has the same slug.

## More precise generated pages

- Generated pages name themselves in their canonical and `og:url`, not the
  base page.
- Block markup in the base page is rendered on generated pages, and a page
  group can build on a draft or private base page.
- Class selectors match whole class names only, replacements land inside the
  matched element, and attribute mappings use WordPress's HTML API.
- A single-segment URL that is not an item of a page group falls through to
  WordPress instead of returning a 404.
- Sitemap URLs end as the site's permalinks do, and rows without a slug no
  longer appear in the sitemap.

## Page groups for your own code

New [PHP functions](/docs/rank/php-functions.md) list, read, create and update
page groups, such as `sleek_rank_get_page_group_by_slug()` and
`sleek_rank_create_page_group()`. Two new filters join them:
`sleekRank/output/canonical` changes a generated page's canonical URL, and
`sleekRank/data/relatedItem` changes an item `sleek_rank_related_items()`
lists.

## Its own table

Page groups are kept in SleekRank's own database table instead of as posts,
with the same IDs and slugs, so their generated URLs, sitemaps, previews and
every saved reference keep working. The update moves them and the data source
credentials once. They are no longer part of WordPress's **Tools > Export**
file; Agent Sync's files in your theme and `wp sleek rank page-group get` keep
a copy of each page group.

## A rebuilt workspace

- A rebuilt administration application.
- A **Docs** page after License holds the documentation inside the workspace.
- **Settings** holds the AI provider keys, shared with every SleekWP plugin on
  the site. The built-in AI chat and chat sharing are retired.
- A light, dark and system theme selector in the header replaces the
  Appearance page.

## Before you update

SleekRank 2.0 requires **PHP 8.2 and WordPress 6.9**. A site below either keeps
its current release, so the updater never moves it. Stored API keys are now
encrypted with a key unique to your site, which means rolling back to an
earlier version needs them entered again. On the command line,
`wp sleek rank page-group create` now requires `--url-pattern` and creates a
draft unless `--status` says otherwise. As with any major release, back up your
database and files first, because downgrading after the migration is not
supported.

The full list of changes is in the [changelog](/rank/changelog/), and the
[SleekRank docs](/docs/rank.md) cover every feature.
