dmzw
Forum Replies Created
-
Forum: Plugins
In reply to: [Schema & Structured Data for WP & AMP] Have this issue in error_logNow i have this
[16-Mar-2026 07:13:26 UTC] PHP Warning: foreach() argument must be of type array|object, string given in /wp-content/plugins/schema-and-structured-data-for-wp/output/markup.php on line 3495Update.
Clarification for the dev team:
Please also check how the plugin appends language conditions to the SQLWHEREclause. In some queries (especially with “Advanced Woo Search”), we see a missingANDoperator right afterpost_status = 'publish'.Failing SQL fragment:
AND wp_posts.post_status = 'publish' \n ( wp_posts.ID NOT IN...The core issue is that the plugin appends language conditions to the
WHEREclause without ensuring a mandatoryANDseparator is present if a newline or multiple spaces exist.Failing string:
post_status = 'publish' (wp_posts.ID NOT IN...
It seems the plugin fails to detect the need for anANDseparator when there’s a newline character in the query.The story continues. Another bug has been identified .
A critical bug in the current version of WP Multilang that causes SQL syntax errors when used with WooCommerce filters (e.g., in
get_filtered_term_product_counts).The issue causes “merged” strings in the final SQL query, such as:
_languages'mt1.meta_value(MissingANDbetween meta keys)post_status = 'publish' ((MissingANDbefore the opening parenthesis)
Root Cause Analysis:
The bug is located inincludes/class-wpm-posts.phpwithin thefilter_posts_by_languagemethod.- Issue with
wp_parse_args: The plugin useswp_parse_argsto merge language meta queries with the existingmeta_query. This function “flattens” multi-dimensional arrays, which destroys the nested structure required by WooCommerce and WordPress for complex meta queries. This results in the missingANDand merged strings like_languages'mt1.meta_value. - Improper WHERE clause joining: In some cases, the language conditions are appended to the
WHEREclause without checking for the existence of a logical operator (AND), leading to syntax errors likepost_status = 'publish' (.
Proposed Fix:
Instead of usingwp_parse_args, the meta queries should be merged while preserving their nested structure and explicitly defining therelation.Suggested code change in
filter_posts_by_language:// Instead of: // $lang_meta_query = wp_parse_args( $query->query_vars['meta_query'], $lang_meta_query ); // Use a safe nested merge: if ( ! empty( $query->query_vars['meta_query'] ) ) { $lang_meta_query = array( 'relation' => 'AND', array( 'relation' => 'AND', $query->query_vars['meta_query'] ), $lang_meta_query ); }This ensures that the language filter is always added as a separate, properly joined block, preventing the SQL “merging” effect.
Please review this fix and include it in the next update to prevent errors when using faceted search or complex product filters.
Looks like I have identified the exact cause of the SQL syntax error (missing
ANDoperators and merged strings like_languages'mt1.meta_value) when using WP Multilang with WooCommerce attribute filters.The Bug Location:
File:
wp-multilang/includes/class-wpm-posts.php
Method:filter_posts_by_language( $query )(Lines approx. 160-167)The Issue:
The plugin uses
wp_parse_argsto merge the existingmeta_queryfrom WooCommerce with the language filter.if ( isset( $query->query_vars['meta_query'] ) ) { $lang_meta_query = wp_parse_args( $query->query_vars['meta_query'], $lang_meta_query ); }Why it fails:
wp_parse_argsis not suitable for complex, multi-dimensional arrays like a WooCommercemeta_query. It flattens the structure, causing WordPress to generate invalid SQL where conditions are concatenated without proper spaces or theANDrelation.Recommended Fix:
Replace the problematic block (around line 160) with a proper nested array structure and a defined
'relation' => 'AND':Current code:
if ( isset( $query->query_vars['meta_query'] ) ) { $lang_meta_query = wp_parse_args( $query->query_vars['meta_query'], $lang_meta_query ); }Corrected code:
if ( ! empty( $query->query_vars['meta_query'] ) ) { $lang_meta_query = array( 'relation' => 'AND', $query->query_vars['meta_query'], $lang_meta_query ); }Hope with this fix, the queries are nested correctly.
Please review this fix and include it in the next plugin update.
“The issue occurs specifically during the execution of
get_filtered_term_product_countsin WooCommerce. It happens when WP Multilang attempts to filter products by language within a complex SQL join created by the Layered Nav widget.To reproduce:
- Install WooCommerce and WP Multilang.
- Create several products with translations (UA/EN).
- Add the standard WooCommerce “Filter Products by Attribute” widget to a sidebar.
- Navigate to the Shop page and interact with the attributes filter.
- Check the
error_logfor a ‘SQL syntax error’ near_languages'mt1.meta_value.
The syntax error is caused by a missing space/operator between the meta_key and the next condition in the
WHEREclause generated by your plugin.”- try to change WP theme to test
i have no issue with shop page Upon click on language flag it tries to call the slug for the last product in shop
as i see on pagination – link is changing
PS. Now WOO Version 10.3.5 and WP 6.8.3
ok I’ll wait quietly but impatiently
but why is the topic marked as already solved?
in your questoin “Yoast setup specifically how you’re adding the title”
Using Yoast there is only one way to enter title. here is the sreen
https://prnt.sc/J7jSdWTCNppx
in first message of this is screen of html result.
The red marks are what is displayed incorrectly – they should not be therehttps://prnt.sc/vegFWBrCZXJK
Multilang has bug.
one more screen of title in browser – https://prnt.sc/sRQAGKriNmFo
We have this issue almost year with no result!
https://ww.wp.xz.cn/support/topic/yoast-problem-4/You can create any Page, enter in Yoast 2 or 3 language titles and you wil see the same
- This reply was modified 11 months ago by dmzw.
NO!!!!
IT’S ANOTHER PROBLEM!!!
NOT FIXED in PREVIOUSLY CLOSED TOPIC!
https://ww.wp.xz.cn/support/topic/yoast-problem-4/#post-17919323updated again to test
again crashed
deactivate/activate helped
before there wasn’t such as problemi tested again – 2.4.19 crashes the site.
rolling back to 2.4.18 – it is ok
it looks like plugin is deactivated
url mysite.com/en/* – 404 not found
but shows all with broken text in mysite.com/*
all menus, woo products – no translations, all text in raw format with []text in pages – still ok (if not woo shortcode or menu widget inside)
i put above link previous to previous topic that hasn’t been solved
examples were there
another man have same problems in different pages
https://ww.wp.xz.cn/support/topic/yoast-problem-4/#post-17919323Forum: Plugins
In reply to: [WP Multilang - Translation and Multilingual Plugin] Yoast problemIt’s not about the theme
it’s about how WP-Miltilang processes Yoast titles
Maxspell’s site screen
https://prnt.sc/TISb88XQGeB5I have the same. other Theme
AND i have sites with WP Multilang v 2.4.1 with no such issue (All sites – same Theme)Moreover, in “secondary” language page I have BOTH Language TITLES
1) Title<title>Default Language Title- Alternate Language Title - SITENAME [:]</title>2) Title for OpenGraph
https://prnt.sc/szO3djufTWbq<meta property="og:title" content="Default Language Title- Alternate Language Title - SITENAME [:]" default="" language="">It’s seems like support is over?
WHAT DETAILS???
i dont unerstand!!!
its simple woocomerce engine!
i gave you screenshots, then another screen.made product example – you can test.
made explanations.
what else?