| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace FluentForm\App\Modules; |
| 4 | 4 | |
| 5 | -use FluentForm\App; | |
| 6 | -use FluentForm\View; | |
| 5 | +use FluentForm\App\Helpers\Helper; | |
| 6 | +use FluentForm\App\Modules\Registerer\TranslationString; | |
| 7 | 7 | |
| 8 | 8 | class AddOnModule |
| 9 | 9 | { |
| 10 | 10 | /** |
| @@ -27,21 +27,36 @@ | ||
| 27 | 27 | public function render() |
| 28 | 28 | { |
| 29 | 29 | $extraMenus = []; |
| 30 | 30 | |
| 31 | - $extraMenus = apply_filters('fluentform_addons_extra_menu', $extraMenus); | |
| 31 | + $extraMenus = apply_filters_deprecated( | |
| 32 | + 'fluentform_addons_extra_menu', | |
| 33 | + [ | |
| 34 | + $extraMenus, | |
| 35 | + ], | |
| 36 | + FLUENTFORM_FRAMEWORK_UPGRADE, | |
| 37 | + 'fluentform/addons_extra_menu', | |
| 38 | + 'Use fluentform/addons_extra_menu instead of fluentform_addons_extra_menu' | |
| 39 | + ); | |
| 32 | 40 | |
| 41 | + // Add suggested plugins tab | |
| 42 | + $extraMenus['suggested_plugins'] = __('Suggested Plugins', 'fluentform'); | |
| 33 | 43 | |
| 44 | + $extraMenus = apply_filters('fluentform/addons_extra_menu', $extraMenus); | |
| 45 | + | |
| 34 | 46 | $current_menu_item = 'fluentform_add_ons'; |
| 35 | 47 | |
| 36 | - if (isset($_GET['sub_page']) && $_GET['sub_page']) { | |
| 37 | - $current_menu_item = sanitize_text_field($_GET['sub_page']); | |
| 48 | + $subPage = wpFluentForm('request')->get('sub_page'); | |
| 49 | + | |
| 50 | + if ($subPage) { | |
| 51 | + $current_menu_item = sanitize_key($subPage); | |
| 38 | 52 | } |
| 39 | 53 | |
| 40 | - return View::make('admin.addons.index', [ | |
| 54 | + wpFluentForm('view')->render('admin.addons.index', [ | |
| 55 | + 'hasPro' => defined('FLUENTFORMPRO'), | |
| 41 | 56 | 'menus' => $extraMenus, |
| 42 | - 'base_url' => admin_url('admin.php?page=fluent_form_add_ons'), | |
| 43 | - 'current_menu_item' => $current_menu_item | |
| 57 | + 'base_url' => admin_url('admin.php?page=fluent_forms_add_ons'), | |
| 58 | + 'current_menu_item' => $current_menu_item, | |
| 44 | 59 | ]); |
| 45 | 60 | } |
| 46 | 61 | |
| 47 | 62 | /** |
| @@ -50,17 +65,42 @@ | ||
| 50 | 65 | public function showFluentAddOns() |
| 51 | 66 | { |
| 52 | 67 | wp_enqueue_script('fluentform-modules'); |
| 53 | 68 | |
| 54 | - $addOns = apply_filters('fluentform_global_addons', []); | |
| 69 | + $addOns = $this->getRegisteredAddOns(); | |
| 55 | 70 | |
| 71 | + wp_localize_script('fluentform-modules', 'fluent_addon_modules', [ | |
| 72 | + 'addons' => $addOns, | |
| 73 | + 'has_pro' => defined('FLUENTFORMPRO'), | |
| 74 | + 'addOnModule_str' => TranslationString::getAddOnModuleI18n(), | |
| 75 | + ]); | |
| 76 | + | |
| 77 | + wpFluentForm('view')->render('admin.addons.list', []); | |
| 78 | + } | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * The registry the Add-on Modules screen renders from, so the status writer can validate against the same source. | |
| 82 | + */ | |
| 83 | + public function getRegisteredAddOns() | |
| 84 | + { | |
| 85 | + $addOns = apply_filters_deprecated( | |
| 86 | + 'fluentform_global_addons', | |
| 87 | + [ | |
| 88 | + [], | |
| 89 | + ], | |
| 90 | + FLUENTFORM_FRAMEWORK_UPGRADE, | |
| 91 | + 'fluentform/global_addons', | |
| 92 | + 'Use fluentform/global_addons instead of fluentform_global_addons' | |
| 93 | + ); | |
| 94 | + $addOns = apply_filters('fluentform/global_addons', $addOns); | |
| 95 | + | |
| 56 | 96 | $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', | |
| 97 | + 'title' => __('Slack', 'fluentform'), | |
| 98 | + 'description' => __('Get realtime notification in slack channel when a new submission will be added.', 'fluentform'), | |
| 99 | + 'logo' => fluentFormMix('img/integrations/slack.png'), | |
| 100 | + 'enabled' => Helper::isSlackEnabled() ? 'yes' : 'no', | |
| 61 | 101 | 'config_url' => '', |
| 62 | - 'category' => 'crm' | |
| 102 | + 'category' => 'crm', | |
| 63 | 103 | ]; |
| 64 | 104 | |
| 65 | 105 | if (!defined('FLUENTFORMPRO')) { |
| 66 | 106 | $addOns = array_merge($addOns, $this->getPremiumAddOns()); |
| @@ -65,221 +105,519 @@ | ||
| 65 | 105 | if (!defined('FLUENTFORMPRO')) { |
| 66 | 106 | $addOns = array_merge($addOns, $this->getPremiumAddOns()); |
| 67 | 107 | } |
| 68 | 108 | |
| 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', []); | |
| 109 | + return $addOns; | |
| 75 | 110 | } |
| 76 | 111 | |
| 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 | 112 | public function getPremiumAddOns() |
| 88 | 113 | { |
| 89 | - $purchaseUrl = 'https://wpmanageninja.com/downloads/fluentform-pro-add-on/'; | |
| 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'), | |
| 114 | + $purchaseUrl = fluentform_upgrade_url(); | |
| 115 | + $addOns = [ | |
| 116 | + 'paypal' => [ | |
| 117 | + 'title' => __('PayPal', 'fluentform'), | |
| 118 | + 'description' => __('Accept Payments via paypal as a part of your form submission', 'fluentform'), | |
| 119 | + 'logo' => fluentFormMix('img/integrations/paypal.png'), | |
| 95 | 120 | 'enabled' => 'no', |
| 96 | 121 | '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'), | |
| 122 | + 'category' => 'payment', | |
| 123 | + ], | |
| 124 | + 'stripe' => [ | |
| 125 | + 'title' => __('Stripe', 'fluentform'), | |
| 126 | + 'description' => __('Accept Payments via stripe as a part of your form submission', 'fluentform'), | |
| 127 | + 'logo' => fluentFormMix('img/integrations/stripe.png'), | |
| 103 | 128 | 'enabled' => 'no', |
| 104 | 129 | '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'), | |
| 130 | + 'category' => 'payment', | |
| 131 | + ], | |
| 132 | + 'UserRegistration' => [ | |
| 133 | + 'title' => __('User Registration', 'fluentform'), | |
| 134 | + 'description' => __('Create WordPress user when when a form is submitted', 'fluentform'), | |
| 135 | + 'logo' => fluentFormMix('img/integrations/user_registration.png'), | |
| 111 | 136 | 'enabled' => 'no', |
| 112 | 137 | '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'), | |
| 138 | + 'category' => 'wp_core', | |
| 139 | + ], | |
| 140 | + 'PostFeeds' => [ | |
| 141 | + 'title' => __('Advanced Post/CPT Creation', 'fluentform'), | |
| 142 | + 'description' => __('Create post/any cpt on form submission. It will enable many new features including dedicated post fields.', 'fluentform'), | |
| 143 | + 'logo' => fluentFormMix('img/integrations/post-creation.png'), | |
| 119 | 144 | 'enabled' => 'no', |
| 120 | 145 | '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', | |
| 146 | + 'category' => 'wp_core', | |
| 147 | + ], | |
| 148 | + 'sharePages' => [ | |
| 149 | + 'title' => __('Landing Pages', 'fluentform'), | |
| 150 | + 'description' => __('Create completely custom "distraction-free" form landing pages to boost conversions', 'fluentform'), | |
| 151 | + 'logo' => fluentFormMix('img/integrations/landing_pages.png'), | |
| 152 | + 'enabled' => 'no', | |
| 128 | 153 | 'purchase_url' => $purchaseUrl, |
| 129 | - 'category' => 'wp_core' | |
| 130 | - ), | |
| 131 | - 'webhook' => array( | |
| 132 | - 'title' => 'WebHooks', | |
| 133 | - 'description' => 'Broadcast your WP Fluent Forms Submission to any web api endpoint with the powerful webhook module.', | |
| 134 | - 'logo' => App::publicUrl('img/integrations/webhook.png'), | |
| 154 | + 'category' => 'wp_core', | |
| 155 | + ], | |
| 156 | + 'webhook' => [ | |
| 157 | + 'title' => __('WebHooks', 'fluentform'), | |
| 158 | + 'description' => __('Broadcast your Fluent Forms Submission to any web api endpoint with the powerful webhook module.', 'fluentform'), | |
| 159 | + 'logo' => fluentFormMix('img/integrations/webhook.png'), | |
| 135 | 160 | 'enabled' => 'no', |
| 136 | 161 | 'purchase_url' => $purchaseUrl, |
| 137 | - 'category' => 'crm' | |
| 138 | - ), | |
| 139 | - 'zapier' => array( | |
| 140 | - 'title' => 'Zapier', | |
| 141 | - 'description' => 'Connect your WP Fluent Forms data with Zapier and push data to thousands of online softwares.', | |
| 142 | - 'logo' => App::publicUrl('img/integrations/zapier.png'), | |
| 162 | + 'category' => 'crm', | |
| 163 | + ], | |
| 164 | + 'zapier' => [ | |
| 165 | + 'title' => __('Zapier', 'fluentform'), | |
| 166 | + 'description' => __('Connect your Fluent Forms data with Zapier and push data to thousands of online softwares.', 'fluentform'), | |
| 167 | + 'logo' => fluentFormMix('img/integrations/zapier.png'), | |
| 143 | 168 | 'enabled' => 'no', |
| 144 | 169 | 'purchase_url' => $purchaseUrl, |
| 145 | - 'category' => 'crm' | |
| 146 | - ), | |
| 147 | - 'trello' => array( | |
| 148 | - 'title' => 'Trello', | |
| 149 | - 'description' => 'WP Fluent Forms Trello Module allows you to create Trello card from submiting forms.', | |
| 150 | - 'logo' => App::publicUrl('img/integrations/trello.png'), | |
| 170 | + 'category' => 'crm', | |
| 171 | + ], | |
| 172 | + 'trello' => [ | |
| 173 | + 'title' => __('Trello', 'fluentform'), | |
| 174 | + 'description' => __('Fluent Forms Trello Module allows you to create Trello card from submiting forms.', 'fluentform'), | |
| 175 | + 'logo' => fluentFormMix('img/integrations/trello.png'), | |
| 151 | 176 | 'enabled' => 'no', |
| 152 | 177 | 'purchase_url' => $purchaseUrl, |
| 153 | - 'category' => 'crm' | |
| 154 | - ), | |
| 155 | - 'google_sheet' => array( | |
| 156 | - 'title' => 'Google Sheet', | |
| 157 | - 'description' => 'Add WP Fluent Forms Submission to Google sheets when a form is submitted.', | |
| 158 | - 'logo' => App::publicUrl('img/integrations/google-sheets.png'), | |
| 178 | + 'category' => 'crm', | |
| 179 | + ], | |
| 180 | + 'google_sheet' => [ | |
| 181 | + 'title' => __('Google Sheet', 'fluentform'), | |
| 182 | + 'description' => __('Add Fluent Forms Submission to Google sheets when a form is submitted.', 'fluentform'), | |
| 183 | + 'logo' => fluentFormMix('img/integrations/google-sheets.png'), | |
| 159 | 184 | 'enabled' => 'no', |
| 160 | 185 | 'purchase_url' => $purchaseUrl, |
| 161 | - 'category' => 'crm' | |
| 162 | - ), | |
| 163 | - 'activecampaign' => array( | |
| 164 | - 'title' => 'ActiveCampaign', | |
| 165 | - 'description' => 'WP 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'), | |
| 186 | + 'category' => 'crm', | |
| 187 | + ], | |
| 188 | + 'activecampaign' => [ | |
| 189 | + 'title' => __('ActiveCampaign', 'fluentform'), | |
| 190 | + 'description' => __('Fluent Forms ActiveCampaign Module allows you to create ActiveCampaign list signup forms in WordPress, so you can grow your email list.', 'fluentform'), | |
| 191 | + 'logo' => fluentFormMix('img/integrations/activecampaign.png'), | |
| 167 | 192 | 'enabled' => 'no', |
| 168 | 193 | 'purchase_url' => $purchaseUrl, |
| 169 | - 'category' => 'crm' | |
| 170 | - ), | |
| 171 | - 'campaign_monitor' => array( | |
| 172 | - 'title' => 'CampaignMonitor', | |
| 173 | - '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.', | |
| 174 | - 'logo' => App::publicUrl('img/integrations/campaignmonitor.png'), | |
| 194 | + 'category' => 'crm', | |
| 195 | + ], | |
| 196 | + 'campaign_monitor' => [ | |
| 197 | + 'title' => __('Campaign Monitor', 'fluentform'), | |
| 198 | + 'description' => __('Fluent Forms Campaign Monitor module allows you to create Campaign Monitor newsletter signup forms in WordPress, so you can grow your email list.', 'fluentform'), | |
| 199 | + 'logo' => fluentFormMix('img/integrations/campaignmonitor.png'), | |
| 175 | 200 | 'enabled' => 'no', |
| 176 | 201 | 'purchase_url' => $purchaseUrl, |
| 177 | - 'category' => 'crm' | |
| 178 | - ), | |
| 179 | - 'constatantcontact' => array( | |
| 180 | - 'title' => 'ConstantContact', | |
| 181 | - 'description' => 'Connect ConstantContact with WP Fluent Forms and create subscriptions forms right into WordPress and grow your list.', | |
| 182 | - 'logo' => App::publicUrl('img/integrations/constantcontact.png'), | |
| 202 | + 'category' => 'crm', | |
| 203 | + ], | |
| 204 | + 'constatantcontact' => [ | |
| 205 | + 'title' => __('Constant Contact', 'fluentform'), | |
| 206 | + 'description' => __('Connect Constant Contact with Fluent Forms and create subscriptions forms right into WordPress and grow your list.', 'fluentform'), | |
| 207 | + 'logo' => fluentFormMix('img/integrations/constantcontact.png'), | |
| 183 | 208 | 'enabled' => 'no', |
| 184 | 209 | 'purchase_url' => $purchaseUrl, |
| 185 | - 'category' => 'crm' | |
| 186 | - ), | |
| 187 | - 'convertkit' => array( | |
| 188 | - 'title' => 'ConvertKit', | |
| 189 | - 'description' => 'Connect ConvertKit with WP Fluent Forms and create subscription forms right into WordPress and grow your list.', | |
| 190 | - 'logo' => App::publicUrl('img/integrations/convertkit.png'), | |
| 210 | + 'category' => 'crm', | |
| 211 | + ], | |
| 212 | + 'convertkit' => [ | |
| 213 | + 'title' => __('ConvertKit', 'fluentform'), | |
| 214 | + 'description' => __('Connect ConvertKit with Fluent Forms and create subscription forms right into WordPress and grow your list.', 'fluentform'), | |
| 215 | + 'logo' => fluentFormMix('img/integrations/convertkit.png'), | |
| 191 | 216 | 'enabled' => 'no', |
| 192 | 217 | 'purchase_url' => $purchaseUrl, |
| 193 | - 'category' => 'crm' | |
| 194 | - ), | |
| 195 | - 'getresponse' => array( | |
| 196 | - 'title' => 'GetResponse', | |
| 197 | - 'description' => 'WP 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'), | |
| 218 | + 'category' => 'crm', | |
| 219 | + ], | |
| 220 | + 'getresponse' => [ | |
| 221 | + 'title' => __('GetResponse', 'fluentform'), | |
| 222 | + 'description' => __('Fluent Forms GetResponse module allows you to create GetResponse newsletter signup forms in WordPress, so you can grow your email list.', 'fluentform'), | |
| 223 | + 'logo' => fluentFormMix('img/integrations/getresponse.png'), | |
| 199 | 224 | 'enabled' => 'no', |
| 200 | 225 | 'purchase_url' => $purchaseUrl, |
| 201 | - 'category' => 'crm' | |
| 202 | - ), | |
| 203 | - 'hubspot' => array( | |
| 204 | - 'title' => 'Hubspot', | |
| 205 | - 'description' => 'Connect HubSpot with WP Fluent Forms and subscribe a contact when a form is submitted.', | |
| 206 | - 'logo' => App::publicUrl('img/integrations/hubspot.png'), | |
| 226 | + 'category' => 'crm', | |
| 227 | + ], | |
| 228 | + 'hubspot' => [ | |
| 229 | + 'title' => __('Hubspot', 'fluentform'), | |
| 230 | + 'description' => __('Connect HubSpot with Fluent Forms and subscribe a contact when a form is submitted.', 'fluentform'), | |
| 231 | + 'logo' => fluentFormMix('img/integrations/hubspot.png'), | |
| 207 | 232 | 'enabled' => 'no', |
| 208 | 233 | 'purchase_url' => $purchaseUrl, |
| 209 | - 'category' => 'crm' | |
| 210 | - ), | |
| 211 | - 'icontact' => array( | |
| 212 | - 'title' => 'iContact', | |
| 213 | - 'description' => 'Connect iContact with WP Fluent Forms and subscribe a contact when a form is submitted.', | |
| 214 | - 'logo' => App::publicUrl('img/integrations/icontact.png'), | |
| 234 | + 'category' => 'crm', | |
| 235 | + ], | |
| 236 | + 'icontact' => [ | |
| 237 | + 'title' => __('iContact', 'fluentform'), | |
| 238 | + 'description' => __('Connect iContact with Fluent Forms and subscribe a contact when a form is submitted.', 'fluentform'), | |
| 239 | + 'logo' => fluentFormMix('img/integrations/icontact.png'), | |
| 215 | 240 | 'enabled' => 'no', |
| 216 | 241 | 'purchase_url' => $purchaseUrl, |
| 217 | - 'category' => 'crm' | |
| 218 | - ), | |
| 219 | - 'platformly' => array( | |
| 220 | - 'title' => 'Platformly', | |
| 221 | - 'description' => 'Connect Platform.ly with WP Fluent Forms and subscribe a contact when a form is submitted.', | |
| 222 | - 'logo' => App::publicUrl('img/integrations/platformly.png'), | |
| 242 | + 'category' => 'crm', | |
| 243 | + ], | |
| 244 | + 'platformly' => [ | |
| 245 | + 'title' => __('Platformly', 'fluentform'), | |
| 246 | + 'description' => __('Connect Platform.ly with Fluent Forms and subscribe a contact when a form is submitted.', 'fluentform'), | |
| 247 | + 'logo' => fluentFormMix('img/integrations/platformly.png'), | |
| 223 | 248 | 'enabled' => 'no', |
| 224 | 249 | 'purchase_url' => $purchaseUrl, |
| 225 | - 'category' => 'crm' | |
| 226 | - ), | |
| 227 | - 'moosend' => array( | |
| 228 | - 'title' => 'MooSend', | |
| 229 | - 'description' => 'Connect MooSend with WP Fluent Forms and subscribe a contact when a form is submitted.', | |
| 230 | - 'logo' => App::publicUrl('img/integrations/moosend_logo.png'), | |
| 250 | + 'category' => 'crm', | |
| 251 | + ], | |
| 252 | + 'moosend' => [ | |
| 253 | + 'title' => __('MooSend', 'fluentform'), | |
| 254 | + 'description' => __('Connect MooSend with Fluent Forms and subscribe a contact when a form is submitted.', 'fluentform'), | |
| 255 | + 'logo' => fluentFormMix('img/integrations/moosend_logo.png'), | |
| 231 | 256 | 'enabled' => 'no', |
| 232 | 257 | 'purchase_url' => $purchaseUrl, |
| 233 | - 'category' => 'crm' | |
| 234 | - ), | |
| 235 | - 'sendfox' => array( | |
| 236 | - 'title' => 'SendFox', | |
| 237 | - 'description' => 'Connect SendFox with WP Fluent Forms and subscribe a contact when a form is submitted.', | |
| 238 | - 'logo' => App::publicUrl('img/integrations/sendfox.png'), | |
| 258 | + 'category' => 'crm', | |
| 259 | + ], | |
| 260 | + 'sendfox' => [ | |
| 261 | + 'title' => __('SendFox', 'fluentform'), | |
| 262 | + 'description' => __('Connect SendFox with Fluent Forms and subscribe a contact when a form is submitted.', 'fluentform'), | |
| 263 | + 'logo' => fluentFormMix('img/integrations/sendfox.png'), | |
| 239 | 264 | 'enabled' => 'no', |
| 240 | 265 | 'purchase_url' => $purchaseUrl, |
| 241 | - 'category' => 'crm' | |
| 242 | - ), | |
| 243 | - 'mailerlite' => array( | |
| 244 | - 'title' => 'MailerLite', | |
| 245 | - 'description' => 'Connect your WP Fluent Forms with MailerLite and add subscribers easily.', | |
| 246 | - 'logo' => App::publicUrl('img/integrations/mailerlite.png'), | |
| 266 | + 'category' => 'crm', | |
| 267 | + ], | |
| 268 | + 'mailerlite' => [ | |
| 269 | + 'title' => __('MailerLite', 'fluentform'), | |
| 270 | + 'description' => __('Connect your Fluent Forms with MailerLite and add subscribers easily.', 'fluentform'), | |
| 271 | + 'logo' => fluentFormMix('img/integrations/mailerlite.png'), | |
| 247 | 272 | 'enabled' => 'no', |
| 248 | 273 | '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 Twillio.', | |
| 254 | - 'logo' => App::publicUrl('img/integrations/twillio.png'), | |
| 274 | + 'category' => 'crm', | |
| 275 | + ], | |
| 276 | + 'sms_notifications' => [ | |
| 277 | + 'title' => __('SMS Notification', 'fluentform'), | |
| 278 | + 'description' => __('Send SMS in real time when a form is submitted with Twilio.', 'fluentform'), | |
| 279 | + 'logo' => fluentFormMix('img/integrations/twilio.png'), | |
| 255 | 280 | 'enabled' => 'no', |
| 256 | 281 | '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'), | |
| 282 | + 'category' => 'crm', | |
| 283 | + ], | |
| 284 | + 'get_gist' => [ | |
| 285 | + 'title' => __('Gist', 'fluentform'), | |
| 286 | + '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.', 'fluentform'), | |
| 287 | + 'logo' => fluentFormMix('img/integrations/getgist.png'), | |
| 263 | 288 | 'enabled' => 'no', |
| 264 | 289 | 'purchase_url' => $purchaseUrl, |
| 265 | - 'category' => 'crm' | |
| 266 | - ), | |
| 267 | - 'sendinblue' => array( | |
| 268 | - 'title' => 'SendInBlue', | |
| 269 | - 'description' => 'WP 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'), | |
| 290 | + 'category' => 'crm', | |
| 291 | + ], | |
| 292 | + 'sendinblue' => [ | |
| 293 | + 'title' => __('Brevo (formerly SendInBlue)', 'fluentform'), | |
| 294 | + 'description' => __('Fluent Forms Brevo (formerly SendInBlue) Module allows you to create contacts on your list, so you can grow your email list.', 'fluentform'), | |
| 295 | + 'logo' => fluentFormMix('img/integrations/brevo.png'), | |
| 271 | 296 | 'enabled' => 'no', |
| 272 | 297 | 'purchase_url' => $purchaseUrl, |
| 273 | - 'category' => 'crm' | |
| 274 | - ), | |
| 275 | - 'drip' => array( | |
| 276 | - 'title' => 'Drip', | |
| 277 | - 'description' => 'WP 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'), | |
| 298 | + 'category' => 'crm', | |
| 299 | + ], | |
| 300 | + 'drip' => [ | |
| 301 | + 'title' => __('Drip', 'fluentform'), | |
| 302 | + 'description' => __('Fluent Forms Drip Module allows you to create contacts on your Drip list, so you can grow your email list.', 'fluentform'), | |
| 303 | + 'logo' => fluentFormMix('img/integrations/drip.png'), | |
| 279 | 304 | 'enabled' => 'no', |
| 280 | 305 | 'purchase_url' => $purchaseUrl, |
| 281 | - 'category' => 'crm' | |
| 282 | - ), | |
| 283 | - ); | |
| 306 | + 'category' => 'crm', | |
| 307 | + ], | |
| 308 | + 'discord' => [ | |
| 309 | + 'title' => __('Discord', 'fluentform'), | |
| 310 | + 'description' => __('Send notification with form data to your Discord channel when a form is submitted', 'fluentform'), | |
| 311 | + 'logo' => fluentFormMix('img/integrations/discord.png'), | |
| 312 | + 'enabled' => 'no', | |
| 313 | + 'purchase_url' => $purchaseUrl, | |
| 314 | + 'category' => 'crm', | |
| 315 | + ], | |
| 316 | + 'telegram' => [ | |
| 317 | + 'title' => __('Telegram', 'fluentform'), | |
| 318 | + 'description' => __('Send notification to Telegram channel or group when a form is submitted', 'fluentform'), | |
| 319 | + 'logo' => fluentFormMix('img/integrations/telegram.png'), | |
| 320 | + 'enabled' => 'no', | |
| 321 | + 'purchase_url' => $purchaseUrl, | |
| 322 | + 'category' => 'crm', | |
| 323 | + ], | |
| 324 | + 'affiliateWp' => [ | |
| 325 | + 'title' => __('AffiliateWP', 'fluentform'), | |
| 326 | + 'description' => __('Generate AffiliateWP referrals automatically when a customer is referred to your site via an affiliate link', 'fluentform'), | |
| 327 | + 'logo' => fluentFormMix('img/integrations/affiliatewp.png'), | |
| 328 | + 'enabled' => 'no', | |
| 329 | + 'purchase_url' => $purchaseUrl, | |
| 330 | + 'category' => 'crm', | |
| 331 | + ], | |
| 332 | + 'clicksend_sms_notification' => [ | |
| 333 | + 'title' => __('ClickSend', 'fluentform'), | |
| 334 | + 'description' => __('Send SMS in real time when a form is submitted with ClickSend', 'fluentform'), | |
| 335 | + 'logo' => fluentFormMix('img/integrations/clicksend.png'), | |
| 336 | + 'enabled' => 'no', | |
| 337 | + 'purchase_url' => $purchaseUrl, | |
| 338 | + 'category' => 'crm', | |
| 339 | + ], | |
| 340 | + 'zohocrm' => [ | |
| 341 | + 'title' => __('Zoho CRM', 'fluentform'), | |
| 342 | + 'description' => __('Zoho CRM is an online Sales CRM software that manages your sales, marketing and support in one CRM platform.', 'fluentform'), | |
| 343 | + 'logo' => fluentFormMix('img/integrations/zohocrm.png'), | |
| 344 | + 'enabled' => 'no', | |
| 345 | + 'purchase_url' => $purchaseUrl, | |
| 346 | + 'category' => 'crm', | |
| 347 | + ], | |
| 348 | + 'cleverreach' => [ | |
| 349 | + 'title' => __('CleverReach', 'fluentform'), | |
| 350 | + 'description' => __('CleverReach is web-based email marketing software for managing email campaigns and contacts. Use Fluent Forms to grow your CleverReach subscriber list', 'fluentform'), | |
| 351 | + 'logo' => fluentFormMix('img/integrations/clever_reach.png'), | |
| 352 | + 'enabled' => 'no', | |
| 353 | + 'purchase_url' => $purchaseUrl, | |
| 354 | + 'category' => 'crm', | |
| 355 | + ], | |
| 356 | + 'salesflare' => [ | |
| 357 | + 'title' => __('Salesflare', 'fluentform'), | |
| 358 | + 'description' => __('Create Salesflare contact from WordPress, so you can grow your contact list', 'fluentform'), | |
| 359 | + 'logo' => fluentFormMix('img/integrations/salesflare.png'), | |
| 360 | + 'enabled' => 'no', | |
| 361 | + 'purchase_url' => $purchaseUrl, | |
| 362 | + 'category' => 'crm', | |
| 363 | + ], | |
| 364 | + 'automizy' => [ | |
| 365 | + 'title' => __('Automizy', 'fluentform'), | |
| 366 | + 'description' => __('Connect Automizy with Fluent Forms and subscribe a contact when a form is submitted.', 'fluentform'), | |
| 367 | + 'logo' => fluentFormMix('img/integrations/automizy.png'), | |
| 368 | + 'enabled' => 'no', | |
| 369 | + 'purchase_url' => $purchaseUrl, | |
| 370 | + 'category' => 'crm', | |
| 371 | + ], | |
| 372 | + 'salesforce' => [ | |
| 373 | + 'title' => __('Salesforce', 'fluentform'), | |
| 374 | + 'description' => __('Salesforce helps your marketing, sales, commerce, service and IT teams work as one from anywhere — so you can keep your customers happy everywhere.', 'fluentform'), | |
| 375 | + 'logo' => fluentFormMix('img/integrations/salesforce.png'), | |
| 376 | + 'enabled' => 'no', | |
| 377 | + 'purchase_url' => $purchaseUrl, | |
| 378 | + 'category' => 'crm', | |
| 379 | + ], | |
| 380 | + 'airtable' => [ | |
| 381 | + 'title' => __('Airtable', 'fluentform'), | |
| 382 | + 'description' => __('Airtable is a low-code platform for building collaborative apps. Customize your workflow, collaborate, and achieve ambitious outcomes.', 'fluentform'), | |
| 383 | + 'logo' => fluentFormMix('img/integrations/airtable.png'), | |
| 384 | + 'enabled' => 'no', | |
| 385 | + 'purchase_url' => $purchaseUrl, | |
| 386 | + 'category' => 'crm', | |
| 387 | + ], | |
| 388 | + 'mailjet' => [ | |
| 389 | + 'title' => __('Mailjet', 'fluentform'), | |
| 390 | + 'description' => __('Mailjet is an easy-to-use all-in-one e-mail platform.', 'fluentform'), | |
| 391 | + 'logo' => fluentFormMix('img/integrations/mailjet.png'), | |
| 392 | + 'enabled' => 'no', | |
| 393 | + 'purchase_url' => $purchaseUrl, | |
| 394 | + 'category' => 'crm', | |
| 395 | + ], | |
| 396 | + 'pipedrive' => [ | |
| 397 | + 'title' => __('Pipedrive', 'fluentform'), | |
| 398 | + 'description' => __('By connecting Pipedrive with Fluent Forms, you can connect and organize leads and more.', 'fluentform'), | |
| 399 | + 'logo' => fluentFormMix('img/integrations/pipedrive.png'), | |
| 400 | + 'enabled' => 'no', | |
| 401 | + 'purchase_url' => $purchaseUrl, | |
| 402 | + 'category' => 'crm', | |
| 403 | + ], | |
| 404 | + 'amocrm' => [ | |
| 405 | + 'title' => __('amoCRM', 'fluentform'), | |
| 406 | + 'description' => __('It can be a great way to manage your leads and tasks with amoCRM and Fluent Forms.', 'fluentform'), | |
| 407 | + 'logo' => fluentFormMix('img/integrations/amocrm.png'), | |
| 408 | + 'enabled' => 'no', | |
| 409 | + 'purchase_url' => $purchaseUrl, | |
| 410 | + 'category' => 'crm', | |
| 411 | + ], | |
| 412 | + 'onepagecrm' => [ | |
| 413 | + 'title' => __('OnePageCRM', 'fluentform'), | |
| 414 | + 'description' => __('Complete your actions with the combination of Fluent Forms and OnePageCRM to collect leads and more.', 'fluentform'), | |
| 415 | + 'logo' => fluentFormMix('img/integrations/onepagecrm.png'), | |
| 416 | + 'enabled' => 'no', | |
| 417 | + 'purchase_url' => $purchaseUrl, | |
| 418 | + 'category' => 'crm', | |
| 419 | + ], | |
| 420 | + 'insightly' => [ | |
| 421 | + 'title' => __('Insightly', 'fluentform'), | |
| 422 | + 'description' => __('With Insightly CRM, you can tailor the standard sales processes of contact, lead and opportunity management.', 'fluentform'), | |
| 423 | + 'logo' => fluentFormMix('img/integrations/insightly.png'), | |
| 424 | + 'enabled' => 'no', | |
| 425 | + 'purchase_url' => $purchaseUrl, | |
| 426 | + 'category' => 'crm', | |
| 427 | + ], | |
| 428 | + 'mailster' => [ | |
| 429 | + 'title' => __('Mailster', 'fluentform'), | |
| 430 | + 'description' => __('Send Beautiful Email Newsletters in WordPress. Join more than 26,000 people worldwide and use Mailster to grow your business.', 'fluentform'), | |
| 431 | + 'logo' => fluentFormMix('img/integrations/mailster.png'), | |
| 432 | + 'enabled' => 'no', | |
| 433 | + 'purchase_url' => $purchaseUrl, | |
| 434 | + 'category' => 'crm', | |
| 435 | + ], | |
| 436 | + 'quiz_addon' => [ | |
| 437 | + 'title' => __('Quiz Module', 'fluentform'), | |
| 438 | + 'description' => __('With this module, you can create quizzes and show scores with grades, points, fractions, or percentages', 'fluentform'), | |
| 439 | + 'logo' => fluentFormMix('img/integrations/quiz-icon.svg'), | |
| 440 | + 'enabled' => 'no', | |
| 441 | + 'purchase_url' => $purchaseUrl, | |
| 442 | + 'category' => 'wp_core', | |
| 443 | + ], | |
| 444 | + 'notion' => [ | |
| 445 | + 'title' => __('Notion', 'fluentform'), | |
| 446 | + 'description' => __('Capture Fluent Forms Submission to your Notion workspaces — and do it exactly the way you want.', 'fluentform'), | |
| 447 | + 'logo' => fluentFormMix('img/integrations/notion.png'), | |
| 448 | + 'enabled' => 'no', | |
| 449 | + 'purchase_url' => $purchaseUrl, | |
| 450 | + 'category' => 'crm', | |
| 451 | + ], | |
| 452 | + ]; | |
| 453 | + | |
| 454 | + foreach ($addOns as $key => &$addOn) { | |
| 455 | + $feature = strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $key)); | |
| 456 | + $addOn['purchase_url'] = fluentform_upgrade_url('feature_lock_' . $feature); | |
| 457 | + } | |
| 458 | + | |
| 459 | + return $addOns; | |
| 460 | + } | |
| 461 | + | |
| 462 | + /** | |
| 463 | + * Show the suggested plugins list. | |
| 464 | + */ | |
| 465 | + public function showSuggestedPlugins() | |
| 466 | + { | |
| 467 | + wp_enqueue_script('fluentform-modules'); | |
| 468 | + | |
| 469 | + $suggestedPlugins = $this->getSuggestedPlugins(); | |
| 470 | + | |
| 471 | + wp_localize_script('fluentform-modules', 'fluent_suggested_plugins', [ | |
| 472 | + 'plugins' => $suggestedPlugins, | |
| 473 | + 'nonce' => wp_create_nonce('fluent_forms_suggested_plugins'), | |
| 474 | + 'assets_url' => fluentFormMix('img/suggested-plugins/'), | |
| 475 | + ]); | |
| 476 | + | |
| 477 | + wpFluentForm('view')->render('admin.addons.suggested_plugins', []); | |
| 478 | + } | |
| 479 | + | |
| 480 | + /** | |
| 481 | + * Get the list of suggested WordPress plugins. | |
| 482 | + * | |
| 483 | + * @return array | |
| 484 | + */ | |
| 485 | + public function getSuggestedPlugins() | |
| 486 | + { | |
| 487 | + $plugins = [ | |
| 488 | + 'fluent-cart' => [ | |
| 489 | + 'title' => __('FluentCart', 'fluentform'), | |
| 490 | + 'description' => __('A performance-first, self-hosted eCommerce platform for WordPress', 'fluentform'), | |
| 491 | + 'logo' => 'fcart.svg', | |
| 492 | + 'slug' => 'fluent-cart/fluent-cart.php', | |
| 493 | + 'basename' => 'fluent-cart', | |
| 494 | + 'badge_type' => 'official', | |
| 495 | + 'wporg_url' => 'https://wordpress.org/plugins/fluent-cart/', | |
| 496 | + 'setup_url' => admin_url('admin.php?page=fluent-cart'), | |
| 497 | + 'setup_label' => __('Dashboard', 'fluentform'), | |
| 498 | + ], | |
| 499 | + 'fluent-smtp' => [ | |
| 500 | + 'title' => __('FluentSMTP', 'fluentform'), | |
| 501 | + 'description' => __('The Ultimate Free SMTP Plugin for WordPress. Safely send emails via Amazon SES, Mailgun, SendGrid, Outlook, Gmail, and more.', | |
| 502 | + 'fluentform'), | |
| 503 | + 'logo' => 'fluent-smtp.svg', | |
| 504 | + 'slug' => 'fluent-smtp/fluent-smtp.php', | |
| 505 | + 'basename' => 'fluent-smtp', | |
| 506 | + 'badge_type' => 'official', | |
| 507 | + 'wporg_url' => 'https://wordpress.org/plugins/fluent-smtp/', | |
| 508 | + 'setup_url' => admin_url('options-general.php?page=fluent-mail#/connections'), | |
| 509 | + 'setup_label' => __('Configure', 'fluentform'), | |
| 510 | + ], | |
| 511 | + 'multilingual-forms-fluent-forms-wpml' => [ | |
| 512 | + 'title' => __('Multilingual Forms for Fluent Forms (WPML)', 'fluentform'), | |
| 513 | + 'description' => __('Make Fluent Forms multilingual with WPML integration', 'fluentform'), | |
| 514 | + 'logo' => 'wpml-ff.png', | |
| 515 | + 'slug' => 'multilingual-forms-fluent-forms-wpml/multilingual-forms-for-fluent-forms-with-wpml.php', | |
| 516 | + 'basename' => 'multilingual-forms-fluent-forms-wpml', | |
| 517 | + 'badge_type' => 'official', | |
| 518 | + 'wporg_url' => 'https://wordpress.org/plugins/multilingual-forms-fluent-forms-wpml/', | |
| 519 | + ], | |
| 520 | + 'cloud-storage-manager' => [ | |
| 521 | + 'title' => __('Cloud Storage Manager for Fluent Forms', 'fluentform'), | |
| 522 | + 'description' => __('Cloud Storage Manager bridges the gap between your fluent forms and popular cloud storage platforms.', | |
| 523 | + 'fluentform'), | |
| 524 | + 'logo' => 'cloud-storage-manager.png', | |
| 525 | + 'slug' => 'cloud-storage-manager/cloud-storage-manager.php', | |
| 526 | + 'basename' => 'cloud-storage-manager', | |
| 527 | + 'badge_type' => 'verified', | |
| 528 | + 'wporg_url' => 'https://wordpress.org/plugins/cloud-storage-manager/', | |
| 529 | + ], | |
| 530 | + 'fluent-pdf' => [ | |
| 531 | + 'title' => __('Fluent Forms PDF', 'fluentform'), | |
| 532 | + 'description' => __('Generate PDF from Fluent Forms Submissions and Send via Email or Download', | |
| 533 | + 'fluentform'), | |
| 534 | + 'logo' => 'fluent-pdf.svg', | |
| 535 | + 'slug' => 'fluentforms-pdf/fluentforms-pdf.php', | |
| 536 | + 'basename' => 'fluentforms-pdf', | |
| 537 | + 'badge_type' => 'official', | |
| 538 | + 'wporg_url' => 'https://wordpress.org/plugins/fluentforms-pdf/', | |
| 539 | + 'setup_url' => admin_url('admin.php?page=fluent_forms_add_ons&sub_page=fluentform_pdf'), | |
| 540 | + 'setup_label' => __('Configure', 'fluentform'), | |
| 541 | + ], | |
| 542 | + 'fluent-community' => [ | |
| 543 | + 'title' => __('FluentCommunity', 'fluentform'), | |
| 544 | + 'description' => __('Build Your Own Community & Membership Site with FluentCommunity', 'fluentform'), | |
| 545 | + 'logo' => 'fluent-community.svg', | |
| 546 | + 'slug' => 'fluent-community/fluent-community.php', | |
| 547 | + 'basename' => 'fluent-community', | |
| 548 | + 'badge_type' => 'official', | |
| 549 | + 'wporg_url' => 'https://wordpress.org/plugins/fluent-community/', | |
| 550 | + 'setup_url' => admin_url('admin.php?page=fluent-community'), | |
| 551 | + 'setup_label' => __('Dashboard', 'fluentform'), | |
| 552 | + ], | |
| 553 | + 'fluent-support' => [ | |
| 554 | + 'title' => __('Fluent Support', 'fluentform'), | |
| 555 | + 'description' => __('WordPress Helpdesk and Customer Support Ticket Plugin', 'fluentform'), | |
| 556 | + 'logo' => 'fluent-support.svg', | |
| 557 | + 'slug' => 'fluent-support/fluent-support.php', | |
| 558 | + 'basename' => 'fluent-support', | |
| 559 | + 'badge_type' => 'official', | |
| 560 | + 'wporg_url' => 'https://wordpress.org/plugins/fluent-support/', | |
| 561 | + 'setup_url' => admin_url('admin.php?page=fluent-support'), | |
| 562 | + 'setup_label' => __('Dashboard', 'fluentform'), | |
| 563 | + ], | |
| 564 | + 'wp-social-reviews' => [ | |
| 565 | + 'title' => __('WP Social Ninja', 'fluentform'), | |
| 566 | + 'description' => __('Best Social Media Plugin for WordPress to Showcase Social Feeds, Reviews, and Chat Widgets', | |
| 567 | + 'fluentform'), | |
| 568 | + 'logo' => 'wp-social-reviews.gif', | |
| 569 | + 'slug' => 'wp-social-reviews/wp-social-reviews.php', | |
| 570 | + 'basename' => 'wp-social-reviews', | |
| 571 | + 'badge_type' => 'official', | |
| 572 | + 'wporg_url' => 'https://wordpress.org/plugins/wp-social-reviews/', | |
| 573 | + 'setup_url' => admin_url('admin.php?page=wpsocialninja.php'), | |
| 574 | + 'setup_label' => __('Dashboard', 'fluentform'), | |
| 575 | + ], | |
| 576 | + 'fluent-crm' => [ | |
| 577 | + 'title' => __('FluentCRM', 'fluentform'), | |
| 578 | + 'description' => __('Email Marketing Automation and CRM Plugin for WordPress', 'fluentform'), | |
| 579 | + 'logo' => 'fluent-crm.svg', | |
| 580 | + 'slug' => 'fluent-crm/fluent-crm.php', | |
| 581 | + 'basename' => 'fluent-crm', | |
| 582 | + 'badge_type' => 'official', | |
| 583 | + 'wporg_url' => 'https://wordpress.org/plugins/fluent-crm/', | |
| 584 | + 'setup_url' => admin_url('admin.php?page=fluentcrm-admin'), | |
| 585 | + 'setup_label' => __('Dashboard', 'fluentform'), | |
| 586 | + ], | |
| 587 | + ]; | |
| 588 | + | |
| 589 | + // Add status to each plugin | |
| 590 | + foreach ($plugins as $key => &$plugin) { | |
| 591 | + $plugin['status'] = $this->getPluginStatus($plugin['slug']); | |
| 592 | + } | |
| 593 | + | |
| 594 | + return $plugins; | |
| 595 | + } | |
| 596 | + | |
| 597 | + /** | |
| 598 | + * Get the installation and activation status of a plugin. | |
| 599 | + * | |
| 600 | + * @param string $pluginSlug The plugin slug (e.g., 'fluent-crm/fluent-crm.php') | |
| 601 | + * @return string 'active', 'inactive', or 'not_installed' | |
| 602 | + */ | |
| 603 | + private function getPluginStatus($pluginSlug) | |
| 604 | + { | |
| 605 | + // Check if plugin file exists | |
| 606 | + $pluginFile = WP_PLUGIN_DIR . '/' . $pluginSlug; | |
| 607 | + | |
| 608 | + if (!file_exists($pluginFile)) { | |
| 609 | + return 'not_installed'; | |
| 610 | + } | |
| 611 | + | |
| 612 | + // Ensure is_plugin_active function is available | |
| 613 | + if (!function_exists('is_plugin_active')) { | |
| 614 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 615 | + } | |
| 616 | + // Check if plugin is active | |
| 617 | + if (is_plugin_active($pluginSlug)) { | |
| 618 | + return 'active'; | |
| 619 | + } | |
| 620 | + | |
| 621 | + return 'inactive'; | |
| 284 | 622 | } |
| 285 | 623 | } |