plugin development – Console errors in 6.0-RC1 Widget screen

Question

Sine 6.0-RC1 the following console error appears on the block widgets screen, on Firefox:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
NotEmpty@https://betatest.opajaap.nl/wp-includes/js/dist/widgets.js?ver=80e98954519d1dad7a91a2248dbc2cc9:1118:7
div
Edit@https://betatest.opajaap.nl/wp-includes/js/dist/widgets.js?ver=80e98954519d1dad7a91a2248dbc2cc9:1051:7
Edit@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:12908:7
withToolbarControls</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:12263:7
withInspectorControl</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:12475:26
custom_class_name_withInspectorControl</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:12582:35
withBlockControls</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:36311:33
withDuotoneControls</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:36678:32
withInspectorControls</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:36924:7
queryTopInspectorControls</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-library.js?ver=c0a77efe7e30b81595292ba7bdec3d8f:35990:7
withMoveToWidgetAreaToolbarItem</<@https://betatest.opajaap.nl/wp-includes/js/dist/edit-widgets.js?ver=6d1c3f1e5fbca4e69781de58b399425e:2327:7
FilteredComponentRenderer@https://betatest.opajaap.nl/wp-includes/js/dist/components.js?ver=704ed65a1b8b5c891184113526f15ce4:73834:9BlockListBlock@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:18670:7
withDataAlign</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:12314:7
withBorderColorPaletteStyles</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:32258:7
withColorPaletteStyles</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:34086:7
withFontSizeInlineStyles</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:35312:31
withElementsStyles</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:36324:112
withDuotoneStyles</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:36722:29
withLayoutStyles</<@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:36944:7
FilteredComponentRenderer@https://betatest.opajaap.nl/wp-includes/js/dist/components.js?ver=704ed65a1b8b5c891184113526f15ce4:73834:9
ifCondition/</<@https://betatest.opajaap.nl/wp-includes/js/dist/compose.js?ver=da94d523b115836ddbf0b3b774ddd94a:2201:8
withDispatch/</<@https://betatest.opajaap.nl/wp-includes/js/dist/data.js?ver=38ad563aa39c8f314fe6f6e430d81a69:4316:46
withSelect/</<@https://betatest.opajaap.nl/wp-includes/js/dist/data.js?ver=38ad563aa39c8f314fe6f6e430d81a69:4160:31
@https://betatest.opajaap.nl/wp-includes/js/dist/compose.js?ver=da94d523b115836ddbf0b3b774ddd94a:2236:12
Items@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:31568:7
BlockListItems
BlockContextProvider@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:12861:7
UncontrolledInnerBlocks@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:31358:7
ControlledInnerBlocks@https://betatest.opajaap.nl/wp-includes/js/dist/block-editor.js?ver=e2ef0c6eb29e06ea9efedec924f1b9a8:31396:15

ETC ETC

I found out that this only happens when plugin wp-photo-album-plus is activated (of which i am the author), and it only happens when one specific classic widget out of a total of 20 is loaded (need not to be activated).

Even when i strip the code to the bare minimum this errors arise although it functions correct both at admin and froontend.

The bare minimum code is:

/* wppa-searchwidget.php
* Package: wp-photo-album-plus
*
* display the search widget
* Version 8.0.09.003
*
*/

class wppaSearchPhotos extends WP_Widget {

    /** constructor */
    function __construct() {
        $widget_ops = array(    'classname' => 'wppa_search_photos',
                                'description' => __( 'Display search photos dialog', 'wp-photo-album-plus' )
                            );
        parent::__construct( 'wppa_search_photos', __( 'WPPA+ Search Photos', 'wp-photo-album-plus' ), $widget_ops );
    }

    /** Haseeb Asif WP_Widget::widget */
    function widget( $args, $instance ) {

    }

    /** Haseeb Asif WP_Widget::update */
    function update( $new_instance, $old_instance ) {

        $instance = $new_instance;

        return $instance;
    }

    /** Haseeb Asif WP_Widget::form */
    function form( $instance ) {

    }

} // class wppaSearchPhotos

// register wppaSearchPhotos widget
add_action('widgets_init', 'wppa_register_wppaSearchPhotos' );

function wppa_register_wppaSearchPhotos() {
    register_widget( "wppaSearchPhotos" );
}

Do i something wrong or is this a 6.0-RC1 bug ?

0
Jacob N Breetvelt 1 week 2022-05-06T04:36:44-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse