Paid Memberships Pro - Version 1.7.7

Version Description

  • Fixed bug where user_id
Download this release

Release Info

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

Code changes from version 1.7.14 to 1.7.7

Files changed (166) hide show
  1. adminpages/addons.php +1 -1
  2. adminpages/addons/images/pmpro-bbpress.jpg +0 -0
  3. adminpages/addons/images/pmpro-constant-contact.gif +0 -0
  4. adminpages/addons/images/pmpro-email-templates.gif +0 -0
  5. adminpages/addons/images/pmpro-woocommerce.gif +0 -0
  6. adminpages/addons/pmpro-addon-packages.php +2 -2
  7. adminpages/addons/pmpro-affiliates.php +2 -2
  8. adminpages/addons/pmpro-aweber.php +2 -2
  9. adminpages/addons/pmpro-bbpress.php +6 -9
  10. adminpages/addons/pmpro-constant-contact.php +0 -31
  11. adminpages/addons/pmpro-email-templates.php +0 -31
  12. adminpages/addons/pmpro-expiration.php +8 -10
  13. adminpages/addons/pmpro-freeaddress.php +5 -7
  14. adminpages/addons/pmpro-infusionsoft.php +4 -4
  15. adminpages/addons/pmpro-mailchimp.php +3 -3
  16. adminpages/addons/pmpro-network-subsite.php +0 -31
  17. adminpages/addons/pmpro-post-affiliate-pro.php +1 -1
  18. adminpages/addons/pmpro-register-helper.php +1 -1
  19. adminpages/addons/pmpro-series.php +1 -1
  20. adminpages/addons/pmpro-shipping.php +1 -1
  21. adminpages/addons/pmpro-user-pages.php +1 -1
  22. adminpages/addons/pmpro-woocommerce.php +0 -31
  23. adminpages/addons/pmpro-wp-affiliate.php +3 -5
  24. adminpages/addons/tml.php +1 -1
  25. adminpages/admin_header.php +1 -1
  26. adminpages/advancedsettings.php +11 -95
  27. adminpages/discountcodes.php +16 -21
  28. adminpages/emailsettings.php +152 -181
  29. adminpages/membershiplevels.php +5 -7
  30. adminpages/memberslist-csv.php +2 -2
  31. adminpages/memberslist.php +3 -3
  32. adminpages/orders-csv.php +14 -116
  33. adminpages/orders.php +7 -312
  34. adminpages/pagesettings.php +1 -29
  35. adminpages/paymentsettings.php +3 -3
  36. adminpages/reports.php +0 -3
  37. adminpages/reports/login.php +2 -2
  38. adminpages/reports/memberships.php +18 -18
  39. classes/class.memberorder.php +6 -36
  40. classes/class.pmproemail.php +14 -17
  41. classes/gateways/class.pmprogateway.php +2 -18
  42. classes/gateways/class.pmprogateway_authorizenet.php +2 -2
  43. classes/gateways/class.pmprogateway_braintree.php +12 -12
  44. classes/gateways/class.pmprogateway_check.php +2 -2
  45. classes/gateways/class.pmprogateway_cybersource.php +5 -5
  46. classes/gateways/class.pmprogateway_payflowpro.php +11 -14
  47. classes/gateways/class.pmprogateway_paypal.php +10 -12
  48. classes/gateways/class.pmprogateway_paypalexpress.php +11 -42
  49. classes/gateways/class.pmprogateway_paypalstandard.php +14 -30
  50. classes/gateways/class.pmprogateway_stripe.php +31 -79
  51. css/admin-rtl.css +0 -63
  52. css/frontend-rtl.css +0 -111
  53. css/frontend.css +1 -3
  54. email/checkout_check.html +1 -1
  55. includes/adminpages.php +66 -147
  56. includes/content.php +42 -69
  57. includes/email.php +17 -48
  58. includes/filters.php +2 -2
  59. includes/functions.php +111 -158
  60. includes/init.php +8 -65
  61. includes/lib/Stripe/Stripe.php +0 -10
  62. includes/lib/Stripe/Stripe/Account.php +6 -5
  63. includes/lib/Stripe/Stripe/ApiRequestor.php +51 -153
  64. includes/lib/Stripe/Stripe/ApiResource.php +17 -51
  65. includes/lib/Stripe/Stripe/ApplicationFee.php +0 -53
  66. includes/lib/Stripe/Stripe/AttachedObject.php +0 -23
  67. includes/lib/Stripe/Stripe/Balance.php +0 -15
  68. includes/lib/Stripe/Stripe/BalanceTransaction.php +0 -39
  69. includes/lib/Stripe/Stripe/Card.php +0 -54
  70. includes/lib/Stripe/Stripe/CardError.php +2 -4
  71. includes/lib/Stripe/Stripe/Charge.php +7 -55
  72. includes/lib/Stripe/Stripe/Coupon.php +7 -24
  73. includes/lib/Stripe/Stripe/Customer.php +6 -61
  74. includes/lib/Stripe/Stripe/Error.php +7 -9
  75. includes/lib/Stripe/Stripe/Event.php +6 -12
  76. includes/lib/Stripe/Stripe/InvalidRequestError.php +2 -4
  77. includes/lib/Stripe/Stripe/Invoice.php +6 -30
  78. includes/lib/Stripe/Stripe/InvoiceItem.php +6 -24
  79. includes/lib/Stripe/Stripe/List.php +5 -25
  80. includes/lib/Stripe/Stripe/Object.php +12 -123
  81. includes/lib/Stripe/Stripe/Plan.php +6 -26
  82. includes/lib/Stripe/Stripe/Recipient.php +0 -75
  83. includes/lib/Stripe/Stripe/SingletonApiResource.php +0 -7
  84. includes/lib/Stripe/Stripe/Stripe.php +3 -49
  85. includes/lib/Stripe/Stripe/Subscription.php +0 -58
  86. includes/lib/Stripe/Stripe/Token.php +6 -12
  87. includes/lib/Stripe/Stripe/Transfer.php +6 -34
  88. includes/lib/Stripe/Stripe/Util.php +14 -42
  89. includes/login.php +3 -19
  90. includes/metaboxes.php +2 -2
  91. includes/profile.php +4 -4
  92. includes/services.php +1 -1
  93. includes/upgradecheck.php +4 -25
  94. includes/xmlrpc.php +0 -80
  95. languages/email/da_DK/admin_change.html +0 -7
  96. languages/email/da_DK/admin_change_admin.html +0 -5
  97. languages/email/da_DK/billing.html +0 -16
  98. languages/email/da_DK/billing_admin.html +0 -17
  99. languages/email/da_DK/billing_failure.html +0 -11
  100. languages/email/da_DK/billing_failure_admin.html +0 -11
  101. languages/email/da_DK/cancel.html +0 -3
  102. languages/email/da_DK/cancel_admin.html +0 -8
  103. languages/email/da_DK/checkout_check.html +0 -17
  104. languages/email/da_DK/checkout_check_admin.html +0 -17
  105. languages/email/da_DK/checkout_express.html +0 -14
  106. languages/email/da_DK/checkout_express_admin.html +0 -14
  107. languages/email/da_DK/checkout_free.html +0 -8
  108. languages/email/da_DK/checkout_free_admin.html +0 -8
  109. languages/email/da_DK/checkout_freetrial.html +0 -19
  110. languages/email/da_DK/checkout_freetrial_admin.html +0 -19
  111. languages/email/da_DK/checkout_paid.html +0 -23
  112. languages/email/da_DK/checkout_paid_admin.html +0 -23
  113. languages/email/da_DK/checkout_trial.html +0 -23
  114. languages/email/da_DK/checkout_trial_admin.html +0 -23
  115. languages/email/da_DK/credit_card_expiring.html +0 -13
  116. languages/email/da_DK/default.html +0 -1
  117. languages/email/da_DK/footer.html +0 -4
  118. languages/email/da_DK/header.html +0 -1
  119. languages/email/da_DK/invoice.html +0 -19
  120. languages/email/da_DK/membership_expired.html +0 -7
  121. languages/email/da_DK/membership_expiring.html +0 -6
  122. languages/email/da_DK/trial_ending.html +0 -8
  123. languages/gettext.sh +0 -3
  124. languages/pmpro-cs_CZ.mo +0 -0
  125. languages/pmpro-cs_CZ.po +0 -2889
  126. languages/pmpro-da_DK.mo +0 -0
  127. languages/pmpro-da_DK.po +0 -3502
  128. languages/pmpro-fr_FR.mo +0 -0
  129. languages/pmpro-fr_FR.po +3 -4
  130. languages/pmpro-it_IT.mo +0 -0
  131. languages/pmpro-it_IT.po +1367 -2483
  132. languages/pmpro-nb_NO.mo +0 -0
  133. languages/pmpro-nb_NO.po +0 -3279
  134. languages/pmpro-pt_BR.mo +0 -0
  135. languages/pmpro-pt_BR.po +0 -2661
  136. languages/pmpro-sk_SK.mo +0 -0
  137. languages/pmpro-sk_SK.po +0 -3826
  138. languages/pmpro-tr_TR.mo +0 -0
  139. languages/pmpro-tr_TR.po +0 -3470
  140. languages/pmpro.mo +0 -0
  141. languages/pmpro.po +1023 -2332
  142. languages/pmpro.pot +823 -1552
  143. logs/.gitkeep +0 -0
  144. pages/account.php +8 -12
  145. pages/billing.php +11 -46
  146. pages/checkout.php +37 -43
  147. pages/confirmation.php +3 -3
  148. pages/invoice.php +2 -2
  149. pages/levels.php +82 -16
  150. paid-memberships-pro.php +10 -57
  151. preheaders/account.php +42 -37
  152. preheaders/billing.php +369 -372
  153. preheaders/cancel.php +40 -39
  154. preheaders/checkout.php +1090 -999
  155. preheaders/confirmation.php +12 -15
  156. preheaders/invoice.php +32 -32
  157. preheaders/levels.php +33 -32
  158. readme.txt +2 -108
  159. scheduled/crons.php +3 -3
  160. services/applydiscountcode.php +2 -8
  161. services/authnet-silent-post.php +0 -5
  162. services/getfile.php +57 -5
  163. services/ipnhandler.php +20 -39
  164. services/stripe-webhook.php +17 -96
  165. services/twocheckout-ins.php +8 -12
  166. 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' => '.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.3',
