| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentForm\App\Modules; |
| 4 |
|
| 5 |
use FluentForm\App; |
| 6 |
use FluentForm\View; |
| 7 |
|
| 8 |
class AddOnModule |
| 9 |
{ |
| 10 |
/** |
| 11 |
* The number of days we'll cached the add-ons got from remote server. |
| 12 |
* |
| 13 |
* @var integer |
| 14 |
*/ |
| 15 |
protected $cacheDays = 1; |
| 16 |
|
| 17 |
/** |
| 18 |
* The URL to fetch the add-ons |
| 19 |
* |
| 20 |
* @var string |
| 21 |
*/ |
| 22 |
protected $addOnsFetchUrl = 'https://wpmanageninja.com/add-ons.json'; |
| 23 |
|
| 24 |
/** |
| 25 |
* Render the add-ons list page. |
| 26 |
*/ |
| 27 |
public function render() |
| 28 |
{ |
| 29 |
$extraMenus = []; |
| 30 |
|
| 31 |
$extraMenus = apply_filters('fluentform_addons_extra_menu', $extraMenus); |
| 32 |
|
| 33 |
|
| 34 |
$current_menu_item = 'fluentform_add_ons'; |
| 35 |
|
| 36 |
if (isset($_GET['sub_page']) && $_GET['sub_page']) { |
| 37 |
$current_menu_item = sanitize_key($_GET['sub_page']); |
| 38 |
} |
| 39 |
|
| 40 |
return View::make('admin.addons.index', [ |
| 41 |
'menus' => $extraMenus, |
| 42 |
'base_url' => admin_url('admin.php?page=fluent_forms_add_ons'), |
| 43 |
'current_menu_item' => $current_menu_item |
| 44 |
]); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Show the add-ons list. |
| 49 |
*/ |
| 50 |
public function showFluentAddOns() |
| 51 |
{ |
| 52 |
wp_enqueue_script('fluentform-modules'); |
| 53 |
|
| 54 |
$addOns = apply_filters('fluentform_global_addons', []); |
| 55 |
|
| 56 |
$addOns['slack'] = [ |
| 57 |
'title' => 'Slack', |
| 58 |
'description' => 'Get realtime notification in slack channel when a new submission will be added.', |
| 59 |
'logo' => App::publicUrl('img/integrations/slack.png'), |
| 60 |
'enabled' => App\Helpers\Helper::isSlackEnabled() ? 'yes' : 'no', |
| 61 |
'config_url' => '', |
| 62 |
'category' => 'crm' |
| 63 |
]; |
| 64 |
|
| 65 |
if (!defined('FLUENTFORMPRO')) { |
| 66 |
$addOns = array_merge($addOns, $this->getPremiumAddOns()); |
| 67 |
} |
| 68 |
|
| 69 |
wp_localize_script('fluentform-modules', 'fluent_addon_modules', [ |
| 70 |
'addons' => $addOns, |
| 71 |
'has_pro' => defined('FLUENTFORMPRO') |
| 72 |
]); |
| 73 |
|
| 74 |
View::render('admin.addons.list', []); |
| 75 |
} |
| 76 |
|
| 77 |
public function updateAddOnsStatus() |
| 78 |
{ |
| 79 |
$addons = wp_unslash($_REQUEST['addons']); |
| 80 |
update_option('fluentform_global_modules_status', $addons, 'no'); |
| 81 |
|
| 82 |
wp_send_json_success([ |
| 83 |
'message' => 'Status successfully updated' |
| 84 |
], 200); |
| 85 |
} |
| 86 |
|
| 87 |
public function getPremiumAddOns() |
| 88 |
{ |
| 89 |
$purchaseUrl = fluentform_upgrade_url(); |
| 90 |
return array( |
| 91 |
'paypal' => array( |
| 92 |
'title' => 'PayPal', |
| 93 |
'description' => 'Accept Payments via paypal as a part of your form submission', |
| 94 |
'logo' => App::publicUrl('img/integrations/paypal.png'), |
| 95 |
'enabled' => 'no', |
| 96 |
'purchase_url' => $purchaseUrl, |
| 97 |
'category' => 'payment' |
| 98 |
), |
| 99 |
'stripe' => array( |
| 100 |
'title' => 'Stripe', |
| 101 |
'description' => 'Accept Payments via stripe as a part of your form submission', |
| 102 |
'logo' => App::publicUrl('img/integrations/stripe.png'), |
| 103 |
'enabled' => 'no', |
| 104 |
'purchase_url' => $purchaseUrl, |
| 105 |
'category' => 'payment' |
| 106 |
), |
| 107 |
'UserRegistration' => array( |
| 108 |
'title' => 'User Registration', |
| 109 |
'description' => 'Create WordPress user when when a form is submitted', |
| 110 |
'logo' => App::publicUrl('img/integrations/user_registration.png'), |
| 111 |
'enabled' => 'no', |
| 112 |
'purchase_url' => $purchaseUrl, |
| 113 |
'category' => 'wp_core' |
| 114 |
), |
| 115 |
'PostFeeds' => array( |
| 116 |
'title' => 'Advanced Post/CPT Creation', |
| 117 |
'description' => 'Create post/any cpt on form submission. It will enable many new features including dedicated post fields.', |
| 118 |
'logo' => App::publicUrl('img/integrations/post-creation.png'), |
| 119 |
'enabled' => 'no', |
| 120 |
'purchase_url' => $purchaseUrl, |
| 121 |
'category' => 'wp_core' |
| 122 |
), |
| 123 |
'sharePages' => array( |
| 124 |
'title' => 'Landing Pages', |
| 125 |
'description' => 'Create completely custom "distraction-free" form landing pages to boost conversions', |
| 126 |
'logo' => App::publicUrl('img/integrations/landing_pages.png'), |
| 127 |
'enabled' => 'no', |
| 128 |
'purchase_url' => $purchaseUrl, |
| 129 |
'category' => 'wp_core' |
| 130 |
), |
| 131 |
'webhook' => array( |
| 132 |
'title' => 'WebHooks', |
| 133 |
'description' => 'Broadcast your Fluent Forms Submission to any web api endpoint with the powerful webhook module.', |
| 134 |
'logo' => App::publicUrl('img/integrations/webhook.png'), |
| 135 |
'enabled' => 'no', |
| 136 |
'purchase_url' => $purchaseUrl, |
| 137 |
'category' => 'crm' |
| 138 |
), |
| 139 |
'zapier' => array( |
| 140 |
'title' => 'Zapier', |
| 141 |
'description' => 'Connect your Fluent Forms data with Zapier and push data to thousands of online softwares.', |
| 142 |
'logo' => App::publicUrl('img/integrations/zapier.png'), |
| 143 |
'enabled' => 'no', |
| 144 |
'purchase_url' => $purchaseUrl, |
| 145 |
'category' => 'crm' |
| 146 |
), |
| 147 |
'trello' => array( |
| 148 |
'title' => 'Trello', |
| 149 |
'description' => 'Fluent Forms Trello Module allows you to create Trello card from submiting forms.', |
| 150 |
'logo' => App::publicUrl('img/integrations/trello.png'), |
| 151 |
'enabled' => 'no', |
| 152 |
'purchase_url' => $purchaseUrl, |
| 153 |
'category' => 'crm' |
| 154 |
), |
| 155 |
'google_sheet' => array( |
| 156 |
'title' => 'Google Sheet', |
| 157 |
'description' => 'Add Fluent Forms Submission to Google sheets when a form is submitted.', |
| 158 |
'logo' => App::publicUrl('img/integrations/google-sheets.png'), |
| 159 |
'enabled' => 'no', |
| 160 |
'purchase_url' => $purchaseUrl, |
| 161 |
'category' => 'crm' |
| 162 |
), |
| 163 |
'activecampaign' => array( |
| 164 |
'title' => 'ActiveCampaign', |
| 165 |
'description' => 'Fluent Forms ActiveCampaign Module allows you to create ActiveCampaign list signup forms in WordPress, so you can grow your email list.', |
| 166 |
'logo' => App::publicUrl('img/integrations/activecampaign.png'), |
| 167 |
'enabled' => 'no', |
| 168 |
'purchase_url' => $purchaseUrl, |
| 169 |
'category' => 'crm' |
| 170 |
), |
| 171 |
'campaign_monitor' => array( |
| 172 |
'title' => 'Campaign Monitor', |
| 173 |
'description' => 'Fluent Forms Campaign Monitor module allows you to create Campaign Monitor newsletter signup forms in WordPress, so you can grow your email list.', |
| 174 |
'logo' => App::publicUrl('img/integrations/campaignmonitor.png'), |
| 175 |
'enabled' => 'no', |
| 176 |
'purchase_url' => $purchaseUrl, |
| 177 |
'category' => 'crm' |
| 178 |
), |
| 179 |
'constatantcontact' => array( |
| 180 |
'title' => 'Constant Contact', |
| 181 |
'description' => 'Connect Constant Contact with Fluent Forms and create subscriptions forms right into WordPress and grow your list.', |
| 182 |
'logo' => App::publicUrl('img/integrations/constantcontact.png'), |
| 183 |
'enabled' => 'no', |
| 184 |
'purchase_url' => $purchaseUrl, |
| 185 |
'category' => 'crm' |
| 186 |
), |
| 187 |
'convertkit' => array( |
| 188 |
'title' => 'ConvertKit', |
| 189 |
'description' => 'Connect ConvertKit with Fluent Forms and create subscription forms right into WordPress and grow your list.', |
| 190 |
'logo' => App::publicUrl('img/integrations/convertkit.png'), |
| 191 |
'enabled' => 'no', |
| 192 |
'purchase_url' => $purchaseUrl, |
| 193 |
'category' => 'crm' |
| 194 |
), |
| 195 |
'getresponse' => array( |
| 196 |
'title' => 'GetResponse', |
| 197 |
'description' => 'Fluent Forms GetResponse module allows you to create GetResponse newsletter signup forms in WordPress, so you can grow your email list.', |
| 198 |
'logo' => App::publicUrl('img/integrations/getresponse.png'), |
| 199 |
'enabled' => 'no', |
| 200 |
'purchase_url' => $purchaseUrl, |
| 201 |
'category' => 'crm' |
| 202 |
), |
| 203 |
'hubspot' => array( |
| 204 |
'title' => 'Hubspot', |
| 205 |
'description' => 'Connect HubSpot with Fluent Forms and subscribe a contact when a form is submitted.', |
| 206 |
'logo' => App::publicUrl('img/integrations/hubspot.png'), |
| 207 |
'enabled' => 'no', |
| 208 |
'purchase_url' => $purchaseUrl, |
| 209 |
'category' => 'crm' |
| 210 |
), |
| 211 |
'icontact' => array( |
| 212 |
'title' => 'iContact', |
| 213 |
'description' => 'Connect iContact with Fluent Forms and subscribe a contact when a form is submitted.', |
| 214 |
'logo' => App::publicUrl('img/integrations/icontact.png'), |
| 215 |
'enabled' => 'no', |
| 216 |
'purchase_url' => $purchaseUrl, |
| 217 |
'category' => 'crm' |
| 218 |
), |
| 219 |
'platformly' => array( |
| 220 |
'title' => 'Platformly', |
| 221 |
'description' => 'Connect Platform.ly with Fluent Forms and subscribe a contact when a form is submitted.', |
| 222 |
'logo' => App::publicUrl('img/integrations/platformly.png'), |
| 223 |
'enabled' => 'no', |
| 224 |
'purchase_url' => $purchaseUrl, |
| 225 |
'category' => 'crm' |
| 226 |
), |
| 227 |
'moosend' => array( |
| 228 |
'title' => 'MooSend', |
| 229 |
'description' => 'Connect MooSend with Fluent Forms and subscribe a contact when a form is submitted.', |
| 230 |
'logo' => App::publicUrl('img/integrations/moosend_logo.png'), |
| 231 |
'enabled' => 'no', |
| 232 |
'purchase_url' => $purchaseUrl, |
| 233 |
'category' => 'crm' |
| 234 |
), |
| 235 |
'sendfox' => array( |
| 236 |
'title' => 'SendFox', |
| 237 |
'description' => 'Connect SendFox with Fluent Forms and subscribe a contact when a form is submitted.', |
| 238 |
'logo' => App::publicUrl('img/integrations/sendfox.png'), |
| 239 |
'enabled' => 'no', |
| 240 |
'purchase_url' => $purchaseUrl, |
| 241 |
'category' => 'crm' |
| 242 |
), |
| 243 |
'mailerlite' => array( |
| 244 |
'title' => 'MailerLite', |
| 245 |
'description' => 'Connect your Fluent Forms with MailerLite and add subscribers easily.', |
| 246 |
'logo' => App::publicUrl('img/integrations/mailerlite.png'), |
| 247 |
'enabled' => 'no', |
| 248 |
'purchase_url' => $purchaseUrl, |
| 249 |
'category' => 'crm' |
| 250 |
), |
| 251 |
'sms_notifications' => array( |
| 252 |
'title' => 'SMS Notification', |
| 253 |
'description' => 'Send SMS in real time when a form is submitted with Twilio.', |
| 254 |
'logo' => App::publicUrl('img/integrations/twilio.png'), |
| 255 |
'enabled' => 'no', |
| 256 |
'purchase_url' => $purchaseUrl, |
| 257 |
'category' => 'crm' |
| 258 |
), |
| 259 |
'get_gist' => array( |
| 260 |
'title' => 'Gist', |
| 261 |
'description' => 'GetGist is Easy to use all-in-one software for live chat, email marketing automation, forms, knowledge base, and more for a complete 360° view of your contacts.', |
| 262 |
'logo' => App::publicUrl('img/integrations/getgist.png'), |
| 263 |
'enabled' => 'no', |
| 264 |
'purchase_url' => $purchaseUrl, |
| 265 |
'category' => 'crm' |
| 266 |
), |
| 267 |
'sendinblue' => array( |
| 268 |
'title' => 'SendInBlue', |
| 269 |
'description' => 'Fluent Forms Sendinblue Module allows you to create contacts on your list, so you can grow your email list.', |
| 270 |
'logo' => App::publicUrl('img/integrations/sendinblue.png'), |
| 271 |
'enabled' => 'no', |
| 272 |
'purchase_url' => $purchaseUrl, |
| 273 |
'category' => 'crm' |
| 274 |
), |
| 275 |
'drip' => array( |
| 276 |
'title' => 'Drip', |
| 277 |
'description' => 'Fluent Forms Drip Module allows you to create contacts on your Drip list, so you can grow your email list.', |
| 278 |
'logo' => App::publicUrl('img/integrations/drip.png'), |
| 279 |
'enabled' => 'no', |
| 280 |
'purchase_url' => $purchaseUrl, |
| 281 |
'category' => 'crm' |
| 282 |
), |
| 283 |
'discord' => array( |
| 284 |
'title' => 'Discord', |
| 285 |
'description' => 'Send notification with form data to your Discord channel when a form is submitted', |
| 286 |
'logo' => App::publicUrl('img/integrations/discord.png'), |
| 287 |
'enabled' => 'no', |
| 288 |
'purchase_url' => $purchaseUrl, |
| 289 |
'category' => 'crm' |
| 290 |
), |
| 291 |
'telegram' => array( |
| 292 |
'title' => 'Telegram', |
| 293 |
'description' => 'Send notification to Telegram channel or group when a form is submitted', |
| 294 |
'logo' => App::publicUrl('img/integrations/telegram.png'), |
| 295 |
'enabled' => 'no', |
| 296 |
'purchase_url' => $purchaseUrl, |
| 297 |
'category' => 'crm' |
| 298 |
), |
| 299 |
'affiliateWp' => array( |
| 300 |
'title' => 'AffiliateWP', |
| 301 |
'description' => 'Generate AffiliateWP referrals automatically when a customer is referred to your site via an affiliate link', |
| 302 |
'logo' => App::publicUrl('img/integrations/affiliatewp.png'), |
| 303 |
'enabled' => 'no', |
| 304 |
'purchase_url' => $purchaseUrl, |
| 305 |
'category' => 'crm' |
| 306 |
), |
| 307 |
'clicksend_sms_notification' => array( |
| 308 |
'title' => 'ClickSend', |
| 309 |
'description' => 'Send SMS in real time when a form is submitted with ClickSend', |
| 310 |
'logo' => App::publicUrl('img/integrations/clicksend.png'), |
| 311 |
'enabled' => 'no', |
| 312 |
'purchase_url' => $purchaseUrl, |
| 313 |
'category' => 'crm' |
| 314 |
), |
| 315 |
'zohocrm' => array( |
| 316 |
'title' => 'Zoho CRM', |
| 317 |
'description' => 'Zoho CRM is an online Sales CRM software that manages your sales, marketing and support in one CRM platform.', |
| 318 |
'logo' => App::publicUrl('img/integrations/zohocrm.png'), |
| 319 |
'enabled' => 'no', |
| 320 |
'purchase_url' => $purchaseUrl, |
| 321 |
'category' => 'crm' |
| 322 |
), |
| 323 |
'cleverreach' => array( |
| 324 |
'title' => 'CleverReach', |
| 325 |
'description' => 'CleverReach is web-based email marketing software for managing email campaigns and contacts. Use Fluent Forms to grow your CleverReach subscriber list', |
| 326 |
'logo' => App::publicUrl('img/integrations/clever_reach.png'), |
| 327 |
'enabled' => 'no', |
| 328 |
'purchase_url' => $purchaseUrl, |
| 329 |
'category' => 'crm' |
| 330 |
), |
| 331 |
'salesflare' => array( |
| 332 |
'title' => 'Salesflare', |
| 333 |
'description' => 'Create Salesflare contact from WordPress, so you can grow your contact list', |
| 334 |
'logo' => App::publicUrl('img/integrations/salesflare.png'), |
| 335 |
'enabled' => 'no', |
| 336 |
'purchase_url' => $purchaseUrl, |
| 337 |
'category' => 'crm' |
| 338 |
), |
| 339 |
'automizy' => array( |
| 340 |
'title' => 'Automizy', |
| 341 |
'description' => 'Connect Automizy with Fluent Forms and subscribe a contact when a form is submitted.', |
| 342 |
'logo' => App::publicUrl('img/integrations/automizy.png'), |
| 343 |
'enabled' => 'no', |
| 344 |
'purchase_url' => $purchaseUrl, |
| 345 |
'category' => 'crm' |
| 346 |
), |
| 347 |
'salesforce' => array( |
| 348 |
'title' => 'Salesforce', |
| 349 |
'description' => 'Salesforce is the world’s #1 customer relationship management (CRM) platform. It helps your marketing, sales, commerce, service and IT teams work as one from anywhere — so you can keep your customers happy everywhere.', |
| 350 |
'logo' => App::publicUrl('img/integrations/salesforce.png'), |
| 351 |
'enabled' => 'no', |
| 352 |
'purchase_url' => $purchaseUrl, |
| 353 |
'category' => 'crm' |
| 354 |
), |
| 355 |
'airtable' => array( |
| 356 |
'title' => 'Airtable', |
| 357 |
'description' => 'Airtable is a low-code platform for building collaborative apps. Customize your workflow, collaborate, and achieve ambitious outcomes.', |
| 358 |
'logo' => App::publicUrl('img/integrations/airtable.png'), |
| 359 |
'enabled' => 'no', |
| 360 |
'purchase_url' => $purchaseUrl, |
| 361 |
'category' => 'crm' |
| 362 |
), |
| 363 |
); |
| 364 |
} |
| 365 |
} |
| 366 |
|