From 9109b2564edae4e75029349a873995fe218d5126 Mon Sep 17 00:00:00 2001 From: xecdev Date: Sat, 6 Dec 2025 09:05:22 +0430 Subject: [PATCH 1/2] make public key field mandatory --- templates/admin/paywall-settings.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/admin/paywall-settings.php b/templates/admin/paywall-settings.php index e018c8e..b8082f7 100644 --- a/templates/admin/paywall-settings.php +++ b/templates/admin/paywall-settings.php @@ -197,10 +197,10 @@ - + - +

Enter your PayButton public key to verify Payment Trigger requests.

@@ -239,7 +239,7 @@ 6. Save your button settings after pasting these values, and you're all set!

- Note: Enabling this feature is strongly recommended as it improves payment reliability, leveraging secure server-to-server messaging to record paywall transactions to your database. + Note: Enabling this feature is required as it improves payment reliability, leveraging secure server-to-server messaging to record paywall and login transactions to your database.

From 1aeb2c88c7ac7fcd03f7089da66590cda53539d3 Mon Sep 17 00:00:00 2001 From: xecdev Date: Sat, 6 Dec 2025 09:36:14 +0430 Subject: [PATCH 2/2] responding to the bot's feedback --- includes/class-paybutton-admin.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/class-paybutton-admin.php b/includes/class-paybutton-admin.php index 06ddc32..cd900c4 100644 --- a/includes/class-paybutton-admin.php +++ b/includes/class-paybutton-admin.php @@ -14,7 +14,7 @@ class PayButton_Admin { public function __construct() { add_action( 'admin_menu', array( $this, 'add_admin_menus' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) ); - add_action( 'admin_notices', array( $this, 'admin_notice_missing_wallet_address' ) ); + add_action( 'admin_notices', array( $this, 'admin_notice_missing_required_inputs' ) ); // Process form submissions early add_action( 'admin_init', array( $this, 'handle_save_settings' ) ); @@ -228,7 +228,7 @@ public function paywall_settings_page() { $this->load_admin_template( 'paywall-settings', $args ); } - public function admin_notice_missing_wallet_address() { + public function admin_notice_missing_required_inputs() { if (isset($_GET['settings-updated']) && $_GET['settings-updated'] === 'true') { return; } @@ -242,6 +242,13 @@ public function admin_notice_missing_wallet_address() { echo '

NOTICE: Please set your wallet address in Paywall Settings. If you don\'t have an address yet, create a wallet using Cashtab, Electrum ABC or Electron Cash.

'; echo ''; } + + $public_key = get_option('paybutton_public_key', ''); + if (empty($public_key)) { + echo '
'; + echo '

NOTICE: Please set your public key in Paywall Settings.

'; + echo '
'; + } } /**