Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7da71f1
Merge pull request #22 from BeAPI/ver/2.0.3
firestar300 Feb 17, 2026
2cb1ce4
add example to FAQ block
MarieComet May 19, 2026
eebfb0c
Merge pull request #24 from BeAPI/feat/add-faq-example
MarieComet May 28, 2026
4bc48a5
chore: reformat package.json scripts
firestar300 Jun 26, 2026
e5fcee6
chore: untrack composer.lock
firestar300 Jun 26, 2026
602fe63
chore: remove psalm
firestar300 Jun 26, 2026
cda0596
Add SEOPress compatibility with dedicated SEO plugin services.
firestar300 Jun 26, 2026
11a4c9b
Add Rank Math SEO integration for FAQ structured data.
firestar300 Jun 26, 2026
2c2660a
Refactor FAQ block markup to align with blockparty-accordion.
firestar300 Jun 26, 2026
dd88ce3
Add configurable FAQ question heading level (h2–h6).
firestar300 Jun 26, 2026
512e602
feat(languages): update french translations files
firestar300 Jun 26, 2026
1343b64
fix: plugin version
firestar300 Jun 26, 2026
4a0bdae
fix: edit js blockprops
firestar300 Jun 26, 2026
ecee49f
Merge pull request #28 from BeAPI/feature/clean-markup
firestar300 Jun 29, 2026
af49dcc
feat: add PSR-4 autoloading for plugin classes
firestar300 Jun 30, 2026
5ca1d88
Merge pull request #27 from BeAPI/feature/seo-press-compat
firestar300 Jun 30, 2026
6bcb8b6
fix: Instantly synchronize FAQ question headings
firestar300 Jun 30, 2026
2f1d1f8
fix: Safely merge and renumber FAQPage schema questions
firestar300 Jun 30, 2026
d4eab60
fix: Use data hooks for FAQ heading synchronization
firestar300 Jun 30, 2026
9bdccb9
fix: Ensure FAQ heading synchronization reacts to inner block changes
firestar300 Jun 30, 2026
1bcb917
Merge pull request #31 from BeAPI/fix/bugbot-2.1.0
firestar300 Jun 30, 2026
c974940
chore(bump): version 2.1.0
firestar300 Jun 30, 2026
5ebdaf2
docs: add CHANGELOG.md and readme.txt
firestar300 Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ Thumbs.db
.wp-env.override.json
phpcs.xml
phpunit.xml

# Composer
composer.lock

# Plugins
.wp-env/plugins/
2 changes: 1 addition & 1 deletion .plugin-data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "2.0.3",
"version": "2.1.0",
"slug": "blockparty-faq"
}
5 changes: 4 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"plugins": [
"."
".",
".wp-env/plugins/seo-by-rank-math",
".wp-env/plugins/wordpress-seo",
".wp-env/plugins/wp-seopress"
]
}
108 changes: 108 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0] - 2026-06-30

### Added

- Configurable FAQ question heading level (h2–h6) from the block settings panel.
- Rank Math SEO integration for FAQ structured data (JSON-LD).
- SEOPress integration for FAQ structured data (JSON-LD).
- SEO service resolver to delegate schema output to the active SEO plugin (Yoast SEO, Rank Math, or SEOPress).
- PSR-4 autoloading for plugin PHP classes via Composer.
- Block example in the FAQ block inserter preview.
- Deprecated save handlers to preserve front-end markup for content saved in 2.0.x.

### Changed

- Refactored FAQ block markup to use WordPress block class names (aligned with blockparty-accordion).
- Refactored Yoast SEO integration into a dedicated service class alongside other SEO plugins.
- Updated French translations for all block editor scripts.
- Replaced wp-env npm scripts (`start:env` / `stop:env` / `setup:env`) with `env:start` / `env:stop`.
- Local development environment now mounts Yoast SEO, Rank Math, and SEOPress via Composer.

### Fixed

