Skip to content

Commit

Permalink
Merge pull request #1090 from laterpay/develop
Browse files Browse the repository at this point in the history
Tag 2.4.1
  • Loading branch information
thrijith authored Jan 11, 2019
2 parents d1a53dd + 934e7a3 commit f31280d
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 48 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.4.0",
"version": "2.4.1",
"config": {
"vendor-dir": "laterpay/vendor",
"secure-http": true
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var gulp = require('gulp'),
// OPTIONS -------------------------------------------------------------------------------------------------------------
var gulpKnownOptions = {
string: 'version',
default: { version: '2.4.0' }
default: { version: '2.4.1' }
};
var gulpOptions = minimist(process.argv.slice(2), gulpKnownOptions);
gulpOptions.svn = {};
Expand Down
8 changes: 6 additions & 2 deletions laterpay/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Donate link: https://laterpay.net
Tags: laterpay, accept micropayments, accept payments, access control, billing, buy now pay later, content monetization, creditcard, debitcard, free to read, laterpay for wordpress, laterpay payment, laterpay plugin, micropayments, monetize, paid content, pay button, pay per use, payments, paywall, PPU, sell digital content, sell digital goods, single sale, wordpress laterpay, Payments, Content Monetization, Paywall, Paid Content, Publisher, Blogger
Requires at least: 4.6
Tested up to: 5.0.2
Stable tag: 2.4.0
Stable tag: 2.4.1
Author URI: https://laterpay.net
Plugin URI: https://github.com/laterpay/laterpay-wordpress-plugin
License: MIT
Expand Down Expand Up @@ -185,6 +185,10 @@ Please see the "Test and Live Mode" section.
6. The plugin provides a variety of advanced settings to customize the LaterPay plugin and adjust it to your needs.

== Changelog ==
= 2.4.1 ( January 11, 2019 ) =
* Fix issue with multiple categories in exclude feature for TimePass and Subscription.
* Fix issue with missing categories data in Post Publish GA event.

= 2.4.0 ( January 10, 2019 ) =
* Add support for multiple categories to be included or excluded.
* Add GA events to capture Merchant Usage Data.
Expand Down Expand Up @@ -687,7 +691,7 @@ KNOWN BUGS:

== Upgrade notice ==

= 2.4.0 ( January 10, 2019 ) =
= 2.4.1 ( January 11, 2019 ) =
Updated plugin initialization hook, Added support for multiple categories, Added GA events to capture Merchant usage data, Fixed Duplicate query issues and minor updates with LaterPay functionality.

== Arbitrary section ==
Expand Down
2 changes: 1 addition & 1 deletion laterpay/application/Controller/Admin/Appearance.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function load_assets() {
),
'l10n_print_after' => 'lpVars.overlaySettings = JSON.parse(lpVars.overlaySettings)',
'gaData' => array(
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? esc_js( $merchant_key ) : '',
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? $merchant_key : '',
),
)
);
Expand Down
2 changes: 1 addition & 1 deletion laterpay/application/Controller/Admin/Post/Metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function load_scripts() {
'l10n_print_after' => 'jQuery.extend(lpVars, laterpay_post_edit)',
'postPriceBehaviour' => LaterPay_Helper_Pricing::get_post_price_behaviour(),
'gaData' => array(
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? esc_js( $merchant_key ) : '',
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? $merchant_key : '',
),
)
);
Expand Down
4 changes: 2 additions & 2 deletions laterpay/application/Controller/Admin/Pricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function load_assets() {
lpVars.sub_vouchers_list = JSON.parse(lpVars.sub_vouchers_list);
lpVars.vouchers_statistic = JSON.parse(lpVars.vouchers_statistic);',
'gaData' => array(
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? esc_js( $merchant_key ) : '',
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? $merchant_key : '',
),
)
);
Expand Down Expand Up @@ -1016,7 +1016,7 @@ protected function update_enabled_post_types( LaterPay_Core_Event $event ) {
}

// Update option for enabled post types.
$is_updated = LaterPay_Helper_Option::update_laterpay_option( 'laterpay_enabled_post_types', $enabled_post_types );
$is_updated = update_option( 'laterpay_enabled_post_types', $enabled_post_types );

if ( ! $is_updated ) {

Expand Down
4 changes: 2 additions & 2 deletions laterpay/application/Controller/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function load_assets()
'invalidCode' => esc_html__( 'Please enter valid UA-ID code!', 'laterpay' ),
),
'gaData' => array(
'custom_roles' => array_map( 'esc_js', $custom_role_names ),
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? esc_js( $merchant_key ) : '',
'custom_roles' => $custom_role_names,
'sandbox_merchant_id' => ( ! empty( $merchant_key ) ) ? $merchant_key : '',
),
)
);
Expand Down
24 changes: 0 additions & 24 deletions laterpay/application/Helper/Option.php

