SOLVED: Slim SEO plugin conflict: CRASH with posts query_vars filter and pre_get_posts

Bricks Version: 1.4

Hi,

When activating Slim SEO plugin, I have the following issue on pages using posts/query_vars filter or pre_get_posts PHP function:

It seems some code is executed twice, since the problem is my custom function redeclaration.

I narrowed it down to 3 problematic options in Slim SEO:

I don’t have the issue with Oxygen, but haven’t tested with other environments.

Note I tried to deactivate Bricks SEO but no change:

Not sure if it is Bricks, but as I had other SEO issues (WAIT: MAJOR SEO settings issues), I thought I could report it here.

1 Like

UPDATE: Found the culprit!

I ran a few tests and when filling a manual description in Slim SEO field, all error disappeared.
So it seems that the problem comes from generating the meta description from post content…

And bingo!

After analysing Slim SEO’s code, I found out it had Bricks integration!
Well, kind of…
It actually disables Bricks SEO and if meta description is not manually filled in page, it tries to generate it from post content, by RENDERING the content, OMG!!!

So the page is generated twice!
Hence the redeclaration.

Quick fix: Use function_exists to detect if function has already been declared.

But I think rendering the content for the sole purpose of generating meta description is a bit too much. Google can do it for you, I guess :rofl:
IMHO meta desc should not be generated in this case.

@timmse, I don’t know if you work with Slim SEO’s dev, but I think you two should have a talk :wink:

1 Like

Reported it to Slim support: Bricks integration renders content to generate meta description | WordPress.org

2 Likes

Hi Yan,
Thank you very much for your report!

As far as I know, we are not in contact with Slim SEO Devs, nor do we have any influence on their plugin. Accordingly, it’s good that you reported the issue to them, which is always a good idea with third-party plugins.

Best regards,
timmse

The issue is actually not critical, since it happens only if meta-description is not filled for a page built with Bricks, which triggers an additional rendering of Bricks content (hence the function redeclation).

But description SHOULD actually be customized for SEO purpose, so it is kind of fallback issue, and easily solved by protecting declaration with function_exist().