Paid Memberships Pro - Version 1.7.4

Version Description

  • Updated PayPal IPN to use HTTP 1.1 and "Connection: Close" per recent PayPal IPN updates.
  • Fixed bug with slashes being added to the SSL Seal text when Payment Settings are saved.
  • Now applying the pmpro_checkout_level filter when a membership level is loaded from an order during the review step with PayPal Express checkouts. This will fix many customizations that might have not worked with PayPal Express.
  • Cleaned up PayPal Express API integration a bit. Fixes some bugs on sites with one-time payments and taxes calculated in.
  • Change the use_ssl payment setting. You can choose "No" now for gateways that require SSL. Just make sure you set it to Yes when going live or use another method to force SSL on your checkout page. You can also set it to Yes (use JavaScript redirect) to fix some issues that come up with infinite redirects on shared hosting with specific caching/proxy techniques.
  • Optimized the members list and orders CSV exports to run with less memory. Especially important for large sites.
  • Including Italian, French, Spanish/Peru, and Spanish/Chile language files contributed from the community. Thanks Mirco Babini (mirkolofio on GitHub) and Javier Monorov (zillionsk8 on GitHub)
  • Fixed the email template issue for admin emails as well. The email sent to admins for free checkouts won't include the empty billing address info anymore. (Thanks, inator on GitHub)
  • Now redirecting from /register/ to PMPro levels page when latest versions of Theme My Login are activated. Can still disable by returning false with the pmpro_register_redirect or pmpro_login_redirect filter.
  • Now showing a "renew" button for the current user's level on the levels page if their level is not recurring.
  • Fix in crons.php where in rare cases the pmpro_expiration_notice meta was not being set correctly for users, which might lead to multiple expiration warning emails.
  • Updated pmpro_next_payment to work for any cycle number or period. (Thanks, antonv and others.)
  • Now checking for a logged in user before trying to get a billing address to prepopulate at checkout.
  • Updated frontend.css to make sure that background gifs in error messages aren't repeated or applied to dropdowns.
  • Added some currencies: CNY, INR, IDR, KRW, TRY, VND, ZAR
  • All currencies now available to all gateways. You still need to make sure that your gateway supports the chosen currency.
  • Now sending all emails from the PMProEmail class from the pmpro_getOption("from_email") setting. Some were sent from the get_option("admin_email") setting before.
Download this release

Release Info

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

Code changes from version 1.7.14 to 1.7.4

