Title: Http referrer problem
Last modified: July 18, 2019

---

# Http referrer problem

 *  Resolved [hmmux](https://wordpress.org/support/users/hmmux/)
 * (@hmmux)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/http-referrer-problem/)
 * Hi,
 * for me plugin wasn’t working after in google console I added youtube API key 
   restriction HTTP referrers: my website’s url. It showed that referrer is wrong,
   debugging showed that referrer was the same generated url as $feed_url in fetch_youtube_feed()
   function. That’s how wp_remote_get() works I suppose.
    After I modified fetch_youtube_feed()
   by adding referer to wp_remote_get headers like this
 *     ```
       $wparg = array(
       				'timeout' => $this->defaults['timeout'],
       				'sslverify' => $this->defaults['sslverify'] ? true : false,
       				'headers' => array( 'referer' => site_url() ),
       			);
       ```
   
 * everything is working.
    Is nobody protecting their keys with referers or is it
   only my websites problem?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Aleksandar Urošević](https://wordpress.org/support/users/urkekg/)
 * (@urkekg)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/http-referrer-problem/#post-11748648)
 * Hi [@hmmux](https://wordpress.org/support/users/hmmux/),
 * Thank you very much for this contribution! Mainly, users do not restrict API 
   keys.
 * I have added this improvement to GitHub project (so will be included in next 
   release) [https://github.com/urosevic/youtube-channel](https://github.com/urosevic/youtube-channel)
 * Kind regards,
    Aleksandar

Viewing 1 replies (of 1 total)

The topic ‘Http referrer problem’ is closed to new replies.

 * ![](https://ps.w.org/youtube-channel/assets/icon.svg?rev=2845692)
 * [My YouTube Channel](https://wordpress.org/plugins/youtube-channel/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/youtube-channel/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/youtube-channel/)
 * [Active Topics](https://wordpress.org/support/plugin/youtube-channel/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/youtube-channel/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/youtube-channel/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Aleksandar Urošević](https://wordpress.org/support/users/urkekg/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/http-referrer-problem/#post-11748648)
 * Status: resolved