Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install the WordPress Plugin #38

Open
call007 opened this issue Jan 29, 2025 · 6 comments
Open

How to install the WordPress Plugin #38

call007 opened this issue Jan 29, 2025 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@call007
Copy link

call007 commented Jan 29, 2025

Hi! Can anyone explain me, how to install the WordPress Plugin? I don't understand how to navigate to wordpress/next-revalidate/. Where is path? I'm also not able to find the webhook endpoint at /api/revalidate. I read this all here https://github.com/9d8dev/next-wp?tab=readme-ov-file#automatic-revalidation
Thanks in advance!

@brijr
Copy link
Collaborator

brijr commented Jan 29, 2025

Hey! Did you set up a WordPress instance somewhere and connect your env vars? If so then you should be able to go to /admin and find your WPAdmin where you can add plugins!

@call007
Copy link
Author

call007 commented Jan 29, 2025

Hey! Did you set up a WordPress instance somewhere and connect your env vars? If so then you should be able to go to /admin and find your WPAdmin where you can add plugins!

Yep! I have found the next-revalidate plugin in the revalidate-from-wordpress branch. I’ve installed it in WordPress and added WORDPRESS_WEBHOOK_SECRET there and in Vercel environments. But it seems it doesn’t work because I don’t see updates in Next.js when I add or remove posts in WordPress.

@brijr
Copy link
Collaborator

brijr commented Jan 29, 2025

Oh I see, sorry I misunderstood. That plugin is still underdevelopment so need to finish that up. Yeah, what I still need to do is create the Webhook endpoint in next-wp to accept the revalidate response--if you want to take a crack at it. I'll try to find time this week to work on this.

@brijr brijr self-assigned this Jan 29, 2025
@youngbloodcyb youngbloodcyb added the enhancement New feature or request label Jan 29, 2025
@Maxssobolev
Copy link

Hi, +1 :)

@franciscusagnew
Copy link

franciscusagnew commented Feb 4, 2025

Thanks for querying this @call007! BTW, I change revalidate to 1 as a temporary solution in the lib/worpress.ts file to observe my edits and updates:

// Default fetch options for WordPress API calls
const defaultFetchOptions: FetchOptions = {
  next: {
    tags: ["wordpress"],
    // revalidate: 3600, // Revalidate every hour by default
    revalidate: 15, // Revalidate every 15 secs
  },
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
  },
};

Just make sure your refresh the browser window displaying NextJs WP project each time you want to see the results.

@glomotion
Copy link

glomotion commented Feb 18, 2025

@franciscusagnew so i've been trying to change these revalidate settings (trying in various different ways) - and am still running into all sorts of stale content even when in dev mode (#40).

I just noticed that instead of using the RC react and react-dom versions, i'm using the 19.x stable ones (npm gave me dep errors when i tried to do npm i for this project).

I now wonder if this might be causing all these dev caching issues. I wonder, are you using the RC react versions?

"react": "19.0.0-rc.1",
"react-dom": "19.0.0-rc.1",

im using:

"react": "19.0.0",
"react-dom": "19.0.0",

EDIT - Nope - using react rc versions didn't fix anything. nvm me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants