From fb705495add7d9f5080f4ff6dae9a72f77d6ae26 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Tue, 2 Apr 2019 15:12:35 +0530 Subject: [PATCH 01/11] Update README.md --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ce1995ed..a058e6094 100644 --- a/README.md +++ b/README.md @@ -17,18 +17,22 @@ The plugin is available on http://wordpress.org/plugins/laterpay 1. Fork it ( https://github.com/laterpay/laterpay-wordpress-plugin/fork ) 2. Run `composer install` to install all the dependencies. -3. Create your feature branch (`git checkout -b feature/my_new_feature`) +3. Create your feature branch (`git checkout -b feature/my_new_feature develop`) 4. Add your changes, verify coding standards and language compatibility ( [Check #development-notes](#development-notes) ) 5. Run `gulp build` for `js` and / or `css` changes. Please check [gulpfile](gulpfile.js) for more tasks. 6. Commit your changes (`git commit -am 'Added some feature'`) 7. Push to the branch (`git push origin feature/my_new_feature`) 8. Create a new Pull Request to develop. +Note: Source code of the plugin resides in [laterpay](./laterpay) directory, you should copy / rsync files from this directory to your test site, in order to see the changes done. + +⚠️ Warning: Code from this repo is only to be used for development purposes. Always use the latest version available at http://wordpress.org/plugins/laterpay for production sites. + ## Development Notes ##### Please run following commands from the root directory. -1. Please verfiy your code is in compliance to the Coding Standards used in this Project. +1. Please verify your code is in compliance to the Coding Standards used in this Project. 2. Run `composer phpcs filename` or `composer phpcs laterpay` to check for PHPCS errors/warnings. 3. Run `composer phpcompat` to check if the code is compatible for PHP 5.6 and above @@ -54,4 +58,4 @@ The LaterPay WordPress plugin uses [Semantic Versioning 2.0.0](http://semver.org ## Copyright -Copyright 2018 LaterPay GmbH – Released under MIT License +Copyright 2019 LaterPay GmbH – Released under MIT License From dbb3fe4c8c2685942695f5a7dad703f47e7642a9 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Tue, 2 Apr 2019 18:57:50 +0530 Subject: [PATCH 02/11] Update README.txt --- laterpay/README.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/laterpay/README.txt b/laterpay/README.txt index 79130a8b9..7df703dd3 100644 --- a/laterpay/README.txt +++ b/laterpay/README.txt @@ -45,7 +45,9 @@ The LaterPay WordPress plugin is easy to implement and offers a user interface t * Data sharing = What it costs you: = + LaterPay is performance-based and works on a revenue sharing basis - for a limited time we’re charging a rate of 15% of actual revenue generated with LaterPay, ALL-INCLUSIVE. + * No payment processing fees * No chargeback fees * No payout fees @@ -68,7 +70,9 @@ when you need it. Contextual help for the current page is available via the ‘H You can find further information about LaterPay and the LaterPay WordPress plugin in the [LaterPay Knowledge Base](https://www.laterpay.net/academy). = Is this plugin crawler friendly? = + Yes! + * *Social media:* The plugin supports Facebook, Twitter, and Google+ crawlers, so it won’t hurt your social media reach. * *Google and Google News:* The plugin also supports Google and Google News crawlers. * Crawlers will never have access to the full content but only to your teaser content. From 6058793ca799ff7119ff9d3a6925c832a2c496e7 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Wed, 24 Apr 2019 18:45:14 +0530 Subject: [PATCH 03/11] Update composer lock --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 79e9ed630..4e22712c7 100644 --- a/composer.lock +++ b/composer.lock @@ -303,16 +303,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.1", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa" + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5b4333b4010625d29580eb4a41f1e53251be6baa", - "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { @@ -350,7 +350,7 @@ "phpcs", "standards" ], - "time": "2019-03-19T03:22:27+00:00" + "time": "2019-04-10T23:49:02+00:00" }, { "name": "wp-coding-standards/wpcs", From 84f81a0fb6dc5494e65cdc41c6aac316267784a2 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Thu, 25 Apr 2019 22:02:25 +0530 Subject: [PATCH 04/11] Fix duplicate queries issues Update code use internal cache Remove unused function --- .../application/Controller/Frontend/Post.php | 4 ++ .../Controller/Frontend/PreviewMode.php | 44 --------------- laterpay/application/Helper/Post.php | 17 ++++++ laterpay/application/Helper/Pricing.php | 24 +++++++- laterpay/application/Model/SubscriptionWP.php | 56 +++++++++++-------- 5 files changed, 77 insertions(+), 68 deletions(-) diff --git a/laterpay/application/Controller/Frontend/Post.php b/laterpay/application/Controller/Frontend/Post.php index 539903723..9be1c6da5 100644 --- a/laterpay/application/Controller/Frontend/Post.php +++ b/laterpay/application/Controller/Frontend/Post.php @@ -313,6 +313,10 @@ public function prefetch_post_access( LaterPay_Core_Event $event ) { return; } + if ( 1 === count( $posts ) && ! LaterPay_Helper_Post::is_enabled_type( $posts[0]->ID ) ) { + return; + } + $post_ids = array(); // as posts can also be loaded by widgets (e.g. recent posts and popular posts), we loop through all posts // and bundle them in one API request to LaterPay, to avoid the overhead of multiple API requests diff --git a/laterpay/application/Controller/Frontend/PreviewMode.php b/laterpay/application/Controller/Frontend/PreviewMode.php index 54b68257d..c707e79fc 100644 --- a/laterpay/application/Controller/Frontend/PreviewMode.php +++ b/laterpay/application/Controller/Frontend/PreviewMode.php @@ -32,47 +32,6 @@ public static function get_subscribed_events() { ); } - /** - * Check requirements for logging and rendering the post statistic pane via Ajax callback. - * - * @param WP_Post $post - * - * @return bool - */ - protected function check_requirements( $post = null ) { - - if ( empty( $post ) ) { - // check, if we're on a singular page - if ( ! is_singular() ) { - return false; - } - - // check, if we have a post - $post = get_post(); - if ( $post === null ) { - return false; - } - } - - // don't collect statistics data, if the current post is not published - if ( $post->post_status !== LaterPay_Helper_Pricing::STATUS_POST_PUBLISHED ) { - return false; - } - - // don't collect statistics data, if the current post_type is not an allowed post_type - $allowed_post_types = $this->config->get( 'content.enabled_post_types' ); - if ( ! in_array( $post->post_type, $allowed_post_types, true ) ) { - return false; - } - - // don't collect statistics data, if the current post is not purchasable - if ( ! LaterPay_Helper_Pricing::is_purchasable( $post->ID ) ) { - return false; - } - - return true; - } - /** * Callback to add the statistics placeholder to the footer. * @@ -82,9 +41,6 @@ protected function check_requirements( $post = null ) { * @return void */ public function modify_footer( LaterPay_Core_Event $event ) { - if ( ! $this->check_requirements() ) { - return; - } // don't add the preview pane placeholder to the footer, if the user is not logged in if ( ! LaterPay_Helper_User::can( 'laterpay_has_full_access_to_content', get_the_ID() ) ) { diff --git a/laterpay/application/Helper/Post.php b/laterpay/application/Helper/Post.php index ad4cd1ff6..2cdd8640d 100644 --- a/laterpay/application/Helper/Post.php +++ b/laterpay/application/Helper/Post.php @@ -442,4 +442,21 @@ public static function is_content_purchasable( $post_id ) { return true; } } + + /** + * Check if post_type is salable. + * + * @param int $post_id Post ID. + * + * @return bool + */ + public static function is_enabled_type( $post_id ) { + $enabled_types = (array) get_option( 'laterpay_enabled_post_types' ); + + if ( ! empty( $enabled_types ) && in_array( get_post_type( $post_id ), $enabled_types, true ) ) { + return true; + } + + return false; + } } diff --git a/laterpay/application/Helper/Pricing.php b/laterpay/application/Helper/Pricing.php index 31484434c..dfe271f67 100644 --- a/laterpay/application/Helper/Pricing.php +++ b/laterpay/application/Helper/Pricing.php @@ -23,6 +23,15 @@ class LaterPay_Helper_Pricing const STATUS_POST_PUBLISHED = 'publish'; const META_KEY = 'laterpay_post_prices'; + /** + * Internal cache for storing posts with their prices. + * + * @var array Internal cache of posts with their prices. + * + * @access private + */ + private static $purchasable_posts = []; + /** * Check, if the current post or a given post is purchasable. * @@ -38,8 +47,14 @@ public static function is_purchasable( $post_id = null ) { } } - // check, if the current post price is not 0 - $price = LaterPay_Helper_Pricing::get_post_price( $post_id, true ); + // Check if price already exists. + if ( isset( self::$purchasable_posts[ $post_id ] ) ) { + $price = self::$purchasable_posts[ $post_id ]; + } else { + // check, if the current post price is not 0 + $price = LaterPay_Helper_Pricing::get_post_price( $post_id, true ); + self::$purchasable_posts[ $post_id ] = $price; + } // Get current post price behaviour. $post_price_behaviour = self::get_post_price_behaviour(); @@ -204,6 +219,11 @@ public static function recalculate_post_price( $post_id, $category_id, $post_pri * @return float $price */ public static function get_post_price( $post_id, $recalculate = false ) { + + if ( ! LaterPay_Helper_Post::is_enabled_type( $post_id ) ) { + return (float) 0; + } + $global_default_price = get_option( 'laterpay_global_price' ); $cache_key = 'laterpay_post_price_' . $post_id; diff --git a/laterpay/application/Model/SubscriptionWP.php b/laterpay/application/Model/SubscriptionWP.php index 58c9ddb3c..9dc5efbb8 100644 --- a/laterpay/application/Model/SubscriptionWP.php +++ b/laterpay/application/Model/SubscriptionWP.php @@ -82,25 +82,8 @@ public function get_subscription( $id, $ignore_deleted = false ) { 'fields' => 'ids', ); - // Create a hash from the query args. - $args_hash = md5( wp_json_encode( $query_args ) ); - - // Check if data already exists for requested query args. - if ( isset( self::$subscription_data_store[ $args_hash ] ) ) { - - // Get data from internal cache for already requested query. - $current_posts = self::$subscription_data_store[ $args_hash ]; - - } else { - - $query = new WP_Query( $query_args ); - - // Get posts for requested args. - $current_posts = $query->posts; - - self::$subscription_data_store[ $args_hash ] = $current_posts; - - } + // Get data from data store. + $current_posts = self::get_subscription_from_data_store( $query_args ); $id = ( isset( $current_posts[0] ) ) ? $current_posts[0] : ''; @@ -122,9 +105,8 @@ public function get_subscription( $id, $ignore_deleted = false ) { $query_args['post_status'] = 'publish'; } - $get_subscription_query = new WP_Query( $query_args ); - - $posts = $get_subscription_query->get_posts(); + // Get data from data store. + $posts = self::get_subscription_from_data_store( $query_args ); if ( isset( $posts[0] ) ) { $subscription = $this->transform_post_to_subscription( $posts[0] ); @@ -572,4 +554,34 @@ private function ensure_post_meta_present( $post_meta ) { return $post_meta_new; } + + /** + * Get subscription data from internal cache. + * + * @param array $query_args Query args to be passed to WP_Query. + * + * @return array + */ + private function get_subscription_from_data_store( $query_args ) { + + // Create a hash from the query args. + $args_hash = md5( wp_json_encode( $query_args ) ); + + // Check if data already exists for requested query args. + if ( isset( self::$subscription_data_store[ $args_hash ] ) ) { + + // Get data from internal cache for already requested query. + self::$subscription_data_store[ $args_hash ]; + + } else { + + $query = new WP_Query( $query_args ); + + // Get posts for requested args. + self::$subscription_data_store[ $args_hash ] = $query->posts;; + + } + + return self::$subscription_data_store[ $args_hash ]; + } } From 7f02cc4c0bd5e4085d30f279b85fcb20d5689be6 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Fri, 3 May 2019 19:24:34 +0530 Subject: [PATCH 05/11] Reduce subscription minimum value --- laterpay/application/Helper/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laterpay/application/Helper/Config.php b/laterpay/application/Helper/Config.php index 29aa636a9..ce0dd4e00 100644 --- a/laterpay/application/Helper/Config.php +++ b/laterpay/application/Helper/Config.php @@ -32,7 +32,7 @@ class LaterPay_Helper_Config { 'ppu_min' => 0.05, 'ppu_only_limit' => 1.48, 'ppu_max' => 5.00, - 'sis_min' => 3.99, + 'sis_min' => 1.99, 'sis_only_limit' => 5.01, 'sis_max' => 149.99, 'sis_min_limit' => 1.50, @@ -73,7 +73,7 @@ class LaterPay_Helper_Config { 'ppu_min' => 0.05, 'ppu_only_limit' => 1.98, 'ppu_max' => 5.00, - 'sis_min' => 3.99, + 'sis_min' => 1.99, 'sis_only_limit' => 5.01, 'sis_max' => 149.99, 'sis_min_limit' => 2.00, From e460383839bb9b47ee71a2c762a3b4a24614e440 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Fri, 3 May 2019 19:40:11 +0530 Subject: [PATCH 06/11] Update subscription minimum value for EUR --- laterpay/application/Helper/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laterpay/application/Helper/Config.php b/laterpay/application/Helper/Config.php index ce0dd4e00..7eb71a5dd 100644 --- a/laterpay/application/Helper/Config.php +++ b/laterpay/application/Helper/Config.php @@ -32,7 +32,7 @@ class LaterPay_Helper_Config { 'ppu_min' => 0.05, 'ppu_only_limit' => 1.48, 'ppu_max' => 5.00, - 'sis_min' => 1.99, + 'sis_min' => 1.49, 'sis_only_limit' => 5.01, 'sis_max' => 149.99, 'sis_min_limit' => 1.50, From a82f2687d7cab04a48abec26c58494c43ec2a411 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Fri, 3 May 2019 22:14:04 +0530 Subject: [PATCH 07/11] Add warning when subscription with invalid price exist in US region --- .../application/Controller/Admin/Pricing.php | 6 +++-- .../js/laterpay-backend-pricing.js | 25 +++++++++++++++++++ .../asset_sources/scss/pages/_pricing.scss | 8 ++++++ laterpay/views/backend/pricing.php | 14 ++++++++++- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/laterpay/application/Controller/Admin/Pricing.php b/laterpay/application/Controller/Admin/Pricing.php index e53522370..c72ac1978 100644 --- a/laterpay/application/Controller/Admin/Pricing.php +++ b/laterpay/application/Controller/Admin/Pricing.php @@ -837,6 +837,7 @@ protected function subscription_form_save( LaterPay_Core_Event $event ) { $event->set_result( array( 'success' => true, + 'region' => get_option( 'laterpay_region', 'us' ), 'data' => $data, 'vouchers' => $vouchers, 'html' => $this->render_subscription( $hmtl_data ), @@ -864,8 +865,9 @@ protected function subscription_delete( LaterPay_Core_Event $event ) { $event->set_result( array( - 'success' => true, - 'message' => esc_html__( 'Subscription deleted.', 'laterpay' ), + 'success' => true, + 'message' => esc_html__( 'Subscription deleted.', 'laterpay' ), + 'region' => get_option( 'laterpay_region', 'us' ), ) ); } else { diff --git a/laterpay/asset_sources/js/laterpay-backend-pricing.js b/laterpay/asset_sources/js/laterpay-backend-pricing.js index 307f204cc..d376b6bba 100644 --- a/laterpay/asset_sources/js/laterpay-backend-pricing.js +++ b/laterpay/asset_sources/js/laterpay-backend-pricing.js @@ -1187,6 +1187,28 @@ }); }, + clearSubscriptionRegionWarning = function ( type, $entity, region, action, id ) { + // Hide subscription region price warning if all prices are ok. + if ( 'subscription' === type && Object.keys($entity.data.list).length ) { + var showSubscriptionRegionWarning = false; + if ( 'delete' === action ) { + delete $entity.data.list[id]; + } + + $.each( $entity.data.list, function( i ) { + var current_sub = $entity.data.list[i]; + if ( current_sub.hasOwnProperty( 'price' ) && + parseFloat(current_sub.price) < 1.99 && 'us' === region ) { + showSubscriptionRegionWarning = true; + } + } ); + + if ( false === showSubscriptionRegionWarning ) { + $('div.lp_js_subscriptionPanelWarning').hide(); + } + } + }, + addEntity = function(type) { var $entity = $o[type]; @@ -1521,6 +1543,7 @@ } $o.navigation.showMessage(r); + clearSubscriptionRegionWarning( type, $entity, r.region, 'edit' ); }, 'json' ); @@ -1601,6 +1624,8 @@ if ($($entity.wrapper + ':visible').length === 0) { $($o.emptyState, $entity.editor).velocity('fadeIn', { duration: 400 }); } + clearSubscriptionRegionWarning( type, $entity, r.region, + 'delete', $wrapper.data($entity.data.id) ); } else { $(this).stop().show(); } diff --git a/laterpay/asset_sources/scss/pages/_pricing.scss b/laterpay/asset_sources/scss/pages/_pricing.scss index 6d28f5897..77353d3db 100644 --- a/laterpay/asset_sources/scss/pages/_pricing.scss +++ b/laterpay/asset_sources/scss/pages/_pricing.scss @@ -102,6 +102,14 @@ div.lp_js_categoryPanelWarning { } } +div.lp_js_subscriptionPanelWarning { + margin: 0 auto $fs; + width: 500px; + p { + color: #ff1744; + } +} + // category default prices --------------------------------------------------------------------------------------------- .lp_category-price-form { diff --git a/laterpay/views/backend/pricing.php b/laterpay/views/backend/pricing.php index 7f4b77aa4..a92b36ab3 100644 --- a/laterpay/views/backend/pricing.php +++ b/laterpay/views/backend/pricing.php @@ -678,7 +678,19 @@ class="lp_js_timePassDescriptionTextarea lp_timePass_description-input lp_input - + +
+

