Skip to content

Instantly share code, notes, and snippets.

@andrewshell
Created December 7, 2022 04:27
Show Gist options
  • Save andrewshell/8b57f96bf62a1dea9fa1a8137e13951a to your computer and use it in GitHub Desktop.
Save andrewshell/8b57f96bf62a1dea9fa1a8137e13951a to your computer and use it in GitHub Desktop.
Debugging rssCloud on WordPress.com

I have a test application running at test.rsscloud.io on ports 80 and 9876.

The following code works:

curl --location --request POST 'https://brokenriverbooks.com/?rsscloud=notify' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'domain=test.rsscloud.io' \
--data-urlencode 'port=80' \
--data-urlencode 'path=/feedupdated-s8759' \
--data-urlencode 'registerProcedure=' \
--data-urlencode 'protocol=http-post' \
--data-urlencode 'url1=https://brokenriverbooks.com/feed/'

However if you change the port to 9876 it fails. For some reason the rssCloud plugin seems unable to hit ports that are not 80.

@josephscott
Copy link

Sorry, my previous comment was supposed to be "RSS block/widget".

In terms of the RSS feed updating, I've run a few tests on a stock out of the box WordPress site and didn't see any problems with the RSS feed updating right away.

What you described with the feed being updated when you viewed it with the browser but not updated when done with curl sounds like it could be a caching difference based on cookies. Were you logged into the site with the browser you used to check the feed?

I went back to the fresh stock WordPress install for testing and still didn't have a problem with the feed updating when viewed logged out or logged in, so I don't think this is sufficient to explain what you saw either.

Are there any other plugins on the site you are using to test? Can you try it with a fresh WordPress install with no plugins and check to see if the RSS feed updates as expected.

@scripting
Copy link

@josephscott @andysylvester --

Once I got the FeedLand implementation working with WordPress and @andrewshell's server, I created a very simple demo app that just does the rssCloud functionality in FeedLand anyone can test with our implementation, and see exactly what's going on. MIT License.

https://github.com/scripting/reallysimple/tree/main/demos/clouddemo

It also provides a reference implementation for people just getting started.

At some point I need to rewrite the walkthrough. It's not very well done imho (I am the author).

@andysylvester
Copy link

@josephscott - I was logged into the site, so I will check on that. I really appreciate your feedback, and will work on testing today.

@andysylvester
Copy link

@scripting - I was already aware of your implementation (see this link to comment above), so I assume you are really leaving your comment for the benefit of @josephscott. I used your app to help figure out my current issue with the RSS Cloud plugin. Since it appears you have removed your block of my account on the reallySimple repo, I will post further feedback on your reference app on that repo in the future.

@andysylvester
Copy link

Well, I see it didn't take long to restore the block of my account...

@andysylvester
Copy link

@josephscott - Yesterday, per your suggestion, I created a new WordPress site (https://scott2.andysylvester.com/) and disabled all plugins, then installed version 0.5.0 of the RSS Cloud plugin, and was able to successfully see posts appear within several seconds on FeedLand, which would indicate that the plugin is working. I also checked the feed in the browser and using curl, and both contained the correct content. This morning, I decided to do additional tests using my test app and Dave Winer's test app. Both apps were able to receive the notification from new posts. However, posts did not appear in FeedLand. I also checked the feed in the browser and using curl, and both contained the correct content.

When I looked at the output of my app, which uses the readFeed function within the NPM reallySimple package to get the feed, the first title in the feed it read was for test post 8, although I had created a new test post. This behavior continued even though I made several additional posts. In the posts, I captured info on each state of testing. To me, if FeedLand was not seeing any changes in the feed, I can totally understand that it would not display anything from the feed. As I have commented before, this seems like a caching problem, but I am not sure where to look.

I do not fully understand what is happening here, but this behavior has now occurred on two different WordPress sites using the latest RSS Cloud plugin. I would like to work this out, because WordPress is the major creator of rssCloud-enabled feeds, and I want to use rssCloud and WordPress in a new project. @josephscott, I am willing to keep posting to this thread, or in some other forum to work this out, I appreciate the feedback you have given me, and want to run this problem down if I can.

@josephscott
Copy link

From what you are describing, I'm not sure that this is directly related to the RSS Cloud plugin. You mentioned that it worked out of the box, with the feed showing the latest data and pings going out to FeedLand.

To track this down I think you are going to need more data. I'd recommend adding logging to every step, that what you can confirm when a step went missing that you were expecting to happen.

@andysylvester
Copy link

@josephscott - thanks for getting back with me. I did see it work "out of the box", but then saw this caching issue when I was running some supplemental test scripts. I will add some logging and report back on what I find.

@andysylvester
Copy link

@josephscott - I apologize for taking so long to get back to you on this thread. I found that my hosting provider (Bluehost) had a site-by-site caching setting that I was not aware of. I turned caching off, and I also uncommented line 12 in rsscloud.php within the WordPress RSS Cloud plugin. After taking those two actions, I was able to see WordPress posts within a few seconds on FeedLand and a separate tool I created. More info is available here: https://andysylvester.com/2023/02/23/solved-my-problem-with-wordpress-caching/. Thanks for your helpful suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment