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 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 79e9ed630..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", @@ -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", 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 79130a8b9..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 @@ -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. @@ -84,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. @@ -618,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/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/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/Config.php b/laterpay/application/Helper/Config.php index 29aa636a9..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' => 3.99, + 'sis_min' => 1.49, '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, 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/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; diff --git a/laterpay/application/Model/SubscriptionWP.php b/laterpay/application/Model/SubscriptionWP.php index 58c9ddb3c..dc3829398 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,28 @@ 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 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; + } + + return self::$subscription_data_store[ $args_hash ]; + } } 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/languages/laterpay-de_CH.mo b/laterpay/languages/laterpay-de_CH.mo index d0e7b4f4b..0634d16a9 100644 Binary files a/laterpay/languages/laterpay-de_CH.mo and b/laterpay/languages/laterpay-de_CH.mo differ diff --git a/laterpay/languages/laterpay-de_CH_informal.mo b/laterpay/languages/laterpay-de_CH_informal.mo index d0e7b4f4b..0634d16a9 100644 Binary files a/laterpay/languages/laterpay-de_CH_informal.mo and b/laterpay/languages/laterpay-de_CH_informal.mo differ diff --git a/laterpay/languages/laterpay-de_DE.mo b/laterpay/languages/laterpay-de_DE.mo index d0e7b4f4b..0634d16a9 100644 Binary files a/laterpay/languages/laterpay-de_DE.mo and b/laterpay/languages/laterpay-de_DE.mo differ diff --git a/laterpay/languages/laterpay-de_DE.po b/laterpay/languages/laterpay-de_DE.po index 6181818b1..82fb58bc1 100644 --- a/laterpay/languages/laterpay-de_DE.po +++ b/laterpay/languages/laterpay-de_DE.po @@ -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-04-01 15:58+0530\n" -"PO-Revision-Date: 2019-04-01 15:58+0530\n" +"POT-Creation-Date: 2019-05-07 12:38+0530\n" +"PO-Revision-Date: 2019-05-07 12:38+0530\n" "Last-Translator: lpadmin \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 d0e7b4f4b..0634d16a9 100644 Binary files a/laterpay/languages/laterpay-de_DE_formal.mo and b/laterpay/languages/laterpay-de_DE_formal.mo differ diff --git a/laterpay/languages/laterpay.po b/laterpay/languages/laterpay.po index e05c7d0eb..2fe80d525 100644 --- a/laterpay/languages/laterpay.po +++ b/laterpay/languages/laterpay.po @@ -429,11 +429,11 @@ msgstr "" msgid "Read now, pay later" msgstr "" -#: laterpay/application/Helper/Pricing.php:900, laterpay/views/backend/pricing.php:198, laterpay/views/backend/pricing.php:329, laterpay/views/backend/pricing.php:449, laterpay/views/backend/pricing.php:608, laterpay/views/backend/partials/post-pricing-form.php:139, laterpay/application/Controller/Admin/Post/Column.php:122 +#: laterpay/application/Helper/Pricing.php:920, laterpay/views/backend/pricing.php:198, laterpay/views/backend/pricing.php:329, laterpay/views/backend/pricing.php:449, laterpay/views/backend/pricing.php:608, laterpay/views/backend/partials/post-pricing-form.php:139, laterpay/application/Controller/Admin/Post/Column.php:122 msgid "Pay Now" msgstr "" -#: laterpay/application/Helper/Pricing.php:903, laterpay/application/Module/Purchase.php:322, laterpay/views/backend/pricing.php:193, laterpay/views/backend/pricing.php:324, laterpay/views/backend/pricing.php:444, laterpay/views/backend/pricing.php:603, laterpay/views/backend/partials/post-pricing-form.php:126, laterpay/application/Controller/Admin/Post/Column.php:123 +#: laterpay/application/Helper/Pricing.php:923, laterpay/application/Module/Purchase.php:322, laterpay/views/backend/pricing.php:193, laterpay/views/backend/pricing.php:324, laterpay/views/backend/pricing.php:444, laterpay/views/backend/pricing.php:603, laterpay/views/backend/partials/post-pricing-form.php:126, laterpay/application/Controller/Admin/Post/Column.php:123 msgid "Pay Later" msgstr "" @@ -445,7 +445,7 @@ msgstr "" msgid "1 month access to all content on this website (cancellable anytime)" msgstr "" -#: laterpay/application/Helper/Subscription.php:68, laterpay/application/Helper/TimePass.php:174, laterpay/views/backend/pricing.php:564, laterpay/views/backend/pricing.php:756 +#: laterpay/application/Helper/Subscription.php:68, laterpay/application/Helper/TimePass.php:174, laterpay/views/backend/pricing.php:564, laterpay/views/backend/pricing.php:768 msgid "access to" msgstr "" @@ -529,7 +529,7 @@ msgstr "" msgid "Problem with inserted shortcode:" msgstr "" -#: laterpay/application/Module/Appearance.php:213, laterpay/application/Controller/Frontend/PreviewMode.php:215 +#: laterpay/application/Module/Appearance.php:213, laterpay/application/Controller/Frontend/PreviewMode.php:171 msgid "You don't have sufficient user capabilities to do this." msgstr "" @@ -537,15 +537,15 @@ msgstr "" msgid "I already bought this" msgstr "" -#: laterpay/application/Module/Purchase.php:197, laterpay/application/Module/Purchase.php:299, laterpay/application/Module/Purchase.php:312, laterpay/application/Controller/Frontend/Post.php:660, laterpay/application/Controller/Frontend/Shortcode.php:544 +#: laterpay/application/Module/Purchase.php:197, laterpay/application/Module/Purchase.php:299, laterpay/application/Module/Purchase.php:312, laterpay/application/Controller/Frontend/Post.php:664, laterpay/application/Controller/Frontend/Shortcode.php:544 msgid "Buy Now" msgstr "" -#: laterpay/application/Module/Purchase.php:200, laterpay/application/Controller/Frontend/Post.php:661, laterpay/application/Controller/Frontend/Shortcode.php:550 +#: laterpay/application/Module/Purchase.php:200, laterpay/application/Controller/Frontend/Post.php:665, laterpay/application/Controller/Frontend/Shortcode.php:550 msgid "Subscribe Now" msgstr "" -#: laterpay/application/Module/Purchase.php:204, laterpay/application/Controller/Frontend/Post.php:659, laterpay/application/Controller/Frontend/Shortcode.php:542 +#: laterpay/application/Module/Purchase.php:204, laterpay/application/Controller/Frontend/Post.php:663, laterpay/application/Controller/Frontend/Shortcode.php:542 msgid "Buy Now, Pay Later" msgstr "" @@ -881,7 +881,7 @@ msgstr "" msgid "Deactivate LaterPay Plugin" msgstr "" -#: laterpay/views/backend/advanced.php:265, laterpay/views/backend/appearance.php:190, laterpay/views/backend/pricing.php:80, laterpay/views/backend/pricing.php:220, laterpay/views/backend/pricing.php:340, laterpay/views/backend/pricing.php:460, laterpay/views/backend/pricing.php:492, laterpay/views/backend/pricing.php:654, laterpay/views/backend/pricing.php:695, laterpay/views/backend/pricing.php:842, laterpay/application/Controller/Admin/Settings.php:248, laterpay/views/frontend/partials/widget/purchase-overlay.php:142 +#: laterpay/views/backend/advanced.php:265, laterpay/views/backend/appearance.php:190, laterpay/views/backend/pricing.php:80, laterpay/views/backend/pricing.php:220, laterpay/views/backend/pricing.php:340, laterpay/views/backend/pricing.php:460, laterpay/views/backend/pricing.php:492, laterpay/views/backend/pricing.php:654, laterpay/views/backend/pricing.php:707, laterpay/views/backend/pricing.php:854, laterpay/application/Controller/Admin/Settings.php:248, laterpay/views/frontend/partials/widget/purchase-overlay.php:142 msgid "Cancel" msgstr "" @@ -1005,7 +1005,7 @@ msgstr "" msgid "Preview" msgstr "" -#: laterpay/views/backend/appearance.php:189, laterpay/views/backend/pricing.php:79, laterpay/views/backend/pricing.php:219, laterpay/views/backend/pricing.php:339, laterpay/views/backend/pricing.php:459, laterpay/views/backend/pricing.php:491, laterpay/views/backend/pricing.php:653, laterpay/views/backend/pricing.php:694, laterpay/views/backend/pricing.php:841 +#: laterpay/views/backend/appearance.php:189, laterpay/views/backend/pricing.php:79, laterpay/views/backend/pricing.php:219, laterpay/views/backend/pricing.php:339, laterpay/views/backend/pricing.php:459, laterpay/views/backend/pricing.php:491, laterpay/views/backend/pricing.php:653, laterpay/views/backend/pricing.php:706, laterpay/views/backend/pricing.php:853 msgid "Save" msgstr "" @@ -1163,11 +1163,11 @@ msgstr "" msgid "Add a Category Default Price" msgstr "" -#: laterpay/views/backend/pricing.php:482, laterpay/views/backend/pricing.php:521, laterpay/application/Controller/Admin/Pricing.php:965 +#: laterpay/views/backend/pricing.php:482, laterpay/views/backend/pricing.php:521, laterpay/application/Controller/Admin/Pricing.php:967 msgid "Pass" msgstr "" -#: laterpay/views/backend/pricing.php:506, laterpay/views/backend/pricing.php:709, laterpay/application/Controller/Admin/Pricing.php:109 +#: laterpay/views/backend/pricing.php:506, laterpay/views/backend/pricing.php:721, laterpay/application/Controller/Admin/Pricing.php:109 msgid "reduces the price to" msgstr "" @@ -1187,15 +1187,15 @@ msgstr "" msgid "and the user has to" msgstr "" -#: laterpay/views/backend/pricing.php:615, laterpay/views/backend/pricing.php:802 +#: laterpay/views/backend/pricing.php:615, laterpay/views/backend/pricing.php:814 msgid "Title" msgstr "" -#: laterpay/views/backend/pricing.php:626, laterpay/views/backend/pricing.php:813, laterpay/application/Controller/Admin/Pricing.php:151 +#: laterpay/views/backend/pricing.php:626, laterpay/views/backend/pricing.php:825, laterpay/application/Controller/Admin/Pricing.php:151 msgid "Description" msgstr "" -#: laterpay/views/backend/pricing.php:642, laterpay/views/backend/pricing.php:829 +#: laterpay/views/backend/pricing.php:642, laterpay/views/backend/pricing.php:841 msgid "The voucher price must be less than or equal to the " msgstr "" @@ -1203,7 +1203,7 @@ msgstr "" msgid "time pass price." msgstr "" -#: laterpay/views/backend/pricing.php:646, laterpay/views/backend/pricing.php:833 +#: laterpay/views/backend/pricing.php:646, laterpay/views/backend/pricing.php:845 msgid "Generate voucher code" msgstr "" @@ -1223,39 +1223,43 @@ msgstr "" msgid "Subscriptions" msgstr "" -#: laterpay/views/backend/pricing.php:685, laterpay/views/backend/pricing.php:724 +#: laterpay/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 "" + +#: laterpay/views/backend/pricing.php:697, laterpay/views/backend/pricing.php:736 msgid "Sub" msgstr "" -#: laterpay/views/backend/pricing.php:742 +#: laterpay/views/backend/pricing.php:754 msgid "The subscription costs" msgstr "" -#: laterpay/views/backend/pricing.php:751 +#: laterpay/views/backend/pricing.php:763 msgid ", grants " msgstr "" -#: laterpay/views/backend/pricing.php:779 +#: laterpay/views/backend/pricing.php:791 msgid "and renews every" msgstr "" -#: laterpay/views/backend/pricing.php:829 +#: laterpay/views/backend/pricing.php:841 msgid "subscription price." msgstr "" -#: laterpay/views/backend/pricing.php:835 +#: laterpay/views/backend/pricing.php:847 msgid "This will reduce the price for the entirety of the subscription." msgstr "" -#: laterpay/views/backend/pricing.php:852 +#: laterpay/views/backend/pricing.php:864 msgid "Sell subscriptions" msgstr "" -#: laterpay/views/backend/pricing.php:855 +#: laterpay/views/backend/pricing.php:867 msgid "Subscriptions work exactly like time passes, with a simple difference: They renew automatically." msgstr "" -#: laterpay/views/backend/pricing.php:858 +#: laterpay/views/backend/pricing.php:870 msgid "Click the \"Create\" button to add a Subscription." msgstr "" @@ -1271,7 +1275,7 @@ msgstr "" msgid "LaterPay does not work properly with invalid API credentials." msgstr "" -#: laterpay/application/Controller/Admin/Account.php:104, laterpay/application/Controller/Admin/Appearance.php:113, laterpay/application/Controller/Admin/Pricing.php:245, laterpay/application/Controller/Admin/Pricing.php:492, laterpay/application/Controller/Admin/Pricing.php:574, laterpay/application/Controller/Admin/Pricing.php:996, laterpay/application/Controller/Frontend/PreviewMode.php:115 +#: laterpay/application/Controller/Admin/Account.php:104, laterpay/application/Controller/Admin/Appearance.php:113, laterpay/application/Controller/Admin/Pricing.php:245, laterpay/application/Controller/Admin/Pricing.php:492, laterpay/application/Controller/Admin/Pricing.php:574, laterpay/application/Controller/Admin/Pricing.php:998, laterpay/application/Controller/Frontend/PreviewMode.php:71 msgid "An error occurred when trying to save your settings. Please try again." msgstr "" @@ -1493,35 +1497,35 @@ msgstr "" msgid "An error occurred when trying to save the subscription. Please try again." msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:843 +#: laterpay/application/Controller/Admin/Pricing.php:844 msgid "Subscription saved." msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:868 +#: laterpay/application/Controller/Admin/Pricing.php:869 msgid "Subscription deleted." msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:875 +#: laterpay/application/Controller/Admin/Pricing.php:877 msgid "The selected subscription was deleted already." msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:930 +#: laterpay/application/Controller/Admin/Pricing.php:932 msgid "Incorrect voucher price." msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:964 +#: laterpay/application/Controller/Admin/Pricing.php:966 msgid "Passes" msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:975 +#: laterpay/application/Controller/Admin/Pricing.php:977 msgid "Laterpay Passes Post type Registration issue." msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:1028 +#: laterpay/application/Controller/Admin/Pricing.php:1030 msgid "Unable to update LaterPay Enabled Post Type(s)." msgstr "" -#: laterpay/application/Controller/Admin/Pricing.php:1040 +#: laterpay/application/Controller/Admin/Pricing.php:1042 msgid "Successfully Updated LaterPay Enabled Post Type(s)." msgstr "" @@ -1748,7 +1752,7 @@ msgstr "" msgid "auto detected" msgstr "" -#: laterpay/application/Controller/Frontend/Post.php:653 +#: laterpay/application/Controller/Frontend/Post.php:657 msgid "" "Your site is in LIVE mode, your visitors would now see the LaterPay purchase dialog. \n" "\n" @@ -1757,27 +1761,27 @@ msgid "" "Note: You will be charged for purchases made while in LIVE mode." msgstr "" -#: laterpay/application/Controller/Frontend/Post.php:654 +#: laterpay/application/Controller/Frontend/Post.php:658 msgid "Voucher code accepted." msgstr "" -#: laterpay/application/Controller/Frontend/Post.php:655 +#: laterpay/application/Controller/Frontend/Post.php:659 msgid " is not a valid voucher code!" msgstr "" -#: laterpay/application/Controller/Frontend/Post.php:656 +#: laterpay/application/Controller/Frontend/Post.php:660 msgid "Please enter a six-digit voucher code." msgstr "" -#: laterpay/application/Controller/Frontend/Post.php:657 +#: laterpay/application/Controller/Frontend/Post.php:661 msgid "An error occurred. Please try again." msgstr "" -#: laterpay/application/Controller/Frontend/Post.php:736 +#: laterpay/application/Controller/Frontend/Post.php:740 msgid "— Visit the post to buy its full content for {price} {currency} — {teaser_content}" msgstr "" -#: laterpay/application/Controller/Frontend/PreviewMode.php:156, laterpay/application/Controller/Frontend/PreviewMode.php:241 +#: laterpay/application/Controller/Frontend/PreviewMode.php:112, laterpay/application/Controller/Frontend/PreviewMode.php:197 msgid "Updated." msgstr "" 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/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 - + +
+

+ +

+
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": {},