Skip to content

Commit 51b3b12

Browse files
authored
Merge pull request #30 from BeAPI/release/2.1.0
Release 2.1.0
2 parents 0c054b6 + 5ebdaf2 commit 51b3b12

54 files changed

Lines changed: 2017 additions & 5918 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ Thumbs.db
2626
.wp-env.override.json
2727
phpcs.xml
2828
phpunit.xml
29+
30+
# Composer
31+
composer.lock
32+
33+
# Plugins
34+
.wp-env/plugins/

.plugin-data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "2.0.3",
2+
"version": "2.1.0",
33
"slug": "blockparty-faq"
44
}

.wp-env.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"plugins": [
3-
"."
3+
".",
4+
".wp-env/plugins/seo-by-rank-math",
5+
".wp-env/plugins/wordpress-seo",
6+
".wp-env/plugins/wp-seopress"
47
]
58
}

CHANGELOG.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.1.0] - 2026-06-30
9+
10+
### Added
11+
12+
- Configurable FAQ question heading level (h2–h6) from the block settings panel.
13+
- Rank Math SEO integration for FAQ structured data (JSON-LD).
14+
- SEOPress integration for FAQ structured data (JSON-LD).
15+
- SEO service resolver to delegate schema output to the active SEO plugin (Yoast SEO, Rank Math, or SEOPress).
16+
- PSR-4 autoloading for plugin PHP classes via Composer.
17+
- Block example in the FAQ block inserter preview.
18+
- Deprecated save handlers to preserve front-end markup for content saved in 2.0.x.
19+
20+
### Changed
21+
22+
- Refactored FAQ block markup to use WordPress block class names (aligned with blockparty-accordion).
23+
- Refactored Yoast SEO integration into a dedicated service class alongside other SEO plugins.
24+
- Updated French translations for all block editor scripts.
25+
- Replaced wp-env npm scripts (`start:env` / `stop:env` / `setup:env`) with `env:start` / `env:stop`.
26+
- Local development environment now mounts Yoast SEO, Rank Math, and SEOPress via Composer.
27+
28+
### Fixed
29+
30+
- Removed duplicate block wrapper in the FAQ item editor component (`useBlockProps` called twice).
31+
- Renamed `includes/` subdirectories to match PSR-4 namespace casing (`Schema/`, `Services/`, `Hooks/`).
32+
33+
### Removed
34+
35+
- Psalm static analysis configuration and dependency.
36+
37+
## [2.0.3] - 2026-02-17
38+
39+
### Added
40+
41+
- Support for core/button blocks inside FAQ answers.
42+
- Spacing support for FAQ answers.
43+
- Font size (typography) support for FAQ questions.
44+
45+
### Changed
46+
47+
- FAQ question text is stripped of HTML tags in structured data output.
48+
49+
## [2.0.2] - 2026-01-27
50+
51+
### Fixed
52+
53+
- Added missing `isAccordion` attribute to the parent FAQ block.
54+
55+
## [2.0.1] - 2026-01-27
56+
57+
### Fixed
58+
59+
- Block registration now uses block metadata from `block.json` correctly after the 2.0 build restructure.
60+
61+
## [2.0.0] - 2026-01-27
62+
63+
### Added
64+
65+
- Nested block architecture with child blocks: `faq-item`, `faq-question`, and `faq-answer`.
66+
- Configurable accordion mode via the `isAccordion` attribute (interactive accordion or static layout).
67+
- InnerBlocks support in FAQ answers (paragraphs, lists, images, and other Gutenberg blocks).
68+
- InnerBlocks support in FAQ questions when accordion mode is disabled.
69+
- Front-end accordion script with configurable behavior via the `beapi_faq_block_config` filter.
70+
- Automatic migration from the legacy `questions` array attribute to the InnerBlocks format.
71+
- Add and remove FAQ item controls in the block editor toolbar.
72+
- Full internationalization: PO/MO translations for PHP and JSON translations for JavaScript.
73+
- Yoast SEO FAQPage structured data integration.
74+
- wp-env local development environment.
75+
76+
### Changed
77+
78+
- Build structure reorganized to follow the blockparty-accordion model (one `block.json` per block directory).
79+
80+
## [1.0.2] - 2024-06-07
81+
82+
### Changed
83+
84+
- Added PHP 8.2 to supported PHP versions.
85+
86+
## [1.0.1] - 2024-04-03
87+
88+
### Fixed
89+
90+
- Corrected CSS custom property variable names.
91+
92+
## [1.0.0] - 2024-04-02
93+
94+
### Added
95+
96+
- Initial release of the Blockparty FAQ Gutenberg block.
97+
- Accessible accordion front-end behavior powered by `@beapi/be-a11y`.
98+
- Yoast SEO FAQPage structured data (JSON-LD) generation.
99+
- Editor controls to add and remove FAQ items.
100+
101+
[2.1.0]: https://github.com/BeAPI/blockparty-faq/compare/2.0.3...2.1.0
102+
[2.0.3]: https://github.com/BeAPI/blockparty-faq/compare/2.0.2...2.0.3
103+
[2.0.2]: https://github.com/BeAPI/blockparty-faq/compare/2.0.1...2.0.2
104+
[2.0.1]: https://github.com/BeAPI/blockparty-faq/compare/2.0.0...2.0.1
105+
[2.0.0]: https://github.com/BeAPI/blockparty-faq/compare/1.0.2...2.0.0
106+
[1.0.2]: https://github.com/BeAPI/blockparty-faq/compare/1.0.1...1.0.2
107+
[1.0.1]: https://github.com/BeAPI/blockparty-faq/compare/1.0.0...1.0.1
108+
[1.0.0]: https://github.com/BeAPI/blockparty-faq/releases/tag/1.0.0

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,30 @@ A Gutenberg block for SEO friendly FAQ in an accessible accordion.
2424
npm run build
2525
```
2626

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

2929
```bash
30-
npm run setup:env
30+
composer install
3131
```
3232

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

3535
```bash
36-
npm run start:env
37-
# Wait for WordPress to be ready (about 10-15 seconds)
38-
npm run setup
36+
npm run env:start
3937
```
4038

39+
Yoast SEO, Rank Math, and SEOPress are mounted automatically via `.wp-env.json`.
40+
4141
### Available Scripts
4242

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

5048
### Note
5149

52-
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.
50+
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/`).
5351

