Paid Memberships Pro - Version 2.1.3

Version Description

  • 2019-10-14 =
  • BUG FIX: Updating Stripe subscriptions from the edit user page will no longer cause an extra charge.
  • BUG FIX: Correctly localizing the expiration date on the frontend account page.
  • BUG FIX: Moved the row actions on the orders page into the correct column. (Thanks, Tim Sparks)
  • BUG FIX: Fixed issue with CSV exports if the fpassthru function is unavailable.
  • BUG FIX: Fixed warning that occurred when the Email Log plugin was active. (Thanks, Matty Cohen)
  • BUG FIX: Fixed warning that occurred with sessions sometimes. (Thanks, Matty Cohen)
  • ENHANCEMENT: Made labels and styling more consistant across settings pages.
  • ENHANCEMENT: The Consent Log will go into a scrollable box if more than 10 items are in the list.
  • ENHANCEMENT: Updated the copy on the license page.
Download this release

Release Info

Developer strangerstudios
Plugin Icon 128x128 Paid Memberships Pro
Version 2.1.3
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.3

Files changed (44) hide show
  1. CHANGELOG.txt +21 -0
  2. adminpages/addons.php +4 -4
  3. adminpages/admin_header.php +16 -4
  4. adminpages/advancedsettings.php +72 -49
  5. adminpages/dashboard.php +6 -6
  6. adminpages/discountcodes.php +11 -11
  7. adminpages/emailsettings.php +5 -2
  8. adminpages/license.php +114 -0
  9. adminpages/membershiplevels.php +41 -24
  10. adminpages/memberslist-csv.php +1 -1
  11. adminpages/memberslist.php +18 -3
  12. adminpages/orders-csv.php +2 -2
  13. adminpages/orders.php +29 -29
  14. adminpages/pagesettings.php +34 -20
  15. adminpages/paymentsettings.php +16 -13
  16. blocks/blocks.php +2 -2
  17. classes/class.pmproemail.php +1 -1
  18. classes/gateways/class.pmprogateway_authorizenet.php +2 -1
  19. classes/gateways/class.pmprogateway_braintree.php +2 -1
  20. classes/gateways/class.pmprogateway_check.php +3 -2
  21. classes/gateways/class.pmprogateway_cybersource.php +4 -3
  22. classes/gateways/class.pmprogateway_payflowpro.php +13 -4
  23. classes/gateways/class.pmprogateway_paypal.php +15 -3
  24. classes/gateways/class.pmprogateway_paypalexpress.php +15 -3
  25. classes/gateways/class.pmprogateway_paypalstandard.php +15 -3
  26. classes/gateways/class.pmprogateway_stripe.php +83 -36
  27. classes/gateways/class.pmprogateway_twocheckout.php +6 -5
  28. css/admin.css +71 -12
  29. images/Paid-Memberships-Pro.png +0 -0
  30. images/Paid-Memberships-Pro_icon.png +0 -0
  31. includes/adminpages.php +17 -0
  32. includes/deprecated.php +14 -1
  33. includes/functions.php +1 -1
  34. includes/license.php +3 -99
  35. includes/privacy.php +5 -0
  36. includes/profile.php +6 -1
  37. includes/sessions.php +7 -14
  38. languages/paid-memberships-pro.mo +0 -0
  39. languages/paid-memberships-pro.po +2130 -1424
  40. languages/paid-memberships-pro.pot +2130 -1424
  41. paid-memberships-pro.php +2 -2
  42. preheaders/billing.php +5 -0
  43. readme.txt +23 -2
  44. shortcodes/pmpro_account.php +1 -1
