gust icon indicating copy to clipboard operation
gust copied to clipboard

Empty post/pages list. "API error: error" message

Open ghost opened this issue 11 years ago • 11 comments

As it says in the headline: the lists of posts and pages remain empty (not the Disqus issue since I'm using WordPress native comments), and whenever I change the tab from Posts to Pages to Panel, I get an error message saying "API error: error".

I'm running WordPress with PHP 5.3 - but my admin panel, and thus Gust, too, are served with HTTPS encryption. Could this be an issue?

ghost avatar Feb 03 '14 21:02 ghost

Hi, could you give me a list of plugins you are using?

ideag avatar Feb 03 '14 21:02 ideag

Of course - my apologies for not testing all plugins by switching them off piece by piece before. By the way: My PHP installation is v.5.3.3.

Here is the list of installed plugins:

All in One SEO Pack - inactive Antispam Bee - active BackWPup - active Bad Behavior - active Better WordPress Recent Comments - inactive Captcha - active Contact Form 7 - active Disable Google Fonts - active Flattr - active Google XML Sitemaps - active Gust - active (of course!) Limit Login Attempts - active Postalicious - inactive PubSubHubbub - active Really Simple Twitter Feed Widget - active Simple Login Log - inactive Subscribe to "Double Opt-In" Comments - active WordPress HTTPS - active WordPress Statistics - active WP Robots Txt - active WP to Twitter - active

Funny thing: I switched them off and back on again and kept getting the error messages, and somewhere in the progress (while fiddling with the "Subscribe to "Double opt-in" Comments") I left Gust open for a couple of seconds more, and after 20 secs (estimated), the list of posts appeared, and also the list of pages, without throwing any more error messages.

Now it still takes a while to pull the list of posts/pages, but I don't get the error messages any more. Magic?

ghost avatar Feb 03 '14 23:02 ghost

Hmm, I would say it was an API timeout error. Is your website generally slow, or does this long load time specific to Gust? Do you have a really big number of posts, maybe?

ideag avatar Feb 04 '14 09:02 ideag

My website hast just 182 posts and 13 pages, so I wouldn't consider it being a large number. And although sometimes people tell me that the site is loading slow, I only can find that external sources such as graphics loading from a different server tend to slow it down a bit. Also, the regular WordPress panel is pretty fast.

Currently, the error message doesn't show any more. It still takes up to ten seconds for the list of posts to be filled (pages: about 4 to 5 seconds).

ghost avatar Feb 04 '14 10:02 ghost

No, 18.000 would be a large number :) This sounds weird, because Gust uses WordPress' native functions to get the posts. I'll have to try it over https maybe that is the problem.

ideag avatar Feb 04 '14 14:02 ideag

Maybe it is, but I doubt it. During my tinkering around, I also disabled the WP HTTPS plugin (which is the only instance enforcing an HTTPS connection) and got the same error message.

I'm trying it again right now, and here's what happens: It always takes some time for the lists to load (10 secs for posts, less for pages), and whenever I try to switch from one list to the other BEFORE the list has loaded, I get the API error message. Once the list has loaded, I can switch without the error message. So I assume you're right with it being a timeout issue.

ghost avatar Feb 04 '14 15:02 ghost

But where does the timeout come from. On my servers (all three of them) api requests average 300-400ms to respond with a similar amount of posts in database. I don't see how my code could hold it up for 10 secs. I've seen load times like that with thousands of posts in database, when sql_calc_found_rows issue kicks in. Could you try disabling ALL other plugins for a while to see if that helps?

ideag avatar Feb 04 '14 16:02 ideag

I did, and while the waiting period went down to 7 secs, there's still a considerable time spam until the lists are pulled. If nobody else is having this problem, maybe it's an issue with my server configuration that hasn't caused any problems before. I'm hosting with one of Germany's largest hosting co.s, and although I'm running a VPS with them, most of the configuration parameters are unchanged, i.e. the ones implemented by a company that needs to get the most out of their server farms. On the other hand, this is a fairly common setup for WordPress pages, isn't it?

ghost avatar Feb 04 '14 16:02 ghost

You are the first reporting this kind of problem. Are you using Apache or nginx ?

ideag avatar Feb 04 '14 17:02 ideag

This is an Apache server.

ghost avatar Feb 04 '14 17:02 ghost

First of all, sorry for me english.

I use this plugin on 3 of my servers. 2 are ok but the third is really slow. The site is ok, but without any other plugins (gust only) it's terrible.

screen shot 2014-03-13 at 19 02 11 screen shot 2014-03-13 at 18 59 30 screen shot 2014-03-13 at 19 01 47

I see it tries to fetch 15 posts at start but with full content. Why? 14 post and it's 8.8mb? I think the result to json conversion is slow with this volume of data. try to fetch only title and important meta data. Download content only on click.

So currently the plugin get all content of the latest 15 posts and call Gust::format_post for each post. On every post-list call. But there are no guarantee if I click at least one post. What if I want only create a new post.

yitsushi avatar Mar 13 '14 18:03 yitsushi