Skip to content

Commit 9001085

Browse files
author
Mike van den Hoek
committed
feat: upgrade to php8
1 parent 9fae22c commit 9001085

25 files changed

+1504
-771
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
!.gitignore
3838

3939
!.php-cs-fixer.php
40+
.php-cs-fixer.cache
4041

4142
# Eslint
4243
!.eslintrc
@@ -64,6 +65,7 @@ Thumbs.db
6465
*.log
6566
*.sql
6667
*.sqlite
68+
pg-log-*.json
6769

6870
# ignore compiled files
6971
*.com

README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
## Description
44

5-
Prefill GravityForms fields, based on the dutch BSN number. Retrieve personal information and place these values in the corrensponding fields.
5+
Prefill GravityForms fields, based on the Dutch BSN number. Retrieve personal information and place these values in the corrensponding fields.
66

77
## Dependencies
88

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

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

14-
See [here](https://github.com/OpenWebconcept/plugin-prefill-gravity-forms/blob/main/config/core.php) for more details.
13+
In addition, at least one of the following plug-ins must be installed to enable authentication by BSN:
14+
15+
- Yard | GravityForms DigiD (<https://github.com/yardinternet/owc-gravityforms-digid>)
16+
- OWC Signicat OpenID (<https://github.com/yardinternet/plugin-owc-signicat-openid>)
1517

1618
## Features
1719

@@ -46,7 +48,7 @@ See [here](https://github.com/OpenWebconcept/plugin-prefill-gravity-forms/blob/m
4648
2. Go to the form settings of the form you want to configure.
4749
3. Scroll down and look for the 'iConnect' panel and configure the settings.
4850

49-
### 🔐 Cache Encryption
51+
### Cache Encryption
5052

5153
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.
5254

@@ -66,3 +68,31 @@ Important:
6668
## License
6769

6870
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.
71+
72+
## Logging
73+
74+
Enable logging to monitor errors during communication with the BRP suppliers.
75+
76+
- Logs are written daily to `pg-log{-date}.json` in the WordPress webroot directory.
77+
- A rotating file handler keeps up to 7 log files by default, deleting the oldest as needed.
78+
- You can change the maximum number of log files using the filter described below.
79+
80+
## Hooks
81+
82+
### Change the maximum number of log files
83+
84+
Use the following filter to alter the rotating file handler's max files setting:
85+
86+
```php
87+
apply_filters('pg::logger/rotating_filer_handler_max_files', PG_LOGGER_DEFAULT_MAX_FILES)
88+
```
89+
90+
### Intercept exceptions for custom handling
91+
92+
You can intercept exceptions caught by the plugin for additional processing or custom logging using this filter:
93+
94+
```php
95+
do_action('pg::exception/intercept', $exception, $method)
96+
```
97+
98+
The `$exception` parameter contains the caught exception object.

build/blocks.asset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<?php return ['dependencies' => ['react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'], 'version' => 'e0a9481f8d532339066b'];
1+
<?php
2+
3+
return ['dependencies' => ['react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'], 'version' => '33b24b2f8a8b7ff4f915'];

build/icons.asset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<?php return ['dependencies' => [], 'version' => '02fa92c9250ff7f119f3'];
1+
<?php
2+
3+
return ['dependencies' => [], 'version' => '12341f29470476729a0c'];

build/style.asset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<?php return ['dependencies' => [], 'version' => 'd63fd4982613309d5c57'];
1+
<?php
2+
3+
return ['dependencies' => [], 'version' => 'd63fd4982613309d5c57'];

composer.json

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
{
2-
"name": "plugin/prefill-gravity-forms",
3-
"description": "Prefill GravityForms Plugin",
4-
"authors": [
5-
{
6-
"name": "Yard | Digital Agency",
7-
"email": "[email protected]",
8-
"homepage": "https://www.yard.nl"
9-
}
10-
],
11-
"type": "wordpress-plugin",
12-
"repositories": [
13-
{
14-
"type": "composer",
15-
"url": "https://wpackagist.org"
16-
},
17-
{
2+
"name": "plugin/prefill-gravity-forms",
3+
"description": "Prefill GravityForms Plugin",
4+
"authors": [
5+
{
6+
"name": "Yard | Digital Agency",
7+
"email": "[email protected]",
8+
"homepage": "https://www.yard.nl"
9+
}
10+
],
11+
"type": "wordpress-plugin",
12+
"repositories": [
13+
{
14+
"type": "composer",
15+
"url": "https://wpackagist.org"
16+
},
17+
{
1818
"type": "vcs",
1919
"url": "[email protected]:OpenWebconcept/idp-userdata"
2020
}
21-
],
22-
"require": {
23-
"php": ">=7.0",
24-
"php-di/php-di": "^6.0",
25-
"owc/idp-userdata": "^1.0"
26-
},
27-
"require-dev": {
28-
"mockery/mockery": "^1.0",
29-
"phpunit/phpunit": "^9.0",
30-
"10up/wp_mock": "^0.5.0",
31-
"friendsofphp/php-cs-fixer": "^3.0",
32-
"phpstan/phpstan": "^0.12",
33-
"szepeviktor/phpstan-wordpress": "^0.6.0"
34-
},
35-
"autoload": {
36-
"psr-4": {
37-
"OWC\\PrefillGravityForms\\": "./src/PrefillGravityForms"
38-
}
39-
},
40-
"autoload-dev": {
41-
"psr-4": {
42-
"OWC\\PrefillGravityForms\\Tests\\": "./tests/Unit"
43-
}
44-
},
45-
"scripts": {
46-
"test": "clear && ./vendor/bin/phpunit --testsuite 'Unit Test Suite' --colors=always",
47-
"format": "vendor/bin/php-cs-fixer fix",
48-
"phpstan": "./vendor/bin/phpstan analyse"
49-
}
21+
],
22+
"require": {
23+
"php": "^8.0",
24+
"php-di/php-di": "^7.0",
25+
"owc/idp-userdata": "^1.0"
26+
},
27+
"require-dev": {
28+
"10up/wp_mock": "^0.5.0",
29+
"friendsofphp/php-cs-fixer": "^3.0",
30+
"mockery/mockery": "^1.0",
31+
"phpunit/phpunit": "^9.0",
32+
"szepeviktor/phpstan-wordpress": "^1.0"
33+
},
34+
"autoload": {
35+
"psr-4": {
36+
"OWC\\PrefillGravityForms\\": "./src/PrefillGravityForms"
37+
}
38+
},
39+
"autoload-dev": {
40+
"psr-4": {
41+
"OWC\\PrefillGravityForms\\Tests\\": "./tests/Unit"
42+
}
43+
},
44+
"scripts": {
45+
"test": "clear && ./vendor/bin/phpunit --testsuite 'Unit Test Suite' --colors=always",
46+
"format": "vendor/bin/php-cs-fixer fix",
47+
"phpstan": "./vendor/bin/phpstan analyse"
48+
}
5049
}

0 commit comments

Comments
 (0)