- Removed duplicate block wrapper in the FAQ item editor component (`useBlockProps` called twice).
- Renamed `includes/` subdirectories to match PSR-4 namespace casing (`Schema/`, `Services/`, `Hooks/`).

### Removed

- Psalm static analysis configuration and dependency.

## [2.0.3] - 2026-02-17

### Added

- Support for core/button blocks inside FAQ answers.
- Spacing support for FAQ answers.
- Font size (typography) support for FAQ questions.

### Changed

- FAQ question text is stripped of HTML tags in structured data output.

## [2.0.2] - 2026-01-27

### Fixed

- Added missing `isAccordion` attribute to the parent FAQ block.

## [2.0.1] - 2026-01-27

### Fixed

- Block registration now uses block metadata from `block.json` correctly after the 2.0 build restructure.

## [2.0.0] - 2026-01-27

### Added

- Nested block architecture with child blocks: `faq-item`, `faq-question`, and `faq-answer`.
- Configurable accordion mode via the `isAccordion` attribute (interactive accordion or static layout).
- InnerBlocks support in FAQ answers (paragraphs, lists, images, and other Gutenberg blocks).
- InnerBlocks support in FAQ questions when accordion mode is disabled.
- Front-end accordion script with configurable behavior via the `beapi_faq_block_config` filter.
- Automatic migration from the legacy `questions` array attribute to the InnerBlocks format.
- Add and remove FAQ item controls in the block editor toolbar.
- Full internationalization: PO/MO translations for PHP and JSON translations for JavaScript.
- Yoast SEO FAQPage structured data integration.
- wp-env local development environment.

### Changed

- Build structure reorganized to follow the blockparty-accordion model (one `block.json` per block directory).

## [1.0.2] - 2024-06-07

### Changed

- Added PHP 8.2 to supported PHP versions.

## [1.0.1] - 2024-04-03

### Fixed

- Corrected CSS custom property variable names.

## [1.0.0] - 2024-04-02

### Added

- Initial release of the Blockparty FAQ Gutenberg block.
- Accessible accordion front-end behavior powered by `@beapi/be-a11y`.
- Yoast SEO FAQPage structured data (JSON-LD) generation.
- Editor controls to add and remove FAQ items.

