SEO Metadata

Server-related issue: SEOM always chooses default image - SEO Metadata

Server-related issue: SEOM always chooses default image

by shortmort37 » Tue Jan 07, 2025 5:16 pm

First, apologies for mis-posting this thread on the sticky - I've moved it here.

Recently my website was moved to a new server, and all the code was ported. I'm running phpBB 3.3.5 with PHP 7.4.33, and most things are sorted out - except, for new posts, SEO Metadata 1.4.2 always supplies the default image to Facebook's Sharing Debugger (FSD) - regardless of how many attachments I supply... I know the problem is on my end, but I'm looking for guidance as to how to diagnose.

I did disable the extension, purge the cache, and re-enabled - to no avail.

Here's a new phpBB post that supplies the default image to FSD: https://59plymouth.net/59forum/viewtopic.php?t=4215

Thanks in advance,
Dan
User avatar
shortmort37
Registered User
Posts: 696
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton

Re: Server-related issue: SEOM always chooses default image

by shortmort37 » Tue Jan 07, 2025 5:16 pm

D'Oh! Of course; the extension prepares the meta properties at time of phpBB posting, for Facebook to scrape. I can simply "view page source" to determine the outcome, without resorting to FSD.

I've got some machinations to perform before I can reenable Xdebug to find out what's going on, so if there are simpler diagnostics I can perform in the meantime, I could use a hint.
User avatar
shortmort37
Registered User
Posts: 696
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton

Re: Server-related issue: SEOM always chooses default image

by shortmort37 » Tue Jan 07, 2025 5:17 pm

At a loss as to why my new site fails with this extension, when everything else seems to be working. In desperation, I:

1) disabled 1.4.2
2) deleted the settings
3) removed 1.4.2
3) cleared the cache
4) uploaded 1.5.0
5) enabled 1.5.0
6) redefined the settings
7) created a new post with images: https://59plymouth.net/59forum/viewtopic.php?t=4216

Still no love - when I view the page source, the default image is assigned:
<meta property="og:image" content="https://59plymouth.net/59forum/images/facebook/facebook0.jpg">
Any ideas about how to diagnose? I'm grasping at straws now.
User avatar
shortmort37
Registered User
Posts: 696
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton

Re: Server-related issue: SEOM always chooses default image

by SQLnovice » Wed Jan 08, 2025 3:11 am

If it were me, I'd think that the 1.4.2+ versions were intended to work with PHPBB 3.3.11+, so I'd want to upgrade my site's version to that first. And why not! I could do the version update using the Advanced option [url-https://www.phpbb.com/downloads/3.3/adv ... sion=3.3.5]3.3.5 to 3.3.14[/url] in under a couple hours. It saves all my site's custom changes, which we have in place, including a forum logo.

Most of the time upgrading is taken up with performing the backup process, then doublechecking that I'm not skipping ahead in the process.
viewtopic.php?p=16042024#p16042024

It's either that or downgrade to the previous version before 1.4.2.
SQLnovice
Registered User
Posts: 159
Joined: Thu Oct 10, 2019 5:03 am

Re: Server-related issue: SEOM always chooses default image

by AlfredoRamos » Wed Jan 08, 2025 4:33 am

Hi,
shortmort37 wrote:Recently my website was moved to a new server [...]
That alone could be the source of the issue.

I'm using a library to extract image information that is already bundled in phpBB, and that needs the PHP extension called GD.

That extension needs to be enabled server-side. If you are using a shared hosting and have cPanel, you could enable GD on the PHP settings (extensions) of could ask tech support to do it for you. I don't use shared hosting or any kind of panel, but it should look something like this (from internet):
Screenshot_20250107_222501.png
If you are using a VPS or manage the server yourself, just edit the php.ini file and enable the gd extension, or install the appropriate package (like php-gd) which usually install an additional config file that enables the extension automatically.

After enabling GD, you must purge the cache of your board so the extension will check for images again for that topic.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1323
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo

Re: Server-related issue: SEOM always chooses default image

by AlfredoRamos » Wed Jan 08, 2025 4:38 am

shortmort37 wrote: I can simply "view page source" to determine the outcome, without resorting to FSD.
That's ok for now. However, once the image an image is selected correctly (see my previous message), you migh need to use the Facebook debugger to force it to check your site again.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1323
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo

Re: Server-related issue: SEOM always chooses default image

by AlfredoRamos » Wed Jan 08, 2025 4:45 am

SQLnovice wrote: I'd think that the 1.4.2+ versions were intended to work with PHPBB 3.3.11+
I would like to add a note on this.

If it wasn't for the bump of the minimum PHP requirements for extensions, this extension would not need any change at all.

It has been working since phpBB 3.2.x, and when 3.3.x came out, it didn't need any change.

So, unless phpBB adds any backward breaking change (like version 4.0), it might work for any future versions of phpBB 3.x :lol:
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1323
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo

