Closed lddd closed 5 years ago
The widget still seems OK for me. Would you be able to help me debug this?
How can i help?
Array ( [code] => 429 [message] => Too Many Requests ...
This is what i get on print_r ($remote);
I have the exact same problem as @lddd
@scottsweb same issue here, fwiw. How can we best help you debug?
In order to debug please:
Modify this line:
https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php#L212
Add a print_r( $remote ); above it and paste back the output here. It should give us more info as to what the actual error is.
@lddd Too many requests seems fairly self explanatory. It sounds like Instagram are rate limiting (most likely by IP). A couple of possible ideas:
Check if your are using the filter null_instagram_cache_time
in your sites code and reducing the cache time to something to low. A good couple of hours cache is sensible.
It is possible that on certain hosts you will be sharing the same external IP. This would mean every site with the plugin would count against your quota. I am not really sure what I could do to help with this.
Closing due to no feedback
Was a solution ever found for this? I'm getting this error and wondering what the solution could be. Could I use a proxy to get round this?
@phy9pas please follow the debug steps above and report back your findings
Hi, I'm not using the null_instagram_cahce_time filter. Here's the output of the $remote dump (attached) debug.txt
I'm having the exact same issue. What is the possible solution here? I've added null_instagram_cache_time filter and set it to 1 hour, but it's not solving the problem.
The only solution I could find was to use a proxy to make these external requests. You can do this by adding the proxy settings to your wp-config file.
define( 'WP_PROXY_HOST', 'xxxx.xxx.com' ); define( 'WP_PROXY_PORT', '10000' ); define( 'WP_PROXY_USERNAME', 'xxxxxxx'); define( 'WP_PROXY_PASSWORD', 'xxxxxxxx');
From looking at your logs @phy9pas, Instagram is rate limiting your requests.
The page responds with Please wait a few minutes before you try again
.
A proxy would ensure you are using a different IP and therefore it is less subject to rate limiting... which is why that is working.
A couple of things that might cause you to be rate limited:
Where are you hosting these sites?
I've not set any custom cache time, so it will be using the default (which I think is 1 hour?) This is on a low-cost host so my guess is it's shared between lots of sites which may be making similar requests.
Default is 2 hours which seems like the best compromise.
Unfortunately there is not a great deal I can do about the hosting situation (other than running a paid for proxy service).
Hello,
Plugin Version 2.0.3. gives me this error. There might has been changes to the instagram API.
Instagram did not return a 200
best regards!