PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 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 All 341 releases
← All changes | admin/pms-cross-promotion.php +236 -171 3.9.6 → 4.0.3 View file →
@@ -7,12 +7,45 @@
7 7 *
8 8 * @return void
9 9 */
10 10 function wppb_register_pms_cross_promo() {
11 - add_submenu_page( '', __( 'Paid Accounts', 'profile-builder' ), __( 'Paid Accounts', 'profile-builder' ), 'manage_options', 'profile-builder-pms-promo', 'wppb_pms_cross_promo' );
11 + add_submenu_page( 'Profile Builder Paid Accounts', __( 'Paid Accounts', 'profile-builder' ), __( 'Paid Accounts', 'profile-builder' ), 'manage_options', 'profile-builder-pms-promo', 'wppb_pms_cross_promo' );
12 12 }
13 13 add_action( 'admin_menu', 'wppb_register_pms_cross_promo', 2 );
14 14
15 +
16 +function wppb_deactivate_pms_plugin() {
17 + check_ajax_referer( 'wppb-activate-addon', 'nonce' );
18 +
19 + if ( current_user_can( 'activate_plugins' ) && !empty( $_POST['wppb_add_on_to_deactivate'] ) && !empty( $_POST['wppb_add_on_index'] ) ) {
20 + $plugin_path = str_replace(array("http://", "https://"), "", sanitize_text_field( $_POST['wppb_add_on_to_deactivate']) );
21 + deactivate_plugins( $plugin_path );
22 + echo esc_html( sanitize_text_field( $_POST['wppb_add_on_index'] ) );
23 + } else {
24 + echo 'error';
25 + }
26 +
27 + wp_die();
28 +}
29 +add_action('wp_ajax_wppb_add_on_deactivate', 'wppb_deactivate_pms_plugin');
30 +
31 +
32 +function wppb_activate_pms_plugin() {
33 + check_ajax_referer( 'wppb-activate-addon', 'nonce' );
34 +
35 + if ( current_user_can( 'activate_plugins' ) && !empty( $_POST['wppb_add_on_to_activate'] ) && !empty( $_POST['wppb_add_on_index'] ) ) {
36 + $plugin_path = str_replace(array("http://", "https://"), "", sanitize_text_field( $_POST['wppb_add_on_to_activate']) );
37 + activate_plugin( $plugin_path );
38 + echo esc_html( sanitize_text_field( $_POST['wppb_add_on_index'] ) );
39 + } else {
40 + echo 'error';
41 + }
42 +
43 + wp_die();
44 +}
45 +add_action('wp_ajax_wppb_add_on_activate', 'wppb_activate_pms_plugin');
46 +
47 +
15 48 /**
16 49 * Function that adds content to the "Paid Accounts" submenu page
17 50 *
18 51 * @since v.2.0
@@ -20,62 +53,70 @@
20 53 * @return string
21 54 */
22 55 function wppb_pms_cross_promo() {
23 56 ?>
24 - <div class="wrap wppb-wrap wppb-info-wrap">
25 - <div class="wppb-badge wppb-pb-pms"></div>
26 - <h1>Users can pay for an account with<br/> <small style="font-size: 30px; letter-spacing: 0.008em;">Profile Builder and Paid Member Subscriptions</small></h1>
27 - <hr />
28 - <div class="wppb-row">
29 - <p>One of the most requested features in Profile Builder was for users to be able to pay for an account.</p>
30 - <p>Now that's possible using the free WordPress plugin - <a href="https://www.cozmoslabs.com/wordpress-paid-member-subscriptions/?utm_source=wpbackend&utm_medium=clientsite&utm_content=pb-pms-promo&utm_campaign=PBFree">Paid Member Subscriptions</a>.</p>
31 - </div>
57 + <div class="wrap wppb-wrap wppb-info-wrap cozmoslabs-wrap">
58 + <div class="cozmoslabs-form-subsection-wrapper" id="pb-pms-cross-promo-header">
32 59
60 + <div class="cozmoslabs-page-header">
61 + <div>
62 + <h1 class="cozmoslabs-page-title"><?php esc_html_e( 'Users can pay for an account with', 'profile-builder' ); ?></h1>
63 + <h3><?php esc_html_e( 'Profile Builder and Paid Member Subscriptions', 'profile-builder' ); ?></h3>
64 + <p class="cozmoslabs-description"><?php esc_html_e( 'One of the most requested features in Profile Builder was for users to be able to pay for an account.', 'profile-builder' ); ?></p>
65 + <p class="cozmoslabs-description">
66 + <?php esc_html_e( 'Now that is possible using the free WordPress plugin - ', 'profile-builder' ); ?>
67 + <a href="https://www.cozmoslabs.com/wordpress-paid-member-subscriptions/?utm_source=wpbackend&utm_medium=clientsite&utm_content=pb-pms-promo&utm_campaign=PBFree"><?php esc_html_e( 'Paid Member Subscriptions', 'profile-builder' ); ?></a>
68 + </p>
69 + </div>
70 + <div class="wppb-badge wppb-pb-pms"></div>
71 + </div>
72 + </div>
33 73
34 - <h2 class="wppb-callout"><?php esc_html_e( 'Paid Member Subscriptions - a free WordPress plugin', 'profile-builder' ); ?></h2>
35 - <hr/>
36 - <div class="wppb-row wppb-2-col">
37 - <div>
38 - <p><?php esc_html_e( 'With the new Subscriptions Field in Profile Builder, your registration forms will allow your users to sign up for paid accounts.', 'profile-builder' ); ?></p>
39 - <p>Other features of Paid Member Subscriptions are:</p>
40 - <ul>
41 - <li><?php esc_html_e( 'Paid & Free Subscriptions', 'profile-builder' ); ?></li>
42 - <li><?php esc_html_e( 'Restrict Content', 'profile-builder' ); ?></li>
43 - <li><?php esc_html_e( 'Member Management', 'profile-builder' ); ?></li>
44 - <li><?php esc_html_e( 'Email Templates', 'profile-builder' ); ?> </li>
45 - <li><?php esc_html_e( 'Account Management', 'profile-builder' ); ?> </li>
46 - <li><?php esc_html_e( 'Subscription Management', 'profile-builder' ); ?> </li>
47 - <li><?php esc_html_e( 'Payment Management', 'profile-builder' ); ?> </li>
48 - </ul>
49 - </div>
50 - <div>
74 + <div class="cozmoslabs-form-subsection-wrapper">
75 + <h2 class="cozmoslabs-subsection-title"><?php esc_html_e( 'Paid Member Subscriptions - a free WordPress plugin', 'profile-builder' ); ?></h2>
76 + <p class="cozmoslabs-description"><?php esc_html_e( 'With the new Subscriptions Field in Profile Builder, your registration forms will allow your users to sign up for paid accounts.', 'profile-builder' ); ?></p>
51 77
52 - <div>
53 - <?php
54 - $wppb_get_all_plugins = get_plugins();
55 - $wppb_get_active_plugins = get_option('active_plugins');
78 + <div id="pb-pms-cross-promo-pms-plugin">
56 79
80 + <div id="pb-pms-cross-promo-pms-fetures" class="cozmoslabs-description">
81 + <p><?php esc_html_e( 'Other features of Paid Member Subscriptions are:', 'profile-builder' ); ?></p>
82 + <ul>
83 + <li><?php esc_html_e( 'Paid & Free Subscriptions', 'profile-builder' ); ?></li>
84 + <li><?php esc_html_e( 'Restrict Content', 'profile-builder' ); ?></li>
85 + <li><?php esc_html_e( 'Member Management', 'profile-builder' ); ?></li>
86 + <li><?php esc_html_e( 'Email Templates', 'profile-builder' ); ?> </li>
87 + <li><?php esc_html_e( 'Account Management', 'profile-builder' ); ?> </li>
88 + <li><?php esc_html_e( 'Subscription Management', 'profile-builder' ); ?> </li>
89 + <li><?php esc_html_e( 'Payment Management', 'profile-builder' ); ?> </li>
90 + </ul>
91 + </div>
92 +
93 + <div>
94 + <?php
95 + $wppb_get_all_plugins = get_plugins();
96 + $wppb_get_active_plugins = get_option('active_plugins');
97 +
57 98 $ajax_nonce = wp_create_nonce("wppb-activate-addon");
58 99
59 - $pms_add_on_exists = 0;
60 - $pms_add_on_is_active = 0;
61 - $pms_add_on_is_network_active = 0;
62 - // Check to see if add-on is in the plugins folder
63 - foreach ($wppb_get_all_plugins as $wppb_plugin_key => $wppb_plugin) {
64 - if( strtolower($wppb_plugin['Name']) == strtolower( 'Paid Member Subscriptions' ) && strpos(strtolower($wppb_plugin['AuthorName']), strtolower('Cozmoslabs')) !== false) {
65 - $pms_add_on_exists = 1;
66 - if (in_array($wppb_plugin_key, $wppb_get_active_plugins)) {
67 - $pms_add_on_is_active = 1;
68 - }
69 - // Consider the add-on active if it's network active
70 - if (is_plugin_active_for_network($wppb_plugin_key)) {
71 - $pms_add_on_is_network_active = 1;
72 - $pms_add_on_is_active = 1;
73 - }
74 - $plugin_file = $wppb_plugin_key;
75 - }
76 - }
77 - ?>
100 + $pms_add_on_exists = 0;
101 + $pms_add_on_is_active = 0;
102 + $pms_add_on_is_network_active = 0;
103 + // Check to see if add-on is in the plugins folder
104 + foreach ($wppb_get_all_plugins as $wppb_plugin_key => $wppb_plugin) {
105 + if( strtolower($wppb_plugin['Name']) == strtolower( 'Paid Member Subscriptions' ) && strpos(strtolower($wppb_plugin['AuthorName']), strtolower('Cozmoslabs')) !== false) {
106 + $pms_add_on_exists = 1;
107 + if (in_array($wppb_plugin_key, $wppb_get_active_plugins)) {
108 + $pms_add_on_is_active = 1;
109 + }
110 + // Consider the add-on active if it's network active
111 + if (is_plugin_active_for_network($wppb_plugin_key)) {
112 + $pms_add_on_is_network_active = 1;
113 + $pms_add_on_is_active = 1;
114 + }
115 + $plugin_file = $wppb_plugin_key;
116 + }
117 + }
118 + ?>
78 119
79 120 <span id="wppb-add-on-activate-button-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Activate', 'profile-builder' ); ?></span>
80 121
81 122 <span id="wppb-add-on-downloading-message-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Downloading and installing...', 'profile-builder' ); ?></span>
@@ -84,150 +125,158 @@
84 125 <span id="wppb-add-on-activated-button-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Plugin is Active', 'profile-builder' ); ?></span>
85 126 <span id="wppb-add-on-activated-message-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Plugin has been activated', 'profile-builder' ) ?></span>
86 127 <span id="wppb-add-on-activated-error-button-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Retry Install', 'profile-builder' ) ?></span>
87 128
88 - <span id="wppb-add-on-is-active-message-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Plugin is <strong>active</strong>', 'profile-builder' ); ?></span>
89 - <span id="wppb-add-on-is-not-active-message-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Plugin is <strong>inactive</strong>', 'profile-builder' ); ?></span>
129 + <span id="wppb-add-on-is-active-message-text" class="wppb-add-on-user-messages"><?php echo sprintf( wp_kses_post( __('Plugin is %1$s active %2$s', 'profile-builder') ), '<strong>', '</strong>' ); ?></span>
130 + <span id="wppb-add-on-is-active-message-text" class="wppb-add-on-user-messages"><?php echo sprintf( wp_kses_post( __('Plugin is %1$s inactive %2$s', 'profile-builder') ), '<strong>', '</strong>' ); ?></span>
90 131
91 132 <span id="wppb-add-on-deactivate-button-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Deactivate', 'profile-builder' ) ?></span>
92 133 <span id="wppb-add-on-deactivated-message-text" class="wppb-add-on-user-messages"><?php echo esc_html__( 'Plugin has been deactivated.', 'profile-builder' ) ?></span>
93 134
94 135
95 - <div class="plugin-card wppb-recommended-plugin wppb-add-on" style="width: 111%;">
96 - <div class="plugin-card-top">
97 - <a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">
98 - <img src="<?php echo esc_url( plugins_url( '../assets/images/pms-recommended.png', __FILE__ ) ); ?>" width="100%">
99 - </a>
100 - <h3 class="wppb-add-on-title">
101 - <a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">Paid Member Subscriptions</a>
102 - </h3>
103 - <h3 class="wppb-add-on-price"><?php esc_html_e( 'Free', 'profile-builder' ) ?></h3>
104 - <p class="wppb-add-on-description">
105 - <?php esc_html_e( 'Accept user payments, create subscription plans and restrict content on your website.', 'profile-builder' ) ?>
106 - <a href="<?php esc_url( admin_url() );?>plugin-install.php?tab=plugin-information&plugin=paid-member-subscriptions&TB_iframe=true&width=772&height=875" class="thickbox" aria-label="More information about Paid Member Subscriptions - membership & content restriction" data-title="Paid Member Subscriptions - membership & content restriction"><?php esc_html_e( 'More Details', 'profile-builder' ); ?></a>
107 - </p>
108 - </div>
109 - <div class="plugin-card-bottom wppb-add-on-compatible">
110 - <?php
111 - if ($pms_add_on_exists) {
136 + <div class="plugin-card wppb-recommended-plugin wppb-add-on">
137 + <div class="plugin-card-top">
138 + <div class="wppb-recommended-plugin-banner">
139 + <a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">
140 + <img src="<?php echo esc_url( plugins_url( '../assets/images/pms-banner.png', __FILE__ ) ); ?>" width="100%">
141 + </a>
142 + </div>
143 + <h3 class="wppb-add-on-title">
144 + <a target="_blank" href="http://wordpress.org/plugins/paid-member-subscriptions/">Paid Member Subscriptions</a>
145 + </h3>
146 + <h3 class="wppb-add-on-price"><?php esc_html_e( 'Free', 'profile-builder' ) ?></h3>
147 + <p class="wppb-add-on-description">
148 + <?php esc_html_e( 'Accept user payments, create subscription plans and restrict content on your website.', 'profile-builder' ) ?>
149 + <a href="<?php esc_url( admin_url() );?>plugin-install.php?tab=plugin-information&plugin=paid-member-subscriptions&TB_iframe=true&width=772&height=875" class="thickbox" aria-label="More information about Paid Member Subscriptions - membership & content restriction" data-title="Paid Member Subscriptions - membership & content restriction"><?php esc_html_e( 'More Details', 'profile-builder' ); ?></a>
150 + </p>
151 + </div>
152 + <div class="plugin-card-bottom wppb-add-on-compatible">
153 + <?php
154 + if ($pms_add_on_exists) {
112 155
113 - // Display activate/deactivate buttons
114 - if (!$pms_add_on_is_active) {
115 - echo '<a class="wppb-add-on-activate right button button-primary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Activate', 'profile-builder') . '</a>';
156 + // Display activate/deactivate buttons
157 + if (!$pms_add_on_is_active) {
158 + echo '<a class="wppb-add-on-activate right button button-primary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Activate', 'profile-builder') . '</a>';
116 159
117 - // If add-on is network activated don't allow deactivation
118 - } elseif (!$pms_add_on_is_network_active) {
119 - echo '<a class="wppb-add-on-deactivate right button button-primary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Deactivate', 'profile-builder') . '</a>';
120 - }
160 + // If add-on is network activated don't allow deactivation
161 + } elseif (!$pms_add_on_is_network_active) {
162 + echo '<a class="wppb-add-on-deactivate right button button-secondary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Deactivate', 'profile-builder') . '</a>';
163 + }
121 164
122 - // Display message to the user
123 - if( !$pms_add_on_is_active ){
124 - echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . esc_html__('Plugin is <strong>inactive</strong>', 'profile-builder') . '</span>';
125 - } else {
126 - echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . esc_html__('Plugin is <strong>active</strong>', 'profile-builder') . '</span>';
127 - }
165 + // Display message to the user
166 + if( !$pms_add_on_is_active ){
167 + echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . sprintf( wp_kses_post( __( 'Plugin is %1$s inactive %2$s', 'profile-builder' ) ), '<strong>', '</strong>' ) . '</span>';
168 + } else {
169 + echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . sprintf( wp_kses_post( __( 'Plugin is %1$s active %2$s', 'profile-builder' ) ), '<strong>', '</strong>' ) . '</span>';
170 + }
128 171
129 - } else {
172 + } else {
130 173
131 - // If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
132 - // handles the in-page download
133 - if (is_multisite()) {
134 - $wppb_paid_link_class = 'button-primary';
135 - $wppb_paid_link_text = esc_html__('Download Now', 'profile-builder' );
136 - } else {
137 - $wppb_paid_link_class = 'button-primary wppb-add-on-download';
138 - $wppb_paid_link_text = esc_html__('Install Now', 'profile-builder');
139 - }
174 + // If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
175 + // handles the in-page download
176 + if (is_multisite()) {
177 + $wppb_paid_link_class = 'button-primary';
178 + $wppb_paid_link_text = esc_html__('Download Now', 'profile-builder' );
179 + } else {
180 + $wppb_paid_link_class = 'button-primary wppb-add-on-download';
181 + $wppb_paid_link_text = esc_html__('Install Now', 'profile-builder');
182 + }
140 183
141 - echo '<a target="_blank" class="right button ' . esc_attr( $wppb_paid_link_class ) . '" href="https://downloads.wordpress.org/plugin/paid-member-subscriptions.zip" data-add-on-slug="paid-member-subscriptions" data-add-on-name="Paid Member Subscriptions" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html( $wppb_paid_link_text ) . '</a>';
142 - echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . esc_html__('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
184 + echo '<a target="_blank" class="right button ' . esc_attr( $wppb_paid_link_class ) . '" href="https://downloads.wordpress.org/plugin/paid-member-subscriptions.zip" data-add-on-slug="paid-member-subscriptions" data-add-on-name="Paid Member Subscriptions" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html( $wppb_paid_link_text ) . '</a>';
185 + echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . esc_html__('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
143 186
144 - }
145 - ?>
146 - <div class="spinner"></div>
147 - <span class="wppb-add-on-user-messages wppb-error-manual-install"><?php printf(esc_html__('Could not install plugin. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url( 'http://www.wordpress.org/plugins/paid-member-subscriptions' )) ?></a>.</span>
148 - </div>
149 - </div>
150 - </div>
187 + }
188 + ?>
189 + <div class="spinner"></div>
190 + <span class="wppb-add-on-user-messages wppb-error-manual-install"><?php printf(esc_html__('Could not install plugin. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url( 'http://www.wordpress.org/plugins/paid-member-subscriptions' )) ?></a>.</span>
191 + </div>
192 + </div>
193 + </div>
194 + </div>
195 + </div>
151 196
197 + <div class="cozmoslabs-form-subsection-wrapper">
198 + <h2 class="cozmoslabs-subsection-title"><?php esc_html_e( 'Step by Step Quick Setup', 'profile-builder' ); ?></h2>
199 + <p class="cozmoslabs-description"><?php esc_html_e( 'Setting up Paid Member Subscriptions opens the door to paid user accounts.', 'profile-builder' ); ?></p>
152 200
153 - </div>
154 - </div>
201 + <div class="cozmoslabs-form-subsection-wrapper">
202 + <h3 class="cozmoslabs-subsection-title"><?php esc_html_e( 'Create Subscription Plans', 'profile-builder' ); ?></h3>
203 + <p class="cozmoslabs-description"><?php esc_html_e( 'With Paid Member Subscriptions it’s fairly easy to create tiered subscription plans for your users.', 'profile-builder' ); ?></p>
204 + <p class="cozmoslabs-description"><?php esc_html_e( 'Adding a new subscription gives you access to the following options to set up: subscription name, description, duration, the price, status and user role.', 'profile-builder' ); ?></p>
205 + <div class="cozmoslabs-subsection-image">
206 + <a href="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_all_subscriptions.jpg" target="_blank">
207 + <img src="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_all_subscriptions.jpg" alt="paid subscription plans"/>
208 + </a>
209 + </div>
210 + </div>
155 211
156 - <h2 class="wppb-callout"><?php esc_html_e( 'Step by Step Quick Setup', 'profile-builder' ); ?></h2>
157 - <hr/>
158 - <p>Setting up Paid Member Subscriptions opens the door to paid user accounts. </p>
159 - <div class="wrap wppb-wrap wppb-1-3-col">
160 - <div><h3>Create Subscription Plans</h3>
161 - <p>With Paid Member Subscriptions it’s fairly easy to create tiered subscription plans for your users. </p>
162 - <p>Adding a new subscription gives you access to the following options to set up: subscription name, description, duration, the price, status and user role.</p>
163 - </div>
164 - <div style="text-align: right">
165 - <p><img src="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_all_subscriptions-600x336.jpg" alt="paid subscription plans"/></p>
166 - </div>
167 - </div>
168 - <div class="wrap wppb-wrap wppb-1-3-col">
169 - <div><h3>Add Subscriptions field to Profile Builder -> Manage Fields</h3>
170 - <p>The new Subscription Plans field will add a list of radio buttons with membership details to Profile Builder registration forms.</p>
171 - </div>
172 - <div style="text-align: right">
173 - <p><img src="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_pb_add_subscription-600x471.png" alt="manage fields subscription plans"/></p>
174 - </div>
175 - </div>
176 - <div class="wrap wppb-wrap wppb-1-3-col">
177 - <div><h3>Start getting user payments</h3>
178 - <p>To finalize registration for a paid account, users will need to complete the payment.</p>
179 - <p>Members created with Profile Builder registration form will have the user role of the selected subscription.</p>
180 - </div>
181 - <div style="text-align: right">
182 - <p><img src="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_pb_register_page-600x618.png" alt="register payed accounts"/></p>
183 - </div>
184 - </div>
212 + <div class="cozmoslabs-form-subsection-wrapper">
213 + <h3 class="cozmoslabs-subsection-title"><?php esc_html_e( 'Add Subscriptions field to Profile Builder -> Manage Fields', 'profile-builder' ); ?></h3>
214 + <p class="cozmoslabs-description"><?php esc_html_e( 'The new Subscription Plans field will add a list of radio buttons with membership details to Profile Builder registration forms.', 'profile-builder' ); ?></p>
215 + <div class="cozmoslabs-subsection-image">
216 + <a href="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_pb_add_subscription.jpg" target="_blank">
217 + <img src="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_pb_add_subscription.jpg" alt="manage fields subscription plans"/>
218 + </a>
219 + </div>
220 + </div>
185 221
222 + <div class="cozmoslabs-form-subsection-wrapper">
223 + <h3 class="cozmoslabs-subsection-title"><?php esc_html_e( 'Start getting user payments', 'profile-builder' ); ?></h3>
224 + <p class="cozmoslabs-description"><?php esc_html_e( 'To finalize registration for a paid account, users will need to complete the payment.', 'profile-builder' ); ?></p>
225 + <p class="cozmoslabs-description"><?php esc_html_e( 'Members created with Profile Builder registration form will have the user role of the selected subscription.', 'profile-builder' ); ?></p>
226 + <div class="cozmoslabs-subsection-image">
227 + <a href="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_pb_register_page.jpg" target="_blank">
228 + <img src="<?php echo esc_url( WPPB_PLUGIN_URL ); ?>assets/images/pms_pb_register_page.jpg" alt="register payed accounts"/>
229 + </a>
230 + </div>
231 + </div>
186 232
187 - <div id="pms-bottom-install" class="wppb-add-on">
188 - <div class="plugin-card-bottom wppb-add-on-compatible">
189 - <?php
190 - if ($pms_add_on_exists) {
233 + </div>
191 234
192 - // Display activate/deactivate buttons
193 - if (!$pms_add_on_is_active) {
194 - echo '<a class="wppb-add-on-activate right button button-secondary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Activate', 'profile-builder') . '</a>';
195 235
196 - // If add-on is network activated don't allow deactivation
197 - } elseif (!$pms_add_on_is_network_active) {
198 - echo '<a class="wppb-add-on-deactivate right button button-secondary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Deactivate', 'profile-builder') . '</a>';
199 - }
236 + <div id="pms-bottom-install" class="wppb-add-on">
237 + <div class="plugin-card-bottom wppb-add-on-compatible">
238 + <?php
239 + if ($pms_add_on_exists) {
200 240
201 - // Display message to the user
202 - if( !$pms_add_on_is_active ){
203 - echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . esc_html__('Plugin is <strong>inactive</strong>', 'profile-builder') . '</span>';
204 - } else {
205 - echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . esc_html__('Plugin is <strong>active</strong>', 'profile-builder') . '</span>';
206 - }
241 + // Display activate/deactivate buttons
242 + if (!$pms_add_on_is_active) {
243 + echo '<a class="wppb-add-on-activate right button button-primary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Activate', 'profile-builder') . '</a>';
207 244
208 - } else {
245 + // If add-on is network activated don't allow deactivation
246 + } elseif (!$pms_add_on_is_network_active) {
247 + echo '<a class="wppb-add-on-deactivate right button button-secondary" href="' . esc_url( $plugin_file ) . '" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html__('Deactivate', 'profile-builder') . '</a>';
248 + }
209 249
210 - // If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
211 - // handles the in-page download
212 - if (is_multisite()) {
213 - $wppb_paid_link_class = 'button-secondary';
214 - $wppb_paid_link_text = __('Download Now', 'profile-builder' );
215 - } else {
216 - $wppb_paid_link_class = 'button-secondary wppb-add-on-download';
217 - $wppb_paid_link_text = __('Install Now', 'profile-builder');
218 - }
250 + // Display message to the user
251 + if( !$pms_add_on_is_active ){
252 + echo '<span class="dashicons dashicons-no-alt"></span><span class="wppb-add-on-message">' . sprintf( wp_kses_post( __( 'Plugin is %1$s inactive %2$s', 'profile-builder' ) ), '<strong>', '</strong>' ) . '</span>';
253 + } else {
254 + echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . sprintf( wp_kses_post( __( 'Plugin is %1$s active %2$s', 'profile-builder' ) ), '<strong>', '</strong>' ) . '</span>';
255 + }
219 256
220 - echo '<a target="_blank" class="right button ' . esc_attr( $wppb_paid_link_class ) . '" href="https://downloads.wordpress.org/plugin/paid-member-subscriptions.zip" data-add-on-slug="paid-member-subscriptions" data-add-on-name="Paid Member Subscriptions" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html( $wppb_paid_link_text ) . '</a>';
221 - echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . esc_html__('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
222 - }
223 - ?>
224 - <div class="spinner"></div>
225 - <?php /* <span class="wppb-add-on-user-messages wppb-error-manual-install"><?php printf(__('Could not install plugin. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url( 'http://www.wordpress.org/plugins/paid-member-subscriptions' )) ?></a>.</span> */ ?>
226 - </div>
227 - </div>
257 + } else {
228 258
259 + // If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
260 + // handles the in-page download
261 + if (is_multisite()) {
262 + $wppb_paid_link_class = 'button-secondary';
263 + $wppb_paid_link_text = __('Download Now', 'profile-builder' );
264 + } else {
265 + $wppb_paid_link_class = 'button-secondary wppb-add-on-download';
266 + $wppb_paid_link_text = __('Install Now', 'profile-builder');
267 + }
229 268
269 + echo '<a target="_blank" class="right button ' . esc_attr( $wppb_paid_link_class ) . '" href="https://downloads.wordpress.org/plugin/paid-member-subscriptions.zip" data-add-on-slug="paid-member-subscriptions" data-add-on-name="Paid Member Subscriptions" data-nonce="' . esc_attr( $ajax_nonce ) . '">' . esc_html( $wppb_paid_link_text ) . '</a>';
270 + echo '<span class="dashicons dashicons-yes"></span><span class="wppb-add-on-message">' . esc_html__('Compatible with your version of Profile Builder.', 'profile-builder') . '</span>';
271 + }
272 + ?>
273 + <div class="spinner"></div>
274 + <?php /* <span class="wppb-add-on-user-messages wppb-error-manual-install"><?php printf(__('Could not install plugin. Retry or <a href="%s" target="_blank">install manually</a>.', 'profile-builder'), esc_url( 'http://www.wordpress.org/plugins/paid-member-subscriptions' )) ?></a>.</span> */ ?>
275 + </div>
276 + </div>
277 +
278 +
230 279 </div>
231 280 <?php
232 281 }
233 282 /*
@@ -234,9 +283,25 @@
234 283 * Instantiate a new notification for the PMS cross Promotion
235 284 *
236 285 * @Since 2.2.5
237 286 */
238 -if ( ( !isset($_GET['page']) || $_GET['page'] != 'profile-builder-pms-promo' ) && function_exists('is_plugin_active') && !is_plugin_active( 'paid-member-subscriptions/index.php' ) ){
239 -new WPPB_Add_General_Notices('wppb_pms_cross_promo',
240 - sprintf(__('Allow your users to have <strong>paid accounts with Profile Builder</strong>. %1$sFind out how >%2$s %3$sDismiss%4$s', 'profile-builder'), "<a href='" . esc_url( admin_url('options.php?page=profile-builder-pms-promo') ) . "'>", "</a>", "<a class='wppb-dismiss-notification' href='" . esc_url( add_query_arg('wppb_pms_cross_promo_dismiss_notification', '0') ) . "'>", "</a>"),
241 - 'pms-cross-promo');
242 -}
287 +add_action('init', function()
288 +{
289 + $is_pms_promo_page = isset( $_GET['page'] ) && $_GET['page'] === 'profile-builder-pms-promo';
290 + $is_setup_wizard = isset( $_GET['subpage'] ) && $_GET['subpage'] === 'wppb-setup';
291 +
292 + if ( $is_pms_promo_page || $is_setup_wizard ) {
293 + return;
294 + }
295 +
296 + if ( ! function_exists( 'is_plugin_active' ) || is_plugin_active( 'paid-member-subscriptions/index.php' ) ) {
297 + return;
298 + }
299 +
300 + if ( ! wppb_should_show_marketing_notice() ) {
301 + return;
302 + }
303 +
304 + new WPPB_Add_General_Notices('wppb_pms_cross_promo',
305 + sprintf(__('Allow your users to have <strong>paid accounts with Profile Builder</strong>. %1$sFind out how >%2$s %3$sDismiss%4$s', 'profile-builder'), "<a href='" . esc_url( admin_url('options.php?page=profile-builder-pms-promo') ) . "'>", "</a>", "<a class='wppb-dismiss-notification' href='" . esc_url( wp_nonce_url( add_query_arg( 'wppb_pms_cross_promo_dismiss_notification', '0' ), 'wppb_general_notice_dismiss' ) ) . "'>", "</a>"),
306 + 'pms-cross-promo');
307 +});