Portfolio not working after update

Hello,

I have recently updated x-theme and cornerstone to the most recent version. This has caused my portfolio page and my essential grids not appear on the front end of the website when I am not logged in as an admin. The error I receive says something regarding jQuery not being a valid function. I have reverted my website to the older theme in the meantime, but I just wanted to bring this to your attention and see if this is something common for other users.

Thanks

Hi @michigancreative,

Thank you for reaching out to us. The error you mentioned indicates that there is a third party plugin or a script conflict. You can first try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

If the problem persists then please perform the following troubleshooting steps:

  1. CHILD THEME
  2. CSS/JS CUSTOMIZATION
  3. DISABLING CACHE
  4. DISABLING CDN
  5. VERSION COMPATIBILITY

Let us know how it goes!

@nabeel

Thanks for your reply. I have gone through the troubleshooting steps and I found out that it was related to a customization of my child theme.

The code that I had to remove was related to deferring the parsing of javascript. Is there a way I can continue to defer the parsing of javascript but retaining the functionality of the essential grid plugin on those pages? Below was my customization that caused the error:

// defer parsing of javascript
function defer_parsing_of_js( $url ) {
    if ( is_user_logged_in() ) return $url; //don't break WP Admin
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    if ( strpos( $url, 'jquery.js' ) ) return $url;
    return str_replace( ' src', ' defer src', $url );
}
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );

Now I am experiencing a different issue.

I am unable to get the cornerstone visual editor to properly load. The panel on the left loads just fine, but the iframe gives me this error [picture in secured note]

Additionally, the same error occurs when navigating to “theme editor” and appears to be an issue with the live view of the website only as I can save and make updates, just not see the page load on the right.

I have disabled plugins, checked theme customization by disabling the child theme, checked my server memory limits, error logs, etc… Any idea what might be causing this?

Hi @michigancreative,

The most common reason behind the issue you are having is the plugin conflict, I would suggest you troubleshoot the steps described in the Plugin Conflict article. If that does not help, please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hey @tristup,

I have tried to troubleshoot the plugins with no success. I suspected it was the W3 Total Cache plugin, but the problem persisted even when I purged cache, removed the plugin, and even removed caching via cloudflare and disabled rocket loading.

I will attach the login via the secure note.

Thanks!

Hi @michigancreative,

A few hours ago we have released another version of the theme with some fixes, I would recommend you to update your theme to the latest one.
I would also suggest you follow the below steps while updating to the latest version of the theme.

  1. Delete the Cornerstone
  2. Update the X theme to the latest version on automatic updates
  3. After the X theme is updated, use the link in the dashboard to automatically install the Cornerstone. It will be at the latest version

If that does not help and you are still getting the issue, please copy your live site to a staging server so we could troubleshoot freely without breaking your live site.
And give us access in the secure note including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Alrighty, I have deleted cornerstone, updated x-theme and reinstalled cornerstone from the link at the top, and am still having the same issue. I have copied the website and created a staging site for you guys to take a look at. Attached is the information.

Hello @michigancreative,

I have logged in and experienced the same error. In the console, it is showing an error 524:

POST https://wp.michigancreative.com/about/ 524

Please check out this article: https://www.raramuridesign.com/kb/articles/error-524-a-timeout-occurred-what-it-is-how-to-fix-it.html

Right after your updates, please log in to your Cloudflare account and purge your site cache. You also need to regenerate the minified CSS and JS files in Cloudflare.

Best Regards.

Hey @ruenel,

I am kind of unsure what you are asking me to change. I am able to view this page just fine without receiving any error. It’s only when I am attempting to load cornerstone does the live view of the page not appear.

I have logged into cloudflare, and purged all my cache which should have regenerated any minified files. I have also logged into my hosting environment and upped my php memory limit, max execution time, max input time, and max input vars.

Any other suggestions? Should I reach out to my hosting provider? Which is odd because I have several other websites on this same server that are using X-Theme that are working without any problems.

Thanks

@ruenel

I am having my hosting company look into this and they noticed this php error:

[08-Jan-2021 13:45:59 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/[user]/public_html/dev02/wp/wp-content/plugins/cornerstone/includes/classes/common/class-locator.php:1) in /home/[user]/public_html/dev02/wp/wp-includes/rest-api.php on line 678

Hey @michigancreative,

This is a problem with your web host according to Cloudflare’s description of the 524 error.

I believe you’re in a shared hosting environment so the site having an issue could not operate Cornerstone anymore.

Please contact your web host to increase all timeouts on your site or you can become a Cloudflare Enterprise client so you can increase the 524 timeout as indicated in the screenshot.

Also, would you also mind temporarily disconnecting Cloudflare from your site altogether and check if the issue will still persist? This might point out to a deeper web hosting issue especially connected to the warning your web host showed you. Though that points out to a Cornerstone file, it’s a web hosting issue. Your web host should support the WordPress Rest API as we now use that in Cornerstone.

Thanks.

@christian

I will touch base with my hosting provider to check on this.

I have paused cloudflare and the problem still persists , I also checked the status of our rest API and it appears to be enabled and supported. Please see the url in my private notes for proof that it’s active

Hey @christian

I have increased the max_execution time of our server to 120s and the max_input_time to 300s and the page finally loaded after some time. I am currently trying to sort out with my host why it is taking so long to load this.

Thanks!

Hi @michigancreative,

Great, it is resolved for now. Please let us know if you need any further help on this.

Thanks

@tristup

It’s “kind of” fixed. Meaning that the page will load sometimes, if it doesn’t timeout entirely. I have had my hosting provider look at the server logs and errors, and they say that the requests are not overloading the server at all, and they notice no errors in PHP or apache regarding this.

What is causing this to take forever to load? I have this theme on several other websites that we host on the same dedicated server, but this is the only one with an issue despite this account having nearly 1gb of memory allocated.

Thanks

Additionally, I have tried to make some other changes to help with this load time, including clearing all the junk from the database to rule that out.

Hi @michigancreative,

Please let us know how it works for you and also inform us if the issue still exists.

Thanks

The issue is still persisting, I have had our hosting provider look into the issue for the last several days. They tell me the server resources are fine, nothing is being overloaded and they aren’t seeing any errors. They suggest that it’s an issue with the theme or plugins. They do mention this specific error that they noticed, maybe this will help determine what is happening:

[12-Jan-2021 10:54:33 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/[user]/public_html/dev02/wp-content/plugins/cornerstone/includes/classes/common/class-locator.php:1) in /home/[user]/public_html/dev02/wp-includes/rest-api.php on line 678

Hey @michigancreative,

You’re still using CloudFlare on your site. I previously have asked to

You need to disconnect Cloudflare and not just pause it. I’m asking this to confirm if the issue is connected to Cloudflare. We can’t help further if you can’t do this.

In Cloudflare, please also ask the support to exclude the x directory and all subdirectories like x/content/11 from being included in the Cloudflare optimizations.

Thanks.