Skip to content

VideoPress: Doing it wrong warning caused by attempting to re-register Video block #44876

Closed

Description

@westonruter

Impacted plugin

Jetpack

Quick summary

I just updated my plugins and I notice that I'm getting a _doing_it_wrong() warning:

Function WP_Block_Type_Registry::register was called incorrectly. Block type "core/video" is already registered. (This message was added in version 5.0.0.)

I traced this down to the VideoPress module:

public function register_video_block_with_videopress() {
Blocks::jetpack_register_block(
'core/video',
array(
'render_callback' => array( $this, 'render_video_block_with_videopress' ),
)
);
}

The issue is that as of Gutenberg 21.4, the Video block is now registered as a dynamic block due to WordPress/gutenberg#70293. This will also be part of WordPress 6.9.

The VideoPress integration should be changed to using the render_block_core/video filter as opposed to attempting to define the underlying render_callback, which may be defined.

Aside: The filtering logic currently present in the render_video_block_with_videopress method should also be updated to use the HTML Tag Processor to update the src more reliably!

Steps to reproduce

  1. Update Gutenberg to the latest version.
  2. Look at PHP error log.

Site owner impact

Fewer than 20% of the total website/platform users

Severity

Minor

What other impact(s) does this issue have?

No revenue impact

If a workaround is available, please outline it here.

No response

Platform (Simple and/or Atomic)

Self-hosted

Activity

  1. added
    BugWhen a feature is broken and / or not performing as intended
    Needs triageTicket needs to be triaged
    on Aug 21, 2025
  2. added theissue type on Aug 21, 2025
  3. westonruter commented on Aug 21, 2025

    @westonruter
    ContributorAuthor

    VideoPress's registering of the Video block in this way also appears to prevent its core block styles from being loaded. Commenting out the above code fixes a CSS issue on my blog, while also eliminating the _doing_it_wrong() warning.

  4. westonruter commented on Aug 21, 2025

    @westonruter
    ContributorAuthor

    Note also that I am not using VideoPress on my blog, so I'm confused why this Video block is getting registered in the first place.

  5. jeherve commented on Aug 21, 2025

    @jeherve
    Member

    Thanks for the report. This is something we also discovered yesterday on our end, but it's good to get a confirmation and a direction towards a fix! :)

    Internal refererence: JETPACK-765

  6. peterwilsoncc commented on Sep 26, 2025

    @peterwilsoncc

    Work around for others hitting this bug an not using VideoPress:

    Do not use this if you are using VideoPress on your site, it will go badly for you.

    /**
     * Prevent VideoPress registering the core/video block.
     *
     * Runs on the `init, 5` action.
     *
     * This prevents VideoPress from modifying the Core Video block due to the notice it
     * currently throws on sites running the Gutenberg plugin.
     *
     * @see https://github.com/Automattic/jetpack/issues/44876
     */
    function prevent_videopress_notice() {
    	$vp_instance = \VideoPress_Gutenberg::init();
    	remove_action( 'init', array( $vp_instance, 'register_video_block_with_videopress' ) );
    }
    add_action( 'init', __NAMESPACE__ . '\\prevent_videopress_notice', 5 );
  7. westonruter commented on Sep 27, 2025

    @westonruter
    ContributorAuthor

    @peterwilsoncc I've fleshed this out into a standalone plugin which I've installed on my site:

    <?php
    /**
     * Plugin Name: Jetpack VideoPress Disable
     * Description: Prevent VideoPress registering the core/video block.
     * Plugin URI: https://github.com/Automattic/jetpack/issues/44876#issuecomment-3340814945
     * Author: Peter Wilson
     * Update URI: false
     */
    
    namespace JetpackVideoPressDisable;
    
    /**
     * Prevent VideoPress registering the core/video block.
     *
     * Runs on the `init, 5` action.
     *
     * This prevents VideoPress from modifying the Core Video block due to the notice it
     * currently throws on sites running the Gutenberg plugin.
     *
     * @see https://github.com/Automattic/jetpack/issues/44876
     */
    function prevent_videopress_notice() {
    	if ( ! method_exists( 'VideoPress_Gutenberg', 'init' ) ) {
    		return;
    	}
    
    	$vp_instance = \VideoPress_Gutenberg::init();
    	remove_action( 'init', array( $vp_instance, 'register_video_block_with_videopress' ) );
    }
    add_action( 'init', __NAMESPACE__ . '\\prevent_videopress_notice', 5 );
  8. helgatheviking commented on Oct 9, 2025

    @helgatheviking

    Confirming that I am still seeing this error

  9. iamtakashi commented on Nov 10, 2025

    @iamtakashi
    Contributor

    I also see the warning, and when I activate Jetpack, it seems to break the video block in the content. I can no longer see the video block from core.

    Image

  10. lancewillett commented on Nov 18, 2025

    @lancewillett
    Contributor

    Should be fixed with this change: #45967

  11. westonruter commented on Nov 18, 2025

    @westonruter
    ContributorAuthor

    @lancewillett can we be sure that the override won't run if VideoPress is not active on a site? It doesn't seem that PR currently accounts for that.

  12. lancewillett commented on Nov 18, 2025

    @lancewillett
    Contributor

    Good idea to test for that case and make sure, Weston.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions