Paid Memberships Pro - Version 1.7.8.1

Version Description

  • Important fix for Braintree Payments users. Credit card information is now correctly updated in Braintree when users submit the form on the billing information page or checkout again on the site. (Thanks, Bryan Paronto and venrooy)
  • Updated Italian translation files. (Thanks, Angelo Giammarresi)
  • Fixed string wrapping in reports for translation.
  • Fixed PHP warning in membership stats report.
Download this release

Release Info

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

Code changes from version 1.7.14 to 1.7.8.1

Files changed (151) hide show
  1. adminpages/addons.php +1 -1
  2. adminpages/addons/images/pmpro-bbpress.jpg +0 -0
  3. adminpages/addons/images/pmpro-constant-contact.gif +0 -0
  4. adminpages/addons/images/pmpro-email-templates.gif +0 -0
  5. adminpages/addons/images/pmpro-woocommerce.gif +0 -0
  6. adminpages/addons/pmpro-addon-packages.php +1 -1
  7. adminpages/addons/pmpro-aweber.php +2 -2
  8. adminpages/addons/pmpro-bbpress.php +2 -3
  9. adminpages/addons/pmpro-constant-contact.php +0 -31
  10. adminpages/addons/pmpro-email-templates.php +0 -31
  11. adminpages/addons/pmpro-expiration.php +2 -2
  12. adminpages/addons/pmpro-infusionsoft.php +1 -1
  13. adminpages/addons/pmpro-mailchimp.php +1 -1
  14. adminpages/addons/pmpro-network-subsite.php +1 -1
  15. adminpages/addons/pmpro-post-affiliate-pro.php +1 -1
  16. adminpages/addons/pmpro-register-helper.php +1 -1
  17. adminpages/addons/pmpro-series.php +1 -1
  18. adminpages/addons/pmpro-shipping.php +1 -1
  19. adminpages/addons/pmpro-woocommerce.php +3 -4
  20. adminpages/addons/tml.php +1 -1
  21. adminpages/admin_header.php +1 -1
  22. adminpages/advancedsettings.php +5 -18
  23. adminpages/discountcodes.php +6 -6
  24. adminpages/emailsettings.php +170 -181
  25. adminpages/memberslist-csv.php +2 -2
  26. adminpages/memberslist.php +3 -3
  27. adminpages/orders-csv.php +8 -8
  28. adminpages/orders.php +11 -11
  29. adminpages/pagesettings.php +8 -8
  30. adminpages/reports/login.php +1 -1
  31. adminpages/reports/memberships.php +1 -1
  32. classes/class.memberorder.php +5 -27
  33. classes/class.pmproemail.php +14 -17
  34. classes/gateways/class.pmprogateway.php +2 -18
  35. classes/gateways/class.pmprogateway_authorizenet.php +2 -2
  36. classes/gateways/class.pmprogateway_braintree.php +2 -2
  37. classes/gateways/class.pmprogateway_check.php +2 -2
  38. classes/gateways/class.pmprogateway_cybersource.php +5 -5
  39. classes/gateways/class.pmprogateway_payflowpro.php +11 -14
  40. classes/gateways/class.pmprogateway_paypal.php +10 -12
  41. classes/gateways/class.pmprogateway_paypalexpress.php +11 -42
  42. classes/gateways/class.pmprogateway_paypalstandard.php +14 -30
  43. classes/gateways/class.pmprogateway_stripe.php +30 -71
  44. css/frontend.css +0 -2
  45. email/checkout_check.html +1 -1
  46. includes/adminpages.php +66 -147
  47. includes/content.php +41 -68
  48. includes/email.php +9 -11
  49. includes/filters.php +2 -2
  50. includes/functions.php +105 -134
  51. includes/init.php +1 -30
  52. includes/lib/Stripe/Stripe.php +0 -10
  53. includes/lib/Stripe/Stripe/Account.php +6 -5
  54. includes/lib/Stripe/Stripe/ApiRequestor.php +51 -153
  55. includes/lib/Stripe/Stripe/ApiResource.php +17 -51
  56. includes/lib/Stripe/Stripe/ApplicationFee.php +0 -53
  57. includes/lib/Stripe/Stripe/AttachedObject.php +0 -23
  58. includes/lib/Stripe/Stripe/Balance.php +0 -15
  59. includes/lib/Stripe/Stripe/BalanceTransaction.php +0 -39
  60. includes/lib/Stripe/Stripe/Card.php +0 -54
  61. includes/lib/Stripe/Stripe/CardError.php +2 -4
  62. includes/lib/Stripe/Stripe/Charge.php +7 -55
  63. includes/lib/Stripe/Stripe/Coupon.php +7 -24
  64. includes/lib/Stripe/Stripe/Customer.php +6 -61
  65. includes/lib/Stripe/Stripe/Error.php +7 -9
  66. includes/lib/Stripe/Stripe/Event.php +6 -12
  67. includes/lib/Stripe/Stripe/InvalidRequestError.php +2 -4
  68. includes/lib/Stripe/Stripe/Invoice.php +6 -30
  69. includes/lib/Stripe/Stripe/InvoiceItem.php +6 -24
  70. includes/lib/Stripe/Stripe/List.php +5 -25
  71. includes/lib/Stripe/Stripe/Object.php +12 -123
  72. includes/lib/Stripe/Stripe/Plan.php +6 -26
  73. includes/lib/Stripe/Stripe/Recipient.php +0 -75
  74. includes/lib/Stripe/Stripe/SingletonApiResource.php +0 -7
  75. includes/lib/Stripe/Stripe/Stripe.php +3 -49
  76. includes/lib/Stripe/Stripe/Subscription.php +0 -58
  77. includes/lib/Stripe/Stripe/Token.php +6 -12
  78. includes/lib/Stripe/Stripe/Transfer.php +6 -34
  79. includes/lib/Stripe/Stripe/Util.php +14 -42
  80. includes/login.php +2 -18
  81. includes/metaboxes.php +2 -2
  82. includes/profile.php +4 -4
  83. includes/services.php +1 -1
  84. includes/upgradecheck.php +1 -22
  85. languages/email/da_DK/admin_change.html +0 -7
  86. languages/email/da_DK/admin_change_admin.html +0 -5
  87. languages/email/da_DK/billing.html +0 -16
  88. languages/email/da_DK/billing_admin.html +0 -17
  89. languages/email/da_DK/billing_failure.html +0 -11
  90. languages/email/da_DK/billing_failure_admin.html +0 -11
  91. languages/email/da_DK/cancel.html +0 -3
  92. languages/email/da_DK/cancel_admin.html +0 -8
  93. languages/email/da_DK/checkout_check.html +0 -17
  94. languages/email/da_DK/checkout_check_admin.html +0 -17
  95. languages/email/da_DK/checkout_express.html +0 -14
  96. languages/email/da_DK/checkout_express_admin.html +0 -14
  97. languages/email/da_DK/checkout_free.html +0 -8
  98. languages/email/da_DK/checkout_free_admin.html +0 -8
  99. languages/email/da_DK/checkout_freetrial.html +0 -19
  100. languages/email/da_DK/checkout_freetrial_admin.html +0 -19
  101. languages/email/da_DK/checkout_paid.html +0 -23
  102. languages/email/da_DK/checkout_paid_admin.html +0 -23
  103. languages/email/da_DK/checkout_trial.html +0 -23
  104. languages/email/da_DK/checkout_trial_admin.html +0 -23
  105. languages/email/da_DK/credit_card_expiring.html +0 -13
  106. languages/email/da_DK/default.html +0 -1
  107. languages/email/da_DK/footer.html +0 -4
  108. languages/email/da_DK/header.html +0 -1
  109. languages/email/da_DK/invoice.html +0 -19
  110. languages/email/da_DK/membership_expired.html +0 -7
  111. languages/email/da_DK/membership_expiring.html +0 -6
  112. languages/email/da_DK/trial_ending.html +0 -8
  113. languages/pmpro-cs_CZ.mo +0 -0
  114. languages/pmpro-cs_CZ.po +0 -2889
  115. languages/pmpro-da_DK.mo +0 -0
  116. languages/pmpro-da_DK.po +0 -3502
  117. languages/pmpro-fr_FR.mo +0 -0
  118. languages/pmpro-fr_FR.po +3 -4
  119. languages/pmpro-it_IT.mo +0 -0
  120. languages/pmpro-it_IT.po +104 -231
  121. languages/pmpro-nb_NO.mo +0 -0
  122. languages/pmpro-nb_NO.po +0 -3279
  123. languages/pmpro-sk_SK.mo +0 -0
  124. languages/pmpro-sk_SK.po +0 -3826
  125. languages/pmpro-tr_TR.mo +0 -0
  126. languages/pmpro-tr_TR.po +0 -3470
  127. languages/pmpro.mo +0 -0
  128. languages/pmpro.po +288 -446
  129. languages/pmpro.pot +288 -446
  130. pages/account.php +2 -2
  131. pages/billing.php +2 -2
  132. pages/checkout.php +10 -14
  133. pages/confirmation.php +3 -3
  134. pages/invoice.php +2 -2
  135. pages/levels.php +5 -5
  136. paid-memberships-pro.php +9 -54
  137. preheaders/account.php +42 -37
  138. preheaders/billing.php +402 -372
  139. preheaders/cancel.php +40 -39
  140. preheaders/checkout.php +1090 -999
  141. preheaders/confirmation.php +12 -15
  142. preheaders/invoice.php +32 -32
  143. preheaders/levels.php +33 -32
  144. readme.txt +2 -79
  145. scheduled/crons.php +3 -3
  146. services/applydiscountcode.php +2 -8
  147. services/getfile.php +57 -5
  148. services/ipnhandler.php +20 -39
  149. services/stripe-webhook.php +17 -96
  150. services/twocheckout-ins.php +8 -12
  151. shortcodes/membership.php +2 -2
