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

βœ… 🧩 🐞 Compatibility issue with FacetWP caused by Optimize Image Loading feature #24226

Closed
5 tasks done
djrmom opened this issue Nov 9, 2023 · 4 comments Β· Fixed by #25357 or #25356
Closed
5 tasks done
Assignees
Labels
bug Indicates a bug with one or multiple components. compatibility/3rd-party Indicates a compatibility problem with a 3rd-party plugin or theme. mod/c* product/pro Indicates if the referenced component is part of the Elementor Pro plugin. solved Indicates that an Issue has been Solved, or a Feature Request has been Released. status/merged Indicates when a Pull Request has been merged to a Release. theme-builder/archive-template References any Archive template feature of Elementor Pro’s Theme Builder. theme-builder References any component related to Elementor Pro’s Theme Builder. type/experiment Indicates when a topic is related to a Stable or Unstable Feature or Experiment. type/performance Indicates when a topic is related to Performance. widget/posts* References the (legacy) Posts (Pro) widget.
Milestone

Comments

@djrmom
Copy link

djrmom commented Nov 9, 2023

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest stable version of Elementor.

Description

Activating the Optimize Image Loading feature when using FacetWP causes errors when Facet filters are used on a page where Elementor widgets for the post loop that is being filtered with Facet. The error only occurs during Facet's ajax post that should return JSON formatted text rather than an HTML page - https://d.pr/i/LqReTd

We have found it occurs because Elementor's Optimize Image Loading opens a buffer on get_footer that is only flushed on end of script - https://d.pr/i/gS1exg - leaving Facet unable to correctly close its own buffer that is used to capture the part of the page html returned in its JSON text. Facet uses ob_get_clean on the shutdown WP hook.

In testing all setups of elementor widgets for the post query and loop that can be used with Optimize Image Loading inactive, have the error when Optimize Image Loading is active.

It does not occur if using a FacetWP listing template for the posts.

Steps to reproduce

  1. Install FacetWP - https://facetwp.com/help-center/getting-started/. Go in Facet's settings and re-index in top right to make sure facet has indexed existing posts. There needs to be sample blog posts to test with.
  2. Install FacetWP Elementor addon - https://facetwp.com/help-center/using-facetwp-with/elementor/.
  3. Be sure Facet's Strict query detection setting is enabled in Facet's settings page.
  4. Set Elementor's Optimize Image Loading to Active.
  5. Follow the directions to create a template for the posts archive with the Elementor posts widget (with current query as the source) and add the category facet that is included as a example facet. It can be added by its shortcode or Facet's elementor widget.
  6. View the posts archive with this template in use. Open the developer tools in browser to view the XHR post requests. Select a facet and you should see a POST by facetwp and the response will show there is a error https://d.pr/i/LqReTd
  7. Set Optimize Image Loading to inactive, test the same as in step 5. Error no longer occurs and facet filtering should be correctly applied to results.

The error can occur without FacetWP Elementor addon. You can setup the posts archive template as above but will not be able to Enable facet in the post widget settings and will have to add the category facet as a shortcode. This setup should work with facet's auto detection of the archive query. It will not work on a non-archive page or if the query source is not current query.

I can provide access to FacetWP and the addon to your developers by whatever non-public method you prefer.

Isolating the problem

  • This bug happens with only Elementor plugin active (and Elementor Pro).
  • This bug happens with a Blank WordPress theme active (Hello theme).
  • I can reproduce this bug consistently following the steps above.

System Info

Click to reveal
					
== Server Environment ==
	Operating System: Linux
	Software: nginx/1.25.3
	MySQL version: mariadb.org binary distribution v10.5.22
	PHP Version: 8.0.30
	PHP Memory Limit: 256M
	PHP Max Input Vars: 1000
	PHP Max Post Size: 1024M
	GD Installed: Yes
	ZIP Installed: Yes
	Write Permissions: All right
	Elementor Library: Connected

== WordPress Environment ==
	Version: 6.4.1
	Site URL: http://elem.test
	Home URL: http://elem.test
	WP Multisite: No
	Max Upload Size: 1 GB
	Memory limit: 40M
	Max Memory limit: 256M
	Permalink Structure: /%year%/%monthnum%/%postname%/
	Language: en-US
	Timezone: 0
	Debug Mode: Active

== Theme ==
	Name: Hello Elementor
	Version: 2.9.0
	Author: Elementor Team
	Child Theme: No

== User ==
	Role: administrator
	WP Profile lang: en_US
	User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0

== Active Plugins ==
	Elementor
		Version: 3.17.3
		Author: Elementor.com

	Elementor Pro
		Version: 3.17.1
		Author: Elementor.com

	FacetWP
		Version: 4.2.7
		Author: FacetWP, LLC

	FacetWP - Elementor
		Version: 1.8.1
		Author: FacetWP, LLC


