Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gravatar image not updating. Child Theme with "Cache Buster" necessary for updating #4357

Open
mattyjoomla opened this issue Jan 21, 2025 · 0 comments
Labels
bug This label could be used to identify issues that are caused by a defect in the product.

Comments

@mattyjoomla
Copy link

Description

Hi all, my nickname is mattyjoomla but meanwhile I am working wiht WordPress, too.
My website is currently under development. It is online but not indexed for search engines yet.
I love the Neve theme but yesterday I encountered an issue I could so far only solve with a child theme cache busting.

My updated gravatar image was immediately updated on all internal - backend - WP functions. Especially the "Comments" showed the correct image.
But it would not update on the frondend - blog - pages.

I carefully deleted all caches (CDN and LiteSpeed, browser cache) and used different browsers but nothing helped.

I did not find anything related in the database.

Changing the theme to the standard "Twenty twenty four" did update the gravatar image.

To solve this, I decided to create a Neve child theme and add the following code to the functions.php:

function force_gravatar_reload($url) {
if (strpos($url, 'gravatar.com') !== false) {
$url = preg_replace('/([?&]d=[^&]+)/', '', $url);
$url = preg_replace('/([?&]ver=[^&]+)/', '', $url);
$url .= (strpos($url, '?') === false ? '?' : '&');
$url .= 'ver=' . time();
}
return $url;
}
add_filter('get_avatar_url', 'force_gravatar_reload', 10, 1);

This does load the correct gravatar image, but:
I have to leave the code active. As soon as I "uncomment", the old image is displayed.

I thus think that Gravatar image caching is too aggressive in the theme.

Step-by-step reproduction instructions

Please see description.

Screenshots, screen recording, code snippet or Help Scout ticket

Code snippet to solve the issue:

function force_gravatar_reload($url) {
if (strpos($url, 'gravatar.com') !== false) {
$url = preg_replace('/([?&]d=[^&]+)/', '', $url);
$url = preg_replace('/([?&]ver=[^&]+)/', '', $url);
$url .= (strpos($url, '?') === false ? '?' : '&');
$url .= 'ver=' . time();
}
return $url;
}
add_filter('get_avatar_url', 'force_gravatar_reload', 10, 1);

Environment info

### wp-core ### version: 6.7.1 site_language: en_US user_language: en_US timezone: Europe/Berlin permalink: /%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 0 default_comment_status: open environment_type: production user_count: 1 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /home/u568735133/domains/innerworldwisdom.com/public_html wordpress_size: 5.45 GB (5846658172 bytes) uploads_path: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/uploads uploads_size: 48.70 MB (51067184 bytes) themes_path: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/themes themes_size: 13.16 MB (13803815 bytes) plugins_path: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/plugins plugins_size: 294.51 MB (308820217 bytes) fonts_path: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/uploads/fonts fonts_size: directory not found database_size: 39.86 MB (41795584 bytes) total_size: 5.83 GB (6262144972 bytes) ### wp-dropins (1) ### object-cache.php: true ### wp-active-theme ### name: Neve Child (neve-child) version: 1.0 author: Matthias Kleespies author_website: https://innerworldwisdom.com parent_theme: Neve (neve) theme_features: core-block-patterns, hfg_support, widgets-block-editor, align-wide, automatic-feed-links, border, custom-background, custom-logo, custom-spacing, custom-units, customize-selective-refresh-widgets, editor-color-palette, fl-theme-builder-footers, fl-theme-builder-headers, fl-theme-builder-parts, header-footer-elementor, html5, lifterlms-sidebars, lifterlms, link-color, post-thumbnails, service_worker, starter-content, title-tag, menus, widgets theme_path: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/themes/neve-child ### wp-parent-theme ### name: Neve (neve) version: 3.8.16 author: ThemeIsle author_website: https://themeisle.com theme_path: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/themes/neve ### wp-themes-inactive (1) ### Twenty Twenty-Four: version: 1.3, author: the WordPress team ### wp-mu-plugins (3) ### Admin Tools for WordPress: version: 1.6.7, author: Akeeba Ltd akeeba-backup-coreupdate.php: author: (undefined), version: (undefined) Hostinger Smart Auto Updates: version: 1.0.5, author: Hostinger ### wp-plugins-active (32) ### Admin and Site Enhancements (ASE): version: 7.6.7.1, author: wpase.com Admin Tools Core for WordPress: version: 1.6.7, author: Akeeba Ltd Advanced Database Cleaner: version: 3.1.5, author: Younes JFR. AIOSEO - IndexNow: version: 1.0.12, author: All in One SEO Team Akeeba Backup CORE for WordPress: version: 8.3.0, author: Akeeba Ltd All in One SEO: version: 4.7.8, author: All in One SEO Team All in One SEO Pro: version: 4.7.8, author: All in One SEO Team Antispam Bee: version: 2.11.7, author: pluginkollektiv Broken Link Checker by AIOSEO: version: 1.2.3, author: All in One SEO Team Code Snippets: version: 3.6.6.1, author: Code Snippets Pro DACH Impressum Hider: version: 3.6, author: Matthias Kleespies Downloadmanager für WPForms: version: 3.6, author: Matthias Kleespies Downloadmanager Statistik: version: 1.9, author: Matthias Kleespies Head, Footer and Post Injections: version: 3.3.0, author: Stefano Lissa Hostinger AI: version: 2.0.28, author: Hostinger Hostinger Easy Onboarding: version: 2.0.54, author: Hostinger Hostinger Tools: version: 3.0.22, author: Hostinger IP2Location Country Blocker: version: 2.38.7, author: IP2Location Ivory Search: version: 5.5.8, author: Ivory Search Kontaktformular Spam Blocker: version: 2.0, author: Matthias Kleespies LiteSpeed Cache: version: 6.5.4, author: LiteSpeed Technologies Maintenance: version: 4.16, author: WebFactory Ltd MaxMind GeoIP Daten Scheduler: version: 1.8, author: Matthias Kleespies Neve Link Modifier: version: 2.1, author: Matthias Kleespies Otter – Page Builder Blocks & Extensions for Gutenberg: version: 3.0.9, author: ThemeIsle Real Cookie Banner (Free): version: 5.0.7, author: devowl.io To Top: version: 2.5.4, author: Catch Plugins Wordfence Security: version: 8.0.3, author: Wordfence WP Activity Log: version: 5.2.2, author: Melapress WPForms: version: 1.9.3.1, author: WPForms WP Mail SMTP: version: 4.3.0, author: WP Mail SMTP WPS Hide Login: version: 1.9.17.1, author: WPServeur, NicolasKulka, wpformation ### wp-plugins-inactive (5) ### Google Analytics for WordPress by MonsterInsights: version: 9.2.4, author: MonsterInsights OptinMonster: version: 2.16.13, author: OptinMonster Popup Builder Team Query Monitor: version: 3.17.0, author: John Blackbourn Site Kit by Google: version: 1.144.0, author: Google WP Crontrol: version: 1.18.0, author: John Blackbourn ### code-snippets (2) ### snippet-1: name: Footer Copyright, scope: global, modified: 2025-01-18 08:33:50 snippet-6: name: Affiliate Hinweis iOS, scope: global, modified: 2025-01-19 08:32:56 ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1809 imagemagick_version: ImageMagick 7.1.1-19 Q16-HDRI x86_64 21601 https://imagemagick.org imagick_version: 3.7.0 file_uploads: 1 post_max_size: 2048M upload_max_filesize: 2048M max_effective_size: 2 GB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 2 TB imagick::RESOURCETYPE_DISK: 9.2233720368548E+18 imagick::RESOURCETYPE_FILE: 393216 imagick::RESOURCETYPE_MAP: 1,006 GB imagick::RESOURCETYPE_MEMORY: 503 GB imagick::RESOURCETYPE_THREAD: 1 imagick::RESOURCETYPE_TIME: 9.2233720368548E+18 imagemagick_file_formats: 3FR, 3G2, 3GP, A, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, B, BAYER, BAYERA, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MPO, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, O, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, R, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YAML, YCbCr, YCbCrA, YUV gd_version: 2.3.3 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: unknown ### wp-server ### server_architecture: Linux 5.14.0-427.22.1.el9_4.x86_64 x86_64 httpd_software: LiteSpeed php_version: 8.2.18 64bit php_sapi: litespeed max_input_variables: 5000 time_limit: 360 memory_limit: 2048M max_input_time: 360 upload_max_filesize: 2048M php_post_max_size: 2048M curl_version: 7.76.1 OpenSSL/3.0.7 suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: true current: 2025-01-21T09:41:35+00:00 utc-time: Tuesday, 21-Jan-25 09:41:35 UTC server-time: 2025-01-21T10:41:34+01:00 ### wp-database ### extension: mysqli server_version: 10.11.10-MariaDB client_version: mysqlnd 8.2.18 max_allowed_packet: 1073741824 max_connections: 2000 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content WP_PLUGIN_DIR: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 2048M WP_DEBUG: false WP_DEBUG_DISPLAY: false WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: true CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: undefined WP_DEVELOPMENT_MODE: undefined DB_CHARSET: utf8 DB_COLLATE: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable fonts: not writable mu-plugins: writable ### aioseo (1) ### noindexed: Author Archives, Search Page ### neve ### api: Yes child: /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/themes/neve-child/functions.php, /home/u568735133/domains/innerworldwisdom.com/public_html/wp-content/themes/neve-child/style.css customizer_css: /* Generelle Einstellungen */ h1 { color: #2511F0; } h2, h3, h4, h5, h6 { color: black; } p { font-size: 20px !important; } .nv-page-title h1 { text-align: center !important; } .site-footer { font-size: 16px !important; } /* h1 und h2 für Mobil anpassen */ @media (max-width: 767px) and (orientation: portrait) { h1 { font-size: 27px; } h2 { font-size: 23px; } } @media (min-width: 768px) and (max-width: 950px) and (orientation: portrait) { h1 { font-size: 30px !important; } h2 { font-size: 25px; } } /* Listendarstellung für Mobil anpassen */ @media (max-width: 1024px) and (orientation: portrait) { ol, ul { font-size: 20px; } ol li, ul li { font-size: 20px !important; } } /*Einstellungen für Blog */ /* Basis-Artikel-Styling */ .nv-index-posts article { background-color: #C9C5C5 !important; border-radius: 10px !important; padding: 20px !important; box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important; margin-bottom: 40px !important; width: 48% !important; /* Breite reduziert, um Platz für Abstand zu lassen */ margin-right: 2% !important; /* Horizontaler Abstand */ float: left !important; /* Ermöglicht horizontales Layout */ } /* Jedes zweite Element */ .nv-index-posts article:nth-child(2n) { margin-right: 0 !important; /* Kein rechter Margin beim zweiten Element */ } /* Container-Clearfix */ .nv-index-posts .posts-wrapper::after { content: "" !important; clear: both !important; display: table !important; } /* Bestehende Styles bleiben unverändert */ .nv-index-posts .nv-post-thumbnail-wrap { margin-bottom: 15px !important; } .nv-index-posts .posts-wrapper { row-gap: 40px !important; } .nv-index-posts .nv-post-thumbnail-wrap img { border-radius: 8px !important; } .nv-index-posts article .entry-title, .nv-index-posts article .entry-title a { font-size: 1.5rem !important; color: #2511F0 !important; } /* Für den Hover-Zustand des Links */ .nv-index-posts article .entry-title a:hover { color: #05A6FA !important; } /* Mobile Anpassungen */ @media screen and (max-width: 768px) { .nv-index-posts article { width: 100% !important; margin-right: 0 !important; float: none !important; background-color: #F0EFF4 !important; } } /* Textgröße Titel im Post anpassen */ .entry-title { font-size: 45px !important; } @media screen { .entry-title { font-size: 36px !important; } } /* AB HIER seitenspezifische Anpassungen */ /* Lead-Buttons (Get Music) für Mobil */ @media screen and (max-width: 790px) { /* Basis-Styling für den Columns-Container */ .wp-block-columns { flex-direction: column !important; align-items: center !important; gap: 0.5em !important; /* Reduzierter vertikaler Abstand */ } /* Die spezifische Column */ .lead-button { flex-basis: 100% !important; margin-left: 0 !important; display: flex !important; flex-direction: column !important; align-items: center !important; } /* Text-Styling */ .lead-button .has-text-align-right { text-align: center !important; margin-bottom: 0.5em !important; /* Reduzierter Abstand zum Button */ padding-top: 0.5em !important; /* Angepasstes Padding */ padding-bottom: 0.5em !important; /* Angepasstes Padding */ } /* Button-Container */ .lead-button .wp-block-button { width: auto !important; display: flex !important; justify-content: center !important; } /* Button selbst */ .lead-button .wp-block-button__link { text-align: center !important; margin: 0 auto !important; } } ### wp_mail_smtp ### version: 4.3.0 license_key_type: lite debug: No debug notices found. lite_install_date: Sep 25, 2024 @ 12:17pm ### wpforms ### version: 1.9.3.1 lite: September 23, 2024 at 4:39 pm pro: September 24, 2024 at 11:24 am upload_dir: Writable total_forms: 3 total_entries: 17 license_status: Valid license: Basic license_location: option

Is the issue you are reporting a regression

No

@mattyjoomla mattyjoomla added the bug This label could be used to identify issues that are caused by a defect in the product. label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This label could be used to identify issues that are caused by a defect in the product.
Projects
None yet
Development

No branches or pull requests

1 participant