Skip to content

Commit

Permalink
Convert to standalone plugin for easier development.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed May 13, 2024
1 parent 2b7f848 commit 35d23b8
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@

# WordPress content
/wp-content/

# Packages
/packages/
1 change: 0 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"https://downloads.wordpress.org/plugin/wp-plugin-dependencies.zip"
],
"mappings": {
"wp-content/plugins/pronamic-ideal": "../../../",
"wp-content/plugins/pronamic-pay-gravity-forms": "."
},
"config": {
Expand Down
21 changes: 19 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,37 @@
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"roots/wordpress-core-installer": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"automattic/jetpack-autoloader": true
},
"sort-packages": true,
"wp-slug": "pronamic-pay-gravity-forms"
},
"extra": {
"installer-paths": {
"packages/{$vendor}/{$name}": [
"vendor:pronamic",
"vendor:wp-pay",
"vendor:wp-pay-extensions",
"vendor:wp-pay-gateways",
"woocommerce/action-scheduler"
]
}
},
"require": {
"php": ">=8.0",
"automattic/jetpack-autoloader": "^3.0",
"composer/installers": "^2.2",
"pronamic/wp-datetime": "^2.1",
"pronamic/wp-gravityforms-nl": "^3.0",
"pronamic/wp-money": "^2.4",
"pronamic/wp-number": "^1.3",
"woocommerce/action-scheduler": "^3.7",
"wp-pay-gateways/mollie": "^4.10",
"wp-pay/core": "^4.16"
},
"require-dev": {
Expand Down
7 changes: 7 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
<exclude-pattern>tests/wp-config.php</exclude-pattern>

<exclude-pattern type="relative">^build/*</exclude-pattern>
<exclude-pattern type="relative">^node_modules/*</exclude-pattern>
<exclude-pattern type="relative">^packages/*</exclude-pattern>
<exclude-pattern type="relative">^vendor/*</exclude-pattern>
<exclude-pattern type="relative">^wordpress/*</exclude-pattern>
<exclude-pattern type="relative">^wp-content/*</exclude-pattern>

<rule ref="PronamicWP">
<exclude name="Squiz.Commenting" />

Expand Down
35 changes: 33 additions & 2 deletions pronamic-pay-gravityforms.php → pronamic-pay-gravity-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
* Author: Pronamic
* Author URI: https://www.pronamic.eu/
*
* Text Domain: pronamic-pay-gravityforms
* Text Domain: pronamic-pay-gravity-forms
* Domain Path: /languages/
*
* License: GPL-3.0-or-later
*
* Requires Plugins: pronamic-ideal
* Depends: wp-pay/core
*
* GitHub URI: https://github.com/pronamic/wp-pronamic-pay-gravityforms
Expand All @@ -27,6 +26,25 @@
* @package Pronamic\WordPress\Pay\Extensions\GravityForms
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Autoload.
*/
require_once __DIR__ . '/vendor/autoload_packages.php';

/**
* Bootstrap.
*/
\Pronamic\WordPress\Pay\Plugin::instance(
[
'file' => __FILE__,
'action_scheduler' => __DIR__ . '/packages/woocommerce/action-scheduler/action-scheduler.php',
]
);

add_filter(
'pronamic_pay_plugin_integrations',
function ( $integrations ) {
Expand All @@ -41,3 +59,16 @@ function ( $integrations ) {
return $integrations;
}
);

add_filter(
'pronamic_pay_gateways',
function ( $gateways ) {
$gateways[] = new \Pronamic\WordPress\Pay\Gateways\Mollie\Integration(
[
'manual_url' => \__( 'https://www.pronamicpay.com/en/manuals/how-to-connect-mollie-to-wordpress-with-pronamic-pay/', 'pronamic-pay-gravity-forms' ),
]
);

return $gateways;
}
);

0 comments on commit 35d23b8

Please sign in to comment.