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

Function utf8_decode() is deprecated #27499

Open
6 tasks done
jamieburchell opened this issue May 26, 2024 · 0 comments
Open
6 tasks done

Function utf8_decode() is deprecated #27499

jamieburchell opened this issue May 26, 2024 · 0 comments
Labels
status/awaiting_triage Indicates when an Issue, Pull Request, or Discussion awaits to be triaged.

Comments

@jamieburchell
Copy link

jamieburchell commented May 26, 2024

Prerequisites

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

Description

As per #27308

Elementor does not use this function. This is not coming from Elementor

It's right here, in the very first line of the backtrace:

plugins/elementor-pro/modules/screenshots/module.php on line 33

$response = wp_remote_get( utf8_decode( $url ) );

Please, troubleshoot your issue before submitting it here,

I have. Please extend me the same courtesy by carefully reading the bug report I have taken the time to submit.

and make sure to provide the full ELEMENTOR SYSTEM INFO.

Apologies, it seems I accidentally provided the WP built-in status info instead, which I will rectify below. Perhaps a better use of everyone's time could have been allowing me to edit my original issue to provide this.

Backtrace:

[26-May-2024 14:41:38 UTC] PHP Deprecated:  Function utf8_decode() is deprecated in /home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php on line 33
[26-May-2024 14:41:38 UTC] PHP Stack trace:
[26-May-2024 14:41:38 UTC] PHP   1. {main}() /home/jamie/projects/example.com/web/index.php:0
[26-May-2024 14:41:38 UTC] PHP   2. require() /home/jamie/projects/example.com/web/index.php:6
[26-May-2024 14:41:38 UTC] PHP   3. require_once() /home/jamie/projects/example.com/web/wp/wp-blog-header.php:13
[26-May-2024 14:41:38 UTC] PHP   4. require_once() /home/jamie/projects/example.com/web/wp/wp-load.php:55
[26-May-2024 14:41:38 UTC] PHP   5. require_once() /home/jamie/projects/example.com/web/wp-config.php:10
[26-May-2024 14:41:38 UTC] PHP   6. do_action($hook_name = 'init') /home/jamie/projects/example.com/web/wp/wp-settings.php:695
[26-May-2024 14:41:38 UTC] PHP   7. WP_Hook->do_action($args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/plugin.php:517
[26-May-2024 14:41:38 UTC] PHP   8. WP_Hook->apply_filters($value = '', $args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:348
[26-May-2024 14:41:38 UTC] PHP   9. Elementor\Plugin->init('') /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:324
[26-May-2024 14:41:38 UTC] PHP  10. do_action($hook_name = 'elementor/init') /home/jamie/projects/example.com/web/app/plugins/elementor/includes/plugin.php:658
[26-May-2024 14:41:38 UTC] PHP  11. WP_Hook->do_action($args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/plugin.php:517
[26-May-2024 14:41:38 UTC] PHP  12. WP_Hook->apply_filters($value = '', $args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:348
[26-May-2024 14:41:38 UTC] PHP  13. ElementorPro\Plugin->on_elementor_init('') /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:324
[26-May-2024 14:41:38 UTC] PHP  14. ElementorPro\Core\Modules_Manager->__construct() /home/jamie/projects/example.com/web/app/plugins/elementor-pro/plugin.php:361
[26-May-2024 14:41:38 UTC] PHP  15. Elementor\Core\Base\Module::instance() /home/jamie/projects/example.com/web/app/plugins/elementor-pro/core/modules-manager.php:93
[26-May-2024 14:41:38 UTC] PHP  16. ElementorPro\Modules\Screenshots\Module->__construct() /home/jamie/projects/example.com/web/app/plugins/elementor/core/base/module.php:85
[26-May-2024 14:41:38 UTC] PHP  17. ElementorPro\Modules\Screenshots\Module->get_proxy_data($url = 'https://fonts.googleapis.com/css?family=Open Sans:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic') /home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php:265
[26-May-2024 14:41:38 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php:33) in /home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php on line 41
[26-May-2024 14:41:38 UTC] PHP Stack trace:
[26-May-2024 14:41:38 UTC] PHP   1. {main}() /home/jamie/projects/example.com/web/index.php:0
[26-May-2024 14:41:38 UTC] PHP   2. require() /home/jamie/projects/example.com/web/index.php:6
[26-May-2024 14:41:38 UTC] PHP   3. require_once() /home/jamie/projects/example.com/web/wp/wp-blog-header.php:13
[26-May-2024 14:41:38 UTC] PHP   4. require_once() /home/jamie/projects/example.com/web/wp/wp-load.php:55
[26-May-2024 14:41:38 UTC] PHP   5. require_once() /home/jamie/projects/example.com/web/wp-config.php:10
[26-May-2024 14:41:38 UTC] PHP   6. do_action($hook_name = 'init') /home/jamie/projects/example.com/web/wp/wp-settings.php:695
[26-May-2024 14:41:38 UTC] PHP   7. WP_Hook->do_action($args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/plugin.php:517
[26-May-2024 14:41:38 UTC] PHP   8. WP_Hook->apply_filters($value = '', $args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:348
[26-May-2024 14:41:38 UTC] PHP   9. Elementor\Plugin->init('') /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:324
[26-May-2024 14:41:38 UTC] PHP  10. do_action($hook_name = 'elementor/init') /home/jamie/projects/example.com/web/app/plugins/elementor/includes/plugin.php:658
[26-May-2024 14:41:38 UTC] PHP  11. WP_Hook->do_action($args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/plugin.php:517
[26-May-2024 14:41:38 UTC] PHP  12. WP_Hook->apply_filters($value = '', $args = [0 => '']) /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:348
[26-May-2024 14:41:38 UTC] PHP  13. ElementorPro\Plugin->on_elementor_init('') /home/jamie/projects/example.com/web/wp/wp-includes/class-wp-hook.php:324
[26-May-2024 14:41:38 UTC] PHP  14. ElementorPro\Core\Modules_Manager->__construct() /home/jamie/projects/example.com/web/app/plugins/elementor-pro/plugin.php:361
[26-May-2024 14:41:38 UTC] PHP  15. Elementor\Core\Base\Module::instance() /home/jamie/projects/example.com/web/app/plugins/elementor-pro/core/modules-manager.php:93
[26-May-2024 14:41:38 UTC] PHP  16. ElementorPro\Modules\Screenshots\Module->__construct() /home/jamie/projects/example.com/web/app/plugins/elementor/core/base/module.php:85
[26-May-2024 14:41:38 UTC] PHP  17. ElementorPro\Modules\Screenshots\Module->get_proxy_data($url = 'https://fonts.googleapis.com/css?family=Open Sans:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic') /home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php:265
[26-May-2024 14:41:38 UTC] PHP  18. header($header = 'content-type: text/css; charset=utf-8') /home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php:41

Steps to reproduce

  1. PHP 8.2 with Elementor & Pro
  2. Create a new template
  3. Open the Theme Builder / trigger template screenshot generation

Expected behavior

Don't use the deprecated function

Isolating the problem

  • This bug happens when only the Elementor (and Elementor Pro) plugins are active.
  • This bug happens with the Hello Elementor theme active.
  • I can reproduce this bug consistently by following the steps I described above.

Elementor System Info

== Server Environment ==
	Operating System: Linux
	Software: Apache/2.4.52 (Ubuntu)
	MySQL version: Ubuntu 22.04 v10.6.16
	PHP Version: 8.2.19
	PHP Memory Limit: 256M
	PHP Max Input Vars: 10000
	PHP Max Post Size: 64M
	GD Installed: Yes
	ZIP Installed: Yes
	Write Permissions: All right
	Elementor Library: Connected

== WordPress Environment ==
	Version: 6.5.3
	Site URL: https://example.com/wp
	Home URL: https://example.com
	WP Multisite: No
	Max Upload Size: 16 MB
	Memory limit: 40M
	Max Memory limit: 256M
	Permalink Structure: /%category%/%year%/%monthnum%/%day%/%postname%/
	Language: en_GB
	Timezone: Europe/London
	Admin Email: jamie@example.com
	Debug Mode: Active

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

== User ==
	Role: administrator
	WP Profile lang: en-GB
	User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

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

	Elementor Pro
		Version: 3.21.3
		Author: Elementor.com


== Must-Use Plugins ==
	Bedrock Autoloader
		Version: 1.0.3
		Author: Roots

	Disable status tests
		Version: 1.0.0
		Author: Roots

	Register Theme Directory
		Version: 1.0.0
		Author: Roots


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

== Integrations ==
	


== Elementor Experiments ==
	Improved Asset Loading: Active by default
	Improved CSS Loading: Active
	Inline Font Icons: Inactive
	Additional Custom Breakpoints: Inactive
	admin_menu_rearrangement: Inactive by default
	Flexbox Container: Active
	Upgrade Swiper Library: Active
	Grid Container: Inactive
	Nested Elements Performance: Inactive by default
	Optimized Control Loading: Inactive
	Default to New Theme Builder: Active
	Hello Theme Header & Footer: Inactive
	Elementor Home Screen: Active by default
	Editor Top Bar: Inactive
	Build with AI: Inactive
	Landing Pages: Inactive
	Nested Elements: Inactive
	Lazy Load Background Images: Inactive
	Display Conditions: Inactive
	Form Submissions: Active
	Menu: Inactive
	Taxonomy Filter: Inactive


== Log ==
	
Log: showing 20 of 402024-04-30 11:45:51 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.21.0',
  'to' => '3.21.1',
)]
2024-05-07 10:26:52 [info] Update DB has been started [array (
  'plugin' => 'Elementor',
  'from' => '3.21.3',
  'to' => '3.21.4',
)]
2024-05-07 10:26:52 [info] elementor::elementor_updater Started 
2024-05-07 10:26:52 [info] Elementor/Upgrades - _on_each_version Start  
2024-05-07 10:26:52 [info] Elementor/Upgrades - _on_each_version Finished 
2024-05-07 10:26:52 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor',
  'from' => '3.21.3',
  'to' => '3.21.4',
)]
2024-05-07 10:26:55 [info] Update DB has been started [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.21.1',
  'to' => '3.21.2',
)]
2024-05-07 10:26:55 [info] elementor-pro::elementor_pro_updater Started 
2024-05-07 10:26:55 [info] Elementor Pro/Upgrades - _on_each_version Start  
2024-05-07 10:26:55 [info] Elementor Pro/Upgrades - _on_each_version Finished 
2024-05-07 10:26:55 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.21.1',
  'to' => '3.21.2',
)]
2024-05-13 09:24:28 [info] Update DB has been started [array (
  'plugin' => 'Elementor',
  'from' => '3.21.4',
  'to' => '3.21.5',
)]
2024-05-13 09:24:28 [info] elementor::elementor_updater Started 
2024-05-13 09:24:28 [info] Elementor/Upgrades - _on_each_version Start  
2024-05-13 09:24:28 [info] Elementor/Upgrades - _on_each_version Finished 
2024-05-13 09:24:28 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor',
  'from' => '3.21.4',
  'to' => '3.21.5',
)]
2024-05-26 15:33:43 [info] elementor::elementor_updater Started 
2024-05-26 15:33:43 [info] Elementor/Upgrades - _on_each_version Start  
2024-05-26 15:33:43 [info] Elementor/Upgrades - _on_each_version Finished 
2024-05-26 15:33:43 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor',
  'from' => '3.21.5',
  'to' => '3.21.8',
)]

