Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Tim W

    (@timwhitlock)

    A problem with the API keys would not show “Unknown error”. It would show “Error 401: API key is invalid”.

    There must be some other problem that my plugin doesn’t know about. It’s probably relevant that it is happening to two separate APIs equally.

    To work this out I need you to (1) open your browser console and check for JavaScript error messages, and (2) open your browser network inspector and post here the full HTTP requests to Google and Yandex (minus your API key) and the full HTTP responses.

    Plugin Author Tim W

    (@timwhitlock)

    Also, please post the contents of the Loco debug screen at:
    /wp-admin/admin.php?page=loco-config&action=debug

    Thread Starter fresneda0405

    (@fresneda0405)

    Versions
    Loco Translate:
    2.5.0
    WordPress:
    5.6
    PHP:
    7.4.13 (cgi-fcgi)
    Server:
    Apache
    jQuery:
    3.5.1; ui/1.12.1; migrate/3.3.2
    Unicode
    UTF-8 rendering:
    ΟΚ ✓
    Multibyte support:
    ΟΚ ✓
    Site character set
    UTF-8 ✓
    Ajax
    Endpoint:
    /wp-admin/admin-ajax.php
    JSON decoding:
    ΟΚ ✓
    Ajax test result:
    ΟΚ ✓
    Translation APIs
    DeepL Translator:
    No API key
    Google Translate:
    OK ✓
    Microsoft Translator:
    No API key
    Yandex.Translate:
    OK ✓
    Limits
    WP_MEMORY_LIMIT:
    40 MB
    WP_MAX_MEMORY_LIMIT:
    256 MB
    PHP memory_limit:
    256 MB (changeable)
    PHP post_max_size:
    260 MB
    PHP max_execution_time:
    30
    Filesystem
    Custom languages directory:
    wp-content/languages/loco
    Directory writable:
    No
    File mods disallowed:
    No
    File mod safety level:
    Warn
    Debug settings
    WP_DEBUG:
    Off
    WP_DEBUG_LOG:
    Off
    WP_DEBUG_DISPLAY:
    On
    PHP display_errors:
    Off
    PHP log_errors:
    On
    PHP error_log:
    error_log

    Thread Starter fresneda0405

    (@fresneda0405)

    Thread Starter fresneda0405

    (@fresneda0405)

    Uncaught (in promise) TypeError: this.engines is not iterable
    at E.updateSocialMedia (content.js:48)
    at new E (content.js:48)
    at Function.start (content.js:48)
    at Function.main (content.js:48)
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.
    translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es:1 Failed to load resource: net::ERR_FAILED
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
    translation.googleapis.com/language/translate/v2?source=en&target=es&format=text:1 Failed to load resource: net::ERR_FAILED
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
    translation.googleapis.com/language/translate/v2?source=en&target=es&format=text:1 Failed to load resource: net::ERR_FAILED
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.
    translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es:1 Failed to load resource: net::ERR_FAILED
    DevTools failed to load SourceMap: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/iframe_handler.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
    DevTools failed to load SourceMap: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.
    admin.js?ver=1.0.22:108 POST https://translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es net::ERR_FAILED
    XMLHttpRequest.send @ admin.js?ver=1.0.22:108
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    c._call @ admin.js?ver=2.5.0:183
    d.batch @ admin.js?ver=2.5.0:173
    c.translate @ admin.js?ver=2.5.0:183
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ admin.js?ver=2.5.0:14
    c @ jquery.min.js?ver=3.5.1:2
    fireWith @ jquery.min.js?ver=3.5.1:2
    l @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    load (async)
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    p @ admin.js?ver=2.5.0:13
    f.get @ admin.js?ver=2.5.0:16
    O @ editor.js?ver=2.5.0:1
    F @ editor.js?ver=2.5.0:1
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    u.fire @ admin.js?ver=2.5.0:118
    (anonymous) @ admin.js?ver=2.5.0:137
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
    admin.js?ver=1.0.22:108 POST https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text net::ERR_FAILED
    XMLHttpRequest.send @ admin.js?ver=1.0.22:108
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    c._call @ admin.js?ver=2.5.0:183
    d.batch @ admin.js?ver=2.5.0:175
    c.translate @ admin.js?ver=2.5.0:183
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ admin.js?ver=2.5.0:14
    c @ jquery.min.js?ver=3.5.1:2
    fireWith @ jquery.min.js?ver=3.5.1:2
    l @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    load (async)
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    p @ admin.js?ver=2.5.0:13
    f.get @ admin.js?ver=2.5.0:16
    O @ editor.js?ver=2.5.0:1
    F @ editor.js?ver=2.5.0:1
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    u.fire @ admin.js?ver=2.5.0:118
    (anonymous) @ admin.js?ver=2.5.0:137
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
    admin.js?ver=1.0.22:108 POST https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text net::ERR_FAILED
    XMLHttpRequest.send @ admin.js?ver=1.0.22:108
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    c._call @ admin.js?ver=2.5.0:183
    d.batch @ admin.js?ver=2.5.0:175
    c.translate @ admin.js?ver=2.5.0:183
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ admin.js?ver=2.5.0:14
    c @ jquery.min.js?ver=3.5.1:2
    fireWith @ jquery.min.js?ver=3.5.1:2
    l @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    load (async)
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    p @ admin.js?ver=2.5.0:13
    f.get @ admin.js?ver=2.5.0:16
    O @ editor.js?ver=2.5.0:1
    F @ editor.js?ver=2.5.0:1
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    u.fire @ admin.js?ver=2.5.0:118
    (anonymous) @ admin.js?ver=2.5.0:137
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.
    admin.js?ver=1.0.22:108 POST https://translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es net::ERR_FAILED
    XMLHttpRequest.send @ admin.js?ver=1.0.22:108
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    c._call @ admin.js?ver=2.5.0:183
    d.batch @ admin.js?ver=2.5.0:173
    c.translate @ admin.js?ver=2.5.0:183
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ admin.js?ver=2.5.0:14
    c @ jquery.min.js?ver=3.5.1:2
    fireWith @ jquery.min.js?ver=3.5.1:2
    l @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    load (async)
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    p @ admin.js?ver=2.5.0:13
    f.get @ admin.js?ver=2.5.0:16
    O @ editor.js?ver=2.5.0:1
    F @ editor.js?ver=2.5.0:1
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    u.fire @ admin.js?ver=2.5.0:118
    (anonymous) @ admin.js?ver=2.5.0:137
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
    admin.js?ver=1.0.22:108 POST https://translation.googleapis.com/language/translate/v2?source=en&target=es&format=text net::ERR_FAILED
    XMLHttpRequest.send @ admin.js?ver=1.0.22:108
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    c._call @ admin.js?ver=2.5.0:183
    d.batch @ admin.js?ver=2.5.0:175
    c.translate @ admin.js?ver=2.5.0:183
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ editor.js?ver=2.5.0:1
    (anonymous) @ admin.js?ver=2.5.0:14
    c @ jquery.min.js?ver=3.5.1:2
    fireWith @ jquery.min.js?ver=3.5.1:2
    l @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    load (async)
    send @ jquery.min.js?ver=3.5.1:2
    ajax @ jquery.min.js?ver=3.5.1:2
    s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
    p @ admin.js?ver=2.5.0:13
    f.get @ admin.js?ver=2.5.0:16
    O @ editor.js?ver=2.5.0:1
    F @ editor.js?ver=2.5.0:1
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    (anonymous) @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    each @ jquery.min.js?ver=3.5.1:2
    trigger @ jquery.min.js?ver=3.5.1:2
    u.fire @ admin.js?ver=2.5.0:118
    (anonymous) @ admin.js?ver=2.5.0:137
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    admin.php?path=themes%2Fbasel%2Flanguages%2Fes_ES.po&bundle=basel&domain=basel&page=loco-theme&action=file-edit:1 Access to XMLHttpRequest at ‘https://translate.yandex.net/api/v1.5/tr.json/translate?format=plain&lang=en-es’ from origin ‘https://afiliados.gobank.com.co’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.
    admin.js?ver=1.0.22:108

    Plugin Author Tim W

    (@timwhitlock)

    The reason is that your browser is sending a Preflighted request and it is being denied. Both Google and Yandex APIs support cross-domain requests with CORS headers, so I can’t explain this.

    I don’t get the same problem in either Chrome or Firefox. What browser are you using? Do you have any extensions installed that might change behaviour? Try disabling them or using another browser.

    I have no answer to why your origin is blocked and mine isn’t.

    One curious thing about your post is that the failure comes from admin.js?ver=1.0.22 What is this? It’s not Loco Translate’s admin script. What plugin do you have installed that is at version 1.0.22?

    Plugin Author Tim W

    (@timwhitlock)

    Just to clarify that last point. The Ajax failure (which uses jQuery) is occurring here:

    XMLHttpRequest.send @ admin.js?ver=1.0.22:108

    So there’s another file called admin.js (not my plugin) which is ultimately performing the send operation on line 108. Normally this would be done from within jquery.min.js but instead is being passed to something else. The question is what?

    Thread Starter fresneda0405

    (@fresneda0405)

    hello, I`m use a diferent browser (edge, chrome, and mozzilla) the same error, please i need traslate this web site

    helpme

    thanks

    Plugin Author Tim W

    (@timwhitlock)

    If you want to make progress on this issue please answer all the questions I have asked. I went into quite some detail on what I suspect might be related to the problem. This is me helping you, but you need to help me help you.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘failed api keys’ is closed to new replies.