Skip to content

Conversation

@t-hamano
Copy link

@t-hamano t-hamano commented Dec 21, 2025

Closes: https://meta.trac.wordpress.org/ticket/8149

This PR adds a plugin that displays a warning for blocks that contain inappropriate external resources. This helps encourage contributors to upload resources when creating documentation by copying content from external documents, preventing media from potentially disappearing in the future.

How this plugin works

  • Check the three blocks that allow you to set external resources as media.
  • Check whether the media URL matches your site's domain. If not, this plugin checks whether it matches one of the allowed domains. Finally, if the media URL does not match any domain, it is considered an inappropriate media resource.
  • Blocks with invalid media resources will have a red border and overlay.
    Additionally, the block toolbar will have a red icon button. Clicking that button will display a popover with details about the error.

Testing Instructions

Use the .wp-env.override.json file to map the plugin to your local wp-env environment:

{
	"plugins": [
		"./your/plugins/plugin",
		"../path/to/wordpress.org/wordpress.org/public_html/wp-content/plugins/wporg-media-resource-checker"
	]
}

Screenshot

image

@t-hamano t-hamano force-pushed the media-resource-checker branch from a189f1f to d12ab9f Compare December 21, 2025 06:45
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is the right place for this file; maybe it should be in a higher directory to cover all plugin files?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant