Closed iamzenigma closed 6 years ago
Good catch and the fix looks sane too. I might shorten the prefix as I think transients names are limited, will aim to push an update in the next week.
Awesome! Thanks! @scottsweb
Oh btw, you'll probably do this, but silly me forgot to add the prefix to the set_transient() call hehe...the most important one.
set_transient( 'instagram-a9-' . $transient_prefix . '-' . sanitize_title_with_dashes( $username )...
Cheers.
Fixed in 2.0.3
Hi,
I'm building a website for my sister and noticed something odd. Whenever I tried to call the feed for the hashtags ('#') I was given the same list as when I searched for the username ('@').
After delving into your code I noticed that, whenever the username or hashtag have the same names, they get saved under the same transient. For example: @test and #test result in the same 'instagram-a9-test', because the function sanitize_title_with_dashes() removes these @/# signs. In your code that means the result will always point to either one of them and therefore one that uses your plugin can't get results for hashtags and usernames with the same search value.
FIX: I'm not sure if transients are allowed to have @ or # values, so I introduced a simple variable to fix this issue. As far as I'm concerned this works, but I'm not sure if this would affect users who are currently using your plugin!
The start of my scrape_instagram() function has this code included:
and the if statement looks like this:
Thank you btw. Really like the simplicity of your coding! I LIKE WHAT YOU GOT! 💯
Zeff