Files changed (186) 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 +2 -2
  7. adminpages/addons/pmpro-affiliates.php +2 -2
  8. adminpages/addons/pmpro-aweber.php +2 -2
  9. adminpages/addons/pmpro-bbpress.php +6 -9
  10. adminpages/addons/pmpro-constant-contact.php +0 -31
  11. adminpages/addons/pmpro-email-templates.php +0 -31
  12. adminpages/addons/pmpro-expiration.php +8 -10
  13. adminpages/addons/pmpro-freeaddress.php +5 -7
  14. adminpages/addons/pmpro-infusionsoft.php +4 -4
  15. adminpages/addons/pmpro-mailchimp.php +3 -3
  16. adminpages/addons/pmpro-network-subsite.php +0 -31
  17. adminpages/addons/pmpro-post-affiliate-pro.php +1 -1
  18. adminpages/addons/pmpro-register-helper.php +1 -1
  19. adminpages/addons/pmpro-series.php +1 -1
  20. adminpages/addons/pmpro-shipping.php +1 -1
  21. adminpages/addons/pmpro-user-pages.php +1 -1
  22. adminpages/addons/pmpro-woocommerce.php +0 -31
  23. adminpages/addons/pmpro-wp-affiliate.php +3 -5
  24. adminpages/addons/tml.php +1 -1
  25. adminpages/addons/wp-bouncer.php +1 -1
  26. adminpages/admin_header.php +2 -3
  27. adminpages/advancedsettings.php +12 -96
  28. adminpages/dashboard.php +2 -2
  29. adminpages/discountcodes.php +24 -29
  30. adminpages/emailsettings.php +152 -181
  31. adminpages/functions.php +6 -6
  32. adminpages/membershiplevels.php +11 -17
  33. adminpages/memberslist-csv.php +22 -76
  34. adminpages/memberslist.php +30 -58
  35. adminpages/orders-csv.php +14 -116
  36. adminpages/orders.php +9 -314
  37. adminpages/pagesettings.php +9 -51
  38. adminpages/paymentsettings.php +13 -19
  39. adminpages/reports.php +0 -3
  40. adminpages/reports/login.php +7 -7
  41. adminpages/reports/memberships.php +18 -18
  42. adminpages/reports/sales.php +42 -40
  43. classes/class.memberorder.php +16 -75
  44. classes/class.pmproemail.php +19 -87
  45. classes/gateways/class.pmprogateway.php +3 -19
  46. classes/gateways/class.pmprogateway_authorizenet.php +2 -2
  47. classes/gateways/class.pmprogateway_braintree.php +12 -12
  48. classes/gateways/class.pmprogateway_check.php +2 -2
  49. classes/gateways/class.pmprogateway_cybersource.php +5 -5
  50. classes/gateways/class.pmprogateway_payflowpro.php +15 -18
  51. classes/gateways/class.pmprogateway_paypal.php +10 -12
  52. classes/gateways/class.pmprogateway_paypalexpress.php +14 -52
  53. classes/gateways/class.pmprogateway_paypalstandard.php +16 -33
  54. classes/gateways/class.pmprogateway_stripe.php +31 -81
  55. classes/gateways/class.pmprogateway_twocheckout.php +16 -20
  56. css/admin-rtl.css +0 -63
  57. css/admin.css +5 -5
  58. css/frontend-rtl.css +0 -111
  59. css/frontend.css +86 -48
  60. email/billing.html +4 -1
  61. email/billing_failure.html +5 -1
  62. email/billing_failure_admin.html +5 -1
  63. email/checkout_check.html +1 -1
  64. email/checkout_freetrial.html +4 -1
  65. email/checkout_freetrial_admin.html +4 -1
  66. email/checkout_paid.html +4 -1
  67. email/checkout_paid_admin.html +4 -1
  68. email/checkout_trial.html +4 -1
  69. email/checkout_trial_admin.html +4 -1
  70. email/credit_card_expiring.html +3 -1
  71. email/invoice.html +6 -2
  72. includes/adminpages.php +66 -147
  73. includes/cleanup.php +12 -1
  74. includes/content.php +35 -70
  75. includes/email.php +18 -50
  76. includes/filters.php +2 -2
  77. includes/functions.php +123 -239
  78. includes/init.php +24 -69
  79. includes/lib/Stripe/Stripe.php +0 -10
  80. includes/lib/Stripe/Stripe/Account.php +6 -5
  81. includes/lib/Stripe/Stripe/ApiRequestor.php +51 -153
  82. includes/lib/Stripe/Stripe/ApiResource.php +17 -51
  83. includes/lib/Stripe/Stripe/ApplicationFee.php +0 -53
  84. includes/lib/Stripe/Stripe/AttachedObject.php +0 -23
  85. includes/lib/Stripe/Stripe/Balance.php +0 -15
  86. includes/lib/Stripe/Stripe/BalanceTransaction.php +0 -39
  87. includes/lib/Stripe/Stripe/Card.php +0 -54
  88. includes/lib/Stripe/Stripe/CardError.php +2 -4
  89. includes/lib/Stripe/Stripe/Charge.php +7 -55
  90. includes/lib/Stripe/Stripe/Coupon.php +7 -24
  91. includes/lib/Stripe/Stripe/Customer.php +6 -61
  92. includes/lib/Stripe/Stripe/Error.php +7 -9
  93. includes/lib/Stripe/Stripe/Event.php +6 -12
  94. includes/lib/Stripe/Stripe/InvalidRequestError.php +2 -4
  95. includes/lib/Stripe/Stripe/Invoice.php +6 -30
  96. includes/lib/Stripe/Stripe/InvoiceItem.php +6 -24
  97. includes/lib/Stripe/Stripe/List.php +5 -25
  98. includes/lib/Stripe/Stripe/Object.php +12 -123
  99. includes/lib/Stripe/Stripe/Plan.php +6 -26
  100. includes/lib/Stripe/Stripe/Recipient.php +0 -75
  101. includes/lib/Stripe/Stripe/SingletonApiResource.php +0 -7
  102. includes/lib/Stripe/Stripe/Stripe.php +3 -49
  103. includes/lib/Stripe/Stripe/Subscription.php +0 -58
  104. includes/lib/Stripe/Stripe/Token.php +6 -12
  105. includes/lib/Stripe/Stripe/Transfer.php +6 -34
  106. includes/lib/Stripe/Stripe/Util.php +14 -42
  107. includes/login.php +4 -20
  108. includes/metaboxes.php +2 -2
  109. includes/profile.php +4 -4
  110. includes/services.php +1 -1
  111. includes/upgradecheck.php +4 -25
  112. includes/xmlrpc.php +0 -80
  113. languages/email/da_DK/admin_change.html +0 -7
  114. languages/email/da_DK/admin_change_admin.html +0 -5
  115. languages/email/da_DK/billing.html +0 -16
  116. languages/email/da_DK/billing_admin.html +0 -17
  117. languages/email/da_DK/billing_failure.html +0 -11
  118. languages/email/da_DK/billing_failure_admin.html +0 -11
  119. languages/email/da_DK/cancel.html +0 -3
  120. languages/email/da_DK/cancel_admin.html +0 -8
  121. languages/email/da_DK/checkout_check.html +0 -17
  122. languages/email/da_DK/checkout_check_admin.html +0 -17
  123. languages/email/da_DK/checkout_express.html +0 -14
  124. languages/email/da_DK/checkout_express_admin.html +0 -14
  125. languages/email/da_DK/checkout_free.html +0 -8
  126. languages/email/da_DK/checkout_free_admin.html +0 -8
  127. languages/email/da_DK/checkout_freetrial.html +0 -19
  128. languages/email/da_DK/checkout_freetrial_admin.html +0 -19
  129. languages/email/da_DK/checkout_paid.html +0 -23
  130. languages/email/da_DK/checkout_paid_admin.html +0 -23
  131. languages/email/da_DK/checkout_trial.html +0 -23
  132. languages/email/da_DK/checkout_trial_admin.html +0 -23
  133. languages/email/da_DK/credit_card_expiring.html +0 -13
  134. languages/email/da_DK/default.html +0 -1
  135. languages/email/da_DK/footer.html +0 -4
  136. languages/email/da_DK/header.html +0 -1
  137. languages/email/da_DK/invoice.html +0 -19
  138. languages/email/da_DK/membership_expired.html +0 -7
  139. languages/email/da_DK/membership_expiring.html +0 -6
  140. languages/email/da_DK/trial_ending.html +0 -8
  141. languages/gettext.sh +0 -23
  142. languages/pmpro-cs_CZ.mo +0 -0
  143. languages/pmpro-cs_CZ.po +0 -2889
  144. languages/pmpro-da_DK.mo +0 -0
  145. languages/pmpro-da_DK.po +0 -3502
  146. languages/pmpro-en_GB.mo +0 -0
  147. languages/pmpro-en_GB.po +0 -2661
  148. languages/pmpro-fr_FR.mo +0 -0
  149. languages/pmpro-fr_FR.po +327 -444
  150. languages/pmpro-it_IT.mo +0 -0
  151. languages/pmpro-it_IT.po +1367 -2483
  152. languages/pmpro-nb_NO.mo +0 -0
  153. languages/pmpro-nb_NO.po +0 -3279
  154. languages/pmpro-pt_BR.mo +0 -0
  155. languages/pmpro-pt_BR.po +0 -2661
  156. languages/pmpro-sk_SK.mo +0 -0
  157. languages/pmpro-sk_SK.po +0 -3826
  158. languages/pmpro-tr_TR.mo +0 -0
  159. languages/pmpro-tr_TR.po +0 -3470
  160. languages/pmpro.mo +0 -0
  161. languages/pmpro.po +1023 -2332
  162. languages/pmpro.pot +1023 -2332
  163. logs/.gitkeep +0 -0
  164. pages/account.php +11 -15
  165. pages/billing.php +11 -46
  166. pages/checkout.php +39 -56
  167. pages/confirmation.php +4 -4
  168. pages/invoice.php +3 -3
  169. pages/levels.php +84 -18
  170. paid-memberships-pro.php +11 -57
  171. preheaders/account.php +42 -37
  172. preheaders/billing.php +369 -372
  173. preheaders/cancel.php +40 -39
  174. preheaders/checkout.php +1068 -999
  175. preheaders/confirmation.php +12 -15
  176. preheaders/invoice.php +32 -32
  177. preheaders/levels.php +33 -32
  178. readme.txt +3 -160
  179. scheduled/crons.php +3 -3
  180. services/applydiscountcode.php +134 -141
  181. services/authnet-silent-post.php +0 -5
  182. services/getfile.php +57 -5
  183. services/ipnhandler.php +32 -181
  184. services/stripe-webhook.php +18 -101
  185. services/twocheckout-ins.php +47 -94
  186. 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
)
@@ -22,7 +22,7 @@ function pmpro_addon_pmpro_addon_packages_widget($addon)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-addon-packages/pmpro-addon-packages.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-addon-packages/pmpro-addon-packages.php'), 'activate-plugin_pmpro-addon-packages/pmpro-addon-packages.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="https://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-addon-packages.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Addon Packages',
8
+ 'version' => '.1.3',
9
'widget' => 'pmpro_addon_pmpro_addon_packages_widget',
10
'enabled' => function_exists('pmproap_post_meta')
11
)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-addon-packages/pmpro-addon-packages.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-addon-packages/pmpro-addon-packages.php'), 'activate-plugin_pmpro-addon-packages/pmpro-addon-packages.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
+ <a href="https://github.com/strangerstudios/pmpro-addon-packages/archive/master.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
adminpages/addons/pmpro-affiliates.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Affiliates',
8
- 'version' => '.2.4',
9
'widget' => 'pmpro_addon_pmpro_affiliates_widget',
10
'enabled' => function_exists('pmpro_affiliates_dependencies')
11
)
@@ -22,7 +22,7 @@ function pmpro_addon_pmpro_affiliates_widget($addon)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-affiliates/pmpro-affiliates.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-affiliates/pmpro-affiliates.php'), 'activate-plugin_pmpro-affiliates/pmpro-affiliates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-affiliates.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Affiliates',
8
+ 'version' => '.2.2',
9
'widget' => 'pmpro_addon_pmpro_affiliates_widget',
10
'enabled' => function_exists('pmpro_affiliates_dependencies')
11
)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-affiliates/pmpro-affiliates.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-affiliates/pmpro-affiliates.php'), 'activate-plugin_pmpro-affiliates/pmpro-affiliates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
+ <a href="https://github.com/strangerstudios/pmpro-affiliates/archive/master.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
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
@@ -3,28 +3,25 @@
3
Addon: PMPro bbPress
4
Slug: pmpro-bbpress
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">
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-bbpress/pmpro-bbpress.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-bbpress/pmpro-bbpress.php'), 'activate-plugin_pmpro-bbpress/pmpro-bbpress.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-bbpress'), 'install-plugin_pmpro-bbpress'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
3
Addon: PMPro bbPress
4
Slug: pmpro-bbpress
5
*/
6
+ pmpro_add_addon('gists', array(
7
'title' => 'PMPro bbPress',
8
+ 'version' => '.1',
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">
20
<?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/1633637" class="button">Enabled</a>
22
<?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/1633637" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
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
@@ -3,11 +3,11 @@
3
Addon: PMPro Expiration Date
4
Slug: pmpro-expiration
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
@@ -15,15 +15,13 @@ function pmpro_addon_pmpro_expiration_widget($addon)
15
{
16
?>
17
<div class="info">
18
- <p>Set a specific expiration date (e.g. 2013-12-31) for a PMPro membership level or discount code.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
- <a href="https://github.com/strangerstudios/pmpro-set-expiration-dates/blob/master/readme.txt" class="button">Enabled</a>
22
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-set-expiration-dates/pmpro-set-expiration-dates.php")) { ?>
23
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-set-expiration-dates/pmpro-set-expiration-dates.php'), 'activate-plugin_pmpro-set-expiration-dates/pmpro-set-expiration-dates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-set-expiration-dates.zip" class="button button-primary">Download</a>
26
- <?php } ?>
27
</div>
28
</div> <!-- end info -->
29
<?php
3
Addon: PMPro Expiration Date
4
Slug: pmpro-expiration
5
*/
6
+ pmpro_add_addon('gists', array(
7
+ 'title' => 'PMPro Expiration Date',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
+ 'enabled' => function_exists('my_pmpro_checkout_level_specific_expiration')
11
)
12
);
13
15
{
16
?>
17
<div class="info">
18
+ <p>Set a specific expiration date for a Membership Level.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5709300" class="button">Enabled</a>
22
<?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5709300" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
adminpages/addons/pmpro-freeaddress.php CHANGED
@@ -3,9 +3,9 @@
3
Addon: PMPro Require Name and Address for Free Level
4
Slug: pmpro-freerequire
5
*/
6
- pmpro_add_addon('github', array(
7
'title' => 'PMPro Require Name/Address for Free Level',
8
- 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_freerequire_widget',
10
'enabled' => function_exists('my_pmpro_checkout_boxes_require_address')
11
)
@@ -18,12 +18,10 @@ function pmpro_addon_pmpro_freerequire_widget($addon)
18
<p>Require name/address for free Membership Level checkout.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
- <a href="https://github.com/strangerstudios/pmpro-address-for-free-levels" class="button">Enabled</a>
22
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-address-for-free-levels/pmpro-address-for-free-levels.php")) { ?>
23
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-address-for-free-levels/pmpro-address-for-free-levels.php'), 'activate-plugin_pmpro-address-for-free-levels/pmpro-address-for-free-levels.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-address-for-free-levels.zip" class="button button-primary">Download</a>
26
- <?php } ?>
27
</div>
28
</div> <!-- end info -->
29
<?php
3
Addon: PMPro Require Name and Address for Free Level
4
Slug: pmpro-freerequire
5
*/
6
+ pmpro_add_addon('gists', array(
7
'title' => 'PMPro Require Name/Address for Free Level',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_freerequire_widget',
10
'enabled' => function_exists('my_pmpro_checkout_boxes_require_address')
11
)
18
<p>Require name/address for free Membership Level checkout.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5716249" class="button">Enabled</a>
22
<?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5716249" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
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
)
@@ -19,12 +19,12 @@ function pmpro_addon_pmpro_infusionsoft_widget($addon)
19
<p>Integrate with Infusionsoft. Add members to email lists (groups, tags) 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-infusionsoft/pmpro-infusionsoft.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-infusionsoft/pmpro-infusionsoft.php'), 'activate-plugin_pmpro-infusionsoft/pmpro-infusionsoft.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-infusionsoft'), 'install-plugin_pmpro-infusionsoft'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Infusionsoft Integration',
8
+ 'version' => '.5',
9
'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
'enabled' => function_exists('pmprois_init')
11
)
19
<p>Integrate with Infusionsoft. Add members to email lists (groups, tags) 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-infusionsoft/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-infusionsoft/pmpro-infusionsoft.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-infusionsoft/pmpro-infusionsoft.php'), 'activate-plugin_pmpro-infusionsoft/pmpro-infusionsoft.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-infusionsoft.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
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
)
@@ -19,12 +19,12 @@ function pmpro_addon_pmpro_mailchimp_widget($addon)
19
<p>Integrate User Registrations with Mailchimp. 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-mailchimp/pmpro-mailchimp.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-mailchimp/pmpro-mailchimp.php'), 'activate-plugin_pmpro-mailchimp/pmpro-mailchimp.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-mailchimp'), 'install-plugin_pmpro-mailchimp'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
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
)
19
<p>Integrate User Registrations with Mailchimp. 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-mailchimp/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-mailchimp/pmpro-mailchimp.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-mailchimp/pmpro-mailchimp.php'), 'activate-plugin_pmpro-mailchimp/pmpro-mailchimp.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-mailchimp'), 'install-plugin_pmpro-mailchimp'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
adminpages/addons/pmpro-network-subsite.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /*
3
- Addon: PMPro Network
4
- Slug: pmpro-network-subsite
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
- )
12
- );
13
-
14
- function pmpro_addon_pmpro_network_subsite_widget($addon)
15
- {
16
- ?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-network.gif" />
18
- <div class="info">
19
- <p>Have network subsites use membership data from a "main" site to handle access restrictions.</p>
20
- <div class="actions">
21
- <?php if($addon['enabled']) { ?>
22
- <a href="https://github.com/strangerstudios/pmpro-network-subsite" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-network-subsite/pmpro-network-subsite.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-network-subsite/pmpro-network-subsite.php'), 'activate-plugin_pmpro-network-subsite/pmpro-network-subsite.php')?>" class="button button-primary">Activate</a>
25
- <?php } else { ?>
26
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-network-subsite.zip" class="button button-primary">Download</a>
27
- <?php } ?>
28
- </div>
29
- </div> <!-- end info -->
30
- <?php
31
- }
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' => '.1',
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.2.1',
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',
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.3',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
adminpages/addons/pmpro-user-pages.php CHANGED
@@ -14,7 +14,7 @@ pmpro_add_addon('github', array(
14
function pmpro_addon_pmpro_user_pages_widget($addon)
15
{
16
?>
17
- <div class="info">
18
<p>Creates a unique page for each Member after checkout, giving the Admin access to write customized content for each specific member.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
14
function pmpro_addon_pmpro_user_pages_widget($addon)
15
{
16
?>
17
+ <div class="info">
18
<p>Creates a unique page for each Member after checkout, giving the Admin access to write customized content for each specific member.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
adminpages/addons/pmpro-woocommerce.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /*
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
- )
12
- );
13
-
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>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-woocommerce/pmpro-woocommerce.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-woocommerce/pmpro-woocommerce.php'), 'activate-plugin_pmpro-woocommerce/pmpro-woocommerce.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-woocommerce'), 'install-plugin_pmpro-woocommerce'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
- </div>
29
- </div> <!-- end info -->
30
- <?php
31
- }
adminpages/addons/pmpro-wp-affiliate.php CHANGED
@@ -19,12 +19,10 @@ function pmpro_addon_pmpro_wp_affiliate_widget($addon)
19
<p>Process an affiliate via WP Affiliate Platform after a PMPro checkout.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="https://github.com/strangerstudios/pmpro-wp-affiliate-platform/" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php'), 'activate-plugin_pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-wp-affiliate-platform.zip" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
19
<p>Process an affiliate via WP Affiliate Platform after a PMPro checkout.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a target="_blank" href="https://gist.github.com/strangerstudios/3137539" class="button">Enabled</a>
23
<?php } else { ?>
24
+ <a target="_blank" href="https://gist.github.com/strangerstudios/3137539" class="button button-primary">View Gist</a>
25
+ <?php } ?>
26
</div>
27
</div> <!-- end info -->
28
<?php
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.8'
11
)
12
);
13
adminpages/addons/wp-bouncer.php CHANGED
@@ -19,7 +19,7 @@ function pmpro_addon_wp_bouncer_widget($addon)
19
<p>Make sure users are only logged in from one computer or device at a time.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="http://wordpress.org/plugins/wp-bouncer/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../wp-bouncer/wp-bouncer.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=wp-bouncer/wp-bouncer.php'), 'activate-plugin_wp-bouncer/wp-bouncer.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
19
<p>Make sure users are only logged in from one computer or device at a time.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/wp-bouncer/blob/master/readme.txt" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../wp-bouncer/wp-bouncer.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=wp-bouncer/wp-bouncer.php'), 'activate-plugin_wp-bouncer/wp-bouncer.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
adminpages/admin_header.php CHANGED
@@ -102,9 +102,8 @@
102
{
103
global $pmpro_twocheckout_error;
104
$pmpro_twocheckout_error = true;
105
-
106
$msg = -1;
107
- $msgt = __("The billing details for this level are not supported by 2Checkout. Please review the notes in the Billing Details section below.", "pmpro");
108
}
109
}
110
elseif($view == "pmpro-membershiplevels")
@@ -124,7 +123,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>
102
{
103
global $pmpro_twocheckout_error;
104
$pmpro_twocheckout_error = true;
105
$msg = -1;
106
+ $msgt = __("The billing details for this level are not supported by TwoCheckout. Please review the notes in the Billing Details section below.", "pmpro");
107
}
108
}
109
elseif($view == "pmpro-membershiplevels")
123
<div class="wrap pmpro_admin">
124
<div class="pmpro_banner">
125
<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>
126
+ <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>
127
128
<br style="clear:both;" />
129
</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");
@@ -30,13 +29,6 @@
30
31
//footer link
32
pmpro_setOption("hide_footer_link");
33
-
34
- // custom settings (added with pmpro_custom_advanced_settings hook)
35
- foreach($_REQUEST as $key => $value ) {
36
- if (strpos($key, 'custom_') === 0) {
37
- pmpro_setOption($key);
38
- }
39
- }
40
41
//assume success
42
$msg = true;
@@ -47,7 +39,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
@@ -65,17 +56,17 @@
65
//default settings
66
if(!$nonmembertext)
67
{
68
- $nonmembertext = sprintf( __( 'This content is for !!levels!! members only. <a href="%s">Register here</a>.', 'pmpro' ), wp_login_url() . "?action=register" );
69
pmpro_setOption("nonmembertext", $nonmembertext);
70
}
71
if(!$notloggedintext)
72
{
73
- $notloggedintext = sprintf( __( 'Please <a href="%s">login</a> to view this content. (<a href="%s">Register here</a>.)', 'pmpro' ), wp_login_url( get_permalink() ), wp_login_url() . "?action=register" );
74
pmpro_setOption("notloggedintext", $notloggedintext);
75
}
76
if(!$rsstext)
77
{
78
- $rsstext = __( 'This content is for members only. Visit the site and log in/register to read.', 'pmpro' );
79
pmpro_setOption("rsstext", $rsstext);
80
}
81
@@ -119,27 +110,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>
@@ -257,73 +237,9 @@ if(pmpro_displayAds())
257
<option value="1" <?php if($hide_footer_link == 1) { ?>selected="selected"<?php } ?>>Yes - Hide the link.</option>
258
</select>
259
</td>
260
- </tr>
261
- */
262
-
263
- // Filter to Add More Advanced Settings for Misc Plugin Options, etc.
264
- if (has_action('pmpro_custom_advanced_settings')) {
265
- $custom_fields = apply_filters('pmpro_custom_advanced_settings', $custom_fields);
266
- foreach ($custom_fields as $field) {
267
- ?>
268
- <tr>
269
- <th valign="top" scope="row">
270
- <label
271
- for="<?php _e($field['field_name'], 'pmpro'); ?>"><?php _e($field['label'], 'pmpro'); ?></label>
272
- </th>
273
- <td>
274
- <?php
275
- switch ($field['field_type']) {
276
- case 'select':
277
- ?>
278
- <select id="<?php _e($field['field_name'], 'pmpro'); ?>"
279
- name="<?php _e($field['field_name'], 'pmpro'); ?>">
280
- <?php foreach ($field['options'] as $option) {
281
- ?>
282
- <option value="<?php _e($option, 'pmpro'); ?>"
283
- <?php
284
- if ($option == pmpro_getOption($field['field_name'])) {
285
- _e('selected', 'pmpro');
286
- }
287
- ?>
288
- ><?php _e($option, 'pmpro'); ?></option>
289
- <?php
290
- } ?>
291
- </select>
292
- <?php
293
- break;
294
- case 'text':
295
- ?>
296
- <input id="<?php _e($field['field_name'], 'pmpro'); ?>"
297
- name="<?php _e($field['field_name'], 'pmpro'); ?>"
298
- type="<?php _e($field['field_type'], 'pmpro'); ?>"
299
- value="<?php echo pmpro_getOption($field['field_name']); ?> ">
300
- <?php
301
- break;
302
- case 'textarea':
303
- ?>
304
- <textarea id="<?php _e($field['field_name'], 'pmpro'); ?>"
305
- name="<?php _e($field['field_name'], 'pmpro'); ?>">
306
- <?php echo pmpro_getOption($field['field_name']); ?>
307
- </textarea>
308
- <?php
309
- break;
310
- default:
311
- break;
312
- }
313
- if (!empty($field['description'])) {
314
- ?>
315
- <br>
316
- <small><?php _e($field['description'], 'pmpro'); ?></small>
317
- <?php
318
- }
319
- ?>
320
- </td>
321
- <?php
322
- }
323
- }
324
- ?>
325
- </tr>
326
- </tbody>
327
</table>
328
<script>
329
function pmpro_updateHideAdsTRs()
@@ -365,7 +281,7 @@ if(pmpro_displayAds())
365
</script>
366
367
<p class="submit">
368
- <input name="savesettings" type="submit" class="button button-primary" value="<?php _e('Save Settings', 'pmpro');?>" />
369
</p>
370
</form>
371
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");
29
30
//footer link
31
pmpro_setOption("hide_footer_link");
32
33
//assume success
34
$msg = true;
39
$notloggedintext = pmpro_getOption("notloggedintext");
40
$rsstext = pmpro_getOption("rsstext");
41
$hideads = pmpro_getOption("hideads");
42
$showexcerpts = pmpro_getOption("showexcerpts");
43
$hideadslevels = pmpro_getOption("hideadslevels");
44
56
//default settings
57
if(!$nonmembertext)
58
{
59
+ $nonmembertext = "This content is for !!levels!! members only. <a href=\"" . wp_login_url() . "?action=register\">Register here</a>.";
60
pmpro_setOption("nonmembertext", $nonmembertext);
61
}
62
if(!$notloggedintext)
63
{
64
+ $notloggedintext = "Please <a href=\"" . wp_login_url( get_permalink() ) . "\">login</a> to view this content. (<a href=\"" . wp_login_url() . "?action=register\">Register here</a>.)";
65
pmpro_setOption("notloggedintext", $notloggedintext);
66
}
67
if(!$rsstext)
68
{
69
+ $rsstext = "This content is for members only. Visit the site and log in/register to read.";
70
pmpro_setOption("rsstext", $rsstext);
71
}
72
110
111
<tr>
112
<th scope="row" valign="top">
113
+ <label for="showexcerpts"><?php _e('Show Excerpts to Non-Members?', 'pmpro');?></label>
114
</th>
115
<td>
116
+ <select id="showexcerpts" name="showexcerpts">
117
+ <option value="0" <?php if(!$showexcerpts) { ?>selected="selected"<?php } ?>><?php _e('No - Hide excerpts.', 'pmpro');?></option>
118
+ <option value="1" <?php if($showexcerpts == 1) { ?>selected="selected"<?php } ?>><?php _e('Yes - Show excerpts.', 'pmpro');?></option>
119
</select>
120
</td>
121
</tr>
122
<tr>
123
<th scope="row" valign="top">
124
<label for="hideads">Hide Ads From Members?</label>
125
</th>
237
<option value="1" <?php if($hide_footer_link == 1) { ?>selected="selected"<?php } ?>>Yes - Hide the link.</option>
238
</select>
239
</td>
240
+ </tr>
241
+ */ ?>
242
+ </tbody>
243
</table>
244
<script>
245
function pmpro_updateHideAdsTRs()
281
</script>
282
283
<p class="submit">
284
+ <input name="savesettings" type="submit" class="button-primary" value="<?php _e('Save Settings', 'pmpro');?>" />
285
</p>
286
</form>
287
adminpages/dashboard.php CHANGED
@@ -105,9 +105,9 @@
105
106
echo '</ul>';
107
echo '<br class="clear"/><div style="margin-top:10px;border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
108
- echo '<a target="_blank" href="'.$pmpro_feed.'"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
109
echo ' &nbsp; &nbsp; &nbsp; ';
110
- echo '<a target="_blank" href="http://www.paidmembershipspro.com/blog/">View Online</a>';
111
echo '<form class="alignright" method="post"><input type="hidden" name="pmpro_removedbwidget" value="true"/><input title="Remove this widget from all users dashboards" class="button" type="submit" value="X"/></form>';
112
echo '</div>';
113
}
105
106
echo '</ul>';
107
echo '<br class="clear"/><div style="margin-top:10px;border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
108
+ echo '<a href="'.$pmpro_feed.'"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
109
echo ' &nbsp; &nbsp; &nbsp; ';
110
+ echo '<a href="http://www.paidmembershipspro.com/"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/wpmini-blue.png" alt=""/> View Online</a>';
111
echo '<form class="alignright" method="post"><input type="hidden" name="pmpro_removedbwidget" value="true"/><input title="Remove this widget from all users dashboards" class="button" type="submit" value="X"/></form>';
112
echo '</div>';
113
}
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)
@@ -189,7 +189,7 @@
189
if($wpdb->query($sqlQuery) !== false)
190
{
191
//okay
192
- do_action("pmpro_save_discount_code_level", $edit, $level_id);
193
}
194
else
195
{
@@ -221,9 +221,6 @@
221
$code = $wpdb->get_var("SELECT code FROM $wpdb->pmpro_discount_codes WHERE id = '" . $delete . "' LIMIT 1");
222
if(!empty($code))
223
{
224
- //action
225
- do_action("pmpro_delete_discount_code", $delete);
226
-
227
//delete the code levels
228
$r1 = $wpdb->query("DELETE FROM $wpdb->pmpro_discount_codes_levels WHERE code_id = '" . $delete . "'");
229
@@ -356,7 +353,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 +371,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 +382,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 +394,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
@@ -437,13 +434,13 @@
437
</tr>
438
439
<tr class="recurring_info" <?php if(!pmpro_isLevelRecurring($level)) {?>style="display: none;"<?php } ?>>
440
- <th scope="row" valign="top"><label for="billing_amount"><?php _e('Billing Amount', 'pmpro');?>:</label></th>
441
<td>
442
<?php echo $pmpro_currency_symbol?><input name="billing_amount[]" type="text" size="20" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->billing_amount))?>" /> <small>per</small>
443
<input name="cycle_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->cycle_number))?>" />
444
<select name="cycle_period[]" onchange="updateCyclePeriod();">
445
<?php
446
- $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
447
foreach ( $cycles as $name => $value ) {
448
echo "<option value='$value'";
449
if ( $level->cycle_period == $value ) echo " selected='selected'";
@@ -480,7 +477,7 @@
480
481
<tr>
482
<th scope="row" valign="top"><label><?php _e('Membership Expiration', 'pmpro');?>:</label></th>
483
- <td><input id="expiration" name="expiration[]" type="checkbox" value="<?php echo $level->id?>" <?php if(pmpro_isLevelExpiring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery(this).is(':checked')) { jQuery(this).parent().parent().siblings('.expiration_info').show(); } else { jQuery(this).parent().parent().siblings('.expiration_info').hide();}" /> <?php _e('Check this to set when membership access expires.', 'pmpro');?></td>
484
</tr>
485
486
<tr class="expiration_info" <?php if(!pmpro_isLevelExpiring($level)) {?>style="display: none;"<?php } ?>>
@@ -489,7 +486,7 @@
489
<input id="expiration_number" name="expiration_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
490
<select id="expiration_period" name="expiration_period[]">
491
<?php
492
- $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
493
foreach ( $cycles as $name => $value ) {
494
echo "<option value='$value'";
495
if ( $level->expiration_period == $value ) echo " selected='selected'";
@@ -497,7 +494,7 @@
497
}
498
?>
499
</select>
500
- <br /><small><?php _e('Set the duration of membership access. Note that the any future payments (recurring subscription, if any) will be cancelled when the membership expires.', 'pmpro');?></small>
501
</td>
502
</tr>
503
</tbody>
@@ -516,8 +513,8 @@
516
</div>
517
518
<p class="submit topborder">
519
- <input name="save" type="submit" class="button button-primary" value="Save Code" />
520
- <input name="cancel" type="button" class="button button-secondary" value="Cancel" onclick="location.href='<?php echo get_admin_url(NULL, '/admin.php?page=pmpro-discountcodes')?>';" />
521
</p>
522
</form>
523
</div>
@@ -526,7 +523,7 @@
526
527
<h2>
528
<?php _e('Memberships Discount Codes', 'pmpro');?>
529
- <a href="admin.php?page=pmpro-discountcodes&edit=-1" class="add-new-h2"><?php _e('Add New Discount Code', 'pmpro');?></a>
530
</h2>
531
532
<?php if(!empty($pmpro_msg)) { ?>
@@ -543,14 +540,7 @@
543
</form>
544
545
<br class="clear" />
546
- <?php
547
- $sqlQuery = "SELECT *, UNIX_TIMESTAMP(starts) as starts, UNIX_TIMESTAMP(expires) as expires FROM $wpdb->pmpro_discount_codes ";
548
- if(!empty($s))
549
- $sqlQuery .= "WHERE code LIKE '%$s%' ";
550
- $sqlQuery .= "ORDER BY id ASC";
551
-
552
- $codes = $wpdb->get_results($sqlQuery, OBJECT);
553
- ?>
554
<table class="widefat">
555
<thead>
556
<tr>
@@ -560,13 +550,19 @@
560
<th><?php _e('Expires', 'pmpro');?></th>
561
<th><?php _e('Uses', 'pmpro');?></th>
562
<th><?php _e('Levels', 'pmpro');?></th>
563
- <?php do_action("pmpro_discountcodes_extra_cols_header", $codes);?>
564
<th></th>
565
<th></th>
566
</tr>
567
</thead>
568
<tbody>
569
<?php
570
if(!$codes)
571
{
572
?>
@@ -614,7 +610,6 @@
614
echo "None";
615
?>
616
</td>
617
- <?php do_action("pmpro_discountcodes_extra_cols_body", $code);?>
618
<td>
619
<a href="?page=pmpro-discountcodes&edit=<?php echo $code->id?>"><?php _e('edit', 'pmpro');?></a>
620
</td>
@@ -633,4 +628,4 @@
633
634
<?php
635
require_once(dirname(__FILE__) . "/admin_footer.php");
636
- ?>
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)
189
if($wpdb->query($sqlQuery) !== false)
190
{
191
//okay
192
+ do_action("pmpro_save_discount_code_level", $saveid, $level_id);
193
}
194
else
195
{
221
$code = $wpdb->get_var("SELECT code FROM $wpdb->pmpro_discount_codes WHERE id = '" . $delete . "' LIMIT 1");
222
if(!empty($code))
223
{
224
//delete the code levels
225
$r1 = $wpdb->query("DELETE FROM $wpdb->pmpro_discount_codes_levels WHERE code_id = '" . $delete . "'");
226
353
for($i = 1; $i < 13; $i++)
354
{
355
?>
356
+ <option value="<?php echo $i?>" <?php if($i == $selected_starts_month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $current_year))?></option>
357
<?php
358
}
359
?>
371
for($i = 1; $i < 13; $i++)
372
{
373
?>
374
+ <option value="<?php echo $i?>" <?php if($i == $selected_expires_month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $current_year))?></option>
375
<?php
376
}
377
?>
382
</tr>
383
384
<tr>
385
+ <th scope="row" valign="top"><label for="uses"><?php _ex('Uses', 'Number of uses for a discount code', 'pmpro');?>:</label></th>
386
<td>
387
<input name="uses" type="text" size="10" value="<?php if(!empty($code->uses)) echo str_replace("\"", "&quot;", stripslashes($code->uses));?>" />
388
<small class="pmpro_lite"><?php _e('Leave blank for unlimited uses.', 'pmpro');?></small>
394
395
<?php do_action("pmpro_discount_code_after_settings"); ?>
396
397
+ <h3>Which Levels Will This Code Apply To?</h3>
398
399
<div class="pmpro_discount_levels">
400
<?php
434
</tr>
435
436
<tr class="recurring_info" <?php if(!pmpro_isLevelRecurring($level)) {?>style="display: none;"<?php } ?>>
437
+ <th scope="row" valign="top"><label for="billing_amount"><?php _e('Billing Ammount', 'pmpro');?>:</label></th>
438
<td>
439
<?php echo $pmpro_currency_symbol?><input name="billing_amount[]" type="text" size="20" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->billing_amount))?>" /> <small>per</small>
440
<input name="cycle_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->cycle_number))?>" />
441
<select name="cycle_period[]" onchange="updateCyclePeriod();">
442
<?php
443
+ $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
444
foreach ( $cycles as $name => $value ) {
445
echo "<option value='$value'";
446
if ( $level->cycle_period == $value ) echo " selected='selected'";
477
478
<tr>
479
<th scope="row" valign="top"><label><?php _e('Membership Expiration', 'pmpro');?>:</label></th>
480
+ <td><input id="expiration" name="expiration[]" type="checkbox" value="<?php echo $level->id?>" <?php if(pmpro_isLevelExpiring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery(this).is(':checked')) { jQuery(this).parent().parent().siblings('.expiration_info').show(); } else { jQuery(this).parent().parent().siblings('.expiration_info').hide();}" /> <small><?php _e('Check this to set an expiration date for new sign ups.', 'pmpro');?></small></td>
481
</tr>
482
483
<tr class="expiration_info" <?php if(!pmpro_isLevelExpiring($level)) {?>style="display: none;"<?php } ?>>
486
<input id="expiration_number" name="expiration_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
487
<select id="expiration_period" name="expiration_period[]">
488
<?php
489
+ $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
490
foreach ( $cycles as $name => $value ) {
491
echo "<option value='$value'";
492
if ( $level->expiration_period == $value ) echo " selected='selected'";
494
}
495
?>
496
</select>
497
+ <br /><small><?php _e('How long before the expiration expires. Note that any future payments will be cancelled when the membership expires.', 'pmpro');?></small>
498
</td>
499
</tr>
500
</tbody>
513
</div>
514
515
<p class="submit topborder">
516
+ <input name="save" type="submit" class="button-primary" value="Save Code" />
517
+ <input name="cancel" type="button" value="Cancel" onclick="location.href='<?php echo get_admin_url(NULL, '/admin.php?page=pmpro-discountcodes')?>';" />
518
</p>
519
</form>
520
</div>
523
524
<h2>
525
<?php _e('Memberships Discount Codes', 'pmpro');?>
526
+ <a href="admin.php?page=pmpro-discountcodes&edit=-1" class="button add-new-h2"><?php _e('Add New Discount Code', 'pmpro');?></a>
527
</h2>
528
529
<?php if(!empty($pmpro_msg)) { ?>
540
</form>
541
542
<br class="clear" />
543
+
544
<table class="widefat">
545
<thead>
546
<tr>
550
<th><?php _e('Expires', 'pmpro');?></th>
551
<th><?php _e('Uses', 'pmpro');?></th>
552
<th><?php _e('Levels', 'pmpro');?></th>
553
<th></th>
554
<th></th>
555
</tr>
556
</thead>
557
<tbody>
558
<?php
559
+ $sqlQuery = "SELECT *, UNIX_TIMESTAMP(starts) as starts, UNIX_TIMESTAMP(expires) as expires FROM $wpdb->pmpro_discount_codes ";
560
+ if(!empty($s))
561
+ $sqlQuery .= "WHERE code LIKE '%$s%' ";
562
+ $sqlQuery .= "ORDER BY id ASC";
563
+
564
+ $codes = $wpdb->get_results($sqlQuery, OBJECT);
565
+
566
if(!$codes)
567
{
568
?>
610
echo "None";
611
?>
612
</td>
613
<td>
614
<a href="?page=pmpro-discountcodes&edit=<?php echo $code->id?>"><?php _e('edit', 'pmpro');?></a>
615
</td>
628
629
<?php
630
require_once(dirname(__FILE__) . "/admin_footer.php");
631
+ ?>
adminpages/emailsettings.php CHANGED
@@ -1,181 +1,152 @@
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
+
18
+ pmpro_setOption("email_admin_checkout");
19
+ pmpro_setOption("email_admin_changes");
20
+ pmpro_setOption("email_admin_cancels");
21
+ pmpro_setOption("email_admin_billing");
22
+
23
+ pmpro_setOption("email_member_notification");
24
+
25
+ //assume success
26
+ $msg = true;
27
+ $msgt = "Your email settings have been updated.";
28
+ }
29
+
30
+ $from_email = pmpro_getOption("from_email");
31
+ $from_name = pmpro_getOption("from_name");
32
+
33
+ $email_admin_checkout = pmpro_getOption("email_admin_checkout");
34
+ $email_admin_changes = pmpro_getOption("email_admin_changes");
35
+ $email_admin_cancels = pmpro_getOption("email_admin_cancels");
36
+ $email_admin_billing = pmpro_getOption("email_admin_billing");
37
+
38
+ $email_member_notification = pmpro_getOption("email_member_notification");
39
+
40
+ if(empty($from_email))
41
+ {
42
+ $parsed = parse_url(home_url());
43
+ $hostname = $parsed[host];
44
+ $hostparts = split("\.", $hostname);
45
+ $email_domain = $hostparts[count($hostparts) - 2] . "." . $hostparts[count($hostparts) - 1];
46
+ $from_email = "wordpress@" . $email_domain;
47
+ pmpro_setOption("from_email", $from_email);
48
+ }
49
+
50
+ if(empty($from_name))
51
+ {
52
+ $from_name = "WordPress";
53
+ pmpro_setOption("from_name", $from_name);
54
+ }
55
+
56
+ require_once(dirname(__FILE__) . "/admin_header.php");
57
+ ?>
58
+
59
+ <form action="" method="post" enctype="multipart/form-data">
60
+ <h2><?php _e('Email Settings', 'pmpro');?></h2>
61
+ <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>
62
+
63
+ <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>
64
+
65
+ <table class="form-table">
66
+ <tbody>
67
+ <tr>
68
+ <th scope="row" valign="top">
69
+ <label for="from_email"><?php _e('From Email', 'pmpro');?>:</label>
70
+ </th>
71
+ <td>
72
+ <input type="text" name="from_email" size="60" value="<?php echo $from_email?>" />
73
+ </td>
74
+ </tr>
75
+ <tr>
76
+ <th scope="row" valign="top">
77
+ <label for="from_name"><?php _e('From Name', 'pmpro');?>:</label>
78
+ </th>
79
+ <td>
80
+ <input type="text" name="from_name" size="60" value="<?php echo $from_name?>" />
81
+ </td>
82
+ </tr>
83
+ </tbody>
84
+ </table>
85
+
86
+ <h3><?php _e('Send the site admin emails', 'pmpro');?>:</h3>
87
+
88
+ <table class="form-table">
89
+ <tbody>
90
+ <tr>
91
+ <th scope="row" valign="top">
92
+ <label for="email_admin_checkout"><?php _e('Checkout', 'pmpro');?>:</label>
93
+ </th>
94
+ <td>
95
+ <input type="checkbox" id="email_admin_checkout" name="email_admin_checkout" value="1" <?php if(!empty($email_admin_checkout)) { ?>checked="checked"<?php } ?> />
96
+ <?php _e('when a member checks out.', 'pmpro');?>
97
+ </td>
98
+ </tr>
99
+ <tr>
100
+ <th scope="row" valign="top">
101
+ <label for="email_admin_changes"><?php _e('Admin Changes', 'pmpro');?>:</label>
102
+ </th>
103
+ <td>
104
+ <input type="checkbox" id="email_admin_changes" name="email_admin_changes" value="1" <?php if(!empty($email_admin_changes)) { ?>checked="checked"<?php } ?> />
105
+ <?php _e('when an admin changes a user\'s membership level through the dashboard.', 'pmpro');?>
106
+ </td>
107
+ </tr>
108
+ <tr>
109
+ <th scope="row" valign="top">
110
+ <label for="email_admin_cancels"><?php _e('Cancellation', 'pmpro');?>:</label>
111
+ </th>
112
+ <td>
113
+ <input type="checkbox" id="email_admin_cancels" name="email_admin_cancels" value="1" <?php if(!empty($email_admin_cancels)) { ?>checked="checked"<?php } ?> />
114
+ <?php _e('when a user cancels his or her account.', 'pmpro');?>
115
+ </td>
116
+ </tr>
117
+ <tr>
118
+ <th scope="row" valign="top">
119
+ <label for="email_admin_billing"><?php _e('Bill Updates', 'pmpro');?>:</label>
120
+ </th>
121
+ <td>
122
+ <input type="checkbox" id="email_admin_billing" name="email_admin_billing" value="1" <?php if(!empty($email_admin_billing)) { ?>checked="checked"<?php } ?> />
123
+ <?php _e('when a user updates his or her billing information.', 'pmpro');?>
124
+ </td>
125
+ </tr>
126
+ </tbody>
127
+ </table>
128
+
129
+ <h3><?php _e('Send members emails', 'pmpro');?>:</h3>
130
+
131
+ <table class="form-table">
132
+ <tbody>
133
+ <tr>
134
+ <th scope="row" valign="top">
135
+ <label for="email_admin_checkout"><?php _e('New Users', 'pmpro');?>:</label>
136
+ </th>
137
+ <td>
138
+ <input type="checkbox" id="email_member_notification" name="email_member_notification" value="1" <?php if(!empty($email_member_notification)) { ?>checked="checked"<?php } ?> />
139
+ <?php _e('Default WP notification email. (Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.)', 'pmpro');?>
140
+ </td>
141
+ </tr>
142
+ </tbody>
143
+ </table>
144
+
145
+ <p class="submit">
146
+ <input name="savesettings" type="submit" class="button-primary" value="Save Settings" />
147
+ </p>
148
+ </form>
149
+
150
+ <?php
151
+ require_once(dirname(__FILE__) . "/admin_footer.php");
152
+ ?>
adminpages/functions.php CHANGED
@@ -40,11 +40,11 @@ function pmpro_checkLevelForStripeCompatibility($level = NULL)
40
/*
41
Stripe currently does not support:
42
* Trial Amounts > 0.
43
- * Daily billing periods.
44
* Billing Limits.
45
*/
46
if($level->trial_amount > 0 ||
47
- ($level->cycle_number > 0 && $level->cycle_period == "Day") ||
48
$level->billing_limit > 0)
49
{
50
return false;
@@ -60,7 +60,7 @@ function pmpro_checkLevelForStripeCompatibility($level = NULL)
60
61
//check this level
62
if($level->trial_amount > 0 ||
63
- ($level->cycle_number > 0 && $level->cycle_period == "Day") ||
64
$level->billing_limit > 0)
65
{
66
return false;
@@ -194,10 +194,10 @@ function pmpro_checkLevelForTwoCheckoutCompatibility($level = NULL)
194
foreach($levels as $level)
195
{
196
/*
197
- 2Checkout currently does not support:
198
* Trial amounts less than or greater than the absolute value of amonthly recurring amount.
199
*/
200
- if(pmpro_isLevelTrial($level))
201
{
202
return false;
203
}
@@ -211,7 +211,7 @@ function pmpro_checkLevelForTwoCheckoutCompatibility($level = NULL)
211
$level = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_levels WHERE id = '" . esc_sql($level) . "' LIMIT 1");
212
213
//check this level
214
- if(pmpro_isLevelTrial($level))
215
{
216
return false;
217
}
40
/*
41
Stripe currently does not support:
42
* Trial Amounts > 0.
43
+ * Daily or Weekly billing periods.
44
* Billing Limits.
45
*/
46
if($level->trial_amount > 0 ||
47
+ ($level->cycle_number > 0 && ($level->cycle_period == "Day" || $level->cycle_period == "Week")) ||
48
$level->billing_limit > 0)
49
{
50
return false;
60
61
//check this level
62
if($level->trial_amount > 0 ||
63
+ ($level->cycle_number > 0 && ($level->cycle_period == "Day" || $level->cycle_period == "Week")) ||
64
$level->billing_limit > 0)
65
{
66
return false;
194
foreach($levels as $level)
195
{
196
/*
197
+ Twocheckout currently does not support:
198
* Trial amounts less than or greater than the absolute value of amonthly recurring amount.
199
*/
200
+ if($level->billing_amount > 0 && abs($level->trial_amount) >= $level->billing_amount )
201
{
202
return false;
203
}
211
$level = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_levels WHERE id = '" . esc_sql($level) . "' LIMIT 1");
212
213
//check this level
214
+ if($level->billing_amount > 0 && abs($level->trial_amount) >= $level->billing_amount )
215
{
216
return false;
217
}
adminpages/membershiplevels.php CHANGED
@@ -157,8 +157,6 @@
157
158
if($ml_id > 0)
159
{
160
- do_action("pmpro_delete_membership_level", $ml_id);
161
-
162
//remove any categories from the ml
163
$sqlQuery = "DELETE FROM $wpdb->pmpro_memberships_categories WHERE membership_id = '$ml_id'";
164
$r1 = $wpdb->query($sqlQuery);
@@ -363,7 +361,7 @@
363
<br /><small>
364
<?php _e('The amount to be billed one cycle after the initial payment.', 'pmpro');?>
365
<?php if($gateway == "stripe") { ?>
366
- <br /><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently only supports billing periods of "Week", "Month" or "Year".', 'pmpro');?>
367
<?php } elseif($gateway == "braintree") { ?>
368
<br /><strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently only supports billing periods of "Month" or "Year".', 'pmpro');?>
369
<?php } elseif($gateway == "payflowpro") { ?>
@@ -393,13 +391,7 @@
393
394
<tr class="recurring_info" <?php if (!pmpro_isLevelRecurring($level)) echo "style='display:none;'";?>>
395
<th scope="row" valign="top"><label><?php _e('Custom Trial', 'pmpro');?>:</label></th>
396
- <td>
397
- <input id="custom_trial" name="custom_trial" type="checkbox" value="yes" <?php if ( pmpro_isLevelTrial($level) ) { echo "checked='checked'"; } ?> onclick="jQuery('.trial_info').toggle();" /> <?php _e('Check to add a custom trial period.', 'pmpro');?>
398
-
399
- <?php if($gateway == "twocheckout") { ?>
400
- <br /><small><strong <?php if(!empty($pmpro_twocheckout_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('2Checkout integration does not support custom trials. You can do one period trials by setting an initial payment different from the billing amount.', 'pmpro');?></strong></small>
401
- <?php } ?>
402
- </td>
403
</tr>
404
405
<tr class="trial_info recurring_info" <?php if (!pmpro_isLevelTrial($level)) echo "style='display:none;'";?>>
@@ -420,7 +412,9 @@
420
<?php } elseif($gateway == "payflowpro") { ?>
421
<br /><small>
422
<strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently does not support trial amounts greater than $0.', 'pmpro');?></strong>
423
- </small>
424
<?php } ?>
425
</td>
426
</tr>
@@ -446,7 +440,7 @@
446
<input id="expiration_number" name="expiration_number" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
447
<select id="expiration_period" name="expiration_period">
448
<?php
449
- $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
450
foreach ( $cycles as $name => $value ) {
451
echo "<option value='$value'";
452
if ( $level->expiration_period == $value ) echo " selected='selected'";
@@ -495,7 +489,7 @@
495
{
496
?>
497
498
- <h2><?php _e('Membership Levels', 'pmpro');?> <a href="admin.php?page=pmpro-membershiplevels&edit=-1" class="add-new-h2"><?php _e('Add New Level', 'pmpro');?></a></h2>
499
<form id="posts-filter" method="get" action="">
500
<p class="search-box">
501
<label class="screen-reader-text" for="post-search-input"><?php _e('Search Levels', 'pmpro');?>:</label>
@@ -548,7 +542,7 @@
548
<?php if(!pmpro_isLevelRecurring($level)) { ?>
549
--
550
<?php } else { ?>
551
- <?php echo $pmpro_currency_symbol?><?php echo $level->billing_amount?> <?php _e('every', 'pmpro');?> <?php echo $level->cycle_number.' '.pmpro_translate_billing_period($level->cycle_period,$level->cycle_number)?>
552
553
<?php if($level->billing_limit) { ?>(<?php _e('for', 'pmpro');?> <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
554
@@ -569,9 +563,9 @@
569
<?php } ?>
570
</td>
571
<td><?php if($level->allow_signups) { ?><?php _e('Yes', 'pmpro');?><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
572
- <td align="center"><a href="admin.php?page=pmpro-membershiplevels&amp;edit=<?php echo $level->id?>" class="edit"><?php _e('edit', 'pmpro');?></a></td>
573
- <td align="center"><a href="admin.php?page=pmpro-membershiplevels&amp;copy=<?php echo $level->id?>&amp;edit=-1" class="edit"><?php _e('copy', 'pmpro');?></a></td>
574
- <td align="center"><a href="javascript: askfirst('<?php printf(__("Are you sure you want to delete membership level %s? All subscriptions will be cancelled.", "pmpro"), $level->name);?>','admin.php?page=pmpro-membershiplevels&amp;action=delete_membership_level&amp;deleteid=<?php echo $level->id?>'); void(0);" class="delete"><?php _e('delete', 'pmpro');?></a></td>
575
</tr>
576
<?php
577
}
157
158
if($ml_id > 0)
159
{
160
//remove any categories from the ml
161
$sqlQuery = "DELETE FROM $wpdb->pmpro_memberships_categories WHERE membership_id = '$ml_id'";
162
$r1 = $wpdb->query($sqlQuery);
361
<br /><small>
362
<?php _e('The amount to be billed one cycle after the initial payment.', 'pmpro');?>
363
<?php if($gateway == "stripe") { ?>
364
+ <br /><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently only supports billing periods of "Month" or "Year".', 'pmpro');?>
365
<?php } elseif($gateway == "braintree") { ?>
366
<br /><strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently only supports billing periods of "Month" or "Year".', 'pmpro');?>
367
<?php } elseif($gateway == "payflowpro") { ?>
391
392
<tr class="recurring_info" <?php if (!pmpro_isLevelRecurring($level)) echo "style='display:none;'";?>>
393
<th scope="row" valign="top"><label><?php _e('Custom Trial', 'pmpro');?>:</label></th>
394
+ <td><input id="custom_trial" name="custom_trial" type="checkbox" value="yes" <?php if ( pmpro_isLevelTrial($level) ) { echo "checked='checked'"; } ?> onclick="jQuery('.trial_info').toggle();" /> <?php _e('Check to add a custom trial period.', 'pmpro');?></td>
395
</tr>
396
397
<tr class="trial_info recurring_info" <?php if (!pmpro_isLevelTrial($level)) echo "style='display:none;'";?>>
412
<?php } elseif($gateway == "payflowpro") { ?>
413
<br /><small>
414
<strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently does not support trial amounts greater than $0.', 'pmpro');?></strong>
415
+ </small>
416
+ <?php } elseif($gateway == "twocheckout") { ?>
417
+ <br /><strong <?php if(!empty($pmpro_twocheckout_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('TwoCheckout integration only supports trial amounts less than the absolute Billing Amount (e.g. if Billing Amount is $10, Trial Amount can fall between $10 and -$10 but cannot equal those).', 'pmpro');?>
418
<?php } ?>
419
</td>
420
</tr>
440
<input id="expiration_number" name="expiration_number" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
441
<select id="expiration_period" name="expiration_period">
442
<?php
443
+ $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
444
foreach ( $cycles as $name => $value ) {
445
echo "<option value='$value'";
446
if ( $level->expiration_period == $value ) echo " selected='selected'";
489
{
490
?>
491
492
+ <h2><?php _e('Membership Levels', 'pmpro');?> <a href="admin.php?page=pmpro-membershiplevels&edit=-1" class="button add-new-h2"><?php _e('Add New Level', 'pmpro');?></a></h2>
493
<form id="posts-filter" method="get" action="">
494
<p class="search-box">
495
<label class="screen-reader-text" for="post-search-input"><?php _e('Search Levels', 'pmpro');?>:</label>
542
<?php if(!pmpro_isLevelRecurring($level)) { ?>
543
--
544
<?php } else { ?>
545
+ <?php echo $pmpro_currency_symbol?><?php echo $level->billing_amount?> <?php _e('every', 'pmpro');?> <?php echo $level->cycle_number.' '.sornot($level->cycle_period,$level->cycle_number)?>
546
547
<?php if($level->billing_limit) { ?>(<?php _e('for', 'pmpro');?> <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
548
563
<?php } ?>
564
</td>
565
<td><?php if($level->allow_signups) { ?><?php _e('Yes', 'pmpro');?><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
566
+ <td align="center"><a href="admin.php?page=pmpro-membershiplevels&edit=<?php echo $level->id?>" class="edit"><?php _e('edit', 'pmpro');?></a></td>
567
+ <td align="center"><a href="admin.php?page=pmpro-membershiplevels&copy=<?php echo $level->id?>&edit=-1" class="edit"><?php _e('copy', 'pmpro');?></a></td>
568
+ <td align="center"><a href="javascript: askfirst('<?php printf(__("Are you sure you want to delete membership level %s? All subscriptions will be cancelled.", "pmpro"), $level->name);?>','admin.php?page=pmpro-membershiplevels&action=delete_membership_level&deleteid=<?php echo $level->id?>'); void(0);" class="delete"><?php _e('delete', 'pmpro');?></a></td>
569
</tr>
570
<?php
571
}
adminpages/memberslist-csv.php CHANGED
@@ -42,83 +42,45 @@
42
43
if($s)
44
{
45
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id ";
46
-
47
- if($l == "oldmembers")
48
- $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
49
-
50
- $sqlQuery .= " WHERE mu.membership_id > 0 AND (u.user_login LIKE '%" . esc_sql($s) . "%' OR u.user_email LIKE '%" . esc_sql($s) . "%' OR um.meta_value LIKE '%" . esc_sql($s) . "%') ";
51
-
52
- if($l == "oldmembers")
53
- $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
54
- elseif($l)
55
- $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . esc_sql($l) . "' ";
56
- else
57
- $sqlQuery .= " AND mu.status = 'active' ";
58
59
- $sqlQuery .= "GROUP BY u.ID ";
60
-
61
- if($l == "oldmembers")
62
- $sqlQuery .= "ORDER BY enddate DESC ";
63
- else
64
- $sqlQuery .= "ORDER BY u.user_registered DESC ";
65
66
if($limit)
67
$sqlQuery .= "LIMIT $start, $limit";
68
}
69
else
70
{
71
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, UNIX_TIMESTAMP(mu.enddate) as enddate FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id ";
72
-
73
- if($l == "oldmembers")
74
- $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
75
-
76
- $sqlQuery .= " WHERE mu.membership_id > 0 ";
77
-
78
- if($l == "oldmembers")
79
- $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
80
- elseif($l)
81
- $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . $l . "' ";
82
- else
83
- $sqlQuery .= " AND mu.status = 'active' ";
84
-
85
- $sqlQuery .= "GROUP BY u.ID ";
86
-
87
- if($l == "oldmembers")
88
- $sqlQuery .= "ORDER BY enddate DESC ";
89
- else
90
- $sqlQuery .= "ORDER BY u.user_registered DESC ";
91
-
92
if($limit)
93
$sqlQuery .= "LIMIT $start, $limit";
94
}
95
96
//filter
97
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
98
-
99
//get users
100
$theusers = $wpdb->get_col($sqlQuery);
101
-
102
//begin output
103
header("Content-type: text/csv");
104
- if($s && $l == "oldmembers")
105
- header("Content-Disposition: attachment; filename=members_list_expired_" . sanitize_file_name($s) . ".csv");
106
- elseif($s && $l)
107
- header("Content-Disposition: attachment; filename=members_list_" . intval($l) . "_level_" . sanitize_file_name($s) . ".csv");
108
elseif($s)
109
header("Content-Disposition: attachment; filename=members_list_" . sanitize_file_name($s) . ".csv");
110
- elseif($l == "oldmembers")
111
- header("Content-Disposition: attachment; filename=members_list_expired.csv");
112
else
113
header("Content-Disposition: attachment; filename=members_list.csv");
114
115
- $heading = "id,username,firstname,lastname,email,billing firstname,billing lastname,address1,address2,city,state,zipcode,country,phone,membership,initial payment,fee,term,discount_code_id,discount_code,joined";
116
-
117
- if($l == "oldmembers")
118
- $heading .= ",ended";
119
- else
120
- $heading .= ",expires";
121
-
122
$heading = apply_filters("pmpro_members_list_csv_heading", $heading);
123
$csvoutput = $heading;
124
@@ -170,14 +132,8 @@
170
{
171
foreach($theusers as $user_id)
172
{
173
- //MULTI: This query will need to be updated to support multiple levels per user. Should probably just dump multiple rows for each membership.
174
//get meta
175
-
176
- if($l == "oldmembers")
177
- $theuser = $wpdb->get_row("SELECT u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE u.ID = '" . $user_id . "' ORDER BY mu.id DESC LIMIT 1");
178
- else
179
- $theuser = $wpdb->get_row("SELECT u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id AND mu.status = 'active' LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE u.ID = '" . $user_id . "' LIMIT 1");
180
-
181
$sqlQuery = "SELECT meta_key as `key`, meta_value as `value` FROM $wpdb->usermeta WHERE $wpdb->usermeta.user_id = '" . $user_id . "'";
182
$metavalues = pmpro_getMetavalues($sqlQuery);
183
$theuser->metavalues = $metavalues;
@@ -203,27 +159,17 @@
203
204
//joindate and enddate
205
$csvoutput .= "," . pmpro_enclose(date("Y-m-d", $theuser->joindate)) . ",";
206
-
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
- {
216
$csvoutput .= pmpro_enclose(date("Y-m-d", $theuser->enddate));
217
- }
218
else
219
- $csvoutput .= "N/A";
220
-
221
//any extra columns
222
if(!empty($extra_columns))
223
{
224
foreach($extra_columns as $heading => $callback)
225
{
226
- $csvoutput .= "," . pmpro_enclose(call_user_func($callback, $theuser, $heading));
227
}
228
}
229
42
43
if($s)
44
{
45
+ $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE mu.status = 'active' AND mu.membership_id > 0 AND (u.user_login LIKE '%" . esc_sql($s) . "%' OR u.user_email LIKE '%" . esc_sql($s) . "%' OR um.meta_value LIKE '%" . esc_sql($s) . "%') ";
46
+
47
+ if($l)
48
+ $sqlQuery .= " AND mu.membership_id = '" . esc_sql($l) . "' ";
49
50
+ $sqlQuery .= "GROUP BY u.ID ORDER BY user_registered DESC ";
51
52
if($limit)
53
$sqlQuery .= "LIMIT $start, $limit";
54
}
55
else
56
{
57
+ $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id";
58
+ $sqlQuery .= " WHERE mu.membership_id > 0 AND mu.status = 'active' ";
59
+ if($l)
60
+ $sqlQuery .= " AND mu.membership_id = '" . $l . "' ";
61
+ $sqlQuery .= "ORDER BY user_registered DESC ";
62
if($limit)
63
$sqlQuery .= "LIMIT $start, $limit";
64
}
65
66
//filter
67
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
68
+
69
//get users
70
$theusers = $wpdb->get_col($sqlQuery);
71
+
72
//begin output
73
header("Content-type: text/csv");
74
+ if($s && $l)
75
+ header("Content-Disposition: attachment; filename=members_list_" . intval($l) . "_level" . sanitize_file_name($s) . ".csv");
76
elseif($s)
77
header("Content-Disposition: attachment; filename=members_list_" . sanitize_file_name($s) . ".csv");
78
+ elseif($l)
79
+ header("Content-Disposition: attachment; filename=members_list_level" . intval($l) . ".csv");
80
else
81
header("Content-Disposition: attachment; filename=members_list.csv");
82
83
+ $heading = "id,username,firstname,lastname,email,billing firstname,billing lastname,address1,address2,city,state,zipcode,country,phone,membership,initial payment,fee,term,discount_code_id,discount_code,joined,expires";
84
$heading = apply_filters("pmpro_members_list_csv_heading", $heading);
85
$csvoutput = $heading;
86
132
{
133
foreach($theusers as $user_id)
134
{
135
//get meta
136
+ $theuser = $wpdb->get_row("SELECT u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE u.ID = '" . $user_id . "' LIMIT 1");
137
$sqlQuery = "SELECT meta_key as `key`, meta_value as `value` FROM $wpdb->usermeta WHERE $wpdb->usermeta.user_id = '" . $user_id . "'";
138
$metavalues = pmpro_getMetavalues($sqlQuery);
139
$theuser->metavalues = $metavalues;
159
160
//joindate and enddate
161
$csvoutput .= "," . pmpro_enclose(date("Y-m-d", $theuser->joindate)) . ",";
162
+ if($theuser->enddate)
163
$csvoutput .= pmpro_enclose(date("Y-m-d", $theuser->enddate));
164
else
165
+ $csvoutput .= pmpro_enclose("Never");
166
+
167
//any extra columns
168
if(!empty($extra_columns))
169
{
170
foreach($extra_columns as $heading => $callback)
171
{
172
+ $csvoutput .= "," . pmpro_enclose(call_user_func($callback, $theuser));
173
}
174
}
175
adminpages/memberslist.php CHANGED
@@ -23,7 +23,7 @@
23
<form id="posts-filter" method="get" action="">
24
<h2>
25
<?php _e('Members List', 'pmpro');?>
26
- <a target="_blank" href="<?php echo admin_url('admin-ajax.php');?>?action=memberslist_csv&s=<?php echo $s?>&l=<?php echo $l?>" class="add-new-h2"><?php _e('Export to CSV', 'pmpro');?></a>
27
</h2>
28
<ul class="subsubsub">
29
<li>
@@ -39,7 +39,6 @@
39
<?php
40
}
41
?>
42
- <option value="oldmembers" <?php if($l == "oldmembers") { ?>selected="selected"<?php } ?>><?php _e('Old Members', 'pmpro');?></option>
43
</select>
44
</li>
45
</ul>
@@ -66,56 +65,24 @@
66
67
if($s)
68
{
69
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id ";
70
-
71
- if($l == "oldmembers")
72
- $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
73
-
74
- $sqlQuery .= " WHERE mu.membership_id > 0 AND (u.user_login LIKE '%$s%' OR u.user_email LIKE '%$s%' OR um.meta_value LIKE '%$s%') ";
75
76
- if($l == "oldmembers")
77
- $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
78
- elseif($l)
79
- $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . $l . "' ";
80
- else
81
- $sqlQuery .= " AND mu.status = 'active' ";
82
-
83
- $sqlQuery .= "GROUP BY u.ID ";
84
-
85
- if($l == "oldmembers")
86
- $sqlQuery .= "ORDER BY enddate DESC ";
87
- else
88
- $sqlQuery .= "ORDER BY u.user_registered DESC ";
89
-
90
- $sqlQuery .= "LIMIT $start, $limit";
91
}
92
else
93
{
94
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id";
95
-
96
- if($l == "oldmembers")
97
- $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
98
-
99
- $sqlQuery .= " WHERE mu.membership_id > 0 ";
100
-
101
- if($l == "oldmembers")
102
- $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
103
- elseif($l)
104
- $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . $l . "' ";
105
- else
106
- $sqlQuery .= " AND mu.status = 'active' ";
107
- $sqlQuery .= "GROUP BY u.ID ";
108
-
109
- if($l == "oldmembers")
110
- $sqlQuery .= "ORDER BY enddate DESC ";
111
- else
112
- $sqlQuery .= "ORDER BY u.user_registered DESC ";
113
-
114
- $sqlQuery .= "LIMIT $start, $limit";
115
}
116
117
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
118
-
119
$theusers = $wpdb->get_results($sqlQuery);
120
$totalrows = $wpdb->get_var("SELECT FOUND_ROWS() as found_rows");
121
@@ -151,14 +118,7 @@
151
<th><?php _e('Membership', 'pmpro');?></th>
152
<th><?php _e('Fee', 'pmpro');?></th>
153
<th><?php _e('Joined', 'pmpro');?></th>
154
- <th>
155
- <?php
156
- if($l == "oldmembers")
157
- _e('Ended', 'pmpro');
158
- else
159
- _e('Expires', 'pmpro');
160
- ?>
161
- </th>
162
</tr>
163
</thead>
164
<tbody id="users" class="list:user user-list">
@@ -186,9 +146,21 @@
186
<td><a href="mailto:<?php echo $theuser->user_email?>"><?php echo $theuser->user_email?></a></td>
187
<?php do_action("pmpro_memberslist_extra_cols_body", $theuser);?>
188
<td>
189
- <?php
190
- echo pmpro_formatAddress(trim($theuser->pmpro_bfirstname . " " . $theuser->pmpro_blastname), $theuser->pmpro_baddress1, $theuser->pmpro_baddress2, $theuser->pmpro_bcity, $theuser->pmpro_bstate, $theuser->pmpro_bzipcode, $theuser->pmpro_bcountry, $theuser->pmpro_bphone);
191
- ?>
192
</td>
193
<td><?php echo $auser->membership?></td>
194
<td>
@@ -203,13 +175,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>
23
<form id="posts-filter" method="get" action="">
24
<h2>
25
<?php _e('Members List', 'pmpro');?>
26
+ <a target="_blank" href="<?php echo admin_url('admin-ajax.php');?>?action=memberslist_csv&s=<?php echo $s?>&l=<?php echo $l?>" class="button add-new-h2"><?php _e('Export to CSV', 'pmpro');?></a>
27
</h2>
28
<ul class="subsubsub">
29
<li>
39
<?php
40
}
41
?>
42
</select>
43
</li>
44
</ul>
65
66
if($s)
67
{
68
+ $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE mu.status = 'active' AND mu.membership_id > 0 AND (u.user_login LIKE '%$s%' OR u.user_email LIKE '%$s%' OR um.meta_value LIKE '%$s%') ";
69
70
+ if($l)
71
+ $sqlQuery .= " AND mu.membership_id = '" . $l . "' ";
72
+
73
+ $sqlQuery .= "GROUP BY u.ID ORDER BY user_registered DESC LIMIT $start, $limit";
74
}
75
else
76
{
77
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id";
78
+ $sqlQuery .= " WHERE mu.membership_id > 0 AND mu.status = 'active' ";
79
+ if($l)
80
+ $sqlQuery .= " AND mu.membership_id = '" . $l . "' ";
81
+ $sqlQuery .= "GROUP BY u.ID ORDER BY user_registered DESC LIMIT $start, $limit";
82
}
83
84
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
85
+
86
$theusers = $wpdb->get_results($sqlQuery);
87
$totalrows = $wpdb->get_var("SELECT FOUND_ROWS() as found_rows");
88
118
<th><?php _e('Membership', 'pmpro');?></th>
119
<th><?php _e('Fee', 'pmpro');?></th>
120
<th><?php _e('Joined', 'pmpro');?></th>
121
+ <th><?php _e('Expires', 'pmpro');?></th>
122
</tr>
123
</thead>
124
<tbody id="users" class="list:user user-list">
146
<td><a href="mailto:<?php echo $theuser->user_email?>"><?php echo $theuser->user_email?></a></td>
147
<?php do_action("pmpro_memberslist_extra_cols_body", $theuser);?>
148
<td>
149
+ <?php
150
+ if(empty($theuser->pmpro_bfirstname))
151
+ $theuser->pmpro_bfirstname = "";
152
+ if(empty($theuser->pmpro_blastname))
153
+ $theuser->pmpro_blastname = "";
154
+ echo trim($theuser->pmpro_bfirstname . " " . $theuser->pmpro_blastname);
155
+ ?><br />
156
+ <?php if(!empty($theuser->pmpro_baddress1)) { ?>
157
+ <?php echo $theuser->pmpro_baddress1; ?><br />
158
+ <?php if(!empty($theuser->pmpro_baddress2)) echo $theuser->pmpro_baddress2 . "<br />"; ?>
159
+ <?php if($theuser->pmpro_bcity && $theuser->pmpro_bstate) { ?>
160
+ <?php echo $theuser->pmpro_bcity?>, <?php echo $theuser->pmpro_bstate?> <?php echo $theuser->pmpro_bzipcode?> <?php if(!empty($theuser->pmpro_bcountry)) echo $theuser->pmpro_bcountry?><br />
161
+ <?php } ?>
162
+ <?php } ?>
163
+ <?php if(!empty($theuser->pmpro_bphone)) echo formatPhone($theuser->pmpro_bphone);?>
164
</td>
165
<td><?php echo $auser->membership?></td>
166
<td>
175
-
176
<?php } ?>
177
</td>
178
+ <td><?php echo date("m/d/Y", strtotime($theuser->user_registered))?></td>
179
<td>
180
<?php
181
if($auser->enddate)
182
+ echo date(get_option('date_format'), $auser->enddate);
183
else
184
+ echo __("Never", "pmpro");
185
?>
186
</td>
187
</tr>
adminpages/orders-csv.php CHANGED
@@ -17,51 +17,6 @@
17
$l = $_REQUEST['l'];
18
else
19
$l = false;
20
-
21
- if(isset($_REQUEST['start-month']))
22
- $start_month = $_REQUEST['start-month'];
23
- else
24
- $start_month = "1";
25
-
26
- if(isset($_REQUEST['start-day']))
27
- $start_day = $_REQUEST['start-day'];
28
- else
29
- $start_day = "1";
30
-
31
- if(isset($_REQUEST['start-year']))
32
- $start_year = $_REQUEST['start-year'];
33
- else
34
- $start_year = date("Y");
35
-
36
- if(isset($_REQUEST['end-month']))
37
- $end_month = $_REQUEST['end-month'];
38
- else
39
- $end_month = date("n");
40
-
41
- if(isset($_REQUEST['end-day']))
42
- $end_day = $_REQUEST['end-day'];
43
- else
44
- $end_day = date("j");
45
-
46
- if(isset($_REQUEST['end-year']))
47
- $end_year = $_REQUEST['end-year'];
48
- else
49
- $end_year = date("Y");
50
-
51
- if(isset($_REQUEST['predefined-date']))
52
- $predefined_date = $_REQUEST['predefined-date'];
53
- else
54
- $predefined_date = "This Month";
55