=== Page Composer — Basic ===
Contributors: segorev
Author: Page-composer.com
Author URI: https://page-composer.com
Tags: page builder, editor, components, drag and drop
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.6.82
License: MIT
License URI: https://opensource.org/licenses/MIT

Replaces the default editor on Posts and Pages with the Page Composer visual editor.

== Description ==

Page Composer — Basic replaces the default editor on Posts and Pages with the Page
Composer visual editor. Compose Posts and Pages from real components (Text, Image,
WooCommerce blocks) and render them with the bundled PCEditor library.

Features:

* Page Composer editor on Posts, Pages and the Page Templates post type.
* Composed content is stored as JSON in post meta and compiled into
  `wp_posts.post_content` as an HTML snapshot on every save — so
  WordPress search, feeds and other plugins see real page text while the live
  page always renders fresh from the JSON.
* Native revisions cover both the snapshot and the JSON (WP 6.4+ revisioned
  meta) — restoring a revision restores the composition.
* Page Composer → Reindex: rebuild all snapshots after component-template
  changes (theme overrides, markup edits) without re-saving every post.
* Rendering via the PCEditor general library, with theme-overridable templates
  (drop `{Component}.php` into your theme's `pce_templates/`).
* Per-component CSS (the `css_props` field) compiled into media queries.
* Settings (Editor / Components / Reindex tabs): enable the editor (it
  replaces the WordPress block editor and Site Editor on Posts and Pages),
  allowed roles, default Row grid, media-query sizes, and CSS output.
* Detects conflicting page builders (Elementor, WPBakery, Divi, Beaver Builder,
  …) and disables the editor with a notice while any is active.
* Load/Save page templates, stored as a custom post type and re-editable in the editor.
* WooCommerce components (18) via shortcodes — products, recent/featured/sale/
  best-selling/top-rated, by category/attribute, single product, related, add to
  cart (+ URL), cart, checkout, my account, order tracking.
* WordPress-widget components (13) — Search, Categories, Recent Posts, Tag Cloud,
  Archives, Calendar, Menu, Meta, Pages, Recent Comments, RSS, Links, Text.
* Raw HTML and Raw JS components for embedding custom markup and scripts.
* Contact Form 7 component (own editor tab) — embed a form by its ID and
  optional title (offered while the Contact Form 7 plugin is active).
* Content components: Title (configurable tag + font size), Quote, Separator,
  CTA Button (colors as CSS variables) and Google map (Maps Embed API key in
  Settings → Components; keyless embed without one).
* "Page Composer — Full Width" page template (Page Attributes → Template) —
  the active theme's header + footer only, content full-width (classic + block
  themes).
* Default Row/Col grid stylesheet loaded in the active theme (disable with the
  `pce_load_grid_styles` filter, or override the --pce-grid-* custom properties).
* Configurable Row column-layout presets (Components → Row layouts) — a visual
  bar builder, fed to the editor as editor.hooks.filters.components.Row.layouts.
* Yoast SEO content analysis integration.
* Filters: `pce_components`, `pce_css_field`, `pce_editor_enabled`,
  `pce_load_assets`, `pce_load_grid_styles`, `pce_content_meta_key`,
  `pce_pre_save_content`, `pce_load_content`.

No account or API key is needed — activate the plugin and the editor works.

= WooCommerce support =

Page Composer ships ready-made components for WooCommerce stores: products
(recent, featured, on sale, best selling, top rated), products by category or
attribute, a single product, related products, add to cart (and its URL), cart,
checkout, my account and order tracking. They render through WooCommerce's own
shortcodes, so they appear in the editor only while WooCommerce is installed and
active, and they follow your WooCommerce templates and styling. WooCommerce
itself is not bundled or required — without it, Page Composer simply omits these
components.

Page Composer is an independent product. It is not affiliated with, endorsed by
or sponsored by Automattic or WooCommerce. "WooCommerce" and "WordPress" are
trademarks of their respective owners and are used here only to describe
compatibility.

== External services ==

The plugin performs no license or activation calls — no account and no API key
are needed, and nothing is sent automatically in the background.

**Feedback to page-composer.com (user-initiated only).** Two optional forms
send data to `https://page-composer.com/plugin-feedback`, and only when an
administrator explicitly submits them:

* *Leave a testimonial* (linked from a dismissible admin notice): sends the
  star rating and testimonial text the admin typed.
* *Deactivation survey* (shown when deactivating the plugin; fully skippable
  via "Skip & deactivate", which sends nothing): sends the selected reason and
  the optional description.

