Paid Memberships Pro - Version 1.7.3.1

Version Description

  • Using MySQL to calculate months since first order instead of date_diff, which is only available in PHP 5.3+
Download this release

Release Info

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

Code changes from version 1.7.14 to 1.7.3.1

Files changed (190) 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-stripe-lite.php +30 -0
  22. adminpages/addons/pmpro-user-pages.php +1 -1
  23. adminpages/addons/pmpro-woocommerce.php +0 -31
  24. adminpages/addons/pmpro-wp-affiliate.php +3 -5
  25. adminpages/addons/tml.php +1 -1
  26. adminpages/addons/wp-bouncer.php +2 -2
  27. adminpages/admin_header.php +1 -22
  28. adminpages/advancedsettings.php +12 -96
  29. adminpages/dashboard.php +2 -2
  30. adminpages/discountcodes.php +24 -29
  31. adminpages/emailsettings.php +152 -181
  32. adminpages/functions.php +3 -68
  33. adminpages/membershiplevels.php +12 -20
  34. adminpages/memberslist-csv.php +32 -95
  35. adminpages/memberslist.php +30 -58
  36. adminpages/orders-csv.php +19 -127
  37. adminpages/orders.php +9 -314
  38. adminpages/pagesettings.php +9 -51
  39. adminpages/paymentsettings.php +77 -36
  40. adminpages/reports.php +0 -3
  41. adminpages/reports/login.php +7 -7
  42. adminpages/reports/memberships.php +22 -32
  43. adminpages/reports/sales.php +42 -40
  44. classes/class.memberorder.php +16 -75
  45. classes/class.pmproemail.php +23 -91
  46. classes/gateways/class.pmprogateway.php +3 -19
  47. classes/gateways/class.pmprogateway_authorizenet.php +2 -2
  48. classes/gateways/class.pmprogateway_braintree.php +12 -12
  49. classes/gateways/class.pmprogateway_check.php +2 -2
  50. classes/gateways/class.pmprogateway_cybersource.php +5 -5
  51. classes/gateways/class.pmprogateway_payflowpro.php +15 -18
  52. classes/gateways/class.pmprogateway_paypal.php +10 -12
  53. classes/gateways/class.pmprogateway_paypalexpress.php +22 -66
  54. classes/gateways/class.pmprogateway_paypalstandard.php +16 -33
  55. classes/gateways/class.pmprogateway_stripe.php +31 -81
  56. classes/gateways/class.pmprogateway_twocheckout.php +27 -49
  57. css/admin-rtl.css +0 -63
  58. css/admin.css +5 -5
  59. css/frontend-rtl.css +0 -111
  60. css/frontend.css +86 -49
  61. email/billing.html +4 -1
  62. email/billing_failure.html +5 -1
  63. email/billing_failure_admin.html +5 -1
  64. email/checkout_check.html +1 -1
  65. email/checkout_freetrial.html +4 -1
  66. email/checkout_freetrial_admin.html +4 -1
  67. email/checkout_paid.html +4 -1
  68. email/checkout_paid_admin.html +4 -1
  69. email/checkout_trial.html +4 -1
  70. email/checkout_trial_admin.html +4 -1
  71. email/credit_card_expiring.html +3 -1
  72. email/invoice.html +6 -2
  73. includes/adminpages.php +66 -147
  74. includes/cleanup.php +12 -1
  75. includes/content.php +35 -70
  76. includes/currencies.php +2 -9
  77. includes/email.php +18 -50
  78. includes/filters.php +2 -2
  79. includes/functions.php +154 -274
  80. includes/https.php +18 -53
  81. includes/init.php +24 -69
  82. includes/lib/Stripe/Stripe.php +0 -10
  83. includes/lib/Stripe/Stripe/Account.php +6 -5
  84. includes/lib/Stripe/Stripe/ApiRequestor.php +51 -153
  85. includes/lib/Stripe/Stripe/ApiResource.php +17 -51
  86. includes/lib/Stripe/Stripe/ApplicationFee.php +0 -53
  87. includes/lib/Stripe/Stripe/AttachedObject.php +0 -23
  88. includes/lib/Stripe/Stripe/Balance.php +0 -15
  89. includes/lib/Stripe/Stripe/BalanceTransaction.php +0 -39
  90. includes/lib/Stripe/Stripe/Card.php +0 -54
  91. includes/lib/Stripe/Stripe/CardError.php +2 -4
  92. includes/lib/Stripe/Stripe/Charge.php +7 -55
  93. includes/lib/Stripe/Stripe/Coupon.php +7 -24
  94. includes/lib/Stripe/Stripe/Customer.php +6 -61
  95. includes/lib/Stripe/Stripe/Error.php +7 -9
  96. includes/lib/Stripe/Stripe/Event.php +6 -12
  97. includes/lib/Stripe/Stripe/InvalidRequestError.php +2 -4
  98. includes/lib/Stripe/Stripe/Invoice.php +6 -30
  99. includes/lib/Stripe/Stripe/InvoiceItem.php +6 -24
  100. includes/lib/Stripe/Stripe/List.php +5 -25
  101. includes/lib/Stripe/Stripe/Object.php +12 -123
  102. includes/lib/Stripe/Stripe/Plan.php +6 -26
  103. includes/lib/Stripe/Stripe/Recipient.php +0 -75
  104. includes/lib/Stripe/Stripe/SingletonApiResource.php +0 -7
  105. includes/lib/Stripe/Stripe/Stripe.php +3 -49
  106. includes/lib/Stripe/Stripe/Subscription.php +0 -58
  107. includes/lib/Stripe/Stripe/Token.php +6 -12
  108. includes/lib/Stripe/Stripe/Transfer.php +6 -34
  109. includes/lib/Stripe/Stripe/Util.php +14 -42
  110. includes/login.php +7 -31
  111. includes/metaboxes.php +2 -2
  112. includes/profile.php +4 -4
  113. includes/services.php +1 -1
  114. includes/upgradecheck.php +4 -25
  115. includes/xmlrpc.php +0 -80
  116. languages/email/da_DK/admin_change.html +0 -7
  117. languages/email/da_DK/admin_change_admin.html +0 -5
  118. languages/email/da_DK/billing.html +0 -16
  119. languages/email/da_DK/billing_admin.html +0 -17
  120. languages/email/da_DK/billing_failure.html +0 -11
  121. languages/email/da_DK/billing_failure_admin.html +0 -11
  122. languages/email/da_DK/cancel.html +0 -3
  123. languages/email/da_DK/cancel_admin.html +0 -8
  124. languages/email/da_DK/checkout_check.html +0 -17
  125. languages/email/da_DK/checkout_check_admin.html +0 -17
  126. languages/email/da_DK/checkout_express.html +0 -14
  127. languages/email/da_DK/checkout_express_admin.html +0 -14
  128. languages/email/da_DK/checkout_free.html +0 -8
  129. languages/email/da_DK/checkout_free_admin.html +0 -8
  130. languages/email/da_DK/checkout_freetrial.html +0 -19
  131. languages/email/da_DK/checkout_freetrial_admin.html +0 -19
  132. languages/email/da_DK/checkout_paid.html +0 -23
  133. languages/email/da_DK/checkout_paid_admin.html +0 -23
  134. languages/email/da_DK/checkout_trial.html +0 -23
  135. languages/email/da_DK/checkout_trial_admin.html +0 -23
  136. languages/email/da_DK/credit_card_expiring.html +0 -13
  137. languages/email/da_DK/default.html +0 -1
  138. languages/email/da_DK/footer.html +0 -4
  139. languages/email/da_DK/header.html +0 -1
  140. languages/email/da_DK/invoice.html +0 -19
  141. languages/email/da_DK/membership_expired.html +0 -7
  142. languages/email/da_DK/membership_expiring.html +0 -6
  143. languages/email/da_DK/trial_ending.html +0 -8
  144. languages/gettext.sh +0 -23
  145. languages/pmpro-cs_CZ.mo +0 -0
  146. languages/pmpro-cs_CZ.po +0 -2889
  147. languages/pmpro-da_DK.mo +0 -0
  148. languages/pmpro-da_DK.po +0 -3502
  149. languages/pmpro-en_GB.mo +0 -0
  150. languages/pmpro-en_GB.po +0 -2661
  151. languages/pmpro-fr_FR.mo +0 -0
  152. languages/pmpro-fr_FR.po +327 -444
  153. languages/pmpro-it_IT.mo +0 -0
  154. languages/pmpro-it_IT.po +0 -3517
  155. languages/pmpro-nb_NO.mo +0 -0
  156. languages/pmpro-nb_NO.po +0 -3279
  157. languages/pmpro-pt_BR.mo +0 -0
  158. languages/pmpro-pt_BR.po +0 -2661
  159. languages/pmpro-sk_SK.mo +0 -0
  160. languages/pmpro-sk_SK.po +0 -3826
  161. languages/pmpro-tr_TR.mo +0 -0
  162. languages/pmpro-tr_TR.po +0 -3470
  163. languages/pmpro.mo +0 -0
  164. languages/pmpro.po +1023 -2332
  165. languages/pmpro.pot +1023 -2332
  166. logs/.gitkeep +0 -0
  167. logs/ipn.txt +2084 -0
  168. pages/account.php +11 -15
  169. pages/billing.php +11 -46
  170. pages/checkout.php +39 -56
  171. pages/confirmation.php +4 -4
  172. pages/invoice.php +3 -3
  173. pages/levels.php +82 -32
  174. paid-memberships-pro.php +12 -58
  175. preheaders/account.php +42 -37
  176. preheaders/billing.php +369 -372
  177. preheaders/cancel.php +40 -39
  178. preheaders/checkout.php +1048 -999
  179. preheaders/confirmation.php +12 -15
  180. preheaders/invoice.php +32 -32
  181. preheaders/levels.php +33 -32
  182. readme.txt +3 -179
  183. scheduled/crons.php +6 -16
  184. services/applydiscountcode.php +134 -141
  185. services/authnet-silent-post.php +0 -5
  186. services/getfile.php +57 -5
  187. services/ipnhandler.php +34 -183
  188. services/stripe-webhook.php +18 -101
  189. services/twocheckout-ins.php +48 -95
  190. 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' => '.2',
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.2',
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' => '.3',
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',
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.2.1',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
adminpages/addons/pmpro-stripe-lite.php ADDED
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Stripe Lite
4
+ Slug: pmpro-stripe-lite
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Stripe Lite',
8
+ 'version' => '.1.1',
9
+ 'widget' => 'pmpro_addon_pmpro_stripe_lite_widget',
10
+ 'enabled' => function_exists('pmprosl_pmpro_pages_shortcode_checkout')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_stripe_lite_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Remove billing fields (not required by Stripe) from the checkout page when using the Stripe payment gateway with PMPro.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-stripe-lite/blob/master/readme.txt" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-stripe-lite/pmpro-stripe-lite.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-stripe-lite/pmpro-stripe-lite.php'), 'activate-plugin_pmpro-stripe-lite/pmpro-stripe-lite.php')?>" class="button button-primary">Activate</a>
24
+ <?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-stripe-lite.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
+ </div>
28
+ </div> <!-- end info -->
29
+ <?php
30
+ }
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
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('repo', array(
7
'title' => 'WP Bouncer',
8
- 'version' => '1.1',
9
'widget' => 'pmpro_addon_wp_bouncer_widget',
10
'enabled' => class_exists('WP_Bouncer')
11
)
@@ -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 { ?>
5
*/
6
pmpro_add_addon('repo', array(
7
'title' => 'WP Bouncer',
8
+ 'version' => '1.0.1',
9
'widget' => 'pmpro_addon_wp_bouncer_widget',
10
'enabled' => class_exists('WP_Bouncer')
11
)
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
@@ -92,27 +92,6 @@
92
$msgt .= " <a href=\"?page=pmpro-membershiplevels\">" . __("Please edit your levels", "pmpro") . "</a>.";
93
}
94
95
- if(!pmpro_checkLevelForTwoCheckoutCompatibility())
96
- {
97
- $msg = -1;
98
- $msgt = __("The billing details for some of your membership levels is not supported by TwoCheckout.", "pmpro");
99
- if($view == "pmpro-membershiplevels" && !empty($_REQUEST['edit']) && $_REQUEST['edit'] > 0)
100
- {
101
- if(!pmpro_checkLevelForTwoCheckoutCompatibility($_REQUEST['edit']))
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")
111
- $msgt .= " " . __("The levels with issues are highlighted below.", "pmpro");
112
- else
113
- $msgt .= " <a href=\"?page=pmpro-membershiplevels\">" . __("Please edit your levels", "pmpro") . "</a>.";
114
- }
115
-
116
if(!empty($msg))
117
{
118
?>
@@ -124,7 +103,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>
92
$msgt .= " <a href=\"?page=pmpro-membershiplevels\">" . __("Please edit your levels", "pmpro") . "</a>.";
93
}
94
95
if(!empty($msg))
96
{
97
?>
103
<div class="wrap pmpro_admin">
104
<div class="pmpro_banner">
105
<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>
106
+ <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>
107
108
<br style="clear:both;" />
109
</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
@@ -1,23 +1,4 @@
1
<?php
2
- /****************************************************************
3
-
4
- IMPORTANT. PLEASE READ.
5
-
6
- DO NOT EDIT THIS FILE or any other file in the /wp-content/plugins/paid-memberships-pro/ directory.
7
- Doing so could break the PMPro plugin and/or keep you from upgrading this plugin in the future.
8
- We regularly release updates to the plugin, including important security fixes and new features.
9
- You want to be able to upgrade.
10
-
11
- If you were asked to insert code into "your functions.php file", it was meant that you edit the functions.php
12
- in the root folder of your active theme. e.g. /wp-content/themes/twentytwelve/functions.php
13
- You can also create a custom plugin to place customization code into. Instructions are here:
14
- http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
15
-
16
- Further documentation for customizing Paid Memberships Pro can be found here:
17
- http://www.paidmembershipspro.com/documentation/
18
-
19
- ****************************************************************/
20
-
21
/*
22
Checks if PMPro settings are complete or if there are any errors.
23
*/
@@ -40,11 +21,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 +41,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;
@@ -174,49 +155,3 @@ function pmpro_checkLevelForBraintreeCompatibility($level = NULL)
174
return true;
175
}
176
177
- /*
178
- Checks if PMPro settings are complete or if there are any errors.
179
- */
180
- function pmpro_checkLevelForTwoCheckoutCompatibility($level = NULL)
181
- {
182
- $gateway = pmpro_getOption("gateway");
183
- if($gateway == "twocheckout")
184
- {
185
- global $wpdb;
186
-
187
- //check ALL the levels
188
- if(empty($level))
189
- {
190
- $sqlQuery = "SELECT * FROM $wpdb->pmpro_membership_levels ORDER BY id ASC";
191
- $levels = $wpdb->get_results($sqlQuery, OBJECT);
192
- if(!empty($levels))
193
- {
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
- }
204
- }
205
- }
206
- }
207
- else
208
- {
209
- //need to look it up?
210
- if(is_numeric($level))
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
- }
218
- }
219
- }
220
-
221
- return true;
222
- }
1
<?php
2
/*
3
Checks if PMPro settings are complete or if there are any errors.
4
*/
21
/*
22
Stripe currently does not support:
23
* Trial Amounts > 0.
24
+ * Daily or Weekly billing periods.
25
* Billing Limits.
26
*/
27
if($level->trial_amount > 0 ||
28
+ ($level->cycle_number > 0 && ($level->cycle_period == "Day" || $level->cycle_period == "Week")) ||
29
$level->billing_limit > 0)
30
{
31
return false;
41
42
//check this level
43
if($level->trial_amount > 0 ||
44
+ ($level->cycle_number > 0 && ($level->cycle_period == "Day" || $level->cycle_period == "Week")) ||
45
$level->billing_limit > 0)
46
{
47
return false;
155
return true;
156
}
157
adminpages/membershiplevels.php CHANGED
@@ -9,7 +9,7 @@
9
10
//some vars
11
$gateway = pmpro_getOption("gateway");
12
- global $pmpro_stripe_error, $pmpro_braintree_error, $pmpro_payflow_error, $pmpro_twocheckout_error, $wp_version;
13
14
if(isset($_REQUEST['edit']))
15
$edit = $_REQUEST['edit'];
@@ -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,8 +412,8 @@
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>
427
@@ -446,7 +438,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 +487,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>
@@ -534,7 +526,7 @@
534
foreach($levels as $level)
535
{
536
?>
537
- <tr class="<?php if(!$level->allow_signups) { ?>pmpro_gray<?php } ?> <?php if(!pmpro_checkLevelForStripeCompatibility($level) || !pmpro_checkLevelForBraintreeCompatibility($level) || !pmpro_checkLevelForPayflowCompatibility($level) || !pmpro_checkLevelForTwoCheckoutCompatibility($level)) { ?>pmpro_error<?php } ?>">
538
<td><?php echo $level->id?></td>
539
<td><?php echo $level->name?></td>
540
<td>
@@ -548,7 +540,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 +561,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
}
9
10
//some vars
11
$gateway = pmpro_getOption("gateway");
12
+ global $pmpro_stripe_error, $pmpro_braintree_error, $pmpro_payflow_error, $wp_version;
13
14
if(isset($_REQUEST['edit']))
15
$edit = $_REQUEST['edit'];
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 } ?>
417
</td>
418
</tr>
419
438
<input id="expiration_number" name="expiration_number" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
439
<select id="expiration_period" name="expiration_period">
440
<?php
441
+ $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
442
foreach ( $cycles as $name => $value ) {
443
echo "<option value='$value'";
444
if ( $level->expiration_period == $value ) echo " selected='selected'";
487
{
488
?>
489
490
+ <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>
491
<form id="posts-filter" method="get" action="">
492
<p class="search-box">
493
<label class="screen-reader-text" for="post-search-input"><?php _e('Search Levels', 'pmpro');?>:</label>
526
foreach($levels as $level)
527
{
528
?>
529
+ <tr class="<?php if(!$level->allow_signups) { ?>pmpro_gray<?php } ?> <?php if(!pmpro_checkLevelForStripeCompatibility($level) || !pmpro_checkLevelForBraintreeCompatibility($level) || !pmpro_checkLevelForPayflowCompatibility($level)) { ?>pmpro_error<?php } ?>">
530
<td><?php echo $level->id?></td>
531
<td><?php echo $level->name?></td>
532
<td>
540
<?php if(!pmpro_isLevelRecurring($level)) { ?>
541
--
542
<?php } else { ?>
543
+ <?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)?>
544
545
<?php if($level->billing_limit) { ?>(<?php _e('for', 'pmpro');?> <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
546
561
<?php } ?>
562
</td>
563
<td><?php if($level->allow_signups) { ?><?php _e('Yes', 'pmpro');?><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
564
+ <td align="center"><a href="admin.php?page=pmpro-membershiplevels&edit=<?php echo $level->id?>" class="edit"><?php _e('edit', 'pmpro');?></a></td>
565
+ <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>
566
+ <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>
567
</tr>
568
<?php
569
}
adminpages/memberslist-csv.php CHANGED
@@ -42,83 +42,32 @@
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
@@ -162,23 +111,12 @@
162
163
$csvoutput .= "\n";
164
165
- //output
166
- echo $csvoutput;
167
- $csvoutput = "";
168
-
169
if($theusers)
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;
184
$sqlQuery = "SELECT c.id, c.code FROM $wpdb->pmpro_discount_codes_uses cu LEFT JOIN $wpdb->pmpro_discount_codes c ON cu.code_id = c.id WHERE cu.user_id = '" . $theuser->ID . "' ORDER BY c.id DESC LIMIT 1";
@@ -203,38 +141,37 @@
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
230
$csvoutput .= "\n";
231
-
232
- //output
233
- echo $csvoutput;
234
- $csvoutput = "";
235
}
236
}
237
-
238
print $csvoutput;
239
240
function pmpro_enclose($s)
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, 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->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
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
67
68
+ $theusers = $wpdb->get_results($sqlQuery);
69
+
70
+ $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";
71
$heading = apply_filters("pmpro_members_list_csv_heading", $heading);
72
$csvoutput = $heading;
73
111
112
$csvoutput .= "\n";
113
114
if($theusers)
115
{
116
+ foreach($theusers as $theuser)
117
{
118
//get meta
119
+ $sqlQuery = "SELECT meta_key as `key`, meta_value as `value` FROM $wpdb->usermeta WHERE $wpdb->usermeta.user_id = '" . $theuser->ID . "'";
120
$metavalues = pmpro_getMetavalues($sqlQuery);
121
$theuser->metavalues = $metavalues;
122
$sqlQuery = "SELECT c.id, c.code FROM $wpdb->pmpro_discount_codes_uses cu LEFT JOIN $wpdb->pmpro_discount_codes c ON cu.code_id = c.id WHERE cu.user_id = '" . $theuser->ID . "' ORDER BY c.id DESC LIMIT 1";
141
142
//joindate and enddate
143
$csvoutput .= "," . pmpro_enclose(date("Y-m-d", $theuser->joindate)) . ",";
144
+ if($theuser->enddate)
145
$csvoutput .= pmpro_enclose(date("Y-m-d", $theuser->enddate));
146
else
147
+ $csvoutput .= pmpro_enclose("Never");
148
+
149
//any extra columns
150
if(!empty($extra_columns))
151
{
152
foreach($extra_columns as $heading => $callback)
153
{
154
+ $csvoutput .= "," . pmpro_enclose(call_user_func($callback, $theuser));
155
}
156
}
157
158
$csvoutput .= "\n";
159
+
160
}
161
}
162
+
163
+ $size_in_bytes = strlen($csvoutput);
164
+ header("Content-type: text/csv");
165
+ //header("Content-type: application/vnd.ms-excel");
166
+ if($s && $l)
167
+ header("Content-Disposition: attachment; filename=members_list_" . intval($l) . "_level" . sanitize_file_name($s) . ".csv; size=$size_in_bytes");
168
+ elseif($s)
169
+ header("Content-Disposition: attachment; filename=members_list_" . sanitize_file_name($s) . ".csv; size=$size_in_bytes");
170
+ elseif($l)
171
+ header("Content-Disposition: attachment; filename=members_list_level" . intval($l) . ".csv; size=$size_in_bytes");
172
+ else
173
+ header("Content-Disposition: attachment; filename=members_list.csv; size=$size_in_bytes");
174
+
175
print $csvoutput;
176
177
function pmpro_enclose($s)
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