Re: Server-related issue: SEOM always chooses default image

by AlfredoRamos » Wed Jan 08, 2025 5:03 am

shortmort37 wrote:
I just saw the email notification.

Thank you for the donation 😎
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1323
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo

Re: Server-related issue: SEOM always chooses default image

by shortmort37 » Wed Jan 08, 2025 2:59 pm

AlfredoRamos wrote: I'm using a library to extract image information that is already bundled in phpBB, and that needs the PHP extension called GD.

That extension needs to be enabled server-side...
I was so hopeful that was it! Alas (from phpinfo.php):
GD.jpg
Might the package need an upgrade? Can you think of any coding diagnostics I could implement, short of an Xdebug trace? I'm still setting up my test environment, and there are lots of hurdles to get Xdebug working...

Thanks for the feedback,
Dan

P.S. PHP details for my site can be found here
User avatar
shortmort37
Registered User
Posts: 696
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton

Re: Server-related issue: SEOM always chooses default image

by AlfredoRamos » Wed Jan 08, 2025 8:56 pm

:thinking:

Could you share, in a private message, the list with extension names and versions you have installed, please?

Do you have any kind of hotlink protection enabled? Does the error or access log have any entry from this extension?

I believe you are using a VPS, so can you try if setting a CA certificate store helps? The library used intentionally suppresses the errors, so the only way to know for sure will need a modification in that library, so try this first and if it does not work, I'll give you instructions in private.

For the CA certificate store you'll need to download the latest PEM file in your server from here:

https://curl.se/docs/caextract.html

And set openssl.cafile to point to that file path, in your php.ini, then restart PHP FPM.

You might want to make a backup of that file first, because if it does not work you'll need to revert those changes.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1323
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo

Re: Server-related issue: SEOM always chooses default image

by shortmort37 » Wed Jan 08, 2025 9:20 pm

AlfredoRamos wrote: Could you share, in a private message, the list with extension names and versions you have installed, please?
Will do.
AlfredoRamos wrote: Do you have any kind of hotlink protection enabled? Does the error or access log have any entry from this extension?
No hotlinking; no errors in any phpBB logs.
AlfredoRamos wrote: I believe you are using a VPS, so can you try if setting a CA certificate store helps? The library used intentionally suppresses the errors, so the only way to know for sure will need a modification in that library, so try this first and if it does not work, I'll give you instructions in private.
Yes, I have full access to my server. I'll attempt the CA certificate store process.

Full disclosure: My site is heavily modded - my own flavor of gallery style, implementation of FancyBox, PDFs as jpegs for thumbnails, MP3/4 attachments, pdf.js for PDF rendering in FancyBox. Prolly some other stuff. I don't have the expertise to develop an extension, so I carry the mods along with each phpBB upgrade; I'm long overdue for another, but it's painful.

That said - there hasn't been any change to my code since it operated perfectly fine - along with SEO Metadata - on the old server.

I'll be back! Thanks.
Dan
User avatar
shortmort37
Registered User
Posts: 696
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton

Re: Server-related issue: SEOM always chooses default image

by shortmort37 » Wed Jan 08, 2025 9:49 pm

OK - no help with adding cacert.pem to /etc/ssl/certs, and updating php.ini to reference it. I'll try the code mod next.

Dan
User avatar
shortmort37
Registered User
Posts: 696
Joined: Sat Aug 26, 2006 8:40 pm
Location: Upper Darby, PA, USA
Name: Dan Morton

Re: Server-related issue: SEOM always chooses default image

by SQLnovice » Thu Jan 09, 2025 4:12 pm

I mentioned this before in another topic, but Guest (group) permissions to download images must be set in order for SEO Metadata to work with attached images. I think that's because it operates under those permissions.

And if you have a Lightbox extension, that has adjustable maximum thumbnail pixels, use something at or greater than 381x200, like 382x202. :lol:

To get it to recognize both attachments and external to domain images at the same time, set this extension to 'domain only images,' No. Then set ACP permission settings for each of your forums in a way that the extension will be able to see both sets of images, as a Guest. If you only have users uploading attachments, you can leave the 'domain only images' setting at Yes.

Forums
Group forum permissions
Guests - Submit
Select all the forums you want SEO Metadata to have access to attachment images for OG:Image
Action- Can download files (Yes)
Apply all permissions

Users and Groups
Manage Group Permissions
Guests - Submit
Advanced Permissions
Post
Can download files (Yes)
Apply permissions

I'm currently updating Postimage.org thumbnail images, which by default are smaller than 200 x 200, to their regular size and letting Lightbox control reducing them, due to the 200 x 200 minimum Social Media guideline limitation. After each batch of posts updated, when I need a break, I just have to clear the forum cache so that SEO Metadata will now see (OG:Image link) the images I've enlarged.
SQLnovice
Registered User
Posts: 159
Joined: Thu Oct 10, 2019 5:03 am