{"id":150345,"date":"2021-11-22T21:41:53","date_gmt":"2021-11-22T21:41:53","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/remove-broken-images\/"},"modified":"2024-10-04T16:04:42","modified_gmt":"2024-10-04T16:04:42","slug":"remove-broken-images","status":"publish","type":"plugin","link":"https:\/\/azb.wordpress.org\/plugins\/remove-broken-images\/","author":339297,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.5.0-beta-1","stable_tag":"1.5.0","tested":"6.7.5","requires":"4.9","requires_php":"","requires_plugins":null,"header_name":"Remove Broken Images","header_author":"Room 34 Creative Services, LLC","header_description":"Very simply, uses JavaScript to remove broken images from page display.","assets_banners_color":"90daee","last_updated":"2024-10-04 16:04:42","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/room34.com\/payments","header_plugin_uri":"https:\/\/room34.com","header_author_uri":"http:\/\/room34.com","rating":4,"author_block_rating":0,"active_installs":1000,"downloads":14302,"num_ratings":4,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","faq","changelog"],"tags":{"1.1.0":{"tag":"1.1.0","author":"room34","date":"2021-11-22 21:41:46"},"1.2.0":{"tag":"1.2.0","author":"room34","date":"2021-11-24 15:25:24"},"1.3.0":{"tag":"1.3.0","author":"room34","date":"2022-07-20 13:44:31"},"1.3.1":{"tag":"1.3.1","author":"room34","date":"2023-10-25 17:06:29"},"1.4.0":{"tag":"1.4.0","author":"room34","date":"2024-04-09 18:51:04"},"1.4.1":{"tag":"1.4.1","author":"room34","date":"2024-04-23 21:45:36"},"1.4.2-beta-1":{"tag":"1.4.2-beta-1","author":"room34","date":"2024-04-23 22:16:11"},"1.5.0":{"tag":"1.5.0","author":"room34","date":"2024-10-04 16:04:42"}},"upgrade_notice":[],"ratings":{"1":1,"2":0,"3":0,"4":0,"5":3},"assets_icons":{"icon-256x256.png":{"filename":"icon-256x256.png","revision":2633771,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":2633771,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2633771,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2633771,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.1.0","1.2.0","1.3.0","1.3.1","1.4.0","1.4.1","1.4.2-beta-1","1.5.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[128337,226431,233,205290,3511],"plugin_category":[],"plugin_contributors":[92733],"plugin_business_model":[],"class_list":["post-150345","plugin","type-plugin","status-publish","hentry","plugin_tags-broken-images","plugin_tags-deleted-images","plugin_tags-media-library","plugin_tags-missing-images","plugin_tags-remove","plugin_contributors-room34","plugin_committers-room34","plugin_committers-room34alt","plugin_support_reps-room34alt"],"banners":{"banner":"https:\/\/ps.w.org\/remove-broken-images\/assets\/banner-772x250.png?rev=2633771","banner_2x":"https:\/\/ps.w.org\/remove-broken-images\/assets\/banner-1544x500.png?rev=2633771","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/remove-broken-images\/assets\/icon.svg?rev=2633771","icon":"https:\/\/ps.w.org\/remove-broken-images\/assets\/icon.svg?rev=2633771","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This is an extremely simple plugin that uses jQuery to remove broken images from displaying on your pages.<\/p>\n\n<p>Note that version 1 does <em>not<\/em> alter any content in the database, nor does it remove the image tags from the initial HTML output of the page, so it doesn't stop 404 errors, nor does it benefit SEO or PageSpeed scores. It does, however, prevent the dreaded \"broken image\" icon from appearing in your pages, and in most cases it will remove the blank space some browsers allocate for images as they are loading.<\/p>\n\n<p><strong>Coming in version 2:<\/strong> We'll be adding an admin tool to let you see a list of posts and pages containing broken images, along with a tool to automatically remove their <code>img<\/code> tags from the database.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id='i%20installed%20and%20activated%20the%20plugin.%20now%20what%3F'><h3>I installed and activated the plugin. Now what?<\/h3><\/dt>\n<dd><p>That's it! There is no configuration necessary. The plugin adds a compact bit of JavaScript that detects if an image is returning a 404 error, and removes its HTML code from displaying on the page.<\/p><\/dd>\n<dt id='does%20this%20plugin%20delete%20the%20image%20code%20from%20my%20page%2Fpost%20in%20the%20wordpress%20database%3F'><h3>Does this plugin delete the image code from my page\/post in the WordPress database?<\/h3><\/dt>\n<dd><p>No, version 1 does not make any changes whatsoever to your database. It also does not remove the missing image file's URL from the HTML that is sent to the user's web browser; it removes the tags from the DOM (Document Object Model) <em>after<\/em> the page has been loaded, using JavaScript, to prevent \"broken image\" icons, extra white space, and links\/captions associated with those missing images from displaying.<\/p><\/dd>\n<dt id='how%20can%20i%20redirect%20to%20the%20home%20page%20when%20an%20image%20is%20missing%20on%20a%20post%3F'><h3>How can I redirect to the home page when an image is missing on a post?<\/h3><\/dt>\n<dd><p>The <code>r34rbi_missing_image<\/code> jQuery hook (added in version 1.4.0) allows you to modify the plugin's behavior with custom code, whenever a missing image is encountered. It is used by the <code>r34rbi_redirect_on_missing_image<\/code> PHP filter (also added in version 1.4.0) to easily redirect to the home page in this situation, by adding this snippet of PHP code to your theme:<\/p>\n\n<pre><code>add_filter('r34rbi_redirect_on_missing_image', '__return_true');\n<\/code><\/pre>\n\n<p>You can replace <code>'__return_true'<\/code> with a custom callback function to change the redirect URL to something other than your site's home page.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.5.0 - 2024.10.04<\/h4>\n\n<ul>\n<li>Features:\n\n<ul>\n<li>Added logic to remove SEO <code>meta<\/code> tags for <code>og:image<\/code> and <code>twitter:image<\/code> if they match the URL of an image the plugin is removing from the page content.<\/li>\n<li>Expanded logic from 1.4.1 by adding a check for the Block Editor page.<\/li>\n<\/ul><\/li>\n<li>Development:\n\n<ul>\n<li>Refactored code into <code>R34RBI<\/code> class.<\/li>\n<li>Created framework for admin settings page (not currently active, but will be used for version 2.0 features).<\/li>\n<li>Set <code>$translate<\/code> input parameter to <code>false<\/code> on <code>get_plugin_data()<\/code> call, as it may cause PHP notices as of WordPress 6.7. See the <a href=\"https:\/\/core.trac.wordpress.org\/ticket\/62154#comment:8\">WordPress Trac<\/a> for more details.<\/li>\n<\/ul><\/li>\n<li>i18n:\n\n<ul>\n<li>Added <code>.pot<\/code> file for translation support.<\/li>\n<\/ul><\/li>\n<li>Bumped \"Tested up to\" to 6.7.<\/li>\n<\/ul>\n\n<h4>1.4.1 - 2024.04.23<\/h4>\n\n<ul>\n<li>Added logic to prevent plugin's code from loading on admin or login pages.<\/li>\n<\/ul>\n\n<h4>1.4.0 - 2024.04.09<\/h4>\n\n<ul>\n<li>Added <code>r34rbi_missing_image<\/code> jQuery hook to allow custom functionality to override the plugin's default behavior when a missing image is encountered. Also added <code>r34rbi_redirect_on_missing_image<\/code> PHP filter, to allow for an easy application of this functionality in your theme. See FAQs for code example.<\/li>\n<li>Bumped \"Tested up to\" to 6.5.<\/li>\n<\/ul>\n\n<h4>1.3.1 - 2023.07.23<\/h4>\n\n<ul>\n<li>Re-minified JS.<\/li>\n<li>Bumped \"Tested up to\" to 6.3.<\/li>\n<\/ul>\n\n<h4>1.3.0 - 2021.12.21<\/h4>\n\n<ul>\n<li>Added handling for <code>img<\/code> tags inserted dynamically into the DOM via AJAX.<\/li>\n<li>Added minified <code>script.min.js<\/code> file to reduce page payload.<\/li>\n<li>Reformatted source JavaScript code for legibility and added comments.<\/li>\n<\/ul>\n\n<h4>1.2.0 - 2021.11.22<\/h4>\n\n<ul>\n<li>Refactored all of the plugin's logic into jQuery, eliminating the need for using <code>the_content<\/code> filter to insert <code>onerror<\/code> into all <code>img<\/code> tags.<\/li>\n<\/ul>\n\n<h4>1.1.0 - 2021.11.22<\/h4>\n\n<ul>\n<li>Added separate <code>script.js<\/code> file; moved JavaScript logic from inline <code>onerror<\/code> attribute to a function that will also remove parent <code>a<\/code> element and ancestor <code>.wp-caption<\/code> element from the DOM, in addition to the <code>img<\/code> tag itself.<\/li>\n<\/ul>\n\n<h4>1.0.0 - 2021.11.20<\/h4>\n\n<ul>\n<li>Original version.<\/li>\n<\/ul>","raw_excerpt":"Very simply, uses JavaScript to remove broken images from page display.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/150345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=150345"}],"author":[{"embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/room34"}],"wp:attachment":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=150345"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=150345"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=150345"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=150345"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=150345"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=150345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}