=== Morphic – Adaptive Content Engine ===
Contributors: pinxton
Tags: custom fields, custom post types, headless, rest api, meta box
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 2.7.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Custom fields, custom post types and relations in a visual builder. A fast ACF alternative with a REST API for headless sites.

== Description ==

Morphic is a custom fields and custom post types plugin that turns WordPress into a content platform, and a fast alternative to Advanced Custom Fields (ACF), Pods and Meta Box. Design content models in a visual builder, write in a clean editor, show entries on your site with your own theme, and read everything from a REST API. Content lives in Morphic's own indexed tables, not post meta, so lists, filters and searches stay fast with hundreds of thousands of entries.

Everything below is included, with no limits on models, entries, fields, pages, languages, API keys or webhooks.

= What people build with Morphic =

**Everyday websites**

* A blog or magazine with authors, categories, reading time and SEO fields, shown by your theme.
* A restaurant menu, a team page, testimonials, FAQs and opening hours, edited by people who never touch code.
* An events calendar with dates, venues, ticket links and "sold out", sorted and filtered instantly.
* A real estate site with listings by price, city and rooms, each with its own page and photo gallery.
* A recipe collection with ingredients, steps, cooking times and servings.
* A job board, a course catalogue, a portfolio, a documentation site with pages in a tree.

**Business and shops**

* A product catalogue or spec database next to WooCommerce, with extra fields on products and fast filters.
* A directory of members, dealers, clinics or partners, searchable and filterable by any field.
* Site-wide settings pages: contact details, footer text, announcement bars, read with one function.
* Multilingual content in as many languages as you need, following Polylang or WPML.

**Headless and apps**

* The content backend for a Next.js, Nuxt, Astro, Svelte or mobile app, with an OpenAPI document and TypeScript types.
* A small API for your app: API keys that read, or read and write, limited to chosen models.
* Signed webhooks that tell your other systems about every change, in order.

**For plugin and theme developers**

* A data layer for your own plugin: define models in PHP with `morphic_define()` and read and write with `morphic_query()`, `morphic_create()` and `morphic_update()`. No custom tables to write or migrate.
* Fields on posts, pages, products, users and terms that filter with real indexes instead of slow meta queries.
* A drop-in move away from post meta: import custom post types and ACF fields in one step, with a speed report on your own content.

**Dynamic data storage**

* Form submissions, leads, bookings or survey answers stored as typed entries with an API.
* Logs, audit trails and change feeds your other systems can follow.
* Product feeds, price lists and stock data synced from outside systems through the REST API.
* Anything that changes shape over time: add fields to a live model and existing entries upgrade as they are read.

= What you get =

* Visual model builder with text, rich text, numbers, dates, options, media, galleries, links, colours, embeds, maps, WordPress links and more.
* Relations, components, dynamic zones, parents and trees.
* Editor with drafts and publishing, bin, translations and keyboard save.
* Filters, sorting, unique values and full-text search, kept current on every save.
* REST API with cursor paging, expand, idempotency keys, an OpenAPI document and TypeScript types.
* API keys that read, or read and write, limited to chosen models.
* Signed webhooks for every change, in order.
* Access per model for every WordPress role, and hashed password fields.
* Website pages for every entry and list, shown with your theme: block themes and classic themes, with your header, footer and layout.
* Works with SEO plugins, sitemaps, menus and site search through optional WordPress mirror posts, with get_post_meta() support.
* Fields on posts, pages, products, users and terms, filtered by Morphic instead of slow meta queries.
* Settings pages for site-wide values.
* Import from WordPress custom post types and ACF, with a speed report on your own content.
* JSON import and export.
* Unlimited languages, following Polylang or WPML when active.
* Shortcodes [morphic_list], [morphic_entry] and [morphic_field], and a block binding source for block themes.
* PHP API for themes and other plugins: morphic_define, morphic_query, morphic_get, morphic_create, morphic_update, morphic_setting and the Morphic\Morphic class.
* Built-in help center, command palette and dark mode.

= Speed =

Measured on 10,000 articles from 50 authors, median of 30 runs on PHP 8.5, caches emptied before every read:

* 20 newest published articles: WordPress posts with meta 61.2 ms, Morphic 0.37 ms.
* Count and total price for 10 authors: WordPress 187 ms, Morphic 19.6 ms, Morphic Pro 0.67 ms.
* 20 articles over HTTP, full response: WordPress REST 16.4 ms, Morphic REST 11.8 ms, Morphic Pro fast endpoint 3.7 ms.