== Features ==
	Custom Fonts: 0
	Custom Icons: 0

== Integrations ==
	


== Elementor Experiments ==
	Optimized DOM Output: Active
	Improved Asset Loading: Active
	Improved CSS Loading: Active
	Inline Font Icons: Active
	Additional Custom Breakpoints: Active
	admin_menu_rearrangement: Inactive by default
	Flexbox Container: Active
	Upgrade Swiper Library: Active
	Grid Container: Inactive by default
	Default to New Theme Builder: Active
	Hello Theme Header & Footer: Active
	Editor Top Bar: Inactive by default
	Optimized Gutenberg Loading: Inactive by default
	Build with AI: Inactive by default
	Landing Pages: Active
	Nested Elements: Inactive by default
	Lazy Load Background Images: Inactive by default
	Optimize Image Loading: Active
	Global Style Guide: Inactive by default
	Page Transitions: Active
	Notes: Active
	Form Submissions: Active
	Scroll Snap: Active
	Menu: Inactive by default
	Taxonomy Filter: Inactive by default


== Log ==
	
Log: showing 20 of 302023-10-05 19:57:16 [info] Elementor Pro/Upgrades - _on_each_version Start  
2023-10-05 19:57:16 [info] Elementor Pro/Upgrades - _on_each_version Finished 
2023-10-05 19:57:16 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.16.2',
  'to' => '3.17.0-beta1',
)]
2023-10-05 19:57:16 [info] Elementor data updater process has been queued. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.16.2',
  'to' => '3.17.0-beta1',
)]
2023-11-01 17:24:39 [info] elementor-pro::elementor_pro_updater Started 
2023-11-01 17:24:39 [info] Elementor Pro/Upgrades - _on_each_version Start  
2023-11-01 17:24:39 [info] Elementor Pro/Upgrades - _on_each_version Finished 
2023-11-01 17:24:39 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.17.0-beta1',
  'to' => '3.17.1',
)]
2023-11-01 17:24:39 [info] Elementor data updater process has been queued. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.17.0-beta1',
  'to' => '3.17.1',
)]
2023-11-01 17:24:51 [info] elementor::elementor_updater Started 
2023-11-01 17:24:51 [info] Elementor/Upgrades - _on_each_version Start  
2023-11-01 17:24:51 [info] Elementor/Upgrades - _on_each_version Finished 
2023-11-01 17:24:51 [info] Elementor/Upgrades - _v_3_17_0_site_settings_updates Start  
2023-11-01 17:24:51 [info] Elementor/Upgrades - _v_3_17_0_site_settings_updates Finished 
2023-11-01 17:24:51 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor',
  'from' => '3.17.0-dev1',
  'to' => '3.17.2',
)]
2023-11-09 13:21:19 [info] elementor::elementor_updater Started 
2023-11-09 13:21:19 [info] Elementor/Upgrades - _on_each_version Start  
2023-11-09 13:21:19 [info] Elementor/Upgrades - _on_each_version Finished 
2023-11-09 13:21:19 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor',
  'from' => '3.17.2',
  'to' => '3.17.3',
)]
2023-11-09 13:21:19 [info] Elementor data updater process has been queued. [array (
  'plugin' => 'Elementor',
  'from' => '3.17.2',
  'to' => '3.17.3',
)]

