-
React Integration - Modern UI components for options pages with PHP-only API
ReactFieldclass extendsFieldwith React rendering capabilities- Automatic React asset loading when
ReactFieldinstances are detected - Supports 10 field types: text, textarea, number, email, url, color, image, checkbox, select
- Uses WordPress
@wordpress/componentsfor consistent admin UI - Media library integration for image fields with live preview
- WordPress color picker with alpha channel support
- Progressive enhancement - HTML works, React is opt-in
- Zero breaking changes - existing code continues to work unchanged
-
ReactField API:
ReactField::make()- Create React-enhanced fieldssetReactProp()- Pass custom props to React componentssetReactComponent()- Override default React componentsetUseReact()- Enable/disable React per fieldgetReactComponent()- Get component name for field typegetReactProps()- Get all props for React component
-
Build System:
- Webpack 5 configuration for React asset compilation
- Babel preset for JSX transformation
- Build commands:
build,build:dev,watch,clean - Optimized production builds with source maps
- WordPress externals (wp-element, wp-components, wp-block-editor)
-
React Components (
assets/js/src/components/):TextField.jsx- Modern text input with validationTextareaField.jsx- Multi-line text with rows configNumberField.jsx- Number input with min/max/stepEmailField.jsx- Email validationUrlField.jsx- URL input validationColorField.jsx- WordPress color pickerImageField.jsx- Media library integration with thumbnail previewCheckboxField.jsx- Toggle checkboxSelectField.jsx- Dropdown select
-
Enhanced CSS:
- Modern WooCommerce-inspired design system
- CSS variables for theming (--hf-color-primary, etc.)
- Card layout with better spacing and typography
- Improved tabs and field rows
- Responsive design with mobile-first approach
- Dark mode support via
@media (prefers-color-scheme: dark) - React-specific styles in
assets/css/react-fields.css
-
OptionsPage Integration:
- Auto-detection of
ReactFieldinstances - Automatic enqueuing of wp-element, wp-components, wp-block-editor
- Data bridge via
wp_localize_script()towindow.hyperfieldsReactData - React root container (
#hyperpress-react-root) for component mounting - Hidden input synchronization for form submission
- Auto-detection of
-
Developer Experience:
- One-line change from
Field::make()toReactField::make() - No React knowledge required
- PHP-only API maintained
- Optional custom React props per field
- One-line change from
-
Documentation:
REACT_EXAMPLES.md- Complete developer guideIMPLEMENTATION_SUMMARY.md- Implementation detailsVERSION_BUMP_GUIDE.md- Version management guideexamples/react-test.php- Working test file
-
Build Automation:
composer build-assetsscript for standalone asset buildingcomposer productionnow automatically builds React assets- Graceful fallback when npm is not available
- Cross-platform support (Linux, macOS, Windows)
-
Version Management:
- Updated
scripts/version-bump.shto handle all version locations - Now updates: composer.json, package.json, bootstrap.php, src/OptionsPage.php
- Synchronizes fallback versions across all files
- Updated
-
CSS Refresh - Modernized
assets/css/hyperfields-admin.csswith:- CSS variable-based theming system
- Card layout replacing dated field styling
- Better spacing, typography, and visual hierarchy
- Improved tabs with active state styling
- Responsive design improvements
- Dark mode compatibility
-
OptionsPage Enhancements:
- Added
reactFieldsToRenderproperty for React field tracking getReactFields()method to collect React fields from sectionshasReactFields()method to check for React presenceenqueueReactAssets()method for React dependency loading- Modified
renderPage()to include React root container
- Added
-
Build System:
- Added
package.jsonwith React dependencies - Added
webpack.config.jsfor asset compilation - Updated
composer.jsonscripts to integrate React builds
- Added
-
Composer Scripts:
- Added
build-assetsscript - Updated
productionscript to run asset builds automatically
- Added
-
ImageField Component:
- Added null check for
wp.mediaobject - Improved error handling for media attachment loading
- Fallback to number input when MediaUpload unavailable
- Added null check for
-
Build System:
- Fixed webpack externals configuration for WordPress dependencies
- Added
@wordpress/block-editorto dependencies - Resolved module resolution issues
- React assets are minified in production builds
- Source maps generated for development debugging
- Lazy loading of React components only when needed
- Zero breaking changes - existing fields work unchanged
- Opt-in React rendering - choose which fields benefit from modern UI
- Mixed rendering - use React for complex fields, HTML for simple ones
- Full backward compatibility maintained
- Transfer audit logging runtime with dedicated classes:
Transfer\AuditLoggerhook subscriber for options/content/manager transfer flowsTransfer\AuditLogStoragededicated DB storage ({wp_prefix}hyperfields_transfer_logs) with lazy schema setup and pruningTransfer\AuditContextrequest-scoped manager-depth guard to avoid nested duplicate logs
- Built-in transfer logs admin screen via
Admin\TransferLogsUI, integrated intoExportImportUIwith a contextualView transfer logslink. ExportImportUIextensibility upgrades:renderConfigured(ExportImportPageConfig $config)entrypoint- custom
exporter,previewer, andimportercallables - optional
exportFormExtrasHTML injection point in export form - option group labels support in
render(..., array $optionGroups = [])
- Transfer Manager envelope customization via
Transfer\SchemaConfigandManager::withSchema(...). - Automatic transfer-audit hook initialization in
LibraryBootstrap::init(). - Typed-node schema validation for option import/export via
Validation\SchemaValidator. ContentExportImportAPI for post/content JSON export/import/diff flows.Transfer\Managerpluggable module registry for export/import/diff orchestration.- New facade and helper methods for content transfer:
HyperFields::exportPosts(),snapshotPosts(),importPosts(),diffPosts(),makeTransferManager()hf_export_posts(),hf_snapshot_posts(),hf_import_posts(),hf_diff_posts()
- Strategy support expansion (
__strategy) for transfer payload behavior control. - Expanded transfer/bootstrap docs:
docs/transfer-and-content-export-import.mddocs/library-bootstrap.md
- Documentation refreshed for transfer logging, Transfer Manager schema configuration, and
ExportImportUIextension points. ExportImportupdated to align with transfer-manager, typed-node, and schema-aware flows.ExportImportUIoverhauled with richer export selection/filter UX and improved diff/import experience.- Export options filter layout and admin styling/scripts refactored (
assets/js/hyperfields-admin.js,assets/css/hyperfields-admin.css). - Core docs updated with content transfer and extensible manager guidance.
- Composer/library metadata and README refreshed for library-first usage.
- Packaging cleanup for library distribution:
- adjusted bootstrap/composer metadata
- stopped shipping committed Composer vendor autoload artifacts
- Repository ignore rules updated for generated/vendor files.
- Minimum supported PHP version raised to
8.2.
- Data Tools UI regressions in export/import rendering and request handling.
- Post-overhaul code quality and test alignment fixes in
ExportImportUI. - Release metadata/version bump consistency updates.
ExportImportclass: export WordPress option groups to JSON and import with prefix filtering, whitelist enforcement, automatic backup transients, and additive mergeExportImportUIclass: admin submenu page for visual Export / Import with jsondiffpatch diff previewExportImportUI::registerPage()— single-call public API for third-party plugins to register the Data Tools page; hooks asset enqueueing toadmin_enqueue_scriptsautomaticallyExportImportUI::enqueuePageAssets()— public method to enqueue HyperFields admin CSS + jsondiffpatch diff assetsHyperFields::registerDataToolsPage()— facade entry point forExportImportUI::registerPage()hf_register_data_tools_page()helper function — procedural wrapper for registering the Data Tools pagehf_export_options()helper function — procedural wrapper forExportImport::exportOptions()hf_import_options()helper function — procedural wrapper forExportImport::importOptions()- Export/Import UI styled with HyperFields admin CSS classes (
hyperpress-options-wrap,hyperpress-fields-group,hyperpress-field-wrapper, etc.) for visual consistency with existing options pages - Full i18n coverage: all user-visible strings in
ExportImportUIwrapped with__()usinghyperfieldstext domain OptionsPage::addTab()andOptionsPage::addSectionToTab()for explicit tab-to-section composition- Section metadata support in
OptionsSection(slug,as_link,allow_html_description) for section-link navigation and HTML-safe section descriptions - WPSettings compatibility mapping for
menu_iconandmenu_positionto options page menu metadata - WPSettings compatibility support for
visiblecallbacks to conditionally skip field registration/rendering - WPSettings compatibility implementation for
code-editor/code_editorusing WordPress code editor assets and initialization (wp_enqueue_code_editor) - WPSettings compatibility type mapping for
wp-editor/wp_editorto HyperFieldsrich_text - WPSettings compatibility type mapping for
media/videoto HyperFieldsimage - WPSettings compatibility support for tab/section
option_levelnesting with option-path read/write handling - WPSettings compatibility support for
validateand callablesanitizeoption args in the options-page save pipeline - WPSettings compatibility support for
wp_settings_option_type_mapcustom type bridge into HyperFields custom fields - Field template/render arg parity extended for
input_type,attributes,rows,cols,editor_settings, and inlineerroroutput - Field template arg parity via
Field::toArray()forinput_class,label_class, andhelp_is_html
TypeErrorin prefix filter arrow functions when option arrays have integer keys — keys now explicitly cast to string beforestrposimportOptions()returnedsuccess: truewhen whitelist or prefix filtering blocked every incoming entry — now returnssuccess: falsewith a descriptive messagerestoreBackup()did not delete the backup transient whenupdate_optionreturnedfalsebecause the stored value was identical to the current value — unchanged-value case now correctly detected and transient cleaned up- XSS via
</script>injection in diff preview data island —wp_json_encodenow usesJSON_HEX_TAG | JSON_HEX_AMPflags - File upload handler did not check
$_FILES['import_file']['error'] !== UPLOAD_ERR_OKbefore callingis_uploaded_file, allowing error-state uploads to proceed - Non-array option values silently coerced to
[]during export — they are now skipped entirely, matching the additive-import contract wp_json_encodereturningfalseon unencodable data causedexportOptionsto return an empty string — fallback is now'{}'- Asset enqueueing (
wp_enqueue_style/wp_enqueue_script) was called inside anob_start()output buffer inrender(), which fires too late for WordPress header output — moved toadmin_enqueue_scriptshook - Options-page registration and sanitization for compatibility tabs with multiple sections now process the active renderable section set rather than assuming section ID equals tab ID
- Options section slug generation now falls back safely when WordPress
sanitize_title()is unavailable (test/library context) - Field templates (
input,checkbox,radio,multiselect,custom) now correctly honorinput_class/label_classand support HTML help rendering withhelp_is_html - Custom field fallback markup now uses
name_attrto preserve correct options-array field naming - Compatibility field save flow now supports nested
option_pathvalues and inline per-field validation feedback without breaking standard options-page behavior
- Updated
docs/hyperfields.mdwith the authoritative field type matrix (core field types + compatibility aliases) and current compatibility parity behavior details
- Fixed test environment compatibility by allowing
HYPERFIELDS_TESTING_MODEconstant to bypass ABSPATH checks - Updated
bootstrap.phpto conditionally return instead of exit when ABSPATH is not defined in test mode - Updated
includes/helpers.phpto support test environment execution - Updated
includes/backward-compatibility.phpto support test environment execution - Fixed PHPUnit bootstrap configuration to properly initialize Brain\Monkey mocks
- Test bootstrap now defines critical WordPress functions before autoloader to prevent conflicts
- Improved test infrastructure for downstream packages that depend on HyperFields via Composer
- Complete custom field system for WordPress
- Post meta, term meta, and user meta container support
- Options pages with sections and tabs
- Conditional logic for dynamic field visibility
- Field types: text, textarea, email, URL, number, select, checkbox, radio, date, color, image, file, wysiwyg, code editor
- Repeater fields for creating dynamic field groups
- Template loader with automatic asset enqueuing
- Block field adapter for Gutenberg integration
- Backward compatibility layer for legacy class names
- PSR-4 autoloading with Composer
- Comprehensive field validation and sanitization
- Admin assets manager for styles and scripts
- Helper functions for field value retrieval
- Metaboxes: Add custom fields to posts, pages, and custom post types
- Options Pages: Create settings pages with organized sections and tabs
- Conditional Logic: Show/hide fields based on other field values
- Flexible Containers: Support for post meta, term meta, user meta, and options
- Rich Field Types: Extensive collection of field types for any use case
- Developer-Friendly: Clean API with extensive hooks and filters
- Performance: Optimized autoloading and asset management
- Extensible: Easy to extend with custom field types and containers
- PHP 8.1 or higher
- WordPress 5.0 or higher
- Composer for dependency management