CHANGELOG.txt CHANGED
@@ -1,5 +1,26 @@
1
== Changelog ==
2
3
= 2.1.1 - 2019-09-16 =
4
* BUG FIX: Fixed issue with SCA authentications via Stripe for subscriptions with a $0 initial payment. (Thanks, mjulian87 on Github.)
5
* BUG FIX: Fixed issue where code was shown in the message box when applying a discount code.
1
== Changelog ==
2
3
+ = 2.1.3 - 2019-10-14 =
4
+ * BUG FIX: Updating Stripe subscriptions from the edit user page will no longer cause an extra charge.
5
+ * BUG FIX: Correctly localizing the expiration date on the frontend account page.
6
+ * BUG FIX: Moved the row actions on the orders page into the correct column. (Thanks, Tim Sparks)
7
+ * BUG FIX: Fixed issue with CSV exports if the fpassthru function is unavailable.
8
+ * BUG FIX: Fixed warning that occurred when the Email Log plugin was active. (Thanks, Matty Cohen)
9
+ * BUG FIX: Fixed warning that occurred with sessions sometimes. (Thanks, Matty Cohen)
10
+ * ENHANCEMENT: Made labels and styling more consistant across settings pages.
11
+ * ENHANCEMENT: The Consent Log will go into a scrollable box if more than 10 items are in the list.
12
+ * ENHANCEMENT: Updated the copy on the license page.
13
+
14
+ = 2.1.2 - 2019-09-26 =
15
+ * BUG FIX: Fixed bug where Stripe subscriptions weren't updated to use the new payment method when users updated their billing method on the Update Billing page. You may have users with an updated "default payment method" but their subscriptions still need to be updated manually in Stripe to use that new method. Otherwise, payments will fail. This is fixed going forward.
16
+ * BUG FIX: Fixed bug where PMPro Blocks were sometimes not loading on the edit post page.
17
+ * BUG FIX: Fixed bug where discount codes would cause ugly warnings to be shown on the checkout page.
18
+ * BUG FIX: Fixed bug where custom templates would sometimes not load.
19
+ * BUG FIX: Fixed issue where a warning was thrown sometimes when loading SESSION vars.
20
+ * ENHANCEMENT: Moved the License page under Memberships.
21
+ * EHNANCEMENT: Updated our UTM tracking links in various places we link to the Paid Memberships Pro website.
22
+ * ENHANCEMENT: Added some help text and links to popular add ons in a few places in the PMPro settings.
23
+
24
= 2.1.1 - 2019-09-16 =
25
* BUG FIX: Fixed issue with SCA authentications via Stripe for subscriptions with a $0 initial payment. (Thanks, mjulian87 on Github.)
26
* BUG FIX: Fixed issue where code was shown in the message box when applying a discount code.
adminpages/addons.php CHANGED
@@ -205,7 +205,7 @@
205
elseif(empty($pmpro_license_key))
206
{
207
//no key
208
- $actions['settings'] = '<span class="settings"><a href="' . admin_url('options-general.php?page=pmpro_license_settings') . '">' . __('Update License', 'paid-memberships-pro' ) . '</a></span>';
209
$actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['PluginURI'] . '">' . __('Download', 'paid-memberships-pro' ) . '</a></span>';
210
}
211
elseif(pmpro_license_isValid($pmpro_license_key, $plugin_data['License']))
@@ -217,7 +217,7 @@
217
else
218
{
219
//invalid key
220
- $actions['settings'] = '<span class="settings"><a href="' . admin_url('options-general.php?page=pmpro_license_settings') . '">' . __('Update License', 'paid-memberships-pro' ) . '</a></span>';
221
$actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['PluginURI'] . '">' . __('Download', 'paid-memberships-pro' ) . '</a></span>';
222
}
223
}
@@ -272,8 +272,8 @@
272
__( 'View details' )
273
);
274
} elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
275
- $plugin_meta[] = sprintf( '<a href="%s">%s</a>',
276
- esc_url( $plugin_data['PluginURI'] ),
277
__( 'Visit plugin site' )
278
);
279
}
205
elseif(empty($pmpro_license_key))
206
{
207
//no key
208
+ $actions['settings'] = '<span class="settings"><a href="' . admin_url('admin.php?page=pmpro-license') . '">' . __('Update License', 'paid-memberships-pro' ) . '</a></span>';
209
$actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['PluginURI'] . '">' . __('Download', 'paid-memberships-pro' ) . '</a></span>';
210
}
211
elseif(pmpro_license_isValid($pmpro_license_key, $plugin_data['License']))
217
else
218
{
219
//invalid key
220
+ $actions['settings'] = '<span class="settings"><a href="' . admin_url('admin.php?page=pmpro-license') . '">' . __('Update License', 'paid-memberships-pro' ) . '</a></span>';
221
$actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['PluginURI'] . '">' . __('Download', 'paid-memberships-pro' ) . '</a></span>';
222
}
223
}
272
__( 'View details' )
273
);
274
} elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
275
+ $plugin_meta[] = sprintf( '<a target="_blank" href="%s">%s</a>',
276
+ esc_url( $plugin_data['PluginURI'] ) . '?utm_source=plugin&utm_medium=pmpro-addons&utm_campaign=add-ons',
277
__( 'Visit plugin site' )
278
);
279
}
adminpages/admin_header.php CHANGED
@@ -150,11 +150,18 @@
150
151
<div class="wrap pmpro_admin">
152
<div class="pmpro_banner">
153
- <a class="pmpro_logo" title="Paid Memberships Pro - Membership Plugin for WordPress" target="_blank" href="<?php echo pmpro_https_filter("https://www.paidmembershipspro.com/?utm_source=plugin&utm_medium=banner&utm_campaign=admin_header")?>"><img src="<?php echo PMPRO_URL?>/images/Paid-Memberships-Pro.png" width="350" height="75" border="0" alt="Paid Memberships Pro(c) - All Rights Reserved" /></a>
154
<div class="pmpro_meta">
155
<span class="pmpro_version">v<?php echo PMPRO_VERSION?></span>
156
- <a target="_blank" class="button button-documentation" href="<?php echo pmpro_https_filter("https://www.paidmembershipspro.com/documentation?utm_source=plugin&utm_medium=banner&utm_campaign=admin_header")?>"><?php _e('Documentation', 'paid-memberships-pro' );?></a>
157
- <a target="_blank" class="button-primary button-support" href="https://www.paidmembershipspro.com/pricing/?utm_source=plugin&utm_medium=banner&utm_campaign=admin_header"><?php _e('Get Support', 'paid-memberships-pro' );?></a>
158
</div>
159
</div>
160
<div id="pmpro_notifications">
@@ -180,7 +187,8 @@
180
'pmpro-paymentsettings',
181
'pmpro-emailsettings',
182
'pmpro-advancedsettings',
183
- 'pmpro-addons'
184
);
185
if( in_array( $view, $settings_tabs ) ) { ?>
186
<nav class="nav-tab-wrapper">
@@ -207,6 +215,10 @@
207
<?php if(current_user_can('pmpro_addons')) { ?>
208
<a href="<?php echo admin_url('admin.php?page=pmpro-addons');?>" class="nav-tab<?php if($view == 'pmpro-addons') { ?> nav-tab-active<?php } ?>"><?php _e('Add Ons', 'paid-memberships-pro' );?></a>
209
<?php } ?>
210
</nav>
211
212
<?php if( $view == 'pmpro-membershiplevels' || $view == 'pmpro-discountcodes' || $view == 'pmpro-pagesettings' || $view == 'pmpro-paymentsettings' || $view == 'pmpro-emailsettings' || $view == 'pmpro-advancedsettings' ) { ?>
150
151
<div class="wrap pmpro_admin">
152
<div class="pmpro_banner">
153
+ <a class="pmpro_logo" title="Paid Memberships Pro - Membership Plugin for WordPress" target="_blank" href="<?php echo pmpro_https_filter("https://www.paidmembershipspro.com/?utm_source=plugin&utm_medium=pmpro-admin-header&utm_campaign=homepage")?>"><img src="<?php echo PMPRO_URL?>/images/Paid-Memberships-Pro.png" width="350" height="75" border="0" alt="Paid Memberships Pro(c) - All Rights Reserved" /></a>
154
<div class="pmpro_meta">
155
<span class="pmpro_version">v<?php echo PMPRO_VERSION?></span>
156
+ <a target="_blank" href="<?php echo pmpro_https_filter("https://www.paidmembershipspro.com/documentation/?utm_source=plugin&utm_medium=pmpro-admin-header&utm_campaign=documentation")?>"><?php _e('Documentation', 'paid-memberships-pro' );?></a>
157
+ <a target="_blank" href="https://www.paidmembershipspro.com/pricing/?utm_source=plugin&utm_medium=pmpro-admin-header&utm_campaign=pricing&utm_content=get-support"><?php _e('Get Support', 'paid-memberships-pro' );?></a>
158
+
159
+ <?php if ( pmpro_license_isValid() ) { ?>
160
+ <?php printf(__( '<a class="pmpro_license_tag pmpro_license_tag-valid" href="%s">Valid License</a>', 'paid-memberships-pro' ), admin_url( 'admin.php?page=pmpro-license' ) ); ?>
161
+ <?php } elseif ( ! defined( 'PMPRO_LICENSE_NAG' ) || PMPRO_LICENSE_NAG == true ) { ?>
162
+ <?php printf(__( '<a class="pmpro_license_tag pmpro_license_tag-invalid" href="%s">No License</a>', 'paid-memberships-pro' ), admin_url( 'admin.php?page=pmpro-license' ) ); ?>
163
+ <?php } ?>
164
+
165
</div>
166
</div>
167
<div id="pmpro_notifications">
187
'pmpro-paymentsettings',
188
'pmpro-emailsettings',
189
'pmpro-advancedsettings',
190
+ 'pmpro-addons',
191
+ 'pmpro-license'
192
);
193
if( in_array( $view, $settings_tabs ) ) { ?>
194
<nav class="nav-tab-wrapper">
215
<?php if(current_user_can('pmpro_addons')) { ?>
216
<a href="<?php echo admin_url('admin.php?page=pmpro-addons');?>" class="nav-tab<?php if($view == 'pmpro-addons') { ?> nav-tab-active<?php } ?>"><?php _e('Add Ons', 'paid-memberships-pro' );?></a>
217
<?php } ?>
218
+
219
+ <?php if(current_user_can('manage_options')) { ?>
220
+ <a href="<?php echo admin_url('admin.php?page=pmpro-license');?>" class="nav-tab<?php if($view == 'pmpro-license') { ?> nav-tab-active<?php } ?>"><?php _e('License', 'paid-memberships-pro' );?></a>
221
+ <?php } ?>
222
</nav>
223
224
<?php if( $view == 'pmpro-membershiplevels' || $view == 'pmpro-discountcodes' || $view == 'pmpro-pagesettings' || $view == 'pmpro-paymentsettings' || $view == 'pmpro-emailsettings' || $view == 'pmpro-advancedsettings' ) { ?>
adminpages/advancedsettings.php CHANGED
@@ -115,8 +115,8 @@
115
<label for="nonmembertext"><?php _e('Message for Logged-in Non-members', 'paid-memberships-pro' );?>:</label>
116
</th>
117
<td>
118
- <textarea name="nonmembertext" rows="3" cols="80"><?php echo stripslashes($nonmembertext)?></textarea><br />
119
- <small class="litegray"><?php _e('This message replaces the post content for non-members. Available variables', 'paid-memberships-pro' );?>: !!levels!!, !!referrer!!</small>
120
</td>
121
</tr>
122
<tr>
@@ -124,8 +124,8 @@
124
<label for="notloggedintext"><?php _e('Message for Logged-out Users', 'paid-memberships-pro' );?>:</label>
125
</th>
126
<td>
127
- <textarea name="notloggedintext" rows="3" cols="80"><?php echo stripslashes($notloggedintext)?></textarea><br />
128
- <small class="litegray"><?php _e('This message replaces the post content for logged-out visitors.', 'paid-memberships-pro' );?></small>
129
</td>
130
</tr>
131
<tr>
@@ -133,11 +133,16 @@
133
<label for="rsstext"><?php _e('Message for RSS Feed', 'paid-memberships-pro' );?>:</label>
134
</th>
135
<td>
136
- <textarea name="rsstext" rows="3" cols="80"><?php echo stripslashes($rsstext)?></textarea><br />
137
- <small class="litegray"><?php _e('This message replaces the post content in RSS feeds.', 'paid-memberships-pro' );?></small>
138
</td>
139
</tr>
140
-
141
<tr>
142
<th scope="row" valign="top">
143
<label for="filterqueries"><?php _e("Filter searches and archives?", 'paid-memberships-pro' );?></label>
@@ -160,7 +165,58 @@
160
</select>
161
</td>
162
</tr>
163
- <tr>
164
<th scope="row" valign="top">
165
<label for="hideads"><?php _e("Hide Ads From Members?", 'paid-memberships-pro' );?></label>
166
</th>
@@ -175,14 +231,12 @@
175
<tr id="hideads_explanation" <?php if($hideads < 2) { ?>style="display: none;"<?php } ?>>
176
<th scope="row" valign="top">&nbsp;</th>
177
<td>
178
- <p class="top0em"><?php _e('Ads from the following plugins will be automatically turned off', 'paid-memberships-pro' );?>: <em>Easy Adsense</em>, ...</p>
179
<p><?php _e('To hide ads in your template code, use code like the following', 'paid-memberships-pro' );?>:</p>
180
<pre lang="PHP">
181
- if(pmpro_displayAds())
182
- {
183
- //insert ad code here
184
- }
185
- </pre>
186
</td>
187
</tr>
188
<tr id="hideadslevels_tr" <?php if($hideads != 2) { ?>style="display: none;"<?php } ?>>
@@ -231,36 +285,6 @@ if(pmpro_displayAds())
231
</td>
232
</tr>
233
<?php } ?>
234
- <tr>
235
- <th scope="row" valign="top">
236
- <label for="recaptcha"><?php _e('Use reCAPTCHA?', 'paid-memberships-pro' );?>:</label>
237
- </th>
238
- <td>
239
- <select id="recaptcha" name="recaptcha" onchange="pmpro_updateRecaptchaTRs();">
240
- <option value="0" <?php if(!$recaptcha) { ?>selected="selected"<?php } ?>><?php _e('No', 'paid-memberships-pro' );?></option>
241
- <option value="1" <?php if($recaptcha == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes - Free memberships only.', 'paid-memberships-pro' );?></option>
242
- <option value="2" <?php if($recaptcha == 2) { ?>selected="selected"<?php } ?>><?php _e('Yes - All memberships.', 'paid-memberships-pro' );?></option>
243
- </select><br />
244
- <small><?php _e('A free reCAPTCHA key is required.', 'paid-memberships-pro' );?> <a href="https://www.google.com/recaptcha/admin/create"><?php _e('Click here to signup for reCAPTCHA', 'paid-memberships-pro' );?></a>.</small>
245
- </td>
246
- </tr>
247
- <tr id="recaptcha_tr" <?php if(!$recaptcha) { ?>style="display: none;"<?php } ?>>
248
- <th scope="row" valign="top">&nbsp;</th>
249
- <td>
250
- <label for="recaptcha_version"><?php _e( 'reCAPTCHA Version', 'paid-memberships-pro' );?>:</label>
251
- <select id="recaptcha_version" name="recaptcha_version">
252
- <option value="2_checkbox" <?php selected( '2_checkbox', $recaptcha_version ); ?>><?php _e( ' v2 - Checkbox', 'paid-memberships-pro' ); ?></option>
253
- <option value="3_invisible" <?php selected( '3_invisible', $recaptcha_version ); ?>><?php _e( 'v3 - Invisible', 'paid-memberships-pro' ); ?></option>
254
- </select>
255
- <small><?php _e( 'Changing your version will require new API keys.', 'paid-memberships-pro' ); ?></small>
256
- <br /><br />
257
- <label for="recaptcha_publickey"><?php _e('reCAPTCHA Site Key', 'paid-memberships-pro' );?>:</label>
258
- <input type="text" id="recaptcha_publickey" name="recaptcha_publickey" size="60" value="<?php echo esc_attr($recaptcha_publickey);?>" />
259
- <br /><br />
260
- <label for="recaptcha_privatekey"><?php _e('reCAPTCHA Secret Key', 'paid-memberships-pro' );?>:</label>
261
- <input type="text" id="recaptcha_privatekey" name="recaptcha_privatekey" size="60" value="<?php echo esc_attr($recaptcha_privatekey);?>" />
262
- </td>
263
- </tr>
264
<tr>
265
<th scope="row" valign="top">
266
<label for="tospage"><?php _e('Require Terms of Service on signups?', 'paid-memberships-pro' );?></label>
@@ -270,7 +294,7 @@ if(pmpro_displayAds())
270
wp_dropdown_pages(array("name"=>"tospage", "show_option_none"=>"No", "selected"=>$tospage));
271
?>
272
<br />
273
- <small><?php _e('If yes, create a WordPress page containing your TOS agreement and assign it using the dropdown above.', 'paid-memberships-pro' );?></small>
274
</td>
275
</tr>
276
@@ -328,8 +352,7 @@ if(pmpro_displayAds())
328
}
329
if (!empty($field['description'])) {
330
?>
331
- <br>
332
- <small><?php echo esc_textarea( $field['description'] ); ?></small>
333
<?php
334
}
335
?>
@@ -370,11 +393,11 @@ if(pmpro_displayAds())
370
var recaptcha = jQuery('#recaptcha').val();
371
if(recaptcha > 0)
372
{
373
- jQuery('#recaptcha_tr').show();
374
}
375
else
376
{
377
- jQuery('#recaptcha_tr').hide();
378
}
379
}
380
pmpro_updateRecaptchaTRs();
115
<label for="nonmembertext"><?php _e('Message for Logged-in Non-members', 'paid-memberships-pro' );?>:</label>
116
</th>
117
<td>
118
+ <textarea name="nonmembertext" rows="3" cols="80"><?php echo stripslashes($nonmembertext)?></textarea>
119
+ <p class="description"><?php _e('This message replaces the post content for non-members. Available variables', 'paid-memberships-pro' );?>: !!levels!!, !!referrer!!</p>
120
</td>
121
</tr>
122
<tr>
124
<label for="notloggedintext"><?php _e('Message for Logged-out Users', 'paid-memberships-pro' );?>:</label>
125
</th>
126
<td>
127
+ <textarea name="notloggedintext" rows="3" cols="80"><?php echo stripslashes($notloggedintext)?></textarea>
128
+ <p class="description"><?php _e('This message replaces the post content for logged-out visitors.', 'paid-memberships-pro' );?></p>
129
</td>
130
</tr>
131
<tr>
133
<label for="rsstext"><?php _e('Message for RSS Feed', 'paid-memberships-pro' );?>:</label>
134
</th>
135
<td>
136
+ <textarea name="rsstext" rows="3" cols="80"><?php echo stripslashes($rsstext)?></textarea>
137
+ <p class="description"><?php _e('This message replaces the post content in RSS feeds.', 'paid-memberships-pro' );?></p>
138
</td>
139
</tr>
140
+ </tbody>
141
+ </table>
142
+ <hr />
143
+ <h3><?php _e('Content Settings', 'paid-memberships-pro' );?></h3>
144
+ <table class="form-table">
145
+ <tbody>
146
<tr>
147
<th scope="row" valign="top">
148
<label for="filterqueries"><?php _e("Filter searches and archives?", 'paid-memberships-pro' );?></label>
165
</select>
166
</td>
167
</tr>
168
+ </tbody>
169
+ </table>
170
+ <hr />
171
+ <h3><?php _e('reCAPTCHA Settings', 'paid-memberships-pro' ); ?></h3>
172
+ <table class="form-table">
173
+ <tbody>
174
+ <tr>
175
+ <th scope="row" valign="top">
176
+ <label for="recaptcha"><?php _e('Use reCAPTCHA?', 'paid-memberships-pro' );?>:</label>
177
+ </th>
178
+ <td>
179
+ <select id="recaptcha" name="recaptcha" onchange="pmpro_updateRecaptchaTRs();">
180
+ <option value="0" <?php if(!$recaptcha) { ?>selected="selected"<?php } ?>><?php _e('No', 'paid-memberships-pro' );?></option>
181
+ <option value="1" <?php if($recaptcha == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes - Free memberships only.', 'paid-memberships-pro' );?></option>
182
+ <option value="2" <?php if($recaptcha == 2) { ?>selected="selected"<?php } ?>><?php _e('Yes - All memberships.', 'paid-memberships-pro' );?></option>
183
+ </select>
184
+ <p class="description"><?php _e('A free reCAPTCHA key is required.', 'paid-memberships-pro' );?> <a href="https://www.google.com/recaptcha/admin/create"><?php _e('Click here to signup for reCAPTCHA', 'paid-memberships-pro' );?></a>.</p>
185
+ </td>
186
+ </tr>
187
+ </tbody>
188
+ </table>
189
+ <table class="form-table" id="recaptcha_settings" <?php if(!$recaptcha) { ?>style="display: none;"<?php } ?>>
190
+ <tbody>
191
+ <tr>
192
+ <th scope="row" valign="top"><label for="recaptcha_version"><?php _e( 'reCAPTCHA Version', 'paid-memberships-pro' );?>:</label></th>
193
+ <td>
194
+ <select id="recaptcha_version" name="recaptcha_version">
195
+ <option value="2_checkbox" <?php selected( '2_checkbox', $recaptcha_version ); ?>><?php _e( ' v2 - Checkbox', 'paid-memberships-pro' ); ?></option>
196
+ <option value="3_invisible" <?php selected( '3_invisible', $recaptcha_version ); ?>><?php _e( 'v3 - Invisible', 'paid-memberships-pro' ); ?></option>
197
+ </select>
198
+ <p class="description"><?php _e( 'Changing your version will require new API keys.', 'paid-memberships-pro' ); ?></p>
199
+ </td>
200
+ </tr>
201
+ <tr>
202
+ <th scope="row"><label for="recaptcha_publickey"><?php _e('reCAPTCHA Site Key', 'paid-memberships-pro' );?>:</label></th>
203
+ <td>
204
+ <input type="text" id="recaptcha_publickey" name="recaptcha_publickey" size="60" value="<?php echo esc_attr($recaptcha_publickey);?>" />
205
+ </td>
206
+ </tr>
207
+ <tr>
208
+ <th scope="row"><label for="recaptcha_privatekey"><?php _e('reCAPTCHA Secret Key', 'paid-memberships-pro' );?>:</label></th>
209
+ <td>
210
+ <input type="text" id="recaptcha_privatekey" name="recaptcha_privatekey" size="60" value="<?php echo esc_attr($recaptcha_privatekey);?>" />
211
+ </td>
212
+ </tr>
213
+ </tbody>
214
+ </table>
215
+ <hr />
216
+ <h3><?php _e('Other Settings', 'paid-memberships-pro' ); ?></h3>
217
+ <table class="form-table">
218
+ <tbody>
219
+ <tr>
220
<th scope="row" valign="top">
221
<label for="hideads"><?php _e("Hide Ads From Members?", 'paid-memberships-pro' );?></label>
222
</th>
231
<tr id="hideads_explanation" <?php if($hideads < 2) { ?>style="display: none;"<?php } ?>>
232
<th scope="row" valign="top">&nbsp;</th>
233
<td>
234
+ <p><?php _e('Ads from the following plugins will be automatically turned off', 'paid-memberships-pro' );?>: <em>Easy Adsense</em>, ...</p>
235
<p><?php _e('To hide ads in your template code, use code like the following', 'paid-memberships-pro' );?>:</p>
236
<pre lang="PHP">
237
+ if ( pmpro_displayAds() ) {
238
+ //insert ad code here
239
+ }</pre>
240
</td>
241
</tr>
242
<tr id="hideadslevels_tr" <?php if($hideads != 2) { ?>style="display: none;"<?php } ?>>
285
</td>
286
</tr>
287
<?php } ?>
288
<tr>
289
<th scope="row" valign="top">
290
<label for="tospage"><?php _e('Require Terms of Service on signups?', 'paid-memberships-pro' );?></label>
294
wp_dropdown_pages(array("name"=>"tospage", "show_option_none"=>"No", "selected"=>$tospage));
295
?>
296
<br />
297
+ <p class="description"><?php _e('If yes, create a WordPress page containing your TOS agreement and assign it using the dropdown above.', 'paid-memberships-pro' );?></p>
298
</td>
299
</tr>
300
352
}
353
if (!empty($field['description'])) {
354
?>
355
+ <p class="description"><?php echo esc_textarea( $field['description'] ); ?></p>
356
<?php
357
}
358
?>
393
var recaptcha = jQuery('#recaptcha').val();
394
if(recaptcha > 0)
395
{
396
+ jQuery('#recaptcha_settings').show();
397
}
398
else
399
{
400
+ jQuery('#recaptcha_settings').hide();
401
}
402
}
403
pmpro_updateRecaptchaTRs();
adminpages/dashboard.php CHANGED
@@ -154,7 +154,7 @@ function pmpro_dashboard_welcome_callback() { ?>
154
<hr />
155
<p class="text-center">
156
<?php echo esc_html( __( 'For guidance as your begin these steps,', 'paid-memberships-pro' ) ); ?>
157
- <a href="https://www.paidmembershipspro.com/documentation/initial-plugin-setup/?utm_source=plugin&utm_medium=banner&utm_campaign=welcome" target="_blank"><?php echo esc_attr_e( 'view the Initial Setup Video and Docs.', 'paid-memberships-pro' ); ?></a>
158
</p>
159
</div> <!-- end pmpro-dashboard-welcome-column -->
160
<div class="pmpro-dashboard-welcome-column">
@@ -167,19 +167,19 @@ function pmpro_dashboard_welcome_callback() { ?>
167
<?php if ( ! pmpro_license_isValid() && empty( $key ) ) { ?>
168
<p class="pmpro_message pmpro_error">
169
<strong><?php echo esc_html_e( 'No support license key found.', 'paid-memberships-pro' ); ?></strong><br />
170
- <?php printf(__( '<a href="%s">Enter your key here &raquo;</a>', 'paid-memberships-pro' ), admin_url( 'options-general.php?page=pmpro_license_settings' ) );?>
171
</p>
172
<?php } elseif ( ! pmpro_license_isValid() ) { ?>
173
<p class="pmpro_message pmpro_alert">
174
<strong><?php echo esc_html_e( 'Your license is invalid or expired.', 'paid-memberships-pro' ); ?></strong><br />
175
- <?php printf(__( '<a href="%s">View your membership account</a> to verify your license key.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/login/?redirect_to=/membership-account/?utm_source=plugin&utm_medium=banner&utm_campaign=welcome' );?>
176
<?php } else { ?>
177
<p class="pmpro_message pmpro_success"><?php printf(__( '<strong>Thank you!</strong> A valid <strong>%s</strong> license key has been used to activate your support license on this site.', 'paid-memberships-pro' ), ucwords($pmpro_license_check['license']));?></p>
178
<?php } ?>
179
180
<?php if ( ! pmpro_license_isValid() ) { ?>
181
- <p><?php esc_html_e( 'An annual support license is recommended for websites running Paid Memberships Pro.', 'paid-memberships-pro' ); ?><br /><a href="http://www.paidmembershipspro.com/pricing/?utm_source=plugin&utm_medium=banner&utm_campaign=welcome" target="_blank"><?php esc_html_e( 'View Pricing &raquo;' , 'paid-memberships-pro' ); ?></a></p>
182
- <p><a href="https://www.paidmembershipspro.com/membership-checkout/?level=20&utm_source=plugin&utm_medium=banner&utm_campaign=welcome" target="_blank" class="button button-action button-hero"><?php esc_attr_e( 'Upgrade', 'paid-memberships-pro' ); ?></a>
183
<?php } ?>
184
<hr />
185
<p><?php echo wp_kses_post( sprintf( __( 'Paid Memberships Pro and our add ons are distributed under the <a target="_blank" href="%s">GPLv2 license</a>. This means, among other things, that you may use the software on this site or any other site free of charge.', 'paid-memberships-pro' ), 'http://www.gnu.org/licenses/gpl-2.0.html' ) ); ?></p>
@@ -383,7 +383,7 @@ function pmpro_dashboard_news_updates_callback() {
383
<?php endforeach; ?>
384
<?php endif; ?>
385
</ul>
386
- <p class="text-center"><a class="button button-primary" href="<?php echo esc_url( 'https://www.paidmembershipspro.com/blog/' ); ?>"><?php esc_attr_e( 'View More', 'paid-memberships-pro' ); ?></a></p>
387
<?php
388
}
389
154
<hr />
155
<p class="text-center">
156
<?php echo esc_html( __( 'For guidance as your begin these steps,', 'paid-memberships-pro' ) ); ?>
157
+ <a href="https://www.paidmembershipspro.com/documentation/initial-plugin-setup/?utm_source=plugin&utm_medium=pmpro-dashboard&utm_campaign=documentation&utm_content=initial-plugin-setup" target="_blank"><?php echo esc_attr_e( 'view the Initial Setup Video and Docs.', 'paid-memberships-pro' ); ?></a>
158
</p>
159
</div> <!-- end pmpro-dashboard-welcome-column -->
160
<div class="pmpro-dashboard-welcome-column">
167
<?php if ( ! pmpro_license_isValid() && empty( $key ) ) { ?>
168
<p class="pmpro_message pmpro_error">
169
<strong><?php echo esc_html_e( 'No support license key found.', 'paid-memberships-pro' ); ?></strong><br />
170
+ <?php printf(__( '<a href="%s">Enter your key here &raquo;</a>', 'paid-memberships-pro' ), admin_url( 'admin.php?page=pmpro-license' ) );?>
171
</p>
172
<?php } elseif ( ! pmpro_license_isValid() ) { ?>
173
<p class="pmpro_message pmpro_alert">
174
<strong><?php echo esc_html_e( 'Your license is invalid or expired.', 'paid-memberships-pro' ); ?></strong><br />
175
+ <?php printf(__( '<a href="%s">View your membership account</a> to verify your license key.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/login/?redirect_to=%2Fmembership-account%2F%3Futm_source%3Dplugin%26utm_medium%3Dpmpro-dashboard%26utm_campaign%3Dmembership-account%26utm_content%3Dverify-license-key' );?>
176
<?php } else { ?>
177
<p class="pmpro_message pmpro_success"><?php printf(__( '<strong>Thank you!</strong> A valid <strong>%s</strong> license key has been used to activate your support license on this site.', 'paid-memberships-pro' ), ucwords($pmpro_license_check['license']));?></p>
178
<?php } ?>
179
180
<?php if ( ! pmpro_license_isValid() ) { ?>
181
+ <p><?php esc_html_e( 'An annual support license is recommended for websites running Paid Memberships Pro.', 'paid-memberships-pro' ); ?><br /><a href="https://www.paidmembershipspro.com/pricing/?utm_source=plugin&utm_medium=pmpro-dashboard&utm_campaign=pricing&utm_content=upgrade" target="_blank"><?php esc_html_e( 'View Pricing &raquo;' , 'paid-memberships-pro' ); ?></a></p>
182
+ <p><a href="https://www.paidmembershipspro.com/membership-checkout/?level=20&utm_source=plugin&utm_medium=pmpro-dashboard&utm_campaign=plus-checkout&utm_content=upgrade" target="_blank" class="button button-action button-hero"><?php esc_attr_e( 'Upgrade', 'paid-memberships-pro' ); ?></a>
183
<?php } ?>
184
<hr />
185
<p><?php echo wp_kses_post( sprintf( __( 'Paid Memberships Pro and our add ons are distributed under the <a target="_blank" href="%s">GPLv2 license</a>. This means, among other things, that you may use the software on this site or any other site free of charge.', 'paid-memberships-pro' ), 'http://www.gnu.org/licenses/gpl-2.0.html' ) ); ?></p>
383
<?php endforeach; ?>
384
<?php endif; ?>
385
</ul>
386
+ <p class="text-center"><a class="button button-primary" href="<?php echo esc_url( 'https://www.paidmembershipspro.com/blog/?utm_source=plugin&utm_medium=pmpro-dashboard&utm_campaign=blog&utm_content=news-updates-metabox' ); ?>"><?php esc_attr_e( 'View More', 'paid-memberships-pro' ); ?></a></p>
387
<?php
388
}
389
adminpages/discountcodes.php CHANGED
@@ -353,7 +353,7 @@
353
}
354
355
if( ! empty( $pmpro_msg ) && ! empty( $expiration_warning_flag ) ) {
356
- $pmpro_msg .= ' <strong>' . sprintf( __( 'WARNING: A level was set with both a recurring billing amount and an expiration date. You only need to set one of these unless you really want this membership to expire after a specific time period. For more information, <a target="_blank" href="%s">see our post here</a>.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels/' ) . '</strong>';
357
358
if( $pmpro_msgt == 'success' ) {
359
$pmpro_msgt = 'warning';
@@ -440,7 +440,7 @@
440
<tbody>
441
<tr>
442
<th scope="row" valign="top"><label><?php _e('ID', 'paid-memberships-pro' );?>:</label></th>
443
- <td class="pmpro_lite"><?php if(!empty($code->id)) echo $code->id; else echo __("This will be generated when you save.", 'paid-memberships-pro' );?></td>
444
</tr>
445
446
<tr>
@@ -521,7 +521,7 @@
521
<th scope="row" valign="top"><label for="uses"><?php _e('Uses', 'paid-memberships-pro' );?>:</label></th>
522
<td>
523
<input name="uses" type="text" size="10" value="<?php if(!empty($code->uses)) echo str_replace("\"", "&quot;", stripslashes($code->uses));?>" />
524
- <small class="pmpro_lite"><?php _e('Leave blank for unlimited uses.', 'paid-memberships-pro' );?></small>
525
</td>
526
</tr>
527
@@ -579,7 +579,7 @@
579
if(pmpro_getCurrencyPosition() == "right")
580
echo $pmpro_currency_symbol;
581
?>
582
- <small><?php _e('The initial amount collected at registration.', 'paid-memberships-pro' );?></small>
583
</td>
584
</tr>
585
@@ -600,7 +600,7 @@
600
if(pmpro_getCurrencyPosition() == "right")
601
echo $pmpro_currency_symbol;
602
?>
603
- <small>per</small>
604
<input name="cycle_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->cycle_number))?>" />
605
<select name="cycle_period[]" onchange="updateCyclePeriod();">
606
<?php
@@ -612,7 +612,7 @@
612
}
613
?>
614
</select>
615
- <br /><small><?php _e('The amount to be billed one cycle after the initial payment.', 'paid-memberships-pro' );?></small>
616
</td>
617
</tr>
618
@@ -620,7 +620,7 @@
620
<th scope="row" valign="top"><label for="billing_limit"><?php _e('Billing Cycle Limit', 'paid-memberships-pro' );?>:</label></th>
621
<td>
622
<input name="billing_limit[]" type="text" size="20" value="<?php echo $level->billing_limit?>" />
623
- <br /><small><?php _e('The <strong>total</strong> number of recurring billing cycles for this level, including the trial period (if applicable) but not including the initial payment. Set to zero if membership is indefinite.', 'paid-memberships-pro' );?></small>
624
</td>
625
</tr>
626
@@ -641,9 +641,9 @@
641
if(pmpro_getCurrencyPosition() == "right")
642
echo $pmpro_currency_symbol;
643
?>
644
- <small><?php _e('for the first', 'paid-memberships-pro' );?></small>
645
<input name="trial_limit[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->trial_limit))?>" />
646
- <small><?php _e('subscription payments', 'paid-memberships-pro' );?>.</small>
647
</td>
648
</tr>
649
@@ -666,7 +666,7 @@
666
}
667
?>
668
</select>
669
- <br /><small><?php _e('Set the duration of membership access. Note that the any future payments (recurring subscription, if any) will be cancelled when the membership expires.', 'paid-memberships-pro' );?></small>
670
</td>
671
</tr>
672
</tbody>
@@ -717,7 +717,7 @@
717
<h2><?php echo esc_attr_e( 'No Discount Codes Found', 'paid-memberships-pro' ); ?></h2>
718
<h4><?php _e( 'Discount codes allow you to override your membership level\'s default pricing.', 'paid-memberships-pro' ); ?></h4>
719
<a href="<?php echo esc_url( admin_url( 'admin.php?page=pmpro-discountcodes&edit=-1' ) ) ; ?>" class="button-primary"><?php esc_attr_e( 'Create a Discount Code', 'paid-memberships-pro' );?></a>
720
- <a href="<?php echo esc_url( 'https://www.paidmembershipspro.com/documentation/discount-codes/' ); ?>" target="_blank" class="button"><?php echo esc_attr_e( 'Documentation: Discount Codes', 'paid-memberships-pro' ); ?></a>
721
</div> <!-- end pmpro-new-install -->
722
<?php } else { ?>
723
353
}
354
355
if( ! empty( $pmpro_msg ) && ! empty( $expiration_warning_flag ) ) {
356
+ $pmpro_msg .= ' <strong>' . sprintf( __( 'WARNING: A level was set with both a recurring billing amount and an expiration date. You only need to set one of these unless you really want this membership to expire after a specific time period. For more information, <a target="_blank" href="%s">see our post here</a>.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels/?utm_source=plugin&utm_medium=pmpro-discountcodes&utm_campaign=blog&utm_content=important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels' ) . '</strong>';
357
358
if( $pmpro_msgt == 'success' ) {
359
$pmpro_msgt = 'warning';
440
<tbody>
441
<tr>
442
<th scope="row" valign="top"><label><?php _e('ID', 'paid-memberships-pro' );?>:</label></th>
443
+ <td><p class="description"><?php if(!empty($code->id)) echo $code->id; else echo __("This will be generated when you save.", 'paid-memberships-pro' );?></p></td>
444
</tr>
445
446
<tr>
521
<th scope="row" valign="top"><label for="uses"><?php _e('Uses', 'paid-memberships-pro' );?>:</label></th>
522
<td>
523
<input name="uses" type="text" size="10" value="<?php if(!empty($code->uses)) echo str_replace("\"", "&quot;", stripslashes($code->uses));?>" />
524
+ <p class="description"><?php _e('Leave blank for unlimited uses.', 'paid-memberships-pro' );?></p>
525
</td>
526
</tr>
527
579
if(pmpro_getCurrencyPosition() == "right")
580
echo $pmpro_currency_symbol;
581
?>
582
+ <p class="description"><?php _e('The initial amount collected at registration.', 'paid-memberships-pro' );?></p>
583
</td>
584
</tr>
585
600
if(pmpro_getCurrencyPosition() == "right")
601
echo $pmpro_currency_symbol;
602
?>
603
+ <?php _e('per', 'paid-memberships-pro' ); ?>
604
<input name="cycle_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->cycle_number))?>" />
605
<select name="cycle_period[]" onchange="updateCyclePeriod();">
606
<?php
612
}
613
?>
614
</select>
615
+ <p class="description"><?php _e('The amount to be billed one cycle after the initial payment.', 'paid-memberships-pro' );?></p>
616
</td>
617
</tr>
618
620
<th scope="row" valign="top"><label for="billing_limit"><?php _e('Billing Cycle Limit', 'paid-memberships-pro' );?>:</label></th>
621
<td>
622
<input name="billing_limit[]" type="text" size="20" value="<?php echo $level->billing_limit?>" />
623
+ <p class="description"><?php _e('The <strong>total</strong> number of recurring billing cycles for this level, including the trial period (if applicable) but not including the initial payment. Set to zero if membership is indefinite.', 'paid-memberships-pro' );?></p>
624
</td>
625
</tr>
626
641
if(pmpro_getCurrencyPosition() == "right")
642
echo $pmpro_currency_symbol;
643
?>
644
+ <?php _e('for the first', 'paid-memberships-pro' );?>
645
<input name="trial_limit[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->trial_limit))?>" />
646
+ <?php _e('subscription payments', 'paid-memberships-pro' );?>.
647
</td>
648
</tr>
649
666
}
667
?>
668
</select>
669
+ <p class="description"><?php _e('Set the duration of membership access. Note that the any future payments (recurring subscription, if any) will be cancelled when the membership expires.', 'paid-memberships-pro' );?></p>
670
</td>
671
</tr>
672
</tbody>
717
<h2><?php echo esc_attr_e( 'No Discount Codes Found', 'paid-memberships-pro' ); ?></h2>
718
<h4><?php _e( 'Discount codes allow you to override your membership level\'s default pricing.', 'paid-memberships-pro' ); ?></h4>
719
<a href="<?php echo esc_url( admin_url( 'admin.php?page=pmpro-discountcodes&edit=-1' ) ) ; ?>" class="button-primary"><?php esc_attr_e( 'Create a Discount Code', 'paid-memberships-pro' );?></a>
720
+ <a href="<?php echo esc_url( 'https://www.paidmembershipspro.com/documentation/discount-codes/?utm_source=plugin&utm_medium=pmpro-discountcodes&utm_campaign=documentation&utm_content=discount-codes' ); ?>" target="_blank" class="button"><?php echo esc_attr_e( 'Documentation: Discount Codes', 'paid-memberships-pro' ); ?></a>
721
</div> <!-- end pmpro-new-install -->
722
<?php } else { ?>
723
adminpages/emailsettings.php CHANGED
@@ -83,7 +83,7 @@
83
<h2><?php _e('Email Settings', 'paid-memberships-pro' );?></h2>
84
<p><?php _e('By default, system generated emails are sent from <em><strong>wordpress@yourdomain.com</strong></em>. You can update this from address using the fields below.', 'paid-memberships-pro' );?></p>
85
86
- <p><?php _e('To modify the appearance of system generated emails, add the files <em>email_header.html</em> and <em>email_footer.html</em> to your theme\'s directory. This will modify both the WordPress default messages as well as messages generated by Paid Memberships Pro. <a title="Paid Memberships Pro - Member Communications" target="_blank" href="http://www.paidmembershipspro.com/documentation/member-communications/?utm_source=plugin&utm_medium=banner&utm_campaign=admin_email_settings">Click here to learn more about Paid Memberships Pro emails</a>.', 'paid-memberships-pro' );?></p>
87
88
<table class="form-table">
89
<tbody>
@@ -126,6 +126,7 @@
126
<p><?php _e('To modify the subject line and body content of system generated emails, <a title="Paid Memberships Pro - Email Templates Plugin" target="_blank" href="' . wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-email-templates-addon'), 'install-plugin_pmpro-email-templates-addon') . '">Install and Activate the PMPro Email Templates add on</a>.', 'paid-memberships-pro' ); ?></p>
127
*/ ?>
128
129
<h3><?php _e('Send the site admin emails', 'paid-memberships-pro' );?>:</h3>
130
131
<table class="form-table">
@@ -169,6 +170,7 @@
169
</tbody>
170
</table>
171
172
<h3><?php _e('Send members emails', 'paid-memberships-pro' );?>:</h3>
173
174
<table class="form-table">
@@ -179,7 +181,8 @@
179
</th>
180
<td>
181
<input type="checkbox" id="email_member_notification" name="email_member_notification" value="1" <?php if(!empty($email_member_notification)) { ?>checked="checked"<?php } ?> />
182
- <label for="email_member_notification"><?php _e('Default WP notification email. (Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.)', 'paid-memberships-pro' );?></label>
183
</td>
184
</tr>
185
</tbody>
83
<h2><?php _e('Email Settings', 'paid-memberships-pro' );?></h2>
84
<p><?php _e('By default, system generated emails are sent from <em><strong>wordpress@yourdomain.com</strong></em>. You can update this from address using the fields below.', 'paid-memberships-pro' );?></p>
85
86
+ <p><?php _e('To modify the appearance of system generated emails, add the files <em>email_header.html</em> and <em>email_footer.html</em> to your theme\'s directory. This will modify both the WordPress default messages as well as messages generated by Paid Memberships Pro. <a title="Paid Memberships Pro - Member Communications" target="_blank" href="http://www.paidmembershipspro.com/documentation/member-communications/?utm_source=plugin&utm_medium=pmpro-emailsettings&utm_campaign=documentation&utm_content=member-communications">Click here to learn more about Paid Memberships Pro emails</a>.', 'paid-memberships-pro' );?></p>
87
88
<table class="form-table">
89
<tbody>
126
<p><?php _e('To modify the subject line and body content of system generated emails, <a title="Paid Memberships Pro - Email Templates Plugin" target="_blank" href="' . wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-email-templates-addon'), 'install-plugin_pmpro-email-templates-addon') . '">Install and Activate the PMPro Email Templates add on</a>.', 'paid-memberships-pro' ); ?></p>
127
*/ ?>
128
129
+ <hr />
130
<h3><?php _e('Send the site admin emails', 'paid-memberships-pro' );?>:</h3>
131
132
<table class="form-table">
170
</tbody>
171
</table>
172
173
+ <hr />
174
<h3><?php _e('Send members emails', 'paid-memberships-pro' );?>:</h3>
175
176
<table class="form-table">
181
</th>
182
<td>
183
<input type="checkbox" id="email_member_notification" name="email_member_notification" value="1" <?php if(!empty($email_member_notification)) { ?>checked="checked"<?php } ?> />
184
+ <label for="email_member_notification"><?php _e('Default WP notification email.', 'paid-memberships-pro' );?></label>
185
+ <p class="description"><?php _e( 'Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.', 'paid-memberships-pro' ); ?></p>
186
</td>
187
</tr>
188
</tbody>
adminpages/license.php ADDED
@@ -0,0 +1,114 @@
1
+ <?php
2
+ //only let admins get here
3
+ if ( ! function_exists( 'current_user_can' ) || ( ! current_user_can( 'manage_options' ) && ! current_user_can( 'pmpro_license') ) ) {
4
+ die( __( 'You do not have permissions to perform this action.', 'paid-memberships-pro' ) );
5
+ }
6
+
7
+ //updating license?
8
+ if ( ! empty( $_REQUEST['pmpro-verify-submit'] ) ) {
9
+ $key = preg_replace("/[^a-zA-Z0-9]/", "", $_REQUEST['pmpro-license-key']);
10
+
11
+ //erase the old key
12
+ delete_option('pmpro_license_key');
13
+
14
+ //check key
15
+ $valid = pmpro_license_isValid($key, NULL, true);
16
+
17
+ if ( $valid ) { ?>
18
+ <div id="message" class="updated fade">
19
+ <p><?php _e( 'Your license key has been validated.', 'paid-memberships-pro' ); ?></p>
20
+ </div>
21
+ <?php } else {
22
+ global $pmpro_license_error;
23
+ if ( ! empty( $pmpro_license_error ) ) { ?>
24
+ <div id="message" class="error">
25
+ <p><?php echo $pmpro_license_error; ?></p>
26
+ </div>
27
+ <?php }
28
+ }
29
+
30
+ //update key
31
+ update_option( 'pmpro_license_key', $key, 'no' );
32
+ }
33
+
34
+ //get saved license
35
+ $key = get_option( 'pmpro_license_key', '' );
36
+ $pmpro_license_check = get_option( 'pmpro_license_check', array( 'license' => false, 'enddate' => 0 ) );
37
+
38
+ //html for license settings page
39
+ if ( defined( 'PMPRO_DIR' ) ) {
40
+ require_once( PMPRO_DIR . '/adminpages/admin_header.php' );
41
+ } ?>
42
+ <div class="about-wrap">
43
+ <h2><?php _e('Paid Memberships Pro Support License', 'paid-memberships-pro' );?></h2>
44
+
45
+ <div class="about-text">
46
+ <?php if(!pmpro_license_isValid() && empty($key)) { ?>
47
+ <p class="pmpro_message pmpro_error"><strong><?php _e('Enter your support license key.</strong> Your license key can be found in your membership email receipt or in your <a href="https://www.paidmembershipspro.com/login/?redirect_to=%2Fmembership-account%2F%3Futm_source%3Dplugin%26utm_medium%3Dpmpro-license%26utm_campaign%3Dmembership-account%26utm_content%3Dno-key" target="_blank">Membership Account</a>.', 'paid-memberships-pro' );?></p>
48
+ <?php } elseif(!pmpro_license_isValid()) { ?>
49
+ <p class="pmpro_message pmpro_error"><strong><?php _e('Your license is invalid or expired.', 'paid-memberships-pro' );?></strong> <?php _e('Visit the PMPro <a href="https://www.paidmembershipspro.com/login/?redirect_to=%2Fmembership-account%2F%3Futm_source%3Dplugin%26utm_medium%3Dpmpro-license%26utm_campaign%3Dmembership-account%26utm_content%3Dkey-not-valid" target="_blank">Membership Account</a> page to confirm that your account is active and to find your license key.', 'paid-memberships-pro' );?></p>
50
+ <?php } else { ?>
51
+ <p class="pmpro_message pmpro_success"><?php printf(__('<strong>Thank you!</strong> A valid <strong>%s</strong> license key has been used to activate your support license on this site.', 'paid-memberships-pro' ), ucwords($pmpro_license_check['license']));?></p>
52
+ <?php } ?>
53
+
54
+ <form action="" method="post">
55
+ <table class="form-table">
56
+ <tbody>
57
+ <tr id="pmpro-settings-key-box">
58
+ <td>
59
+ <input type="password" name="pmpro-license-key" id="pmpro-license-key" value="<?php echo esc_attr($key);?>" placeholder="<?php _e('Enter license key here...', 'paid-memberships-pro' );?>" size="40" />
60
+ <?php wp_nonce_field( 'pmpro-key-nonce', 'pmpro-key-nonce' ); ?>
61
+ <?php submit_button( __( 'Validate Key', 'paid-memberships-pro' ), 'primary', 'pmpro-verify-submit', false ); ?>
62
+ </td>
63
+ </tr>
64
+ </tbody>
65
+ </table>
66
+ </form>
67
+
68
+ <p>
69
+ <?php if ( ! pmpro_license_isValid() ) { ?>
70
+ <a class="button button-primary button-hero" href="https://www.paidmembershipspro.com/membership-checkout/?level=20&utm_source=plugin&utm_medium=pmpro-license&utm_campaign=plus-checkout&utm_content=buy-plus" target="_blank"><?php echo esc_html( 'Buy Plus License', 'paid-memberships-pro' ); ?></a>
71
+ <a class="button button-hero" href="https://www.paidmembershipspro.com/pricing/?utm_source=plugin&utm_medium=pmpro-license&utm_campaign=pricing&utm_content=view-license-options" target="_blank"><?php echo esc_html( 'View Support License Options', 'paid-memberships-pro' ); ?></a>
72
+ <?php } else { ?>
73
+ <a class="button button-primary button-hero" href="https://www.paidmembershipspro.com/login/?redirect_to=%2Fmembership-account%2F%3Futm_source%3Dplugin%26utm_medium%3Dpmpro-license%26utm_campaign%3Dmembership-account%26utm_content%3Dview-account" target="_blank"><?php echo esc_html( 'Manage My Account', 'paid-memberships-pro' ); ?></a>
74
+ <a class="button button-hero" href="https://www.paidmembershipspro.com/login/?redirect_to=%2Fnew-topic%2F%3Futm_source%3Dplugin%26utm_medium%3Dpmpro-license%26utm_campaign%3Dsupport%26utm_content%3Dnew-support-ticket" target="_blank"><?php echo esc_html( 'Open Support Ticket', 'paid-memberships-pro' ); ?></a>
75
+ <?php } ?>
76
+ </p>
77
+
78
+ <hr />
79
+
80
+ <div class="clearfix"></div>
81
+
82
+ <img class="pmpro_icon alignright" src="<?php echo PMPRO_URL?>/images/Paid-Memberships-Pro_icon.png" border="0" alt="Paid Memberships Pro(c) - All Rights Reserved" />
83
+ <?php
84
+ $allowed_pmpro_license_strings_html = array (
85
+ 'a' => array (
86
+ 'href' => array(),
87
+ 'target' => array(),
88
+ 'title' => array(),
89
+ ),
90
+ 'strong' => array(),
91
+ 'em' => array(), );
92
+ ?>
93
+
94
+ <?php
95
+ echo '<p>' . sprintf( wp_kses( __( 'Paid Memberships Pro and our Add Ons are distributed under the <a href="%s" title="GPLv2 license" target="_blank">GPLv2 license</a>. This means, among other things, that you may use the software on this site or any other site free of charge.', 'paid-memberships-pro' ), $allowed_pmpro_license_strings_html ), 'https://www.paidmembershipspro.com/features/paid-memberships-pro-is-100-gpl/?utm_source=plugin&utm_medium=pmpro-license&utm_campaign=documentation&utm_content=gpl' ) . '</p>';
96
+ ?>
97
+
98
+ <?php
99
+ echo '<p>' . wp_kses( __( '<strong>Paid Memberships Pro offers plans for automatic updates of Add Ons and premium support.</strong> These plans include a Plus license key which we recommend for all public websites running Paid Memberships Pro. A Plus license key allows you to automatically install new Add Ons and update active Add Ons when a new security, bug fix, or feature enhancement is released.' ), $allowed_pmpro_license_strings_html ) . '</p>';
100
+ ?>
101
+
102
+ <?php
103
+ echo '<p>' . wp_kses( __( '<strong>Need help?</strong> Your license allows you to open new tickets in our private support area. Purchases are backed by a 30 day, no questions asked refund policy.' ), $allowed_pmpro_license_strings_html ) . '</p>';
104
+ ?>
105
+
106
+ <p><a href="https://www.paidmembershipspro.com/pricing/?utm_source=plugin&utm_medium=pmpro-license&utm_campaign=pricing&utm_content=view-license-options" target="_blank"><?php echo esc_html( 'View Support License Options &raquo;', 'paid-memberships-pro' ); ?></a></p>
107
+
108
+ </div> <!-- end about-text -->
109
+ </div> <!-- end about-wrap -->
110
+
111
+ <?php
112
+
113
+ require_once(dirname(__FILE__) . "/admin_footer.php");
114
+ ?>
adminpages/membershiplevels.php CHANGED
@@ -166,7 +166,7 @@
166
}
167
168
if( ! empty( $msgt ) && $ml_recurring && $ml_expiration ) {
169
- $msgt .= ' <strong class="red">' . sprintf( __( 'WARNING: A level was set with both a recurring billing amount and an expiration date. You only need to set one of these unless you really want this membership to expire after a specific time period. For more information, <a target="_blank" href="%s">see our post here</a>.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels/' ) . '</strong>';
170
171
// turn success to errors
172
if( $msg > 0 ) {
@@ -408,7 +408,8 @@
408
if(pmpro_getCurrencyPosition() == "right")
409
echo $pmpro_currency_symbol;
410
?>
411
- <small><?php _e('The initial amount collected at registration.', 'paid-memberships-pro' );?></small></td>
412
</tr>
413
414
<tr>
@@ -428,7 +429,7 @@
428
if(pmpro_getCurrencyPosition() == "right")
429
echo $pmpro_currency_symbol;
430
?>
431
- <small><?php _e('per', 'paid-memberships-pro' );?></small>
432
<input id="cycle_number" name="cycle_number" type="text" size="10" value="<?php echo esc_attr($level->cycle_number);?>" />
433
<select id="cycle_period" name="cycle_period">
434
<?php
@@ -440,12 +441,12 @@
440
}
441
?>
442
</select>
443
- <br /><small>
444
<?php _e('The amount to be billed one cycle after the initial payment.', 'paid-memberships-pro' );?>
445
<?php if($gateway == "braintree") { ?>
446
- <br /><strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently only supports billing periods of "Month" or "Year".', 'paid-memberships-pro' );?>
447
<?php } ?>
448
- </small>
449
<?php if($gateway == "braintree" && $edit < 0) { ?>
450
<p class="pmpro_message"><strong><?php _e('Note', 'paid-memberships-pro' );?>:</strong> <?php _e('After saving this level, make note of the ID and create a "Plan" in your Braintree dashboard with the same settings and the "Plan ID" set to <em>pmpro_#</em>, where # is the level ID.', 'paid-memberships-pro' );?></p>
451
<?php } elseif($gateway == "braintree") {
@@ -461,12 +462,12 @@
461
<th scope="row" valign="top"><label for="billing_limit"><?php _e('Billing Cycle Limit', 'paid-memberships-pro' );?>:</label></th>
462
<td>
463
<input name="billing_limit" type="text" size="20" value="<?php echo $level->billing_limit?>" />
464
- <br /><small>
465
<?php _e('The <strong>total</strong> number of recurring billing cycles for this level, including the trial period (if applicable) but not including the initial payment. Set to zero if membership is indefinite.', 'paid-memberships-pro' );?>
466
<?php if($gateway == "stripe") { ?>
467
- <br /><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently does not support billing limits. You can still set an expiration date below.', 'paid-memberships-pro' );?></strong>
468
<?php } ?>
469
- </small>
470
</td>
471
</tr>
472
@@ -476,11 +477,22 @@
476
<input id="custom_trial" name="custom_trial" type="checkbox" value="yes" <?php if ( pmpro_isLevelTrial($level) ) { echo "checked='checked'"; } ?> onclick="jQuery('.trial_info').toggle();" /> <label for="custom_trial"><?php _e('Check to add a custom trial period.', 'paid-memberships-pro' );?></label>
477
478
<?php if($gateway == "twocheckout") { ?>
479
- <br /><small><strong <?php if(!empty($pmpro_twocheckout_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('2Checkout integration does not support custom trials. You can do one period trials by setting an initial payment different from the billing amount.', 'paid-memberships-pro' );?></strong></small>
480
<?php } ?>
481
</td>
482
</tr>
483
484
<tr class="trial_info recurring_info" <?php if (!pmpro_isLevelTrial($level)) echo "style='display:none;'";?>>
485
<th scope="row" valign="top"><label for="trial_amount"><?php _e('Trial Billing Amount', 'paid-memberships-pro' );?>:</label></th>
486
<td>
@@ -493,21 +505,15 @@
493
if(pmpro_getCurrencyPosition() == "right")
494
echo $pmpro_currency_symbol;
495
?>
496
- <small><?php _e('for the first', 'paid-memberships-pro' );?></small>
497
<input name="trial_limit" type="text" size="10" value="<?php echo esc_attr($level->trial_limit);?>" />
498
- <small><?php _e('subscription payments', 'paid-memberships-pro' );?>.</small>
499
<?php if($gateway == "stripe") { ?>
500
- <br /><small>
501
- <strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently does not support trial amounts greater than $0.', 'paid-memberships-pro' );?></strong>
502
- </small>
503
<?php } elseif($gateway == "braintree") { ?>
504
- <br /><small>
505
- <strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently does not support trial amounts greater than $0.', 'paid-memberships-pro' );?></strong>
506
- </small>
507
<?php } elseif($gateway == "payflowpro") { ?>
508
- <br /><small>
509
- <strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently does not support trial amounts greater than $0.', 'paid-memberships-pro' );?></strong>
510
- </small>
511
<?php } ?>
512
</td>
513
</tr>
@@ -528,6 +534,17 @@
528
<td><input id="expiration" name="expiration" type="checkbox" value="yes" <?php if(pmpro_isLevelExpiring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery('#expiration').is(':checked')) { jQuery('.expiration_info').show(); } else { jQuery('.expiration_info').hide();}" /> <label for="expiration"><?php _e('Check this to set when membership access expires.', 'paid-memberships-pro' );?></label></a></td>
529
</tr>
530
531
<tr class="expiration_info" <?php if(!pmpro_isLevelExpiring($level)) {?>style="display: none;"<?php } ?>>
532
<th scope="row" valign="top"><label for="billing_amount"><?php _e('Expires In', 'paid-memberships-pro' );?>:</label></th>
533
<td>
@@ -542,10 +559,10 @@
542
}
543
?>
544
</select>
545
- <br /><small><?php _e('Set the duration of membership access. Note that the any future payments (recurring subscription, if any) will be cancelled when the membership expires.', 'paid-memberships-pro' );?></small>
546
547
<div id="pmpro_expiration_warning" style="display: none;" class="notice error inline">
548
- <p><?php printf( __( 'WARNING: This level is set with both a recurring billing amount and an expiration date. You only need to set one of these unless you really want this membership to expire after a certain number of payments. For more information, <a target="_blank" href="%s">see our post here</a>.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels/' ); ?></p>
549
</div>
550
<script>
551
jQuery(document).ready(function() {
@@ -713,7 +730,7 @@
713
<div class="pmpro-new-install">
714
<h2><?php echo esc_attr_e( 'No Membership Levels Found', 'paid-memberships-pro' ); ?></h2>
715
<a href="<?php echo esc_url( admin_url( 'admin.php?page=pmpro-membershiplevels&edit=-1' ) ); ?>" class="button-primary"><?php echo esc_attr_e( 'Create a Membership Level', 'paid-memberships-pro' ); ?></a>
716
- <a href="<?php echo esc_url( 'https://www.paidmembershipspro.com/documentation/initial-plugin-setup/step-1-add-new-membership-level/' ); ?>" target="_blank" class="button"><?php echo esc_attr_e( 'Video: Membership Levels', 'paid-memberships-pro' ); ?></a>
717
</div> <!-- end pmpro-new-install -->
718
<?php } else { ?>
719
166
}
167
168
if( ! empty( $msgt ) && $ml_recurring && $ml_expiration ) {
169
+ $msgt .= ' <strong class="red">' . sprintf( __( 'WARNING: A level was set with both a recurring billing amount and an expiration date. You only need to set one of these unless you really want this membership to expire after a specific time period. For more information, <a target="_blank" href="%s">see our post here</a>.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels/?utm_source=plugin&utm_medium=pmpro-membershiplevels&utm_campaign=blog&utm_content=important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels' ) . '</strong>';
170
171
// turn success to errors
172
if( $msg > 0 ) {
408
if(pmpro_getCurrencyPosition() == "right")
409
echo $pmpro_currency_symbol;
410
?>
411
+ <p class="description"><?php _e('The initial amount collected at registration.', 'paid-memberships-pro' );?></p>
412
+ </td>
413
</tr>
414
415
<tr>
429
if(pmpro_getCurrencyPosition() == "right")
430
echo $pmpro_currency_symbol;
431
?>
432
+ <?php _e('per', 'paid-memberships-pro' );?>
433
<input id="cycle_number" name="cycle_number" type="text" size="10" value="<?php echo esc_attr($level->cycle_number);?>" />
434
<select id="cycle_period" name="cycle_period">
435
<?php
441
}
442
?>
443
</select>
444
+ <p class="description">
445
<?php _e('The amount to be billed one cycle after the initial payment.', 'paid-memberships-pro' );?>
446
<?php if($gateway == "braintree") { ?>
447
+ <strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently only supports billing periods of "Month" or "Year".', 'paid-memberships-pro' );?></strong>
448
<?php } ?>
449
+ </p>
450
<?php if($gateway == "braintree" && $edit < 0) { ?>
451
<p class="pmpro_message"><strong><?php _e('Note', 'paid-memberships-pro' );?>:</strong> <?php _e('After saving this level, make note of the ID and create a "Plan" in your Braintree dashboard with the same settings and the "Plan ID" set to <em>pmpro_#</em>, where # is the level ID.', 'paid-memberships-pro' );?></p>
452
<?php } elseif($gateway == "braintree") {
462
<th scope="row" valign="top"><label for="billing_limit"><?php _e('Billing Cycle Limit', 'paid-memberships-pro' );?>:</label></th>
463
<td>
464
<input name="billing_limit" type="text" size="20" value="<?php echo $level->billing_limit?>" />
465
+ <p class="description">
466
<?php _e('The <strong>total</strong> number of recurring billing cycles for this level, including the trial period (if applicable) but not including the initial payment. Set to zero if membership is indefinite.', 'paid-memberships-pro' );?>
467
<?php if($gateway == "stripe") { ?>
468
+ <strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently does not support billing limits. You can still set an expiration date below.', 'paid-memberships-pro' );?></strong>
469
<?php } ?>
470
+ </p>
471
</td>
472
</tr>
473
477
<input id="custom_trial" name="custom_trial" type="checkbox" value="yes" <?php if ( pmpro_isLevelTrial($level) ) { echo "checked='checked'"; } ?> onclick="jQuery('.trial_info').toggle();" /> <label for="custom_trial"><?php _e('Check to add a custom trial period.', 'paid-memberships-pro' );?></label>
478
479
<?php if($gateway == "twocheckout") { ?>
480
+ <p class="description"><strong <?php if(!empty($pmpro_twocheckout_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('2Checkout integration does not support custom trials. You can do one period trials by setting an initial payment different from the billing amount.', 'paid-memberships-pro' );?></strong></p>
481
<?php } ?>
482
</td>
483
</tr>
484
485
+ <?php if ( ! function_exists( 'pmprosd_pmpro_membership_level_after_other_settings' ) ) {
486
+ $allowed_sd_html = array (
487
+ 'a' => array (
488
+ 'href' => array(),
489
+ 'target' => array(),
490
+ 'title' => array(),
491
+ ),
492
+ );
493
+ echo '<tr><th>&nbsp;</th><td><p class="description">' . sprintf( wp_kses( __( 'Optional: Allow more customizable trial periods and renewal dates using the <a href="%s" title="Paid Memberships Pro - Subscription Delays Add On" target="_blank">Subscription Delays Add On</a>.', 'paid-memberships-pro' ), $allowed_sd_html ), 'https://www.paidmembershipspro.com/add-ons/subscription-delays/?utm_source=plugin&utm_medium=pmpro-membershiplevels&utm_campaign=add-ons&utm_content=subscription-delays' ) . '</p></td></tr>';
494
+ } ?>
495
+
496
<tr class="trial_info recurring_info" <?php if (!pmpro_isLevelTrial($level)) echo "style='display:none;'";?>>
497
<th scope="row" valign="top"><label for="trial_amount"><?php _e('Trial Billing Amount', 'paid-memberships-pro' );?>:</label></th>
498
<td>
505
if(pmpro_getCurrencyPosition() == "right")
506
echo $pmpro_currency_symbol;
507
?>
508
+ <?php _e('for the first', 'paid-memberships-pro' );?>
509
<input name="trial_limit" type="text" size="10" value="<?php echo esc_attr($level->trial_limit);?>" />
510
+ <?php _e('subscription payments', 'paid-memberships-pro' );?>.
511
<?php if($gateway == "stripe") { ?>
512
+ <p class="description"><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently does not support trial amounts greater than $0.', 'paid-memberships-pro' );?></strong></p>
513
<?php } elseif($gateway == "braintree") { ?>
514
+ <p class="description"><strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently does not support trial amounts greater than $0.', 'paid-memberships-pro' );?></strong></p>
515
<?php } elseif($gateway == "payflowpro") { ?>
516
+ <p class="description"><strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently does not support trial amounts greater than $0.', 'paid-memberships-pro' );?></strong></p>
517
<?php } ?>
518
</td>
519
</tr>
534
<td><input id="expiration" name="expiration" type="checkbox" value="yes" <?php if(pmpro_isLevelExpiring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery('#expiration').is(':checked')) { jQuery('.expiration_info').show(); } else { jQuery('.expiration_info').hide();}" /> <label for="expiration"><?php _e('Check this to set when membership access expires.', 'paid-memberships-pro' );?></label></a></td>
535
</tr>
536
537
+ <?php if ( ! function_exists( 'pmprosed_pmpro_membership_level_after_other_settings' ) ) {
538
+ $allowed_sed_html = array (
539
+ 'a' => array (
540
+ 'href' => array(),
541
+ 'target' => array(),
542
+ 'title' => array(),
543
+ ),
544
+ );
545
+ echo '<tr><th>&nbsp;</th><td><p class="description">' . sprintf( wp_kses( __( 'Optional: Allow more customizable expiration dates using the <a href="%s" title="Paid Memberships Pro - Set Expiration Date Add On" target="_blank">Set Expiration Date Add On</a>.', 'paid-memberships-pro' ), $allowed_sed_html ), 'https://www.paidmembershipspro.com/add-ons/pmpro-expiration-date/?utm_source=plugin&utm_medium=pmpro-membershiplevels&utm_campaign=add-ons&utm_content=pmpro-expiration-date' ) . '</p></td></tr>';
546
+ } ?>
547
+
548
<tr class="expiration_info" <?php if(!pmpro_isLevelExpiring($level)) {?>style="display: none;"<?php } ?>>
549
<th scope="row" valign="top"><label for="billing_amount"><?php _e('Expires In', 'paid-memberships-pro' );?>:</label></th>
550
<td>
559
}
560
?>
561
</select>
562
+ <p class="description"><?php _e('Set the duration of membership access. Note that the any future payments (recurring subscription, if any) will be cancelled when the membership expires.', 'paid-memberships-pro' );?></p>
563
564
<div id="pmpro_expiration_warning" style="display: none;" class="notice error inline">
565
+ <p><?php printf( __( 'WARNING: This level is set with both a recurring billing amount and an expiration date. You only need to set one of these unless you really want this membership to expire after a certain number of payments. For more information, <a target="_blank" href="%s">see our post here</a>.', 'paid-memberships-pro' ), 'https://www.paidmembershipspro.com/important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels/?utm_source=plugin&utm_medium=pmpro-membershiplevels&utm_campaign=blog&utm_content=important-notes-on-recurring-billing-and-expiration-dates-for-membership-levels' ); ?></p>
566
</div>
567
<script>
568
jQuery(document).ready(function() {
730
<div class="pmpro-new-install">
731
<h2><?php echo esc_attr_e( 'No Membership Levels Found', 'paid-memberships-pro' ); ?></h2>
732
<a href="<?php echo esc_url( admin_url( 'admin.php?page=pmpro-membershiplevels&edit=-1' ) ); ?>" class="button-primary"><?php echo esc_attr_e( 'Create a Membership Level', 'paid-memberships-pro' ); ?></a>
733
+ <a href="<?php echo esc_url( 'https://www.paidmembershipspro.com/documentation/initial-plugin-setup/step-1-add-new-membership-level/?utm_source=plugin&utm_medium=pmpro-membershiplevels&utm_campaign=documentation&utm_content=step-1-add-new-membership-level' ); ?>" target="_blank" class="button"><?php echo esc_attr_e( 'Video: Membership Levels', 'paid-memberships-pro' ); ?></a>
734
</div> <!-- end pmpro-new-install -->
735
<?php } else { ?>
736
adminpages/memberslist-csv.php CHANGED
@@ -560,7 +560,7 @@
560
else
561
{
562
// use readfile() if fpassthru() is disabled (like on Flywheel Hosted)
563
- readfile($fh);
564
}
565
566
// remove the temp file
560
else
561
{
562
// use readfile() if fpassthru() is disabled (like on Flywheel Hosted)
563
+ readfile($filename);
564
}
565
566
// remove the temp file
adminpages/memberslist.php CHANGED
@@ -147,13 +147,17 @@
147
$initial_payments = pmpro_calculateInitialPaymentRevenue($s, $l);
148
$recurring_payments = pmpro_calculateRecurringRevenue($s, $l);
149
?>
150
- <p class="clear"><?php echo strval($totalrows)?> members found. These members have paid <strong>lt;?php echo number_format($initial_payments)?> in initial payments</strong> and will generate an estimated <strong>lt;?php echo number_format($recurring_payments)?> in revenue over the next year</strong>, or <strong>lt;?php echo number_format($recurring_payments/12)?>/month</strong>. <span class="pmpro_lite">(This estimate does not take into account trial periods or billing limits.)</span></p>
151
<?php
152
}
153
else
154
{
155
?>
156
- <p class="clear"><?php printf(__("%d members found.", 'paid-memberships-pro' ), $totalrows);?></span></p>
157
<?php
158
}
159
}
@@ -168,7 +172,7 @@
168
<th><?php _e('Email', 'paid-memberships-pro' );?></th>
169
<?php do_action("pmpro_memberslist_extra_cols_header", $theusers);?>
170
<th><?php _e('Billing Address', 'paid-memberships-pro' );?></th>
171
- <th><?php _e('Membership', 'paid-memberships-pro' );?></th>
172
<th><?php _e('Fee', 'paid-memberships-pro' );?></th>
173
<th><?php _e('Joined', 'paid-memberships-pro' );?></th>
174
<th>
@@ -291,6 +295,17 @@
291
echo pmpro_getPaginationString($pn, $totalrows, $limit, 1, add_query_arg(array("s" => urlencode($s), "l" => $l, "limit" => $limit)));
292
?>
293
294
<?php
295
require_once(dirname(__FILE__) . "/admin_footer.php");
296
?>
147
$initial_payments = pmpro_calculateInitialPaymentRevenue($s, $l);
148
$recurring_payments = pmpro_calculateRecurringRevenue($s, $l);
149
?>
150
+ <br class="clear" />
151
+ <hr />
152
+ <p><?php echo strval($totalrows)?> members found. These members have paid <strong>lt;?php echo number_format($initial_payments)?> in initial payments</strong> and will generate an estimated <strong>lt;?php echo number_format($recurring_payments)?> in revenue over the next year</strong>, or <strong>lt;?php echo number_format($recurring_payments/12)?>/month</strong>. <span class="description">(This estimate does not take into account trial periods or billing limits.)</span></p>
153
<?php
154
}
155
else
156
{
157
?>
158
+ <br class="clear" />
159
+ <hr />
160
+ <p class="description"><?php printf(__("%d members found.", 'paid-memberships-pro' ), $totalrows);?></p>
161
<?php
162
}
163
}
172
<th><?php _e('Email', 'paid-memberships-pro' );?></th>
173
<?php do_action("pmpro_memberslist_extra_cols_header", $theusers);?>
174
<th><?php _e('Billing Address', 'paid-memberships-pro' );?></th>
175
+ <th><?php _e('Level', 'paid-memberships-pro' );?></th>
176
<th><?php _e('Fee', 'paid-memberships-pro' );?></th>
177
<th><?php _e('Joined', 'paid-memberships-pro' );?></th>
178
<th>
295
echo pmpro_getPaginationString($pn, $totalrows, $limit, 1, add_query_arg(array("s" => urlencode($s), "l" => $l, "limit" => $limit)));
296
?>
297
298
+ <?php if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
299
+ $allowed_pmprorh_html = array (
300
+ 'a' => array (
301
+ 'href' => array(),
302
+ 'target' => array(),
303
+ 'title' => array(),
304
+ ),
305
+ );
306
+ echo '<br /><p class="description">' . sprintf( wp_kses( __( 'Optional: Capture additional member profile fields using the <a href="%s" title="Paid Memberships Pro - Register Helper Add On" target="_blank">Register Helper Add On</a>.', 'paid-memberships-pro' ), $allowed_pmprorh_html ), 'https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/?utm_source=plugin&utm_medium=pmpro-memberslist&utm_campaign=add-ons&utm_content=pmpro-register-helper-add-checkout-and-profile-fields' ) . '</p>';
307
+ } ?>
308
+
309
<?php
310
require_once(dirname(__FILE__) . "/admin_footer.php");
311
?>
adminpages/orders-csv.php CHANGED
@@ -564,7 +564,7 @@ function pmpro_transmit_order_content( $csv_fh, $filename, $headers = array() )
564
if ( headers_sent() ) {
565
echo str_repeat( '-', 75 ) . "<br/>\n";
566
echo 'Please open a support case and paste in the warnings/errors you see above this text to\n ';
567
- echo 'the <a href="http://paidmembershipspro.com/support/?utm_source=plugin&utm_medium=banner&utm_campaign=orders_csv" target="_blank">Paid Memberships Pro support forum</a><br/>\n';
568
echo str_repeat( "=", 75 ) . "<br/>\n";
569
echo file_get_contents( $filename );
570
echo str_repeat( "=", 75 ) . "<br/>\n";
@@ -595,7 +595,7 @@ function pmpro_transmit_order_content( $csv_fh, $filename, $headers = array() )
595
else
596
{
597
// use readfile() if fpassthru() is disabled (like on Flywheel Hosted)
598
- readfile($fh);
599
}
600
601
// remove the temp file
564
if ( headers_sent() ) {
565
echo str_repeat( '-', 75 ) . "<br/>\n";
566
echo 'Please open a support case and paste in the warnings/errors you see above this text to\n ';
567
+ echo 'the <a href="http://paidmembershipspro.com/support/?utm_source=plugin&utm_medium=pmpro-orders-csv&utm_campaign=support" target="_blank">Paid Memberships Pro support forum</a><br/>\n';
568
echo str_repeat( "=", 75 ) . "<br/>\n";
569
echo file_get_contents( $filename );
570
echo str_repeat( "=", 75 ) . "<br/>\n";
595
else
596
{
597
// use readfile() if fpassthru() is disabled (like on Flywheel Hosted)
598
+ readfile($filename);
599
}
600
601
// remove the temp file
adminpages/orders.php CHANGED
@@ -399,7 +399,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
399
if ( ! empty( $order->id ) ) {
400
echo $order->id;
401
} else {
402
- echo __( 'This will be generated when you save.', 'paid-memberships-pro' );
403
}
404
?>
405
</td>
@@ -417,8 +417,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
417
value="<?php echo esc_attr( $order->code ); ?>"/>
418
<?php } ?>
419
<?php if ( $order_id < 0 ) { ?>
420
- <small
421
- class="pmpro_lite"><?php _e( 'Randomly generated for you.', 'paid-memberships-pro' ); ?></small><?php } ?>
422
</td>
423
</tr>
424
@@ -634,8 +633,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
634
<input id="total" name="total" type="text" size="10"
635
value="<?php echo esc_attr( $order->total ); ?>"/>
636
<?php } ?>
637
- <small
638
- class="pmpro_lite"><?php _e( 'Should be subtotal + tax - couponamount.', 'paid-memberships-pro' ); ?></small>
639
</td>
640
</tr>
641
@@ -651,8 +649,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
651
<input id="payment_type" name="payment_type" type="text" size="50"
652
value="<?php echo esc_attr( $order->payment_type ); ?>"/>
653
<?php } ?>
654
- <small
655
- class="pmpro_lite"><?php _e( 'e.g. PayPal Express, PayPal Standard, Credit Card.', 'paid-memberships-pro' ); ?></small>
656
</td>
657
</tr>
658
<tr>
@@ -666,7 +663,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
666
<input id="cardtype" name="cardtype" type="text" size="50"
667
value="<?php echo esc_attr( $order->cardtype ); ?>"/>
668
<?php } ?>
669
- <small class="pmpro_lite"><?php _e( 'e.g. Visa, MasterCard, AMEX, etc', 'paid-memberships-pro' ); ?></small>
670
</td>
671
</tr>
672
<tr>
@@ -681,7 +678,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
681
<input id="accountnumber" name="accountnumber" type="text" size="50"
682
value="<?php echo esc_attr( $order->accountnumber ); ?>"/>
683
<?php } ?>
684
- <small class="pmpro_lite"><?php _e( 'Obscure all but last 4 digits.', 'paid-memberships-pro' ); ?></small>
685
</td>
686
</tr>
687
<?php
@@ -695,7 +692,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
695
<td>
696
<input id="expirationmonth" name="expirationmonth" type="text" size="10"
697
value="<?php echo esc_attr( $order->expirationmonth ); ?>"/>
698
- <small class="pmpro_lite">MM</small>
699
</td>
700
</tr>
701
<tr>
@@ -704,7 +701,7 @@ if ( function_exists( 'pmpro_add_email_order_modal' ) ) {
704
<td>
705
<input id="expirationyear" name="expirationyear" type="text" size="10"
706
value="<?php echo esc_attr( $order->expirationyear ); ?>"/>
707
- <small class="pmpro_lite">YYYY</small>
708
</td>
709
</tr>
710
<?php } ?>
@@ -789,8 +786,7 @@ selected="selected"<?php } ?>><?php _e( 'Live/Production', 'paid-memberships-pro
789
<input id="payment_transaction_id" name="payment_transaction_id" type="text" size="50"
790
value="<?php echo esc_attr( $order->payment_transaction_id ); ?>"/>
791
<?php } ?>
792
- <small
793
- class="pmpro_lite"><?php _e( 'Generated by the gateway. Useful to cross reference orders.', 'paid-memberships-pro' ); ?></small>
794
</td>
795
</tr>
796
<tr>
@@ -806,8 +802,7 @@ selected="selected"<?php } ?>><?php _e( 'Live/Production', 'paid-memberships-pro
806
<input id="subscription_transaction_id" name="subscription_transaction_id" type="text" size="50"
807
value="<?php echo esc_attr( $order->subscription_transaction_id ); ?>"/>
808
<?php } ?>
809
- <small
810
- class="pmpro_lite"><?php _e( 'Generated by the gateway. Useful to cross reference subscriptions.', 'paid-memberships-pro' ); ?></small>
811
</td>
812
</tr>
813
@@ -1306,9 +1301,9 @@ selected="selected"<?php } ?>><?php echo date_i18n( 'M', strtotime( $i . '/1/' .
1306
<tr class="thead">
1307
<th><?php _e( 'ID', 'paid-memberships-pro' ); ?></th>
1308
<th><?php _e( 'Code', 'paid-memberships-pro' ); ?></th>
1309
- <th><?php _e( 'User', 'paid-memberships-pro' ); ?></th>
1310
<?php do_action( 'pmpro_orders_extra_cols_header', $order_ids ); ?>
1311
- <th><?php _e( 'Membership Level', 'paid-memberships-pro' ); ?></th>
1312
<th><?php _e( 'Total', 'paid-memberships-pro' ); ?></th>
1313
<th><?php _e( 'Payment', 'paid-memberships-pro' ); ?></th>
1314
<th><?php _e( 'Gateway', 'paid-memberships-pro' ); ?></th>
@@ -1334,18 +1329,8 @@ class="alternate"<?php } ?>>
1334
<td>
1335
<a href="admin.php?page=pmpro-orders&order=<?php echo $order->id; ?>"><?php echo $order->id; ?></a>
1336
</td>
1337
- <td>
1338
<a href="admin.php?page=pmpro-orders&order=<?php echo $order->id; ?>"><?php echo $order->code; ?></a>
1339
- </td>
1340
- <td class="username column-username has-row-actions">
1341
- <?php $order->getUser(); ?>
1342
- <?php if ( ! empty( $order->user ) ) { ?>
1343
- <a href="user-edit.php?user_id=<?php echo $order->user->ID; ?>"><?php echo $order->user->user_login; ?></a>
1344
- <?php } elseif ( $order->user_id > 0 ) { ?>
1345
- [<?php _e( 'deleted', 'paid-memberships-pro' ); ?>]
1346
- <?php } else { ?>
1347
- [<?php _e( 'none', 'paid-memberships-pro' ); ?>]
1348
- <?php } ?>
1349
<br />
1350
<div class="row-actions">
1351
<span class="edit">
@@ -1381,8 +1366,23 @@ class="alternate"<?php } ?>>
1381
?>
1382
</div>
1383
</td>
1384
<?php do_action( 'pmpro_orders_extra_cols_body', $order ); ?>
1385
- <td><?php echo $order->membership_id; ?></td>
1386
<td><?php echo pmpro_formatPrice( $order->total ); ?></td>
1387
<td>
1388
<?php
399
if ( ! empty( $order->id ) ) {
400
echo $order->id;
401
} else {
402
+ echo '<p class="description">' . __( 'This will be generated when you save.', 'paid-memberships-pro' ) . '</p>';
403
}
404
?>
405
</td>
417
value="<?php echo esc_attr( $order->code ); ?>"/>
418
<?php } ?>
419
<?php if ( $order_id < 0 ) { ?>
420
+ <p class="description"><?php _e( 'Randomly generated for you.', 'paid-memberships-pro' ); ?></p><?php } ?>
421
</td>
422
</tr>
423
633
<input id="total" name="total" type="text" size="10"
634
value="<?php echo esc_attr( $order->total ); ?>"/>
635
<?php } ?>
636
+ <p class="description"><?php _e( 'Should be subtotal + tax - couponamount.', 'paid-memberships-pro' ); ?></p>
637
</td>
638
</tr>
639
649
<input id="payment_type" name="payment_type" type="text" size="50"
650
value="<?php echo esc_attr( $order->payment_type ); ?>"/>
651
<?php } ?>
652
+ <p class="description"><?php _e( 'e.g. PayPal Express, PayPal Standard, Credit Card.', 'paid-memberships-pro' ); ?></p>
653
</td>
654
</tr>
655
<tr>
663
<input id="cardtype" name="cardtype" type="text" size="50"
664
value="<?php echo esc_attr( $order->cardtype ); ?>"/>
665
<?php } ?>
666
+ <p class="description"><?php _e( 'e.g. Visa, MasterCard, AMEX, etc', 'paid-memberships-pro' ); ?></p>
667
</td>
668
</tr>
669
<tr>
678
<input id="accountnumber" name="accountnumber" type="text" size="50"
679
value="<?php echo esc_attr( $order->accountnumber ); ?>"/>
680
<?php } ?>
681
+ <p class="description"><?php _e( 'Obscure all but last 4 digits.', 'paid-memberships-pro' ); ?></p>
682
</td>
683
</tr>
684
<?php
692
<td>
693
<input id="expirationmonth" name="expirationmonth" type="text" size="10"
694
value="<?php echo esc_attr( $order->expirationmonth ); ?>"/>
695
+ <span class="description">MM</span>
696
</td>
697
</tr>
698
<tr>
701
<td>
702
<input id="expirationyear" name="expirationyear" type="text" size="10"
703
value="<?php echo esc_attr( $order->expirationyear ); ?>"/>
704
+ <span class="description">YYYY</span>
705
</td>
706
</tr>
707
<?php } ?>
786
<input id="payment_transaction_id" name="payment_transaction_id" type="text" size="50"
787
value="<?php echo esc_attr( $order->payment_transaction_id ); ?>"/>
788
<?php } ?>
789
+ <p class="description"><?php _e( 'Generated by the gateway. Useful to cross reference orders.', 'paid-memberships-pro' ); ?></p>
790
</td>
791
</tr>
792
<tr>
802
<input id="subscription_transaction_id" name="subscription_transaction_id" type="text" size="50"
803
value="<?php echo esc_attr( $order->subscription_transaction_id ); ?>"/>
804
<?php } ?>
805
+ <p class="description"><?php _e( 'Generated by the gateway. Useful to cross reference subscriptions.', 'paid-memberships-pro' ); ?></p>
806
</td>
807
</tr>
808
1301
<tr class="thead">
1302
<th><?php _e( 'ID', 'paid-memberships-pro' ); ?></th>
1303
<th><?php _e( 'Code', 'paid-memberships-pro' ); ?></th>
1304
+ <th><?php _e( 'Username', 'paid-memberships-pro' ); ?></th>
1305
<?php do_action( 'pmpro_orders_extra_cols_header', $order_ids ); ?>
1306
+ <th><?php _e( 'Level', 'paid-memberships-pro' ); ?></th>
1307
<th><?php _e( 'Total', 'paid-memberships-pro' ); ?></th>
1308
<th><?php _e( 'Payment', 'paid-memberships-pro' ); ?></th>
1309
<th><?php _e( 'Gateway', 'paid-memberships-pro' ); ?></th>
1329
<td>
1330
<a href="admin.php?page=pmpro-orders&order=<?php echo $order->id; ?>"><?php echo $order->id; ?></a>
1331
</td>
1332
+ <td class="order_code column-order_code has-row-actions">
1333
<a href="admin.php?page=pmpro-orders&order=<?php echo $order->id; ?>"><?php echo $order->code; ?></a>
1334
<br />
1335
<div class="row-actions">
1336
<span class="edit">
1366
?>
1367
</div>
1368
</td>
1369
+ <td class="username column-username">
1370
+ <?php $order->getUser(); ?>
1371
+ <?php if ( ! empty( $order->user ) ) { ?>
1372
+ <a href="user-edit.php?user_id=<?php echo $order->user->ID; ?>"><?php echo $order->user->user_login; ?></a>
1373
+ <?php } elseif ( $order->user_id > 0 ) { ?>
1374
+ [<?php _e( 'deleted', 'paid-memberships-pro' ); ?>]
1375
+ <?php } else { ?>
1376
+ [<?php _e( 'none', 'paid-memberships-pro' ); ?>]
1377
+ <?php } ?>
1378
+ </td>
1379
<?php do_action( 'pmpro_orders_extra_cols_body', $order ); ?>
1380
+ <td>
1381
+ <?php
1382
+ $level = pmpro_getLevel( $order->membership_id );
1383
+ echo $level->name;
1384
+ ?>
1385
+ </td>
1386
<td><?php echo pmpro_formatPrice( $order->total ); ?></td>
1387
<td>
1388
<?php
adminpages/pagesettings.php CHANGED
@@ -107,8 +107,20 @@ require_once(dirname(__FILE__) . "/admin_header.php");
107
<?php wp_nonce_field('savesettings', 'pmpro_pagesettings_nonce');?>
108
<h2><?php _e( 'Page Settings', 'paid-memberships-pro' ); ?></h2>
109
<?php
110
- global $pmpro_pages_ready;
111
- if ( $pmpro_pages_ready ) { ?>
112
<p><?php _e('Manage the WordPress pages assigned to each required Paid Memberships Pro page.', 'paid-memberships-pro' ); ?></p>
113
<?php } elseif( ! empty( $_REQUEST['manualpages'] ) ) { ?>
114
<p><?php _e('Assign the WordPress pages for each required Paid Memberships Pro page or', 'paid-memberships-pro' ); ?> <a
@@ -123,7 +135,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
123
</div> <!-- end pmpro-new-install -->
124
<?php } ?>
125
126
- <?php if ( ! empty( $pmpro_pages_ready ) || ! empty( $_REQUEST['manualpages'] ) ) { ?>
127
<table class="form-table">
128
<tbody>
129
<tr>
@@ -141,8 +153,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
141
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['account']); ?>"
142
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
143
<?php } ?>
144
- <br/>
145
- <small class="pmpro_lite"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_account].</small>
146
</td>
147
<tr>
148
<th scope="row" valign="top">
@@ -159,8 +170,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
159
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['billing']); ?>"
160
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
161
<?php } ?>
162
- <br/>
163
- <small class="pmpro_lite"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_billing].</small>
164
</td>
165
<tr>
166
<th scope="row" valign="top">
@@ -177,8 +187,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
177
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['cancel']); ?>"
178
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
179
<?php } ?>
180
- <br/>
181
- <small class="pmpro_lite"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_cancel].</small>
182
</td>
183
</tr>
184
<tr>
@@ -196,8 +205,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
196
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['checkout']); ?>"
197
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
198
<?php } ?>
199
- <br/>
200
- <small class="pmpro_lite"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_checkout].</small>
201
</td>
202
</tr>
203
<tr>
@@ -215,9 +223,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
215
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['confirmation']); ?>"
216
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
217
<?php } ?>
218
- <br/>
219
- <small class="pmpro_lite"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_confirmation].
220
- </small>
221
</td>
222
</tr>
223
<tr>
@@ -235,8 +241,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
235
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['invoice']); ?>"
236
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
237
<?php } ?>
238
- <br/>
239
- <small class="pmpro_lite"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_invoice].</small>
240
</td>
241
</tr>
242
<tr>
@@ -254,8 +259,18 @@ require_once(dirname(__FILE__) . "/admin_header.php");
254
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['levels']); ?>"
255
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
256
<?php } ?>
257
- <br/>
258
- <small class="pmpro_lite"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_levels].</small>
259
</td>
260
</tr>
261
</tbody>
@@ -301,8 +316,7 @@ require_once(dirname(__FILE__) . "/admin_header.php");
301
<a href="<?php echo wp_nonce_url( add_query_arg( array( 'page' => 'pmpro-pagesettings', 'createpages' => 1, 'page_name' => esc_attr( $name ) ), admin_url('admin.php') ), 'createpages', 'pmpro_pagesettings_nonce' ); ?>"><?php _e('Generate Page', 'paid-memberships-pro' ); ?></a>
302
<?php } ?>
303
<?php if(!empty($hint)) { ?>
304
- <br/>
305
- <small class="pmpro_lite"><?php echo $hint;?></small>
306
<?php } ?>
307
</td>
308
</tr>
107
<?php wp_nonce_field('savesettings', 'pmpro_pagesettings_nonce');?>
108
<h2><?php _e( 'Page Settings', 'paid-memberships-pro' ); ?></h2>
109
<?php
110
+ // check if we have all pages
111
+ if ( $pmpro_pages['account'] ||
112
+ $pmpro_pages['billing'] ||
113
+ $pmpro_pages['cancel'] ||
114
+ $pmpro_pages['checkout'] ||
115
+ $pmpro_pages['confirmation'] ||
116
+ $pmpro_pages['invoice'] ||
117
+ $pmpro_pages['levels'] ) {
118
+ $pmpro_some_pages_ready = true;
119
+ } else {
120
+ $pmpro_some_pages_ready = false;
121
+ }
122
+
123
+ if ( $pmpro_some_pages_ready ) { ?>
124
<p><?php _e('Manage the WordPress pages assigned to each required Paid Memberships Pro page.', 'paid-memberships-pro' ); ?></p>
125
<?php } elseif( ! empty( $_REQUEST['manualpages'] ) ) { ?>
126
<p><?php _e('Assign the WordPress pages for each required Paid Memberships Pro page or', 'paid-memberships-pro' ); ?> <a
135
</div> <!-- end pmpro-new-install -->
136
<?php } ?>
137
138
+ <?php if ( ! empty( $pmpro_some_pages_ready ) || ! empty( $_REQUEST['manualpages'] ) ) { ?>
139
<table class="form-table">
140
<tbody>
141
<tr>
153
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['account']); ?>"
154
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
155
<?php } ?>
156
+ <p class="description"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_account] <?php _e('or the Membership Account block', 'paid-memberships-pro' ); ?>.</p>
157
</td>
158
<tr>
159
<th scope="row" valign="top">
170
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['billing']); ?>"
171
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
172
<?php } ?>
173
+ <p class="description"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_billing] <?php _e('or the Membership Billing block', 'paid-memberships-pro' ); ?>.</p>
174
</td>
175
<tr>
176
<th scope="row" valign="top">
187
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['cancel']); ?>"
188
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
189
<?php } ?>
190
+ <p class="description"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_cancel] <?php _e('or the Membership Cancel block', 'paid-memberships-pro' ); ?>.</p>
191
</td>
192
</tr>
193
<tr>
205
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['checkout']); ?>"
206
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
207
<?php } ?>
208
+ <p class="description"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_checkout] <?php _e('or the Membership Checkout block', 'paid-memberships-pro' ); ?>.</p>
209
</td>
210
</tr>
211
<tr>
223
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['confirmation']); ?>"
224
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
225
<?php } ?>
226
+ <p class="description"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_confirmation] <?php _e('or the Membership Confirmation block', 'paid-memberships-pro' ); ?>.</p>
227
</td>
228
</tr>
229
<tr>
241
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['invoice']); ?>"
242
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
243
<?php } ?>
244
+ <p class="description"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_invoice] <?php _e('or the Membership Invoice block', 'paid-memberships-pro' ); ?>.</p>
245
</td>
246
</tr>
247
<tr>
259
<a target="_blank" href="<?php echo get_permalink($pmpro_pages['levels']); ?>"
260
class="button button-secondary pmpro_page_view"><?php _e('view page', 'paid-memberships-pro' ); ?></a>
261
<?php } ?>
262
+ <p class="description"><?php _e('Include the shortcode', 'paid-memberships-pro' ); ?> [pmpro_levels] <?php _e('or the Membership Levels block', 'paid-memberships-pro' ); ?>.</p>
263
+
264
+ <?php if ( ! function_exists( 'pmpro_advanced_levels_shortcode' ) ) {
265
+ $allowed_advanced_levels_html = array (
266
+ 'a' => array (
267
+ 'href' => array(),
268
+ 'target' => array(),
269
+ 'title' => array(),
270
+ ),
271
+ );
272
+ echo '<br /><p class="description">' . sprintf( wp_kses( __( 'Optional: Customize your Membership Levels page using the <a href="%s" title="Paid Memberships Pro - Advanced Levels Page Add On" target="_blank">Advanced Levels Page Add On</a>.', 'paid-memberships-pro' ), $allowed_advanced_levels_html ), 'https://www.paidmembershipspro.com/add-ons/pmpro-advanced-levels-shortcode/?utm_source=plugin&utm_medium=pmpro-pagesettings&utm_campaign=add-ons&utm_content=pmpro-advanced-levels-shortcode' ) . '</p>';
273
+ } ?>
274
</td>
275
</tr>
276
</tbody>
316
<a href="<?php echo wp_nonce_url( add_query_arg( array( 'page' => 'pmpro-pagesettings', 'createpages' => 1, 'page_name' => esc_attr( $name ) ), admin_url('admin.php') ), 'createpages', 'pmpro_pagesettings_nonce' ); ?>"><?php _e('Generate Page', 'paid-memberships-pro' ); ?></a>
317
<?php } ?>
318
<?php if(!empty($hint)) { ?>
319
+ <p class="description"><?php echo $hint;?></p>
320
<?php } ?>
321
</td>
322
</tr>
adminpages/paymentsettings.php CHANGED
@@ -109,13 +109,14 @@
109
110
<h2><?php _e('Payment Gateway', 'paid-memberships-pro' );?> &amp; <?php _e('SSL Settings', 'paid-memberships-pro' );?></h2>
111
112
- <p><?php _e('Learn more about <a title="Paid Memberships Pro - SSL Settings" target="_blank" href="https://www.paidmembershipspro.com/documentation/initial-plugin-setup/ssl/">SSL</a> or <a title="Paid Memberships Pro - Payment Gateway Settings" target="_blank" href="https://www.paidmembershipspro.com/documentation/initial-plugin-setup/step-3-payment-gateway-security/">Payment Gateway Settings</a>.', 'paid-memberships-pro' ); ?></p>
113
114
<table class="form-table">
115
<tbody>
116
<tr class="pmpro_settings_divider">
117
<td colspan="2">
118
- <?php _e('Choose a Gateway', 'paid-memberships-pro' ); ?>
119
</td>
120
</tr>
121
<tr>
@@ -135,7 +136,7 @@
135
?>
136
</select>
137
<?php if( pmpro_onlyFreeLevels() ) { ?>
138
- <div id='pmpro-default-gateway-message' style="display:none;"><small><?php echo __( 'This gateway is for membership sites with Free levels or for sites that accept payment offline.', 'paid-memberships-pro' ) . '<br/>' . __( 'It is not connected to a live gateway environment and cannot accept payments.', 'paid-memberships-pro' ); ?></small></div>
139
<?php } ?>
140
</td>
141
</tr>
@@ -179,7 +180,8 @@
179
180
<tr class="pmpro_settings_divider">
181
<td colspan="2">
182
- <?php _e('Currency and Tax Settings', 'paid-memberships-pro' ); ?>
183
</td>
184
</tr>
185
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("currency"));?>" <?php if(!empty($gateway) && $gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard" && $gateway != "braintree" && $gateway != "twocheckout" && $gateway != "cybersource" && $gateway != "payflowpro" && $gateway != "stripe" && $gateway != "authorizenet" && $gateway != "gourl") { ?>style="display: none;"<?php } ?>>
@@ -200,7 +202,7 @@
200
}
201
?>
202
</select>
203
- <small><?php _e( 'Not all currencies will be supported by every gateway. Please check with your gateway.', 'paid-memberships-pro' ); ?></small>
204
</td>
205
</tr>
206
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("accepted_credit_cards"));?>" <?php if(!empty($gateway) && $gateway != "authorizenet" && $gateway != "paypal" && $gateway != "stripe" && $gateway != "payflowpro" && $gateway != "braintree" && $gateway != "twocheckout" && $gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
@@ -219,20 +221,21 @@
219
</tr>
220
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("tax_rate"));?>" <?php if(!empty($gateway) && $gateway != "stripe" && $gateway != "authorizenet" && $gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "check" && $gateway != "paypalstandard" && $gateway != "payflowpro" && $gateway != "braintree" && $gateway != "twocheckout" && $gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
221
<th scope="row" valign="top">
222
- <label for="tax"><?php _e('Sales Tax', 'paid-memberships-pro' );?> <small>(<?php _e('optional', 'paid-memberships-pro' );?>)</small></label>
223
</th>
224
<td>
225
<?php _e('Tax State', 'paid-memberships-pro' );?>:
226
- <input type="text" id="tax_state" name="tax_state" size="4" value="<?php echo esc_attr($tax_state)?>" /> <small>(<?php _e('abbreviation, e.g. "PA"', 'paid-memberships-pro' );?>)</small>
227
&nbsp; <?php _e('Tax Rate', 'paid-memberships-pro' ); ?>:
228
- <input type="text" id="tax_rate" name="tax_rate" size="10" value="<?php echo esc_attr($tax_rate)?>" /> <small>(<?php _e('decimal, e.g. "0.06"', 'paid-memberships-pro' );?>)</small>
229
- <p><small><?php _e('US only. If values are given, tax will be applied for any members ordering from the selected state.<br />For non-US or more complex tax rules, use the <a target="_blank" href="https://www.paidmembershipspro.com/non-us-taxes-paid-memberships-pro/?utm_source=plugin&utm_medium=banner&utm_campaign=payment_settings">pmpro_tax filter</a>.', 'paid-memberships-pro' );?></small></p>
230
</td>
231
</tr>
232
233
<tr class="pmpro_settings_divider">
234
<td colspan="2">
235
- <?php _e('SSL Settings', 'paid-memberships-pro' ); ?>
236
</td>
237
</tr>
238
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("use_ssl"));?>">
@@ -244,7 +247,7 @@
244
if( pmpro_check_site_url_for_https() ) {
245
//entire site is over HTTPS
246
?>
247
- <p><?php _e( 'Your Site URL starts with https:// and so PMPro will allow your entire site to be served over HTTPS.', 'paid-memberships-pro' ); ?></p>
248
<?php
249
} else {
250
//site is not over HTTPS, show setting
@@ -254,7 +257,7 @@
254
<option value="1" <?php if(!empty($use_ssl) && $use_ssl == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes', 'paid-memberships-pro' );?></option>
255
<option value="2" <?php if(!empty($use_ssl) && $use_ssl == 2) { ?>selected="selected"<?php } ?>><?php _e('Yes (with JavaScript redirects)', 'paid-memberships-pro' );?></option>
256
</select>
257
- <small><?php _e('Recommended: Yes. Try the JavaScript redirects setting if you are having issues with infinite redirect loops.', 'paid-memberships-pro' ); ?></small>
258
<?php
259
}
260
?>
@@ -266,7 +269,7 @@
266
</th>
267
<td>
268
<textarea id="sslseal" name="sslseal" rows="3" cols="80"><?php echo stripslashes(esc_textarea($sslseal))?></textarea>
269
- <br /><small><?php _e('Your <strong><a target="_blank" href="http://www.paidmembershipspro.com/documentation/initial-plugin-setup/ssl/?utm_source=plugin&utm_medium=banner&utm_campaign=payment_settings">SSL Certificate</a></strong> must be installed by your web host. Your <strong>SSL Seal</strong> will be a short HTML or JavaScript snippet that can be pasted here.', 'paid-memberships-pro' ); ?></small>
270
</td>
271
</tr>
272
<tr>
109
110
<h2><?php _e('Payment Gateway', 'paid-memberships-pro' );?> &amp; <?php _e('SSL Settings', 'paid-memberships-pro' );?></h2>
111
112
+ <p><?php _e('Learn more about <a title="Paid Memberships Pro - SSL Settings" target="_blank" href="https://www.paidmembershipspro.com/documentation/initial-plugin-setup/ssl/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=documentation&utm_content=ssl&utm_term=link1">SSL</a> or <a title="Paid Memberships Pro - Payment Gateway Settings" target="_blank" href="https://www.paidmembershipspro.com/documentation/initial-plugin-setup/step-3-payment-gateway-security/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=documentation&utm_content=step-3-payment-gateway-security">Payment Gateway Settings</a>.', 'paid-memberships-pro' ); ?></p>
113
114
<table class="form-table">
115
<tbody>
116
<tr class="pmpro_settings_divider">
117
<td colspan="2">
118
+ <hr />
119
+ <h3><?php _e('Choose a Gateway', 'paid-memberships-pro' ); ?></h3>
120
</td>
121
</tr>
122
<tr>
136
?>
137
</select>
138
<?php if( pmpro_onlyFreeLevels() ) { ?>
139
+ <div id="pmpro-default-gateway-message" style="display:none;"><p class="description"><?php echo __( 'This gateway is for membership sites with Free levels or for sites that accept payment offline.', 'paid-memberships-pro' ) . '<br/>' . __( 'It is not connected to a live gateway environment and cannot accept payments.', 'paid-memberships-pro' ); ?></p></div>
140
<?php } ?>
141
</td>
142
</tr>
180
181
<tr class="pmpro_settings_divider">
182
<td colspan="2">
183
+ <hr />
184
+ <h3><?php _e('Currency and Tax Settings', 'paid-memberships-pro' ); ?></h3>
185
</td>
186
</tr>
187
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("currency"));?>" <?php if(!empty($gateway) && $gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard" && $gateway != "braintree" && $gateway != "twocheckout" && $gateway != "cybersource" && $gateway != "payflowpro" && $gateway != "stripe" && $gateway != "authorizenet" && $gateway != "gourl") { ?>style="display: none;"<?php } ?>>
202
}
203
?>
204
</select>
205
+ <p class="description"><?php _e( 'Not all currencies will be supported by every gateway. Please check with your gateway.', 'paid-memberships-pro' ); ?></p>
206
</td>
207
</tr>
208
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("accepted_credit_cards"));?>" <?php if(!empty($gateway) && $gateway != "authorizenet" && $gateway != "paypal" && $gateway != "stripe" && $gateway != "payflowpro" && $gateway != "braintree" && $gateway != "twocheckout" && $gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
221
</tr>
222
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("tax_rate"));?>" <?php if(!empty($gateway) && $gateway != "stripe" && $gateway != "authorizenet" && $gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "check" && $gateway != "paypalstandard" && $gateway != "payflowpro" && $gateway != "braintree" && $gateway != "twocheckout" && $gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
223
<th scope="row" valign="top">
224
+ <label for="tax"><?php _e('Sales Tax', 'paid-memberships-pro' );?> (<?php _e('optional', 'paid-memberships-pro' );?>)</label>
225
</th>
226
<td>
227
<?php _e('Tax State', 'paid-memberships-pro' );?>:
228
+ <input type="text" id="tax_state" name="tax_state" size="4" value="<?php echo esc_attr($tax_state)?>" /> (<?php _e('abbreviation, e.g. "PA"', 'paid-memberships-pro' );?>)
229
&nbsp; <?php _e('Tax Rate', 'paid-memberships-pro' ); ?>:
230
+ <input type="text" id="tax_rate" name="tax_rate" size="10" value="<?php echo esc_attr($tax_rate)?>" /> (<?php _e('decimal, e.g. "0.06"', 'paid-memberships-pro' );?>)
231
+ <p class="description"><?php _e('US only. If values are given, tax will be applied for any members ordering from the selected state.<br />For non-US or more complex tax rules, use the <a target="_blank" href="https://www.paidmembershipspro.com/non-us-taxes-paid-memberships-pro/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=blog&utm_content=non-us-taxes-paid-memberships-pro">pmpro_tax filter</a>.', 'paid-memberships-pro' );?></p>
232
</td>
233
</tr>
234
235
<tr class="pmpro_settings_divider">
236
<td colspan="2">
237
+ <hr />
238
+ <h3><?php _e('SSL Settings', 'paid-memberships-pro' ); ?></h3>
239
</td>
240
</tr>
241
<tr class="gateway gateway_ <?php echo esc_attr(pmpro_getClassesForPaymentSettingsField("use_ssl"));?>">
247
if( pmpro_check_site_url_for_https() ) {
248
//entire site is over HTTPS
249
?>
250
+ <p class="description"><?php _e( 'Your Site URL starts with https:// and so PMPro will allow your entire site to be served over HTTPS.', 'paid-memberships-pro' ); ?></p>
251
<?php
252
} else {
253
//site is not over HTTPS, show setting
257
<option value="1" <?php if(!empty($use_ssl) && $use_ssl == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes', 'paid-memberships-pro' );?></option>
258
<option value="2" <?php if(!empty($use_ssl) && $use_ssl == 2) { ?>selected="selected"<?php } ?>><?php _e('Yes (with JavaScript redirects)', 'paid-memberships-pro' );?></option>
259
</select>
260
+ <p class="description"><?php _e('Recommended: Yes. Try the JavaScript redirects setting if you are having issues with infinite redirect loops.', 'paid-memberships-pro' ); ?></p>
261
<?php
262
}
263
?>
269
</th>
270
<td>
271
<textarea id="sslseal" name="sslseal" rows="3" cols="80"><?php echo stripslashes(esc_textarea($sslseal))?></textarea>
272
+ <p class="description"><?php _e('Your <strong><a target="_blank" href="https://www.paidmembershipspro.com/documentation/initial-plugin-setup/ssl/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=documentation&utm_content=ssl&utm_term=link2">SSL Certificate</a></strong> must be installed by your web host. Use this field to display your seal or other trusted merchant images. This field does not accept JavaScript.', 'paid-memberships-pro' ); ?></p>
273
</td>
274
</tr>
275
<tr>
blocks/blocks.php CHANGED
@@ -47,7 +47,7 @@ function pmpro_block_editor_scripts() {
47
wp_enqueue_script(
48
'pmpro-blocks-editor-js',
49
plugins_url( 'js/editor.blocks.js', PMPRO_BASE_FILE ),
50
- array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api', 'wp-editor'),
51
PMPRO_VERSION
52
);
53
@@ -59,4 +59,4 @@ function pmpro_block_editor_scripts() {
59
PMPRO_VERSION
60
);
61
}
62
- add_action( 'enqueue_block_editor_assets', 'pmpro_block_editor_scripts' );
47
wp_enqueue_script(
48
'pmpro-blocks-editor-js',
49
plugins_url( 'js/editor.blocks.js', PMPRO_BASE_FILE ),
50
+ array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api', 'wp-editor', 'pmpro_admin'),
51
PMPRO_VERSION
52
);
53
59
PMPRO_VERSION
60
);
61
}
62
+ add_action( 'enqueue_block_editor_assets', 'pmpro_block_editor_scripts' );
classes/class.pmproemail.php CHANGED
@@ -44,7 +44,7 @@
44
45
$this->headers = array("Content-Type: text/html");
46
47
- $this->attachments = NULL;
48
49
//load the template
50
$locale = apply_filters("plugin_locale", get_locale(), "paid-memberships-pro");
44
45
$this->headers = array("Content-Type: text/html");
46
47
+ $this->attachments = array();
48
49
//load the template
50
$locale = apply_filters("plugin_locale", get_locale(), "paid-memberships-pro");
classes/gateways/class.pmprogateway_authorizenet.php CHANGED
@@ -90,7 +90,8 @@
90
?>
91
<tr class="pmpro_settings_divider gateway gateway_authorizenet" <?php if($gateway != "authorizenet") { ?>style="display: none;"<?php } ?>>
92
<td colspan="2">
93
- <?php _e('Authorize.net Settings', 'paid-memberships-pro' ); ?>
94
</td>
95
</tr>
96
<tr class="gateway gateway_authorizenet" <?php if($gateway != "authorizenet") { ?>style="display: none;"<?php } ?>>
90
?>
91
<tr class="pmpro_settings_divider gateway gateway_authorizenet" <?php if($gateway != "authorizenet") { ?>style="display: none;"<?php } ?>>
92
<td colspan="2">
93
+ <hr />
94
+ <h3><?php _e('Authorize.net Settings', 'paid-memberships-pro' ); ?></h3>
95
</td>
96
</tr>
97
<tr class="gateway gateway_authorizenet" <?php if($gateway != "authorizenet") { ?>style="display: none;"<?php } ?>>
classes/gateways/class.pmprogateway_braintree.php CHANGED
@@ -303,7 +303,8 @@ use Braintree\WebhookNotification as Braintree_WebhookNotification;
303
?>
304
<tr class="pmpro_settings_divider gateway gateway_braintree" <?php if($gateway != "braintree") { ?>style="display: none;"<?php } ?>>
305
<td colspan="2">
306
- <?php _e('Braintree Settings', 'paid-memberships-pro' ); ?>
307
</td>
308
</tr>
309
<tr class="gateway gateway_braintree" <?php if($gateway != "braintree") { ?>style="display: none;"<?php } ?>>
303
?>
304
<tr class="pmpro_settings_divider gateway gateway_braintree" <?php if($gateway != "braintree") { ?>style="display: none;"<?php } ?>>
305
<td colspan="2">
306
+ <hr />
307
+ <h3><?php _e('Braintree Settings', 'paid-memberships-pro' ); ?></h3>
308
</td>
309
</tr>
310
<tr class="gateway gateway_braintree" <?php if($gateway != "braintree") { ?>style="display: none;"<?php } ?>>
classes/gateways/class.pmprogateway_check.php CHANGED
@@ -98,7 +98,8 @@
98
?>
99
<tr class="pmpro_settings_divider gateway gateway_check" <?php if($gateway != "check") { ?>style="display: none;"<?php } ?>>
100
<td colspan="2">
101
- <?php _e('Pay by Check Settings', 'paid-memberships-pro' ); ?>
102
</td>
103
</tr>
104
<tr class="gateway gateway_check" <?php if($gateway != "check") { ?>style="display: none;"<?php } ?>>
@@ -107,7 +108,7 @@
107
</th>
108
<td>
109
<textarea id="instructions" name="instructions" rows="3" cols="80"><?php echo wpautop( wp_unslash( $values['instructions'] ) ); ?></textarea>
110
- <p><small><?php _e('Who to write the check out to. Where to mail it. Shown on checkout, confirmation, and invoice pages.', 'paid-memberships-pro' );?></small></p>
111
</td>
112
</tr>
113
<?php
98
?>
99
<tr class="pmpro_settings_divider gateway gateway_check" <?php if($gateway != "check") { ?>style="display: none;"<?php } ?>>
100
<td colspan="2">
101
+ <hr />
102
+ <h3><?php _e('Pay by Check Settings', 'paid-memberships-pro' ); ?></h3>
103
</td>
104
</tr>
105
<tr class="gateway gateway_check" <?php if($gateway != "check") { ?>style="display: none;"<?php } ?>>
108
</th>
109
<td>
110
<textarea id="instructions" name="instructions" rows="3" cols="80"><?php echo wpautop( wp_unslash( $values['instructions'] ) ); ?></textarea>
111
+ <p class="description"><?php _e('Who to write the check out to. Where to mail it. Shown on checkout, confirmation, and invoice pages.', 'paid-memberships-pro' );?></p>
112
</td>
113
</tr>
114
<?php
classes/gateways/class.pmprogateway_cybersource.php CHANGED
@@ -80,12 +80,13 @@
80
?>
81
<tr class="pmpro_settings_divider gateway gateway_cybersource" <?php if($gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
82
<td colspan="2">
83
- <?php _e('CyberSource Settings', 'paid-memberships-pro' ); ?>
84
</td>
85
</tr>
86
<tr class="gateway gateway_cybersource" <?php if($gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
87
- <td colspan="2">
88
- <strong><?php _e('Note', 'paid-memberships-pro' );?>:</strong> <?php _e('This gateway option is in beta. Some functionality may not be available. Please contact Paid Memberships Pro with any issues you run into. <strong>Please be sure to upgrade Paid Memberships Pro to the latest versions when available.</strong>', 'paid-memberships-pro' );?>
89
</td>
90
</tr>
91
<tr class="gateway gateway_cybersource" <?php if($gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
80
?>
81
<tr class="pmpro_settings_divider gateway gateway_cybersource" <?php if($gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
82
<td colspan="2">
83
+ <hr />
84
+ <h3><?php _e('CyberSource Settings', 'paid-memberships-pro' ); ?></h3>
85
</td>
86
</tr>
87
<tr class="gateway gateway_cybersource" <?php if($gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
88
+ <td colspan="2" style="padding: 0px;">
89
+ <p class="pmpro_message"><?php _e('Note', 'paid-memberships-pro' );?>:</strong> <?php _e('This gateway option is in beta. Some functionality may not be available. Please contact Paid Memberships Pro with any issues you run into. <strong>Please be sure to upgrade Paid Memberships Pro to the latest versions when available.</strong>', 'paid-memberships-pro' );?></p>
90
</td>
91
</tr>
92
<tr class="gateway gateway_cybersource" <?php if($gateway != "cybersource") { ?>style="display: none;"<?php } ?>>
classes/gateways/class.pmprogateway_payflowpro.php CHANGED
@@ -92,7 +92,8 @@
92
?>
93
<tr class="pmpro_settings_divider gateway gateway_payflowpro" <?php if($gateway != "payflowpro") { ?>style="display: none;"<?php } ?>>
94
<td colspan="2">
95
- <?php _e('Payflow Pro Settings', 'paid-memberships-pro' ); ?>
96
</td>
97
</tr>
98
<tr class="gateway gateway_payflowpro" <?php if($gateway != "payflowpro") { ?>style="display: none;"<?php } ?>>
@@ -132,9 +133,17 @@
132
<label><?php _e('IPN Handler', 'paid-memberships-pro' );?>:</label>
133
</th>
134
<td>
135
- <p><?php
136
- $addon_url = "http://www.paidmembershipspro.com/add-ons/plugins-on-github/payflow-recurring-orders-addon/";
137
- printf(__('Payflow does not use IPN. To sync recurring subscriptions, please see <a target="_blank" href="%s">this addon</a>.', 'paid-memberships-pro' ), $addon_url);?>
138
</p>
139
</td>
140
</tr>
92
?>
93
<tr class="pmpro_settings_divider gateway gateway_payflowpro" <?php if($gateway != "payflowpro") { ?>style="display: none;"<?php } ?>>
94
<td colspan="2">
95
+ <hr />
96
+ <h3><?php _e('Payflow Pro Settings', 'paid-memberships-pro' ); ?></h3>
97
</td>
98
</tr>
99
<tr class="gateway gateway_payflowpro" <?php if($gateway != "payflowpro") { ?>style="display: none;"<?php } ?>>
133
<label><?php _e('IPN Handler', 'paid-memberships-pro' );?>:</label>
134
</th>
135
<td>
136
+ <p>
137
+ <?php
138
+ $allowed_message_html = array (
139
+ 'a' => array (
140
+ 'href' => array(),
141
+ 'target' => array(),
142
+ 'title' => array(),
143
+ ),
144
+ );
145
+ echo sprintf( wp_kses( __( 'Payflow does not use IPN. To sync recurring subscriptions, please see the <a target="_blank" href="%s" title="the Payflow Recurring Orders Add On">Payflow Recurring Orders Add On</a>.', 'paid-memberships-pro' ), $allowed_message_html ), 'https://www.paidmembershipspro.com/add-ons/payflow-recurring-orders-addon/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=add-ons&utm_content=payflow-recurring-orders-addon' );
146
+ ?>
147
</p>
148
</td>
149
</tr>
classes/gateways/class.pmprogateway_paypal.php CHANGED
@@ -128,12 +128,24 @@
128
?>
129
<tr class="pmpro_settings_divider gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
130
<td colspan="2">
131
- <?php _e('PayPal Settings', 'paid-memberships-pro' ); ?>
132
</td>
133
</tr>
134
<tr class="gateway gateway_paypalstandard" <?php if($gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
135
- <td colspan="2">
136
- <strong><?php _e('Note', 'paid-memberships-pro' );?>:</strong> <?php _e('We do not recommend using PayPal Standard. We suggest using PayPal Express, Website Payments Pro (Legacy), or PayPal Pro (Payflow Pro). <a target="_blank" href="http://www.paidmembershipspro.com/2013/09/read-using-paypal-standard-paid-memberships-pro/">More information on why can be found here.</a>', 'paid-memberships-pro' );?>
137
</td>
138
</tr>
139
<tr class="gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
128
?>
129
<tr class="pmpro_settings_divider gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
130
<td colspan="2">
131
+ <hr />
132
+ <h3><?php _e('PayPal Settings', 'paid-memberships-pro' ); ?></h3>
133
</td>
134
</tr>
135
<tr class="gateway gateway_paypalstandard" <?php if($gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
136
+ <td colspan="2" style="padding: 0px;">
137
+ <p class="pmpro_message">
138
+ <?php
139
+ $allowed_message_html = array (
140
+ 'a' => array (
141
+ 'href' => array(),
142
+ 'target' => array(),
143
+ 'title' => array(),
144
+ ),
145
+ );
146
+ echo sprintf( wp_kses( __( 'Note: We do not recommend using PayPal Standard. We suggest using PayPal Express, Website Payments Pro (Legacy), or PayPal Pro (Payflow Pro). <a target="_blank" href="%s" title="More information on why can be found here">More information on why can be found here</a>.', 'paid-memberships-pro' ), $allowed_message_html ), 'https://www.paidmembershipspro.com/read-using-paypal-standard-paid-memberships-pro/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=blog&utm_content=read-using-paypal-standard-paid-memberships-pro' );
147
+ ?>
148
+ </p>
149
</td>
150
</tr>
151
<tr class="gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
classes/gateways/class.pmprogateway_paypalexpress.php CHANGED
@@ -137,12 +137,24 @@
137
?>
138
<tr class="pmpro_settings_divider gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
139
<td colspan="2">
140
- <?php _e('PayPal Settings', 'paid-memberships-pro' ); ?>
141
</td>
142
</tr>
143
<tr class="gateway gateway_paypalstandard" <?php if($gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
144
- <td colspan="2">
145
- <strong><?php _e('Note', 'paid-memberships-pro' );?>:</strong> <?php _e('We do not recommend using PayPal Standard. We suggest using PayPal Express, Website Payments Pro (Legacy), or PayPal Pro (Payflow Pro). <a target="_blank" href="http://www.paidmembershipspro.com/2013/09/read-using-paypal-standard-paid-memberships-pro/">More information on why can be found here.</a>', 'paid-memberships-pro' );?>
146
</td>
147
</tr>
148
<tr class="gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
137
?>
138
<tr class="pmpro_settings_divider gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
139
<td colspan="2">
140
+ <hr />
141
+ <h3><?php _e('PayPal Settings', 'paid-memberships-pro' ); ?></h3>
142
</td>
143
</tr>
144
<tr class="gateway gateway_paypalstandard" <?php if($gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
145
+ <td colspan="2" style="padding: 0px;">
146
+ <p class="pmpro_message">
147
+ <?php
148
+ $allowed_message_html = array (
149
+ 'a' => array (
150
+ 'href' => array(),
151
+ 'target' => array(),
152
+ 'title' => array(),
153
+ ),
154
+ );
155
+ echo sprintf( wp_kses( __( 'Note: We do not recommend using PayPal Standard. We suggest using PayPal Express, Website Payments Pro (Legacy), or PayPal Pro (Payflow Pro). <a target="_blank" href="%s" title="More information on why can be found here">More information on why can be found here</a>.', 'paid-memberships-pro' ), $allowed_message_html ), 'https://www.paidmembershipspro.com/read-using-paypal-standard-paid-memberships-pro/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=blog&utm_content=read-using-paypal-standard-paid-memberships-pro' );
156
+ ?>
157
+ </p>
158
</td>
159
</tr>
160
<tr class="gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
classes/gateways/class.pmprogateway_paypalstandard.php CHANGED
@@ -129,12 +129,24 @@
129
?>
130
<tr class="pmpro_settings_divider gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
131
<td colspan="2">
132
- <?php _e('PayPal Settings', 'paid-memberships-pro' ); ?>
133
</td>
134
</tr>
135
<tr class="gateway gateway_paypalstandard" <?php if($gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
136
- <td colspan="2">
137
- <strong><?php _e('Note', 'paid-memberships-pro' );?>:</strong> <?php _e('We do not recommend using PayPal Standard. We suggest using PayPal Express, Website Payments Pro (Legacy), or PayPal Pro (Payflow Pro). <a target="_blank" href="http://www.paidmembershipspro.com/2013/09/read-using-paypal-standard-paid-memberships-pro/">More information on why can be found here.</a>', 'paid-memberships-pro' );?>
138
</td>
139
</tr>
140
<tr class="gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
129
?>
130
<tr class="pmpro_settings_divider gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
131
<td colspan="2">
132
+ <hr />
133
+ <h3><?php _e('PayPal Settings', 'paid-memberships-pro' ); ?></h3>
134
</td>
135
</tr>
136
<tr class="gateway gateway_paypalstandard" <?php if($gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
137
+ <td colspan="2" style="padding: 0px;">
138
+ <p class="pmpro_message">
139
+ <?php
140
+ $allowed_message_html = array (
141
+ 'a' => array (
142
+ 'href' => array(),
143
+ 'target' => array(),
144
+ 'title' => array(),
145
+ ),
146
+ );
147
+ echo sprintf( wp_kses( __( 'Note: We do not recommend using PayPal Standard. We suggest using PayPal Express, Website Payments Pro (Legacy), or PayPal Pro (Payflow Pro). <a target="_blank" href="%s" title="More information on why can be found here">More information on why can be found here</a>.', 'paid-memberships-pro' ), $allowed_message_html ), 'https://www.paidmembershipspro.com/read-using-paypal-standard-paid-memberships-pro/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=blog&utm_content=read-using-paypal-standard-paid-memberships-pro' );
148
+ ?>
149
+ </p>
150
</td>
151
</tr>
152
<tr class="gateway gateway_paypal gateway_paypalexpress gateway_paypalstandard" <?php if($gateway != "paypal" && $gateway != "paypalexpress" && $gateway != "paypalstandard") { ?>style="display: none;"<?php } ?>>
classes/gateways/class.pmprogateway_stripe.php CHANGED
@@ -294,8 +294,7 @@ class PMProGateway_stripe extends PMProGateway {
294
$public_key_prefix = substr( $values['stripe_publishablekey'], 0, 3 );
295
if ( ! empty( $values['stripe_publishablekey'] ) && $public_key_prefix != 'pk_' ) {
296
?>
297
- <br/><small
298
- class="pmpro_message pmpro_error"><?php _e( 'Your Publishable Key appears incorrect.', 'paid-memberships-pro' ); ?></small>
299
<?php
300
}
301
?>
@@ -322,7 +321,7 @@ class PMProGateway_stripe extends PMProGateway {
322
<option value="1"
323
<?php if ( ! empty( $values['stripe_billingaddress'] ) ) { ?>selected="selected"<?php } ?>><?php _e( 'Yes', 'paid-memberships-pro' ); ?></option>
324
</select>
325
- <small><?php _e( "Stripe doesn't require billing address fields. Choose 'No' to hide them on the checkout page.<br /><strong>If No, make sure you disable address verification in the Stripe dashboard settings.</strong>", 'paid-memberships-pro' ); ?></small>
326
</td>
327
</tr>
328
<tr class="gateway gateway_stripe" <?php if ( $gateway != "stripe" ) { ?>style="display: none;"<?php } ?>>
@@ -340,6 +339,20 @@ class PMProGateway_stripe extends PMProGateway {
340
<th><?php _e( 'Stripe API Version', 'paid-memberships-pro' ); ?>:</th>
341
<td><?php echo PMPRO_STRIPE_API_VERSION; ?></td>
342
</tr>
343
<?php
344
}
345
@@ -454,11 +467,6 @@ class PMProGateway_stripe extends PMProGateway {
454
$morder->subscription_transaction_id = sanitize_text_field( $_REQUEST['subscription_id'] );
455
}
456
457
- // Add the Source ID to the order.
458
- if ( ! empty ( $_REQUEST['source_id'] ) ) {
459
- $morder->source_id = sanitize_text_field( $_REQUEST['source_id'] );
460
- }
461
-
462
// Add the PaymentMethod ID to the order.
463
if ( ! empty ( $_REQUEST['payment_method_id'] ) ) {
464
$morder->payment_method_id = sanitize_text_field( $_REQUEST['payment_method_id'] );
@@ -1071,8 +1079,8 @@ class PMProGateway_stripe extends PMProGateway {
1071
function process( &$order ) {
1072
$steps = array(
1073
'set_customer',
1074
- 'set_source',
1075
- 'attach_source_to_customer',
1076
'process_charges',
1077
'process_subscriptions',
1078
);
@@ -1308,7 +1316,7 @@ class PMProGateway_stripe extends PMProGateway {
1308
try {
1309
$this->customer = Stripe_Customer::retrieve( $customer_id );
1310
// Update description.
1311
- if ( ! empty( $order->source_id ) ) {
1312
$this->customer->description = $name . " (" . $email . ")";
1313
$this->customer->email = $email;
1314
$this->customer->save();
@@ -1697,6 +1705,7 @@ class PMProGateway_stripe extends PMProGateway {
1697
//build order object
1698
$update_order = new MemberOrder();
1699
$update_order->setGateway( 'stripe' );
1700
$update_order->user_id = $user_id;
1701
$update_order->membership_id = $user_level->id;
1702
$update_order->membership_name = $user_level->name;
@@ -1705,6 +1714,7 @@ class PMProGateway_stripe extends PMProGateway {
1705
$update_order->ProfileStartDate = date_i18n( "Y-m-d", $end_timestamp );
1706
$update_order->BillingPeriod = $update['cycle_period'];
1707
$update_order->BillingFrequency = $update['cycle_number'];
1708
1709
//need filter to reset ProfileStartDate
1710
$profile_start_date = $update_order->ProfileStartDate;
@@ -1713,7 +1723,8 @@ class PMProGateway_stripe extends PMProGateway {
1713
}, 10, 2 );
1714
1715
//update subscription
1716
- $update_order->Gateway->subscribe( $update_order, false );
1717
1718
//update membership
1719
$sqlQuery = "UPDATE $wpdb->pmpro_memberships_users
@@ -1743,8 +1754,9 @@ class PMProGateway_stripe extends PMProGateway {
1743
1744
$steps = array(
1745
'set_customer',
1746
- 'set_source',
1747
- 'attach_source_to_customer',
1748
);
1749
1750
foreach ( $steps as $key => $step ) {
@@ -1759,6 +1771,41 @@ class PMProGateway_stripe extends PMProGateway {
1759
return true;
1760
1761
}
1762
1763
/**
1764
* Cancel a subscription at Stripe
@@ -1991,27 +2038,27 @@ class PMProGateway_stripe extends PMProGateway {
1991
}
1992
}
1993
1994
- function set_source( &$order, $force = false ) {
1995
- if ( ! empty( $this->source ) && ! $force ) {
1996
return true;
1997
}
1998
1999
- $source = $this->get_source( $order );
2000
2001
- if ( empty( $source ) ) {
2002
return false;
2003
}
2004
2005
- $this->source = $source;
2006
2007
return true;
2008
}
2009
2010
- function get_source( &$order ) {
2011
2012
if ( ! empty( $order->payment_method_id ) ) {
2013
try {
2014
- $source = Stripe_PaymentMethod::retrieve( $order->payment_method_id );
2015
} catch ( Stripe\Error\Base $e ) {
2016
$order->error = $e->getMessage();
2017
return false;
@@ -2024,11 +2071,11 @@ class PMProGateway_stripe extends PMProGateway {
2024
}
2025
}
2026
2027
- if ( empty( $source ) ) {
2028
return false;
2029
}
2030
2031
- return $source;
2032
}
2033
2034
function set_customer( &$order, $force = false ) {
@@ -2038,16 +2085,16 @@ class PMProGateway_stripe extends PMProGateway {
2038
$this->getCustomer( $order );
2039
}
2040
2041
- function attach_source_to_customer( &$order ) {
2042
2043
if ( ! empty( $this->customer->invoice_settings->default_payment_method ) &&
2044
- $this->customer->invoice_settings->default_payment_method === $this->source->id ) {
2045
return true;
2046
}
2047
2048
try {
2049
- $this->source->attach( [ 'customer' => $this->customer->id ] );
2050
- $this->customer->invoice_settings->default_payment_method = $this->source->id;
2051
$this->customer->save();
2052
} catch ( Stripe\Error\Base $e ) {
2053
$order->error = $e->getMessage();
@@ -2144,7 +2191,7 @@ class PMProGateway_stripe extends PMProGateway {
2144
2145
$params = array(
2146
'customer' => $this->customer->id,
2147
- 'payment_method' => $this->source->id,
2148
'amount' => $amount * $currency_unit_multiplier,
2149
'currency' => $pmpro_currency,
2150
'confirmation_method' => 'manual',
@@ -2255,16 +2302,16 @@ class PMProGateway_stripe extends PMProGateway {
2255
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
2256
}
2257
2258
- //convert to a profile start date
2259
$order->ProfileStartDate = date_i18n( "Y-m-d", strtotime( "+ " . $trial_period_days . " Day", current_time( "timestamp" ) ) ) . "T0:0:0";
2260
2261
- //filter the start date
2262
$order->ProfileStartDate = apply_filters( "pmpro_profile_start_date", $order->ProfileStartDate, $order );
2263
2264
- //convert back to days
2265
$trial_period_days = ceil( abs( strtotime( date_i18n( "Y-m-d" ), current_time( "timestamp" ) ) - strtotime( $order->ProfileStartDate, current_time( "timestamp" ) ) ) / 86400 );
2266
2267
- //for free trials, just push the start date of the subscription back
2268
if ( ! empty( $order->TrialBillingCycles ) && $order->TrialAmount == 0 ) {
2269
$trialOccurrences = (int) $order->TrialBillingCycles;
2270
if ( $order->BillingPeriod == "Year" ) {
@@ -2280,10 +2327,10 @@ class PMProGateway_stripe extends PMProGateway {
2280
2281
}
2282
2283
- // Save $trial_period_days to order for now too.
2284
$order->TrialPeriodDays = $trial_period_days;
2285
2286
- //create a plan
2287
try {
2288
$plan = array(
2289
"amount" => $amount * $currency_unit_multiplier,
@@ -2310,11 +2357,11 @@ class PMProGateway_stripe extends PMProGateway {
2310
2311
function create_subscription( &$order ) {
2312
2313
- //subscribe to the plan
2314
try {
2315
$params = array(
2316
'customer' => $this->customer->id,
2317
- 'default_payment_method' => $this->source,
2318
'items' => array(
2319
array( 'plan' => $order->code ),
2320
),
294
$public_key_prefix = substr( $values['stripe_publishablekey'], 0, 3 );
295
if ( ! empty( $values['stripe_publishablekey'] ) && $public_key_prefix != 'pk_' ) {
296
?>
297
+ <p class="pmpro_red"><strong><?php _e( 'Your Publishable Key appears incorrect.', 'paid-memberships-pro' ); ?></strong></p>
298
<?php
299
}
300
?>
321
<option value="1"
322
<?php if ( ! empty( $values['stripe_billingaddress'] ) ) { ?>selected="selected"<?php } ?>><?php _e( 'Yes', 'paid-memberships-pro' ); ?></option>
323
</select>
324
+ <p class="description"><?php _e( "Stripe doesn't require billing address fields. Choose 'No' to hide them on the checkout page.<br /><strong>If No, make sure you disable address verification in the Stripe dashboard settings.</strong>", 'paid-memberships-pro' ); ?></p>
325
</td>
326
</tr>
327
<tr class="gateway gateway_stripe" <?php if ( $gateway != "stripe" ) { ?>style="display: none;"<?php } ?>>
339
<th><?php _e( 'Stripe API Version', 'paid-memberships-pro' ); ?>:</th>
340
<td><?php echo PMPRO_STRIPE_API_VERSION; ?></td>
341
</tr>
342
+ <?php if ( ! function_exists( 'pmproappe_pmpro_valid_gateways' ) ) {
343
+ $allowed_appe_html = array (
344
+ 'a' => array (
345
+ 'href' => array(),
346
+ 'target' => array(),
347
+ 'title' => array(),
348
+ ),
349
+ );
350
+ echo '<tr class="gateway gateway_stripe"';
351
+ if ( $gateway != "stripe" ) {
352
+ echo ' style="display: none;"';
353
+ }
354
+ echo '><th>&nbsp;</th><td><p class="description">' . sprintf( wp_kses( __( 'Optional: Offer PayPal Express as an option at checkout using the <a target="_blank" href="%s" title="Paid Memberships Pro - Add PayPal Express Option at Checkout Add On">Add PayPal Express Add On</a>.', 'paid-memberships-pro' ), $allowed_appe_html ), 'https://www.paidmembershipspro.com/add-ons/plus-add-ons/pmpro-add-paypal-express-option-checkout/?utm_source=plugin&utm_medium=pmpro-paymentsettings&utm_campaign=add-ons&utm_content=pmpro-add-paypal-express-option-checkout' ) . '</p></td></tr>';
355
+ } ?>
356
<?php
357
}
358
467
$morder->subscription_transaction_id = sanitize_text_field( $_REQUEST['subscription_id'] );
468
}
469
470
// Add the PaymentMethod ID to the order.
471
if ( ! empty ( $_REQUEST['payment_method_id'] ) ) {
472
$morder->payment_method_id = sanitize_text_field( $_REQUEST['payment_method_id'] );
1079
function process( &$order ) {
1080
$steps = array(
1081
'set_customer',
1082
+ 'set_payment_method',
1083
+ 'attach_payment_method_to_customer',
1084
'process_charges',
1085
'process_subscriptions',
1086
);
1316
try {
1317
$this->customer = Stripe_Customer::retrieve( $customer_id );
1318
// Update description.
1319
+ if ( ! empty( $order->payment_method_id ) ) {
1320
$this->customer->description = $name . " (" . $email . ")";
1321
$this->customer->email = $email;
1322
$this->customer->save();
1705
//build order object
1706
$update_order = new MemberOrder();
1707
$update_order->setGateway( 'stripe' );
1708
+ $update_order->code = $update_order->getRandomCode();
1709
$update_order->user_id = $user_id;
1710
$update_order->membership_id = $user_level->id;
1711
$update_order->membership_name = $user_level->name;
1714
$update_order->ProfileStartDate = date_i18n( "Y-m-d", $end_timestamp );
1715
$update_order->BillingPeriod = $update['cycle_period'];
1716
$update_order->BillingFrequency = $update['cycle_number'];
1717
+ $update_order->getMembershipLevel();
1718
1719
//need filter to reset ProfileStartDate
1720
$profile_start_date = $update_order->ProfileStartDate;
1723
}, 10, 2 );
1724
1725
//update subscription
1726
+ $update_order->Gateway->set_customer( $update_order, true );
1727
+ $update_order->Gateway->process_subscriptions( $update_order );
1728
1729
//update membership
1730
$sqlQuery = "UPDATE $wpdb->pmpro_memberships_users
1754
1755
$steps = array(
1756
'set_customer',
1757
+ 'set_payment_method',
1758
+ 'attach_payment_method_to_customer',
1759
+ 'update_payment_method_for_subscriptions',
1760
);
1761
1762
foreach ( $steps as $key => $step ) {
1771
return true;
1772
1773
}
1774
+
1775
+ /**
1776
+ * Update the payment method for a subscription.
1777
+ */
1778
+ function update_payment_method_for_subscriptions( &$order ) {
1779
+ // get customer
1780
+ $this->getCustomer( $order );
1781
+
1782
+ if ( empty( $this->customer ) ) {
1783
+ return false;
1784
+ }
1785
+
1786
+ // get all subscriptions
1787
+ if ( ! empty( $this->customer->subscriptions ) ) {
1788
+ $subscriptions = $this->customer->subscriptions->all();
1789
+ }
1790
+
1791
+ foreach( $subscriptions as $subscription ) {
1792
+ // check if cancelled or expired
1793
+ if ( in_array( $subscription->status, array( 'canceled', 'incomplete', 'incomplete_expired' ) ) ) {
1794
+ continue;
1795
+ }
1796
+
1797
+ // check if we have a related order for it
1798
+ $one_order = new MemberOrder();
1799
+ $one_order->getLastMemberOrderBySubscriptionTransactionID( $subscription->id );
1800
+ if ( empty( $one_order ) || empty( $one_order->id ) ) {
1801
+ continue;
1802
+ }
1803
+
1804
+ // update the payment method
1805
+ $subscription->default_payment_method = $this->customer->invoice_settings->default_payment_method;
1806
+ $subscription->save();
1807
+ }
1808
+ }
1809
1810
/**
1811
* Cancel a subscription at Stripe
2038
}
2039
}
2040
2041
+ function set_payment_method( &$order, $force = false ) {
2042
+ if ( ! empty( $this->payment_method ) && ! $force ) {
2043
return true;
2044
}
2045
2046
+ $payment_method = $this->get_payment_method( $order );
2047
2048
+ if ( empty( $payment_method ) ) {