PHP: showing 10 of 10PHP: 2023-09-28 12:10:38 [warning X 7][../wp-content/plugins/elementor/core/common/modules/ajax/module.php::175] Undefined array key "data" [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-09-28 12:10:39 [warning X 28][../wp-content/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php::150] Undefined array key "condition_type" [array (
  'trace' => '
#0: ../wp-content/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php(150): Elementor\Core\Logger\Manager -> rest_error_handler()
#1: ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates -> normalize_template_json_item()
#2: ../wp-content/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php(120): class type array_map()
#3: ../wp-content/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php(59): ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates -> normalize_templates_json()
#4: ../wp-content/plugins/elementor/data/base/endpoint.php(158): ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates -> get_items()
',
)]
PHP: 2023-09-28 12:10:40 [error X 1][../wp-content/plugins/elementor/core/files/css/base.php::398] Allowed memory size of 134217728 bytes exhausted (tried to allocate 1417216 bytes) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-10-05 19:51:07 [error X 2][../wp-content/plugins/elementor/includes/base/widget-base.php::183] Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-10-05 19:51:12 [error X 1][../wp-content/plugins/elementor/core/files/css/base.php::398] Allowed memory size of 134217728 bytes exhausted (tried to allocate 1830912 bytes) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-10-05 22:12:53 [error X 1][../wp-content/plugins/elementor/core/files/css/base.php::398] Allowed memory size of 134217728 bytes exhausted (tried to allocate 1486848 bytes) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-10-13 18:59:30 [warning X 1][../wp-content/plugins/elementor/modules/history/revisions-manager.php::363] Trying to access array offset on value of type null [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-10-19 17:21:20 [error X 1][../wp-content/plugins/elementor/core/files/css/base.php::398] Allowed memory size of 134217728 bytes exhausted (tried to allocate 19263784 bytes) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-10-19 17:21:57 [error X 2][../wp-content/plugins/elementor/core/files/css/base.php::398] Allowed memory size of 134217728 bytes exhausted (tried to allocate 19263816 bytes) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-11-02 12:01:09 [error X 2][../wp-content/plugins/elementor/core/files/css/base.php::398] Allowed memory size of 134217728 bytes exhausted (tried to allocate 6699648 bytes) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]

JS: showing 2 of 2JS: 2023-10-13 19:00:04 [error X 6][../wp-content/plugins/elementor/assets/js/editor.js?ver=3.16.5:39861:31] this.store.find(...) is undefined 
JS: 2023-10-19 16:43:03 [error X 1][../wp-content/plugins/elementor/assets/js/editor.js?ver=3.16.6:30365:9] this.container is undefined 



== Elementor - Compatibility Tag ==
	
	Elementor Pro: Compatible
	FacetWP - Elementor: Compatibility not specified

== Elementor Pro - Compatibility Tag ==
	

				
@djrmom djrmom added the status/awaiting_triage Indicates when an Issue, Pull Request, or Discussion awaits to be triaged. label Nov 9, 2023
@Webtica
Copy link

Webtica commented Nov 9, 2023

+1 following

@nicholaszein nicholaszein changed the title Compatibility issue with FacetWP caused by Optimize Image Loading feature β›” 🧩 🐞 Compatibility issue with FacetWP caused by Optimize Image Loading feature Jan 18, 2024
@nicholaszein nicholaszein added compatibility/3rd-party Indicates a compatibility problem with a 3rd-party plugin or theme. product/pro Indicates if the referenced component is part of the Elementor Pro plugin. type/experiment Indicates when a topic is related to a Stable or Unstable Feature or Experiment. mod* mod/c* widget/posts* References the (legacy) Posts (Pro) widget. theme-builder/archive-template References any Archive template feature of Elementor Pro’s Theme Builder. theme-builder References any component related to Elementor Pro’s Theme Builder. type/performance Indicates when a topic is related to Performance. and removed status/awaiting_triage Indicates when an Issue, Pull Request, or Discussion awaits to be triaged. mod* labels Jan 18, 2024
@sarah-cul
Copy link

Experienced the same issue after updating the Elementor Pro plugin to v3.19.2 , the "Optimize Image Loading" needed to be set to inactive for the facetwp functionality to work on a page using elementor accordion widget and custom post loop.

@remcokalf
Copy link

For other FacetWP users coming here via Google: here are a few ways to fix this issue:
https://facetwp.com/help-center/using-facetwp-with/elementor/#fix-the-elementor-json-error

Still hoping this issue gets some attention. Elementor needs to properly close the output buffer opened by Optimize Image Loading.

@rami-elementor rami-elementor self-assigned this Feb 26, 2024
@nicholaszein nicholaszein added this to the 3.20.0 milestone Mar 12, 2024
@nicholaszein nicholaszein added status/merged Indicates when a Pull Request has been merged to a Release. solved Indicates that an Issue has been Solved, or a Feature Request has been Released. bug Indicates a bug with one or multiple components. labels Mar 12, 2024
@nicholaszein nicholaszein changed the title β›” 🧩 🐞 Compatibility issue with FacetWP caused by Optimize Image Loading feature βœ… 🧩 🐞 Compatibility issue with FacetWP caused by Optimize Image Loading feature Mar 12, 2024
@remcokalf
Copy link

@rami-elementor Thank you very much for looking into this! Can confirm this fixes the issues with FacetWP.

@elementor elementor locked and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Indicates a bug with one or multiple components. compatibility/3rd-party Indicates a compatibility problem with a 3rd-party plugin or theme. mod/c* product/pro Indicates if the referenced component is part of the Elementor Pro plugin. solved Indicates that an Issue has been Solved, or a Feature Request has been Released. status/merged Indicates when a Pull Request has been merged to a Release. theme-builder/archive-template References any Archive template feature of Elementor Pro’s Theme Builder. theme-builder References any component related to Elementor Pro’s Theme Builder. type/experiment Indicates when a topic is related to a Stable or Unstable Feature or Experiment. type/performance Indicates when a topic is related to Performance. widget/posts* References the (legacy) Posts (Pro) widget.
Projects
None yet
6 participants