+ +

+
From eeca0a0793249d95a5683c2a8f3c60b4f6421119 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Mon, 6 May 2019 13:36:11 +0530 Subject: [PATCH 08/11] Remove hyperlinks from blurred content --- laterpay/application/Helper/String.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/laterpay/application/Helper/String.php b/laterpay/application/Helper/String.php index 26770f71b..b06fd0c3a 100644 --- a/laterpay/application/Helper/String.php +++ b/laterpay/application/Helper/String.php @@ -234,6 +234,10 @@ public static function get_scrambled_text( $content ) { foreach ( $words as $key => $value ) { $tag = ( ! empty( $tags[ $key ] ) ) ? $tags[ $key ] : ''; + if ( ! empty( $tag[1] ) && 'a' === $tag[1] ) { + $tag = preg_replace( '//', '', $tag ); + } + if ( ! in_array( trim( $tag, '<>/' ), $allowed_tags, true ) ) { // Scramble the string before appending to final content. $final_content .= self::scramble_text( $value ) . $tag; From 4a5412122a057957e92352f21e9cdf2e53c4ba1e Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Tue, 7 May 2019 12:25:05 +0530 Subject: [PATCH 09/11] Refactor: control structure --- laterpay/application/Model/SubscriptionWP.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/laterpay/application/Model/SubscriptionWP.php b/laterpay/application/Model/SubscriptionWP.php index 9dc5efbb8..dc3829398 100644 --- a/laterpay/application/Model/SubscriptionWP.php +++ b/laterpay/application/Model/SubscriptionWP.php @@ -567,19 +567,13 @@ private function get_subscription_from_data_store( $query_args ) { // Create a hash from the query args. $args_hash = md5( wp_json_encode( $query_args ) ); - // Check if data already exists for requested query args. - if ( isset( self::$subscription_data_store[ $args_hash ] ) ) { - - // Get data from internal cache for already requested query. - self::$subscription_data_store[ $args_hash ]; - - } else { + // Check if data exists for requested query args, if not, add it to internal cache. + if ( ! isset( self::$subscription_data_store[ $args_hash ] ) ) { $query = new WP_Query( $query_args ); // Get posts for requested args. - self::$subscription_data_store[ $args_hash ] = $query->posts;; - + self::$subscription_data_store[ $args_hash ] = $query->posts; } return self::$subscription_data_store[ $args_hash ]; From 67c73e4230526705701bab2ad3217730705a44d0 Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Tue, 7 May 2019 12:41:37 +0530 Subject: [PATCH 10/11] Update language files --- laterpay/languages/laterpay-de_CH.mo | Bin 50056 -> 50056 bytes laterpay/languages/laterpay-de_CH_informal.mo | Bin 50056 -> 50056 bytes laterpay/languages/laterpay-de_DE.mo | Bin 50056 -> 50056 bytes laterpay/languages/laterpay-de_DE.po | 99 ++++++++++-------- laterpay/languages/laterpay-de_DE_formal.mo | Bin 50056 -> 50056 bytes laterpay/languages/laterpay.po | 84 ++++++++------- 6 files changed, 97 insertions(+), 86 deletions(-) diff --git a/laterpay/languages/laterpay-de_CH.mo b/laterpay/languages/laterpay-de_CH.mo index d0e7b4f4b60d4bc98477a43997cef46b88002299..0634d16a97642ae4cda90c8943bbcdc070e346b3 100644 GIT binary patch delta 38 lcmeBZXYOcc-oTd4X{u{ru3%_nWjvWbTOPsNY@Qt$0RYGD3G@H} delta 38 lcmeBZXYOcc-oTd4X`*Xjs9\n" "Language-Team: German\n" "Language: de_DE\n" @@ -545,8 +545,8 @@ msgstr "LaterPay funktioniert nicht ohne gültige API Zugangsdaten." #: application/Controller/Admin/Pricing.php:245 #: application/Controller/Admin/Pricing.php:492 #: application/Controller/Admin/Pricing.php:574 -#: application/Controller/Admin/Pricing.php:996 -#: application/Controller/Frontend/PreviewMode.php:115 +#: application/Controller/Admin/Pricing.php:998 +#: application/Controller/Frontend/PreviewMode.php:71 msgid "An error occurred when trying to save your settings. Please try again." msgstr "" "Während des Speicherns ist ein Fehler aufgetreten. Bitte versuchen Sie es " @@ -722,7 +722,7 @@ msgid "FREE" msgstr "KOSTENLOS" #: application/Controller/Admin/Post/Column.php:122 -#: application/Helper/Pricing.php:900 +#: application/Helper/Pricing.php:920 #: views/backend/partials/post-pricing-form.php:139 #: views/backend/pricing.php:198 views/backend/pricing.php:329 #: views/backend/pricing.php:449 views/backend/pricing.php:608 @@ -730,7 +730,7 @@ msgid "Pay Now" msgstr "Sofort zahlen" #: application/Controller/Admin/Post/Column.php:123 -#: application/Helper/Pricing.php:903 application/Module/Purchase.php:322 +#: application/Helper/Pricing.php:923 application/Module/Purchase.php:322 #: views/backend/partials/post-pricing-form.php:126 #: views/backend/pricing.php:193 views/backend/pricing.php:324 #: views/backend/pricing.php:444 views/backend/pricing.php:603 @@ -902,7 +902,7 @@ msgstr "" "dieses Abo wirklich löschen?" #: application/Controller/Admin/Pricing.php:109 views/backend/pricing.php:506 -#: views/backend/pricing.php:709 +#: views/backend/pricing.php:721 msgid "reduces the price to" msgstr "reduziert den Preis auf" @@ -938,7 +938,7 @@ msgid "All posts in category" msgstr "aller Beiträge in Kategorie" #: application/Controller/Admin/Pricing.php:151 views/backend/pricing.php:626 -#: views/backend/pricing.php:813 +#: views/backend/pricing.php:825 msgid "Description" msgstr "Beschreibung" @@ -1006,42 +1006,42 @@ msgstr "" "Während des Speicherns des Abos ist ein Fehler aufgetreten. Bitte versuchen " "Sie es erneut." -#: application/Controller/Admin/Pricing.php:843 +#: application/Controller/Admin/Pricing.php:844 msgid "Subscription saved." msgstr "Abo gespeichert." -#: application/Controller/Admin/Pricing.php:868 +#: application/Controller/Admin/Pricing.php:869 msgid "Subscription deleted." msgstr "Abo gelöscht." -#: application/Controller/Admin/Pricing.php:875 +#: application/Controller/Admin/Pricing.php:877 msgid "The selected subscription was deleted already." msgstr "Dieses Abo wurde bereits gelöscht." -#: application/Controller/Admin/Pricing.php:930 +#: application/Controller/Admin/Pricing.php:932 msgid "Incorrect voucher price." msgstr "Ungültiger Gutschein-Preis." -#: application/Controller/Admin/Pricing.php:964 +#: application/Controller/Admin/Pricing.php:966 msgid "Passes" msgstr "" -#: application/Controller/Admin/Pricing.php:965 views/backend/pricing.php:482 +#: application/Controller/Admin/Pricing.php:967 views/backend/pricing.php:482 #: views/backend/pricing.php:521 msgid "Pass" msgstr "Pass" -#: application/Controller/Admin/Pricing.php:975 +#: application/Controller/Admin/Pricing.php:977 msgid "Laterpay Passes Post type Registration issue." msgstr "" -#: application/Controller/Admin/Pricing.php:1028 +#: application/Controller/Admin/Pricing.php:1030 #, fuzzy #| msgid "LaterPay-enabled Post Types" msgid "Unable to update LaterPay Enabled Post Type(s)." msgstr "LaterPay Post-Types" -#: application/Controller/Admin/Pricing.php:1040 +#: application/Controller/Admin/Pricing.php:1042 #, fuzzy #| msgid "LaterPay-enabled Post Types" msgid "Successfully Updated LaterPay Enabled Post Type(s)." @@ -1140,8 +1140,8 @@ msgstr "" #: views/backend/appearance.php:190 views/backend/pricing.php:80 #: views/backend/pricing.php:220 views/backend/pricing.php:340 #: views/backend/pricing.php:460 views/backend/pricing.php:492 -#: views/backend/pricing.php:654 views/backend/pricing.php:695 -#: views/backend/pricing.php:842 +#: views/backend/pricing.php:654 views/backend/pricing.php:707 +#: views/backend/pricing.php:854 #: views/frontend/partials/widget/purchase-overlay.php:142 msgid "Cancel" msgstr "Abbrechen" @@ -1408,7 +1408,7 @@ msgstr "Bezahlinhalte werden ausgeblendet, der Direktzugriff wird verweigert." msgid "auto detected" msgstr "" -#: application/Controller/Frontend/Post.php:653 +#: application/Controller/Frontend/Post.php:657 msgid "" "Your site is in LIVE mode, your visitors would now see the LaterPay purchase " "dialog. \n" @@ -1419,42 +1419,42 @@ msgid "" "Note: You will be charged for purchases made while in LIVE mode." msgstr "" -#: application/Controller/Frontend/Post.php:654 +#: application/Controller/Frontend/Post.php:658 msgid "Voucher code accepted." msgstr "Gutschein-Code akzeptiert." -#: application/Controller/Frontend/Post.php:655 +#: application/Controller/Frontend/Post.php:659 msgid " is not a valid voucher code!" msgstr " ist kein gültiger Gutschein-Code!" -#: application/Controller/Frontend/Post.php:656 +#: application/Controller/Frontend/Post.php:660 msgid "Please enter a six-digit voucher code." msgstr "Bitte geben Sie einen sechsstelligen Gutschein-Code ein." -#: application/Controller/Frontend/Post.php:657 +#: application/Controller/Frontend/Post.php:661 msgid "An error occurred. Please try again." msgstr "Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut." -#: application/Controller/Frontend/Post.php:659 +#: application/Controller/Frontend/Post.php:663 #: application/Controller/Frontend/Shortcode.php:542 #: application/Module/Purchase.php:204 msgid "Buy Now, Pay Later" msgstr "Jetzt kaufen, später zahlen" -#: application/Controller/Frontend/Post.php:660 +#: application/Controller/Frontend/Post.php:664 #: application/Controller/Frontend/Shortcode.php:544 #: application/Module/Purchase.php:197 application/Module/Purchase.php:299 #: application/Module/Purchase.php:312 msgid "Buy Now" msgstr "Jetzt kaufen" -#: application/Controller/Frontend/Post.php:661 +#: application/Controller/Frontend/Post.php:665 #: application/Controller/Frontend/Shortcode.php:550 #: application/Module/Purchase.php:200 msgid "Subscribe Now" msgstr "Jetzt abonnieren" -#: application/Controller/Frontend/Post.php:736 +#: application/Controller/Frontend/Post.php:740 msgid "" "— Visit the post to buy its full content for {price} {currency} " "— {teaser_content}" @@ -1462,12 +1462,12 @@ msgstr "" "— Kaufen Sie den vollständigen Inhalt für {price} {currency} — " "{teaser_content}" -#: application/Controller/Frontend/PreviewMode.php:156 -#: application/Controller/Frontend/PreviewMode.php:241 +#: application/Controller/Frontend/PreviewMode.php:112 +#: application/Controller/Frontend/PreviewMode.php:197 msgid "Updated." msgstr "Aktualisiert." -#: application/Controller/Frontend/PreviewMode.php:215 +#: application/Controller/Frontend/PreviewMode.php:171 #: application/Module/Appearance.php:213 msgid "You don't have sufficient user capabilities to do this." msgstr "Sie haben nicht die erforderlichen Berechtigungen für diese Aktion." @@ -1612,7 +1612,7 @@ msgid "1 month access to all content on this website (cancellable anytime)" msgstr "1 Monat Zugriff auf alle Inhalte dieser Website (jederzeit kündbar)" #: application/Helper/Subscription.php:68 application/Helper/TimePass.php:174 -#: views/backend/pricing.php:564 views/backend/pricing.php:756 +#: views/backend/pricing.php:564 views/backend/pricing.php:768 msgid "access to" msgstr "Zugriff auf" @@ -2411,8 +2411,8 @@ msgstr "Vorschau" #: views/backend/appearance.php:189 views/backend/pricing.php:79 #: views/backend/pricing.php:219 views/backend/pricing.php:339 #: views/backend/pricing.php:459 views/backend/pricing.php:491 -#: views/backend/pricing.php:653 views/backend/pricing.php:694 -#: views/backend/pricing.php:841 +#: views/backend/pricing.php:653 views/backend/pricing.php:706 +#: views/backend/pricing.php:853 msgid "Save" msgstr "Speichern" @@ -2894,11 +2894,11 @@ msgstr "Dieser Pass kostet" msgid "and the user has to" msgstr "und Nutzer müssen" -#: views/backend/pricing.php:615 views/backend/pricing.php:802 +#: views/backend/pricing.php:615 views/backend/pricing.php:814 msgid "Title" msgstr "Titel" -#: views/backend/pricing.php:642 views/backend/pricing.php:829 +#: views/backend/pricing.php:642 views/backend/pricing.php:841 msgid "The voucher price must be less than or equal to the " msgstr "" @@ -2906,7 +2906,7 @@ msgstr "" msgid "time pass price." msgstr "" -#: views/backend/pricing.php:646 views/backend/pricing.php:833 +#: views/backend/pricing.php:646 views/backend/pricing.php:845 msgid "Generate voucher code" msgstr "Gutschein-Code erstellen" @@ -2930,35 +2930,42 @@ msgid "Click the \"Create\" button to add a Time Pass." msgstr "" "Klicken Sie auf den \"Erstellen\" Button, um einen Zeitpass hinzuzufügen." -#: views/backend/pricing.php:685 views/backend/pricing.php:724 +#: views/backend/pricing.php:688 +msgid "" +"Important: The minimum value for \"Pay Now\" prices in the US is $1.99. " +"Please be sure to update your subscriptions so that your users to not " +"receive an error when they try to purchase." +msgstr "" + +#: views/backend/pricing.php:697 views/backend/pricing.php:736 msgid "Sub" msgstr "Abo" -#: views/backend/pricing.php:742 +#: views/backend/pricing.php:754 msgid "The subscription costs" msgstr "Das Abo kostet" -#: views/backend/pricing.php:751 +#: views/backend/pricing.php:763 msgid ", grants " msgstr ", gibt" -#: views/backend/pricing.php:779 +#: views/backend/pricing.php:791 msgid "and renews every" msgstr "und verlängert sich nach" -#: views/backend/pricing.php:829 +#: views/backend/pricing.php:841 msgid "subscription price." msgstr "" -#: views/backend/pricing.php:835 +#: views/backend/pricing.php:847 msgid "This will reduce the price for the entirety of the subscription." msgstr "Der Gutschein bezieht sich auf die gesamte Laufzeit des Abos." -#: views/backend/pricing.php:852 +#: views/backend/pricing.php:864 msgid "Sell subscriptions" msgstr "Abos verkaufen" -#: views/backend/pricing.php:855 +#: views/backend/pricing.php:867 msgid "" "Subscriptions work exactly like time passes, with a simple difference: They " "renew automatically." @@ -2966,7 +2973,7 @@ msgstr "" "Abos funktionieren genau wie Zeitpässe, mit einem einfachen Unterschied: Sie " "verlängern sich automatisch." -#: views/backend/pricing.php:858 +#: views/backend/pricing.php:870 msgid "Click the \"Create\" button to add a Subscription." msgstr "Klicken Sie auf den \"Erstellen\" Button, um ein Abo hinzuzufügen." diff --git a/laterpay/languages/laterpay-de_DE_formal.mo b/laterpay/languages/laterpay-de_DE_formal.mo index d0e7b4f4b60d4bc98477a43997cef46b88002299..0634d16a97642ae4cda90c8943bbcdc070e346b3 100644 GIT binary patch delta 38 lcmeBZXYOcc-oTd4X{u{ru3%_nWjvWbTOPsNY@Qt$0RYGD3G@H} delta 38 lcmeBZXYOcc-oTd4X`*Xjs9 Date: Tue, 7 May 2019 12:57:07 +0530 Subject: [PATCH 11/11] Bump version to 2.5.3 Update Changelog --- composer.json | 2 +- composer.lock | 2 +- gulpfile.js | 2 +- laterpay/README.txt | 14 ++++++++++---- laterpay/laterpay.php | 2 +- package.json | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index aed04a413..80725bff3 100644 --- a/composer.json +++ b/composer.json @@ -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.5.2", + "version": "2.5.3", "config": { "vendor-dir": "laterpay/vendor", "secure-http": true diff --git a/composer.lock b/composer.lock index 4e22712c7..d1b5661ff 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f7ebc8b3af366240a7c6fd7bb42f1b9a", + "content-hash": "38a9940d01fb8f5122bdfc0b30cf3a2b", "packages": [ { "name": "laterpay/laterpay-client-php", diff --git a/gulpfile.js b/gulpfile.js index c63ff049c..0e30e45fd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -38,7 +38,7 @@ var gulp = require('gulp'), // OPTIONS ------------------------------------------------------------------------------------------------------------- var gulpKnownOptions = { string: 'version', - default: { version: '2.5.2' } + default: { version: '2.5.3' } }; var gulpOptions = minimist(process.argv.slice(2), gulpKnownOptions); gulpOptions.svn = {}; diff --git a/laterpay/README.txt b/laterpay/README.txt index 7df703dd3..5c98345ad 100644 --- a/laterpay/README.txt +++ b/laterpay/README.txt @@ -4,8 +4,8 @@ Contributors: laterpay, dominik-rodler, mihail-turalenka, avahura, ahryb 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.1.1 -Stable tag: 2.5.2 +Tested up to: 5.2 +Stable tag: 2.5.3 Author URI: https://laterpay.net Plugin URI: https://github.com/laterpay/laterpay-wordpress-plugin License: MIT @@ -88,6 +88,12 @@ Yes! 6. The plugin provides a variety of advanced settings to customize the LaterPay plugin and adjust it to your needs. == Changelog == += 2.5.3 ( May 7, 2019 ) = +* Optimize code and use internal cache, to reduce queries. +* Add warning for subscription with invalid price. +* Lower Subscription Minimum value to $1.99 and 1.49€ for US and EU region respectively. +* Remove Hyperlinks from Obfuscated text. + = 2.5.2 ( April 2, 2019 ) = * Add Advanced Tab, to inform about all advanced feature. * Add disclaimer for Subscription voucher. @@ -622,8 +628,8 @@ KNOWN BUGS: == Upgrade notice == -= 2.5.2 ( April 2, 2019 ) = -A new "Advanced" Tab containing information of advanced feature, updated plugin mode toggle behaviour and improvements with LaterPay functionality. += 2.5.3 ( May 7, 2019 ) = +Code optimizations for reducing DB calls, reduced Subscription minimum value for both regions and minor improvements with LaterPay functionality. == Arbitrary section == diff --git a/laterpay/laterpay.php b/laterpay/laterpay.php index d42dc13f7..8cc5476de 100644 --- a/laterpay/laterpay.php +++ b/laterpay/laterpay.php @@ -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.5.2 + * Version: 2.5.3 * Author URI: https://laterpay.net/ * Textdomain: laterpay * Domain Path: /languages diff --git a/package.json b/package.json index cd595df8b..17515700d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "laterpay-wordpress-plugin", - "version": "2.5.2", + "version": "2.5.3", "description": "LaterPay WordPress plugin", "main": "index.js", "dependencies": {},