| 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_text_field($_GET['sub_page']); |
| 38 |
} |
| 39 |
|
| 40 |
return View::make('admin.addons.index', [ |
| 41 |
'menus' => $extraMenus, |
| 42 |
'base_url' => admin_url('admin.php?page=fluent_form_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 = 'https://wpmanageninja.com/downloads/fluentform-pro-add-on/'; |
| 90 |
return array( |
| 91 |
'UserRegistration' => array( |
| 92 |
'title' => 'User Registration', |
| 93 |
'description' => 'Create WordPress user when when a form is submitted', |
| 94 |
'logo' => App::publicUrl('img/integrations/user_registration.png'), |
| 95 |
'enabled' => 'no', |
| 96 |
'purchase_url' => $purchaseUrl, |
| 97 |
'category' => 'wp_core' |
| 98 |
), |
| 99 |
'PostFeeds' => array( |
| 100 |
'title' => 'Advanced Post/CPT Creation', |
| 101 |
'description' => 'Create post/any cpt on form submission. It will enable many new features including dedicated post fields.', |
| 102 |
'logo' => App::publicUrl('img/integrations/post-creation.png'), |
| 103 |
'enabled' => 'no', |
| 104 |
'purchase_url' => $purchaseUrl, |
| 105 |
'category' => 'wp_core' |
| 106 |
), |
| 107 |
'sharePages' => array( |
| 108 |
'title' => 'Landing Pages', |
| 109 |
'description' => 'Create completely custom "distraction-free" form landing pages to boost conversions', |
| 110 |
'logo' => App::publicUrl('img/integrations/landing_pages.png'), |
| 111 |
'enabled' => 'no', |
| 112 |
'purchase_url' => $purchaseUrl, |
| 113 |
'category' => 'wp_core' |
| 114 |
), |
| 115 |
'webhook' => array( |
| 116 |
'title' => 'WebHooks', |
| 117 |
'description' => 'Broadcast your WP Fluent Forms Submission to any web api endpoint with the powerful webhook module.', |
| 118 |
'logo' => App::publicUrl('img/integrations/webhook.png'), |
| 119 |
'enabled' => 'no', |
| 120 |
'purchase_url' => $purchaseUrl, |
| 121 |
'category' => 'crm' |
| 122 |
), |
| 123 |
'zapier' => array( |
| 124 |
'title' => 'Zapier', |
| 125 |
'description' => 'Connect your WP Fluent Forms data with Zapier and push data to thousands of online softwares.', |
| 126 |
'logo' => App::publicUrl('img/integrations/zapier.png'), |
| 127 |
'enabled' => 'no', |
| 128 |
'purchase_url' => $purchaseUrl, |
| 129 |
'category' => 'crm' |
| 130 |
), |
| 131 |
'trello' => array( |
| 132 |
'title' => 'Trello', |
| 133 |
'description' => 'WP Fluent Forms Trello Module allows you to create Trello card from submiting forms.', |
| 134 |
'logo' => App::publicUrl('img/integrations/trello.png'), |
| 135 |
'enabled' => 'no', |
| 136 |
'purchase_url' => $purchaseUrl, |
| 137 |
'category' => 'crm' |
| 138 |
), |
| 139 |
'google_sheet' => array( |
| 140 |
'title' => 'Google Sheet', |
| 141 |
'description' => 'Add WP Fluent Forms Submission to Google sheets when a form is submitted.', |
| 142 |
'logo' => App::publicUrl('img/integrations/google-sheets.png'), |
| 143 |
'enabled' => 'no', |
| 144 |
'purchase_url' => $purchaseUrl, |
| 145 |
'category' => 'crm' |
| 146 |
), |
| 147 |
'activecampaign' => array( |
| 148 |
'title' => 'ActiveCampaign', |
| 149 |
'description' => 'WP Fluent Forms ActiveCampaign Module allows you to create ActiveCampaign list signup forms in WordPress, so you can grow your email list.', |
| 150 |
'logo' => App::publicUrl('img/integrations/activecampaign.png'), |
| 151 |
'enabled' => 'no', |
| 152 |
'purchase_url' => $purchaseUrl, |
| 153 |
'category' => 'crm' |
| 154 |
), |
| 155 |
'campaign_monitor' => array( |
| 156 |
'title' => 'CampaignMonitor', |
| 157 |
'description' => 'WP Fluent Forms Campaign Monitor module allows you to create Campaign Monitor newsletter signup forms in WordPress, so you can grow your email list.', |
| 158 |
'logo' => App::publicUrl('img/integrations/campaignmonitor.png'), |
| 159 |
'enabled' => 'no', |
| 160 |
'purchase_url' => $purchaseUrl, |
| 161 |
'category' => 'crm' |
| 162 |
), |
| 163 |
'constatantcontact' => array( |
| 164 |
'title' => 'ConstantContact', |
| 165 |
'description' => 'Connect ConstantContact with WP Fluent Forms and create subscriptions forms right into WordPress and grow your list.', |
| 166 |
'logo' => App::publicUrl('img/integrations/constantcontact.png'), |
| 167 |
'enabled' => 'no', |
| 168 |
'purchase_url' => $purchaseUrl, |
| 169 |
'category' => 'crm' |
| 170 |
), |
| 171 |
'convertkit' => array( |
| 172 |
'title' => 'ConvertKit', |
| 173 |
'description' => 'Connect ConvertKit with WP Fluent Forms and create subscription forms right into WordPress and grow your list.', |
| 174 |
'logo' => App::publicUrl('img/integrations/convertkit.png'), |
| 175 |
'enabled' => 'no', |
| 176 |
'purchase_url' => $purchaseUrl, |
| 177 |
'category' => 'crm' |
| 178 |
), |
| 179 |
'getresponse' => array( |
| 180 |
'title' => 'GetResponse', |
| 181 |
'description' => 'WP Fluent Forms GetResponse module allows you to create GetResponse newsletter signup forms in WordPress, so you can grow your email list.', |
| 182 |
'logo' => App::publicUrl('img/integrations/getresponse.png'), |
| 183 |
'enabled' => 'no', |
| 184 |
'purchase_url' => $purchaseUrl, |
| 185 |
'category' => 'crm' |
| 186 |
), |
| 187 |
'hubspot' => array( |
| 188 |
'title' => 'Hubspot', |
| 189 |
'description' => 'Connect HubSpot with WP Fluent Forms and subscribe a contact when a form is submitted.', |
| 190 |
'logo' => App::publicUrl('img/integrations/hubspot.png'), |
| 191 |
'enabled' => 'no', |
| 192 |
'purchase_url' => $purchaseUrl, |
| 193 |
'category' => 'crm' |
| 194 |
), |
| 195 |
'icontact' => array( |
| 196 |
'title' => 'iContact', |
| 197 |
'description' => 'Connect iContact with WP Fluent Forms and subscribe a contact when a form is submitted.', |
| 198 |
'logo' => App::publicUrl('img/integrations/icontact.png'), |
| 199 |
'enabled' => 'no', |
| 200 |
'purchase_url' => $purchaseUrl, |
| 201 |
'category' => 'crm' |
| 202 |
), |
| 203 |
'platformly' => array( |
| 204 |
'title' => 'Platformly', |
| 205 |
'description' => 'Connect Platform.ly with WP Fluent Forms and subscribe a contact when a form is submitted.', |
| 206 |
'logo' => App::publicUrl('img/integrations/platformly.png'), |
| 207 |
'enabled' => 'no', |
| 208 |
'purchase_url' => $purchaseUrl, |
| 209 |
'category' => 'crm' |
| 210 |
), |
| 211 |
'moosend' => array( |
| 212 |
'title' => 'MooSend', |
| 213 |
'description' => 'Connect MooSend with WP Fluent Forms and subscribe a contact when a form is submitted.', |
| 214 |
'logo' => App::publicUrl('img/integrations/moosend_logo.png'), |
| 215 |
'enabled' => 'no', |
| 216 |
'purchase_url' => $purchaseUrl, |
| 217 |
'category' => 'crm' |
| 218 |
), |
| 219 |
'sendfox' => array( |
| 220 |
'title' => 'SendFox', |
| 221 |
'description' => 'Connect SendFox with WP Fluent Forms and subscribe a contact when a form is submitted.', |
| 222 |
'logo' => App::publicUrl('img/integrations/sendfox.png'), |
| 223 |
'enabled' => 'no', |
| 224 |
'purchase_url' => $purchaseUrl, |
| 225 |
'category' => 'crm' |
| 226 |
), |
| 227 |
'mailerlite' => array( |
| 228 |
'title' => 'MailerLite', |
| 229 |
'description' => 'Connect your WP Fluent Forms with MailerLite and add subscribers easily.', |
| 230 |
'logo' => App::publicUrl('img/integrations/mailerlite.png'), |
| 231 |
'enabled' => 'no', |
| 232 |
'purchase_url' => $purchaseUrl, |
| 233 |
'category' => 'crm' |
| 234 |
), |
| 235 |
'sms_notifications' => array( |
| 236 |
'title' => 'SMS Notification', |
| 237 |
'description' => 'Send SMS in real time when a form is submitted with Twillio.', |
| 238 |
'logo' => App::publicUrl('img/integrations/twillio.png'), |
| 239 |
'enabled' => 'no', |
| 240 |
'purchase_url' => $purchaseUrl, |
| 241 |
'category' => 'crm' |
| 242 |
), |
| 243 |
'get_gist' => array( |
| 244 |
'title' => 'Gist', |
| 245 |
'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.', |
| 246 |
'logo' => App::publicUrl('img/integrations/getgist.png'), |
| 247 |
'enabled' => 'no', |
| 248 |
'purchase_url' => $purchaseUrl, |
| 249 |
'category' => 'crm' |
| 250 |
), |
| 251 |
'sendinblue' => array( |
| 252 |
'title' => 'SendInBlue', |
| 253 |
'description' => 'WP Fluent Forms Sendinblue Module allows you to create contacts on your list, so you can grow your email list.', |
| 254 |
'logo' => App::publicUrl('img/integrations/sendinblue.png'), |
| 255 |
'enabled' => 'no', |
| 256 |
'purchase_url' => $purchaseUrl, |
| 257 |
'category' => 'crm' |
| 258 |
), |
| 259 |
); |
| 260 |
} |
| 261 |
} |
| 262 |
|