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 7, 2024
1 parent 33b9e13 commit 9b64aee
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 11 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/
3 changes: 1 addition & 2 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
"plugins": [
"pronamic/wp-env-quick-login",
"pronamic/wp-pronamic-pay-test-helper",
"https://downloads.wordpress.org/plugin/restrict-content.3.1.5.zip",
"https://downloads.wordpress.org/plugin/restrict-content.zip",
"https://downloads.wordpress.org/plugin/pronamic-client.zip",
"https://downloads.wordpress.org/plugin/query-monitor.zip",
"https://downloads.wordpress.org/plugin/one-time-login.zip",
"https://downloads.wordpress.org/plugin/wp-plugin-dependencies.zip"
],
"mappings": {
"wp-content/plugins/pronamic-ideal": "../../../",
"wp-content/plugins/pronamic-pay-restrict-content": "."
},
"config": {
Expand Down
21 changes: 17 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-pay-extensions/restrict-content-pro",
"description": "Restrict Content Pro driver for the WordPress payment processing library.",
"description": "Restrict Content (Pro) driver for the WordPress payment processing library.",
"keywords": [
"wordpress",
"wp",
Expand Down Expand Up @@ -43,13 +43,25 @@
"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
},
"platform": {
"php": "8.0"
},
"sort-packages": true,
"wp-slug": "pronamic-pay-restrict-content-pro"
"wp-slug": "pronamic-pay-restrict-content"
},
"extra": {
"installer-paths": {
"packages/{$vendor}/{$name}": [
"vendor:pronamic",
"vendor:wp-pay",
"vendor:wp-pay-extensions",
"vendor:wp-pay-gateways",
"woocommerce/action-scheduler"
]
}
},
"repositories": [
{
Expand All @@ -63,7 +75,9 @@
],
"require": {
"php": ">=8.0",
"automattic/jetpack-autoloader": "^3.0",
"pronamic/wp-money": "^2.2",
"woocommerce/action-scheduler": "^3.7",
"wp-pay/core": "^4.6"
},
"require-dev": {
Expand All @@ -73,7 +87,6 @@
"phpstan/phpstan": "^1.10",
"pronamic/pronamic-cli": "^1.0",
"pronamic/wp-coding-standards": "^2.1",
"restrictcontentpro/restrict-content": "2.2.3",
"roots/wordpress": "^6.0",
"szepeviktor/phpstan-wordpress": "^1.3",
"vimeo/psalm": "^5.24",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "restrict-content-pro",
"version": "4.4.4",
"description": "Restrict Content Pro driver for the WordPress payment processing library.",
"description": "Restrict Content (Pro) driver for the WordPress payment processing library.",
"repository": {
"type": "git",
"url": "https://github.com/wp-pay-extensions/restrict-content-pro"
Expand Down
26 changes: 22 additions & 4 deletions pronamic-pay-rcp.php → pronamic-pay-restrict-content.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* Plugin Name: Pronamic Pay Restrict Content Pro Add-On
* Plugin Name: Pronamic Pay Restrict Content (Pro) Add-On
* Plugin URI: https://www.pronamic.eu/plugins/pronamic-pay-restrict-content-pro/
* Description: Extend the Pronamic Pay plugin with Restrict Content Pro support to receive payments through a variety of payment providers.
* Description: Extend the Pronamic Pay plugin with Restrict Content (Pro) support to receive payments through a variety of payment providers.
*
* Version: 4.4.4
* Requires at least: 4.7
Expand All @@ -11,12 +11,11 @@
* Author: Pronamic
* Author URI: https://www.pronamic.eu/
*
* Text Domain: pronamic-pay-rcp
* Text Domain: pronamic-pay-restrict-content
* Domain Path: /languages/
*
* License: GPL-3.0-or-later
*
* Requires Plugins: pronamic-ideal
* Depends: wp-pay/core
*
* GitHub URI: https://github.com/wp-pay-extensions/restrict-content-pro
Expand All @@ -27,6 +26,25 @@
* @package Pronamic\WordPress\Pay\Extensions\RestrictContentPro
*/

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 Down

0 comments on commit 9b64aee

Please sign in to comment.