Paid Memberships Pro - Version 2.1.1

Version Description

  • BUG FIX: Fixed issue with SCA authentications via Stripe for subscriptions with a $0 initial payment. (Thanks, mjulian87 on Github.)
  • BUG FIX: Fixed issue where code was shown in the message box when applying a discount code.
  • BUG FIX: Fixed issue where pmpro_is_checkout() would always return true if no checkout page was set. This caused JavaScript issues on non-checkout pages.
  • BUG FIX: The SVN repo on WordPress.org was missing a file for about 10 minutes after version 2.1 was pushed. Users who upgraded during this time may be missing that file. Updating now will restore it.
Download this release

Release Info

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

Code changes from version 2.1 to 2.1.1

CHANGELOG.txt CHANGED
@@ -1,5 +1,11 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
3
  = 2.1 - 2019-09-13 =
4
  * FEATURE: Updated Stripe integration to support Stripe v3, Stripe Elements, and their Secure Customer Authorization process.
5
  * FEATURE: Updated how we store prices to support up to 8 decimals (e.g. for Bitcoin gateway implementations).
1
  == Changelog ==
2
 
3
+ = 2.1.1 - 2019-09-16 =
4
+ * BUG FIX: Fixed issue with SCA authentications via Stripe for subscriptions with a $0 initial payment. (Thanks, mjulian87 on Github.)
5
+ * BUG FIX: Fixed issue where code was shown in the message box when applying a discount code.
6
+ * BUG FIX: Fixed issue where pmpro_is_checkout() would always return true if no checkout page was set. This caused JavaScript issues on non-checkout pages.
7
+ * BUG FIX: The SVN repo on WordPress.org was missing a file for about 10 minutes after version 2.1 was pushed. Users who upgraded during this time may be missing that file. Updating now will restore it.
8
+
9
  = 2.1 - 2019-09-13 =
10
  * FEATURE: Updated Stripe integration to support Stripe v3, Stripe Elements, and their Secure Customer Authorization process.
11
  * FEATURE: Updated how we store prices to support up to 8 decimals (e.g. for Bitcoin gateway implementations).
