Closed jpSimkins closed 1 year ago
Hello @jpSimkins!
Thank you for submitting your issue! π
Please allow us some time to investigate it, and get back to you with our findings. π§
Best regards
To make this easier to see, add
echo '<hr/>'; echo nl2br($hook_name . PHP_EOL); echo '<pre>' . print_r($arg, true) . '</pre>';
To the
do_action
method inwp-includes/plugin.php:439
- You should not edit core WP files.
- Did you tested this without Elementor?
- Seems like Elementor is not your only active plugins. You have "Olympusat WordPress Core" Must-Use Plugins. Please deactivate that one too share the results.
managers/controls.php: 877
). This can only happen with Elementor.== Server Environment ==
Operating System: Linux
Software: Apache
MySQL version: MySQL Community Server (GPL) v5.7.38
PHP Version: 7.4.29
PHP Memory Limit: 128M
PHP Max Input Vars: 1000
PHP Max Post Size: 64M
GD Installed: Yes
ZIP Installed: Yes
Write Permissions: All right
Elementor Library: Connected
== WordPress Environment ==
Version: 6.0.2
Site URL: https://test.local/wordpress
Home URL: https://test.local/
WP Multisite: No
Max Upload Size: 64 MB
Memory limit: 40M
Max Memory limit: 256M
Permalink Structure: Plain
Language: en-US
Timezone: 0
Admin Email: private
Debug Mode: Active
== Theme ==
Name: Hello Elementor
Version: 2.6.1
Author: Elementor Team
Child Theme: No
== User ==
Role: administrator
WP Profile lang: en_US
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
== Active Plugins ==
Elementor
Version: 3.7.8
Author: Elementor.com
== Elementor Experiments ==
Optimized DOM Output: Active by default
Improved Asset Loading: Active by default
Improved CSS Loading: Active by default
Inline Font Icons: Inactive by default
Accessibility Improvements: Active by default
Additional Custom Breakpoints: Active by default
Import Export Template Kit: Active by default
Hide native WordPress widgets from search results: Active by default
admin_menu_rearrangement: Inactive by default
Flexbox Container: Inactive by default
Hello Theme Header & Footer: Active by default
Landing Pages: Active by default
Color Sampler: Active by default
Favorite Widgets: Active by default
Admin Top Bar: Active by default
== Log ==
== Elementor - Compatibility Tag ==
I explained how to see it visually since you won't see any errors (edit the core file to see the side effects of how Elementor is using it). On the default theme with nothing on it, it has over 150 calls to this which invokes other hooks (wasting over 400 calls, which add up and add useless latency). This is an expensive cost for falsy checks, which is what I have seen this used for. If you use this on a site that has a lot of content, this is costing well over 100,000 calls and has noticeable performance impacts (> 3 seconds loading cost).
It would appear that this is intended by design, given that this is being used for falsy checks in the code. I am suggesting a better approach due to the cost WP_Error
has due to it firing other hooks. If I used a plugin that hooks into the WP_Error
system then this would cause a lot of false positives, which I have already experienced.
I just wanted to bring this to your attention. I do hope that you consider improving the code for this and wasn't sure if you were aware of the expense that WP_Error
adds.
Thank you
Hello there @jpSimkins!
We have great news! π
βοΈ Please feel free to check it out and update your plugin to the new version!
Cheers π₯
Prerequisites
Description
The front page of a vanilla site with just Elementor installed and using the Hello theme causes over 150
WP_Error
sIf this is intended behavior, consider not using
WP_Error
as this has overhead that will affect performance on larger sites.Steps to reproduce
1) Install a fresh WP 2) Activate Elementor 3) Load home page and examine the hooks
To make this easier to see, add
To the
do_action
method inwp-includes/plugin.php:439
Isolating the problem
System Info
System Info
````txt == Server Environment == Operating System: Linux Software: Apache MySQL version: MySQL Community Server (GPL) v5.7.38 PHP Version: 7.4.29 PHP Memory Limit: 128M PHP Max Input Vars: 1000 PHP Max Post Size: 64M GD Installed: Yes ZIP Installed: Yes Write Permissions: All right Elementor Library: Connected == WordPress Environment == Version: 6.0.2 Site URL: https://test.local/wordpress Home URL: https://test.local WP Multisite: No Max Upload Size: 64 MB Memory limit: 40M Max Memory limit: 256M Permalink Structure: Plain Language: en-US Timezone: 0 Admin Email: private Debug Mode: Active == Theme == Name: Hello Elementor Version: 2.6.1 Author: Elementor Team Child Theme: No == User == Role: administrator WP Profile lang: en_US User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 == Active Plugins == Elementor Version: 3.7.8 Author: Elementor.com == Must-Use Plugins == Olympusat WordPress Core Version: 1.3.0 == Elementor Experiments == Optimized DOM Output: Active by default Improved Asset Loading: Active by default Improved CSS Loading: Active by default Inline Font Icons: Inactive by default Accessibility Improvements: Active by default Additional Custom Breakpoints: Active by default Import Export Template Kit: Active by default Hide native WordPress widgets from search results: Active by default admin_menu_rearrangement: Inactive by default Flexbox Container: Inactive by default Hello Theme Header & Footer: Active by default Landing Pages: Active by default Color Sampler: Active by default Favorite Widgets: Active by default Admin Top Bar: Active by default == Log == == Elementor - Compatibility Tag == ````