WordPress error 2022

featured image error

Notice: Function register_block_script_handle was called incorrectly. The asset file for the “editorScript” defined in “contact-form-7/contact-form-selector” block definition is missing. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in

Notice: Function register_block_script_handle was called incorrectly. The asset file for the "editorScript" defined in "contact-form-7/contact-form-selector" block definition is missing. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in

Fix: open wordpress-web-folder/wp-content/plugins/contact-form-7/includes/block-editor/block.json

Go to line 43. Change from: 

"editorScript": "file:./index.js"

To:

"editorScript": "./index.js"

Save and problem solve.

_register_controls is deprecated since version 3.1.0! – WordPress error

Since WordPress has been reaching version 6 now, you experience errors when you are using it for a while, especially after an upgrade. For example,

Notice: _register_controls is deprecated since version 3.1.0! Use Elementor\Controls_Stack::register_controls() instead. in /home/ohbyxzoc/public_html/wp-includes/functions.php on line 5314

If you see any WordPress error, first of all, DON’T panic. We should set the debug mode to true to show the full details first.

1. Edit the file in /root_web_folder/wp-config.php
2. Find and change

define( ‘WP_DEBUG’, false );

to

define( ‘WP_DEBUG’, true );

Then copy your error to Google to search for solution. You may not get the solution in the first Google result. You may need to look for a couple of results before you can solve the problem.

For this example error, I found the solution in https://github.com/elementor/elementor/issues/17580

The plugin author should to replace the _register_controls() method with register_controls() removing the _ prefix (this was changed in Elementor 3.1.0).

So you just need to find the function in the file and change to the new function name and problem solved.

Deprecated: Function get_create_new_post_url is deprecated since version 3.3.0! Use Plugin::$instance->documents->get_create_new_post_url() instead.

Change the code from

if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {

to

if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', false ) ) {

Fatal error: Uncaught ReflectionException: Method get_site_editor_type does not exist in /var/www/web/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php:48 Stack trace: #0

Find that file and change the code from:

$reflection = new \ReflectionClass( $class_name ); //45 line
$method = $reflection->getMethod( 'get_site_editor_type' );

// It's own method, use it.
if ( $class_name === $method->class ) {
    return static::get_site_editor_type();
}

To

if (method_exists($class_name, "get_site_editor_type")) {
    $reflection = new \ReflectionClass( $class_name );
    $method = $reflection->getMethod( 'get_site_editor_type' );
    
    // It's own method, use it.
    if ( $class_name === $method->class ) {
        return static::get_site_editor_type();
    }
}

,