9
'widget' => 'pmpro_addon_pmpro_affiliates_widget',
10
'enabled' => function_exists('pmpro_affiliates_dependencies')
11
)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-affiliates/pmpro-affiliates.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-affiliates/pmpro-affiliates.php'), 'activate-plugin_pmpro-affiliates/pmpro-affiliates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
+ <a href="https://github.com/strangerstudios/pmpro-affiliates/archive/master.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
adminpages/addons/pmpro-aweber.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro AWeber Integration',
8
- 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_aweber_widget',
10
'enabled' => function_exists('pmproaw_init')
11
)
@@ -19,7 +19,7 @@ function pmpro_addon_pmpro_aweber_widget($addon)
19
<p>Integrate User Registrations with AWeber. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-aweber/pmpro-aweber.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-aweber/pmpro-aweber.php'), 'activate-plugin_pmpro-aweber/pmpro-aweber.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro AWeber Integration',
8
+ 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_aweber_widget',
10
'enabled' => function_exists('pmproaw_init')
11
)
19
<p>Integrate User Registrations with AWeber. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-aweber/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-aweber/pmpro-aweber.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-aweber/pmpro-aweber.php'), 'activate-plugin_pmpro-aweber/pmpro-aweber.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
adminpages/addons/pmpro-bbpress.php CHANGED
@@ -3,28 +3,25 @@
3
Addon: PMPro bbPress
4
Slug: pmpro-bbpress
5
*/
6
- pmpro_add_addon('repo', array(
7
'title' => 'PMPro bbPress',
8
- 'version' => '1.0.1',
9
'widget' => 'pmpro_addon_pmpro_bbpress_widget',
10
- 'enabled' => function_exists('pmprobbp_add_meta_box')
11
)
12
);
13
14
function pmpro_addon_pmpro_bbpress_widget($addon)
15
{
16
?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-bbpress.jpg" />
18
<div class="info">
19
<p>Locking down bbPress Forums by Membership Level and Forum ID.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-bbpress/pmpro-bbpress.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-bbpress/pmpro-bbpress.php'), 'activate-plugin_pmpro-bbpress/pmpro-bbpress.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
- <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-bbpress'), 'install-plugin_pmpro-bbpress'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
3
Addon: PMPro bbPress
4
Slug: pmpro-bbpress
5
*/
6
+ pmpro_add_addon('gists', array(
7
'title' => 'PMPro bbPress',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_bbpress_widget',
10
+ 'enabled' => function_exists('pmpro_check_forum')
11
)
12
);
13
14
function pmpro_addon_pmpro_bbpress_widget($addon)
15
{
16
?>
17
<div class="info">
18
<p>Locking down bbPress Forums by Membership Level and Forum ID.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/1633637" class="button">Enabled</a>
22
<?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/1633637" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
adminpages/addons/pmpro-constant-contact.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /*
3
- Addon: PMPro Constant Contact Integration
4
- Slug: pmpro-constant-contact
5
- */
6
- pmpro_add_addon('thirdparty', array(
7
- 'title' => 'PMPro Constant Contact Integration',
8
- 'version' => '1.0',
9
- 'widget' => 'pmpro_addon_pmpro_constant_contact_widget',
10
- 'enabled' => function_exists('pmprocc_init')
11
- )
12
- );
13
-
14
- function pmpro_addon_pmpro_constant_contact_widget($addon)
15
- {
16
- ?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-constant-contact.gif" />
18
- <div class="info">
19
- <p>Integrate User Registrations with Constant Contact . Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
- <div class="actions">
21
- <?php if($addon['enabled']) { ?>
22
- <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-constant-contact/pmpro-constant-contact.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-constant-contact/pmpro-constant-contact.php'), 'activate-plugin_pmpro-constant-contact/pmpro-constant-contact.php')?>" class="button button-primary">Activate</a>
25
- <?php } else { ?>
26
- <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-constant-contact'), 'install-plugin_pmpro-constant-contact'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
- </div>
29
- </div> <!-- end info -->
30
- <?php
31
- }
adminpages/addons/pmpro-email-templates.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /*
3
- Addon: PMPro Email Templates Editor
4
- Slug: pmpro-email-templates-addon
5
- */
6
- pmpro_add_addon('repo', array(
7
- 'title' => 'PMPro Email Templates',
8
- 'version' => '.5.2',
9
- 'widget' => 'pmpro_addon_email_templates_widget',
10
- 'enabled' => function_exists('pmproet_scripts')
11
- )
12
- );
13
-
14
- function pmpro_addon_email_templates_widget($addon)
15
- {
16
- ?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-email-templates.gif" />
18
- <div class="info">
19
- <p>Easily edit system-generated Email Templates from the WordPress admin.</p>
20
- <div class="actions">
21
- <?php if($addon['enabled']) { ?>
22
- <a href="http://wordpress.org/plugins/pmpro-email-templates-addon/" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-email-templates-addon/pmpro-email-templates.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-email-templates-addon/pmpro-email-templates.php'), 'activate-plugin_pmpro-email-templates-addon/pmpro-email-templates.php')?>" class="button button-primary">Activate</a>
25
- <?php } else { ?>
26
- <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-email-templates-addon'), 'install-plugin_pmpro-email-templates-addon'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
- </div>
29
- </div> <!-- end info -->
30
- <?php
31
- }
adminpages/addons/pmpro-expiration.php CHANGED
@@ -3,11 +3,11 @@
3
Addon: PMPro Expiration Date
4
Slug: pmpro-expiration
5
*/
6
- pmpro_add_addon('github', array(
7
- 'title' => 'PMPro Set Expiration Dates',
8
- 'version' => '.1.1',
9
'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
- 'enabled' => function_exists('pmprosed_pmpro_checkout_level')
11
)
12
);
13
@@ -15,15 +15,13 @@ function pmpro_addon_pmpro_expiration_widget($addon)
15
{
16
?>
17
<div class="info">
18
- <p>Set a specific expiration date (e.g. 2013-12-31) for a PMPro membership level or discount code.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
- <a href="https://github.com/strangerstudios/pmpro-set-expiration-dates/blob/master/readme.txt" class="button">Enabled</a>
22
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-set-expiration-dates/pmpro-set-expiration-dates.php")) { ?>
23
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-set-expiration-dates/pmpro-set-expiration-dates.php'), 'activate-plugin_pmpro-set-expiration-dates/pmpro-set-expiration-dates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-set-expiration-dates.zip" class="button button-primary">Download</a>
26
- <?php } ?>
27
</div>
28
</div> <!-- end info -->
29
<?php
3
Addon: PMPro Expiration Date
4
Slug: pmpro-expiration
5
*/
6
+ pmpro_add_addon('gists', array(
7
+ 'title' => 'PMPro Expiration Date',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
+ 'enabled' => function_exists('my_pmpro_checkout_level_specific_expiration')
11
)
12
);
13
15
{
16
?>
17
<div class="info">
18
+ <p>Set a specific expiration date for a Membership Level.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5709300" class="button">Enabled</a>
22
<?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5709300" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
adminpages/addons/pmpro-freeaddress.php CHANGED
@@ -3,9 +3,9 @@
3
Addon: PMPro Require Name and Address for Free Level
4
Slug: pmpro-freerequire
5
*/
6
- pmpro_add_addon('github', array(
7
'title' => 'PMPro Require Name/Address for Free Level',
8
- 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_freerequire_widget',
10
'enabled' => function_exists('my_pmpro_checkout_boxes_require_address')
11
)
@@ -18,12 +18,10 @@ function pmpro_addon_pmpro_freerequire_widget($addon)
18
<p>Require name/address for free Membership Level checkout.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
- <a href="https://github.com/strangerstudios/pmpro-address-for-free-levels" class="button">Enabled</a>
22
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-address-for-free-levels/pmpro-address-for-free-levels.php")) { ?>
23
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-address-for-free-levels/pmpro-address-for-free-levels.php'), 'activate-plugin_pmpro-address-for-free-levels/pmpro-address-for-free-levels.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-address-for-free-levels.zip" class="button button-primary">Download</a>
26
- <?php } ?>
27
</div>
28
</div> <!-- end info -->
29
<?php
3
Addon: PMPro Require Name and Address for Free Level
4
Slug: pmpro-freerequire
5
*/
6
+ pmpro_add_addon('gists', array(
7
'title' => 'PMPro Require Name/Address for Free Level',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_freerequire_widget',
10
'enabled' => function_exists('my_pmpro_checkout_boxes_require_address')
11
)
18
<p>Require name/address for free Membership Level checkout.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5716249" class="button">Enabled</a>
22
<?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5716249" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
adminpages/addons/pmpro-infusionsoft.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Infusionsoft Integration',
8
- 'version' => '1.2',
9
'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
'enabled' => function_exists('pmprois_init')
11
)
@@ -19,12 +19,12 @@ function pmpro_addon_pmpro_infusionsoft_widget($addon)
19
<p>Integrate with Infusionsoft. Add members to email lists (groups, tags) based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-infusionsoft/pmpro-infusionsoft.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-infusionsoft/pmpro-infusionsoft.php'), 'activate-plugin_pmpro-infusionsoft/pmpro-infusionsoft.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
- <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-infusionsoft'), 'install-plugin_pmpro-infusionsoft'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Infusionsoft Integration',
8
+ 'version' => '.5',
9
'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
'enabled' => function_exists('pmprois_init')
11
)
19
<p>Integrate with Infusionsoft. Add members to email lists (groups, tags) based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-infusionsoft/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-infusionsoft/pmpro-infusionsoft.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-infusionsoft/pmpro-infusionsoft.php'), 'activate-plugin_pmpro-infusionsoft/pmpro-infusionsoft.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-infusionsoft.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
adminpages/addons/pmpro-mailchimp.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro MailChimp Integration',
8
- 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_mailchimp_widget',
10
'enabled' => function_exists('pmpromc_init')
11
)
@@ -19,12 +19,12 @@ function pmpro_addon_pmpro_mailchimp_widget($addon)
19
<p>Integrate User Registrations with Mailchimp. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-mailchimp/pmpro-mailchimp.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-mailchimp/pmpro-mailchimp.php'), 'activate-plugin_pmpro-mailchimp/pmpro-mailchimp.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
<a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-mailchimp'), 'install-plugin_pmpro-mailchimp'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro MailChimp Integration',
8
+ 'version' => '.3.3',
9
'widget' => 'pmpro_addon_pmpro_mailchimp_widget',
10
'enabled' => function_exists('pmpromc_init')
11
)
19
<p>Integrate User Registrations with Mailchimp. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-mailchimp/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-mailchimp/pmpro-mailchimp.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-mailchimp/pmpro-mailchimp.php'), 'activate-plugin_pmpro-mailchimp/pmpro-mailchimp.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
<a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-mailchimp'), 'install-plugin_pmpro-mailchimp'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
adminpages/addons/pmpro-network-subsite.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /*
3
- Addon: PMPro Network
4
- Slug: pmpro-network-subsite
5
- */
6
- pmpro_add_addon('github', array(
7
- 'title' => 'PMPro Network Subsite Helper',
8
- 'version' => '.2',
9
- 'widget' => 'pmpro_addon_pmpro_network_subsite_widget',
10
- 'enabled' => function_exists('pmpron_subsite_activated_plugin')
11
- )
12
- );
13
-
14
- function pmpro_addon_pmpro_network_subsite_widget($addon)
15
- {
16
- ?>
17
- <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-network.gif" />
18
- <div class="info">
19
- <p>Have network subsites use membership data from a "main" site to handle access restrictions.</p>
20
- <div class="actions">
21
- <?php if($addon['enabled']) { ?>
22
- <a href="https://github.com/strangerstudios/pmpro-network-subsite" class="button">Enabled</a>
23
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-network-subsite/pmpro-network-subsite.php")) { ?>
24
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-network-subsite/pmpro-network-subsite.php'), 'activate-plugin_pmpro-network-subsite/pmpro-network-subsite.php')?>" class="button button-primary">Activate</a>
25
- <?php } else { ?>
26
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-network-subsite.zip" class="button button-primary">Download</a>
27
- <?php } ?>
28
- </div>
29
- </div> <!-- end info -->
30
- <?php
31
- }
adminpages/addons/pmpro-post-affiliate-pro.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Post Affiliate Pro Integration',
8
- 'version' => '.2.1.1',
9
'widget' => 'pmpro_addon_pmpro_post_affiliate_pro_widget',
10
'enabled' => function_exists('pap_pmpro_track_sale')
11
)
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Post Affiliate Pro Integration',
8
+ 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_post_affiliate_pro_widget',
10
'enabled' => function_exists('pap_pmpro_track_sale')
11
)
adminpages/addons/pmpro-register-helper.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Register Helper',
8
- 'version' => '.5.16.1',
9
'widget' => 'pmpro_addon_pmpro_register_helper_widget',
10
'enabled' => class_exists('PMProRH_Field')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Register Helper',
8
+ 'version' => '.5.5.1',
9
'widget' => 'pmpro_addon_pmpro_register_helper_widget',
10
'enabled' => class_exists('PMProRH_Field')
11
)
adminpages/addons/pmpro-series.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Series',
8
- 'version' => '.3',
9
'widget' => 'pmpro_addon_pmpro_series_widget',
10
'enabled' => class_exists("PMProSeries")
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Series',
8
+ 'version' => '.2.1',
9
'widget' => 'pmpro_addon_pmpro_series_widget',
10
'enabled' => class_exists("PMProSeries")
11
)
adminpages/addons/pmpro-shipping.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Shipping Add On',
8
- 'version' => '.2.6',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Shipping Add On',
8
+ 'version' => '.2.4',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
adminpages/addons/pmpro-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/admin_header.php CHANGED
@@ -124,7 +124,7 @@
124
<div class="wrap pmpro_admin">
125
<div class="pmpro_banner">
126
<a class="pmpro_logo" title="Paid Memberships Pro - Membership Plugin for WordPress" target="_blank" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><img src="<?php echo PMPRO_URL?>/images/Paid-Memberships-Pro.png" width="350" height="75" border="0" alt="Paid Memberships Pro(c) - All Rights Reserved" /></a>
127
- <div class="pmpro_meta"><span class="pmpro_tag-grey">v<?php echo PMPRO_VERSION?></span><a target="_blank" class="pmpro_tag-blue" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><?php _e('Plugin Support', 'pmpro');?></a><a target="_blank" class="pmpro_tag-blue" href="http://www.paidmembershipspro.com/forums/"><?php _e('User Forum', 'pmpro');?></a></div>
128
129
<br style="clear:both;" />
130
</div>
124
<div class="wrap pmpro_admin">
125
<div class="pmpro_banner">
126
<a class="pmpro_logo" title="Paid Memberships Pro - Membership Plugin for WordPress" target="_blank" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><img src="<?php echo PMPRO_URL?>/images/Paid-Memberships-Pro.png" width="350" height="75" border="0" alt="Paid Memberships Pro(c) - All Rights Reserved" /></a>
127
+ <div class="pmpro_meta"><span class="pmpro_tag-grey">v<?php echo PMPRO_VERSION?></span><a class="pmpro_tag-blue" href="<?php echo pmpro_https_filter("http://www.paidmembershipspro.com")?>"><?php _e('Plugin Support', 'pmpro');?></a><a class="pmpro_tag-blue" href="http://www.paidmembershipspro.com/forums/"><?php _e('User Forum', 'pmpro');?></a></div>
128
129
<br style="clear:both;" />
130
</div>
adminpages/advancedsettings.php CHANGED
@@ -1,6 +1,6 @@
1
<?php
2
//only admins can get this
3
- if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_advancedsettings")))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
@@ -14,7 +14,6 @@
14
pmpro_setOption("nonmembertext");
15
pmpro_setOption("notloggedintext");
16
pmpro_setOption("rsstext");
17
- pmpro_setOption("filterqueries");
18
pmpro_setOption("showexcerpts");
19
pmpro_setOption("hideads");
20
pmpro_setOption("hideadslevels");
@@ -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()
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()
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)
@@ -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
@@ -443,7 +440,7 @@
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'";
@@ -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'";
@@ -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>
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)
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
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'";
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'";
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>
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/membershiplevels.php CHANGED
@@ -157,8 +157,6 @@
157
158
if($ml_id > 0)
159
{
160
- do_action("pmpro_delete_membership_level", $ml_id);
161
-
162
//remove any categories from the ml
163
$sqlQuery = "DELETE FROM $wpdb->pmpro_memberships_categories WHERE membership_id = '$ml_id'";
164
$r1 = $wpdb->query($sqlQuery);
@@ -446,7 +444,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'";
@@ -548,7 +546,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 +567,9 @@
569
<?php } ?>
570
</td>
571
<td><?php if($level->allow_signups) { ?><?php _e('Yes', 'pmpro');?><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
572
- <td align="center"><a href="admin.php?page=pmpro-membershiplevels&amp;edit=<?php echo $level->id?>" class="edit"><?php _e('edit', 'pmpro');?></a></td>
573
- <td align="center"><a href="admin.php?page=pmpro-membershiplevels&amp;copy=<?php echo $level->id?>&amp;edit=-1" class="edit"><?php _e('copy', 'pmpro');?></a></td>
574
- <td align="center"><a href="javascript: askfirst('<?php printf(__("Are you sure you want to delete membership level %s? All subscriptions will be cancelled.", "pmpro"), $level->name);?>','admin.php?page=pmpro-membershiplevels&amp;action=delete_membership_level&amp;deleteid=<?php echo $level->id?>'); void(0);" class="delete"><?php _e('delete', 'pmpro');?></a></td>
575
</tr>
576
<?php
577
}
157
158
if($ml_id > 0)
159
{
160
//remove any categories from the ml
161
$sqlQuery = "DELETE FROM $wpdb->pmpro_memberships_categories WHERE membership_id = '$ml_id'";
162
$r1 = $wpdb->query($sqlQuery);
444
<input id="expiration_number" name="expiration_number" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
445
<select id="expiration_period" name="expiration_period">
446
<?php
447
+ $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
448
foreach ( $cycles as $name => $value ) {
449
echo "<option value='$value'";
450
if ( $level->expiration_period == $value ) echo " selected='selected'";
546
<?php if(!pmpro_isLevelRecurring($level)) { ?>
547
--
548
<?php } else { ?>
549
+ <?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)?>
550
551
<?php if($level->billing_limit) { ?>(<?php _e('for', 'pmpro');?> <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
552
567
<?php } ?>
568
</td>
569
<td><?php if($level->allow_signups) { ?><?php _e('Yes', 'pmpro');?><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
570
+ <td align="center"><a href="admin.php?page=pmpro-membershiplevels&edit=<?php echo $level->id?>" class="edit"><?php _e('edit', 'pmpro');?></a></td>
571
+ <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>
572
+ <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>
573
</tr>
574
<?php
575
}
adminpages/memberslist-csv.php CHANGED
@@ -207,9 +207,9 @@
207
if($theuser->membership_id)
208
{
209
if($theuser->enddate)
210
- $csvoutput .= pmpro_enclose(apply_filters("pmpro_memberslist_expires_column", date("Y-m-d", $theuser->enddate), $theuser));
211
else
212
- $csvoutput .= pmpro_enclose(apply_filters("pmpro_memberslist_expires_column", "Never", $theuser));
213
}
214
elseif($l == "oldmembers" && $theuser->enddate)
215
{
207
if($theuser->membership_id)
208
{
209
if($theuser->enddate)
210
+ $csvoutput .= pmpro_enclose(date("Y-m-d", $theuser->enddate));
211
else
212
+ $csvoutput .= pmpro_enclose("Never");
213
}
214
elseif($l == "oldmembers" && $theuser->enddate)
215
{
adminpages/memberslist.php CHANGED
@@ -203,13 +203,13 @@
203
-
204
<?php } ?>
205
</td>
206
- <td><?php echo date(get_option("date_format"), strtotime($theuser->user_registered, current_time("timestamp")))?></td>
207
<td>
208
<?php
209
if($auser->enddate)
210
- echo apply_filters("pmpro_memberslist_expires_column", date(get_option('date_format'), $auser->enddate), $auser);
211
else
212
- echo __(apply_filters("pmpro_memberslist_expires_column", "Never", $auser), "pmpro");
213
?>
214
</td>
215
</tr>
203
-
204
<?php } ?>
205
</td>
206
+ <td><?php echo date(get_option("date_format"), strtotime($theuser->user_registered))?></td>
207
<td>
208
<?php
209
if($auser->enddate)
210
+ echo date(get_option('date_format'), $auser->enddate);
211
else
212
+ echo __("Never", "pmpro");
213
?>
214
</td>
215
</tr>
adminpages/orders-csv.php CHANGED
@@ -17,51 +17,6 @@
17
$l = $_REQUEST['l'];
18
else
19
$l = false;
20
-
21
- if(isset($_REQUEST['start-month']))
22
- $start_month = $_REQUEST['start-month'];
23
- else
24
- $start_month = "1";
25
-
26
- if(isset($_REQUEST['start-day']))
27
- $start_day = $_REQUEST['start-day'];
28
- else
29
- $start_day = "1";
30
-
31
- if(isset($_REQUEST['start-year']))
32
- $start_year = $_REQUEST['start-year'];
33
- else
34
- $start_year = date("Y");
35
-
36
- if(isset($_REQUEST['end-month']))
37
- $end_month = $_REQUEST['end-month'];
38
- else
39
- $end_month = date("n");
40
-
41
- if(isset($_REQUEST['end-day']))
42
- $end_day = $_REQUEST['end-day'];
43
- else
44
- $end_day = date("j");
45
-
46
- if(isset($_REQUEST['end-year']))
47
- $end_year = $_REQUEST['end-year'];
48
- else
49
- $end_year = date("Y");
50
-
51
- if(isset($_REQUEST['predefined-date']))
52
- $predefined_date = $_REQUEST['predefined-date'];
53
- else
54
- $predefined_date = "This Month";
55
-
56
- if(isset($_REQUEST['status']))
57
- $status = $_REQUEST['status'];
58
- else
59
- $status = "";
60
-
61
- if(isset($_REQUEST['filter']))
62
- $filter = sanitize_text_field($_REQUEST['filter']);
63
- else
64
- $filter = "all";
65
66
//some vars for the search
67
if(!empty($_REQUEST['pn']))
@@ -85,62 +40,6 @@
85
$start = NULL;
86
}
87
88
- //filters
89
- if($filter == "all" || !$filter)
90
- $condition = "1=1";
91
- elseif($filter == "within-a-date-range")
92
- {
93
- $start_date = $start_year."-".$start_month."-".$start_day;
94
- $end_date = $end_year."-".$end_month."-".$end_day;
95
-
96
- //add times to dates
97
- $start_date = $start_date . " 00:00:00";
98
- $end_date = $end_date . " 23:59:59";
99
-
100
- $condition = "timestamp BETWEEN '".$start_date."' AND '".$end_date."'";
101
- }
102
- elseif($filter == "predefined-date-range")
103
- {
104
- if($predefined_date == "Last Month")
105
- {
106
- $start_date = date("Y-m-d", strtotime("first day of last month", current_time("timestamp")));
107
- $end_date = date("Y-m-d", strtotime("last day of last month", current_time("timestamp")));
108
- }
109
- elseif($predefined_date == "This Month")
110
- {
111
- $start_date = date("Y-m-d", strtotime("first day of this month", current_time("timestamp")));
112
- $end_date = date("Y-m-d", strtotime("last day of this month", current_time("timestamp")));
113
- }
114
- elseif($predefined_date == "This Year")
115
- {
116
- $year = date('Y');
117
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
118
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
119
- }
120
-
121
- elseif($predefined_date == "Last Year")
122
- {
123
- $year = date('Y') - 1;
124
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
125
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
126
- }
127
-
128
- //add times to dates
129
- $start_date = $start_date . " 00:00:00";
130
- $end_date = $end_date . " 23:59:59";
131
-
132
- $condition = "timestamp BETWEEN '".$start_date."' AND '".$end_date."'";
133
- }
134
- elseif($filter == "within-a-level")
135
- {
136
- $condition = "membership_id = $l";
137
- }
138
- elseif($filter == "within-a-status")
139
- {
140
- $condition = "status = '$status' ";
141
- }
142
-
143
- //string search
144
if($s)
145
{
146
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS o.id FROM $wpdb->pmpro_membership_orders o LEFT JOIN $wpdb->users u ON o.user_id = u.ID LEFT JOIN $wpdb->pmpro_membership_levels l ON o.membership_id = l.id ";
@@ -150,40 +49,39 @@
150
$sqlQuery .= "LEFT JOIN $wpdb->usermeta um ON o.user_id = um.user_id ";
151
152
$sqlQuery .= "WHERE (1=2 ";
153
-
154
$fields = array("o.id", "o.code", "o.billing_name", "o.billing_street", "o.billing_city", "o.billing_state", "o.billing_zip", "o.billing_phone", "o.payment_type", "o.cardtype", "o.accountnumber", "o.status", "o.gateway", "o.gateway_environment", "o.payment_transaction_id", "o.subscription_transaction_id", "u.user_login", "u.user_email", "u.display_name", "l.name");
155
156
if($join_with_usermeta)
157
$fields[] = "um.meta_value";
158
-
159
$fields = apply_filters("pmpro_orders_search_fields", $fields);
160
161
foreach($fields as $field)
162
$sqlQuery .= " OR " . $field . " LIKE '%" . esc_sql($s) . "%' ";
163
$sqlQuery .= ") ";
164
-
165
- $sqlQuery .= "AND " . $condition . " ";
166
-
167
- $sqlQuery .= "GROUP BY o.id ORDER BY o.id DESC, o.timestamp DESC ";
168
}
169
else
170
{
171
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS id FROM $wpdb->pmpro_membership_orders WHERE ".$condition." ORDER BY id DESC, timestamp DESC ";
172
}
173
174
- if(!empty($start) && !empty($limit))
175
$sqlQuery .= "LIMIT $start, $limit";
176
177
$order_ids = $wpdb->get_col($sqlQuery);
178
-
179
//begin output
180
header("Content-type: text/csv");
181
-
182
- $filename = "orders.csv";
183
- /*
184
- Insert logic here for building filename from $filter and other values.
185
- */
186
- header("Content-Disposition: attachment; filename=$filename;");
187
188
$csvoutput = "id,user_id,user_login,first_name,last_name,user_email,billing_name,billing_street,billing_city,billing_state,billing_zip,billing_country,billing_phone,membership_id,level_name,subtotal,tax,couponamount,total,payment_type,cardtype,accountnumber,expirationmonth,expirationyear,status,gateway,gateway_environment,payment_transaction_id,subscription_transaction_id,discount_code_id,discount_code,timestamp";
189
17
$l = $_REQUEST['l'];
18
else
19
$l = false;
20
21
//some vars for the search
22
if(!empty($_REQUEST['pn']))
40
$start = NULL;
41
}
42
43
if($s)
44
{
45
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS o.id FROM $wpdb->pmpro_membership_orders o LEFT JOIN $wpdb->users u ON o.user_id = u.ID LEFT JOIN $wpdb->pmpro_membership_levels l ON o.membership_id = l.id ";
49
$sqlQuery .= "LEFT JOIN $wpdb->usermeta um ON o.user_id = um.user_id ";
50
51
$sqlQuery .= "WHERE (1=2 ";
52
+
53
$fields = array("o.id", "o.code", "o.billing_name", "o.billing_street", "o.billing_city", "o.billing_state", "o.billing_zip", "o.billing_phone", "o.payment_type", "o.cardtype", "o.accountnumber", "o.status", "o.gateway", "o.gateway_environment", "o.payment_transaction_id", "o.subscription_transaction_id", "u.user_login", "u.user_email", "u.display_name", "l.name");
54
55
if($join_with_usermeta)
56
$fields[] = "um.meta_value";
57
+
58
$fields = apply_filters("pmpro_orders_search_fields", $fields);
59
60
foreach($fields as $field)
61
$sqlQuery .= " OR " . $field . " LIKE '%" . esc_sql($s) . "%' ";
62
$sqlQuery .= ") ";
63
+ $sqlQuery .= "ORDER BY o.timestamp DESC ";
64
}
65
else
66
{
67
+ $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS id FROM $wpdb->pmpro_membership_orders ORDER BY timestamp DESC ";
68
}
69
70
+ if($limit)
71
$sqlQuery .= "LIMIT $start, $limit";
72
73
$order_ids = $wpdb->get_col($sqlQuery);
74
+
75
//begin output
76
header("Content-type: text/csv");
77
+ if($s && $l)
78
+ header("Content-Disposition: attachment; filename=orders" . intval($l) . "_level" . sanitize_file_name($s) . ".csv; size=$size_in_bytes");
79
+ elseif($s)
80
+ header("Content-Disposition: attachment; filename=orders_" . sanitize_file_name($s) . ".csv; size=$size_in_bytes");
81
+ elseif($l)
82
+ header("Content-Disposition: attachment; filename=orders_level" . intval($l) . ".csv; size=$size_in_bytes");
83
+ else
84
+ header("Content-Disposition: attachment; filename=orders.csv; size=$size_in_bytes");
85
86
$csvoutput = "id,user_id,user_login,first_name,last_name,user_email,billing_name,billing_street,billing_city,billing_state,billing_zip,billing_country,billing_phone,membership_id,level_name,subtotal,tax,couponamount,total,payment_type,cardtype,accountnumber,expirationmonth,expirationyear,status,gateway,gateway_environment,payment_transaction_id,subscription_transaction_id,discount_code_id,discount_code,timestamp";
87
adminpages/orders.php CHANGED
@@ -16,47 +16,6 @@
16
$l = $_REQUEST['l'];
17
else
18
$l = false;
19
-
20
- if(isset($_REQUEST['start-month']))
21
- $start_month = $_REQUEST['start-month'];
22
- else
23
- $start_month = "1";
24
-
25
- if(isset($_REQUEST['start-day']))
26
- $start_day = $_REQUEST['start-day'];
27
- else
28
- $start_day = "1";
29
-
30
- if(isset($_REQUEST['start-year']))
31
- $start_year = $_REQUEST['start-year'];
32
- else
33
- $start_year = date("Y");
34
-
35
- if(isset($_REQUEST['end-month']))
36
- $end_month = $_REQUEST['end-month'];
37
- else
38
- $end_month = date("n");
39
-
40
- if(isset($_REQUEST['end-day']))
41
- $end_day = $_REQUEST['end-day'];
42
- else
43
- $end_day = date("j");
44
-
45
- if(isset($_REQUEST['end-year']))
46
- $end_year = $_REQUEST['end-year'];
47
- else
48
- $end_year = date("Y");
49
-
50
- if(isset($_REQUEST['predefined-date']))
51
- $predefined_date = $_REQUEST['predefined-date'];
52
- else
53
- $predefined_date = "This Month";
54
-
55
- if(isset($_REQUEST['status']))
56
- $status = $_REQUEST['status'];
57
- else
58
- $status = "";
59
-
60
61
//deleting?
62
if(!empty($_REQUEST['delete']))
@@ -74,15 +33,6 @@
74
}
75
}
76
77
- if(isset($_REQUEST['filter']))
78
- $filter = sanitize_text_field($_REQUEST['filter']);
79
- else
80
- $filter = "all";
81
-
82
- $thisyear = date("Y");
83
-
84
-
85
-
86
//this array stores fields that should be read only
87
$read_only_fields = apply_filters("pmpro_orders_read_only_fields", array("code", "payment_transaction_id", "subscription_transaction_id"));
88
@@ -481,7 +431,7 @@
481
<tr>
482
<th scope="row" valign="top"><label for="subscription_transaction_id"><?php _e('Subscription Transaction ID', 'pmpro');?>:</label></th>
483
<td>
484
- <?php if(in_array("subscription_transaction_id", $read_only_fields) && $order_id > 0) { echo $order->subscription_transaction_id; } else { ?>
485
<input id="subscription_transaction_id" name="subscription_transaction_id" type="text" size="50" value="<?php echo esc_attr($order->subscription_transaction_id);?>" />
486
<?php } ?>
487
<small class="pmpro_lite"><?php _e('Generated by the gateway. Useful to cross reference subscriptions.', 'pmpro');?></small>
@@ -497,7 +447,7 @@
497
if(!empty($order->timestamp))
498
$timestamp = $order->timestamp;
499
else
500
- $timestamp = current_time('timestamp');
501
502
$year = date("Y", $timestamp);
503
$month = date("n", $timestamp);
@@ -508,7 +458,7 @@
508
for($i = 1; $i < 13; $i++)
509
{
510
?>
511
- <option value="<?php echo $i?>" <?php if($i == $month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $year, current_time("timestamp")))?></option>
512
<?php
513
}
514
?>
@@ -569,217 +519,24 @@
569
<h2>
570
<?php _e('Orders', 'pmpro');?>
571
<a href="admin.php?page=pmpro-orders&order=-1" class="add-new-h2">+ <?php _e('Add New Order', 'pmpro');?></a>
572
-
573
- <?php
574
- //build the export URL
575
- $export_url = admin_url('admin-ajax.php') . "?action=orders_csv";
576
- $url_params = array(
577
- "filter"=>$filter,
578
- "s"=>$s,
579
- "l"=>$l,
580
- "start-month"=>$start_month,
581
- "start-day"=>$start_day,
582
- "start-year"=>$start_year,
583
- "end-month"=>$end_month,
584
- "end-day"=>$end_day,
585
- "end-year"=>$end_year,
586
- "predefined-date"=>$predefined_date,
587
- "status"=>$status
588
- );
589
- $export_url = add_query_arg($url_params, $export_url);
590
- ?>
591
- <a target="_blank" href="<?php echo $export_url;?>" class="add-new-h2"><?php _e('Export to CSV', 'pmpro');?></a>
592
- </h2>
593
-
594
-
595
596
<?php if(!empty($pmpro_msg)) { ?>
597
<div id="message" class="<?php if($pmpro_msgt == "success") echo "updated fade"; else echo "error"; ?>"><p><?php echo $pmpro_msg?></p></div>
598
<?php } ?>
599
600
-
601
<ul class="subsubsub">
602
<li>
603
- <?php _ex('Show', 'Dropdown label, e.g. Show Daily Orders for January', 'pmpro')?>
604
- <select id="filter" name="filter">
605
- <option value="all" <?php selected($filter, "all");?>><?php _e('All', 'pmpro');?></option>
606
- <option value="within-a-date-range" <?php selected($filter, "within-a-date-range");?>><?php _e('Within a Date Range', 'pmpro');?></option>
607
- <option value="predefined-date-range" <?php selected($filter, "predefined-date-range");?>><?php _e('Predefined Date Range', 'pmpro');?></option>
608
- <option value="within-a-level" <?php selected($filter, "within-a-level");?>><?php _e('Within a Level', 'pmpro');?></option>
609
- <option value="within-a-status" <?php selected($filter, "within-a-status");?>><?php _e('Within a Status', 'pmpro');?></option>
610
- </select>
611
-
612
- <span id="from"><?php _ex('From', 'Dropdown label', 'pmpro')?></span>
613
-
614
- <select id="start-month" name="start-month">
615
- <?php for($i = 1; $i < 13; $i++) { ?>
616
- <option value="<?php echo $i;?>" <?php selected($start_month, $i);?>><?php echo date("F", mktime(0, 0, 0, $i));?></option>
617
- <?php } ?>
618
- </select>
619
-
620
- <input id='start-day' name="start-day" type="text" size="2" value="<?php echo $start_day?>" />
621
- <input id='start-year' name="start-year" type="text" size="4" value="<?php echo $start_year?>" />
622
-
623
-
624
- <span id="to"><?php _ex('To', 'Dropdown label', 'pmpro')?></span>
625
-
626
- <select id="end-month" name="end-month">
627
- <?php for($i = 1; $i < 13; $i++) { ?>
628
- <option value="<?php echo $i;?>" <?php selected($end_month, $i);?>><?php echo date("F", mktime(0, 0, 0, $i));?></option>
629
- <?php } ?>
630
- </select>
631
-
632
-
633
- <input id='end-day' name="end-day" type="text" size="2" value="<?php echo $end_day?>" />
634
- <input id='end-year' name="end-year" type="text" size="4" value="<?php echo $end_year?>" />
635
-
636
- <span id="filterby"><?php _ex('filter by ', 'Dropdown label', 'pmpro')?></span>
637
-
638
- <select id="predefined-date" name="predefined-date">
639
640
- <option value="<?php echo "This Month";?>" <?php selected($predefined_date, "This Month");?>><?php echo "This Month";?></option>
641
- <option value="<?php echo "Last Month";?>" <?php selected($predefined_date, "Last Month");?>><?php echo "Last Month";?></option>
642
- <option value="<?php echo "This Year";?>" <?php selected($predefined_date, "This Year");?>><?php echo "This Year";?></option>
643
- <option value="<?php echo "Last Year";?>" <?php selected($predefined_date, "Last Year");?>><?php echo "Last Year";?></option>
644
-
645
- </select>
646
-
647
- <?php
648
- //Note: only orders belonging to current levels can be filtered. There is no option for orders belonging to deleted levels
649
- $levels = pmpro_getAllLevels();
650
-
651
- ?>
652
- <select id="l" name="l">
653
- <?php foreach($levels as $level) { ?>
654
- <option value="<?php echo $level->id;?>" <?php selected($l, $level->id);?>><?php echo $level->name;?></option>
655
- <?php } ?>
656
-
657
- </select>
658
-
659
- <?php
660
- $statuses = array();
661
- $default_statuses = array("", "success", "cancelled", "review", "token", "refunded");
662
- $used_statuses = $wpdb->get_col("SELECT DISTINCT(status) FROM $wpdb->pmpro_membership_orders");
663
- $statuses = array_unique(array_merge($default_statuses, $used_statuses));
664
- asort($statuses);
665
- $statuses = apply_filters("pmpro_order_statuses", $statuses);
666
- ?>
667
- <select id="status" name="status">
668
- <?php foreach($statuses as $the_status) { ?>
669
- <option value="<?php echo esc_attr($the_status);?>" <?php selected($the_status, $status);?>><?php echo $the_status;?></option>
670
- <?php } ?>
671
- </select>
672
-
673
-
674
- <input id="submit" type="submit" value="<?php _ex('Filter', 'Submit button value.', 'pmpro');?>" />
675
</li>
676
</ul>
677
-
678
- <script>
679
- //update month/year when period dropdown is changed
680
- jQuery(document).ready(function() {
681
- jQuery('#filter').change(function() {
682
- pmpro_ShowMonthOrYear();
683
- });
684
- });
685
-
686
- function pmpro_ShowMonthOrYear()
687
- {
688
- var filter = jQuery('#filter').val();
689
- if(filter == 'all')
690
- {
691
- jQuery('#start-month').hide();
692
- jQuery('#start-day').hide();
693
- jQuery('#start-year').hide();
694
- jQuery('#end-month').hide();
695
- jQuery('#end-day').hide();
696
- jQuery('#end-year').hide();
697
- jQuery('#predefined-date').hide();
698
- jQuery('#status').hide();
699
- jQuery('#l').hide();
700
- jQuery('#from').hide();
701
- jQuery('#to').hide();
702
- jQuery('#submit').show();
703
- jQuery('#filterby').hide();
704
- }
705
- else if(filter == 'within-a-date-range')
706
- {
707
- jQuery('#start-month').show();
708
- jQuery('#start-day').show();
709
- jQuery('#start-year').show();
710
- jQuery('#end-month').show();
711
- jQuery('#end-day').show();
712
- jQuery('#end-year').show();
713
- jQuery('#predefined-date').hide();
714
- jQuery('#status').hide();
715
- jQuery('#l').hide();
716
- jQuery('#submit').show();
717
- jQuery('#from').show();
718
- jQuery('#to').show();
719
- jQuery('#filterby').hide();
720
- }
721
- else if(filter == 'predefined-date-range')
722
- {
723
- jQuery('#start-month').hide();
724
- jQuery('#start-day').hide();
725
- jQuery('#start-year').hide();
726
- jQuery('#end-month').hide();
727
- jQuery('#end-day').hide();
728
- jQuery('#end-year').hide();
729
- jQuery('#predefined-date').show();
730
- jQuery('#status').hide();
731
- jQuery('#l').hide();
732
- jQuery('#submit').show();
733
- jQuery('#from').hide();
734
- jQuery('#to').hide();
735
- jQuery('#filterby').show();
736
- }
737
- else if(filter == 'within-a-level')
738
- {
739
- jQuery('#start-month').hide();
740
- jQuery('#start-day').hide();
741
- jQuery('#start-year').hide();
742
- jQuery('#end-month').hide();
743
- jQuery('#end-day').hide();
744
- jQuery('#end-year').hide();
745
- jQuery('#predefined-date').hide();
746
- jQuery('#status').hide();
747
- jQuery('#l').show();
748
- jQuery('#submit').show();
749
- jQuery('#from').hide();
750
- jQuery('#to').hide();
751
- jQuery('#filterby').show();
752
- }
753
- else if(filter == 'within-a-status')
754
- {
755
- jQuery('#start-month').hide();
756
- jQuery('#start-day').hide();
757
- jQuery('#start-year').hide();
758
- jQuery('#end-month').hide();
759
- jQuery('#end-day').hide();
760
- jQuery('#end-year').hide();
761
- jQuery('#predefined-date').hide();
762
- jQuery('#status').show();
763
- jQuery('#l').hide();
764
- jQuery('#submit').show();
765
- jQuery('#from').hide();
766
- jQuery('#to').hide();
767
- jQuery('#filterby').show();
768
- }
769
- }
770
-
771
- pmpro_ShowMonthOrYear();
772
-
773
-
774
- </script>
775
-
776
<p class="search-box">
777
<label class="hidden" for="post-search-input"><?php _e('Search Orders', 'pmpro');?>:</label>
778
<input type="hidden" name="page" value="pmpro-orders" />
779
<input id="post-search-input" type="text" value="<?php echo $s?>" name="s"/>
780
<input class="button" type="submit" value="<?php _e('Search Orders', 'pmpro');?>"/>
781
</p>
782
-
783
<?php
784
//some vars for the search
785
if(isset($_REQUEST['pn']))
@@ -795,62 +552,6 @@
795
$end = $pn * $limit;
796
$start = $end - $limit;
797
798
- //filters
799
- if($filter == "all" || !$filter)
800
- $condition = "1=1";
801
- elseif($filter == "within-a-date-range")
802
- {
803
- $start_date = $start_year."-".$start_month."-".$start_day;
804
- $end_date = $end_year."-".$end_month."-".$end_day;
805
-
806
- //add times to dates
807
- $start_date = $start_date . " 00:00:00";
808
- $end_date = $end_date . " 23:59:59";
809
-
810
- $condition = "timestamp BETWEEN '".$start_date."' AND '".$end_date."'";
811
- }
812
- elseif($filter == "predefined-date-range")
813
- {
814
- if($predefined_date == "Last Month")
815
- {
816
- $start_date = date("Y-m-d", strtotime("first day of last month", current_time("timestamp")));
817
- $end_date = date("Y-m-d", strtotime("last day of last month", current_time("timestamp")));
818
- }
819
- elseif($predefined_date == "This Month")
820
- {
821
- $start_date = date("Y-m-d", strtotime("first day of this month", current_time("timestamp")));
822
- $end_date = date("Y-m-d", strtotime("last day of this month", current_time("timestamp")));
823
- }
824
- elseif($predefined_date == "This Year")
825
- {
826
- $year = date('Y');
827
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
828
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
829
- }
830
-
831
- elseif($predefined_date == "Last Year")
832
- {
833
- $year = date('Y') - 1;
834
- $start_date = date("Y-m-d", strtotime("first day of January $year", current_time("timestamp")));
835
- $end_date = date("Y-m-d", strtotime("last day of December $year", current_time("timestamp")));
836
- }
837
-
838
- //add times to dates
839
- $start_date = $start_date . " 00:00:00";
840
- $end_date = $end_date . " 23:59:59";
841
-
842
- $condition = "timestamp BETWEEN '".$start_date."' AND '".$end_date."'";
843
- }
844
- elseif($filter == "within-a-level")
845
- {
846
- $condition = "membership_id = $l";
847
- }
848
- elseif($filter == "within-a-status")
849
- {
850
- $condition = "status = '$status' ";
851
- }
852
-
853
- //string search
854
if($s)
855
{
856
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS o.id FROM $wpdb->pmpro_membership_orders o LEFT JOIN $wpdb->users u ON o.user_id = u.ID LEFT JOIN $wpdb->pmpro_membership_levels l ON o.membership_id = l.id ";
@@ -871,20 +572,16 @@
871
foreach($fields as $field)
872
$sqlQuery .= " OR " . $field . " LIKE '%" . esc_sql($s) . "%' ";
873
$sqlQuery .= ") ";
874
-
875
- $sqlQuery .= "AND " . $condition . " ";
876
-
877
$sqlQuery .= "GROUP BY o.id ORDER BY o.id DESC, o.timestamp DESC ";
878
}
879
else
880
{
881
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS id FROM $wpdb->pmpro_membership_orders WHERE ".$condition." ORDER BY id DESC, timestamp DESC ";
882
}
883
884
$sqlQuery .= "LIMIT $start, $limit";
885
886
$order_ids = $wpdb->get_col($sqlQuery);
887
-
888
$totalrows = $wpdb->get_var("SELECT FOUND_ROWS() as found_rows");
889
890
if($order_ids)
@@ -984,9 +681,7 @@
984
</form>
985
986
<?php
987
- //add normal args
988
- $pagination_url = add_query_arg($url_params, get_admin_url(NULL, "/admin.php?page=pmpro-orders"));
989
- echo pmpro_getPaginationString($pn, $totalrows, $limit, 1, $pagination_url, "&limit=$limit&pn=");
990
?>
991
992
<?php } ?>
16
$l = $_REQUEST['l'];
17
else
18
$l = false;
19
20
//deleting?
21
if(!empty($_REQUEST['delete']))
33
}
34
}
35
36
//this array stores fields that should be read only
37
$read_only_fields = apply_filters("pmpro_orders_read_only_fields", array("code", "payment_transaction_id", "subscription_transaction_id"));
38
431
<tr>
432
<th scope="row" valign="top"><label for="subscription_transaction_id"><?php _e('Subscription Transaction ID', 'pmpro');?>:</label></th>
433
<td>
434
+ <?php if(in_array("code", $read_only_fields) && $order_id > 0) { echo $order->subscription_transaction_id; } else { ?>
435
<input id="subscription_transaction_id" name="subscription_transaction_id" type="text" size="50" value="<?php echo esc_attr($order->subscription_transaction_id);?>" />
436
<?php } ?>
437
<small class="pmpro_lite"><?php _e('Generated by the gateway. Useful to cross reference subscriptions.', 'pmpro');?></small>
447
if(!empty($order->timestamp))
448
$timestamp = $order->timestamp;
449
else
450
+ $timestamp = time();
451
452
$year = date("Y", $timestamp);
453
$month = date("n", $timestamp);
458
for($i = 1; $i < 13; $i++)
459
{
460
?>
461
+ <option value="<?php echo $i?>" <?php if($i == $month) { ?>selected="selected"<?php } ?>><?php echo date("M", strtotime($i . "/1/" . $year))?></option>
462
<?php
463
}
464
?>
519
<h2>
520
<?php _e('Orders', 'pmpro');?>
521
<a href="admin.php?page=pmpro-orders&order=-1" class="add-new-h2">+ <?php _e('Add New Order', 'pmpro');?></a>
522
+ <a target="_blank" href="<?php echo admin_url('admin-ajax.php');?>?action=orders_csv&s=<?php echo $s?>&l=<?php echo $l?>" class="add-new-h2"><?php _e('Export to CSV', 'pmpro');?></a>
523
+ </h2>
524
525
<?php if(!empty($pmpro_msg)) { ?>
526
<div id="message" class="<?php if($pmpro_msgt == "success") echo "updated fade"; else echo "error"; ?>"><p><?php echo $pmpro_msg?></p></div>
527
<?php } ?>
528
529
<ul class="subsubsub">
530
<li>
531
532
</li>
533
</ul>
534
<p class="search-box">
535
<label class="hidden" for="post-search-input"><?php _e('Search Orders', 'pmpro');?>:</label>
536
<input type="hidden" name="page" value="pmpro-orders" />
537
<input id="post-search-input" type="text" value="<?php echo $s?>" name="s"/>
538
<input class="button" type="submit" value="<?php _e('Search Orders', 'pmpro');?>"/>
539
</p>
540
<?php
541
//some vars for the search
542
if(isset($