= Morphic and Morphic Pro =

Morphic, this plugin, is complete on its own. Morphic Pro is a separate add-on for teams and growing sites, sold at https://morphicwp.com:

* Free: unlimited models, entries, fields, languages, website pages, API keys and webhooks; the REST API; the editor; website pages in any theme; SEO and sitemap support; fields on WordPress content; import from WordPress and ACF; JSON import and export; the PHP API.
* Pro adds team work: approval workflow with a review queue, comments with mentions and assignments, field-level permissions, history with compare and restore, and an audit log.
* Pro adds translation workflow: missing and outdated translations per language, side-by-side translating and XLIFF files for translators.
* Pro adds speed and scale: a fast endpoint that skips the WordPress bootstrap, live views with counts and sums, a key-value store and batch transactions.
* Pro adds site building and operations: Gutenberg blocks, ACF compatibility, bulk edit, more model templates, model sync between sites, API key permissions and rate limits, a webhook delivery log with replay, scheduled publishing, CSV import and export, and scheduled exports by email.

= Privacy and external services =

Morphic does not contact any external service on its own and collects no data. Webhooks send change notifications only to the addresses you enter in Settings → Webhooks. Links to https://morphicwp.com appear only on Morphic's own admin screens.

= Source code =

The admin app is plain JavaScript modules shipped as written, with no build step. The plugin source is included in full.

== Installation ==

1. In WordPress, go to Plugins → Add New, search for "Morphic" and click Install, then Activate.
2. Open Morphic in the admin menu.
3. Under Models, start from a template (Blog, Product catalog or Events) or create your own model.
4. Add a few entries under Content.
5. To show entries on your site, open the model, go to Advanced → Website pages, switch it on and choose an address such as "journal".
6. To read content from an app, open API & integration and copy a ready-made request. Public models need no key; give Read to Everyone in the model's Access tab.
7. Coming from ACF or custom post types? Open Import from WordPress and import them in one step.

== Frequently Asked Questions ==

= Is it really free without limits? =

Yes. Models, entries, fields, website pages, languages, API keys and webhooks are unlimited. Morphic Pro adds separate features; it does not unlock anything in this plugin.

= Does it work with my theme? =

Yes. Entry pages and lists use your theme's own templates, header and footer, in block themes and classic themes. Block themes can design them in Appearance → Editor → Templates.

= Does it work with Yoast, Rank Math and sitemaps? =

Yes. Switch on "Show in WordPress" in a model's WordPress tab. Each published entry gets a lightweight mirror post that SEO plugins, sitemaps, menus and site search include.

= Can I move from ACF? =

Yes. Import from WordPress turns custom post types and their ACF fields, including repeaters, flexible content, relationships and galleries, into Morphic models. Your posts are not touched.

= Does it use custom post types? =

No. Morphic stores content in its own database tables. Mirror posts for SEO plugins are optional.

= How do I authenticate API requests? =

Public models need no authentication. For private models, create an API key in Settings → API keys and send it in the X-Morphic-Key header, or use WordPress application passwords.

= Can other plugins use Morphic? =

Yes, through the PHP API. Define models with morphic_define() and read and write with morphic_query(), morphic_create() and morphic_update(). It does not check permissions; the calling plugin does.

= Why is a filter refused with no_access_path? =

The field has no index. Turn on "Filter by this field" for it, or add a combined filter that covers it. This keeps every list fast.

= What happens on a conflict? =

The API returns 409. Read the entry again, then retry the write with the new revision number.

= Is my data lost if I remove a field? =

No. Values stay in the database and come back if you add the field again.

= Does deleting the plugin erase my content? =

No. Deleting Morphic removes only its scheduled job, its cached transients and its version record, and leaves the Morphic database tables and all entries in place.

= Is it multilingual? =

Yes. Add as many languages as you need in Settings → Languages and mark fields as translatable. Morphic follows Polylang or WPML on your site.

= Does it work on multisite? =

Yes. Each site has its own models and content.

= Where is the documentation? =

Inside the plugin: open Morphic → Help & docs for a guide to every feature.

== Screenshots ==

1. Home dashboard with every model, its entry count and quick links.
2. Product content list with sortable columns for each field.
3. Entry editor for a product with its fields and rich text description.
4. Model fields tab showing each field's type and API name.
5. Access tab for choosing who can read, create, edit and delete.
6. API and integration page with ready-to-copy request snippets.

== Changelog ==

= 2.7.6 =
* Fixed the API and Settings screens showing a broken Fast endpoint address.
* Removed entry history code from the free plugin; history remains part of Morphic Pro.
* Added the banner and screenshots.

