-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgive-test-data.php
51 lines (42 loc) · 1.62 KB
/
give-test-data.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php namespace GiveTestData;
use GiveTestData\Addon\Environment;
use GiveTestData\TestData\Helpers\Addons;
use GiveTestData\TestData\ServiceProvider;
/**
* Plugin Name: Give - Test Data Generator
* Plugin URI: https://givewp.com/
* Description: This plugin makes it easy to generate test (dummy) donors, donations, donation forms, and more using an easy-to-use interface.
* Version: 1.0.0
* Author: GiveWP
* Author URI: https://givewp.com/
* Text Domain: give-test-data
* Domain Path: /languages
*/
defined( 'ABSPATH' ) or exit;
// Add-on name
define( 'GIVE_TEST_DATA_NAME', 'Give - Test Data Generator' );
// Versions
define( 'GIVE_TEST_DATA_VERSION', '1.0.0' );
define( 'GIVE_TEST_DATA_MIN_GIVE_VERSION', '2.9.6' );
// Add-on paths
define( 'GIVE_TEST_DATA_FILE', __FILE__ );
define( 'GIVE_TEST_DATA_DIR', plugin_dir_path( GIVE_TEST_DATA_FILE ) );
define( 'GIVE_TEST_DATA_URL', plugin_dir_url( GIVE_TEST_DATA_FILE ) );
define( 'GIVE_TEST_DATA_BASENAME', plugin_basename( GIVE_TEST_DATA_FILE ) );
require GIVE_TEST_DATA_DIR . 'vendor/autoload.php';
// Register the add-on service provider with the GiveWP core.
add_action(
'before_give_init',
function () {
// Check Give min required version.
if ( Environment::giveMinRequiredVersionCheck() ) {
give()->registerServiceProvider( ServiceProvider::class );
// Load active add-ons
foreach ( Addons::getActiveAddons() as $addon ) {
give()->registerServiceProvider( $addon[ 'serviceProvider' ] );
}
}
}
);
// Check to make sure GiveWP core is installed and compatible with this add-on.
add_action( 'admin_init', [ Environment::class, 'checkEnvironment' ] );