This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing an issue where search results in their website's header, powered by Buddyboss, are not displayed in the main language (English), but work fine in French. The issue is linked to the 'smart-opengraph' plugin, which affects the display of search results in the translated language.
Solution:
If the 'smart-opengraph' plugin is essential for the website, we recommend modifying its function to correctly handle search queries in different languages. Here's how you can adjust the code:
static function compileOpenGraphTags() {<br /> if ( ! $_GET['s'] ) { //added check condition<br /> global $post;<br /> // Your logic here<br /> return $aVal;<br /> }<br />} //added end bracket
Please note that the plugin might have hardcoded values that could lead to further issues, and it uses a logic that incorrectly retrieves page IDs, causing it to fail in translated versions. We also suggest contacting the plugin developers to consider joining the Go Global Program for better multilingual support.
If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket for further assistance.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Compatibility
This topic contains 11 replies, has 2 voices.
Last updated by Bruno Kos 5 months ago.
Assisted by: Bruno Kos.
Author | Posts |
---|---|
August 29, 2024 at 12:15 am #16117275 | |
antoineC-28 |
Background of the issue: Symptoms: Questions: |
September 2, 2024 at 5:56 am #16129999 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
Hi, Can you install BuddyBoss here hidden link and show us where we can see the issue? I will check with our compatibility team then. |
September 12, 2024 at 9:23 am #16169911 | |
antoineC-28 |
Hi again! Sorry i was in holidays! The problem still here, did you want me to do something in paticular i think the link is expired! Here is some screenshots, In english its just a blank page giving no results and in french everything works fine and giving me results for the same terms. Thanks a lot for your help, |
September 12, 2024 at 11:48 am #16170636 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
Sandboxes expire after 7 days if no activity. I created a new one, can you reproduce this issue here? Feel free to install whatever is needed. |
September 12, 2024 at 12:53 pm #16171044 | |
antoineC-28 |
I've installed buddyboss and buddyboss team and results seems to be provided in both languages. |
September 13, 2024 at 6:36 am #16174105 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
I see, so the issue would be your site specific only? Can you please check if this issue appears when: - only WPML plugins are activated (along with BuddyBoss and BuddyPress Multilingual), as it will tell us if there is an interaction issue with other plugin |
September 13, 2024 at 4:09 pm #16176831 | |
antoineC-28 |
Hello again! I did a test with only these activated on Sandbox : BuddyBoss Platform Multilingual Tools Buddyboss theme I cant deactivate Buddyboss theme and other buddyboss plugins since its tightly realetd to their advaned search bar and not the deafault WordPress Search bar! |
September 16, 2024 at 6:50 am #16181499 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
Given that we weren't able to reproduce this in sandbox, to troubleshoot this problem, I'll install the Duplicator plugin and generate packages for further debugging purposes. I'll ensure to exclude all media files to maintain a minimal package size. You can find more information about the process here: [link](https://wpml.org/faq/provide-supporters-copy-site/). Please confirm if this approach is acceptable to you. Apart from that, can you send me screenshots/instruction on what should I do to see the issue on your site, which item to search and on which url? |
September 18, 2024 at 9:22 am #16191878 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
I am checking this with our 2nd tier and will keep you posted. |
September 20, 2024 at 8:13 am #16201580 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
We found that the issue comes from "smart-opengraph" and the issue itself is quite complex. Can you tell me if this plugin is required for your website? |
September 25, 2024 at 4:41 pm #16221940 | |
antoineC-28 |
Hi again! Thank you! No, i think we could get rid of it if needed to make it work! |
September 26, 2024 at 5:26 am #16223011 | |
Bruno Kos Supporter
Languages: English (English ) German (Deutsch ) French (Français ) Timezone: Europe/Zagreb (GMT+01:00) |
If you need it, you can try this: 1. Modify the function `WpWootOGBuilder::compileOpenGraphTags` located in `wp-content/plugins/smart-opengraph/helper/wpwoot-ogbuilder.php`. Add a condition to check if a search is set, like this: static function compileOpenGraphTags() { if ( ! $_GET['s'] ) { //added check condition global $post; // Your logic here return $aVal; } } //added end bracket 2. Please note that the plugin is not functioning for the translated language. The code appears to be custom-tailored with some hardcoded hosts added, which might lead to additional issues. 3. The plugin uses a logic that calls `url_to_postid`, which is returning the page ID for the homepage, causing unwanted behavior. This issue does not occur in the translation because the logic fails to retrieve the ID for the `/fr/` page. 4. You might also want to consider asking their developers to join [Go Global Program](https://wpml.org/documentation/support/go-global-program/) for further support on multilingual functionality. |