• Resolved apearl

    (@apearl)


    Hi,
    I have a problem with Loco: when I click on “Add new language” or “Upload a PO file”, I receive a blank page and this error in the console “Uncaught ReferenceError: wp is not defined”.
    What could have happened?

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

    (@timwhitlock)

    I don’t think my plugin’s JavaScript references wp anywhere. Please show the full stack trace that appears in your console with this ReferenceError.

    Thread Starter apearl

    (@apearl)

    Hi @timwhitlock, thanks for your reply!

    We did some checks and in fact that error might not be the cause of our problem (this is the screen from the console -> https://i.postimg.cc/J41c0z1X/console.png).

    We consulted the FAQ, verified that there were no conflicts with other plugins: we cannot understand why it returns a blank page (this is a screen after we click on “Load a PO file”, but the situation is identical for “New language” -> https://i.postimg.cc/CKfbXZ43/Immagine-2023-11-27-090743.png)


    Plugin Author Tim W

    (@timwhitlock)

    You may be right about the JavaScript error not being the root cause of the missing page content, but I’d be concerned that you have some code running in your admin screens that produces an error like this.

    Your stack trace shows that the error is coming from inline scripts in the admin page. Clicking the error line 4436 will show you exactly where.

    Before you go any further with your diagnosis, I suggest you identify which plugin is referencing “wp” before it’s defined, and disable that plugin.

    You should also have a look at FAQ: Why do I get a blank page / blank response from server? Noting that actually the page is not blank, but partial.

    Thread Starter apearl

    (@apearl)

    So, we made some fixes but it didn’t solve much

    However, I noticed that, even if, as already shown, we have a partially empty page, in the console I see that there are elements of what I think is the content of the page (here is the screen -> https://i.postimg.cc/8zVvmt1Y/Immagine-2023-11-27-141746.png), is it possible?

    Plugin Author Tim W

    (@timwhitlock)

    Yes, looks like the elements are being hidden by another plugin’s CSS styles. My guess is a plugin that hides nag messages. As mentioned in the Content removal section of the FAQ. Do you have something like this installed?

    Thread Starter apearl

    (@apearl)

    We tried again to deactivate all plugins and we have also disabled some additional scripts: nothing changed

    We’re out of ideas =(

    Plugin Author Tim W

    (@timwhitlock)

    Use the inspector from your screenshots to establish what CSS rule is hiding the content*, then you’ll know what provides that CSS.

    Possibly your theme CSS? Switch to a stock theme.

    * not the selected element though. That is supposed to be hidden. Select the H2, check its computed styles to find what visibility rules it’s inheriting.

    Thread Starter apearl

    (@apearl)

    Hi @timwhitlock!

    We found the error ??

    For some reason there was a line of code that put notifications in “display:none !important”, and this compromised the loco tabs…

    Now we can use loco again and import the po files ??

    Thanks for your availability and help!

    Plugin Author Tim W

    (@timwhitlock)

    Great. Thanks for the update. This is effectively a nag blocker. Unfortunately Loco Translate uses the same CSS styles for its UI panels as the WordPress notices system. I will look at writing my own styles for these so I can rename the CSS classes.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Error in add new language’ is closed to new replies.