PluginProbe
The Innovative Form Builder – IvyForms / 1.0
The Innovative Form Builder – IvyForms v1.0
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Integrations / IntegrationService.php

IntegrationService.php in The Innovative Form Builder – IvyForms 1.0, at backend/src/Services/Integrations/IntegrationService.php

127 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\Integrations;
4
5 use IvyForms\Common\Exceptions\InvalidArgumentException;
6
7 /**
8 * Integration Service
9 *
10 * Initializes the integration registry and registers default Lite integrations
11 *
12 * @since 1.0.0
13 */
14 class IntegrationService
15 {
16 private IntegrationRegistry $registry;
17
18 public function __construct(IntegrationRegistry $registry)
19 {
20 $this->registry = $registry;
21 }
22
23 /**
24 * Initialize integrations
25 *
26 * @return void
27 * @throws InvalidArgumentException
28 */
29 public function init(): void
30 {
31 // Register Lite integrations
32 $this->registerLiteIntegrations();
33
34 /**
35 * Allow Pro/addons to register their integrations
36 *
37 * @since 1.0.0
38 *
39 * @param IntegrationRegistry $registry The integration registry instance
40 */
41 do_action('ivyforms/integrations/register', $this->registry);
42 }
43
44 /**
45 * Register default Lite integrations
46 *
47 * @return void
48 * @throws InvalidArgumentException
49 */
50 private function registerLiteIntegrations(): void
51 {
52 // wpDataTables Integration (Lite)
53 $this->registry->register('wpdatatables', [
54 'label' => 'wpdatatables_label',
55 'component' => 'WpDataTablesIntegrationSettings',
56 'icon' => 'wpdatatables',
57 'description' => 'wpdatatables_description',
58 'category' => 'Data Management',
59 'requiresAuth' => false,
60 'plan' => 'lite',
61 'settingsSchema' => [
62 'enabled' => [
63 'type' => 'boolean',
64 'default' => false,
65 ],
66 ],
67 ]);
68
69 // Register Pro integrations as placeholders
70 // These will be shown with "Upgrade" button when Pro is not installed
71 // When Pro is installed, these will be overwritten by Pro's registrar
72
73 // MailChimp Integration (Pro - Essentials)
74 $this->registry->register('mailchimp', [
75 'label' => 'mailchimp_label',
76 'component' => 'MailChimpIntegrationSettings',
77 'icon' => 'mailchimp',
78 'description' => 'mailchimp_description',
79 'category' => 'Email Marketing',
80 'requiresAuth' => true,
81 'hasGlobalSettings' => true,
82 'plan' => 'essentials',
83 ]);
84
85 // Webhooks Integration (Pro - Growth)
86 $this->registry->register('webhooks', [
87 'label' => 'webhooks_label',
88 'component' => 'WebhooksIntegrationSettings',
89 'icon' => 'webhooks',
90 'description' => 'webhooks_description',
91 'category' => 'Developer Tools',
92 'requiresAuth' => false,
93 'hasGlobalSettings' => false,
94 'plan' => 'growth',
95 'learnMoreUrl' => 'https://ivyforms.com/documentation/webhooks-integration/',
96 'settingsSchema' => [
97 'enabled' => [
98 'type' => 'boolean',
99 'default' => false,
100 ],
101 ],
102 ]);
103
104 // Zapier Integration (Pro - Growth)
105 // $this->registry->register('zapier', [
106 // 'label' => 'zapier_label',
107 // 'component' => 'ZapierIntegrationSettings',
108 // 'icon' => 'zapier',
109 // 'description' => 'zapier_description',
110 // 'category' => 'Automation',
111 // 'requiresAuth' => false,
112 // 'plan' => 'growth',
113 // ]);
114
115 // Salesforce Integration (Pro - Agency)
116 // $this->registry->register('salesforce', [
117 // 'label' => 'salesforce_label',
118 // 'component' => 'SalesforceIntegrationSettings',
119 // 'icon' => 'salesforce',
120 // 'description' => 'salesforce_description',
121 // 'category' => 'CRM',
122 // 'requiresAuth' => true,
123 // 'plan' => 'agency',
124 // ]);
125 }
126 }
127