5452
## Changelog
5553

blockparty-faq.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Description: A FAQ block for WordPress Editor that provided structured data based on FAQ schema.
55
* Requires at least: 6.2
66
* Requires PHP: 8.1
7-
* Version: 2.0.3
7+
* Version: 2.1.0
88
* Plugin URI: https://beapi.fr
99
* Author: Be API Technical team
1010
* Author URI: https://beapi.fr
@@ -40,15 +40,27 @@
4040
die( '-1' );
4141
}
4242

43+
if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
44+
include_once __DIR__ . '/vendor/autoload.php';
45+
}
46+
4347
// Plugin constants
44-
define( 'BLOCKPARTY_FAQ_VERSION', '2.0.3' );
48+
define( 'BLOCKPARTY_FAQ_VERSION', '2.1.0' );
4549

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

53+
// Schema & SEO services
54+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Schema/FAQ_Schema_Generator.php';
55+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Schema/FAQ_Schema.php';
56+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Seo_Service_Interface.php';
57+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Yoast_Seo_Service.php';
58+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Rank_Math_Seo_Service.php';
59+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Seopress_Seo_Service.php';
60+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Services/Seo_Service_Resolver.php';
61+
4962
// Hooks
50-
require_once BLOCKPARTY_FAQ_DIR . 'includes/hooks/schema.php';
51-
require_once BLOCKPARTY_FAQ_DIR . 'includes/schema/faq_schema.php';
63+
require_once BLOCKPARTY_FAQ_DIR . 'includes/Hooks/Schema_Hooks.php';
5264

5365
/**
5466
* Initialize plugin blocks.
@@ -83,9 +95,9 @@ function blockparty_faq_init(): void {
8395
'forceExpand' => false,
8496
'hasAnimation' => true,
8597
'openMultiple' => false,
86-
'panelSelector' => '.faq__panel',
98+
'panelSelector' => '.wp-block-blockparty-faq-answer',
8799
'prefixId' => 'block-faq',
88-
'triggerSelector' => '.faq__trigger',
100+
'triggerSelector' => '.wp-block-blockparty-faq-trigger',
89101
]
90102
),
91103
];

composer.json

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,50 @@
2727
"php": "8.1"
2828
}
2929
},
30+
"extra": {
31+
"installer-paths": {
32+
".wp-env/plugins/{$name}/": [
33+
"type:wordpress-plugin"
34+
]
35+
}
36+
},
3037
"require": {
3138
"php": "^8.1 | ^8.2 | ^8.3 | ^8.4",
3239
"ext-json": "*",
3340
"composer/installers": "^1.0 || ^2.0"
3441
},
3542
"require-dev": {
3643
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
37-
"humanmade/psalm-plugin-wordpress": "^3.0",
3844
"overtrue/phplint": "^9.1",
3945
"php-parallel-lint/php-parallel-lint": "^1.3",
4046
"php-stubs/wordpress-seo-stubs": "^20.5",
4147
"phpcompatibility/phpcompatibility-wp": "^2.1",
4248
"phpro/grumphp-shim": "^1.5",
4349
"roave/security-advisories": "dev-latest",
4450
"roots/wordpress-no-content": "^6.0",
45-
"vimeo/psalm": "^5.20",
46-
"wp-coding-standards/wpcs": "^3.0"
51+
"wp-coding-standards/wpcs": "^3.3",
52+
"wp-plugin/seo-by-rank-math": "1.0.272",
53+
"wp-plugin/wordpress-seo": "27.9",
54+
"wp-plugin/wp-seopress": "10.0.1"
55+
},
56+
"repositories": [
57+
{
58+
"name": "wp-packages",
59+
"type": "composer",
60+
"url": "https://repo.wp-packages.org"
61+
}
62+
],
63+
"autoload": {
64+
"psr-4": {
65+
"Blockparty\\Faq\\": "includes/"
66+
}
4767
},
4868
"scripts": {
4969
"cs": "./vendor/bin/phpcs",
50-
"cb": "./vendor/bin/phpcbf",
51-
"psalm": "./vendor/bin/psalm"
70+
"cb": "./vendor/bin/phpcbf"
5271
},
5372
"scripts-descriptions": {
5473
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
55-
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset.",
56-
"psalm": "Run psalm on codebase using custom ruleset."
74+
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset."
5775
}
5876
}

0 commit comments

Comments
 (0)