CONTRIBUTING.md DELETED
@@ -1,49 +0,0 @@
1
- # Contribute to Paid Memberships Pro
2
-
3
- Paid Memberships Pro is the "community solution" for membership sites on WordPress, and so contributions of all kinds are appreciated.
4
-
5
- When contributing, please follow these guidelines to ensure things work as smoothly as possible.
6
-
7
- __Please Note:__ GitHub is for bug reports and contributions only. If you have a support or customization question, go to our [Member Support Page](http://www.paidmembershipspro.com/support/) instead.
8
-
9
- ## Getting Started
10
-
11
- * __Do not report potential security vulnerabilities here. Email them privately to [info@paidmembershipspro.com](mailto:info@paidmembershipspro.com) with the words "Security Vulnerability" in the subject.__
12
- * Submit a ticket for your issue, assuming one does not already exist.
13
- * Raise it on our [Issue Tracker](https://github.com/strangerstudios/paid-memberships-pro//issues)
14
- * Clearly describe the issue including steps to reproduce the bug.
15
- * Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.
16
-
17
- ## Making Changes
18
-
19
- * Fork the repository on GitHub
20
- * For bug fixes, checkout the DEV branch of the PMPro repository.
21
- * For new features and enhancements, checkout the branch for the version the feature is milestoned for.
22
- * Make sure to pull in any "upstream" changes first.
23
- * Use `git remote add upstream https://github.com/strangerstudios/paid-memberships-pro.git` to set the upstream repo
24
- * Use `git checkout dev` to get on the development branch.
25
- * Use `git pull upstream dev` to get the latest updates.
26
- * Use `git push` to push those updates to your fork.
27
- * Create a new local branch for each separate bug fix or feature. This will ensure that each pull request is for one issue only and easier to process.
28
- * Use `git checkout -b nameofmybugfixorfeature` to create the new branch
29
- * Make the changes to your local repository.
30
- * Ensure you stick to the [WordPress Coding Standards](https://codex.wordpress.org/WordPress_Coding_Standards) (even though much of the PMPro code does not currently)
31
- * If you have an automatic beautifier in your IDE or dev environment, turn it off. Unrelated style changes in your pull requests will make them harder to process. Feel free to message the core development team to ask them to clean up a file you are working on if the inconsitent coding styles is bothering you.
32
- * You can update the readme.txt to include a comment about your fix or feature in the changelog, but if you do not the core team will do it for you.
33
- * When committing, reference your issue (if present) and include a note about the fix in the commit message.
34
- * Push the changes to your fork.
35
- * For bug fixes, submit a pull request to the DEV branch of the PMPro repository.
36
- * For new features and enhancements, submit a pull request to the version the feature is milestoned for. This will usually be the version number following the current release unless the core dev team has milestoned the feature for a later release.
37
- * We will process all pull requests and make suggestions or changes as soon as possible. Feel free to ping us politely via email or social networks to take a look at your pulls.
38
-
39
- ## Code Documentation
40
-
41
- * We would like for every function, filter, class, and class method to be documented using phpDoc standards.
42
- * An example of [how PMPro uses phpDoc blocks can be found here](https://gist.github.com/sunnyratilal/5308969).
43
- * Please make sure that every function is documented so that when we update our API Documentation things don't go awry!
44
- * If you're adding/editing a function in a class, make sure to add `@access {private|public|protected}`
45
- * Finally, please use tabs and not spaces. The tab indent size should be 4 for all Paid Memberships Pro code.
46
-
47
- # Additional Resources
48
- * [General GitHub Documentation](https://help.github.com/)
49
- * [GitHub Pull Request documentation](https://help.github.com/send-pull-requests/)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
adminpages/discountcodes.php CHANGED
@@ -755,7 +755,9 @@
755
  <tbody>
756
  <?php
757
  $count = 0;
758
- foreach($codes as $code) { ?>
 
 
759
  <tr<?php if($count++ % 2 == 1) { ?> class="alternate"<?php } ?>>
760
  <td><?php echo $code->id?></td>
761
  <td class="has-row-actions">
@@ -785,7 +787,6 @@
785
  </td>
786
  <td>
787
  <?php
788
- $uses = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->pmpro_discount_codes_uses WHERE code_id = %d", $code->id ) );
789
  if($code->uses > 0)
790
  echo "<strong>" . (int)$uses . "</strong>/" . $code->uses;
791
  else
755
  <tbody>
756
  <?php
757
  $count = 0;
758
+ foreach($codes as $code) {
759
+ $uses = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->pmpro_discount_codes_uses WHERE code_id = %d", $code->id ) );
760
+ ?>
761
  <tr<?php if($count++ % 2 == 1) { ?> class="alternate"<?php } ?>>
762
  <td><?php echo $code->id?></td>
763
  <td class="has-row-actions">
787
  </td>
788
  <td>
789
  <?php
 
790
  if($code->uses > 0)
791
  echo "<strong>" . (int)$uses . "</strong>/" . $code->uses;
792
  else
includes/functions.php CHANGED
@@ -2927,7 +2927,7 @@ function pmpro_is_checkout() {
2927
  global $pmpro_pages;
2928
 
2929
  // Try is_page first.
2930
- if ( isset( $pmpro_pages['checkout'] ) ) {
2931
  $is_checkout = is_page( $pmpro_pages['checkout'] );
2932
  } else {
2933
  $is_checkout = false;
2927
  global $pmpro_pages;
2928
 
2929
  // Try is_page first.
2930
+ if ( ! empty( $pmpro_pages['checkout'] ) ) {
2931
  $is_checkout = is_page( $pmpro_pages['checkout'] );
2932
  } else {
2933
  $is_checkout = false;
includes/lib/Stripe/data/test.png DELETED
Binary file
includes/lib/Stripe/lib/AttachedObject.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
-
3
- namespace Stripe;
4
-
5
- use Countable;
6
-
7
- /**
8
- * Class AttachedObject
9
- *
10
- * e.g. metadata on Stripe objects.
11
- *
12
- * @package Stripe
13
- */
14
- class AttachedObject extends StripeObject implements Countable
15
- {
16
- /**
17
- * Updates this object.
18
- *
19
- * @param array $properties A mapping of properties to update on this object.
20
- */
21
- public function replaceWith($properties)
22
- {
23
- $removed = array_diff(array_keys($this->_values), array_keys($properties));
24
- // Don't unset, but rather set to null so we send up '' for deletion.
25
- foreach ($removed as $k) {
26
- $this->$k = null;
27
- }
28
-
29
- foreach ($properties as $k => $v) {
30
- $this->$k = $v;
31
- }
32
- }
33
-
34
- /**
35
- * Counts the number of elements in the AttachedObject instance.
36
- *
37
- * @return int the number of elements
38
- */
39
- public function count()
40
- {
41
- return count($this->_values);
42
- }
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/Stripe/lib/ExternalAccount.php DELETED
@@ -1,89 +0,0 @@
1
- <?php
2
-
3
- namespace Stripe;
4
-
5
- /**
6
- * Class ExternalAccount
7
- *
8
- * @package Stripe
9
- */
10
- abstract class ExternalAccount extends ApiResource
11
- {
12
- /**
13
- * @return string The instance URL for this resource. It needs to be special
14
- * cased because it doesn't fit into the standard resource pattern.
15
- */
16
- public function instanceUrl()
17
- {
18
- $id = $this['id'];
19
- if (!$id) {
20
- $class = get_class($this);
21
- $msg = "Could not determine which URL to request: $class instance "
22
- . "has invalid ID: $id";
23
- throw new Error\InvalidRequest($msg, null);
24
- }
25
-
26
- if ($this['customer']) {
27
- $parent = $this['customer'];
28
- $base = Customer::classUrl();
29
- $path = 'sources';
30
- } elseif ($this['account']) {
31
- $parent = $this['account'];
32
- $base = Account::classUrl();
33
- $path = 'external_accounts';
34
- } elseif ($this['recipient']) {
35
- $parent = $this['recipient'];
36
- $base = Recipient::classUrl();
37
- $path = 'cards';
38
- } else {
39
- return null;
40
- }
41
-
42
- $parent = Util\Util::utf8($parent);
43
- $id = Util\Util::utf8($id);
44
-
45
- $parentExtn = urlencode($parent);
46
- $extn = urlencode($id);
47
- return "$base/$parentExtn/$path/$extn";
48
- }
49
-
50
- /**
51
- * @param array|null $params
52
- * @param array|string|null $opts
53
- *
54
- * @return ExternalAccount The deleted external account.
55
- */
56
- public function delete($params = null, $opts = null)
57
- {
58
- return $this->_delete($params, $opts);
59
- }
60
-
61
- /**
62
- * @param array|string|null $opts
63
- *
64
- * @return ExternalAccount The saved external account.
65
- */
66
- public function save($opts = null)
67
- {
68
- return $this->_save($opts);
69
- }
70
-
71
- /**
72
- * @param array|null $params
73
- * @param array|string|null $opts
74
- *
75
- * @return ExternalAccount The verified (or not) external account.
76
- */
77
- public function verify($params = null, $opts = null)
78
- {
79
- if ($this['customer']) {
80
- $url = $this->instanceUrl() . '/verify';
81
- list($response, $options) = $this->_request('post', $url, $params, $opts);
82
- $this->refreshFrom($response, $options);
83
- return $this;
84
- } else {
85
- $message = 'Only customer external accounts can be verified in this manner.';
86
- throw new Error\Api($message);
87
- }
88
- }
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/Stripe/lib/JsonSerializable.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
-
3
- namespace Stripe;
4
-
5
- // JsonSerializable only exists in PHP 5.4+. Stub if out if it doesn't exist
6
- if (interface_exists('\JsonSerializable', false)) {
7
- interface JsonSerializable extends \JsonSerializable
8
- {
9
- }
10
- } else {
11
- // PSR2 wants each interface to have its own file.
12
- // @codingStandardsIgnoreStart
13
- interface JsonSerializable
14
- {
15
- // @codingStandardsIgnoreEnd
16
- public function jsonSerialize();
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/paid-memberships-pro.js DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * Show a system prompt before redirecting to a URL.
3
- * Used for delete links/etc.
4
- * @param text The prompt, i.e. are you sure?
5
- * @param url The url to redirect to.
6
- */
7
- function askfirst( text, url ) {
8
- var answer = window.confirm( text );
9
-
10
- if ( answer ) {
11
- window.location = url;
12
- }
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
js/pmpro-checkout.js CHANGED
@@ -192,7 +192,7 @@ jQuery(document).ready(function(){
192
  });
193
 
194
  function pmpro_copyMessageToBottom() {
195
- jQuery('#pmpro_message_bottom').text(jQuery('#pmpro_message').text());
196
  jQuery('#pmpro_message_bottom').attr('class', jQuery('#pmpro_message').attr('class'));
197
  if(jQuery('#pmpro_message').is(":visible")) {
198
  jQuery('#pmpro_message_bottom').show();
192
  });
193
 
194
  function pmpro_copyMessageToBottom() {
195
+ jQuery('#pmpro_message_bottom').html(jQuery('#pmpro_message').html());
196
  jQuery('#pmpro_message_bottom').attr('class', jQuery('#pmpro_message').attr('class'));
197
  if(jQuery('#pmpro_message').is(":visible")) {
198
  jQuery('#pmpro_message_bottom').show();
js/pmpro-stripe.js CHANGED
@@ -17,7 +17,7 @@ jQuery( document ).ready( function( $ ) {
17
  cardExpiry.mount('#Expiry');
18
  cardCvc.mount('#CVV');
19
 
20
- // Handle authentication if required.
21
  if ( 'undefined' !== typeof( pmproStripe.paymentIntent ) ) {
22
  if ( 'requires_action' === pmproStripe.paymentIntent.status ) {
23
  // On submit disable its submit button
@@ -28,6 +28,18 @@ jQuery( document ).ready( function( $ ) {
28
  .then( stripeResponseHandler );
29
  }
30
  }
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  $( '.pmpro_form' ).submit( function( event ) {
33
  var name, address;
17
  cardExpiry.mount('#Expiry');
18
  cardCvc.mount('#CVV');
19
 
20
+ // Handle authentication for charge if required.
21
  if ( 'undefined' !== typeof( pmproStripe.paymentIntent ) ) {
22
  if ( 'requires_action' === pmproStripe.paymentIntent.status ) {
23
  // On submit disable its submit button
28
  .then( stripeResponseHandler );
29
  }
30
  }
31
+
32
+ // Handle authentication for subscription if required.
33
+ if ( 'undefined' !== typeof( pmproStripe.setupIntent ) ) {
34
+ if ( 'requires_action' === pmproStripe.setupIntent.status ) {
35
+ // On submit disable its submit button
36
+ $('input[type=submit]', this).attr('disabled', 'disabled');
37
+ $('input[type=image]', this).attr('disabled', 'disabled');
38
+ $('#pmpro_processing_message').css('visibility', 'visible');
39
+ stripe.handleCardSetup( pmproStripe.setupIntent.client_secret )
40
+ .then( stripeResponseHandler );
41
+ }
42
+ }
43
 
44
  $( '.pmpro_form' ).submit( function( event ) {
45
  var name, address;
paid-memberships-pro.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Paid Memberships Pro
4
  * Plugin URI: https://www.paidmembershipspro.com
5
  * Description: The most complete member management and membership subscriptions plugin for WordPress.
6
- * Version: 2.1
7
  * Author: Stranger Studios
8
  * Author URI: https://www.strangerstudios.com
9
  * Text Domain: paid-memberships-pro
@@ -16,7 +16,7 @@
16
  */
17
 
18
  // version constant
19
- define( 'PMPRO_VERSION', '2.1' );
20
  define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
21
  define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
22
 
3
  * Plugin Name: Paid Memberships Pro
4
  * Plugin URI: https://www.paidmembershipspro.com
5
  * Description: The most complete member management and membership subscriptions plugin for WordPress.
6
+ * Version: 2.1.1
7
  * Author: Stranger Studios
8
  * Author URI: https://www.strangerstudios.com
9
  * Text Domain: paid-memberships-pro
16
  */
17
 
18
  // version constant
19
+ define( 'PMPRO_VERSION', '2.1.1' );
20
  define( 'PMPRO_USER_AGENT', 'Paid Memberships Pro v' . PMPRO_VERSION . '; ' . site_url() );
21
  define( 'PMPRO_MIN_PHP_VERSION', '5.6' );
22
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: strangerstudios
3
  Tags: membership, memberships, member, members, ecommerce, e-commerce, paypal, stripe, braintree, authorize.net, payflow, restrict access, restrict content, directory
4
  Requires at least: 4
5
  Tested up to: 5.2.3
6
- Stable tag: 2.1
7
 
8
  Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
9
 
@@ -129,6 +129,12 @@ Not sure? You can find out by doing a bit a research.
129
 
130
  == Changelog ==
131
 
 
 
 
 
 
 
132
  = 2.1 - 2019-09-13 =
133
  * FEATURE: Updated Stripe integration to support Stripe v3, Stripe Elements, and their Secure Customer Authorization process.
134
  * FEATURE: Updated how we store prices to support up to 8 decimals (e.g. for Bitcoin gateway implementations).
3
  Tags: membership, memberships, member, members, ecommerce, e-commerce, paypal, stripe, braintree, authorize.net, payflow, restrict access, restrict content, directory
4
  Requires at least: 4
5
  Tested up to: 5.2.3
6
+ Stable tag: 2.1.2
7
 
8
  Get Paid with Paid Memberships Pro: The most complete member management and membership subscriptions plugin for your WordPress site.
9
 
129
 
130
  == Changelog ==
131
 
132
+ = 2.1.1 =
133
+ * BUG FIX: Fixed issue with SCA authentications via Stripe for subscriptions with a $0 initial payment. (Thanks, mjulian87 on Github.)
134
+ * BUG FIX: Fixed issue where code was shown in the message box when applying a discount code.
135
+ * BUG FIX: Fixed issue where pmpro_is_checkout() would always return true if no checkout page was set. This caused JavaScript issues on non-checkout pages.
136
+ * BUG FIX: The SVN repo on WordPress.org was missing a file for about 10 minutes after version 2.1 was pushed. Users who upgraded during this time may be missing that file. Updating now will restore it.
137
+
138
  = 2.1 - 2019-09-13 =
139
  * FEATURE: Updated Stripe integration to support Stripe v3, Stripe Elements, and their Secure Customer Authorization process.
140
  * FEATURE: Updated how we store prices to support up to 8 decimals (e.g. for Bitcoin gateway implementations).