Skip to content

Commit 865f1e4

Browse files
committed
fix: wp plugin issues
1 parent a254069 commit 865f1e4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

plugin/next-revalidate.zip

1.38 KB
Binary file not shown.

plugin/next-revalidate/README.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: 9d8
33
Tags: next.js, headless, revalidation, cache
44
Requires at least: 5.0
55
Tested up to: 6.4
6-
Stable tag: 1.0.0
6+
Stable tag: 1.0.1
77
Requires PHP: 7.2
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -55,6 +55,9 @@ Yes, the plugin automatically detects and handles revalidation for custom post t
5555

5656
== Changelog ==
5757

58+
= 1.0.1 =
59+
* Fix: Register AJAX actions for manual revalidation
60+
* Fix: Normalize Next.js site URL in settings (remove trailing slash)
5861
= 1.0.0 =
5962
* Initial release
6063

plugin/next-revalidate/next-revalidate.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Next.js Revalidation
44
* Description: Revalidates Next.js site when WordPress content changes
5-
* Version: 1.0.0
5+
* Version: 1.0.1
66
* Author: 9d8
77
* Author URI: https://9d8.dev
88
*/
@@ -19,6 +19,8 @@ class Next_Revalidation {
1919
public function __construct() {
2020
// Initialize plugin
2121
add_action('init', array($this, 'init'));
22+
// Register AJAX actions for manual revalidation
23+
add_action('init', array($this, 'register_ajax_actions'));
2224

2325
// Register settings
2426
add_action('admin_init', array($this, 'register_settings'));
@@ -92,8 +94,10 @@ public function register_settings() {
9294
public function sanitize_settings($input) {
9395
$new_input = array();
9496

95-
if(isset($input['next_url'])) {
96-
$new_input['next_url'] = esc_url_raw(trim($input['next_url']));
97+
if (isset($input['next_url'])) {
98+
// Normalize and sanitize Next.js site URL (remove trailing slash)
99+
$url = rtrim(trim($input['next_url']), '/');
100+
$new_input['next_url'] = esc_url_raw($url);
97101
}
98102

99103
if(isset($input['webhook_secret'])) {

0 commit comments

Comments
 (0)