[2.1.0]: https://github.com/BeAPI/blockparty-faq/compare/2.0.3...2.1.0
[2.0.3]: https://github.com/BeAPI/blockparty-faq/compare/2.0.2...2.0.3
[2.0.2]: https://github.com/BeAPI/blockparty-faq/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/BeAPI/blockparty-faq/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/BeAPI/blockparty-faq/compare/1.0.2...2.0.0
[1.0.2]: https://github.com/BeAPI/blockparty-faq/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/BeAPI/blockparty-faq/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/BeAPI/blockparty-faq/releases/tag/1.0.0
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,30 @@ A Gutenberg block for SEO friendly FAQ in an accessible accordion.
npm run build
```

4. Start the WordPress environment and install Yoast SEO:
4. Install PHP dependencies (downloads SEO plugins into `.wp-env/plugins/`):

```bash
npm run setup:env
composer install
```

**Note:** On Windows, you may need to run the commands separately:
5. Start the WordPress environment:

```bash
npm run start:env
# Wait for WordPress to be ready (about 10-15 seconds)
npm run setup
npm run env:start
```

Yoast SEO, Rank Math, and SEOPress are mounted automatically via `.wp-env.json`.

### Available Scripts

- `npm run build` - Build the blocks for production
- `npm run start` - Start the development server with hot reload
- `npm run start:env` - Start the WordPress environment (wp-env)
- `npm run stop:env` - Stop the WordPress environment
- `npm run install:yoast` - Install and activate Yoast SEO plugin (required for schema generation)
- `npm run setup:env` - Start wp-env and install Yoast SEO in one command
- `npm run env:start` - Start the WordPress environment (wp-env)
- `npm run env:stop` - Stop the WordPress environment

### Note

Yoast SEO is required for the FAQ schema (JSON-LD) generation. It is installed automatically via `npm run setup:env` but is not versioned in the repository.
FAQ structured data (JSON-LD) requires Yoast SEO, Rank Math, or SEOPress. All three plugins are available in the local wp-env environment; keep only one active in the WordPress admin when testing a specific integration. SEO plugin files are not versioned in the repository (installed via Composer into `.wp-env/plugins/`).

## Changelog

Expand Down
24 changes: 18 additions & 6 deletions blockparty-faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: A FAQ block for WordPress Editor that provided structured data based on FAQ schema.
* Requires at least: 6.2
* Requires PHP: 8.1
* Version: 2.0.3
* Version: 2.1.0
* Plugin URI: https://beapi.fr
* Author: Be API Technical team
* Author URI: https://beapi.fr
Expand Down Expand Up @@ -40,15 +40,27 @@
die( '-1' );
}

if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
include_once __DIR__ . '/vendor/autoload.php';
}

// Plugin constants
define( 'BLOCKPARTY_FAQ_VERSION', '2.0.3' );
define( 'BLOCKPARTY_FAQ_VERSION', '2.1.0' );

// Plugin URL and PATH
define( 'BLOCKPARTY_FAQ_DIR', plugin_dir_path( __FILE__ ) );

// Schema & SEO services
require_once BLOCKPARTY_FAQ_DIR . 'includes/Schema/FAQ_Schema_Generator.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/Schema/FAQ_Schema.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Seo_Service_Interface.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Yoast_Seo_Service.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Rank_Math_Seo_Service.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Seopress_Seo_Service.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Seo_Service_Resolver.php';

// Hooks
require_once BLOCKPARTY_FAQ_DIR . 'includes/hooks/schema.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/schema/faq_schema.php';
require_once BLOCKPARTY_FAQ_DIR . 'includes/Hooks/Schema_Hooks.php';

/**
* Initialize plugin blocks.
Expand Down Expand Up @@ -83,9 +95,9 @@ function blockparty_faq_init(): void {
'forceExpand' => false,
'hasAnimation' => true,
'openMultiple' => false,
'panelSelector' => '.faq__panel',
'panelSelector' => '.wp-block-blockparty-faq-answer',
'prefixId' => 'block-faq',
'triggerSelector' => '.faq__trigger',
'triggerSelector' => '.wp-block-blockparty-faq-trigger',
]
),
];
Expand Down
32 changes: 25 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,50 @@
"php": "8.1"
}
},
"extra": {
"installer-paths": {
".wp-env/plugins/{$name}/": [
"type:wordpress-plugin"
]
}
},
"require": {
"php": "^8.1 | ^8.2 | ^8.3 | ^8.4",
"ext-json": "*",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"humanmade/psalm-plugin-wordpress": "^3.0",
"overtrue/phplint": "^9.1",
"php-parallel-lint/php-parallel-lint": "^1.3",
"php-stubs/wordpress-seo-stubs": "^20.5",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpro/grumphp-shim": "^1.5",
"roave/security-advisories": "dev-latest",
"roots/wordpress-no-content": "^6.0",
"vimeo/psalm": "^5.20",
"wp-coding-standards/wpcs": "^3.0"
"wp-coding-standards/wpcs": "^3.3",
"wp-plugin/seo-by-rank-math": "1.0.272",
"wp-plugin/wordpress-seo": "27.9",
"wp-plugin/wp-seopress": "10.0.1"
},
"repositories": [
{
"name": "wp-packages",
"type": "composer",
"url": "https://repo.wp-packages.org"
}
],
"autoload": {
"psr-4": {
"Blockparty\\Faq\\": "includes/"
}
},
"scripts": {
"cs": "./vendor/bin/phpcs",
"cb": "./vendor/bin/phpcbf",
"psalm": "./vendor/bin/psalm"
"cb": "./vendor/bin/phpcbf"
},
"scripts-descriptions": {
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset.",
"psalm": "Run psalm on codebase using custom ruleset."
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset."
}
}
Loading
Loading