PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.2
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.2
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 4.0.2, at admin/add-ons.php

422 lines 31.2 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', 28 );
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/add-ons/';
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 need an active license to have access to the addon. %1$sRenew%2$s or %3$spurchase a new one here%4$s.', 'profile-builder' ), '<a target="_blank" href="https://www.cozmoslabs.com/account/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-expired-license">', '</a>', '<a target="_blank" href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-expired-license#pricing">', '</a>' );
37 $pb_addons_listing->tooltip_content_license_inactive = sprintf( __( 'To activate this add-on, you must first %senter your license key%s.', 'profile-builder' ), '<a target="_blank" href="'.admin_url( 'admin.php?page=profile-builder-general-settings' ).'">', '</a>' );
38
39
40 //Add Pro Section
41 $pb_addons_listing->section_header = array( 'title' => __( 'Pro Add-ons', 'profile-builder' ), 'description' => __( 'These Add-ons are available with the Pro and Agency license', 'profile-builder' ) );
42 $pb_addons_listing->section_header_free = array( 'title' => __( 'Pro Add-ons', 'profile-builder' ), 'description' => sprintf( __( 'Get access to these Add-ons with a Pro or Agency license. %sBuy now%s', 'profile-builder' ), '<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=pb-addons-pro&utm_medium=client-site&utm_campaign=pb-pro-addons-upsell#pricing" target="_blank">', '</a>' ) );
43 $pb_addons_listing->section_versions = array( 'Profile Builder Pro', 'Profile Builder Agency', 'Profile Builder Unlimited' );
44 // The Multiple Registration / Multiple Edit Profile Forms cards were
45 // removed because the underlying functionality is now bundled with the
46 // form-builder (see form-builder/multiple-forms/). Users access the
47 // classic UI via the per-CPT toggle in Advanced Settings -> Forms ->
48 // Forms Editor, so the standalone upsell cards no longer apply.
49 $pb_addons_listing->items = array(
50 array( 'slug' => 'wppb_userListing',
51 'type' => 'add-on',
52 'name' => __( 'User Listing', 'profile-builder' ),
53 'description' => __( 'Easy to edit templates for listing your users as well as creating single user pages.', 'profile-builder' ),
54 'icon' => 'pb-add-on-userlisting-logo.png',
55 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/modules/user-listing/?utm_source=pb-addons-pro&utm_medium=client-site&utm_campaign=pb-user-listing-addon',
56 ),
57 array( 'slug' => 'wppb_customRedirect',
58 'type' => 'add-on',
59 'name' => __( 'Custom Redirects', 'profile-builder' ),
60 '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' ),
61 'icon' => 'pb-add-on-custom-redirects-logo.png',
62 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/modules/custom-redirects/?utm_source=pb-addons-pro&utm_medium=client-site&utm_campaign=pb-custom-redirects-addon',
63 ),
64 array( 'slug' => 'wppb_fileRestriction',
65 'type' => 'add-on',
66 'name' => __( 'Files Restriction', 'profile-builder' ),
67 'description' => __( 'Protect your Media Library by restricting direct links to media files according to user roles.', 'profile-builder' ),
68 'icon' => 'pb-add-on-file-restriction-logo.png',
69 'doc_url' => 'https://www.cozmoslabs.com/add-ons/files-restriction/?utm_source=pb-addons-pro&utm_medium=client-site&utm_campaign=pb-files-restriction-addon',
70 ),
71 array( 'slug' => 'wppb_repeaterFields',
72 'type' => 'add-on',
73 'name' => __( 'Repeater Fields', 'profile-builder' ),
74 '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' ),
75 'icon' => 'pb-add-on-repeater-fields-logo.png',
76 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/modules/repeater-fields/?utm_source=pb-addons-pro&utm_medium=client-site&utm_campaign=pb-repeater-fields-addon',
77 ),
78 array( 'slug' => 'buddypress',
79 'type' => 'add-on',
80 'name' => __( 'BuddyPress', 'profile-builder' ),
81 'description' => __( 'This integration add-on allows extending BuddyPress user profiles with Profile Builder user fields.', 'profile-builder' ),
82 'icon' => 'pb-add-on-buddypress-logo.png',
83 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/buddypress/?utm_source=pb-addons-pro&utm_medium=client-site&utm_campaign=pb-buddypress-addon',
84 'download_url' => 'https://www.cozmoslabs.com/add-ons/buddypress/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
85 ),
86 );
87 $pb_addons_listing->add_section();
88
89 //Add Basic section
90 $pb_addons_listing->section_header = array( 'title' => __( 'Basic Add-ons', 'profile-builder' ), 'description' => __( 'These Add-ons are available with the Basic, Pro and Agency license', 'profile-builder' ) );
91 $pb_addons_listing->section_header_free = array( 'title' => __( 'Basic Add-ons', 'profile-builder' ), 'description' => sprintf( __( 'Get access to these Add-ons with a Basic, Pro or Agency license. %sBuy now%s', 'profile-builder' ), '<a href="https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-basic-addons-upsell#pricing" target="_blank">', '</a>' ) );
92 $pb_addons_listing->section_versions = array( 'Profile Builder Pro', 'Profile Builder Hobbyist', 'Profile Builder Basic', 'Profile Builder Agency', 'Profile Builder Unlimited' );
93 $pb_addons_listing->items = array(
94 array( 'slug' => 'form-fields-in-columns',
95 'type' => 'add-on',
96 'name' => __( 'Form Fields in Columns', 'profile-builder' ),
97 'description' => __( 'Extends the functionality of Profile Builder by adding the possibility to organize fields in columns.', 'profile-builder' ),
98 'icon' => 'pb-add-on-form-fields-in-columns-logo.png',
99 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/form-fields-in-columns/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-field-columns-addon',
100 'download_url' => 'https://www.cozmoslabs.com/add-ons/form-fields-in-columns/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
101 ),
102 array( 'slug' => 'social-connect',
103 'type' => 'add-on',
104 'name' => __( 'Social Connect', 'profile-builder' ),
105 'description' => __( 'Easily configure and enable social login on your website. Users can login with social platforms like Facebook, Google or X.', 'profile-builder' ),
106 'icon' => 'pb-add-on-social-connect-logo.png',
107 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/social-connect/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-social-connect-addon',
108 'download_url' => 'https://www.cozmoslabs.com/add-ons/social-connect/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree'
109 ),
110 array( 'slug' => 'woocommerce',
111 'type' => 'add-on',
112 'name' => __( 'WooCommerce Sync', 'profile-builder' ),
113 'description' => __( 'Syncs Profile Builder with WooCommerce, allowing you to manage the user Shipping and Billing fields from WooCommerce with Profile Builder.', 'profile-builder' ),
114 'icon' => 'pb-add-on-woocommerce-logo.png',
115 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/woocommerce-sync/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-woo-sync-addon',
116 'download_url' => 'https://www.cozmoslabs.com/add-ons/woocommerce-sync/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
117 ),
118 array( 'slug' => 'multi-step-forms',
119 'type' => 'add-on',
120 'name' => __( 'Multi Step Forms', 'profile-builder' ),
121 'description' => __( 'Extends the functionality of Profile Builder by adding the possibility of having multi-page registration and edit-profile forms.', 'profile-builder' ),
122 'icon' => 'pb-add-on-multi-step-forms-logo.png',
123 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/multi-step-forms/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-multi-step-addon',
124 'download_url' => 'https://www.cozmoslabs.com/add-ons/multi-step-forms/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
125 ),
126 array( 'slug' => 'mailchimp-integration',
127 'type' => 'add-on',
128 'name' => __( 'MailChimp', 'profile-builder' ),
129 'description' => __( 'Easily associate MailChimp list fields with Profile Builder fields and set advanced settings for each list.', 'profile-builder' ),
130 'icon' => 'pb-add-on-mailchimp-logo.png',
131 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/mailchimp/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-mailchimp-addon',
132 'download_url' => 'https://www.cozmoslabs.com/add-ons/profile-builder-mailchimp/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
133 ),
134 array( 'slug' => 'bbpress',
135 'type' => 'add-on',
136 'name' => __( 'bbPress', 'profile-builder' ),
137 'description' => __( 'This add-on allows you to integrate Profile Builder with the popular forums plugin, bbPress.', 'profile-builder' ),
138 'icon' => 'pb-add-on-bbpress-logo.png',
139 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/bbpress/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-bbpress-addon',
140 'download_url' => 'https://www.cozmoslabs.com/add-ons/bbpress/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
141 ),
142 array( 'slug' => 'campaign-monitor',
143 'type' => 'add-on',
144 'name' => __( 'Campaign Monitor', 'profile-builder' ),
145 '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' ),
146 'icon' => 'pb-add-on-campaign-monitor-logo.png',
147 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/campaign-monitor/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-campaign-monitor-addon',
148 '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=PBFree',
149 ),
150 array( 'slug' => 'field-visibility',
151 'type' => 'add-on',
152 'name' => __( 'Field Visibility', 'profile-builder' ),
153 'description' => __( 'Extends the functionality of Profile Builder by allowing you to change visibility options for the extra fields.', 'profile-builder' ),
154 'icon' => 'pb-add-on-field-visibility-logo.png',
155 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/field-visibility/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-field-visibility-addon',
156 'download_url' => 'https://www.cozmoslabs.com/add-ons/field-visibility/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
157 ),
158 array( 'slug' => 'edit-profile-approved-by-admin',
159 'type' => 'add-on',
160 'name' => __( 'Edit Profile Approved by Admin', 'profile-builder' ),
161 'description' => __( 'Extends the functionality of Profile Builder by allowing administrators to approve profile changes made by users on individual fields.', 'profile-builder' ),
162 'icon' => 'pb-add-on-edit-profile-updates-approved-by-admins-logo.png',
163 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/edit-profile-approved-by-admin/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-profile-approved-admin-addon',
164 '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=PBFree',
165 ),
166 array( 'slug' => 'custom-profile-menus',
167 'type' => 'add-on',
168 'name' => __( 'Custom Profile Menus', 'profile-builder' ),
169 'description' => __( 'Add custom menu items like Login/Logout or just Logout button and Login/Register/Edit Profile in iFrame Popup.', 'profile-builder' ),
170 'icon' => 'pb-add-on-custom-profile-menus-logo.png',
171 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/custom-profile-menus/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-custom-profile-menus-addon',
172 'download_url' => 'https://www.cozmoslabs.com/add-ons/custom-profile-menus/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
173 ),
174 array( 'slug' => 'mailpoet-integration',
175 'type' => 'add-on',
176 'name' => __( 'MailPoet', 'profile-builder' ),
177 'description' => __( 'Allow users to subscribe to your MailPoet lists directly from the Register and Edit Profile forms.', 'profile-builder' ),
178 'icon' => 'pb-add-on-mailpoet-logo.png',
179 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/mailpoet/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-mailpoet-addon',
180 'download_url' => 'https://www.cozmoslabs.com/add-ons/mailpoet/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
181 ),
182 array( 'slug' => 'progress-bar',
183 'type' => 'add-on',
184 'name' => __( 'Progress Bar', 'profile-builder' ),
185 'description' => __( 'Display a live completion progress bar on your Register and Edit Profile forms.', 'profile-builder' ),
186 'icon' => 'pb-add-on-progress-bar-logo.png',
187 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/progress-bar/?utm_source=pb-addons-basic&utm_medium=client-site&utm_campaign=pb-progress-bar-addon',
188 'download_url' => 'https://www.cozmoslabs.com/add-ons/progress-bar/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
189 )
190 );
191 $pb_addons_listing->add_section();
192
193 //Add Free section
194 $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') );
195 $pb_addons_listing->section_versions = array( 'Profile Builder Pro', 'Profile Builder Hobbyist', 'Profile Builder Free', 'Profile Builder Basic', 'Profile Builder Agency', 'Profile Builder Unlimited' );
196 $pb_addons_listing->items = array(
197 array( 'slug' => 'user-profile-picture',
198 'type' => 'add-on',
199 'name' => __( 'User Profile Picture', 'profile-builder' ),
200 'description' => __( 'Set or remove a custom profile image for a user using the standard WordPress media upload tool.', 'profile-builder' ),
201 'icon' => 'pb-add-on-user-profile-picture-logo.png',
202 'doc_url' => 'https://www.cozmoslabs.com/user-profile-picture/?utm_source=pb-addons-free&utm_medium=client-site&utm_campaign=pb-profile-picture-addon',
203 'download_url' => 'https://wordpress.org/plugins/metronet-profile-picture/',
204 'version' => 'free',
205 ),
206 array( 'slug' => 'import-export',
207 'type' => 'add-on',
208 'name' => __( 'Import and Export', 'profile-builder' ),
209 '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' ),
210 'icon' => 'pb-add-on-import-export-logo.png',
211 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/import-export-pb-settings/?utm_source=pb-addons-free&utm_medium=client-site&utm_campaign=pb-import-export-addon',
212 'download_url' => 'https://www.cozmoslabs.com/add-ons/import-export/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
213 'version' => 'free',
214 ),
215 array( 'slug' => 'custom-css-classes-on-fields',
216 'type' => 'add-on',
217 'name' => __( 'Custom CSS Classes on Fields', 'profile-builder' ),
218 'description' => __( 'This add-on extends the functionality of Profile Builder by allowing you to add custom css classes for fields.', 'profile-builder' ),
219 'icon' => 'pb-add-on-classes-on-fields-logo.png',
220 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/custom-css-classes-on-fields-for-profile-builder/?utm_source=pb-addons-free&utm_medium=client-site&utm_campaign=pb-custom-css-addon',
221 '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=PBFree',
222 'version' => 'free',
223 ),
224 array( 'slug' => 'maximum-character-length',
225 'type' => 'add-on',
226 'name' => __( 'Maximum Character Length', 'profile-builder' ),
227 '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' ),
228 'icon' => 'pb-add-on-maximum-character-length-logo.png',
229 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/maximum-character-length/?utm_source=pb-addons-free&utm_medium=client-site&utm_campaign=pb-max-character-length-addon',
230 'download_url' => 'https://www.cozmoslabs.com/add-ons/maximum-character-length/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
231 'version' => 'free',
232 ),
233 array( 'slug' => 'labels-edit',
234 'type' => 'add-on',
235 'name' => __( 'Labels Edit', 'profile-builder' ),
236 'description' => __( 'This add-on extends the functionality of our plugin and let us easily edit all Profile Builder labels.', 'profile-builder' ),
237 'icon' => 'pb-add-on-labels-edit-logo.png',
238 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/labels-edit/?utm_source=pb-addons-free&utm_medium=client-site&utm_campaign=pb-labels-edit-addon',
239 'download_url' => 'https://www.cozmoslabs.com/add-ons/labels-edit/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
240 'version' => 'free',
241 ),
242 array( 'slug' => 'gdpr-communication-preferences',
243 'type' => 'add-on',
244 'name' => __( 'GDPR Communication Preferences', 'profile-builder' ),
245 'description' => __( 'This add-on plugin adds a GDPR Communication preferences field to Profile Builder.', 'profile-builder' ),
246 'icon' => 'pb-add-on-gdpr-communication-preferences-logo.png',
247 'doc_url' => 'https://www.cozmoslabs.com/add-ons/gdpr-communication-preferences/?utm_source=pb-addons-free&utm_medium=client-site&utm_campaign=pb-gdpr-addon',
248 'download_url' => 'https://www.cozmoslabs.com/add-ons/gdpr-communication-preferences/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree',
249 'version' => 'free',
250 ),
251 );
252 $pb_addons_listing->add_section();
253
254
255
256 //Add Recommended Plugins
257 $pb_addons_listing->section_header = array( 'title' => __('Recommended Plugins', 'profile-builder' ), 'description' => __('These plugins are compatible with all versions of Profile Builder', 'profile-builder') );
258 $pb_addons_listing->section_versions = array( 'Profile Builder Pro', 'Profile Builder Hobbyist', 'Profile Builder Free', 'Profile Builder Basic', 'Profile Builder Agency', 'Profile Builder Unlimited' );
259 $pb_addons_listing->items = array(
260 array( 'slug' => 'translatepress-multilingual/index.php',
261 'type' => 'plugin',
262 'name' => __( 'TranslatePress', 'profile-builder' ),
263 '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' ),
264 'icon' => 'pb-add-on-translatepress-logo.png',
265 'doc_url' => 'https://translatepress.com/docs/translatepress/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-tp-upsell',
266 'download_url' => 'https://wordpress.org/plugins/translatepress-multilingual/',
267 ),
268 array( 'slug' => 'paid-member-subscriptions/index.php',
269 'type' => 'plugin',
270 'name' => __( 'Paid Member Subscriptions', 'profile-builder' ),
271 'description' => __( 'Unlock the Subscriptions Field in Profile Builder and offer paid memberships for your site. With Paid Member Subscriptions your registration forms will allow your users to sign up for paid accounts.', 'profile-builder' ),
272 'icon' => 'pb-add-on-pms-logo.png',
273 'doc_url' => 'https://www.cozmoslabs.com/docs/paid-member-subscriptions/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-pms-upsell',
274 'download_url' => 'https://wordpress.org/plugins/paid-member-subscriptions/'
275 ),
276 array( 'slug' => 'wp-webhooks/wp-webhooks.php',
277 'type' => 'plugin',
278 'name' => __( 'WP Webhooks Automations', 'profile-builder' ),
279 'description' => __( 'Easily create powerful no-code automations that connect Profile Builder actions, like sign-ups or edits to a user\'s profile, to actions from other plugins, sites, and apps.', 'profile-builder' ),
280 'icon' => 'pb-add-on-wp-webhooks-icon.jpg',
281 'doc_url' => 'https://wp-webhooks.com/integrations/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-wpwh-upsell',
282 'download_url' => 'https://wordpress.org/plugins/wp-webhooks/'
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-add-on-client-portal-logo.png',
289 'doc_url' => 'https://www.cozmoslabs.com/add-ons/client-portal/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-client-portal-upsell',
290 'download_url' => 'https://www.cozmoslabs.com/add-ons/client-portal/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree'
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' => 'pb-add-on-custom-login-page-templates-logo.png',
297 'doc_url' => 'https://www.cozmoslabs.com/add-ons/custom-login-page-templates/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-login-templates-upsell',
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=PBFree'
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-add-on-passwordless-login-logo.png',
305 'doc_url' => 'https://www.cozmoslabs.com/docs/profile-builder/add-ons/passwordless-login/?utm_source=pb-addons&utm_medium=client-site&utm_campaign=pb-passwordless-upsell',
306 'download_url' => 'https://www.cozmoslabs.com/add-ons/passwordless-login/?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PBFree'
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_fileRestriction' => 'hide',
327 'wppb_emailCustomizer' => 'hide',
328 'wppb_multipleEditProfileForms' => 'hide',
329 'wppb_multipleRegistrationForms' => 'hide',
330 'wppb_repeaterFields' => 'hide'
331 );
332 update_option( 'wppb_module_settings', $wppb_module_settings );
333 }
334 }
335
336
337 /**
338 * For add-ons (not plugins) the implementation is speciffic to each plugin ( PB/PMS/TP ) and is done through filters in the plugin itself
339 */
340
341 /**
342 * Function that determines if a PB add-on is active
343 */
344 add_filter( 'cl_add_on_is_active', 'wppb_check_add_ons_activation', 10, 2 );
345 function wppb_check_add_ons_activation( $bool, $slug ){
346 return wppb_check_if_add_on_is_active($slug);
347 }
348
349 /**
350 * Function that activates a PB add-on
351 */
352 add_action( 'cl_add_ons_activate', 'wppb_activate_add_ons' );
353 function wppb_activate_add_ons( $slug ){
354 wppb_activate_or_deactivate_add_on( $slug, 'show' );
355
356 do_action( 'wppb_add_ons_activate', $slug );
357 }
358
359 /**
360 * Function that deactivates a PB add-on
361 */
362 add_action( 'cl_add_ons_deactivate', 'wppb_deactivate_add_ons' );
363 function wppb_deactivate_add_ons( $slug ){
364 wppb_activate_or_deactivate_add_on( $slug, 'hide' );
365
366 do_action( 'wppb_add_ons_deactivate', $slug );
367 }
368
369
370 /**
371 * Function used to activate or deactivate a PB add-on
372 */
373 function wppb_activate_or_deactivate_add_on( $slug, $action ){
374 //the old modules part
375 $wppb_module_settings = get_option( 'wppb_module_settings', 'not_found' );
376 if ( $wppb_module_settings != 'not_found' ){
377 foreach( $wppb_module_settings as $add_on_slug => $status ){
378 if( $slug == $add_on_slug ){
379 $wppb_module_settings[$add_on_slug] = $action;
380 }
381 }
382 }
383 update_option( 'wppb_module_settings', $wppb_module_settings );
384
385 //the free addons part
386 $wppb_free_add_ons_settings = get_option( 'wppb_free_add_ons_settings', array() );
387 if ( !empty( $wppb_free_add_ons_settings ) ){
388
389 if( $action == 'show' )
390 $wppb_free_add_ons_settings[$slug] = true;
391 elseif( $action == 'hide' )
392 $wppb_free_add_ons_settings[$slug] = false;
393
394 }
395 update_option( 'wppb_free_add_ons_settings', $wppb_free_add_ons_settings );
396
397 //the advanced addons part
398 $wppb_advanced_add_ons_settings = get_option( 'wppb_advanced_add_ons_settings', array() );
399 if ( !empty( $wppb_advanced_add_ons_settings ) ){
400
401 if( $action == 'show' )
402 $wppb_advanced_add_ons_settings[$slug] = true;
403 elseif( $action == 'hide' )
404 $wppb_advanced_add_ons_settings[$slug] = false;
405
406 }
407 update_option( 'wppb_advanced_add_ons_settings', $wppb_advanced_add_ons_settings );
408 }
409
410 /**
411 * Add a notice on the add-ons page if the save was successful
412 */
413 add_action('init', function()
414 {
415 if ( isset($_GET['cl_add_ons_listing_success']) ){
416 if( class_exists('WPPB_Add_General_Notices') ) {
417 new WPPB_Add_General_Notices('cl_add_ons_listing_success',
418 sprintf(__('%1$sAdd-ons settings saved successfully%2$s', 'profile-builder'), "<p>", "</p>"),
419 'updated notice is-dismissible');
420 }
421 }
422 });