This file was deleted.

11 changes: 11 additions & 0 deletions laterpay/application/Model/SubscriptionWP.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,17 @@ public function get_subscriptions_by_category_ids( $term_ids = null, $exclude =
$subscriptions[ $key ] = $this->transform_post_to_subscription( $post );
}

// Unset subscription data if it contains excluded categories.
foreach ( $subscriptions as $key => $subscription ) {
if ( 1 === $subscription['access_to'] ) {
$found_categories = array_intersect( $term_ids, $subscription['access_category'] );

if ( ! empty( $found_categories ) ) {
unset( $subscriptions[$key] );
}
}
}

// Store formatted data, in case same query is fired again.
self::$term_data_store[$args_hash] = $subscriptions;

Expand Down
14 changes: 13 additions & 1 deletion laterpay/application/Model/TimePassWP.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,19 @@ public function get_time_passes_by_category_ids( $term_ids = null, $exclude = fa
$posts = $query->query( $query_args );

// Get formatted data and store it, in case same query is fired again.
$timepasses = $this->get_formatted_results( $posts );
$timepasses = $this->get_formatted_results( $posts );

// Unset time pass data if it contains excluded categories.
foreach ( $timepasses as $key => $timepass ) {
if ( 1 === $timepass['access_to'] ) {
$found_categories = array_intersect( $term_ids, $timepass['access_category'] );

if ( ! empty( $found_categories ) ) {
unset( $timepasses[$key] );
}
}
}

self::$term_data_store[$args_hash] = $timepasses;

}
Expand Down
23 changes: 18 additions & 5 deletions laterpay/asset_sources/js/laterpay-post-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,26 @@
var eventCategory = 'LP WP Post';
var commonLabel = lpVars.gaData.sandbox_merchant_id + ' | ' + lpVars.postId + ' | ';

var selectedCategories = $('#categorychecklist :checkbox:checked');
var categoryLabel = [];

// Loop through selected categories and store in an array.
$.each( selectedCategories, function( i ) {
categoryLabel.push($('#'+selectedCategories[i].id).parent().text().trim());
} );
// Check editor type to get selected categories in post.
if ( ! wp.data ) {
var selectedCategories = $('#categorychecklist :checkbox:checked');

// Loop through selected categories and store in an array.
$.each( selectedCategories, function( i ) {
categoryLabel.push($('#'+selectedCategories[i].id).parent().text().trim());
} );
} else {
var selectedCategoriesGB =
$('div.editor-post-taxonomies__hierarchical-terms-list :checkbox:checked');

// Loop through checked categories and store label text in an array.
$.each( selectedCategoriesGB, function( i ) {
categoryLabel.push($(selectedCategoriesGB[i]).next( 'label' ).text().trim());
} );

}

// Send GA event with category details.
lpGlobal.sendLPGAEvent( 'Post Published', eventCategory, commonLabel + categoryLabel.join(',') );
Expand Down
Binary file modified laterpay/languages/laterpay-de_DE.mo
Binary file not shown.
8 changes: 2 additions & 6 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: 2019-01-10 16:14+0530\n"
"PO-Revision-Date: 2019-01-10 16:14+0530\n"
"POT-Creation-Date: 2019-01-11 14:42+0530\n"
"PO-Revision-Date: 2019-01-11 14:43+0530\n"
"Last-Translator: lpadmin <[email protected]>\n"
"Language-Team: German\n"
"Language: de_DE\n"
Expand Down Expand Up @@ -1781,10 +1781,6 @@ msgstr ""
"Kaufen Sie einen Zeitpass oder ein Abo und zahlen Sie mit einer "
"Zahlungsmethode, der Sie vertrauen."

#: built_assets/js/laterpay-common.js:1
msgid "lp_ga_purchased"
msgstr ""

#: built_assets/js/vendor/velocity.min.js:3
msgid "translateX"
msgstr ""
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 GmbH, Mihail Turalenka and Aliaksandr Vahura
* Version: 2.4.0
* Version: 2.4.1
* Author URI: https://laterpay.net/
* Textdomain: laterpay
* Domain Path: /languages
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "laterpay-wordpress-plugin",
"version": "2.4.0",
"version": "2.4.1",
"description": "LaterPay WordPress plugin",
"main": "index.js",
"dependencies": {},
Expand Down

0 comments on commit f31280d

Please sign in to comment.