PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.13.1
GiveWP – Donation Plugin and Fundraising Platform v2.13.1
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / TestData / Addons.php
Addons.php
65 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\TestData;
4
5 use Give\TestData\Addons\Funds\ServiceProvider as Funds;
6 use Give\TestData\Addons\CurrencySwitcher\ServiceProvider as CurrencySwitcher;
7 use Give\TestData\Addons\FeeRecovery\ServiceProvider as FeeRecovery;
8 use Give\TestData\Addons\RecurringDonations\ServiceProvider as RecurringDonations;
9 use Give\TestData\Addons\ManualDonations\ServiceProvider as ManualDonations;
10
11 /**
12 * Class Addons
13 * @package Give\TestData\Helpers
14 */
15 class Addons {
16 /**
17 * Get add-ons
18 *
19 * @return array[]
20 * @since 1.0.0
21 */
22 public static function getAddons() {
23 return [
24 [
25 'isActive' => defined( 'GIVE_FUNDS_VERSION' ),
26 'serviceProvider' => Funds::class,
27 ],
28 [
29 'isActive' => defined( 'GIVE_CURRENCY_SWITCHER_VERSION' ),
30 'serviceProvider' => CurrencySwitcher::class,
31 ],
32 [
33 'isActive' => defined( 'GIVE_RECURRING_VERSION' ),
34 'serviceProvider' => RecurringDonations::class,
35 ],
36 [
37 'isActive' => defined( 'GIVE_FEE_RECOVERY_VERSION' ),
38 'serviceProvider' => FeeRecovery::class,
39 ],
40 [
41 'isActive' => defined( 'GIVE_MD_VERSION' ),
42 'serviceProvider' => ManualDonations::class,
43 ],
44 [
45 'isActive' => defined( 'GIVE_FUNDS_ADDON_VERSION' ),
46 'serviceProvider' => Funds::class,
47 ],
48 ];
49 }
50
51 /**
52 * Get active add-ons
53 * @return array[]
54 * @since 1.0.0
55 */
56 public static function getActiveAddons() {
57 return array_filter(
58 self::getAddons(),
59 function ( $addon ) {
60 return $addon['isActive'];
61 }
62 );
63 }
64 }
65