Skip to content

Remove rest_error_handler #12219

@stoyan0v

Description

@stoyan0v

Prerequisites

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

Description

Dear Elementor Support, please remove rest_error_handler method, along with add_action( 'rest_api_init', [ $this, 'register_rest_error_handler' ] );, because these two methods are causing issues with every plugin, which uses WP REST API.

The problem is that when you set the following:
set_error_handler( [ $logger_manager, 'rest_error_handler' ], E_ALL );, you are allowing all errors/notices/warngins to be displayed. From there you show the error message if the WP_DEBUG is enabled or a message to see the System Info of Elementor.

It's not ok to show such messages when the debug is disabled.
For example, your hook is used on our plugin page, and you show your message because our plugin generates the following notice:

Deprecated: strpos(): Non-string needles will be interpreted as strings in the future

We know about this warning, and we will fix it soon, but I don't see a reason to show such message in OUR endpoint. Even when the notice is suppressed using @.

At least, if you want to have such error handler, check the error_file param or something else, but do not change the way, how WP debug works.

I will be happy to provide more information or anything else if you need my help.

Regards,
Stanimir

Isolating the problem

  • [ x ] This bug happens with only Elementor plugin active (and Elementor Pro).
  • [ x ] This bug happens with a default WordPress theme active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates a bug with one or multiple components.compatibility/3rd-partyIndicates a compatibility problem with a 3rd-party plugin or theme.status/has-prIndicates that an Issue, or Discussion has a companion Pull Request awaiting to be merged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions