Charbel Nemnom
Forum Replies Created
-
Forum: Plugins
In reply to: [Redis Object Cache] I Can’t enable Object Cache: Drop-in not installedI deleted the object-cache.php file and then enable Object Cache, the Drop-in was enabled for a minute and then turned off.
I have the Performance plugin installed by WordPress. Please see the new Diagnostics message below.
Status: Drop-in is invalid
Client:
Drop-in: Invalid
Disabled: No
PhpRedis: Not loaded
Relay: Not loaded
Predis: 2.0.3
Credis: Not loaded
PHP Version: 7.4.13
Plugin Version: 2.2.3
Redis Version: Unknown
Multisite: No
Metrics: Disabled
Metrics recorded: 0
Filesystem: Working
WP_REDIS_PLUGIN_PATH: “/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/redis-cache”
Drop-ins: [
“Performance Lab Server Timing Object Cache Drop-In v1 by WordPress Performance Team”
]Please find a copy of my current object-cache.php file: What should be changed?
<?php
/**- Plugin Name: Performance Lab Server Timing Object Cache Drop-In
- Plugin URI: https://github.com/WordPress/performance
- Description: Performance Lab drop-in to register Server-Timing metrics early. This is not a real object cache drop-in and will not override other actual object cache drop-ins.
- Version: 1
- Author: WordPress Performance Team
- Author URI: https://make.www.ads-software.com/performance/
- License: GPLv2 or later
- License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* - Object cache drop-in from Performance Lab plugin.
* - This drop-in is used, admittedly as a hack, to be able to measure server
- timings in WordPress as early as possible. Once a plugin is loaded, it is
- too late to capture several critical events.
* - This file respects any real object cache implementation the site may already
- be using, and it is implemented in a way that there is no risk for breakage.
* - If you do not want the Performance Lab plugin to place this file and thus be
- limited to server timings only from after plugins are loaded, you can remove
- this file and set the following constant (e.g. in wp-config.php):
* - define( ‘PERFLAB_DISABLE_OBJECT_CACHE_DROPIN’, true );
* - @package performance-lab
- @since 1.8.0
*/
// Set constant to be able to later check for whether this file was loaded.
define( ‘PERFLAB_OBJECT_CACHE_DROPIN_VERSION’, 1 );/**
- Loads the Performance Lab Server-Timing API if available.
* - This function will short-circuit if the constant
- ‘PERFLAB_DISABLE_OBJECT_CACHE_DROPIN’ is set as true.
* - @since 1.8.0
*/
function perflab_load_server_timing_api_from_dropin() {
if ( defined( ‘PERFLAB_DISABLE_OBJECT_CACHE_DROPIN’ ) && PERFLAB_DISABLE_OBJECT_CACHE_DROPIN ) {
return;
} $plugins_dir = defined( ‘WP_PLUGIN_DIR’ ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . ‘/plugins’;
$plugin_dir = $plugins_dir . ‘/performance-lab/’;
if ( ! file_exists( $plugin_dir . ‘server-timing/load.php’ ) ) {
$plugin_dir = $plugins_dir . ‘/performance/’;
if ( ! file_exists( $plugin_dir . ‘server-timing/load.php’ ) ) {
return;
}
} require_once $plugin_dir . ‘server-timing/class-perflab-server-timing-metric.php’;
require_once $plugin_dir . ‘server-timing/class-perflab-server-timing.php’;
require_once $plugin_dir . ‘server-timing/load.php’;
require_once $plugin_dir . ‘server-timing/defaults.php’;
}
perflab_load_server_timing_api_from_dropin();
// Load the original object cache drop-in if present.
if ( file_exists( WP_CONTENT_DIR . ‘/object-cache-plst-orig.php’ ) ) {
require_once WP_CONTENT_DIR . ‘/object-cache-plst-orig.php’;
}Forum: Plugins
In reply to: [Redis Object Cache] I Can’t enable Object Cache: Drop-in not installedHello @robin,
Do we have any update on this, please?
What is the correct filter that I can use to change the scriptlesssocialsharing__heading from h3 to h2, please?
Thank You!
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatThank you @jamesosborne,
Yes, I will use this workaround in RankMath for now.
It was not working for me at the beginning because it was not saving due to the firewall blocking it as described here:
https://rankmath.com/kb/meta-data-not-saving/#firewallPlease note that I have removed the filter that you shared and deselected Generate JPEG files in addition to WebP.
So, all is set for now.
Many Thanks!
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatThank you @jamesosborne,
Yes, this answers my query. I can find them in the hosting file manager.
But my only concern is the size of keeping both JPEG/WEBP. My server will start to grow over time.
I would rather prefer not to keep JPEG for my Content Images inside the article and Keep only WEBP.My Featured image only should be in JPEG.
How this can be solved?
Thanks again!
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatThank you @jamesosborne, now it’s clear.
I added the filter back to my functions.php.
Now my Featured Image is JPEG in myOG:Image
, my Front End, as well as my Media Library.I added another JPEG image to the content of the article. The image was uploaded as JPEG, however, the Front End image is getting converted to webp as expected. So, this is good.
Now my question is, I don’t see the webp version in my Media library besides JPEG.
Where the webp images are saved for my content images within the article?
In other words, are we storing both the webp and the jpg versions of the images that I added to the content of the articles? I am not talking about Featured Images.Thank You!
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatThank you @jamesosborne,
Ok, we solved the issue but we created another one by storing both the webp and the jpg versions of my images.
I remember that we did not have this issue with Performance Lab version 1.5.0.
We need to create/use webp for the images inside the article (the content) except for the Featured Image.
I am getting confused here. Do I still need to use the filter? Because as I mentioned, without the filter, the jpg that I upload to my Featured Image, it’s used correctly as my Featured Image, and my Front End is WebP and not JPEG. So, I don’t think that I need the filter here.
I am concerned with point 1 of having to store both the webp and the jpg versions of all my images (Featured Images, as well as my Content images for all articles moving forward).
Could you please clarify?
Many Thanks!
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatThank you @jamesosborne, much appreciated!
Finally, the issue is resolved now for my Featured Images.
This new option was added recently to Performance Lab version 1.6.0.Generate JPEG files in addition to WebP Enabling JPEG in addition to WebP can improve compatibility, but will effectively double the filesystem storage use of your images.
I have follow-up two questions, please:
With this option enabled, now all my images will be created twice (JPEG + WebP), thus as noted in the settings, it will take double storage.???
I need to keep using WebP only for my Content within the article/post except for the Featured Image.
My next question is, why do I still need to keep the filter active in my functions.php?
What does this filter do actually?I tried without the filter and it works also, but the difference is, my Front End Featured Image remains webp, but my Feature Image is JPEG, thus RankMath used the current
OG:Image
from the Media library for that particular post.Check this post: https://charbelnemnom.com/setup-a-cloud-environment-in-google-cloud/
TheOG:Image
is set correctly now in JPEG after I deleted and uploaded a new Featured Image.<meta property="og:image" content="https://charbelnemnom.com/wp-content/uploads/2022/11/Setup_Configure_Cloud_Environment_In_Google_Cloud_12.jpg" />
but the Front End is seeing it as WebP as you can see in the screenshot below. This option is without the Filter that you shared, if I set the filter, then the
OG:Image
, as well as the Front End Featured Image will be in JPEG.
Could you please advise?
Many Thanks!
- This reply was modified 2 years, 4 months ago by Charbel Nemnom.
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatHello @jamesosborne,
Thanks for the update!
Yes, and because Performance Lab has converted my Featured Image to webp in my Media Library, thus RankMath was not able to pick it as a valid Featured Image, then RankMath selected my default OpenGraph Thumbnail which is the same jpg that I shared previously.
Please watch the video below and see the difference between, why my previous posts were working and why after October 20, the issue started to happen.
https://i.rankmath.com/v/6tMbD2
I know that the Performance Lab plugin doesn’t provide any Open Graph metadata functionality, but the issue is that the plugin converted the Featured Image to webp.
RankMath does not support webp as of today.In Performance Lab version 1.6.0 here: https://github.com/WordPress/performance/pull/527
They have added the following feature: Generate only WebP images by default for JPEG and WebP uploads.
I believe this is the issue that I am facing.Waiting for your feedback. Many Thanks!
-Charbel
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatHello @jamesosborne, thanks for the update.
Please find below the reply from RankMath.
I believe after the last Performance Lab update to version 1.6.0 (3 weeks ago), the issue started to happen on my site.https://github.com/WordPress/performance/pull/527
1.6.0 Enhancements Site Health: Only load Site Health checks for persistent cache and full page cache when not available in core. (543) Images: Add checkbox to Settings > Media to control whether to generate JPEG in addition to WebP. (537) Images: Generate only WebP images by default for JPEG and WebP uploads. (527) Infrastructure: Bump minimum WordPress requirement to 6.0. (549)
Rank Math Update:
\\
I can check that for the posts that have the correctOG:image
, if you edit them and check the featured image in the editor, the image is in JPG format even if it is getting converted to WebP in the front end. Since the image is being saved in the postmeta table as the JPG image, our plugin is able to add it as the OG image.But if you check the posts that have the default thumbnail, the featured image is in the WebP format in the media library and that’s why they are not getting picked up as the OG image. Here is a quick screencast: https://i.rankmath.com/v/6tMbD2
So it will work fine if the image is saved in JPG format in the media library even if they are getting converted in the front end but it will not work if the image originally has the WebP format.
We are soon going to improve the OpenGraph tags and add support for the WebP images, but we currently don’t have an ETA for that.
For now, you will have to make sure that the featured image has the JPG format, at least in the media library to use it as the OG image.
//How can we fix this, please?
Your help is highly appreciated.
Thank You @jamesosborne!!!
- This reply was modified 2 years, 4 months ago by Charbel Nemnom.
- This reply was modified 2 years, 4 months ago by Charbel Nemnom.
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatMany Thanks, @jamesosborne for the great analysis as usual, much appreciated!
This issue is really annoying and we are not able to find the root cause for this.
I will share with Rank Math this analysis and see if they can identify the issue.
Looking forward to hearing back from you once you investigate the filter you provided.
Thank You!
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatHello @jamesosborne,
Please I need to come back to this issue.
As I’ve noted about RankMath. They checked my site and here is the confirmation.
//
I can check that the featured image of the post is in WebP format. The Open Graph only supports image/jpeg, image/gif, or image/png.You can also check this link for the standard image file extensions supported by Open Graph:
https://developers.facebook.com/docs/sharing/webmasters/#images
Please use the supported format to fix the issue.
\\Please I need to exclude the Featured Image from WebP format.
The filter below is not working.remove_filter( 'post_thumbnail_html', 'webp_uploads_update_featured_image', 10 );
Please watch this video. You can see that the Featured Image in the Front End for both posts is WEBP, however, in the Editor mode, you can see the article which has the
OG:IMAGE
set incorrectly, the Featured Image is in WEBP and not JPEG.
Why Performance Lab is setting WEBP for the Featured Image exclusively.Your help is highly appreciated.
Thank You!
- This reply was modified 2 years, 4 months ago by Charbel Nemnom.
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatHello @jamesosborne,
Thank you for the analysis again, much appreciated!
It looks like the issue started to happen after October 19, 2022.
Example: After October 19, 2022:
https://charbelnemnom.com/delete-microsoft-sentinel-analytics-rule/And Before October 19, 2022, the OG:image is set to my Featured Image correctly. Check this:
https://charbelnemnom.com/backup-and-restore-microsoft-sentinel-watchlists/I found out that RankMath did an update on October 21 which might be the issue of this case. I am in contact with them.
In all cases, I removed the filter that you shared with me from my functions.php.
Thank you again!
Forum: Plugins
In reply to: [Performance Lab] How to Exclude Featured Image from .Webp FormatHello @jamesosborne,
Thanks for the analysis, much appreciated!
Please note that the OpenGraph Thumbnail in RankMath will be only used when a featured image or an OpenGraph Image is not set for individual posts/pages/CPTs, this image will be used as a fallback thumbnail when the post is shared on Facebook.
However, this is not the case. I have a featured image selected/set for my post as you can see here before the Post Title: https://charbelnemnom.com/delete-microsoft-sentinel-analytics-rule/
The OG Image URL you shared below is to be used as a fallback thumbnail only.
I am not sure why the featured image differs from the OG:Image data when you checked the source code. This is weird, how can we debug this?<meta property="og:image" content="https://charbelnemnom.com/wp-content/uploads/2021/06/CN_NewHeader_OG_2021_1200x630_v1.jpg">
Here is the setting in RankMath global settings:
I always have the Featured Image to be used as OG:Image by default, yes, I noticed that I can configure it independently by single post in RankMath if needed. However, I tried this option and it didn’t work. It’s always falling back to the one that I set in Rank Math under DASHBOARD / SEO TITLES & META.
The issue is about .webp with Facebook and LinkedIn.
As noted by RankMath, Facebook currently supports only jpeg, png, and gif image formats. So if you’re trying to add an image of .webp or any other format, then Facebook and similar social media platforms might not be able to recognize them.
That’s why in my case, it falls back to the OG Image that I set in RankMath here:
How can we solve this issue, please?
In regards to the filter, I did not create a new post after applying the filter.
remove_filter( 'post_thumbnail_html', 'webp_uploads_update_featured_image', 10 );
What I have done, is I removed and deleted permanently the featured image for that post and then uploaded a new JPG image with a different file name.
So, it’s the same post here and not a new one: https://charbelnemnom.com/delete-microsoft-sentinel-analytics-rule/I need to solve the existing post (Featured Image) so I can share it on Facebook/LinkedIn.
Your help is highly appreciated.
Many Thanks @jamesosborne
- This reply was modified 2 years, 4 months ago by Charbel Nemnom.