Both submissions also include the site's domain name, the plugin version and
the WordPress version, so we can reproduce reported problems. No page content,
no personal data and no visitor data is ever sent, and nothing is sent without
an explicit form submission. This service is operated by Page-composer.com —
see our terms (https://page-composer.com/terms) and privacy policy
(https://page-composer.com/privacy).

**Google Maps (frontend embed, only if you use the Google map component).**
When a page contains the Google map component, that page embeds a map in an
iframe from google.com — through the Google Maps Embed API when a key is
configured under *Page Composer → Settings → Components*, or Google's keyless
classic embed when it is not. The embed is requested by the visitor's browser
when such a page loads, and carries the map address/coordinates you entered in
the component plus the standard request headers the browser sends to any site
(IP address, user agent, referrer). The plugin itself sends no data to Google
from the server, and pages without this component make no Google requests at
all. This service is provided by Google: terms of service
(https://policies.google.com/terms), privacy policy
(https://policies.google.com/privacy), Google Maps Platform terms
(https://cloud.google.com/maps-platform/terms).

== Source code ==

The editor bundle shipped in `assets/editor/js/pceditor_wp_basic.js` is a
standard webpack production build of the Page Composer editor. Bundled
third-party libraries (React, ReactDOM and small MIT/ISC utilities) are listed
with their licenses in `assets/editor/js/pceditor_wp_basic.js.LICENSE.txt`;
the plugin's own PHP is unminified throughout. Questions about the build are
welcome at sergey@page-composer.com.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` (or install it from the Plugin
   Directory) and activate it.
2. Open *Page Composer → Settings* and enable the editor — it replaces the
   block editor on Posts and Pages.
3. Edit any Post or Page: compose it from components, then Update as usual.

== Changelog ==

= 1.6.82 =
* Security hardening: composition JSON is now filtered by author capability on
  every save, mirroring how WordPress core treats post_content. Authors without
  the `unfiltered_html` capability have field values passed through
  `wp_kses_post()` and script payloads (Raw JS) removed; authors with the
  capability are unaffected.

= 1.6.80 =
* First public release on WordPress.org.
* Visual component editor for Posts and Pages with saved page templates and
  per-component saved settings.
* WooCommerce (18), WordPress-widget (13), Contact Form 7 and content
  components; Yoast SEO analysis integration.
* Full Width page template, configurable Row layouts, grid stylesheet filters.
* Wysiwyg paste clean-up (data-* attributes and copy artifacts are stripped).
* Interface translated into 12 languages.

== Storage hooks ==

By default the composed JSON lives in the `_pce_content` post meta, and a
compiled HTML snapshot of it is written to `wp_posts.post_content` on every
save (that snapshot is what search/feeds/REST consumers read; the live page
renders from the JSON). Three filters customise the storage:

`pce_content_meta_key` — `filter( string $meta_key )`
Rename the post meta key that holds the JSON (default `_pce_content`).
Applied consistently to every read/write, including revisioning and the
Reindex tool. Register it before `init` priority 10 (top-level in your plugin
or in the theme's functions.php / `after_setup_theme`) and in every context
(admin, frontend, cron) — the one-time storage migration and the revisioned
meta registration resolve the key there. Adopting the filter on a site with
existing content requires copying the `_pce_content` meta to the new key
yourself.

`pce_pre_save_content` — `filter( bool $handled, string $json, array $postarr )`
Runs on save (inside `wp_insert_post_data`). Store `$json` yourself (a custom
table, an external service) and return `true`; the plugin then writes neither
the meta nor the snapshot. `$json` arrives unslashed and JSON-validated (or
empty when the composition was cleared).

`pce_load_content` — `filter( string $json, WP_Post $post )`
Runs wherever the plugin reads a post's composition (editor metabox, frontend
renderer, Yoast analysis). Receives the meta value as the default; return your
stored JSON instead.

Example — rename the meta key:

    add_filter( 'pce_content_meta_key', fn () => '_my_composition' );

Example — store the JSON in a custom table:

    add_filter( 'pce_pre_save_content', function ( $handled, $json, $postarr ) {
        my_table_store( (int) $postarr['ID'], $json );
        return true;
    }, 10, 3 );

    add_filter( 'pce_load_content', function ( $json, $post ) {
        $stored = my_table_fetch( $post->ID );
        return $stored !== null ? $stored : $json;
    }, 10, 2 );

The saved page templates (Load/Save window) follow the same storage: JSON in
the templates CPT's meta, snapshot in its post_content. Saved component
settings (each component's Load/Save-settings window) are posts of the
`pce_comp_templates` post type — the component name in `_pce_component_tag`,
the settings JSON in `_pce_component_json` — the same storage the Pro plugin
uses, so an upgrade keeps every saved version. (Pre-existing entries in the
old `pce_components_store` option are migrated automatically once; the option
is kept as a downgrade backup until uninstall.)

== Upgrade Notice ==

Page Composer Pro unlocks all field types, component templates, Live mode and priority
support: https://page-composer.com/pricing
