Site logo

Archived topic

Updates to latest theme version (3.0.3) or GP Premium (2.0.2) causes issues

15 replies · Started by Rachel on May 26, 2021

Viewing posts 1–15 of 16

Hello,

Sorry if this topic has already been covered. I updated the GP Premium from 1.12 to 2.0.2 and it causes my website to stop showing when I'm in edit mode (like top black admin bar preview of site, not talking about when left-handed customizer is on). When I click edit page on top bar, I get a critical error. Normally I would be using a page builder but that option no longer appears at the top black admin bar after update to GP.

When I disable the GP Premium plugins, I see my site again. I then tried to update the theme from 3.0.2 to 3.0.3 and it does the same thing.

The strange thing is, when I click customize: the website shows again.

I'd like to grab a previous version of the GP theme and GP Premium plugin first to rollback. Then try to resolve the issues above on a staging site. Would that be ok?

Hi Rachel,

That's quite strange. As I don't see this occur in any of my test sites.

Have you tried disabling all plugins except GP Premium to see if the issue stops occurring? Perhaps its a plugin conflict.

When I click edit page on top bar, I get a critical error. Normally I would be using a page builder but that option no longer appears at the top black admin bar after update to GP.

Can you share the error log?

Try our debugging check list here - https://docs.generatepress.com/article/debugging-tips/

Kindly share any findings (errors, etc) with us. Let us know.

I’d like to grab a previous version of the GP theme and GP Premium plugin first to rollback. Then try to resolve the issues above on a staging site. Would that be ok?

You can send us a mail requesting for an older version of GP Premium if you must. You can contact us through the contact page -https://generatepress.com/contact/

Hi Elvin,

Have you tried disabling all plugins except GP Premium to see if the issue stops occurring? Perhaps its a plugin conflict.

Yes, I disabled all plugins except GP Premium and still the same.

Can you share the error log?

I didn't get emailed anything (I'm admin level but I guess the email is suppose to go to the administration email: the website owner? They've not forwarded anything so I'll check with them).

Just tried a couple of points from the debug link that you mentioned. When I tried "4. Activate the core WordPress theme (TwentySeventeen) – does the issue still exist? If so, we know it’s not a GeneratePress specific issue." and I have GP Premium on: it shows a white screen instead of a grey one. When I turn GP Premium off, it shows the core WP theme normally.

Oh! I just deactivated all the GP Premium sections then re-activated them one by one. It seems that it is the "Elements" one that is triggering it. I've activated all others (except Site Library and WooCommerce since I don't use them) and have all other plugins activated - this shows the website fine now.

Further update: I went through the different elements and placed them in draft. It was a hook with Google Tag Manager script that is triggering the problem. Since un-publishing it cause it to go back to normal, would that be to root of the issue?

It's a hook that I put in wp_head for entire site with the Google Tag Manager script. How do I go about keeping it?

Further update: I went through the different elements and placed them in draft. It was a hook with Google Tag Manager script that is triggering the problem. Since un-publishing it cause it to go back to normal, would that be to root of the issue?

That's strange. Can you share the whole code of this hook element?

It’s a hook that I put in wp_head for entire site with the Google Tag Manager script. How do I go about keeping it?

You can try adding it back with Code Snippets plugin or a child theme's functions.php.

Try adding it using wp_head hook.

Example:

add_action('wp_head',function(){
echo '<script> your GTM script here. </script>';
});

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W99ZSMZ');</script>
<!-- End Google Tag Manager -->

That's all I have in the element hook.

Can you try re-adding it using my suggested method?

add_action('wp_head',function(){
echo '<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W99ZSMZ');</script>
<!-- End Google Tag Manager -->';
});

And see if the issue re-occurs?

Really strange - I tried to add it to the child's theme functions.php and I can see something is up with the GTA script (like it hasn't been closed properly). So of course I can't save the child theme's function.php file.

It's the same GTA script when I was using GP Premium 1.12 & theme 3.0.2. I'm asking website owner to grant me access to Google Console so I can check the script again. Should it not have also caused an issue with GP Premium 1.12 then...?

Hi there,

try using this function instead:

add_action('wp_head',function(){
    ?>
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-W99ZSMZ');</script>
    <!-- End Google Tag Manager -->
    <?php
});

Hi David,

Yes - this works! Should I should throw out the Element hook then?

You don't need both - so yep throw it out.

But before you do so - how have you added the GTM tag that goes in the wp_body_open hook?

Hey David,

Sorry for late reply! The GTM tag for the body I added to the child theme's function.php using your method but with add_action( 'generate_before_header',.

Great will throw out the element one.

Glad to hear that.

For reference you can use:

add_action( 'wp_body_open',

WP added the wp_body_open hook specifically for this kinda thing :)

I'm also trying to activate the GP premium on a new website. When I enter the license code and activate it, it shows an error.

This archived topic is closed to new replies.