I updated everything, upgraded PHP to 7.4, reduced it to 7.3, disabled all plugins, cleared cache, and still cannot edit my pages.
Site info in private message to follow.
I updated everything, upgraded PHP to 7.4, reduced it to 7.3, disabled all plugins, cleared cache, and still cannot edit my pages.
Site info in private message to follow.
Hello @jlswilton,
You might need to have the PHP memory limit of your site increased.
To do this, please edit your wp-config.php file and insert these lines:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
You can add it before the line
/*That's all, stop editing! Happy Blogging. */
Here is a details article about the PHP Memory Limit that is in our Knowledge Base:
Please also 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.
In case the issue persists, please try to get in touch with your hosting provider and confirm to them that your PHP memory limit is increased.
If you are still having an issue, please provide us with the admin details of your site in a Secure Note so that we can check this further.
I have tried all of these things. I deactivated all non-essential plugins (some will break my site if deactivated). I confirmed the php memory change on my server. I’d appreciate you taking a look, as I really need to make a change to one of my pages and am unable to do so. Will include credentials in a secure note.
Hi @jlswilton,
Thank you for the credentials, would you mind removing that custom function that is on your child theme’s functions.php
file, and see if that resolves the issue? You seem to have an identical issue as the user here.
Hope it helps,
Cheers!
That did fix the problem, but why did this come up? I’ve had that function there for a long time and have never encountered this issue. I removed it but now my speed is compromised.
Hello @jlswilton,
If that is the case, please put back your custom functions right after you have made all the necessary change in Cornerstone. And if there is a need to edit the page in Cornerstone again, you will need to temporarily remove the custom PHP function again and put it back thereafter.
Hope this makes sense.
I understand, but I’d like to know why this is suddenly an issue. It’s really quite a pain to do this every time I have a small edit and it was not like this before. Is this something that is actively being addressed in bug fixes?
Hello @jlswilton,
Are you also using the same PHP code?
if (!(is_admin() )) {
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
if ( strpos( $url, 'x-head.min.js' ) ) return $url;
return "$url' defer='defer";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
}
If you are not using this, can you please provide us your custom PHP function so that we can analyze and investigate why it is causing an issue when added in your child theme’s functions.php?
Thank you in advance.
This is what I was using. It appears to be the same as what you posted:
if (!(is_admin() )) {
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, ‘.js’ ) ) return $url;
if ( strpos( $url, ‘jquery.js’ ) ) return $url;
if ( strpos( $url, ‘x-head.min.js’ ) ) return $url;
return “$url’ defer='defer”;
}
add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );
}
Hey @jlswilton,
I’ve taken a quick look at this, and I suspect the problem is the is_admin
condition no longer applies to Cornerstone because that is not entirely correct so our development team did some optimization regarding this. That means that scripts are being deferred even in Cornerstone and that causes loading issues. Try using did_action( 'cs_before_preview_frame')
instead. Also, the conditions should be inside the function. Even if your code worked before, it’s not a best practice. You’re code structure should look like the following code which I’ve actually tested to output in the frontend but not in Cornerstone.
function test() {
if (!(did_action( 'cs_before_preview_frame'))) {
echo 'testing';
}
}
Please just note though that fixing custom code is outside of theme support, as the problem is not with the theme but rather, your customization or optimization of it. We’re sorry if Runel offered to investigate your custom code.
I’ve given the above as guidance because it was not an extensive problem to figure out, but if you’re still having issues with the custom script beyond this, we won’t be able to assist further and you’ll need to consult a developer.
Thank you for understanding.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.