diff --git a/composer.json b/composer.json index 3a9c8a4..77b9d8a 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "simpay/simpay-wordpress", - "version": "2.2.4", + "version": "2.2.5", "type": "library", "require": { "simpaypl/simpay": "^2.2" diff --git a/readme.txt b/readme.txt index 0514159..5de57f4 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://darkgl.pl/ Tags: simpay, payments, directbiling, sms Requires at least: 6.0 Tested up to: 6.6.1 -Stable tag: 2.2.4 +Stable tag: 2.2.5 Requires PHP: 8.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html diff --git a/simpay-wordpress.php b/simpay-wordpress.php index a78b5de..803dbc8 100644 --- a/simpay-wordpress.php +++ b/simpay-wordpress.php @@ -4,7 +4,7 @@ * Plugin Name: SimPay Wordpress * Plugin URI: https://simpay.pl * Description: Use SimPay SMS service to use during registration or access to the post. - * Version: 2.2.4 + * Version: 2.2.5 * Author: SimPay * Author URI: https://simpay.pl * License: GPL-2.0+ diff --git a/src/Modules/PaywallMode/Hooks/AddPaywallOnPost.php b/src/Modules/PaywallMode/Hooks/AddPaywallOnPost.php index d4bb01d..3a921a0 100644 --- a/src/Modules/PaywallMode/Hooks/AddPaywallOnPost.php +++ b/src/Modules/PaywallMode/Hooks/AddPaywallOnPost.php @@ -85,7 +85,7 @@ private function showNotLoggedInAlert(): string */ private function handlePaywallForm(mixed $wpQuery): ?string { - if (!isset($_POST['_simpay_nonce']) || !wp_verify_nonce($_POST['_simpay_nonce'], 'simpay_paywall_nonce')) { + if (!isset($_POST['_simpay_nonce']) || !wp_verify_nonce($_POST['_simpay_nonce'], 'simpay_nonce')) { return ''; } diff --git a/src/Modules/PaywallMode/Hooks/SaveMetaboxPaywallData.php b/src/Modules/PaywallMode/Hooks/SaveMetaboxPaywallData.php index 9a190b9..02f8737 100644 --- a/src/Modules/PaywallMode/Hooks/SaveMetaboxPaywallData.php +++ b/src/Modules/PaywallMode/Hooks/SaveMetaboxPaywallData.php @@ -15,6 +15,10 @@ public static function getHookName(): string public function __invoke($postId): void { + if (!isset($_POST['_simpay_nonce']) || !wp_verify_nonce($_POST['_simpay_nonce'], 'simpay_nonce')) { + return; + } + update_post_meta( $postId, 'paywall_active', diff --git a/view/admin/settings/settings-page.php b/view/admin/settings/settings-page.php index 14b654c..b5b3d69 100644 --- a/view/admin/settings/settings-page.php +++ b/view/admin/settings/settings-page.php @@ -5,6 +5,7 @@