= 2.7.5 =
* Updates from WordPress.org now run the setup routine once (database tables, scheduled task, rewrite rules) so a new version never needs a manual reactivation.
* Removing the plugin now clears its scheduled tasks and cached data and keeps your entries and tables.

= 2.7.4 =
* Requests that send a list where a single value is expected (search, cursor, filters) now return a clear error instead of PHP warnings.
* Importing a file that is not a Morphic export, or saving a non-numeric history period, is now rejected with an error.

= 2.7.4 =
* Fixed creating a model in the admin, which failed while typing the name.
* Fixed saving entries and loading related content on sites that use plain permalinks.

= 2.7.0 =
* The admin and the plugin screens are now translated into all 24 official EU languages and follow each user's WordPress language.

= 2.6.7 =
* Security: hidden and translated hidden fields, unpublished related entries and internal user ids are no longer returned to visitors.
* Security: checking a hashed secret is limited to 10 tries per 5 minutes and respects publishing.
* Security: password-protected posts are imported as drafts, attached fields check access to the item they belong to, and secret fields can no longer be nested or indexed.
* Security: database and server errors are no longer shown to API callers, page titles and post meta are escaped or filtered, and admin requests cannot be redirected to other API paths.
* Performance: long archive page numbers, large WordPress link lists and import benchmarks no longer do unbounded work.

= 2.6.6 =
* Unpublished entries stay hidden from visitors when lists are filtered by parent and in related-entry lookups.
* Content inside [morphic_entry] and author names from the_author are escaped on output.

= 2.6.5 =
* The admin app works on phones again: the content area no longer collapses to zero width.
* Settings tabs scroll to the open tab, and two-column cards stack on small screens.

= 2.6.4 =
* Requires WordPress 6.9 or newer.

= 2.6.3 =
* On PHP older than 8.0 the plugin pauses itself and shows a notice instead of breaking the site.
* Background work no longer waits for other sites that share the same database server.
* Tested on PHP 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5.

= 2.6.2 =
* Uses the faster built-in PHP functions when the site runs PHP 8.1, 8.4 or 8.5, and keeps working on PHP 8.0.

= 2.6.1 =
* Runs on PHP 8.0 again.
* Fields attached to posts, users and terms are sanitized field by field, and saving them always needs a valid nonce.
* The Morphic menu now sits below the WordPress menus.
* Scripts and styles load only on the screens that use them.

= 2.6.0 =
* Export as Parquet in the model menu (with Morphic Pro).
* Add-ons can rebuild their indexes in larger batches.
* Help guide for facets covers sums, groups, speed settings and Parquet.

= 2.5.2 =
* Faster rebuilds for add-ons that index entries in batches.

= 2.5.1 =
* The Views tab in a model opens the views editor when Pro is licensed.

= 2.5.0 =
* Date ranges in morphic_query() and in shortcode lists now filter correctly.
* Ticked checkboxes are visible again in the app.
* New help guide for Pro facets.

= 2.4.1 =
* New help center with a starting path, topic pages and an outline for every guide.

= 2.4.0 =
* Website pages render through your theme's own templates, in block and classic themes.
* Fields on posts, pages, products, users and terms; settings pages; import from WordPress and ACF.
* Works with SEO plugins, sitemaps, menus and site search through optional mirror posts.
* Unlimited languages with Polylang and WPML addresses.
* No limits on website pages, API keys or webhooks.

== Upgrade Notice ==

= 2.7.0 =
Adds translations for all 24 official EU languages.

= 2.6.7 =
Security and privacy fixes. Update recommended.

= 2.6.6 =
Keeps unpublished entries private in every list and lookup.

= 2.6.5 =
Fixes the admin app on phones.

= 2.6.4 =
Requires WordPress 6.9 or newer.

= 2.6.3 =
Safer on older PHP and on shared database servers.

= 2.6.2 =
Faster on newer PHP versions.

= 2.6.1 =
PHP 8.0 compatibility and safer saving of attached fields.

= 2.6.0 =
Parquet export and faster rebuilds with Morphic Pro.

= 2.5.2 =
Faster rebuilds with Morphic Pro.

= 2.5.1 =
Fixes the Views tab for Pro sites.

= 2.5.0 =
Fixes date-range filters in morphic_query() and shortcode lists.

= 2.4.1 =
A clearer help center.

= 2.4.0 =
Website pages now use your theme's templates. No limits on pages, API keys, webhooks or languages.
