=== 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.91
License: MIT
License URI: https://opensource.org/licenses/MIT

Page Composer is a free visual page builder for WordPress. Create posts and pages from components, then save layouts as reusable templates.

== Description ==

Page Composer — Basic is a free page builder for WordPress posts and pages.
Build layouts from reusable components, edit your content, and save page
templates to use again.

Use the visual composer to arrange rows and columns, add text, images and
buttons, and adjust each component's settings. When enabled, it replaces the
default editor on Posts and Pages.

The editor runs inside your WordPress installation. No Page Composer account
or activation key is needed.

= Build and reuse layouts =

* Drag and drop components into rows and columns. Choose column layouts or
  configure your own Row layout presets.
* Add text, images, headings, quotes, separators, buttons and Google maps.
* Save layouts as page templates, load them into another post or page, and
  reopen them in the editor whenever they need an update.
* Set styles for individual components and configure media-query sizes for
  different screen widths.
* Use the "Page Composer — Full Width" page template to keep your theme's
  header and footer while giving the content the full width. It supports
  classic and block themes.

= WordPress features and integrations =

* Add WordPress widgets such as Search, Categories, Recent Posts, menus,
  archives and RSS feeds to your layout.
* Use WooCommerce components for products, cart, checkout and other store
  content when WooCommerce is active. See the details below.
* Embed a Contact Form 7 form by its ID when that plugin is active.
* Analyse composed content with Yoast SEO.
* Keep page text available to WordPress search, feeds and other plugins. Each
  save writes an HTML snapshot to `wp_posts.post_content`, while the published
  page renders from the composition stored as JSON in post meta.
* Restore both content and layout through native WordPress revisions (6.4+).
* Choose which user roles can use the editor in Page Composer settings.

The plugin detects conflicting page builders, including Elementor, WPBakery,
Divi and Beaver Builder. If one is active, it disables the editor and shows a
notice explaining which plugin needs to be deactivated.

= Tools for developers =

* Override component markup by adding `{Component}.php` to your theme's
  `pce_templates/` folder. The bundled PCEditor library handles rendering.
* Add custom markup and scripts with the Raw HTML and Raw JS components,
  subject to WordPress user permissions.
* Compile per-component CSS from the `css_props` field into media queries.
  Configure CSS output and media-query sizes in settings.
* Adjust the Row/Col grid through the `--pce-grid-*` custom properties, or
  disable its stylesheet with the `pce_load_grid_styles` filter.
* Rebuild saved HTML snapshots with Page Composer → Reindex after changing
  component templates, without opening and saving every post.
* Extend components, fields, editor access, assets and storage with filters:
  `pce_components`, `pce_css_field`, `pce_editor_enabled`, `pce_load_assets`,
  `pce_load_grid_styles`, `pce_content_meta_key`, `pce_pre_save_content` and
  `pce_load_content`.

[Try the editor](https://page-composer.com/) or read the
[documentation](https://page-composer.com/docs).

= 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.91 =
* Preserved edited field values when search or conditional settings change
  which fields are visible.
* Saved complete component settings when creating a template while a settings
  search filter is active.

= 1.6.90 =
* Enabled dragging from component content by default, with automatic exclusions
  for interactive controls and header-only dragging for rows.
* Added `dragFromContent: false` and the `data-pce-no-drag` template attribute
  so custom components can disable content dragging where needed.
* Added grab and grabbing cursors to show where components can be dragged.

= 1.6.89 =
* Preserved saved and custom fractional column widths while safely parsing
  column ratios in the bundled editor.

= 1.6.88 =
* Updated the bundled editor to React 19.3.1 and compatible integration packages.
* Preserved WordPress React globals; custom editor integrations can use the
  bundled runtime through `pce.React` and `pce.ReactDOM`.

= 1.6.87 =
* Fixed modal Save, Load and confirmation buttons to use white labels and icons
  by default, with matching theme-aware colors on hover and keyboard focus.
* Prevented host website link styles from overriding modal action colors while
  preserving delete and disabled button states.

= 1.6.86 =
* Fixed duplicate fields and incorrect visibility when switching `if.show`
  conditions, including fields inside groups.
* Added the `fields_inline` card template for editing fields marked
  `show_in_template: true` directly on a component, with group editing support.
* Preserved field instances when reordering components within the same container
  and improved group drag coordinates and cancellation.

= 1.6.85 =
* Fixed: TinyMCE dialogs of the wysiwyg field (Source Code, insert link) opened
  behind the settings window when the editor ran in full-window mode.

= 1.6.84 =
* New card templates for custom components: `fields_chips` and `fields_grid`
  show every field marked `show_in_template: true` on the editor card as a
  label + value pair — switches as localized Yes/No, colors as a swatch,
  selects as their option label, files as the file name, long text truncated.

= 1.6.83 =
* Components window: a long category list no longer overlaps the bar with the
  action buttons.
* Fixed a potential editor freeze in background tabs when a save/load request
  failed — request errors now log to the browser console instead of showing a
  blocking alert.

= 1.6.82 =
* Columns can now be reordered by dragging the new handle in a column's
  toolbar — the neighbouring columns slide aside to show where it will land.
* 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
