Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0aa345a
feat: upgrade to php8
Apr 30, 2025
2b4ced8
feat: user object model class
Nov 19, 2025
17b8d54
feat: conditional usage of ssl certificates
Jan 7, 2026
36fa542
refactor: update block registration + prefix to make blocks visible i…
Jan 8, 2026
be45b61
fix: remove some default values in GFAddon settings
Jan 8, 2026
c6c1cc6
fix: validate certificates and their paths
mvdhoek1 Jan 21, 2026
417fe16
fix: personal data row inner block
mvdhoek1 Feb 5, 2026
4f469d0
fix: make sure getValueFromNestedArray() returns string in PersonalDa…
mvdhoek1 Feb 12, 2026
2238baa
fix: mapping options vrijbrp
mvdhoek1 Feb 18, 2026
931c7af
refactor: snake_case to camelCase
mvdhoek1 Feb 19, 2026
867aef4
chore(8343): add missing information to personal data block for mijng…
Rovasch Feb 27, 2026
e3e59dd
refactor: pr comments
Rovasch Feb 27, 2026
ca1d728
chore: run composer format script
mvdhoek1 Mar 3, 2026
21d2448
chore: remove EnableU as supplier with exceptions
mvdhoek1 Mar 4, 2026
fc89ca3
feat: add fullName class method to UserModel
mvdhoek1 Mar 4, 2026
ca00864
fix: usage of SSL certs in WeAreFrankController
mvdhoek1 Mar 9, 2026
3b46225
feat: add mTLS certificate configuration with passphrase support and …
mvdhoek1 Mar 10, 2026
f97d6b5
refactor: verify SSL peer and host when using client certificates
mvdhoek1 Mar 10, 2026
3942a1b
feat: expand UserModel class
mvdhoek1 Mar 12, 2026
0c44d46
feat: upgrade to php8
Apr 30, 2025
2a4cfd1
refactor: update block registration + prefix to make blocks visible i…
Jan 8, 2026
10b5e88
feat: Pink and EnableU v2 implementation
Jan 9, 2026
1779cc5
chore: update mapping options BRP V2
mvdhoek1 Mar 26, 2026
5137da8
fix: bsn location in response
mvdhoek1 Mar 31, 2026
3eea278
fix: set supplier certificate as CA to support self-signed certificates
mvdhoek1 Mar 31, 2026
0bbd063
refactor: rename doelBinding to goalBinding
mvdhoek1 Apr 2, 2026
2057712
chore: update mapping options BRP V2
mvdhoek1 Apr 2, 2026
c4b5371
fix: personal data service class, also improves V2 usage
mvdhoek1 Apr 8, 2026
77abd87
fix: separate cache for personal data service and form requests
mvdhoek1 Apr 9, 2026
fd1ed6d
refactor: VrijBRP mapping options
mvdhoek1 May 4, 2026
82683e4
refactor: VrijBRP controller has specific Curl headers
mvdhoek1 May 4, 2026
aac9596
fix: Broken curl error handling
dtakken May 4, 2026
dcd7b48
fix: escape output and strip version suffix in personal data row block
mvdhoek1 May 11, 2026
5badfe1
chore: update README.md
mvdhoek1 May 11, 2026
95e0f5c
fix: mapping options VrijBRP
mvdhoek1 May 20, 2026
4555d1d
fix: use general goal binding when none is used in the request
mvdhoek1 May 26, 2026
e93a5a7
fix: validate SSL certs
mvdhoek1 May 26, 2026
2887246
fix: path traversal bypass
mvdhoek1 May 26, 2026
5583b06
fix: prevent octal conversion from stripping leading zeros in BSN
mvdhoek1 May 26, 2026
c454db7
chore: improve README.md
mvdhoek1 May 29, 2026
71e281c
chore: add github release and dependabot workflows
mvdhoek1 Jun 3, 2026
777de49
release: v2.0.0
mvdhoek1 Jun 3, 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
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Basic set up for two package managers

version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: 'github-actions'
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
directory: '/'
schedule:
interval: 'weekly'
groups:
actions:
patterns:
- '*'
commit-message:
prefix: 'chore'

# Maintain dependencies for Composer
- package-ecosystem: 'composer'
directory: '/'
schedule:
interval: 'weekly'
groups:
composer:
patterns:
- '*'
commit-message:
prefix: 'chore'
versioning-strategy: lockfile-only
11 changes: 11 additions & 0 deletions .github/workflows/composer-lock-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Composer Diff

on:
pull_request:
paths:
- 'composer.lock'

jobs:
composer-diff:
uses: yardinternet/workflows/.github/workflows/composer-lock-diff.yml@main
secrets: inherit
22 changes: 22 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot automerge

on:
- pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr comment "$PR_URL" --body "@dependabot merge"
env:
PR_URL: ${{github.event.pull_request.html_url}}
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Auto Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
# track this file .gitignore (i.e. do NOT ignore it)
!.gitignore

!.github
!.php-cs-fixer.php
.php-cs-fixer.cache

# Eslint
!.eslintrc
Expand Down Expand Up @@ -64,6 +66,7 @@ Thumbs.db
*.log
*.sql
*.sqlite
pg-log-*.json

# ignore compiled files
*.com
Expand Down
69 changes: 35 additions & 34 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,40 @@
declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->notPath('vendor')
->notPath('node_modules')
->in(__DIR__)
->in('./resources/views')
->in('./config')
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
->notPath('vendor')
->notPath('node_modules')
->in(__DIR__)
->in('./resources/views')
->in('./config')
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config)
->setRules([
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short',
],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'no_unused_imports' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'=>' => null,
'|' => 'no_space',
],
],
'full_opening_tag' => true,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
])
->setFinder($finder);
->setRules([
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short',
],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'no_unused_imports' => true,
'array_indentation' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'=>' => 'single_space',
'|' => 'no_space',
],
],
'full_opening_tag' => true,
'yoda_style' => [
'always_move_variable' => true,
'equal' => true,
'identical' => true,
'less_and_greater' => true,
],
])
->setFinder($finder);
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Changelog

- Tested up to: WordPress 6.8.3
## [v2.0.0] - 2026-06-03

- Added: upgrade to PHP 8
- Added: user object model class with fullName support
- Added: mTLS certificate configuration with passphrase support and improved tooltips
- Added: conditional usage of SSL certificates
- Added: Pink and EnableU v2 implementation
- Fix: prevent octal conversion from stripping leading zeros in BSN
- Fix: path traversal bypass
- Fix: validate SSL certificates and their paths
- Fix: set supplier certificate as CA to support self-signed certificates
- Fix: use general goal binding when none is used in the request
- Fix: mapping options VrijBRP
- Fix: broken cURL error handling
- Fix: separate cache for personal data service and form requests
- Fix: personal data service class, also improves V2 usage
- Fix: BSN location in response
- Fix: escape output and strip version suffix in personal data row block
- Fix: personal data row inner block
- Fix: remove some default values in GF Addon settings
- Change: VrijBRP controller uses specific cURL headers
- Change: rename doelBinding to goalBinding
- Change: update block registration and prefix to make blocks visible in editor
- Change: verify SSL peer and host when using client certificates
- Chore: update mapping options BRP V2
- Chore: remove EnableU as supplier
- Chore: add missing information to personal data block for mijngegevens page
- Chore: improve README.md

## v1.9.1

Expand Down
100 changes: 91 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

## Description

Prefill GravityForms fields, based on the dutch BSN number. Retrieve personal information and place these values in the corrensponding fields.
Prefill GravityForms fields, based on the Dutch BSN number. Retrieve personal information and place these values in the corrensponding fields.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misschien wat miereneukerig 😶 :
Retrieves personal information and places these values in the corrensponding fields.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Altijd blijven mierenneuken 🐜


## Dependencies

In order to use this plug-in there are two required plug-ins:
To use this plug-in, the following dependencies are required:

- GravityForms (premium)
- Yard | GravityForms DigiD (private repo, contact [Yard | Digital Agency](https://www.yard.nl/) for access)

See [here](https://github.com/OpenWebconcept/plugin-prefill-gravity-forms/blob/main/config/core.php) for more details.
In addition, at least one of the following plug-ins must be installed to enable authentication by BSN:

- Yard | GravityForms DigiD (<https://github.com/yardinternet/owc-gravityforms-digid>)
- OWC Signicat OpenID (<https://github.com/yardinternet/plugin-owc-signicat-openid>)

## Features

Expand Down Expand Up @@ -39,14 +41,14 @@ See [here](https://github.com/OpenWebconcept/plugin-prefill-gravity-forms/blob/m

1. Go to '/wp-admin/admin.php?page=gf_settings&subview=owc-gravityforms-iconnect' and configure all the required settings.

- 1. Suppliers will provide the needed certificates which need to be selected in order to make prefilling form fields work.
- 2. Suppliers will also provide an API-key, certificates password (if needed) and a base URL.
- 3. [OIN](https://logius.nl/domeinen/toegang/organisatie-identificatienummer/wat-is-het) is a unique number for organizations provided by Logius.
- 1. Suppliers will provide the needed certificates which need to be selected in order to make prefilling form fields work.
- 2. Suppliers will also provide an API-key, certificates password (if needed) and a base URL.
- 3. [OIN](https://logius.nl/domeinen/toegang/organisatie-identificatienummer/wat-is-het) is a unique number for organizations provided by Logius.

2. Go to the form settings of the form you want to configure.
3. Scroll down and look for the 'iConnect' panel and configure the settings.
3. Scroll down and look for the 'OWC Prefill' panel and configure the settings.

### 🔐 Cache Encryption
### Cache Encryption

To enable secure caching of sensitive data, you **must define an encryption key** in your `wp-config.php` file. This key is used to encrypt and decrypt the cached data and should be kept secret at all times.

Expand All @@ -66,3 +68,83 @@ Important:
## License

The source code is made available under the [EUPL 1.2 license](https://github.com/OpenWebconcept/plugin-prefill-gravity-forms/blob/main/LICENSE.md). Some of the dependencies are licensed differently, with the BSD or MIT license, for example.

## User model

The `UserModel` provides a simple way to access BRP (Basisregistratie Personen) data that has been retrieved after a valid DigiD login.
It automatically detects which data supplier is configured (in the add-on settings), loads the correct controller, and exposes a small set of helper methods for use in templates or form-prefill logic.

Before accessing any user attributes, always check whether the user is authenticated using DigiD.

### Usage

```php
$user = new \OWC\PrefillGravityForms\Models\UserModel();

if ( $user->isLoggedIn() ) {
$bsn = $user->bsn();
$age = $user->age();
}
```

This model does not handle authentication itself, it only exposes data retrieved by the underlying BRP supplier controller.
If a controller fails to load (e.g., misconfiguration or missing supplier), the model gracefully returns default values.

To use this model, make sure it is enabled in the settings available at '/wp-admin/admin.php?page=gf_settings&subview=owc-gravityforms-iconnect'.
Otherwise, the object will be instantiated but will not contain any data.

## Gutenberg blocks

This plugin ships with two Gutenberg blocks for displaying personal data of the logged-in user on any page.

- **Personal Data Table** (`owc-prefill-gravity-forms/personal-data-table`) — a container block that wraps rows in an HTML table (`<table>`).
- **Personal Data Row** (`owc-prefill-gravity-forms/personal-data-row`) — displays a single personal data field. When placed inside the table block it renders as a `<tr>`, otherwise as a configurable HTML element (`<div>`, `<p>`, or `<span>`).

Each Personal Data Row block must be configured in the block sidebar:

| Setting | Description |
|---|---|
| Supplier | Must match the supplier configured in the plugin settings. |
| Goal binding | Required for HaalCentraal API v2 — determines which fields are returned. |
| Processing | Optional processing context for HaalCentraal API v2. |
| Personal data field | The specific BRP attribute to display (e.g. name, date of birth). |

## Logging

Enable logging to monitor errors during communication with the BRP suppliers.

- Logs are written daily to `pg-log{-date}.json` in the WordPress webroot directory.
- A rotating file handler keeps up to 7 log files by default, deleting the oldest as needed.
- You can change the maximum number of log files using the filter described below.

## Hooks

### Change the maximum number of log files

Use the following filter to alter the rotating file handler's max files setting:

```php
apply_filters('pg::logger/rotating_filer_handler_max_files', PG_LOGGER_DEFAULT_MAX_FILES)
```

### Intercept exceptions for custom handling

You can intercept exceptions caught by the plugin for additional processing or custom logging using this filter:

```php
do_action('pg::exception/intercept', $exception, $method)
```

The `$exception` parameter contains the caught exception object.

### Provide Custom Mapping Options from a Theme Directory

This plugin includes supplier-specific mapping option files. In version 1 of the "HaalCentraal API", all available fields were returned, even when only a subset was needed.

Since version 2 of HaalCentraal, this has changed: the goal binding (doelbinding) now determines which fields are returned. This results in a more concise dataset that contains only the necessary fields. Because each municipality (gemeente) can define its own unique goal bindings and corresponding fields, this plugin cannot include all possible mapping configurations by default.

```php
add_filter('pg::theme/dir_mapping_options', function ($value) {
return __DIR__ . '/templates/owc-prefill/';
}, 10, 1);
```
1 change: 0 additions & 1 deletion build/blocks.asset.php

This file was deleted.

1 change: 0 additions & 1 deletion build/blocks.js

This file was deleted.

1 change: 1 addition & 0 deletions build/icons-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/icons.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return ['dependencies' => [], 'version' => '12341f29470476729a0c'];
<?php return ['dependencies' => [], 'version' => 'eafbc2f5130762d2e52d'];
Loading
Loading