Viewing 15 replies - 1 through 15 (of 42 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    I’m afraid “1” is a bit of a mystery @aminech, only thing I can think of if to make sure you have not added any restriction to the key (not even HTTP referrer)?

    But maybe @nicksws can share his solution here? 🙂

    frank

    Hi both,

    Sadly it didn’t want to play ball with me so in the end I gave it a rest. Even with checking the HTTP referrer it still didn’t want to play.

    In the end I used some code, here is a quick way of doing it:

    <iframe id=”iframe1″ src=”” width=”200″ height=”100″ border=”2″></iframe>
    <script>
    function setIframeSrc() {
    var s = “YOUR YOUTUBE VIDEO HERE”;
    var iframe1 = document.getElementById(‘iframe1’);
    if ( -1 == navigator.userAgent.indexOf(“MSIE”) ) {
    iframe1.src = s;
    }
    else {
    iframe1.location = s;
    }
    }
    setTimeout(setIframeSrc, 400);
    </script>

    Alter the number 400 if you want it to delay a bit longer.

    Hope this helps!

    Steven

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmmm … OK, let’s try something else; contact me at frank-at-optimizingmatters-dot-com and we can do a test with an API key I’m using to see if the problem is with the key or with … something else?

    I would like to say I have been having this same issue. I tried two weeks ago and again just now.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, as per my earlier comment mail me and we can try with a know-good key.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    for people still having this problem;
    1. can you open up your browser’s developer console and check for javascript errors there?
    2. can you check (are you sure) that your server (and/ or security plugins) allow outgoing requests (so PHP-code on your server that connects to 3rd party systems -in this case YouTube servers- to fetch data)?
    3. can you check your PHP-errorlog for relevant information around the time of receiving these errors?

    frank

    Hi Frank,
    I got the same error and I could say the following:

    1-I tried to analyze the Console logs: no warnings nor errors
    2-I’m on an hosting provider that does not give such detail on PHP code that connects to third-party servers (I would bet no, since my website is hosted on a cheap, low performance server along with other websites. I pay nuts, I get monkeys)
    3-I sent you the PHP log via email.

    bonus hint-I have Cloudflare on top of my website. Disabled it: no luck.

    Nicola

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    @nicolaottomano: if you hosting provider does not allow outgoing request, then connecting to the YouTube api will never work I’m afraid.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, for those of you still brave enough to fight this monster; can you please install the “health check” plugin?

    I’m specifically interested in the following information that plugin will show;
    * PHP version
    * Communication with WordPress.org
    * Secure communication
    * cURL version

    frank

    PHP Version 	7.1.15 - For performance and security reasons, we strongly recommend running PHP version 7.2 or higher.
    MySQL Server version 	5.6.39-cll-lve
    JSON Extension 	Your PHP install supports JSON.
    MySQL utf8mb4 support 	Your MySQL version supports utf8mb4
    Communication with WordPress.org 	WordPress.org is reachable from your server.
    HTTPS status 	You are accessing this website using HTTPS.
    Secure communication 	Your WordPress install can communicate securely with other services.
    cURL version 	Your version of cURL, 7.54.0, is slightly out of date. The most recent version is 7.58. This may in some cases affect your sites ability to communicate with other services. If you are experiencing connectivity issues connecting to various services, please contact your host.
    Scheduled events 	No scheduled events have been missed.
    Background updates 	
    
        The AUTOMATIC_UPDATER_DISABLED constant is defined and enabled.
        No version control systems were detected.
        Your installation of WordPress doesn't require FTP credentials to perform updates.
        All of your WordPress files are writable.
    
    Loopback request 	The loopback request to your site completed successfully. 
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    nothing out of the ordinary @emilyatal. have you tried “save settings” despite the error when testing the key?

    I saved the settings, and removed my custom thumbnail from lyte_helper.php. The thumbnail from youtube was displayed, so it looks like the API is working, even though test is failing.

    I don’t know if it makes a difference, but I did update to the latest version of the plugin.

    • This reply was modified 6 years, 2 months ago by emilyatal.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The thumbnail from youtube was displayed, so it looks like the API is working, even though test is failing.

    and is the title displaying as well (the thumbnail can be a fall-back version)?

    yes, the title is displaying as well.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    great! in that case I’ll see if I can make the error-message a bit less harsh (well for “error: 1” at least to tell users they can try the key).

Viewing 15 replies - 1 through 15 (of 42 total)
  • The topic ‘YouTube API, Got Error: 1’ is closed to new replies.