adminpages/addons.php CHANGED
@@ -1,6 +1,6 @@
1
<?php
2
//only admins can get this
3
- if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_addons")))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
1
<?php
2
//only admins can get this
3
+ if(!function_exists("current_user_can") || !current_user_can("manage_options"))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
adminpages/addons/images/pmpro-bbpress.jpg DELETED
Binary file
adminpages/addons/images/pmpro-constant-contact.gif DELETED
Binary file
adminpages/addons/images/pmpro-email-templates.gif DELETED
Binary file
adminpages/addons/images/pmpro-woocommerce.gif DELETED
Binary file
adminpages/addons/pmpro-addon-packages.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Addon Packages',
8
- 'version' => '.4.3',
9
'widget' => 'pmpro_addon_pmpro_addon_packages_widget',
10
'enabled' => function_exists('pmproap_post_meta')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Addon Packages',
8
+ 'version' => '.4.2',
9
'widget' => 'pmpro_addon_pmpro_addon_packages_widget',
10
'enabled' => function_exists('pmproap_post_meta')
11
)
adminpages/addons/pmpro-aweber.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro AWeber Integration',
8
- 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_aweber_widget',
10
'enabled' => function_exists('pmproaw_init')
11
)
@@ -19,7 +19,7 @@ function pmpro_addon_pmpro_aweber_widget($addon)
19
<p>Integrate User Registrations with AWeber. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-aweber/pmpro-aweber.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-aweber/pmpro-aweber.php'), 'activate-plugin_pmpro-aweber/pmpro-aweber.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro AWeber Integration',
8
+ 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_aweber_widget',
10
'enabled' => function_exists('pmproaw_init')
11
)
19
<p>Integrate User Registrations with AWeber. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-aweber/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-aweber/pmpro-aweber.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-aweber/pmpro-aweber.php'), 'activate-plugin_pmpro-aweber/pmpro-aweber.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
adminpages/addons/pmpro-bbpress.php CHANGED
@@ -5,16 +5,15 @@
5
*/
6
pmpro_add_addon('repo', array(
7
'title' => 'PMPro bbPress',
8
- 'version' => '1.0.1',
9
'widget' => 'pmpro_addon_pmpro_bbpress_widget',
10
- 'enabled' => function_exists('pmprobbp_add_meta_box')
11
)
12
);
13
14
function pmpro_addon_pmpro_bbpress_widget($addon)
15
{
16
?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-bbpress.jpg" />
18
<div class="info">
19
<p>Locking down bbPress Forums by Membership Level and Forum ID.</p>
20
<div class="actions">
5
*/
6
pmpro_add_addon('repo', array(
7
'title' => 'PMPro bbPress',
8
+ 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_bbpress_widget',
10
+ 'enabled' => function_exists('pmpro_check_forum')
11
)
12
);
13
14
function pmpro_addon_pmpro_bbpress_widget($addon)
15
{
16
?>
17
<div class="info">
18
<p>Locking down bbPress Forums by Membership Level and Forum ID.</p>
19
<div class="actions">
adminpages/addons/pmpro-constant-contact.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /*
3
- Addon: PMPro Constant Contact Integration
4
- Slug: pmpro-constant-contact
5
- */
6
- pmpro_add_addon('thirdparty', array(
7
- 'title' => 'PMPro Constant Contact Integration',
8
- 'version' => '1.0',
9
- 'widget' => 'pmpro_addon_pmpro_constant_contact_widget',
10
- 'enabled' => function_exists('pmprocc_init')
11
- )
12
- );
13
-
14
- function pmpro_addon_pmpro_constant_contact_widget($addon)
15
- {
16
- ?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-constant-contact.gif" />
18
- <div class="info">
19
- <p>Integrate User Registrations with Constant Contact . Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
- <div class="actions">
21
- <?php if($addon['enabled']) { ?>
22
- <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-constant-contact/pmpro-constant-contact.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-constant-contact/pmpro-constant-contact.php'), 'activate-plugin_pmpro-constant-contact/pmpro-constant-contact.php')?>" class="button button-primary">Activate</a>
25
- <?php } else { ?>
26
- <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-constant-contact'), 'install-plugin_pmpro-constant-contact'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
- </div>
29
- </div> <!-- end info -->
30
- <?php
31
- }
adminpages/addons/pmpro-email-templates.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /*
3
- Addon: PMPro Email Templates Editor
4
- Slug: pmpro-email-templates-addon
5
- */
6
- pmpro_add_addon('repo', array(
7
- 'title' => 'PMPro Email Templates',
8
- 'version' => '.5.2',
9
- 'widget' => 'pmpro_addon_email_templates_widget',
10
- 'enabled' => function_exists('pmproet_scripts')
11
- )
12
- );
13
-
14
- function pmpro_addon_email_templates_widget($addon)
15
- {
16
- ?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-email-templates.gif" />
18
- <div class="info">
19
- <p>Easily edit system-generated Email Templates from the WordPress admin.</p>
20
- <div class="actions">
21
- <?php if($addon['enabled']) { ?>
22
- <a href="http://wordpress.org/plugins/pmpro-email-templates-addon/" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-email-templates-addon/pmpro-email-templates.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-email-templates-addon/pmpro-email-templates.php'), 'activate-plugin_pmpro-email-templates-addon/pmpro-email-templates.php')?>" class="button button-primary">Activate</a>
25
- <?php } else { ?>
26
- <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-email-templates-addon'), 'install-plugin_pmpro-email-templates-addon'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
- </div>
29
- </div> <!-- end info -->
30
- <?php
31
- }
adminpages/addons/pmpro-expiration.php CHANGED
@@ -5,9 +5,9 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Set Expiration Dates',
8
- 'version' => '.1.1',
9
'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
- 'enabled' => function_exists('pmprosed_pmpro_checkout_level')
11
)
12
);
13
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Set Expiration Dates',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
+ 'enabled' => function_exists('my_pmpro_checkout_level_specific_expiration')
11
)
12
);
13
adminpages/addons/pmpro-infusionsoft.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Infusionsoft Integration',
8
- 'version' => '1.2',
9
'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
'enabled' => function_exists('pmprois_init')
11
)
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Infusionsoft Integration',
8
+ 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
'enabled' => function_exists('pmprois_init')
11
)
adminpages/addons/pmpro-mailchimp.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro MailChimp Integration',
8
- 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_mailchimp_widget',
10
'enabled' => function_exists('pmpromc_init')
11
)
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro MailChimp Integration',
8
+ 'version' => '.3.3',
9
'widget' => 'pmpro_addon_pmpro_mailchimp_widget',
10
'enabled' => function_exists('pmpromc_init')
11
)
adminpages/addons/pmpro-network-subsite.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Network Subsite Helper',
8
- 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_network_subsite_widget',
10
'enabled' => function_exists('pmpron_subsite_activated_plugin')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Network Subsite Helper',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_network_subsite_widget',
10
'enabled' => function_exists('pmpron_subsite_activated_plugin')
11
)
adminpages/addons/pmpro-post-affiliate-pro.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Post Affiliate Pro Integration',
8
- 'version' => '.2.1.1',
9
'widget' => 'pmpro_addon_pmpro_post_affiliate_pro_widget',
10
'enabled' => function_exists('pap_pmpro_track_sale')
11
)
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Post Affiliate Pro Integration',
8
+ 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_post_affiliate_pro_widget',
10
'enabled' => function_exists('pap_pmpro_track_sale')
11
)
adminpages/addons/pmpro-register-helper.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Register Helper',
8
- 'version' => '.5.16.1',
9
'widget' => 'pmpro_addon_pmpro_register_helper_widget',
10
'enabled' => class_exists('PMProRH_Field')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Register Helper',
8
+ 'version' => '.5.10',
9
'widget' => 'pmpro_addon_pmpro_register_helper_widget',
10
'enabled' => class_exists('PMProRH_Field')
11
)
adminpages/addons/pmpro-series.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Series',
8
- 'version' => '.3',
9
'widget' => 'pmpro_addon_pmpro_series_widget',
10
'enabled' => class_exists("PMProSeries")
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Series',
8
+ 'version' => '.2.1',
9
'widget' => 'pmpro_addon_pmpro_series_widget',
10
'enabled' => class_exists("PMProSeries")
11
)
adminpages/addons/pmpro-shipping.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Shipping Add On',
8
- 'version' => '.2.6',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Shipping Add On',
8
+ 'version' => '.2.4',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
adminpages/addons/pmpro-woocommerce.php CHANGED
@@ -3,9 +3,9 @@
3
Addon: PMPro WooCommerce
4
Slug: pmpro-woocommerce
5
*/
6
- pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro WooCommerce',
8
- 'version' => '1.2.2',
9
'widget' => 'pmpro_addon_pmpro_woocommerce_widget',
10
'enabled' => function_exists('pmprowoo_add_membership_from_order')
11
)
@@ -14,9 +14,8 @@ pmpro_add_addon('thirdparty', array(
14
function pmpro_addon_pmpro_woocommerce_widget($addon)
15
{
16
?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-woocommerce.gif" />
18
<div class="info">
19
- <p>Use WooCommerce to purchase membership or set members-only product pricing.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
<a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
3
Addon: PMPro WooCommerce
4
Slug: pmpro-woocommerce
5
*/
6
+ pmpro_add_addon('repo', array(
7
'title' => 'PMPro WooCommerce',
8
+ 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_woocommerce_widget',
10
'enabled' => function_exists('pmprowoo_add_membership_from_order')
11
)
14
function pmpro_addon_pmpro_woocommerce_widget($addon)
15
{
16
?>
17
<div class="info">
18
+ <p>Integrates Paid Memberships Pro with WooCommerce to use WooCommerce to checkout for PMPro levels or set membership pricing.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
<a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
adminpages/addons/tml.php CHANGED
@@ -7,7 +7,7 @@ pmpro_add_addon('recommended', array(
7
'title' => 'Theme My Login',
8
'widget' => 'pmpro_addon_tml_widget',
9
'enabled' => class_exists('Theme_My_Login'),
10
- 'version' => '6.3.10'
11
)
12
);
13
7
'title' => 'Theme My Login',
8
'widget' => 'pmpro_addon_tml_widget',
9
'enabled' => class_exists('Theme_My_Login'),
10
+ 'version' => '6.3.9'
11
)
12
);
13
adminpages/admin_header.php CHANGED
@@ -124,7 +124,7 @@
124
<div class="wrap pmpro_admin">
125
<div class="pmpro_banner">
126
<a class="pmpro_logo" title="Paid Memberships Pro - Membership Plugin for WordPress" target="_blank" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><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>
127
- <div class="pmpro_meta"><span class="pmpro_tag-grey">v<?php echo PMPRO_VERSION?></span><a target="_blank" class="pmpro_tag-blue" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><?php _e('Plugin Support', 'pmpro');?></a><a target="_blank" class="pmpro_tag-blue" href="http://www.paidmembershipspro.com/forums/"><?php _e('User Forum', 'pmpro');?></a></div>
128
129
<br style="clear:both;" />
130
</div>
124
<div class="wrap pmpro_admin">
125
<div class="pmpro_banner">
126
<a class="pmpro_logo" title="Paid Memberships Pro - Membership Plugin for WordPress" target="_blank" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><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>
127
+ <div class="pmpro_meta"><span class="pmpro_tag-grey">v<?php echo PMPRO_VERSION?></span><a class="pmpro_tag-blue" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><?php _e('Plugin Support', 'pmpro');?></a><a class="pmpro_tag-blue" href="http://www.paidmembershipspro.com/forums/"><?php _e('User Forum', 'pmpro');?></a></div>
128
129
<br style="clear:both;" />
130
</div>
adminpages/advancedsettings.php CHANGED
@@ -1,6 +1,6 @@
1
<?php
2
//only admins can get this
3
- if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_advancedsettings")))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
@@ -14,7 +14,6 @@
14
pmpro_setOption("nonmembertext");
15
pmpro_setOption("notloggedintext");
16
pmpro_setOption("rsstext");
17
- pmpro_setOption("filterqueries");
18
pmpro_setOption("showexcerpts");
19
pmpro_setOption("hideads");
20
pmpro_setOption("hideadslevels");
@@ -47,7 +46,6 @@
47
$notloggedintext = pmpro_getOption("notloggedintext");
48
$rsstext = pmpro_getOption("rsstext");
49
$hideads = pmpro_getOption("hideads");
50
- $filterqueries = pmpro_getOption('filterqueries');
51
$showexcerpts = pmpro_getOption("showexcerpts");
52
$hideadslevels = pmpro_getOption("hideadslevels");
53
@@ -119,27 +117,16 @@
119
120
<tr>
121
<th scope="row" valign="top">
122
- <label for="filterqueries"><?php _e("Filter searches and archives?", 'pmpro');?></label>
123
</th>
124
<td>
125
- <select id="filterqueries" name="filterqueries">
126
- <option value="0" <?php if(!$filterqueries) { ?>selected="selected"<?php } ?>><?php _e('No - Non-members will see restricted posts/pages in searches and archives.', 'pmpro');?></option>
127
- <option value="1" <?php if($filterqueries == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes - Only members will see restricted posts/pages in searches and archives.', 'pmpro');?></option>
128
</select>
129
</td>
130
</tr>
131
<tr>
132
- <th scope="row" valign="top">
133
- <label for="showexcerpts"><?php _e('Show Excerpts to Non-Members?', 'pmpro');?></label>
134
- </th>
135
- <td>
136
- <select id="showexcerpts" name="showexcerpts">
137
- <option value="0" <?php if(!$showexcerpts) { ?>selected="selected"<?php } ?>><?php _e('No - Hide excerpts.', 'pmpro');?></option>
138
- <option value="1" <?php if($showexcerpts == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes - Show excerpts.', 'pmpro');?></option>
139
- </select>
140
- </td>
141
- </tr>
142
- <tr>
143
<th scope="row" valign="top">
144
<label for="hideads">Hide Ads From Members?</label>
145
</th>
1
<?php
2
//only admins can get this
3
+ if(!function_exists("current_user_can") || !current_user_can("manage_options"))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
14
pmpro_setOption("nonmembertext");
15
pmpro_setOption("notloggedintext");
16
pmpro_setOption("rsstext");
17
pmpro_setOption("showexcerpts");
18
pmpro_setOption("hideads");
19
pmpro_setOption("hideadslevels");
46
$notloggedintext = pmpro_getOption("notloggedintext");
47
$rsstext = pmpro_getOption("rsstext");
48
$hideads = pmpro_getOption("hideads");
49
$showexcerpts = pmpro_getOption("showexcerpts");
50
$hideadslevels = pmpro_getOption("hideadslevels");
51
117
118
<tr>
119
<th scope="row" valign="top">
120
+ <label for="showexcerpts"><?php _e('Show Excerpts to Non-Members?', 'pmpro');?></label>
121
</th>
122
<td>
123
+ <select id="showexcerpts" name="showexcerpts">
124
+ <option value="0" <?php if(!$showexcerpts) { ?>selected="selected"<?php } ?>><?php _e('No - Hide excerpts.', 'pmpro');?></option>
125
+ <option value="1" <?php if($showexcerpts == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes - Show excerpts.', 'pmpro');?></option>
126
</select>
127
</td>
128
</tr>
129
<tr>
130
<th scope="row" valign="top">
131
<label for="hideads">Hide Ads From Members?</label>
132
</th>
adminpages/discountcodes.php CHANGED
@@ -36,8 +36,8 @@
36
$uses = $_POST['uses'];
37
38
//fix up dates
39
- $starts = date("Y-m-d", strtotime($starts_month . "/" . $starts_day . "/" . $starts_year, current_time("timestamp")));
40
- $expires = date("Y-m-d", strtotime($expires_month . "/" . $expires_day . "/" . $expires_year, current_time("timestamp")));
41
42
//updating or new?
43
if($saveid > 0)
@@ -356,7 +356,7 @@
356
for($i = 1; $i < 13; $i++)
357
{
358
?>
359
- <option value="<?php echo $i?>" <?php if($i == $selected_starts_month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $current_year, current_time("timestamp")))?></option>
360
<?php
361
}
362
?>
@@ -374,7 +374,7 @@
374
for($i = 1; $i < 13; $i++)
375
{
376
?>
377
- <option value="<?php echo $i?>" <?php if($i == $selected_expires_month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $current_year, current_time("timestamp")))?></option>
378
<?php
379
}
380
?>
@@ -385,7 +385,7 @@
385
</tr>
386
387
<tr>
388
- <th scope="row" valign="top"><label for="uses"><?php _e('Uses', 'pmpro');?>:</label></th>
389
<td>
390
<input name="uses" type="text" size="10" value="<?php if(!empty($code->uses)) echo str_replace("\"", "&quot;", stripslashes($code->uses));?>" />
391
<small class="pmpro_lite"><?php _e('Leave blank for unlimited uses.', 'pmpro');?></small>
@@ -397,7 +397,7 @@
397
398
<?php do_action("pmpro_discount_code_after_settings"); ?>
399
400
- <h3><?php _e('Which Levels Will This Code Apply To?', 'pmpro'); ?></h3>
401
402
<div class="pmpro_discount_levels">
403
<?php
36
$uses = $_POST['uses'];
37
38
//fix up dates
39
+ $starts = date("Y-m-d", strtotime($starts_month . "/" . $starts_day . "/" . $starts_year));
40
+ $expires = date("Y-m-d", strtotime($expires_month . "/" . $expires_day . "/" . $expires_year));
41
42
//updating or new?
43
if($saveid > 0)
356
for($i = 1; $i < 13; $i++)
357
{
358
?>
359
+ <option value="<?php echo $i?>" <?php if($i == $selected_starts_month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $current_year))?></option>
360
<?php
361
}
362
?>
374
for($i = 1; $i < 13; $i++)
375
{
376
?>
377
+ <option value="<?php echo $i?>" <?php if($i == $selected_expires_month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $current_year))?></option>
378
<?php
379
}
380
?>
385
</tr>
386
387
<tr>
388
+ <th scope="row" valign="top"><label for="uses"><?php _ex('Uses', 'Number of uses for a discount code', 'pmpro');?>:</label></th>
389
<td>
390
<input name="uses" type="text" size="10" value="<?php if(!empty($code->uses)) echo str_replace("\"", "&quot;", stripslashes($code->uses));?>" />
391
<small class="pmpro_lite"><?php _e('Leave blank for unlimited uses.', 'pmpro');?></small>
397
398
<?php do_action("pmpro_discount_code_after_settings"); ?>
399
400
+ <h3>Which Levels Will This Code Apply To?</h3>
401
402
<div class="pmpro_discount_levels">
403
<?php
adminpages/emailsettings.php CHANGED
@@ -1,181 +1,170 @@
1
- <?php
2
- //only admins can get this
3
- if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_emailsettings")))
4
- {
5
- die(__("You do not have permissions to perform this action.", "pmpro"));
6
- }
7
-
8
- global $wpdb, $msg, $msgt;
9
-
10
- //get/set settings
11
- global $pmpro_pages;
12
- if(!empty($_REQUEST['savesettings']))
13
- {
14
- //email options
15
- pmpro_setOption("from_email");
16
- pmpro_setOption("from_name");
17
- pmpro_setOption("only_filter_pmpro_emails");
18
-
19
- pmpro_setOption("email_admin_checkout");
20
- pmpro_setOption("email_admin_changes");
21
- pmpro_setOption("email_admin_cancels");
22
- pmpro_setOption("email_admin_billing");
23
-
24
- pmpro_setOption("email_member_notification");
25
-
26
- //assume success
27
- $msg = true;
28
- $msgt = "Your email settings have been updated.";
29
- }
30
-
31
- $from_email = pmpro_getOption("from_email");
32
- $from_name = pmpro_getOption("from_name");
33
- $only_filter_pmpro_emails = pmpro_getOption("only_filter_pmpro_emails");
34
-
35
- $email_admin_checkout = pmpro_getOption("email_admin_checkout");
36
- $email_admin_changes = pmpro_getOption("email_admin_changes");
37
- $email_admin_cancels = pmpro_getOption("email_admin_cancels");
38
- $email_admin_billing = pmpro_getOption("email_admin_billing");
39
-
40
- $email_member_notification = pmpro_getOption("email_member_notification");
41
-
42
- if(empty($from_email))
43
- {
44
- $parsed = parse_url(home_url());
45
- $hostname = $parsed[host];
46
- $hostparts = split("\.", $hostname);
47
- $email_domain = $hostparts[count($hostparts) - 2] . "." . $hostparts[count($hostparts) - 1];
48
- $from_email = "wordpress@" . $email_domain;
49
- pmpro_setOption("from_email", $from_email);
50
- }
51
-
52
- if(empty($from_name))
53
- {
54
- $from_name = "WordPress";
55
- pmpro_setOption("from_name", $from_name);
56
- }
57
-
58
- // default from email wordpress@sitename
59
- $sitename = strtolower( $_SERVER['SERVER_NAME'] );
60
- if ( substr( $sitename, 0, 4 ) == 'www.' ) {
61
- $sitename = substr( $sitename, 4 );
62
- }
63
- $default_from_email = 'wordpress@' . $sitename;
64
-
65
- require_once(dirname(__FILE__) . "/admin_header.php");
66
- ?>
67
-
68
- <form action="" method="post" enctype="multipart/form-data">
69
- <h2><?php _e('Email Settings', 'pmpro');?></h2>
70
- <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.', 'pmpro');?></p>
71
-
72
- <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/">Click here to learn more about Paid Memberships Pro emails</a>.', 'pmpro');?></p>
73
-
74
- <table class="form-table">
75
- <tbody>
76
- <tr>
77
- <th scope="row" valign="top">
78
- <label for="from_email"><?php _e('From Email', 'pmpro');?>:</label>
79
- </th>
80
- <td>
81
- <input type="text" name="from_email" size="60" value="<?php echo $from_email?>" />
82
- </td>
83
- </tr>
84
- <tr>
85
- <th scope="row" valign="top">
86
- <label for="from_name"><?php _e('From Name', 'pmpro');?>:</label>
87
- </th>
88
- <td>
89
- <input type="text" name="from_name" size="60" value="<?php echo $from_name?>" />
90
- </td>
91
- </tr>
92
- <tr>
93
- <th scope="row" valign="top">
94
- <label for="only_filter_pmpro_emails"><?php _e('Only Filter PMPro Emails?', 'pmpro');?>:</label>
95
- </th>
96
- <td>
97
- <input type="checkbox" id="only_filter_pmpro_emails" name="only_filter_pmpro_emails" value="1" <?php if(!empty($only_filter_pmpro_emails)) { ?>checked="checked"<?php } ?> />
98
- <?php _e('If unchecked, all emails from "WordPress &lt;' . $default_from_email . '&gt;" will be filtered to use the above settings.', 'pmpro');?>
99
- </td>
100
- </tr>
101
- </tbody>
102
- </table>
103
-
104
- <?php /* going to put something like this here in next version
105
- <h3><?php _e('Modify System-generated Email Templates', 'pmpro');?>:</h3>
106
- <?php
107
- if (function_exists('pmproet_scripts'))
108
- {
109
- _e('You have installed the PMPro Email Templates add on. <a href="' . admin_url('admin.php?page=pmpro-email-templates') . '">Click here to modify email templates</a>');
110
- }
111
- ?>
112
- <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>.', 'pmpro'); ?></p>
113
- */ ?>
114
-
115
- <h3><?php _e('Send the site admin emails', 'pmpro');?>:</h3>
116
-
117
- <table class="form-table">
118
- <tbody>
119
- <tr>
120
- <th scope="row" valign="top">
121
- <label for="email_admin_checkout"><?php _e('Checkout', 'pmpro');?>:</label>
122
- </th>
123
- <td>
124
- <input type="checkbox" id="email_admin_checkout" name="email_admin_checkout" value="1" <?php if(!empty($email_admin_checkout)) { ?>checked="checked"<?php } ?> />
125
- <?php _e('when a member checks out.', 'pmpro');?>
126
- </td>
127
- </tr>
128
- <tr>
129
- <th scope="row" valign="top">
130
- <label for="email_admin_changes"><?php _e('Admin Changes', 'pmpro');?>:</label>
131
- </th>
132
- <td>
133
- <input type="checkbox" id="email_admin_changes" name="email_admin_changes" value="1" <?php if(!empty($email_admin_changes)) { ?>checked="checked"<?php } ?> />
134
- <?php _e('when an admin changes a user\'s membership level through the dashboard.', 'pmpro');?>
135
- </td>
136
- </tr>
137
- <tr>
138
- <th scope="row" valign="top">
139
- <label for="email_admin_cancels"><?php _e('Cancellation', 'pmpro');?>:</label>
140
- </th>
141
- <td>
142
- <input type="checkbox" id="email_admin_cancels" name="email_admin_cancels" value="1" <?php if(!empty($email_admin_cancels)) { ?>checked="checked"<?php } ?> />
143
- <?php _e('when a user cancels his or her account.', 'pmpro');?>
144
- </td>
145
- </tr>
146
- <tr>
147
- <th scope="row" valign="top">
148
- <label for="email_admin_billing"><?php _e('Bill Updates', 'pmpro');?>:</label>
149
- </th>
150
- <td>
151
- <input type="checkbox" id="email_admin_billing" name="email_admin_billing" value="1" <?php if(!empty($email_admin_billing)) { ?>checked="checked"<?php } ?> />
152
- <?php _e('when a user updates his or her billing information.', 'pmpro');?>
153
- </td>
154
- </tr>
155
- </tbody>
156
- </table>
157
-
158
- <h3><?php _e('Send members emails', 'pmpro');?>:</h3>
159
-
160
- <table class="form-table">
161
- <tbody>
162
- <tr>
163
- <th scope="row" valign="top">
164
- <label for="email_admin_checkout"><?php _e('New Users', 'pmpro');?>:</label>
165
- </th>
166
- <td>
167
- <input type="checkbox" id="email_member_notification" name="email_member_notification" value="1" <?php if(!empty($email_member_notification)) { ?>checked="checked"<?php } ?> />
168
- <?php _e('Default WP notification email. (Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.)', 'pmpro');?>
169
- </td>
170
- </tr>
171
- </tbody>
172
- </table>
173
-
174
- <p class="submit">
175
- <input name="savesettings" type="submit" class="button-primary" value="Save Settings" />
176
- </p>
177
- </form>
178
-
179
- <?php
180
- require_once(dirname(__FILE__) . "/admin_footer.php");
181
- ?>
1
+ <?php
2
+ //only admins can get this
3
+ if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_emailsettings")))
4
+ {
5
+ die(__("You do not have permissions to perform this action.", "pmpro"));
6
+ }
7
+
8
+ global $wpdb, $msg, $msgt;
9
+
10
+ //get/set settings
11
+ global $pmpro_pages;
12
+ if(!empty($_REQUEST['savesettings']))
13
+ {
14
+ //email options
15
+ pmpro_setOption("from_email");
16
+ pmpro_setOption("from_name");
17
+ pmpro_setOption("only_filter_pmpro_emails");
18
+
19
+ pmpro_setOption("email_admin_checkout");
20
+ pmpro_setOption("email_admin_changes");
21
+ pmpro_setOption("email_admin_cancels");
22
+ pmpro_setOption("email_admin_billing");
23
+
24
+ pmpro_setOption("email_member_notification");
25
+
26
+ //assume success
27
+ $msg = true;
28
+ $msgt = "Your email settings have been updated.";
29
+ }
30
+
31
+ $from_email = pmpro_getOption("from_email");
32
+ $from_name = pmpro_getOption("from_name");
33
+ $only_filter_pmpro_emails = pmpro_getOption("only_filter_pmpro_emails");
34
+
35
+ $email_admin_checkout = pmpro_getOption("email_admin_checkout");
36
+ $email_admin_changes = pmpro_getOption("email_admin_changes");
37
+ $email_admin_cancels = pmpro_getOption("email_admin_cancels");
38
+ $email_admin_billing = pmpro_getOption("email_admin_billing");
39
+
40
+ $email_member_notification = pmpro_getOption("email_member_notification");
41
+
42
+ if(empty($from_email))
43
+ {
44
+ $parsed = parse_url(home_url());
45
+ $hostname = $parsed[host];
46
+ $hostparts = split("\.", $hostname);
47
+ $email_domain = $hostparts[count($hostparts) - 2] . "." . $hostparts[count($hostparts) - 1];
48
+ $from_email = "wordpress@" . $email_domain;
49
+ pmpro_setOption("from_email", $from_email);
50
+ }
51
+
52
+ if(empty($from_name))
53
+ {
54
+ $from_name = "WordPress";
55
+ pmpro_setOption("from_name", $from_name);
56
+ }
57
+
58
+ // default from email wordpress@sitename
59
+ $sitename = strtolower( $_SERVER['SERVER_NAME'] );
60
+ if ( substr( $sitename, 0, 4 ) == 'www.' ) {
61
+ $sitename = substr( $sitename, 4 );
62
+ }
63
+ $default_from_email = 'wordpress@' . $sitename;
64
+
65
+ require_once(dirname(__FILE__) . "/admin_header.php");
66
+ ?>
67
+
68
+ <form action="" method="post" enctype="multipart/form-data">
69
+ <h2><?php _e('Email Settings', 'pmpro');?></h2>
70
+ <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.', 'pmpro');?></p>
71
+
72
+ <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/">Click here to learn more about Paid Memberships Pro emails</a>.', 'pmpro');?></p>
73
+
74
+ <table class="form-table">
75
+ <tbody>
76
+ <tr>
77
+ <th scope="row" valign="top">
78
+ <label for="from_email"><?php _e('From Email', 'pmpro');?>:</label>
79
+ </th>
80
+ <td>
81
+ <input type="text" name="from_email" size="60" value="<?php echo $from_email?>" />
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <th scope="row" valign="top">
86
+ <label for="from_name"><?php _e('From Name', 'pmpro');?>:</label>
87
+ </th>
88
+ <td>
89
+ <input type="text" name="from_name" size="60" value="<?php echo $from_name?>" />
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <th scope="row" valign="top">
94
+ <label for="only_filter_pmpro_emails"><?php _e('Only Filter PMPro Emails?', 'pmpro');?>:</label>
95
+ </th>
96
+ <td>
97
+ <input type="checkbox" id="only_filter_pmpro_emails" name="only_filter_pmpro_emails" value="1" <?php if(!empty($only_filter_pmpro_emails)) { ?>checked="checked"<?php } ?> />
98
+ <?php _e('If unchecked, all emails from "WordPress &lt;' . $default_from_email . '&gt;" will be filtered to use the above settings.', 'pmpro');?>
99
+ </td>
100
+ </tr>
101
+ </tbody>
102
+ </table>
103
+
104
+ <h3><?php _e('Send the site admin emails', 'pmpro');?>:</h3>
105
+
106
+ <table class="form-table">
107
+ <tbody>
108
+ <tr>
109
+ <th scope="row" valign="top">
110
+ <label for="email_admin_checkout"><?php _e('Checkout', 'pmpro');?>:</label>
111
+ </th>
112
+ <td>
113
+ <input type="checkbox" id="email_admin_checkout" name="email_admin_checkout" value="1" <?php if(!empty($email_admin_checkout)) { ?>checked="checked"<?php } ?> />
114
+ <?php _e('when a member checks out.', 'pmpro');?>
115
+ </td>
116
+ </tr>
117
+ <tr>
118
+ <th scope="row" valign="top">
119
+ <label for="email_admin_changes"><?php _e('Admin Changes', 'pmpro');?>:</label>
120
+ </th>
121
+ <td>
122
+ <input type="checkbox" id="email_admin_changes" name="email_admin_changes" value="1" <?php if(!empty($email_admin_changes)) { ?>checked="checked"<?php } ?> />
123
+ <?php _e('when an admin changes a user\'s membership level through the dashboard.', 'pmpro');?>
124
+ </td>
125
+ </tr>
126
+ <tr>
127
+ <th scope="row" valign="top">
128
+ <label for="email_admin_cancels"><?php _e('Cancellation', 'pmpro');?>:</label>
129
+ </th>
130
+ <td>
131
+ <input type="checkbox" id="email_admin_cancels" name="email_admin_cancels" value="1" <?php if(!empty($email_admin_cancels)) { ?>checked="checked"<?php } ?> />
132
+ <?php _e('when a user cancels his or her account.', 'pmpro');?>
133
+ </td>
134
+ </tr>
135
+ <tr>
136
+ <th scope="row" valign="top">
137
+ <label for="email_admin_billing"><?php _e('Bill Updates', 'pmpro');?>:</label>
138
+ </th>
139
+ <td>
140
+ <input type="checkbox" id="email_admin_billing" name="email_admin_billing" value="1" <?php if(!empty($email_admin_billing)) { ?>checked="checked"<?php } ?> />
141
+ <?php _e('when a user updates his or her billing information.', 'pmpro');?>
142
+ </td>
143
+ </tr>
144
+ </tbody>
145
+ </table>
146
+
147
+ <h3><?php _e('Send members emails', 'pmpro');?>:</h3>
148
+
149
+ <table class="form-table">
150
+ <tbody>
151
+ <tr>
152
+ <th scope="row" valign="top">
153
+ <label for="email_admin_checkout"><?php _e('New Users', 'pmpro');?>:</label>
154
+ </th>
155
+ <td>
156
+ <input type="checkbox" id="email_member_notification" name="email_member_notification" value="1" <?php if(!empty($email_member_notification)) { ?>checked="checked"<?php } ?> />
157
+ <?php _e('Default WP notification email. (Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.)', 'pmpro');?>
158
+ </td>
159
+ </tr>
160
+ </tbody>
161
+ </table>
162
+
163
+ <p class="submit">
164
+ <input name="savesettings" type="submit" class="button-primary" value="Save Settings" />
165
+ </p>
166
+ </form>
167
+
168
+ <?php
169
+ require_once(dirname(__FILE__) . "/admin_footer.php");
170
+ ?>
adminpages/memberslist-csv.php CHANGED
@@ -207,9 +207,9 @@
207
if($theuser->membership_id)
208
{
209
if($theuser->enddate)
210
- $csvoutput .= pmpro_enclose(apply_filters("pmpro_memberslist_expires_column", date("Y-m-d", $theuser->enddate), $theuser));
211
else
212
- $csvoutput .= pmpro_enclose(apply_filters("pmpro_memberslist_expires_column", "Never", $theuser));
213
}
214
elseif($l == "oldmembers" && $theuser->enddate)
215
{
207
if($theuser->membership_id)
208
{
209
if($theuser->enddate)
210
+ $csvoutput .= pmpro_enclose(date("Y-m-d", $theuser->enddate));
211
else
212
+ $csvoutput .= pmpro_enclose("Never");
213
}
214
elseif($l == "oldmembers" && $theuser->enddate)
215
{
adminpages/memberslist.php CHANGED
@@ -203,13 +203,13 @@
203
-
204
<?php } ?>
205
</td>
206
- <td><?php echo date(get_option("date_format"), strtotime($theuser->user_registered, current_time("timestamp")))?></td>
207
<td>
208
<?php
209
if($auser->enddate)
210
- echo apply_filters("pmpro_memberslist_expires_column", date(get_option('date_format'), $auser->enddate), $auser);
211
else
212
- echo __(apply_filters("pmpro_memberslist_expires_column", "Never", $auser), "pmpro");
213
?>
214
</td>
215
</tr>
203
-
204
<?php } ?>
205
</td>
206
+ <td><?php echo date(get_option("date_format"), strtotime($theuser->user_registered))?></td>
207
<td>
208
<?php
209
if($auser->enddate)
210
+ echo date(get_option('date_format'), $auser->enddate);
211
else
212
+ echo __("Never", "pmpro");
213
?>
214
</td>
215
</tr>
adminpages/orders-csv.php CHANGED
@@ -103,26 +103,26 @@
103
{
104
if($predefined_date == "Last Month")
105
{
106
- $start_date = date("Y-m-d", strtotime("first day of last month", current_time("timestamp")));
107
- $end_date = date("Y-m-d", strtotime("last day of last month", current_time("timestamp")));
108
}
109
elseif($predefined_date == "This Month")
110
{
111
- $start_date = date("Y-m-d", strtotime("first day of this month", current_time("timestamp")));
112
- $end_date = date("Y-m-d", strtotime("last day of this month", current_time("timestamp")));
113
}
114
elseif($predefined_date == "This Year")
115
{
116
$year = date('Y');
117
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
118
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
119
}
120
121
elseif($predefined_date == "Last Year")
122
{
123
$year = date('Y') - 1;
124
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
125
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
126
}
127
128
//add times to dates
103
{
104
if($predefined_date == "Last Month")
105
{
106
+ $start_date = date("Y-m-d", strtotime("first day of last month"));
107
+ $end_date = date("Y-m-d", strtotime("last day of last month"));
108
}
109
elseif($predefined_date == "This Month")
110
{
111
+ $start_date = date("Y-m-d", strtotime("first day of this month"));
112
+ $end_date = date("Y-m-d", strtotime("last day of this month"));
113
}
114
elseif($predefined_date == "This Year")
115
{
116
$year = date('Y');
117
+ $start_date = date("Y-m-d", strtotime("first day of January $year"));
118
+ $end_date = date("Y-m-d", strtotime("last day of December $year"));
119
}
120
121
elseif($predefined_date == "Last Year")
122
{
123
$year = date('Y') - 1;
124
+ $start_date = date("Y-m-d", strtotime("first day of January $year"));
125
+ $end_date = date("Y-m-d", strtotime("last day of December $year"));
126
}
127
128
//add times to dates
adminpages/orders.php CHANGED
@@ -481,7 +481,7 @@
481
<tr>
482
<th scope="row" valign="top"><label for="subscription_transaction_id"><?php _e('Subscription Transaction ID', 'pmpro');?>:</label></th>
483
<td>
484
- <?php if(in_array("subscription_transaction_id", $read_only_fields) && $order_id > 0) { echo $order->subscription_transaction_id; } else { ?>
485
<input id="subscription_transaction_id" name="subscription_transaction_id" type="text" size="50" value="<?php echo esc_attr($order->subscription_transaction_id);?>" />
486
<?php } ?>
487
<small class="pmpro_lite"><?php _e('Generated by the gateway. Useful to cross reference subscriptions.', 'pmpro');?></small>
@@ -497,7 +497,7 @@
497
if(!empty($order->timestamp))
498
$timestamp = $order->timestamp;
499
else
500
- $timestamp = current_time('timestamp');
501
502
$year = date("Y", $timestamp);
503
$month = date("n", $timestamp);
@@ -508,7 +508,7 @@
508
for($i = 1; $i < 13; $i++)
509
{
510
?>
511
- <option value="<?php echo $i?>" <?php if($i == $month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $year, current_time("timestamp")))?></option>
512
<?php
513
}
514
?>
@@ -813,26 +813,26 @@
813
{
814
if($predefined_date == "Last Month")
815
{
816
- $start_date = date("Y-m-d", strtotime("first day of last month", current_time("timestamp")));
817
- $end_date = date("Y-m-d", strtotime("last day of last month", current_time("timestamp")));
818
}
819
elseif($predefined_date == "This Month")
820
{
821
- $start_date = date("Y-m-d", strtotime("first day of this month", current_time("timestamp")));
822
- $end_date = date("Y-m-d", strtotime("last day of this month", current_time("timestamp")));
823
}
824
elseif($predefined_date == "This Year")
825
{
826
$year = date('Y');
827
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
828
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
829
}
830
831
elseif($predefined_date == "Last Year")
832
{
833
$year = date('Y') - 1;
834
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
835
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
836
}
837
838
//add times to dates
481
<tr>
482
<th scope="row" valign="top"><label for="subscription_transaction_id"><?php _e('Subscription Transaction ID', 'pmpro');?>:</label></th>
483
<td>
484
+ <?php if(in_array("code", $read_only_fields) && $order_id > 0) { echo $order->subscription_transaction_id; } else { ?>
485
<input id="subscription_transaction_id" name="subscription_transaction_id" type="text" size="50" value="<?php echo esc_attr($order->subscription_transaction_id);?>" />
486
<?php } ?>
487
<small class="pmpro_lite"><?php _e('Generated by the gateway. Useful to cross reference subscriptions.', 'pmpro');?></small>
497
if(!empty($order->timestamp))
498
$timestamp = $order->timestamp;
499
else
500
+ $timestamp = time();
501
502
$year = date("Y", $timestamp);
503
$month = date("n", $timestamp);
508
for($i = 1; $i < 13; $i++)
509
{
510
?>
511
+ <option value="<?php echo $i?>" <?php if($i == $month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $year))?></option>
512
<?php
513
}
514
?>
813
{
814
if($predefined_date == "Last Month")
815
{
816
+ $start_date = date("Y-m-d", strtotime("first day of last month"));
817
+ $end_date = date("Y-m-d", strtotime("last day of last month"));
818
}
819
elseif($predefined_date == "This Month")
820
{
821
+ $start_date = date("Y-m-d", strtotime("first day of this month"));
822
+ $end_date = date("Y-m-d", strtotime("last day of this month"));
823
}
824
elseif($predefined_date == "This Year")
825
{
826
$year = date('Y');
827
+ $start_date = date("Y-m-d", strtotime("first day of January $year"));
828
+ $end_date = date("Y-m-d", strtotime("last day of December $year"));
829
}
830
831
elseif($predefined_date == "Last Year")
832
{
833
$year = date('Y') - 1;
834
+ $start_date = date("Y-m-d", strtotime("first day of January $year"));
835
+ $end_date = date("Y-m-d", strtotime("last day of December $year"));
836
}
837
838
//add times to dates
adminpages/pagesettings.php CHANGED
@@ -48,29 +48,29 @@
48
{
49
switch ($pmpro_page_name) {
50
case 'account':
51
- $pmpro_page_title = __( 'Membership Account', 'pmpro' );
52
break;
53
case 'billing':
54
- $pmpro_page_title = __( 'Membership Billing', 'pmpro' );
55
break;
56
case 'cancel':
57
- $pmpro_page_title = __( 'Membership Cancel', 'pmpro' );
58
break;
59
case 'checkout':
60
- $pmpro_page_title = __( 'Membership Checkout', 'pmpro' );
61
break;
62
case 'confirmation':
63
- $pmpro_page_title = __( 'Membership Confirmation', 'pmpro' );
64
break;
65
case 'invoice':
66
- $pmpro_page_title = __( 'Membership Invoice', 'pmpro' );
67
break;
68
case 'levels':
69
- $pmpro_page_title = __( 'Membership Levels', 'pmpro' );
70
break;
71
72
default:
73
- $pmpro_page_title = sprintf( __( 'Membership %s', 'Page title template', 'pmpro' ), ucwords($pmpro_page_name) );
74
break;
75
}
76
48
{
49
switch ($pmpro_page_name) {
50
case 'account':
51
+ $pmpro_page_title = _x( 'Membership Account', 'Page title', 'pmpro' );
52
break;
53
case 'billing':
54
+ $pmpro_page_title = _x( 'Membership Billing', 'Page title', 'pmpro' );
55
break;
56
case 'cancel':
57
+ $pmpro_page_title = _x( 'Membership Cancel', 'Page title', 'pmpro' );
58
break;
59
case 'checkout':
60
+ $pmpro_page_title = _x( 'Membership Checkout', 'Page title', 'pmpro' );
61
break;
62
case 'confirmation':
63
+ $pmpro_page_title = _x( 'Membership Confirmation', 'Page title', 'pmpro' );
64
break;
65
case 'invoice':
66
+ $pmpro_page_title = _x( 'Membership Invoice', 'Page title', 'pmpro' );
67
break;
68
case 'levels':
69
+ $pmpro_page_title = _x( 'Membership Levels', 'Page title', 'pmpro' );
70
break;
71
72
default:
73
+ $pmpro_page_title = sprintf( _x( 'Membership %s', 'Page title template', 'pmpro' ), ucwords($pmpro_page_name) );
74
break;
75
}
76
adminpages/reports/login.php CHANGED
@@ -182,7 +182,7 @@ function pmpro_report_login_page()
182
<?php echo $theuser->display_name;?>
183
</td>
184
<td><?php echo $auser->membership?></td>
185
- <td><?php echo date("m/d/Y", strtotime($theuser->user_registered, current_time("timestamp")))?></td>
186
<td>
187
<?php
188
if($auser->enddate)
182
<?php echo $theuser->display_name;?>
183
</td>
184
<td><?php echo $auser->membership?></td>
185
+ <td><?php echo date("m/d/Y", strtotime($theuser->user_registered))?></td>
186
<td>
187
<?php
188
if($auser->enddate)
adminpages/reports/memberships.php CHANGED
@@ -479,7 +479,7 @@ function pmpro_getCancellations($period = false, $levels = 'all')
479
else
480
$startdate = '';
481
482
- $startdate_plus_one = strtotime( $startdate . + ' + 1 day', current_time("timestamp") );
483
484
/*
485
build query.
479
else
480
$startdate = '';
481
482
+ $startdate_plus_one = strtotime( $startdate . + ' + 1 day' );
483
484
/*
485
build query.
classes/class.memberorder.php CHANGED
@@ -125,7 +125,7 @@
125
return $this->Gateway;
126
}
127
128
- function getLastMemberOrder($user_id = NULL, $status = 'success', $membership_id = NULL)
129
{
130
global $current_user, $wpdb;
131
if(!$user_id)
@@ -140,9 +140,6 @@
140
$this->sqlQuery .= "AND status IN('" . implode("','", $status) . "') ";
141
elseif(!empty($status))
142
$this->sqlQuery .= "AND status = '" . esc_sql($status) . "' ";
143
-
144
- if(!empty($membership_id))
145
- $this->sqlQuery .= "AND membership_id = '" . $membership_id . "' ";
146
$this->sqlQuery .= "ORDER BY timestamp DESC LIMIT 1";
147
148
//get id
@@ -217,9 +214,6 @@
217
global $wpdb;
218
$this->discount_code = $wpdb->get_row("SELECT dc.* FROM $wpdb->pmpro_discount_codes dc LEFT JOIN $wpdb->pmpro_discount_codes_uses dcu ON dc.id = dcu.code_id WHERE dcu.order_id = '" . $this->id . "' LIMIT 1");
219
220
- //filter @since v1.7.14
221
- $this->discount_code = apply_filters("pmpro_order_discount_code", $this->discount_code, $this);
222
-
223
return $this->discount_code;
224
}
225
@@ -255,13 +249,7 @@
255
//okay, do I have a discount code to check? (if there is no membership_level->membership_id value, that means there was no entry in memberships_users)
256
if(!empty($this->discount_code) && empty($this->membership_level->membership_id))
257
{
258
- if(!empty($this->discount_code->code))
259
- $discount_code = $this->discount_code->code;
260
- else
261
- $discount_code = $this->discount_code;
262
-
263
- $sqlQuery = "SELECT l.id, cl.*, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_discount_codes_levels cl LEFT JOIN $wpdb->pmpro_membership_levels l ON cl.level_id = l.id LEFT JOIN $wpdb->pmpro_discount_codes dc ON dc.id = cl.code_id WHERE dc.code = '" . $discount_code . "' AND cl.level_id = '" . $this->membership_id . "' LIMIT 1";
264
-
265
$this->membership_level = $wpdb->get_row($sqlQuery);
266
}
267
@@ -287,7 +275,7 @@
287
if($tax_state && $tax_rate)
288
{
289
//we have values, is this order in the tax state?
290
- if(!empty($this->billing) && trim(strtoupper($this->billing->state)) == trim(strtoupper($tax_state)))
291
{
292
//return value, pass through filter
293
$tax = round((float)$price * (float)$tax_rate, 2);
@@ -491,7 +479,7 @@
491
'" . $this->gateway_environment . "',
492
'" . esc_sql($this->payment_transaction_id) . "',
493
'" . esc_sql($this->subscription_transaction_id) . "',
494
- '" . current_time('mysql') . "',
495
'" . esc_sql($this->affiliate_id) . "',
496
'" . esc_sql($this->affiliate_subid) . "',
497
'" . esc_sql($this->notes) . "'
@@ -518,7 +506,7 @@
518
519
while(empty($code))
520
{
521
- $scramble = md5(AUTH_KEY . current_time('timestamp') . SECURE_AUTH_KEY);
522
$code = substr($scramble, 0, 10);
523
$code = apply_filters("pmpro_random_code", $code, $this); //filter
524
$check = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_membership_orders WHERE code = '$code' LIMIT 1");
@@ -589,16 +577,6 @@
589
return $this->Gateway->update($this);
590
}
591
592
- function getGatewaySubscriptionStatus()
593
- {
594
- return $this->Gateway->getSubscriptionStatus($this);
595
- }
596
-
597
- function getGatewayTransactionStatus()
598
- {
599
- return $this->Gateway->getTransactionStatus($this);
600
- }
601
-
602
function deleteMe()
603
{
604
if(empty($this->id))
125
return $this->Gateway;
126
}
127
128
+ function getLastMemberOrder($user_id = NULL, $status = 'success')
129
{
130
global $current_user, $wpdb;
131
if(!$user_id)
140
$this->sqlQuery .= "AND status IN('" . implode("','", $status) . "') ";
141
elseif(!empty($status))
142
$this->sqlQuery .= "AND status = '" . esc_sql($status) . "' ";
143
$this->sqlQuery .= "ORDER BY timestamp DESC LIMIT 1";
144
145
//get id
214
global $wpdb;
215
$this->discount_code = $wpdb->get_row("SELECT dc.* FROM $wpdb->pmpro_discount_codes dc LEFT JOIN $wpdb->pmpro_discount_codes_uses dcu ON dc.id = dcu.code_id WHERE dcu.order_id = '" . $this->id . "' LIMIT 1");
216
217
return $this->discount_code;
218
}
219
249
//okay, do I have a discount code to check? (if there is no membership_level->membership_id value, that means there was no entry in memberships_users)
250
if(!empty($this->discount_code) && empty($this->membership_level->membership_id))
251
{
252
+ $sqlQuery = "SELECT l.id, cl.*, l.name, l.description, l.allow_signups FROM $wpdb->pmpro_discount_codes_levels cl LEFT JOIN $wpdb->pmpro_membership_levels l ON cl.level_id = l.id LEFT JOIN $wpdb->pmpro_discount_codes dc ON dc.id = cl.code_id WHERE dc.code = '" . $this->discount_code . "' AND cl.level_id = '" . $this->membership_id . "' LIMIT 1";
253
$this->membership_level = $wpdb->get_row($sqlQuery);
254
}
255
275
if($tax_state && $tax_rate)
276
{
277
//we have values, is this order in the tax state?
278
+ if(trim(strtoupper($this->billing->state)) == trim(strtoupper($tax_state)))
279
{
280
//return value, pass through filter
281
$tax = round((float)$price * (float)$tax_rate, 2);
479
'" . $this->gateway_environment . "',
480
'" . esc_sql($this->payment_transaction_id) . "',
481
'" . esc_sql($this->subscription_transaction_id) . "',
482
+ now(),
483
'" . esc_sql($this->affiliate_id) . "',
484
'" . esc_sql($this->affiliate_subid) . "',
485
'" . esc_sql($this->notes) . "'
506
507
while(empty($code))
508
{
509
+ $scramble = md5(AUTH_KEY . time() . SECURE_AUTH_KEY);
510
$code = substr($scramble, 0, 10);
511
$code = apply_filters("pmpro_random_code", $code, $this); //filter
512
$check = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_membership_orders WHERE code = '$code' LIMIT 1");
577
return $this->Gateway->update($this);
578
}
579
580
function deleteMe()
581
{
582
if(empty($this->id))
classes/class.pmproemail.php CHANGED
@@ -44,8 +44,6 @@
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(), "pmpro");
51
if(file_exists(get_stylesheet_directory() . "/paid-memberships-pro/email/" . $this->template . ".html"))
@@ -100,9 +98,8 @@
100
$this->template = apply_filters("pmpro_email_template", $temail->template, $this);
101
$this->body = apply_filters("pmpro_email_body", $temail->body, $this);
102
$this->headers = apply_filters("pmpro_email_headers", $temail->headers, $this);
103
- $this->attachments = apply_filters("pmpro_email_attachments", $temail->attachments, $this);
104
-
105
- if(wp_mail($this->email,$this->subject,$this->body,$this->headers,$this->attachments))
106
{
107
return true;
108
}
@@ -186,7 +183,7 @@
186
"membership_id" => $user->membership_level->id,
187
"membership_level_name" => $user->membership_level->name,
188
"membership_cost" => pmpro_getLevelCost($user->membership_level),
189
- "login_link" => wp_login_url(pmpro_url("account")),
190
"display_name" => $user->display_name,
191
"user_email" => $user->user_email,0
192
);
@@ -286,7 +283,7 @@
286
"membership_id" => $user->membership_level->id,
287
"membership_level_name" => $user->membership_level->name,
288
"membership_cost" => pmpro_getLevelCost($user->membership_level),
289
- "login_link" => wp_login_url(pmpro_url("account")),
290
"display_name" => $user->display_name,
291
"user_email" => $user->user_email,0
292
);
@@ -387,7 +384,7 @@
387
"accountnumber" => hideCardNumber($invoice->accountnumber),
388
"expirationmonth" => $invoice->expirationmonth,
389
"expirationyear" => $invoice->expirationyear,
390
- "login_link" => wp_login_url(pmpro_url("account"))
391
);
392
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
393
$invoice->billing->street,
@@ -488,7 +485,7 @@
488
"accountnumber" => hideCardNumber($invoice->accountnumber),
489
"expirationmonth" => $invoice->expirationmonth,
490
"expirationyear" => $invoice->expirationyear,
491
- "login_link" => wp_login_url(pmpro_url("billing"))
492
);
493
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
494
$invoice->billing->street,
@@ -534,7 +531,7 @@
534
"accountnumber" => hideCardNumber($invoice->accountnumber),
535
"expirationmonth" => $invoice->expirationmonth,
536
"expirationyear" => $invoice->expirationyear,
537
- "login_link" => wp_login_url(pmpro_url("billing"))
538
);
539
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
540
$invoice->billing->street,
@@ -581,7 +578,7 @@
581
"accountnumber" => hideCardNumber($invoice->accountnumber),
582
"expirationmonth" => $invoice->expirationmonth,
583
"expirationyear" => $invoice->expirationyear,
584
- "login_link" => wp_login_url(pmpro_url("billing"))
585
);
586
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
587
$invoice->billing->street,
@@ -618,7 +615,7 @@
618
"membership_level_name" => $user->membership_level->name,
619
"display_name" => $user->display_name,
620
"user_email" => $user->user_email,
621
- "invoice_id" => $invoice->code,
622
"invoice_total" => $pmpro_currency_symbol . number_format($invoice->total, 2),
623
"invoice_date" => date(get_option('date_format'), $invoice->timestamp),
624
"billing_name" => $invoice->billing->name,
@@ -632,9 +629,9 @@
632
"accountnumber" => hideCardNumber($invoice->accountnumber),
633
"expirationmonth" => $invoice->expirationmonth,
634
"expirationyear" => $invoice->expirationyear,
635
- "login_link" => wp_login_url(pmpro_url("account")),
636
- "invoice_link" => wp_login_url(pmpro_url("invoice", "?invoice=" . $invoice->code)
637
- ));
638
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
639
$invoice->billing->street,
640
"", //address 2
@@ -694,7 +691,7 @@
694
"cycle_period" => $user->membership_level->cycle_period,
695
"trial_amount" => $pmpro_currency_symbol . $user->membership_level->trial_amount,
696
"trial_limit" => $user->membership_level->trial_limit,
697
- "trial_end" => date(get_option('date_format'), strtotime(date("m/d/Y", $user->membership_level->startdate) . " + " . $user->membership_level->trial_limit . " " . $user->membership_level->cycle_period), current_time("timestamp"))
698
);
699
700
return $this->sendEmail();
@@ -799,7 +796,7 @@
799
if($user->membership_level->ID)
800
$this->data["membership_change"] = sprintf(__("The new level is %s. This membership is free", "pmpro"), $user->membership_level->name);
801
else
802
- $this->data["membership_change"] = __("Membership has been cancelled", "pmpro");
803
804
if(!empty($user->membership_level->enddate))
805
{
44
45
$this->headers = array("Content-Type: text/html");
46
47
//load the template
48
$locale = apply_filters("plugin_locale", get_locale(), "pmpro");
49
if(file_exists(get_stylesheet_directory() . "/paid-memberships-pro/email/" . $this->template . ".html"))
98
$this->template = apply_filters("pmpro_email_template", $temail->template, $this);
99
$this->body = apply_filters("pmpro_email_body", $temail->body, $this);
100
$this->headers = apply_filters("pmpro_email_headers", $temail->headers, $this);
101
+
102
+ if(wp_mail($this->email,$this->subject,$this->body,$this->headers))
103
{
104
return true;
105
}
183
"membership_id" => $user->membership_level->id,
184
"membership_level_name" => $user->membership_level->name,
185
"membership_cost" => pmpro_getLevelCost($user->membership_level),
186
+ "login_link" => pmpro_url("account"),
187
"display_name" => $user->display_name,
188
"user_email" => $user->user_email,0
189
);
283
"membership_id" => $user->membership_level->id,
284
"membership_level_name" => $user->membership_level->name,
285
"membership_cost" => pmpro_getLevelCost($user->membership_level),
286
+ "login_link" => pmpro_url("account"),
287
"display_name" => $user->display_name,
288
"user_email" => $user->user_email,0
289
);
384
"accountnumber" => hideCardNumber($invoice->accountnumber),
385
"expirationmonth" => $invoice->expirationmonth,
386
"expirationyear" => $invoice->expirationyear,
387
+ "login_link" => pmpro_url("account")
388
);
389
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
390
$invoice->billing->street,
485
"accountnumber" => hideCardNumber($invoice->accountnumber),
486
"expirationmonth" => $invoice->expirationmonth,
487
"expirationyear" => $invoice->expirationyear,
488
+ "login_link" => pmpro_url("billing")
489
);
490
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
491
$invoice->billing->street,
531
"accountnumber" => hideCardNumber($invoice->accountnumber),
532
"expirationmonth" => $invoice->expirationmonth,
533
"expirationyear" => $invoice->expirationyear,
534
+ "login_link" => pmpro_url("billing")
535
);
536
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
537
$invoice->billing->street,
578
"accountnumber" => hideCardNumber($invoice->accountnumber),
579
"expirationmonth" => $invoice->expirationmonth,
580
"expirationyear" => $invoice->expirationyear,
581
+ "login_link" => pmpro_url("billing")
582
);
583
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
584
$invoice->billing->street,
615
"membership_level_name" => $user->membership_level->name,
616
"display_name" => $user->display_name,
617
"user_email" => $user->user_email,
618
+ "invoice_id" => $invoice->payment_transaction_id,
619
"invoice_total" => $pmpro_currency_symbol . number_format($invoice->total, 2),
620
"invoice_date" => date(get_option('date_format'), $invoice->timestamp),
621
"billing_name" => $invoice->billing->name,
629
"accountnumber" => hideCardNumber($invoice->accountnumber),
630
"expirationmonth" => $invoice->expirationmonth,
631
"expirationyear" => $invoice->expirationyear,
632
+ "login_link" => pmpro_url("account"),
633
+ "invoice_link" => pmpro_url("invoice", "?invoice=" . $invoice->code)
634
+ );
635
$this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name,
636
$invoice->billing->street,
637
"", //address 2
691
"cycle_period" => $user->membership_level->cycle_period,
692
"trial_amount" => $pmpro_currency_symbol . $user->membership_level->trial_amount,
693
"trial_limit" => $user->membership_level->trial_limit,
694
+ "trial_end" => date(get_option('date_format'), strtotime(date("m/d/Y", $user->membership_level->startdate) . " + " . $user->membership_level->trial_limit . " " . $user->membership_level->cycle_period))
695
);
696
697
return $this->sendEmail();
796
if($user->membership_level->ID)
797
$this->data["membership_change"] = sprintf(__("The new level is %s. This membership is free", "pmpro"), $user->membership_level->name);
798
else
799
+ $this->data["membership_change"] = __("membership has been cancelled", "pmpro");
800
801
if(!empty($user->membership_level->enddate))
802
{
classes/gateways/class.pmprogateway.php CHANGED
@@ -43,7 +43,7 @@
43
else
44
{
45
//add a period to the start date to account for the initial payment
46
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
47
}
48
49
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
@@ -90,7 +90,7 @@
90
else
91
{
92
//add a period to the start date to account for the initial payment
93
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $this->BillingFrequency . " " . $this->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
94
}
95
96
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
@@ -200,21 +200,5 @@
200
$order->updateStatus("cancelled");
201
return true;
202
}
203
-
204
- function getSubscriptionStatus(&$order)
205
- {
206
- //require a subscription id
207
- if(empty($order->subscription_transaction_id))
208
- return false;
209
-
210
- //this looks different for each gateway, but generally an array of some sort
211
- return array();
212
- }
213
-
214
- function getTransactionStatus(&$order)
215
- {
216
- //this looks different for each gateway, but generally an array of some sort
217
- return array();
218
- }
219
}
220
?>
43
else
44
{
45
//add a period to the start date to account for the initial payment
46
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
47
}
48
49
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
90
else
91
{
92
//add a period to the start date to account for the initial payment
93
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $this->BillingFrequency . " " . $this->BillingPeriod)) . "T0:0:0";
94
}
95
96
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
200
$order->updateStatus("cancelled");
201
return true;
202
}
203
}
204
?>
classes/gateways/class.pmprogateway_authorizenet.php CHANGED
@@ -43,7 +43,7 @@
43
else
44
{
45
//add a period to the start date to account for the initial payment
46
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
47
}
48
49
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
@@ -90,7 +90,7 @@
90
else
91
{
92
//add a period to the start date to account for the initial payment
93
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
94
}
95
96
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
43
else
44
{
45
//add a period to the start date to account for the initial payment
46
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
47
}
48
49
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
90
else
91
{
92
//add a period to the start date to account for the initial payment
93
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
94
}
95
96
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
classes/gateways/class.pmprogateway_braintree.php CHANGED
@@ -296,13 +296,13 @@
296
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
297
298
//convert to a profile start date
299
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day", current_time("timestamp"))) . "T0:0:0";
300
301
//filter the start date
302
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
303
304
//convert back to days
305
- $trial_period_days = ceil(abs(strtotime(date("Y-m-d")) - strtotime($order->ProfileStartDate, current_time("timestamp"))) / 86400);
306
307
//now add the actual trial set by the site
308
if(!empty($order->TrialBillingCycles))
296
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
297
298
//convert to a profile start date
299
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day")) . "T0:0:0";
300
301
//filter the start date
302
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
303
304
//convert back to days
305
+ $trial_period_days = ceil(abs(strtotime(date("Y-m-d")) - strtotime($order->ProfileStartDate)) / 86400);
306
307
//now add the actual trial set by the site
308
if(!empty($order->TrialBillingCycles))
classes/gateways/class.pmprogateway_check.php CHANGED
@@ -48,7 +48,7 @@
48
else
49
{
50
//add a period to the start date to account for the initial payment
51
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
52
}
53
54
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
@@ -95,7 +95,7 @@
95
else
96
{
97
//add a period to the start date to account for the initial payment
98
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $this->BillingFrequency . " " . $this->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
99
}
100
101
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
48
else
49
{
50
//add a period to the start date to account for the initial payment
51
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
52
}
53
54
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
95
else
96
{
97
//add a period to the start date to account for the initial payment
98
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $this->BillingFrequency . " " . $this->BillingPeriod)) . "T0:0:0";
99
}
100
101
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
classes/gateways/class.pmprogateway_cybersource.php CHANGED
@@ -45,7 +45,7 @@
45
else
46
{
47
//add a period to the start date to account for the initial payment
48
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
49
}
50
51
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
@@ -92,7 +92,7 @@
92
else
93
{
94
//add a period to the start date to account for the initial payment
95
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $this->BillingFrequency . " " . $this->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
96
}
97
98
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
@@ -464,13 +464,13 @@
464
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
465
466
//convert to a profile start date
467
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day", current_time("timestamp"))) . "T0:0:0";
468
469
//filter the start date
470
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
471
472
//convert back to days
473
- $trial_period_days = ceil(abs(strtotime(date("Y-m-d"), current_time('timestamp')) - strtotime($order->ProfileStartDate, current_time("timestamp"))) / 86400);
474
475
//now add the actual trial set by the site
476
if(!empty($order->TrialBillingCycles))
@@ -762,4 +762,4 @@
762
else
763
return "Unknown error.";
764
}
765
- }
45
else
46
{
47
//add a period to the start date to account for the initial payment
48
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
49
}
50
51
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
92
else
93
{
94
//add a period to the start date to account for the initial payment
95
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $this->BillingFrequency . " " . $this->BillingPeriod)) . "T0:0:0";
96
}
97
98
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
464
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
465
466
//convert to a profile start date
467
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day")) . "T0:0:0";
468
469
//filter the start date
470
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
471
472
//convert back to days
473
+ $trial_period_days = ceil(abs(strtotime(date("Y-m-d")) - strtotime($order->ProfileStartDate)) / 86400);
474
475
//now add the actual trial set by the site
476
if(!empty($order->TrialBillingCycles))
762
else
763
return "Unknown error.";
764
}
765
+ }
classes/gateways/class.pmprogateway_payflowpro.php CHANGED
@@ -17,7 +17,7 @@
17
if($authorization_id)
18
{
19
$this->void($order, $authorization_id);
20
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
21
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
22
return $this->subscribe($order);
23
}
@@ -36,7 +36,7 @@
36
//setup recurring billing
37
if(pmpro_isLevelRecurring($order->membership_level))
38
{
39
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
40
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
41
if($this->subscribe($order))
42
{
@@ -159,7 +159,7 @@
159
160
//paypal profile stuff
161
$nvpStr = "";
162
- $nvpStr .="&AMT=" . $amount . "&TAXAMT=" . $amount_tax . "&CURRENCY=" . $pmpro_currency;
163
$nvpStr .= "&NOTIFYURL=" . urlencode(admin_url('admin-ajax.php') . "?action=ipnhandler");
164
//$nvpStr .= "&L_BILLINGTYPE0=RecurringPayments&L_BILLINGAGREEMENTDESCRIPTION0=" . $order->PaymentAmount;
165
@@ -179,7 +179,7 @@
179
$nvpStr .= "&CITY=" . $order->billing->city . "&STATE=" . $order->billing->state . "&BILLTOCOUNTRY=" . $order->billing->country . "&ZIP=" . $order->billing->zip . "&PHONENUM=" . $order->billing->phone;
180
}
181
182
- $this->nvpStr = $nvpStr;
183
$this->httpParsedResponseAr = $this->PPHttpPost('S', $nvpStr);
184
185
if("0" == strtoupper($this->httpParsedResponseAr["RESULT"])) {
@@ -219,7 +219,7 @@
219
220
//paypal profile stuff
221
$nvpStr = "&ACTION=A";
222
- $nvpStr .="&AMT=" . $amount . "&TAXAMT=" . $amount_tax . "&CURRENCY=" . $pmpro_currency;
223
$nvpStr .= "&NOTIFYURL=" . urlencode(admin_url('admin-ajax.php') . "?action=ipnhandler");
224
//$nvpStr .= "&L_BILLINGTYPE0=RecurringPayments&L_BILLINGAGREEMENTDESCRIPTION0=" . $order->PaymentAmount;
225
@@ -253,13 +253,13 @@
253
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
254
255
//convert to a profile start date
256
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day", current_time("timestamp"))) . "T0:0:0";
257
258
//filter the start date
259
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
260
261
//convert back to days
262
- $trial_period_days = ceil(abs(strtotime(date("Y-m-d"), current_time('timestamp')) - strtotime($order->ProfileStartDate, current_time("timestamp"))) / 86400);
263
264
//now add the actual trial set by the site
265
if(!empty($order->TrialBillingCycles))
@@ -276,7 +276,7 @@
276
}
277
278
//convert back into a date
279
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day", current_time("timestamp"))) . "T0:0:0";
280
281
//start date
282
$nvpStr .= "&START=" . date("mdY", strtotime($order->ProfileStartDate));
@@ -365,13 +365,10 @@
365
$this->nvpStr = $nvpStr;
366
$this->httpParsedResponseAr = $this->PPHttpPost('R', $nvpStr);
367
368
- if("0" == strtoupper($this->httpParsedResponseAr["RESULT"]))
369
- {
370
$order->updateStatus("cancelled");
371
return true;
372
- }
373
- else
374
- {
375
$order->status = "error";
376
$order->errorcode = $this->httpParsedResponseAr['RESULT'];
377
$order->error = urldecode($this->httpParsedResponseAr['RESPMSG']);
@@ -445,4 +442,4 @@
445
446
return $httpParsedResponseAr;
447
}
448
- }
17
if($authorization_id)
18
{
19
$this->void($order, $authorization_id);
20
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
21
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
22
return $this->subscribe($order);
23
}
36
//setup recurring billing
37
if(pmpro_isLevelRecurring($order->membership_level))
38
{
39
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
40
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
41
if($this->subscribe($order))
42
{
159
160
//paypal profile stuff
161
$nvpStr = "";
162
+ $nvpStr .="&AMT=" . $amount . "&TAXAMT=" . $amount_tax;
163
$nvpStr .= "&NOTIFYURL=" . urlencode(admin_url('admin-ajax.php') . "?action=ipnhandler");
164
//$nvpStr .= "&L_BILLINGTYPE0=RecurringPayments&L_BILLINGAGREEMENTDESCRIPTION0=" . $order->PaymentAmount;
165
179
$nvpStr .= "&CITY=" . $order->billing->city . "&STATE=" . $order->billing->state . "&BILLTOCOUNTRY=" . $order->billing->country . "&ZIP=" . $order->billing->zip . "&PHONENUM=" . $order->billing->phone;
180
}
181
182
+ $this->nvpStr = $nvpStr;
183
$this->httpParsedResponseAr = $this->PPHttpPost('S', $nvpStr);
184
185
if("0" == strtoupper($this->httpParsedResponseAr["RESULT"])) {
219
220
//paypal profile stuff
221
$nvpStr = "&ACTION=A";
222
+ $nvpStr .="&AMT=" . $amount . "&TAXAMT=" . $amount_tax;
223
$nvpStr .= "&NOTIFYURL=" . urlencode(admin_url('admin-ajax.php') . "?action=ipnhandler");
224
//$nvpStr .= "&L_BILLINGTYPE0=RecurringPayments&L_BILLINGAGREEMENTDESCRIPTION0=" . $order->PaymentAmount;
225
253
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
254
255
//convert to a profile start date
256
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day")) . "T0:0:0";
257
258
//filter the start date
259
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
260
261
//convert back to days
262
+ $trial_period_days = ceil(abs(strtotime(date("Y-m-d")) - strtotime($order->ProfileStartDate)) / 86400);
263
264
//now add the actual trial set by the site
265
if(!empty($order->TrialBillingCycles))
276
}
277
278
//convert back into a date
279
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day")) . "T0:0:0";
280
281
//start date
282
$nvpStr .= "&START=" . date("mdY", strtotime($order->ProfileStartDate));
365
$this->nvpStr = $nvpStr;
366
$this->httpParsedResponseAr = $this->PPHttpPost('R', $nvpStr);
367
368
+ if("0" == strtoupper($this->httpParsedResponseAr["RESULT"])) {
369
$order->updateStatus("cancelled");
370
return true;
371
+ } else {
372
$order->status = "error";
373
$order->errorcode = $this->httpParsedResponseAr['RESULT'];
374
$order->error = urldecode($this->httpParsedResponseAr['RESPMSG']);
442
443
return $httpParsedResponseAr;
444
}
445
+ }
classes/gateways/class.pmprogateway_paypal.php CHANGED
@@ -17,7 +17,7 @@
17
if($authorization_id)
18
{
19
$this->void($order, $authorization_id);
20
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
21
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
22
return $this->subscribe($order);
23
}
@@ -36,7 +36,7 @@
36
//setup recurring billing
37
if(pmpro_isLevelRecurring($order->membership_level))
38
{
39
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
40
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
41
if($this->subscribe($order))
42
{
@@ -369,23 +369,21 @@
369
{
370
//paypal profile stuff
371
$nvpStr = "";
372
- $nvpStr .= "&PROFILEID=" . urlencode($order->subscription_transaction_id) . "&ACTION=Cancel&NOTE=" . urlencode("User requested cancel.");
373
374
$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);
375
376
- if("SUCCESS" == strtoupper($this->httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($this->httpParsedResponseAr["ACK"]))
377
- {
378
$order->updateStatus("cancelled");
379
- return true;
380
- }
381
- else
382
- {
383
$order->status = "error";
384
$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];
385
- $order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']) . ". " . __("Please contact the site owner or cancel your subscription from within PayPal to make sure you are not charged going forward.", "pmpro");
386
$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);
387
-
388
- return false;
389
}
390
}
391
17
if($authorization_id)
18
{
19
$this->void($order, $authorization_id);
20
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
21
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
22
return $this->subscribe($order);
23
}
36
//setup recurring billing
37
if(pmpro_isLevelRecurring($order->membership_level))
38
{
39
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
40
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
41
if($this->subscribe($order))
42
{
369
{
370
//paypal profile stuff
371
$nvpStr = "";
372
+ $nvpStr .= "&PROFILEID=" . $order->subscription_transaction_id . "&ACTION=Cancel&NOTE=User requested cancel.";
373
374
$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);
375
376
+ if("SUCCESS" == strtoupper($this->httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($this->httpParsedResponseAr["ACK"]) || $this->httpParsedResponseAr['L_ERRORCODE0'] == "11556") {
377
$order->updateStatus("cancelled");
378
+ return true;
379
+ //exit('CreateRecurringPaymentsProfile Completed Successfully: '.print_r($this->httpParsedResponseAr, true));
380
+ } else {
381
$order->status = "error";
382
$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];
383
+ $order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']);
384
$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);
385
+ return false;
386
+ //exit('CreateRecurringPaymentsProfile failed: ' . print_r($httpParsedResponseAr, true));
387
}
388
}
389
classes/gateways/class.pmprogateway_paypalexpress.php CHANGED
@@ -12,7 +12,7 @@
12
{
13
if(pmpro_isLevelRecurring($order->membership_level))
14
{
15
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
16
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
17
return $this->subscribe($order);
18
}
@@ -47,7 +47,7 @@
47
//paypal profile stuff
48
$nvpStr = "";
49
$nvpStr .="&AMT=" . $initial_payment . "&CURRENCYCODE=" . $pmpro_currency;
50
- if(!empty($order->ProfileStartDate) && strtotime($order->ProfileStartDate, current_time("timestamp")) > 0)
51
$nvpStr .= "&PROFILESTARTDATE=" . $order->ProfileStartDate;
52
if(!empty($order->BillingFrequency))
53
$nvpStr .= "&BILLINGPERIOD=" . $order->BillingPeriod . "&BILLINGFREQUENCY=" . $order->BillingFrequency . "&AUTOBILLAMT=AddToNextBilling&L_BILLINGTYPE0=RecurringPayments";
@@ -89,10 +89,6 @@
89
90
$nvpStr .= "&CANCELURL=" . urlencode(pmpro_url("levels"));
91
92
- $account_optional = apply_filters('pmpro_paypal_account_optional', true);
93
- if ($account_optional)
94
- $nvpStr .= '&SOLUTIONTYPE=Sole&LANDINGPAGE=Billing';
95
-
96
$nvpStr = apply_filters("pmpro_set_express_checkout_nvpstr", $nvpStr, $order);
97
98
///echo str_replace("&", "&<br />", $nvpStr);
@@ -289,51 +285,24 @@
289
{
290
//paypal profile stuff
291
$nvpStr = "";
292
- $nvpStr .= "&PROFILEID=" . urlencode($order->subscription_transaction_id) . "&ACTION=Cancel&NOTE=" . urlencode("User requested cancel.");
293
294
$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);
295
296
- if("SUCCESS" == strtoupper($this->httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($this->httpParsedResponseAr["ACK"]))
297
- {
298
$order->updateStatus("cancelled");
299
- return true;
300
- }
301
- else
302
- {
303
$order->status = "error";
304
$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];
305
- $order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']) . ". " . __("Please contact the site owner or cancel your subscription from within PayPal to make sure you are not charged going forward.", "pmpro");
306
$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);
307
308
- return false;
309
- }
310
- }
311
-
312
- function getSubscriptionStatus(&$order)
313
- {
314
- if(empty($order->subscription_transaction_id))
315
return false;
316
-
317
- //paypal profile stuff
318
- $nvpStr = "";
319
- $nvpStr .= "&PROFILEID=" . urlencode($order->subscription_transaction_id);
320
-
321
- $this->httpParsedResponseAr = $this->PPHttpPost('GetRecurringPaymentsProfileDetails', $nvpStr);
322
-
323
- if("SUCCESS" == strtoupper($this->httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($this->httpParsedResponseAr["ACK"]))
324
- {
325
- return $this->httpParsedResponseAr;
326
- }
327
- else
328
- {
329
- $order->status = "error";
330
- $order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];
331
- $order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']);
332
- $order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);
333
-
334
- return false;
335
}
336
- }
337
338
/**
339
* PAYPAL Function
@@ -399,4 +368,4 @@
399
400
return $httpParsedResponseAr;
401
}
402
- }
12
{
13
if(pmpro_isLevelRecurring($order->membership_level))
14
{
15
+ $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
16
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
17
return $this->subscribe($order);
18
}
47
//paypal profile stuff
48
$nvpStr = "";
49
$nvpStr .="&AMT=" . $initial_payment . "&CURRENCYCODE=" . $pmpro_currency;
50
+ if(!empty($order->ProfileStartDate) && strtotime($order->ProfileStartDate) > 0)
51
$nvpStr .= "&PROFILESTARTDATE=" . $order->ProfileStartDate;
52
if(!empty($order->BillingFrequency))
53
$nvpStr .= "&BILLINGPERIOD=" . $order->BillingPeriod . "&BILLINGFREQUENCY=" . $order->BillingFrequency . "&AUTOBILLAMT=AddToNextBilling&L_BILLINGTYPE0=RecurringPayments";
89
90
$nvpStr .= "&CANCELURL=" . urlencode(pmpro_url("levels"));
91
92
$nvpStr = apply_filters("pmpro_set_express_checkout_nvpstr", $nvpStr, $order);
93
94
///echo str_replace("&", "&<br />", $nvpStr);
285
{
286
//paypal profile stuff
287
$nvpStr = "";
288
+ $nvpStr .= "&PROFILEID=" . $order->subscription_transaction_id . "&ACTION=Cancel&NOTE=User requested cancel.";
289
290
$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);
291
292
+ if("SUCCESS" == strtoupper($this->httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($this->httpParsedResponseAr["ACK"]) || $this->httpParsedResponseAr['L_ERRORCODE0'] == "11556") {
293
$order->updateStatus("cancelled");
294
+ return true;
295
+ //exit('CreateRecurringPaymentsProfile Completed Successfully: '.print_r($this->httpParsedResponseAr, true));
296
+ } else {
297
$order->status = "error";
298
$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];
299
+ $order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']);
300
$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);
301
302
return false;
303
+ //exit('CreateRecurringPaymentsProfile failed: ' . print_r($httpParsedResponseAr, true));
304
}
305
+ }
306
307
/**
308
* PAYPAL Function
368
369
return $httpParsedResponseAr;
370
}
371
+ }
classes/gateways/class.pmprogateway_paypalstandard.php CHANGED
@@ -114,13 +114,13 @@
114
else
115
{
116
//we can try to work in any change in ProfileStartDate
117
- $psd = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod, current_time("timestamp"))) . "T0:0:0";
118
$adjusted_psd = apply_filters("pmpro_profile_start_date", $psd, $order);
119
if($psd != $adjusted_psd)
120
{
121
//someone is trying to push the start date back
122
- $adjusted_psd_time = strtotime($adjusted_psd, current_time("timestamp"));
123
- $seconds_til_psd = $adjusted_psd_time - current_time('timestamp');
124
$days_til_psd = floor($seconds_til_psd/(60*60*24));
125
126
//push back trial one by days_til_psd
@@ -144,20 +144,9 @@
144
if(!empty($order->TotalBillingCycles))
145
{
146
if(!empty($trial_amount))
147
- {
148
-
149
- $srt = intval($order->TotalBillingCycles) - 1; //subtract one for the trial period
150
- }
151
- else
152
- {
153
- $srt = intval($order->TotalBillingCycles);
154
- }
155
-
156
- //srt must be at least 2 or the subscription is not "recurring" according to paypal
157
- if($srt > 1)
158
- $paypal_args['srt'] = $srt;
159
else
160
- $paypal_args['src'] = '0';
161
}
162
else
163
$paypal_args['srt'] = '0'; //indefinite subscription
@@ -195,17 +184,13 @@
195
foreach($additional_parameters as $key => $value)
196
$nvpStr .= urlencode("&" . $key . "=" . $value);
197
}
198
-
199
- $account_optional = apply_filters('pmpro_paypal_account_optional', true);
200
- if ($account_optional)
201
- $nvpStr .= '&SOLUTIONTYPE=Sole&LANDINGPAGE=Billing';
202
203
$nvpStr = apply_filters("pmpro_paypal_standard_nvpstr", $nvpStr, $order);
204
205
//redirect to paypal
206
$paypal_url .= $nvpStr;
207
208
- //wp_die(str_replace("&", "<br />", $paypal_url));
209
210
wp_redirect($paypal_url);
211
exit;
@@ -219,19 +204,18 @@
219
220
$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);
221
222
- if("SUCCESS" == strtoupper($this->httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($this->httpParsedResponseAr["ACK"]))
223
- {
224
$order->updateStatus("cancelled");
225
- return true;
226
- }
227
- else
228
- {
229
$order->status = "error";
230
$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];
231
- $order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']) . ". " . __("Please contact the site owner or cancel your subscription from within PayPal to make sure you are not charged going forward.", "pmpro");
232
$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);
233
234
- return false;
235
}
236
}
237
@@ -299,4 +283,4 @@
299
300
return $httpParsedResponseAr;
301
}
302
- }
114
else
115
{
116
//we can try to work in any change in ProfileStartDate
117
+ $psd = date("Y-m-d", strtotime("+ " . $order->BillingFrequency . " " . $order->BillingPeriod)) . "T0:0:0";
118
$adjusted_psd = apply_filters("pmpro_profile_start_date", $psd, $order);
119
if($psd != $adjusted_psd)
120
{
121
//someone is trying to push the start date back
122
+ $adjusted_psd_time = strtotime($adjusted_psd);
123
+ $seconds_til_psd = $adjusted_psd_time - time();
124
$days_til_psd = floor($seconds_til_psd/(60*60*24));
125
126
//push back trial one by days_til_psd
144
if(!empty($order->TotalBillingCycles))
145
{
146
if(!empty($trial_amount))
147
+ $paypal_args['srt'] = intval($order->TotalBillingCycles) - 1; //subtract 1 for the trial period
148
else
149
+ $paypal_args['srt'] = intval($order->TotalBillingCycles);
150
}
151
else
152
$paypal_args['srt'] = '0'; //indefinite subscription
184
foreach($additional_parameters as $key => $value)
185
$nvpStr .= urlencode("&" . $key . "=" . $value);
186
}
187
188
$nvpStr = apply_filters("pmpro_paypal_standard_nvpstr", $nvpStr, $order);
189
190
//redirect to paypal
191
$paypal_url .= $nvpStr;
192
193
+ //die($paypal_url);
194
195
wp_redirect($paypal_url);
196
exit;
204
205
$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);
206
207
+ if("SUCCESS" == strtoupper($this->httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($this->httpParsedResponseAr["ACK"]) || $this->httpParsedResponseAr['L_ERRORCODE0'] == "11556") {
208
$order->updateStatus("cancelled");
209
+ return true;
210
+ //exit('CreateRecurringPaymentsProfile Completed Successfully: '.print_r($this->httpParsedResponseAr, true));
211
+ } else {
212
$order->status = "error";
213
$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];
214
+ $order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']);
215
$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);
216
217
+ return false;
218
+ //exit('CreateRecurringPaymentsProfile failed: ' . print_r($httpParsedResponseAr, true));
219
}
220
}
221
283
284
return $httpParsedResponseAr;
285
}
286
+ }
classes/gateways/class.pmprogateway_stripe.php CHANGED
@@ -58,8 +58,6 @@
58
59
function charge(&$order)
60
{
61
- global $pmpro_currency;
62
-
63
//create a code for the order
64
if(empty($order->code))
65
$order->code = $order->getRandomCode();
@@ -85,7 +83,7 @@
85
{
86
$response = Stripe_Charge::create(array(
87
"amount" => $amount * 100, # amount in cents, again
88
- "currency" => $pmpro_currency,
89
"customer" => $this->customer->id,
90
"description" => "Order #" . $order->code . ", " . trim($order->FirstName . " " . $order->LastName) . " (" . $order->Email . ")"
91
)
@@ -178,7 +176,7 @@
178
}
179
180
return $this->customer;
181
- }
182
catch (Exception $e)
183
{
184
//assume no customer found
@@ -203,25 +201,9 @@
203
return false;
204
}
205
206
- if(!empty($user_id))
207
- {
208
- //user logged in/etc
209
- update_user_meta($user_id, "pmpro_stripe_customerid", $this->customer->id);
210
- }
211
- else
212
- {
213
- //user not registered yet, queue it up
214
- global $pmpro_stripe_customer_id;
215
- $pmpro_stripe_customer_id = $this->customer->id;
216
- function pmpro_user_register_stripe_customerid($user_id)
217
- {
218
- global $pmpro_stripe_customer_id;
219
- update_user_meta($user_id, "pmpro_stripe_customerid", $pmpro_stripe_customer_id);
220
- }
221
- add_action("user_register", "pmpro_user_register_stripe_customerid");
222
- }
223
-
224
- return apply_filters('pmpro_stripe_create_customer', $this->customer);
225
}
226
227
return false;
@@ -229,8 +211,6 @@
229
230
function subscribe(&$order)
231
{
232
- global $pmpro_currency;
233
-
234
//create a code for the order
235
if(empty($order->code))
236
$order->code = $order->getRandomCode();
@@ -266,13 +246,13 @@
266
$trial_period_days = $order->BillingFrequency * 30; //assume monthly
267
268
//convert to a profile start date
269
- $order->ProfileStartDate = date("Y-m-d", strtotime("+ " . $trial_period_days . " Day", current_time("timestamp"))) . "T0:0:0";
270
271
//filter the start date
272
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
273
274
//convert back to days
275
- $trial_period_days = ceil(abs(strtotime(date("Y-m-d"), current_time("timestamp")) - strtotime($order->ProfileStartDate, current_time("timestamp"))) / 86400);
276
277
//now add the actual trial set by the site
278
if(!empty($order->TrialBillingCycles))
@@ -290,18 +270,16 @@
290
291
//create a plan
292
try
293
- {
294
- $plan = array(
295
- "amount" => $amount * 100,
296
- "interval_count" => $order->BillingFrequency,
297
- "interval" => strtolower($order->BillingPeriod),
298
- "trial_period_days" => $trial_period_days,
299
- "name" => $order->membership_name . " for order " . $order->code,
300
- "currency" => strtolower($pmpro_currency),
301
- "id" => $order->code
302
- );
303
-
304
- $plan = Stripe_Plan::create(apply_filters('pmpro_stripe_create_plan_array', $plan));
305
}
306
catch (Exception $e)
307
{
@@ -353,48 +331,29 @@
353
354
function cancel(&$order)
355
{
356
- //no matter what happens below, we're going to cancel the order in our system
357
- $order->updateStatus("cancelled");
358
-
359
//require a subscription id
360
if(empty($order->subscription_transaction_id))
361
return false;
362
363
//find the customer
364
- $this->getCustomer($order);
365
366
if(!empty($this->customer))
367
{
368
- //find subscription with this order code
369
- $subscriptions = $this->customer->subscriptions->all();
370
-
371
- if(!empty($subscriptions))
372
{
373
- //in case only one is returned
374
- if(!is_array($subscriptions))
375
- $subscriptions = array($subscriptions);
376
-
377
- foreach($subscriptions as $sub)
378
- {
379
- if($sub->data[0]->plan->id == $order->code)
380
- {
381
- //found it, cancel it
382
- try
383
- {
384
- $this->customer->subscriptions->retrieve($sub->data[0]->id)->cancel();
385
- break;
386
- }
387
- catch(Exception $e)
388
- {
389
- $order->error = __("Could not cancel old subscription.", "pmpro");
390
- $order->shorterror = $order->error;
391
-
392
- return false;
393
- }
394
- }
395
- }
396
- }
397
398
return true;
399
}
400
else
58
59
function charge(&$order)
60
{
61