Skip to content

Commit 65390ff

Browse files
authored
Merge pull request #1395 from laterpay/develop
Tag 2.9.4
2 parents 134db3f + 29efdcb commit 65390ff

14 files changed

Lines changed: 38 additions & 21 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "laterpay/laterpay-wordpress-plugin",
33
"description": "This is the official LaterPay plugin for selling digital content with WordPress",
44
"license": "MIT",
5-
"version": "2.9.3",
5+
"version": "2.9.4",
66
"config": {
77
"vendor-dir": "laterpay/vendor",
88
"secure-http": true

composer.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var gulp = require('gulp'),
3939
// OPTIONS -------------------------------------------------------------------------------------------------------------
4040
var gulpKnownOptions = {
4141
string: 'version',
42-
default: { version: '2.9.3' }
42+
default: { version: '2.9.4' }
4343
};
4444
var gulpOptions = minimist(process.argv.slice(2), gulpKnownOptions);
4545
gulpOptions.svn = {};

laterpay/README.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Contributors: laterpay, dominik-rodler, mihail-turalenka, avahura, ahryb
44
Donate link: https://laterpay.net
55
Tags: contribution, conversion, earn-money, micropayment, monetization, monetize-content, paid-content, payment, paywall, sell-article, sell-content, subscription
66
Requires at least: 4.6
7-
Tested up to: 5.3.2
7+
Tested up to: 5.4
88
Requires PHP: 5.6
9-
Stable tag: 2.9.3
9+
Stable tag: 2.9.4
1010
Author URI: https://laterpay.net
1111
Plugin URI: https://github.com/laterpay/laterpay-wordpress-plugin
1212
License: MIT
@@ -90,6 +90,10 @@ Yes!
9090
7. The plugin provides a variety of advanced settings to customize the LaterPay plugin and adjust it to your needs.
9191

9292
== Changelog ==
93+
= 2.9.4 ( April 16, 2020 ) =
94+
* Disable additional requests on home page if disabled by merchant.
95+
* Validate account status before `/access` check to avoid unnecessary request.
96+
9397
= 2.9.3 ( March 19, 2020 ) =
9498
* Lower Pay Now limit from 1.49€ to 1.00€ for EU region.
9599
* Reduce unnecessary API request to `validatesignature` endpoint.
@@ -706,8 +710,8 @@ KNOWN BUGS:
706710

707711
== Upgrade notice ==
708712

709-
= 2.9.3 =
710-
Reduces unnecessary API call to `validatesignature` endpoint.
713+
= 2.9.4 =
714+
Reduces unnecessary API calls to `/validatesignature` and `/access` endpoint.
711715

712716
== Arbitrary section ==
713717

laterpay/application/Helper/Request.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class LaterPay_Helper_Request {
2222
*/
2323
public static function isLpApiAvailability()
2424
{
25+
// Check if access check is disabled and current page is home page.
26+
if ( LaterPay_Helper_Pricing::is_access_check_disabled_on_home() ) {
27+
return false;
28+
}
29+
2530
if ( null === self::$lp_api_availability ) {
2631
$client_options = LaterPay_Helper_Config::get_php_client_options();
2732
$action = (int) get_option( 'laterpay_api_fallback_behavior', 0 );
@@ -142,6 +147,11 @@ public static function laterpay_api_get_access( $article_ids, $product_key = nul
142147
$result = array();
143148
$action = (int) get_option( 'laterpay_api_fallback_behavior', 0 );
144149

150+
// Check if access check is disabled and current page is home page.
151+
if ( LaterPay_Helper_Pricing::is_access_check_disabled_on_home() ) {
152+
return $result;
153+
}
154+
145155
try {
146156
$client_options = LaterPay_Helper_Config::get_php_client_options();
147157
$client = new LaterPay_Client(
@@ -152,8 +162,6 @@ public static function laterpay_api_get_access( $article_ids, $product_key = nul
152162
$client_options['token_name']
153163
);
154164

155-
$result = $client->get_access($article_ids, $product_key);
156-
157165
// Check if current config is valid or not.
158166
$health_check = json_decode( $client->check_health( true ), true );
159167

@@ -170,8 +178,13 @@ public static function laterpay_api_get_access( $article_ids, $product_key = nul
170178
return false;
171179
}
172180

181+
$result = $client->get_access($article_ids, $product_key);
182+
173183
// Possible value of status is ok or error in case of wrong params which means api is working.
174-
if ( ( is_array( $result ) && array_key_exists( 'status', $result ) ) || ( empty( $result ) && array_key_exists( 'status', $health_check ) ) ) {
184+
if (
185+
( is_array( $result ) && array_key_exists( 'status', $result ) ) ||
186+
( empty( $result ) && ( ! empty( $health_check ) && array_key_exists( 'status', $health_check ) ) )
187+
) {
175188
self::$lp_api_availability = true;
176189
} else {
177190
throw new Exception( 'Unable to reach LaterPay API' );
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

laterpay/languages/laterpay-de_DE.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: LaterPay 0.9.6\n"
44
"Report-Msgid-Bugs-To: http://wordpress.org/tag/laterpay\n"
5-
"POT-Creation-Date: 2020-03-18 22:13+0530\n"
6-
"PO-Revision-Date: 2020-03-18 22:13+0530\n"
5+
"POT-Creation-Date: 2020-04-15 19:42+0530\n"
6+
"PO-Revision-Date: 2020-04-15 19:42+0530\n"
77
"Last-Translator: Kimberly Moore <kmoore@laterpay.net>\n"
88
"Language-Team: German\n"
99
"Language: de_DE\n"
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)