PHP: showing 3 of 3PHP: 2024-05-15 07:22:43 [warning X 2][/var/www/vhosts/example.com/releases/127/web/app/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php::150] Undefined array key "condition_type" [array (
  'trace' => '
#0: /var/www/vhosts/example.com/releases/127/web/app/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: /var/www/vhosts/example.com/releases/127/web/app/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php(120): class type array_map()
#3: /var/www/vhosts/example.com/releases/127/web/app/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: /var/www/vhosts/example.com/releases/127/web/app/plugins/elementor/data/base/endpoint.php(158): ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates -> get_items()
',
)]
PHP: 2024-05-26 15:35:03 [warning X 8][/home/jamie/projects/example.com/web/app/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php::150] Undefined array key "condition_type" [array (
  'trace' => '
#0: /home/jamie/projects/example.com/web/app/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: /home/jamie/projects/example.com/web/app/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates.php(120): class type array_map()
#3: /home/jamie/projects/example.com/web/app/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: /home/jamie/projects/example.com/web/app/plugins/elementor/data/base/endpoint.php(158): ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates -> get_items()
',
)]
PHP: 2024-05-26 15:41:39 [warning X 1][/home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php::41] Cannot modify header information - headers already sent by (output started at /home/jamie/projects/example.com/web/app/plugins/elementor-pro/modules/screenshots/module.php:33) [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]



== Elementor - Compatibility Tag ==
	
	Elementor Pro: Compatible

== Elementor Pro - Compatibility Tag ==

Agreement

  • I agree that my issue may be closed without action if it doesn't meet all the requirements.
@jamieburchell jamieburchell added the status/awaiting_triage Indicates when an Issue, Pull Request, or Discussion awaits to be triaged. label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/awaiting_triage Indicates when an Issue, Pull Request, or Discussion awaits to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant