rpodsada
Forum Replies Created
-
Forum: Plugins
In reply to: [Classic Editor] Changes you made may not be saved.I’m also getting this on every editor page (with TinyMCE on it) in 5.6.1. Started happening only after the update to 5.6.1. If I enter any page with TinyMCE on it, it prompts me if I want to leave when I click into something else, regardless if I edited anything anywhere or not.
Forum: Plugins
In reply to: [a3 Lazy Load] Cumulative Layout ShiftIf the lazy loader displays nothing in place of an image before it’s in the viewport, then this would trigger the CLS test to register as a shift on the page. For example, a carousel banner on the homepage. Upon first load, the banner isn’t rendered at all (content is bumped up to menu.) Of course, right away the plugin detects that the images in the banner are in the viewport, so its check triggers the images to load via ajax. This would register as a layout shift, e.g. the position or size of elements / height of the page changes during the page load or while you are browsing the page.
If this is the case, then the solution would be for the lazy loader to display placeholder images of some sort in place of the original image being lazy-loaded. These images would be at the final output size of the image, so keep the layout constant. Problem is, this would have to happen prior to the page load, so it would have to be augmented server-side, or cached in advance in some way, so upon first load of the content, the images are ‘there’ and taking up the correct amount of space.
If the page loads initially with no images, and the placeholders are added after with an AJAX call, the CLS will still register…
@mvaneijgen You can run this using wp-cli. The eval command it lets you execute PHP code. e.g. Run this from the command line of the root WordPress install folder:
wp-cli eval 'AAM_Core_API::clearCache();'
The PHP code would also work from any script that has wp-load.php loaded as well, so any file inside of your theme, or your own script which includes wp-load before running this code.
That being said, it’s probably not a good idea to put it into functions.php or another theme file, though. Even though it would run, it would clear the cache on each page load, slowing down your site and eliminating any benefits the AAM cache would provide.
Update: Found a fix for this with 5.6: Go into Settings and Clear Cache. The error seems to be some kind of memory runaway with the cache after the upgrade. Maybe the upgrade process should clear the cache automatically on each upgrade?
Just confirming the issue is fixed on all sites this problem was appearing on before. Looks like you got it. Thanks again!
Wow that was fast. Thank you kindly. You rock!
Forum: Plugins
In reply to: [Top 10 - WordPress Popular posts by WebberZone] Fatal errorI’m getting this error too. In PHP < 5.6 (I think), the empty() function only accepts variables and not returns from another function.
So what you need to do is change line 107 from:
$tptn_settings[‘exclude_post_ids’] = empty( sanitize_text_field( $_POST[‘exclude_post_ids’] ) ) ? ” : implode( ‘,’, array_map( ‘absint’, explode( ‘,’, sanitize_text_field( wp_unslash( $_POST[‘exclude_post_ids’] ) ) ) ) );
… to:
$exclude_post_ids_value = sanitize_text_field( $_POST[‘exclude_post_ids’] );
$tptn_settings[‘exclude_post_ids’] = empty( $exclude_post_ids_value ) ? ” : implode( ‘,’, array_map( ‘absint’, explode( ‘,’, sanitize_text_field( wp_unslash( $_POST[‘exclude_post_ids’] ) ) ) ) );
Basically put the result of sanitize_text_field( $_POST[‘exclude_post_ids’] ) into a variable before you put it through empty().
This might not be an issue on later versions of PHP, but will likely be required for backwards compatibility.