PluginProbe ʕ •ᴥ•ʔ
OttoKit: All-in-One Automation Platform / trunk
OttoKit: All-in-One Automation Platform vtrunk
1.1.31 1.1.30 1.1.29 1.1.28 1.1.27 1.1.9 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.47 1.0.48 1.0.49 1.0.50 1.0.51 1.0.52 1.0.53 1.0.54 1.0.55 1.0.56 1.0.57 1.0.58 1.0.59 1.0.60 1.0.61 1.0.62 1.0.63 1.0.64 1.0.65 1.0.66 1.0.67 1.0.68 1.0.69 1.0.7 1.0.70 1.0.71 1.0.72 1.0.73 1.0.74 1.0.75 1.0.76 1.0.77 1.0.78 1.0.79 1.0.8 1.0.80 1.0.81 1.0.82 1.0.83 1.0.84 1.0.85 1.0.86 1.0.87 1.0.88 1.0.89 1.0.9 1.0.90 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.20 1.1.21 1.1.22 1.1.23 1.1.24 1.1.25 1.1.26 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8
suretriggers / src / Integrations / Integrations.php
suretriggers / src / Integrations Last commit date
CluevoLms 1 month ago JetEngineCCT 2 months ago SureDash 4 weeks ago academylms 9 months ago advanced-ads 2 years ago advanced-coupons 5 months ago advanced-custom-fields 9 months ago advanced-forms 1 month ago affiliatewp 9 months ago amelia 2 weeks ago appointment-hour-booking 1 month ago asgaros 2 years ago badgeos 3 years ago bbpress 9 months ago beaver-builder 11 months ago better-messages 9 months ago bookingpress 4 weeks ago bookly 1 month ago bricks-builder 11 months ago bricksforge 4 weeks ago buddyboss 4 weeks ago buddypress 9 months ago cartflows 1 year ago clickwhale 9 months ago code-snippets 2 months ago contact-form7 10 months ago convertpro 1 year ago divi-builder 1 year ago easy-affiliate 9 months ago edd 4 weeks ago elementor-pro 11 months ago event-calendar 3 months ago event-espresso 1 month ago eventon 1 month ago eventprime 2 months ago events-manager 2 months ago everest-forms 2 months ago fluent-boards 1 month ago fluent-booking 8 months ago fluent-form 2 months ago fluent-support 9 months ago fluentaffiliate 5 months ago fluentcart 6 months ago fluentcommunity 5 months ago fluentcrm 1 month ago fluentsmtp 1 year ago formidable-forms 1 month ago forminator 3 years ago funnel-kit-automations 9 months ago gamipress 9 months ago geo-directory 9 months ago givewp 9 months ago gravity-form 9 months ago gravity-kit 2 years ago groundhogg 7 months ago groups-itthinx 1 month ago happyforms 3 years ago jet-appointments-booking 5 months ago jetengine 3 years ago jetformbuilder 1 year ago jetpack-crm 5 months ago kadence-forms 3 months ago late-point 1 month ago learndash 3 months ago learndash-achievements 9 months ago learnpress 9 months ago lifterlms 9 months ago mail-mint 9 months ago mailerpress 6 months ago mailpoet 9 months ago masteriyo 2 years ago masterstudy-lms 9 months ago memberpress 2 weeks ago memberpress-course 2 months ago metabox 9 months ago metform 3 years ago modern-events-calendar 9 months ago mycred 9 months ago new-user-approve 4 months ago newsletter 5 months ago ninja-forms 3 years ago ninja-tables 1 month ago paid-memberships-pro 9 months ago paymattic 9 months ago peepso 9 months ago pie-forms 3 years ago powerful-docs 1 year ago presto-player 9 months ago pretty-links 8 months ago profilegrid 1 year ago profilepress 9 months ago projecthuddle 9 months ago raffle-press 9 months ago redirection 2 months ago restrict-content 9 months ago secure-custom-fields 1 month ago sensei-lms 9 months ago services-for-surecart 1 year ago simply-schedule-appointments 2 years ago slice-wp 9 months ago spaces-engine 1 month ago storeengine 2 months ago support-genix 1 month ago support-portal-for-surecart 1 year ago suredash 3 months ago sureforms 3 months ago suremail 1 year ago suremembers 3 weeks ago teams-for-woocommerce-memberships 2 months ago thrive-apprentice 6 months ago thrive-leads 1 year ago thrive-ovation 5 months ago triggerbutton 1 year ago tutorlms 4 months ago ultimate-addons-for-gutenberg 3 years ago ultimate-member 9 months ago voxel 4 months ago wishlistmember 8 months ago woocommerce 3 months ago woocommerce-bookings 2 years ago woocommerce-memberships 9 months ago woocommerce-shipstation 2 years ago woocommerce-subscriptions 5 months ago wordpress 3 months ago wp-all-import 2 years ago wp-courseware 9 months ago wp-fusion 9 months ago wp-job-manager 3 years ago wp-polls 2 months ago wp-simple-pay 2 years ago wp-travel-engine 1 month ago wp-user-manager 2 years ago wpadverts 2 months ago wpcafe 4 months ago wpforms 8 months ago wpforo 9 months ago wpfunnels 2 months ago wplms 11 months ago wployalty 9 months ago wpsubscription 9 months ago ws-form 1 year ago AutomateAction.php 11 months ago Integrations.php 11 months ago
Integrations.php
251 lines
1 <?php
2 /**
3 * Integration base class file
4 *
5 * @package SureTrigger
6 * @since 1.0.0
7 */
8
9 namespace SureTriggers\Integrations;
10
11 use SureTriggers\Controllers\EventController;
12
13 if ( ! function_exists( 'is_plugin_active' ) ) {
14 include_once ABSPATH . 'wp-admin/includes/plugin.php';
15 }
16
17 /**
18 * Class Integrations
19 *
20 * @package SureTriggers\Integrations
21 */
22 abstract class Integrations {
23
24 /**
25 * ID of the integration
26 *
27 * @var string
28 */
29 protected $id;
30
31 /**
32 * Integration Name
33 *
34 * @var string
35 */
36 protected $name;
37
38 /**
39 * Integration Description
40 *
41 * @var string
42 */
43 protected $description;
44
45 /**
46 * Integration icon/logo URL
47 *
48 * @var string
49 */
50 protected $icon_url;
51
52 /**
53 * Contains configuration form fields.
54 *
55 * @var array
56 */
57 protected $config_fields = [];
58
59 /**
60 * Contains saved configurations
61 *
62 * @var array
63 */
64 protected $config = [];
65
66 /**
67 * Contains errors list
68 *
69 * @var array
70 */
71 protected $errors = [];
72
73 /**
74 * If the form should be verify or not.
75 *
76 * @var bool
77 */
78 protected $form_validation = false;
79
80 /**
81 * Get api key page URL
82 *
83 * @var null|bool
84 */
85 protected $api_page_url = null;
86
87 /**
88 * Contains it's actions list, if any. For the future usage
89 *
90 * @var array
91 */
92 protected $actions = [];
93
94 /**
95 * Contains it's triggers list, if any. For the future usage
96 *
97 * @var array
98 */
99 protected $triggers = [];
100
101 /**
102 * Integrations constructor.
103 */
104 public function __construct() {
105 $this->process_events();
106 }
107
108 /**
109 * Process and get all events
110 *
111 * @return void
112 */
113 public function process_events() {
114 $events = EventController::get_instance();
115
116 if ( ! empty( $events->triggers[ $this->id ] ) ) {
117 $this->triggers = $events->triggers[ $this->id ];
118 }
119
120 if ( ! empty( $events->actions[ $this->id ] ) ) {
121 $this->actions = $events->actions[ $this->id ];
122 }
123 }
124
125 /**
126 * If enabled or not
127 *
128 * @return bool
129 */
130 public function is_enabled() {
131 return (bool) $this->is_plugin_installed();
132 }
133
134 /**
135 * Check if plugin is installed.
136 *
137 * @return bool
138 */
139 abstract public function is_plugin_installed();
140
141 /**
142 * Returns ID
143 *
144 * @return string
145 */
146 public function get_id() {
147 return $this->id;
148 }
149
150 /**
151 * Returns integration name
152 *
153 * @return string
154 */
155 public function get_name() {
156 return $this->name;
157 }
158
159 /**
160 * Returns integration description
161 *
162 * @return string
163 */
164 public function get_description() {
165 return $this->description;
166 }
167
168 /**
169 * Get the integration URL
170 *
171 * @return string
172 */
173 public function get_icon_url() {
174 return $this->icon_url;
175 }
176
177 /**
178 * Get config form fields
179 *
180 * @return array
181 */
182 public function get_config_fields() {
183 return $this->config_fields;
184 }
185
186 /**
187 * Get saved
188 *
189 * @return array
190 */
191 public function get_config() {
192 return $this->config;
193 }
194
195 /**
196 * Get errors if any
197 *
198 * @return array
199 */
200 public function get_errors() {
201 return $this->errors;
202 }
203
204 /**
205 * Determine if the form is require validation.
206 *
207 * @return bool
208 */
209 public function form_validation() {
210 return $this->form_validation;
211 }
212
213 /**
214 * Get API key page URL
215 *
216 * @return bool|null
217 */
218 public function get_api_page_url() {
219 return $this->api_page_url;
220 }
221
222 /**
223 * Get actions if any
224 *
225 * @return array
226 */
227 public function get_actions() {
228 return $this->actions;
229 }
230
231 /**
232 * Get triggers if any
233 *
234 * @return array
235 */
236 public function get_triggers() {
237 return $this->triggers;
238 }
239
240 /**
241 * Default validation abstract method (optional)
242 *
243 * @param array $args Form input as $args.
244 *
245 * @return false
246 */
247 public function validation( $args = [] ) {
248 return false;
249 }
250 }
251