PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 3.7.0
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v3.7.0
4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 All 340 releases
profile-builder / admin / add-ons.php

add-ons.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 3.7.0, at admin/add-ons.php

404 lines 29.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
4 if( ! class_exists( 'CL_Addons_List_Table' ) ) {
5 require_once( WPPB_PLUGIN_DIR . '/assets/lib/cl-add-ons-listing/cl-add-ons-listing.php' );
6 }
7
8 /**
9 * Function that creates the "Add-Ons" submenu page
10 *
11 * @since v.2.1.0
12 *
13 * @return void
14 */
15 function wppb_register_add_ons_submenu_page() {
16 add_submenu_page( 'profile-builder', __( 'Add-Ons', 'profile-builder' ), __( 'Add-Ons', 'profile-builder' ), 'manage_options', 'profile-builder-add-ons', 'wppb_add_ons_content' );
17 }
18 add_action( 'admin_menu', 'wppb_register_add_ons_submenu_page', 19 );
19
20
21 /**
22 * Function that adds content to the "Add-Ons" submenu page
23 *
24 * @since v.2.1.0
25 *
26 * @return string
27 */
28 function wppb_add_ons_content() {
29 //initialize the object
30 $pb_addons_listing = new CL_Addons_List_Table();
31 $pb_addons_listing->images_folder = WPPB_PLUGIN_URL.'assets/images/';
32 $pb_addons_listing->text_domain = 'profile-builder';
33 $pb_addons_listing->header = array( 'title' => __('Profile Builder Add-ons', 'profile-builder' ) );
34 $pb_addons_listing->current_version = PROFILE_BUILDER;
35 $pb_addons_listing->tooltip_header = __( 'Profile Builder Add-ons', 'profile-builder' );
36 $pb_addons_listing->tooltip_content = sprintf( __( 'You must first purchase this version to have access to the addon %1$shere%2$s', 'profile-builder' ), '<a target="_blank" href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PB">', '</a>' );
37
38
39 //Add Pro Section
40 $pb_addons_listing->section_header = array( 'title' => __('Pro Add-ons', 'profile-builder' ), 'description' => __('These Add-ons are available with the Pro and Unlimited license', 'profile-builder') );
41 $pb_addons_listing->section_versions = array( 'Profile Builder Pro' );
42 $pb_addons_listing->items = array(
43 array( 'slug' => 'wppb_multipleRegistrationForms',
44 'type' => 'add-on',
45 'name' => __( 'Multiple Registration Forms', 'profile-builder' ),
46 'description' => __( 'Set up multiple registration forms with different fields for certain user roles. Helps capture different information from different types of users.', 'profile-builder' ),
47 'icon' => 'pro_multiple_registration.png',
48 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/modules/multiple-registration-forms/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
49 ),
50 array( 'slug' => 'wppb_multipleEditProfileForms',
51 'type' => 'add-on',
52 'name' => __( 'Multiple Edit Profile Forms', 'profile-builder' ),
53 'description' => __( 'Allow different user roles to edit their specific information. Set up multiple edit-profile forms with different fields for certain user roles.', 'profile-builder' ),
54 'icon' => 'pro_multiple_edit_profile.png',
55 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/modules/multiple-edit-profile-forms/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
56 ),
57 array( 'slug' => 'wppb_userListing',
58 'type' => 'add-on',
59 'name' => __( 'User Listing', 'profile-builder' ),
60 'description' => __( 'Easy to edit templates for listing your users as well as creating single user pages.', 'profile-builder' ),
61 'icon' => 'pro_user_listing.png',
62 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/modules/user-listing/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
63 ),
64 array( 'slug' => 'wppb_emailCustomizer',
65 'type' => 'add-on',
66 'name' => __( 'Email Customizer', 'profile-builder' ),
67 'description' => __( 'Simple to use customization of the WordPress Registration Emails', 'profile-builder' ),
68 'icon' => 'pro_email_customizer.png',
69 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/modules/user-email-customizer/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
70 ),
71 array( 'slug' => 'wppb_customRedirect',
72 'type' => 'add-on',
73 'name' => __( 'Custom Redirects', 'profile-builder' ),
74 'description' => __( 'Redirect users after login, after they first register or when they try to access the default WordPress dashboard, login, lost password and registration forms.', 'profile-builder' ),
75 'icon' => 'pro_custom_redirects.png',
76 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/modules/custom-redirects/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
77 ),
78 array( 'slug' => 'wppb_repeaterFields',
79 'type' => 'add-on',
80 'name' => __( 'Repeater Fields', 'profile-builder' ),
81 'description' => __( 'The Repeater Field Module makes it really easy to add repeater front-end fields or groups of fields to your user profile. Integration with both the Email Customizer and User Listing modules, makes creating advanced user profiles possible.', 'profile-builder' ),
82 'icon' => 'pro_repeater_fields.png',
83 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/modules/repeater-fields/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
84 ),
85 array( 'slug' => 'pb-add-on-buddypress/index.php',
86 'type' => 'plugin',
87 'name' => __( 'BuddyPress', 'profile-builder' ),
88 'description' => __( 'This integration add-on allows extending BuddyPress user profiles with Profile Builder user fields.', 'profile-builder' ),
89 'icon' => 'pro_buddypress.png',
90 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/buddypress/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
91 'download_url' => 'https://www.cozmoslabs.com/add-ons/buddypress/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
92 ),
93 );
94 $pb_addons_listing->add_section();
95
96 //Add Hobbyist section
97 $pb_addons_listing->section_header = array( 'title' => __('Advanced Add-ons', 'profile-builder' ), 'description' => __('These Add-ons are available with the Hobbyist, Pro and Unlimited license', 'profile-builder') );
98 $pb_addons_listing->section_versions = array( 'Profile Builder Pro', 'Profile Builder Hobbyist' );
99 $pb_addons_listing->items = array(
100 array( 'slug' => 'pb-add-on-social-connect/index.php',
101 'type' => 'plugin',
102 'name' => __( 'Social Connect', 'profile-builder' ),
103 'description' => __( 'Easily configure and enable social login on your website. Users can login with social platforms like Facebook, Google+ or Twitter.', 'profile-builder' ),
104 'icon' => 'pb_addon_small_social_connect.png',
105 'doc_url' => 'http://www.cozmoslabs.com/docs/profile-builder-2/add-ons/social-connect/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
106 'download_url' => 'https://www.cozmoslabs.com/add-ons/social-connect/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
107 ),
108 array( 'slug' => 'pb-add-on-woocommerce/index.php',
109 'type' => 'plugin',
110 'name' => __( 'WooCommerce Sync', 'profile-builder' ),
111 'description' => __( 'Syncs Profile Builder with WooCommerce, allowing you to manage the user Shipping and Billing fields from WooCommerce with Profile Builder.', 'profile-builder' ),
112 'icon' => 'pb_addon_small_woosync.png',
113 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/woocommerce-sync/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
114 'download_url' => 'https://www.cozmoslabs.com/add-ons/woocommerce-sync/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
115 ),
116 array( 'slug' => 'pb-add-on-multi-step-forms/index.php',
117 'type' => 'plugin',
118 'name' => __( 'Multi Step Forms', 'profile-builder' ),
119 'description' => __( 'Extends the functionality of Profile Builder by adding the possibility of having multi-page registration and edit-profile forms.', 'profile-builder' ),
120 'icon' => 'pb_addon_small_multistep_forms.png',
121 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/multi-step-forms/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
122 'download_url' => 'https://www.cozmoslabs.com/add-ons/multi-step-forms/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
123 ),
124 array( 'slug' => 'pb-add-on-mailchimp-integration/index.php',
125 'type' => 'plugin',
126 'name' => __( 'MailChimp', 'profile-builder' ),
127 'description' => __( 'Easily associate MailChimp list fields with Profile Builder fields and set advanced settings for each list.', 'profile-builder' ),
128 'icon' => 'pb_addon_small_mailchimp.png',
129 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/mailchimp/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
130 'download_url' => 'https://www.cozmoslabs.com/add-ons/profile-builder-mailchimp/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
131 ),
132 array( 'slug' => 'pb-add-on-bbpress/index.php',
133 'type' => 'plugin',
134 'name' => __( 'bbPress', 'profile-builder' ),
135 'description' => __( 'This add-on allows you to integrate Profile Builder with the popular forums plugin, bbPress.', 'profile-builder' ),
136 'icon' => 'pb_addon_small_bbpress.png',
137 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/bbpress/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
138 'download_url' => 'https://www.cozmoslabs.com/add-ons/bbpress/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
139 ),
140 array( 'slug' => 'pb-add-on-campaign-monitor/index.php',
141 'type' => 'plugin',
142 'name' => __( 'Campaign Monitor', 'profile-builder' ),
143 'description' => __( 'Easily associate Campaign Monitor client list fields with Profile Builder fields. Use Profile Builder Campaign Monitor Widget to add more subscribers to your lists.', 'profile-builder' ),
144 'icon' => 'pb_addon_small_campaignmonitor.png',
145 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/campaign-monitor/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
146 'download_url' => 'https://www.cozmoslabs.com/add-ons/profile-builder-campaign-monitor/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
147 ),
148 array( 'slug' => 'pb-add-on-field-visibility/index.php',
149 'type' => 'plugin',
150 'name' => __( 'Field Visibility', 'profile-builder' ),
151 'description' => __( 'Extends the functionality of Profile Builder by allowing you to change visibility options for the extra fields.', 'profile-builder' ),
152 'icon' => 'pb_addon_small_fieldvisibility.png',
153 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/field-visibility/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
154 'download_url' => 'https://www.cozmoslabs.com/add-ons/field-visibility/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
155 ),
156 array( 'slug' => 'pb-add-on-edit-profile-approved-by-admin/index.php',
157 'type' => 'plugin',
158 'name' => __( 'Edit Profile Approved by Admin', 'profile-builder' ),
159 'description' => __( 'Extends the functionality of Profile Builder by allowing administrators to approve profile changes made by users on individual fields.', 'profile-builder' ),
160 'icon' => 'pb_addon_epaa_small.png',
161 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/edit-profile-approved-by-admin/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
162 'download_url' => 'https://www.cozmoslabs.com/add-ons/edit-profile-approved-by-admin/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
163 ),
164 array( 'slug' => 'pb-add-on-custom-profile-menus/index.php',
165 'type' => 'plugin',
166 'name' => __( 'Custom Profile Menus', 'profile-builder' ),
167 'description' => __( 'Add custom menu items like Login/Logout or just Logout button and Login/Register/Edit Profile in iFrame Popup.', 'profile-builder' ),
168 'icon' => 'pb_addon_small_custom_menu.png',
169 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/custom-profile-menus/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
170 'download_url' => 'https://www.cozmoslabs.com/add-ons/custom-profile-menus/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
171 ),
172 array( 'slug' => 'pb-add-on-mailpoet-integration/index.php',
173 'type' => 'plugin',
174 'name' => __( 'MailPoet', 'profile-builder' ),
175 'description' => __( 'Allow users to subscribe to your MailPoet lists directly from the Register and Edit Profile forms.', 'profile-builder' ),
176 'icon' => 'pb_addon_small_mailpoet.png',
177 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/mailpoet/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
178 'download_url' => 'https://www.cozmoslabs.com/add-ons/mailpoet/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
179 ),
180 );
181 $pb_addons_listing->add_section();
182
183 //Add Free section
184 $pb_addons_listing->section_header = array( 'title' => __('Free Add-ons', 'profile-builder' ), 'description' => __('These Add-ons are available in all versions of Profile Builder', 'profile-builder') );
185 $pb_addons_listing->section_versions = array( 'Profile Builder Pro', 'Profile Builder Hobbyist', 'Profile Builder Free' );
186 $pb_addons_listing->items = array(
187 array( 'slug' => 'import-export',
188 'type' => 'add-on',
189 'name' => __( 'Import and Export', 'profile-builder' ),
190 'description' => __( 'With the help of this add-on you will be able to export all Profile Builder Settings data to a .json. You can then use this file as a back-up or you can import this data on another instance of Profile Builder.', 'profile-builder' ),
191 'icon' => 'pb_addon_small_importexport.png',
192 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/import-export-pb-settings/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
193 'download_url' => 'https://www.cozmoslabs.com/add-ons/import-export/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
194 ),
195 array( 'slug' => 'custom-css-classes-on-fields',
196 'type' => 'add-on',
197 'name' => __( 'Custom CSS Classes on Fields', 'profile-builder' ),
198 'description' => __( 'This add-on extends the functionality of Profile Builder by allowing you to add custom css classes for fields.', 'profile-builder' ),
199 'icon' => 'pb_addon_small_cssclasses.png',
200 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/custom-css-classes-on-fields-for-profile-builder/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
201 'download_url' => 'https://www.cozmoslabs.com/add-ons/custom-css-classes-fields/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
202 ),
203 array( 'slug' => 'maximum-character-length',
204 'type' => 'add-on',
205 'name' => __( 'Maximum Character Length', 'profile-builder' ),
206 'description' => __( 'Using this addon you can limit the maximum number of characters a user can type in a field added and managed with Profile Builder.', 'profile-builder' ),
207 'icon' => 'pb_addon_small_maxcharlength.png',
208 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/maximum-character-length/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
209 'download_url' => 'https://www.cozmoslabs.com/add-ons/maximum-character-length/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
210 ),
211 /*array( 'slug' => 'pd-add-on-multiple-admin-e-mails/index.php',
212 'type' => 'plugin',
213 'name' => __( 'Multiple Admin E-mails', 'profile-builder' ),
214 'description' => __( 'Extends the functionality of Profile Builder by allowing you to set multiple admin e-mail addresses that will receive e-mail notifications sent by Profile Builder.', 'profile-builder' ),
215 'icon' => 'pb_addon_small_multipleadminemails.png',
216 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/multiple-admin-e-mails/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
217 'download_url' => 'https://www.cozmoslabs.com/add-ons/multiple-admin-e-mails/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
218 ),*/
219 array( 'slug' => 'labels-edit',
220 'type' => 'add-on',
221 'name' => __( 'Labels Edit', 'profile-builder' ),
222 'description' => __( 'This add-on extends the functionality of our plugin and let us easily edit all Profile Builder labels.', 'profile-builder' ),
223 'icon' => 'pb_addon_small_labeledit.png',
224 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/labels-edit/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
225 'download_url' => 'https://www.cozmoslabs.com/add-ons/labels-edit/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
226 ),
227 /*array( 'slug' => 'pb-add-on-placeholder-labels/pbpl.php',
228 'type' => 'plugin',
229 'name' => __( 'Placeholder Labels', 'profile-builder' ),
230 'description' => __( 'Extends the functionality of our plugin by replacing Labels with Placeholders in Profile Builder forms.', 'profile-builder' ),
231 'icon' => 'pb_addon_small_placeholder.png',
232 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/placeholder-labels/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
233 'download_url' => 'https://www.cozmoslabs.com/add-ons/placeholder-labels/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
234 ),*/
235 /*array( 'slug' => 'pb-add-on-email-confirmation-field/index.php',
236 'type' => 'plugin',
237 'name' => __( 'Email Confirmation Field', 'profile-builder' ),
238 'description' => __( 'The Email Confirmation Field add-on is meant to check if the email address entered matches the first one, making sure a user submits a valid and correct email address.', 'profile-builder' ),
239 'icon' => 'pb_addon_small_emailconfirmation.png',
240 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/email-confirmation-field/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
241 'download_url' => 'https://www.cozmoslabs.com/add-ons/email-confirmation-field/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
242 ),*/
243 /*array( 'slug' => 'pb-add-on-select2/index.php',
244 'type' => 'plugin',
245 'name' => __( 'Select2', 'profile-builder' ),
246 'description' => __( 'This add-on allows you to create select fields with search and filter functionality. All of this in a good looking, responsive select box.', 'profile-builder' ),
247 'icon' => 'pb_addon_small_select2.png',
248 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/select2/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
249 'download_url' => 'https://www.cozmoslabs.com/add-ons/select2/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
250 ),*/
251 array( 'slug' => 'gdpr-communication-preferences',
252 'type' => 'add-on',
253 'name' => __( 'GDPR Communication Preferences', 'profile-builder' ),
254 'description' => __( 'This add-on plugin adds a GDPR Communication preferences field to Profile Builder.', 'profile-builder' ),
255 'icon' => 'pb_addon_gdpr_small.png',
256 'doc_url' => 'https://www.cozmoslabs.com/add-ons/gdpr-communication-preferences/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
257 'download_url' => 'https://www.cozmoslabs.com/add-ons/gdpr-communication-preferences/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
258 ),
259 );
260 $pb_addons_listing->add_section();
261
262
263
264 //Add Recommended Plugins
265 $pb_addons_listing->section_header = array( 'title' => __('Recommended Plugins', 'profile-builder' ), 'description' => __('These plugins are compatible with all versions of Profile Builder', 'profile-builder') );
266 $pb_addons_listing->section_versions = array( 'Profile Builder Pro', 'Profile Builder Hobbyist', 'Profile Builder Free' );
267 $pb_addons_listing->items = array(
268 array( 'slug' => 'translatepress-multilingual/index.php',
269 'type' => 'plugin',
270 'name' => __( 'TranslatePress', 'profile-builder' ),
271 'description' => __( 'Translate your Profile Builder forms with a WordPress translation plugin that anyone can use. It offers a simpler way to translate WordPress sites, with full support for WooCommerce and site builders.', 'profile-builder' ),
272 'icon' => 'translatepress_logo.png',
273 'doc_url' => 'https://translatepress.com/docs/translatepress/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
274 'download_url' => 'https://wordpress.org/plugins/translatepress-multilingual/'
275 ),
276 array( 'slug' => 'paid-member-subscriptions/index.php',
277 'type' => 'plugin',
278 'name' => __( 'Paid Member Subscriptions', 'profile-builder' ),
279 'description' => __( 'Accept user payments, create subscription plans and restrict content on your membership site.', 'profile-builder' ),
280 'icon' => 'pms_logo.png',
281 'doc_url' => 'https://www.cozmoslabs.com/docs/paid-member-subscriptions/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
282 'download_url' => 'https://wordpress.org/plugins/paid-member-subscriptions/'
283 ),
284 array( 'slug' => 'client-portal/index.php',
285 'type' => 'plugin',
286 'name' => __( 'Client Portal', 'profile-builder' ),
287 'description' => __( 'Create private pages for your website users that only an administrator can edit.', 'profile-builder' ),
288 'icon' => 'pb_addon_client_portal.png',
289 'doc_url' => 'https://www.cozmoslabs.com/55726-how-to-wordpress-client-portal-plugin/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
290 'download_url' => 'https://www.cozmoslabs.com/add-ons/client-portal/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
291 ),
292 array( 'slug' => 'custom-login-page-templates/custom-login-templates.php',
293 'type' => 'plugin',
294 'name' => __( 'Custom Login Page Templates', 'profile-builder' ),
295 'description' => __( 'Customizes the default WordPress Login Page with different templates, logo and background uploads and also adds support for custom CSS.', 'profile-builder' ),
296 'icon' => 'custom_login_page_templates_logo.png',
297 'doc_url' => 'https://www.cozmoslabs.com/add-ons/custom-login-page-templates/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
298 'download_url' => 'https://www.cozmoslabs.com/add-ons/custom-login-page-templates/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
299 ),
300 array( 'slug' => 'passwordless-login/passwordless_login.php',
301 'type' => 'plugin',
302 'name' => __( 'Passwordless Login', 'profile-builder' ),
303 'description' => __( 'WordPress Passwordless Login is a plugin that allows your users to login without a password.', 'profile-builder' ),
304 'icon' => 'pb_addon_small_passwordlesslogin.png',
305 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder-2/add-ons/passwordless-login/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro',
306 'download_url' => 'https://www.cozmoslabs.com/add-ons/passwordless-login/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBPro'
307 ),
308 );
309 $pb_addons_listing->add_section();
310
311
312 //Display the whole listing
313 $pb_addons_listing->display_addons();
314 }
315
316
317 /**
318 * Add this for generating default options on first install
319 */
320 add_action( 'admin_init', 'wppb_generate_modules_default_values' );
321 function wppb_generate_modules_default_values(){
322 $wppb_module_settings = get_option( 'wppb_module_settings', 'not_found' );
323 if ( $wppb_module_settings == 'not_found' ){
324 $wppb_module_settings = array( 'wppb_userListing' => 'hide',
325 'wppb_customRedirect' => 'hide',
326 'wppb_emailCustomizer' => 'hide',
327 'wppb_multipleEditProfileForms' => 'hide',
328 'wppb_multipleRegistrationForms' => 'hide',
329 'wppb_repeaterFields' => 'hide'
330 );
331 update_option( 'wppb_module_settings', $wppb_module_settings );
332 }
333 }
334
335
336 /**
337 * For add-ons (not plugins) the implementation is speciffic to each plugin ( PB/PMS/TP ) and is done through filters in the plugin itself
338 */
339
340 /**
341 * Function that determines if a PB add-on is active
342 */
343 add_filter( 'cl_add_on_is_active', 'wppb_check_add_ons_activation', 10, 2 );
344 function wppb_check_add_ons_activation( $bool, $slug ){
345 return wppb_check_if_add_on_is_active($slug);
346 }
347
348 /**
349 * Function that activates a PB add-on
350 */
351 add_action( 'cl_add_ons_activate', 'wppb_activate_add_ons' );
352 function wppb_activate_add_ons( $slug ){
353 wppb_activate_or_deactivate_add_on( $slug, 'show' );
354 }
355
356 /**
357 * Function that deactivates a PB add-on
358 */
359 add_action( 'cl_add_ons_deactivate', 'wppb_deactivate_add_ons' );
360 function wppb_deactivate_add_ons( $slug ){
361 wppb_activate_or_deactivate_add_on( $slug, 'hide' );
362 }
363
364
365 /**
366 * Function used to activate or deactivate a PB add-on
367 */
368 function wppb_activate_or_deactivate_add_on( $slug, $action ){
369 //the old modules part
370 $wppb_module_settings = get_option( 'wppb_module_settings', 'not_found' );
371 if ( $wppb_module_settings != 'not_found' ){
372 foreach( $wppb_module_settings as $add_on_slug => $status ){
373 if( $slug == $add_on_slug ){
374 $wppb_module_settings[$add_on_slug] = $action;
375 }
376 }
377 }
378 update_option( 'wppb_module_settings', $wppb_module_settings );
379
380 //the free addons part
381 $wppb_free_add_ons_settings = get_option( 'wppb_free_add_ons_settings', array() );
382 if ( !empty( $wppb_free_add_ons_settings ) ){
383 foreach( $wppb_free_add_ons_settings as $add_on_slug => $status ){
384 if( $slug == $add_on_slug ){
385 if( $action == 'show' )
386 $wppb_free_add_ons_settings[$add_on_slug] = true;
387 elseif( $action == 'hide' )
388 $wppb_free_add_ons_settings[$add_on_slug] = false;
389 }
390 }
391 }
392 update_option( 'wppb_free_add_ons_settings', $wppb_free_add_ons_settings );
393 }
394
395 /**
396 * Add a notice on the add-ons page if the save was successful
397 */
398 if ( isset($_GET['cl_add_ons_listing_success']) ){
399 if( class_exists('WPPB_Add_General_Notices') ) {
400 new WPPB_Add_General_Notices('cl_add_ons_listing_success',
401 sprintf(__('%1$sAdd-ons settings saved successfully%2$s', 'profile-builder'), "<p>", "</p>"),
402 'updated notice is-dismissible');
403 }
404 }