Skip to content

Commit

Permalink
Merge pull request #1395 from laterpay/develop
Browse files Browse the repository at this point in the history
Tag 2.9.4
  • Loading branch information
thrijith authored Apr 16, 2020
2 parents 134db3f + 29efdcb commit 65390ff
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 21 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "laterpay/laterpay-wordpress-plugin",
"description": "This is the official LaterPay plugin for selling digital content with WordPress",
"license": "MIT",
"version": "2.9.3",
"version": "2.9.4",
"config": {
"vendor-dir": "laterpay/vendor",
"secure-http": true
Expand Down
5 changes: 3 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var gulp = require('gulp'),
// OPTIONS -------------------------------------------------------------------------------------------------------------
var gulpKnownOptions = {
string: 'version',
default: { version: '2.9.3' }
default: { version: '2.9.4' }
};
var gulpOptions = minimist(process.argv.slice(2), gulpKnownOptions);
gulpOptions.svn = {};
Expand Down
12 changes: 8 additions & 4 deletions laterpay/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Contributors: laterpay, dominik-rodler, mihail-turalenka, avahura, ahryb
Donate link: https://laterpay.net
Tags: contribution, conversion, earn-money, micropayment, monetization, monetize-content, paid-content, payment, paywall, sell-article, sell-content, subscription
Requires at least: 4.6
Tested up to: 5.3.2
Tested up to: 5.4
Requires PHP: 5.6
Stable tag: 2.9.3
Stable tag: 2.9.4
Author URI: https://laterpay.net
Plugin URI: https://github.com/laterpay/laterpay-wordpress-plugin
License: MIT
Expand Down Expand Up @@ -90,6 +90,10 @@ Yes!
7. The plugin provides a variety of advanced settings to customize the LaterPay plugin and adjust it to your needs.

== Changelog ==
= 2.9.4 ( April 16, 2020 ) =
* Disable additional requests on home page if disabled by merchant.
* Validate account status before `/access` check to avoid unnecessary request.

= 2.9.3 ( March 19, 2020 ) =
* Lower Pay Now limit from 1.49€ to 1.00€ for EU region.
* Reduce unnecessary API request to `validatesignature` endpoint.
Expand Down Expand Up @@ -706,8 +710,8 @@ KNOWN BUGS:

== Upgrade notice ==

= 2.9.3 =
Reduces unnecessary API call to `validatesignature` endpoint.
= 2.9.4 =
Reduces unnecessary API calls to `/validatesignature` and `/access` endpoint.

== Arbitrary section ==

Expand Down
19 changes: 16 additions & 3 deletions laterpay/application/Helper/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class LaterPay_Helper_Request {
*/
public static function isLpApiAvailability()
{
// Check if access check is disabled and current page is home page.
if ( LaterPay_Helper_Pricing::is_access_check_disabled_on_home() ) {
return false;
}

if ( null === self::$lp_api_availability ) {
$client_options = LaterPay_Helper_Config::get_php_client_options();
$action = (int) get_option( 'laterpay_api_fallback_behavior', 0 );
Expand Down Expand Up @@ -142,6 +147,11 @@ public static function laterpay_api_get_access( $article_ids, $product_key = nul
$result = array();
$action = (int) get_option( 'laterpay_api_fallback_behavior', 0 );

// Check if access check is disabled and current page is home page.
if ( LaterPay_Helper_Pricing::is_access_check_disabled_on_home() ) {
return $result;
}

try {
$client_options = LaterPay_Helper_Config::get_php_client_options();
$client = new LaterPay_Client(
Expand All @@ -152,8 +162,6 @@ public static function laterpay_api_get_access( $article_ids, $product_key = nul
$client_options['token_name']
);

$result = $client->get_access($article_ids, $product_key);

// Check if current config is valid or not.
$health_check = json_decode( $client->check_health( true ), true );

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

$result = $client->get_access($article_ids, $product_key);

// Possible value of status is ok or error in case of wrong params which means api is working.
if ( ( is_array( $result ) && array_key_exists( 'status', $result ) ) || ( empty( $result ) && array_key_exists( 'status', $health_check ) ) ) {
if (
( is_array( $result ) && array_key_exists( 'status', $result ) ) ||
( empty( $result ) && ( ! empty( $health_check ) && array_key_exists( 'status', $health_check ) ) )
) {
self::$lp_api_availability = true;
} else {
throw new Exception( 'Unable to reach LaterPay API' );
Expand Down
Binary file modified laterpay/languages/laterpay-de_CH.mo
Binary file not shown.
Binary file modified laterpay/languages/laterpay-de_CH_informal.mo
Binary file not shown.
Binary file modified laterpay/languages/laterpay-de_DE.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions laterpay/languages/laterpay-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: LaterPay 0.9.6\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/laterpay\n"
"POT-Creation-Date: 2020-03-18 22:13+0530\n"
"PO-Revision-Date: 2020-03-18 22:13+0530\n"
"POT-Creation-Date: 2020-04-15 19:42+0530\n"
"PO-Revision-Date: 2020-04-15 19:42+0530\n"
"Last-Translator: Kimberly Moore <[email protected]>\n"
"Language-Team: German\n"
"Language: de_DE\n"
Expand Down
Binary file modified laterpay/languages/laterpay-de_DE_formal.mo
Binary file not shown.
3 changes: 1 addition & 2 deletions laterpay/languages/laterpay.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
# This file is distributed under the same license as the LaterPay plugin.
msgid ""
msgstr ""
"Project-Id-Version: LaterPay 2.9.3\n"
"Project-Id-Version: LaterPay 2.9.4\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/laterpay\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: Kimberly Moore <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
2 changes: 1 addition & 1 deletion laterpay/laterpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/laterpay/laterpay-wordpress-plugin
* Description: Sell digital content with LaterPay. It allows super easy and fast payments from as little as 5 cent up to 149.99 Euro at a 15% fee and no fixed costs.
* Author: LaterPay
* Version: 2.9.3
* Version: 2.9.4
* Author URI: https://laterpay.net/
* Textdomain: laterpay
* Domain Path: /languages
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "laterpay-wordpress-plugin",
"version": "2.9.3",
"version": "2.9.4",
"description": "LaterPay WordPress plugin",
"main": "index.js",
"dependencies": {},
Expand Down Expand Up @@ -41,7 +41,7 @@
"gulp-zip": "^4.1.0",
"jshint-stylish": "^1.0.0",
"lodash": ">=4.17.11",
"minimist": "^1.2.2",
"minimist": "^1.2.3",
"prompt": "^0.2.14",
"q": "^1.4.1",
"run-sequence": "^1.1.2"
Expand Down

0 comments on commit 65390ff

Please sign in to comment.