{
  "generator": "Quick Edit Featured Image build",
  "date_created": "2026-10-07 00:00",
  "snippets": [
    {
      "name": "Quick Edit Featured Image",
      "desc": "Set and remove featured images in Quick Edit. Use either the plugin or this snippet.",
      "code": "/**\n * Plugin Name:       Quick Edit Featured Image\n * Plugin URI:        https://github.com/deckerweb/quick-edit-featured-image\n * Description:       Set, replace and remove featured images directly in Quick Edit for posts, pages and supported public post types.\n * Version:           1.4.2\n * Requires at least: 6.7\n * Requires PHP:      8.1\n * Author:            David Decker – DECKERWEB\n * Author URI:        https://github.com/deckerweb\n * License:           GPL v2 or later\n * License URI:       https://www.gnu.org/licenses/gpl-2.0.html\n * Text Domain:       quick-edit-featured-image\n * Domain Path:       /languages/\n * Update URI:        https://github.com/deckerweb/quick-edit-featured-image\n * GitHub Plugin URI: https://github.com/deckerweb/quick-edit-featured-image\n *\n * Copyright © 2025–2026 David Decker – DECKERWEB.\n * SPDX-License-Identifier: GPL-2.0-or-later\n *\n * Primary Branch:    main\n * @package QuickEditFeaturedImage\n */\n\n/** Prevent direct access. */\nif ( ! defined( 'ABSPATH' ) ) {\n\texit;\n}\n\n// The evaluated snippet remains self-contained; embedded components belong to the plugin.\nif ( 'quick-edit-featured-image/quick-edit-featured-image.php' === plugin_basename( __FILE__ )\n\t&& version_compare( PHP_VERSION, '8.1', '>=' ) ) {\n\trequire_once __DIR__ . '/includes/deckerweb-plugin-library/bootstrap.php';\n\tdeckerweb_library_register_v2( __FILE__, array(), __DIR__ . '/includes/deckerweb-plugin-library' );\n}\n\nif ( ! class_exists( 'DDW_Quick_Edit_Featured_Image' ) ) :\n\n/**\n * Adds featured-image previews and editing to supported admin post-type tables.\n *\n * WordPress owns nonce/capability validation and attachment saving through Quick Edit.\n * Installed-plugin integrations are isolated from the alternative evaluated snippet.\n */\nclass DDW_Quick_Edit_Featured_Image {\n\tprivate const VERSION = '1.4.2';\n\tprivate const COLUMN = 'qefi_featured_image';\n\t/** Original placeholder artwork from 1.3.0. */\n\tprivate const PLACEHOLDER_ICON = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0icmdiYSgxNzMsMTg0LDE5NCwxKSI+PHBhdGggZD0iTTIxIDE1VjE4SDI0VjIwSDIxVjIzSDE5VjIwSDE2VjE4SDE5VjE1SDIxWk0yMS4wMDgyIDNDMjEuNTU2IDMgMjIgMy40NDQ5NSAyMiAzLjk5MzRWMTNIMjBWNUg0VjE4Ljk5OUwxNCA5TDE3IDEyVjE0LjgyOUwxNCAxMS44Mjg0TDYuODI3IDE5SDE0VjIxSDIuOTkxOEMyLjQ0NDA1IDIxIDIgMjAuNTU1MSAyIDIwLjAwNjZWMy45OTM0QzIgMy40NDQ3NiAyLjQ1NTMxIDMgMi45OTE4IDNIMjEuMDA4MlpNOCA3QzkuMTA0NTcgNyAxMCA3Ljg5NTQzIDEwIDlDMTAgMTAuMTA0NiA5LjEwNDU3IDExIDggMTFDNi44OTU0MyAxMSA2IDEwLjEwNDYgNiA5QzYgNy44OTU0MyA2Ljg5NTQzIDcgOCA3WiI+PC9wYXRoPjwvc3ZnPg==';\n\tprivate $translation_locale = null;\n\tprivate $strings = array();\n\tprivate $updater_registered = false;\n\tprivate $component_error = false;\n\n\t/**\n\t * Register admin editing, translations, diagnostics and installed-plugin integrations.\n\t *\n\t * @return void Registers WordPress hooks; no persistent data is changed.\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'init', array( $this, 'load_translations' ), 20 );\n\t\tadd_filter( 'load_textdomain_mofile', array( $this, 'component_language_file' ), 10, 2 );\n\t\tadd_action( 'init', array( $this, 'register_updater' ), 30 );\n\t\tadd_action( 'admin_notices', array( $this, 'component_notice' ) );\n\t\tadd_action( 'network_admin_notices', array( $this, 'component_notice' ) );\n\t\tadd_filter( 'manage_posts_columns', array( $this, 'featured_image_column' ), 10, 2 );\n\t\tadd_filter( 'manage_pages_columns', array( $this, 'featured_image_column' ) );\n\t\tadd_action( 'manage_posts_custom_column', array( $this, 'column_display_featured_image' ), 10, 2 );\n\t\tadd_action( 'manage_pages_custom_column', array( $this, 'column_display_featured_image' ), 10, 2 );\n\t\tadd_action( 'quick_edit_custom_box', array( $this, 'quick_edit_featured_image' ), 10, 2 );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'admin_inline_styles_scripts' ) );\n\t\tadd_filter( 'debug_information', array( $this, 'site_health_debug_info' ), 9 );\n\t}\n\n\t/**\n\t * Load translations once per current administrator locale and reset cached labels.\n\t *\n\t * @return void Loads host language resources; custom snippet resources are supported.\n\t */\n\tpublic function load_translations() {\n\t\t$domain = 'quick-edit-featured-image';\n\t\t$locale = apply_filters( 'plugin_locale', get_user_locale(), $domain );\n\t\tif ( $this->translation_locale === $locale ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->translation_locale = $locale;\n\t\t$this->strings = array();\n\t\tload_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo', $locale );\n\t\tif ( $this->is_plugin_file() ) {\n\t\t\tload_plugin_textdomain( $domain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n\t\t\tload_textdomain( $domain, __DIR__ . '/languages/' . $domain . '-' . $locale . '.mo', $locale );\n\t\t}\n\t}\n\n\t/**\n\t * Keep host and component messages together when the Library reloads a locale.\n\t *\n\t * @param string $mofile Requested MO resource path.\n\t * @param string $domain Requested translation domain.\n\t * @return string Combined host resource for this embedded copy, otherwise the original path.\n\t */\n\tpublic function component_language_file( $mofile, $domain ) {\n\t\tif ( ! $this->is_plugin_file() || 'quick-edit-featured-image' !== $domain ) {\n\t\t\treturn $mofile;\n\t\t}\n\t\t$locale = basename( $mofile, '.mo' );\n\t\tif ( ! in_array( $locale, array( 'de_DE', 'de_DE_formal' ), true )\n\t\t\t|| wp_normalize_path( dirname( $mofile ) ) !== wp_normalize_path( __DIR__ . '/includes/deckerweb-plugin-library/languages' ) ) {\n\t\t\treturn $mofile;\n\t\t}\n\t\t// User-maintained custom messages retain precedence over the bundled catalog.\n\t\tload_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo', $locale );\n\t\treturn __DIR__ . '/languages/' . $domain . '-' . $locale . '.mo';\n\t}\n\n\t/**\n\t * Check whether this is the installed plugin under its stable directory.\n\t *\n\t * @return bool True for the installed plugin; false for an evaluated snippet.\n\t */\n\tprivate function is_plugin_file() {\n\t\treturn 'quick-edit-featured-image/quick-edit-featured-image.php' === plugin_basename( __FILE__ );\n\t}\n\n\t/**\n\t * Resolve the table post type, including inline AJAX request fallbacks.\n\t *\n\t * @return string|null Valid screen/global/request post-type slug, or null.\n\t */\n\tprivate function get_current_post_type() {\n\t\tglobal $post, $typenow;\n\t\t$screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;\n\t\tif ( $screen && ! empty( $screen->post_type ) ) {\n\t\t\treturn $screen->post_type;\n\t\t}\n\t\tif ( ! empty( $typenow ) ) {\n\t\t\treturn $typenow;\n\t\t}\n\t\tif ( $post instanceof WP_Post ) {\n\t\t\treturn $post->post_type;\n\t\t}\n\t\treturn isset( $_REQUEST['post_type'] ) && is_string( $_REQUEST['post_type'] )\n\t\t\t? sanitize_key( wp_unslash( $_REQUEST['post_type'] ) ) : null;\n\t}\n\n\t/**\n\t * Normalize supported exclusion input into unique sanitized post-type slugs.\n\t *\n\t * @param mixed $values Scalar or array of candidate post-type values.\n\t * @return string[] Unique nonempty post-type slugs.\n\t */\n\tprivate function normalize_post_types( $values ) {\n\t\t$types = array();\n\t\tforeach ( (array) $values as $value ) {\n\t\t\tif ( is_string( $value ) ) {\n\t\t\t\t$value = sanitize_key( $value );\n\t\t\t\tif ( '' !== $value ) {\n\t\t\t\t\t$types[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn array_values( array_unique( $types ) );\n\t}\n\n\t/**\n\t * Combine built-in exclusions with the user constant and existing filter.\n\t *\n\t * @return string[] Normalized post-type exclusions.\n\t */\n\tprivate function post_types_disable() {\n\t\t$defaults = array( 'qefi_test_type', 'mb-post-type', 'mb-taxonomy', 'meta-box', 'mb-relationship', 'mb-settings-page', 'mb-views' );\n\t\tif ( class_exists( 'WooCommerce' ) ) {\n\t\t\t$defaults[] = 'product';\n\t\t}\n\t\t$user = defined( 'QEFI_DISABLED_TYPES' ) ? $this->normalize_post_types( QEFI_DISABLED_TYPES ) : array();\n\t\t/**\n\t\t * Filter disabled post-type slugs, including built-in and configured exclusions.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param string[] $disabled Post-type slugs; return the desired exclusions.\n\t\t */\n\t\treturn $this->normalize_post_types( apply_filters( 'ddw/quick_edit/post_types_disable', array_merge( $defaults, $user ) ) );\n\t}\n\n\t/**\n\t * Check whether a viewable post type supports featured images and is enabled.\n\t *\n\t * @param string|null $post_type Candidate post-type slug.\n\t * @return bool Whether the plugin should add its column and editing controls.\n\t */\n\tprivate function supports_post_type( $post_type ) {\n\t\treturn is_string( $post_type ) && '' !== $post_type\n\t\t\t&& ! in_array( $post_type, $this->post_types_disable(), true )\n\t\t\t&& is_post_type_viewable( $post_type )\n\t\t\t&& post_type_supports( $post_type, 'thumbnail' );\n\t}\n\n\t/**\n\t * Resolve raw localized labels and cache them per post type.\n\t *\n\t * @param string $type Requested label key.\n\t * @param string|null $post_type Post-type slug, or null to use the current table.\n\t * @return string Raw label, or an empty string for an unknown key.\n\t */\n\tprivate function image_strings( $type, $post_type = null ) {\n\t\t$this->load_translations();\n\t\t$post_type = $post_type ?: $this->get_current_post_type();\n\t\t$key = (string) $post_type;\n\t\tif ( ! isset( $this->strings[ $key ] ) ) {\n\t\t\t$object = get_post_type_object( $post_type );\n\t\t\t$labels = $object ? $object->labels : null;\n\t\t\t$featured = ! empty( $labels->featured_image ) ? $labels->featured_image : __( 'Featured Image', 'quick-edit-featured-image' );\n\t\t\t$strings = array(\n\t\t\t\t'image' => _x( 'Image', 'Name of the Admin List Table column', 'quick-edit-featured-image' ),\n\t\t\t\t'featured_image' => $featured,\n\t\t\t\t/* translators: %s: post type’s featured image label. */\n\t\t\t\t'change_featured_image' => sprintf( __( 'Change %s', 'quick-edit-featured-image' ), $featured ),\n\t\t\t\t/* translators: %s: post type's featured image label. */\n\t\t\t\t'set_featured_image' => ! empty( $labels->set_featured_image ) ? $labels->set_featured_image : sprintf( __( 'Set %s', 'quick-edit-featured-image' ), $featured ),\n\t\t\t\t/* translators: %s: post type's featured image label. */\n\t\t\t\t'remove_featured_image' => ! empty( $labels->remove_featured_image ) ? $labels->remove_featured_image : sprintf( __( 'Remove %s', 'quick-edit-featured-image' ), $featured ),\n\t\t\t\t/* translators: %s: post type's featured image label. */\n\t\t\t\t'image_ok' => sprintf( __( '%s is set', 'quick-edit-featured-image' ), $featured ),\n\t\t\t\t/* translators: %s: post type's featured image label. */\n\t\t\t\t'placeholder' => sprintf( __( 'No %s yet', 'quick-edit-featured-image' ), $featured ),\n\t\t\t);\n\t\t\tif ( defined( 'QEFI_GERMAN_STRINGS' ) && is_string( QEFI_GERMAN_STRINGS ) && 'ja' === sanitize_key( QEFI_GERMAN_STRINGS ) && in_array( get_user_locale(), array( 'de_DE', 'de_DE_formal', 'de_AT', 'de_CH', 'de_LU' ), true ) ) {\n\t\t\t\t$strings['image'] = 'Bild';\n\t\t\t\t$strings['change_featured_image'] = $featured . ' ändern';\n\t\t\t\t$strings['set_featured_image'] = $featured . ' festlegen';\n\t\t\t\t$strings['remove_featured_image'] = $featured . ' entfernen';\n\t\t\t\t$strings['image_ok'] = $featured . ' ist gesetzt';\n\t\t\t\t$strings['placeholder'] = 'Derzeit kein ' . $featured . ' festgelegt';\n\t\t\t}\n\t\t\t$this->strings[ $key ] = $strings;\n\t\t}\n\t\treturn $this->strings[ $key ][ $type ] ?? '';\n\t}\n\n\t/**\n\t * Insert the image column once for a supported post-type table.\n\t *\n\t * @param array $columns Existing column keys and labels.\n\t * @param string|null $post_type Explicit hook post type, or null for screen lookup.\n\t * @return array Column labels with the image column when supported.\n\t */\n\tpublic function featured_image_column( $columns, $post_type = null ) {\n\t\t$post_type = $post_type ?: $this->get_current_post_type();\n\t\tif ( ! $this->supports_post_type( $post_type ) || isset( $columns[ self::COLUMN ] ) ) {\n\t\t\treturn $columns;\n\t\t}\n\t\treturn array_slice( $columns, 0, 1, true )\n\t\t\t+ array( self::COLUMN => esc_html( $this->image_strings( 'image', $post_type ) ) )\n\t\t\t+ array_slice( $columns, 1, null, true );\n\t}\n\n\t/**\n\t * Render the preview or original placeholder in this plugin column.\n\t *\n\t * @param string $column_name Current table column key.\n\t * @param int $post_id Post ID whose featured image is displayed.\n\t * @return void Outputs escaped markup; edit controls require edit_post permission.\n\t */\n\tpublic function column_display_featured_image( $column_name, $post_id ) {\n\t\tif ( self::COLUMN !== $column_name ) {\n\t\t\treturn;\n\t\t}\n\t\t$post_type = get_post_type( $post_id );\n\t\tif ( ! $this->supports_post_type( $post_type ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$id = absint( get_post_thumbnail_id( $post_id ) );\n\t\t$url = $id ? wp_get_attachment_image_url( $id, 'thumbnail' ) : false;\n\t\tif ( current_user_can( 'edit_post', $post_id ) ) {\n\t\t\t$action = $this->image_strings( $url ? 'change_featured_image' : 'set_featured_image', $post_type );\n\t\t\tprintf( '<button type=\"button\" class=\"button-link editinline qefi-image-data\" data-id=\"%1$d\" data-url=\"%2$s\" aria-label=\"%3$s\" title=\"%3$s\"><img%4$s src=\"%5$s\" alt=\"\" /></button>', (int) ( $url ? $id : -1 ), $url ? esc_url( $url ) : '', esc_attr( $action ), $url ? '' : ' class=\"qefi-placeholder\"', $url ? esc_url( $url ) : esc_attr( self::PLACEHOLDER_ICON ) );\n\t\t} else {\n\t\t\t$status = $this->image_strings( $url ? 'image_ok' : 'placeholder', $post_type );\n\t\t\tprintf( '<span class=\"qefi-image-data\" data-id=\"%1$d\" data-url=\"%2$s\"><span class=\"screen-reader-text\">%3$s</span><img%4$s src=\"%5$s\" alt=\"\" /></span>', (int) ( $url ? $id : -1 ), $url ? esc_url( $url ) : '', esc_html( $status ), $url ? '' : ' class=\"qefi-placeholder\"', $url ? esc_url( $url ) : esc_attr( self::PLACEHOLDER_ICON ) );\n\t\t}\n\t}\n\n\t/**\n\t * Render image controls in the native Quick Edit fieldset.\n\t *\n\t * @param string $column_name Current Quick Edit column key.\n\t * @param string $post_type Explicit post type provided by WordPress.\n\t * @return void Outputs escaped markup; WordPress validates saving and permissions.\n\t */\n\tpublic function quick_edit_featured_image( $column_name, $post_type ) {\n\t\tif ( self::COLUMN !== $column_name || ! $this->supports_post_type( $post_type ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<fieldset class=\"inline-edit-col-left qefi-featured-image\">\n\t\t\t<legend class=\"screen-reader-text\"><?php echo esc_html( $this->image_strings( 'featured_image', $post_type ) ); ?></legend>\n\t\t\t<div class=\"inline-edit-col\">\n\t\t\t\t<span class=\"title\" aria-hidden=\"true\"><?php echo esc_html( $this->image_strings( 'featured_image', $post_type ) ); ?></span>\n\t\t\t\t<button type=\"button\" class=\"button qefi-upload-img\" aria-label=\"<?php echo esc_attr( $this->image_strings( 'set_featured_image', $post_type ) ); ?>\"><?php echo esc_html( $this->image_strings( 'set_featured_image', $post_type ) ); ?></button>\n\t\t\t\t<input type=\"hidden\" class=\"qefi-thumbnail-id\" name=\"_thumbnail_id\" value=\"-1\" disabled />\n\t\t\t\t<button type=\"button\" class=\"button-link submitdelete qefi-remove-img\" hidden><?php echo esc_html( $this->image_strings( 'remove_featured_image', $post_type ) ); ?></button>\n\t\t\t\t<p class=\"qefi-save-hint\" hidden><?php echo esc_html__( 'Save this change with Update.', 'quick-edit-featured-image' ); ?></p>\n\t\t\t</div>\n\t\t</fieldset>\n\t\t<?php\n\t}\n\n\t/**\n\t * Load editing assets only on supported post-type list tables.\n\t *\n\t * @param string $hook Admin screen hook suffix.\n\t * @return void Enqueues media and dependent inline assets on eligible screens.\n\t */\n\tpublic function admin_inline_styles_scripts( $hook ) {\n\t\tif ( 'edit.php' !== $hook || ! $this->supports_post_type( $this->get_current_post_type() ) ) {\n\t\t\treturn;\n\t\t}\n\t\twp_enqueue_media();\n\t\twp_register_script( 'qefi-featured-image', false, array( 'jquery', 'inline-edit-post', 'media-views', 'wp-a11y' ), self::VERSION, true );\n\t\twp_enqueue_script( 'qefi-featured-image' );\n\t\twp_add_inline_style( 'list-tables', $this->inline_css() );\n\t\twp_localize_script( 'qefi-featured-image', 'qefi_strings', array( 'set_featured_image' => $this->image_strings( 'set_featured_image' ), 'change_featured_image' => $this->image_strings( 'change_featured_image' ), 'image_selected' => __( 'Image selected. Save this change with Update.', 'quick-edit-featured-image' ), 'image_removed' => __( 'Image removal selected. Save this change with Update.', 'quick-edit-featured-image' ), 'image_restored' => __( 'Original image state restored.', 'quick-edit-featured-image' ) ) );\n\t\twp_add_inline_script( 'qefi-featured-image', $this->inline_js() );\n\t}\n\n\t/** Generated from assets: run node tools/build.mjs after changing JS/CSS. */\n\t// BEGIN GENERATED ASSETS\n\t/**\n\t * Return the generated inline css source.\n\t *\n\t * @return string Embedded asset content.\n\t */\n\tprivate function inline_css() {\n\t\treturn <<<'QEFI_CSS'\nth.manage-column.column-qefi_featured_image {\n\ttext-align: center;\n\twidth: 6rem;\n}\n.column-qefi_featured_image img,\n.qefi-featured-image .qefi-upload-img img {\n\tmax-width: 5.25rem;\n\tmax-height: 4.85rem;\n\twidth: auto;\n\theight: auto;\n}\n.column-qefi_featured_image a,\n.column-qefi_featured_image button {\n\tdisplay: inline-block;\n\tborder: 0;\n\tpadding: 0;\n\tcursor: pointer;\n}\n/* Preserve the original 1.3.0 image border, including its reserved hover space. */\n.column-qefi_featured_image img {\n\tborder: 2px solid transparent;\n\tpadding: 2px;\n}\n.column-qefi_featured_image a:hover img,\n.column-qefi_featured_image button:hover img {\n\tborder-color: #ddd;\n}\n.column-qefi_featured_image a:active img,\n.column-qefi_featured_image button:active img {\n\tborder-color: #2271b1;\n}\n.column-qefi_featured_image a:focus,\n.column-qefi_featured_image button:focus,\n.qefi-featured-image button:focus {\n\toutline: 2px solid #2271b1;\n\toutline-offset: 2px;\n}\n.qefi-featured-image .inline-edit-col {\n\tmargin-top: 1rem;\n}\n.qefi-featured-image .title {\n\tdisplay: block;\n\tmargin-bottom: .7rem;\n}\n.qefi-featured-image .qefi-upload-img:not(.button) {\n\tbackground: none;\n\tborder: 0;\n\tpadding: 0;\n\tcursor: pointer;\n}\n.qefi-featured-image .qefi-remove-img {\n\tdisplay: block;\n\tcolor: #b32d2e;\n\tmargin-top: .5rem;\n}\n.qefi-featured-image .qefi-remove-img[hidden] {\n\tdisplay: none;\n}\n@media screen and (max-width: 782px) {\n\t/* The image column precedes the primary column and stays visible on mobile. */\n\t.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-qefi_featured_image::before {\n\t\tdisplay: none;\n\t}\n}\n\n.column-qefi_featured_image img.qefi-placeholder {\n\twidth: 5.25rem;\n\tmax-width: 100%;\n\theight: auto;\n}\n\n.qefi-featured-image .qefi-save-hint {\n\tmargin: .5rem 0 0;\n\tcolor: #50575e;\n\tfont-size: 12px;\n}\n.qefi-featured-image .qefi-save-hint[hidden] {\n\tdisplay: none;\n}\nQEFI_CSS;\n\t}\n\n\t/**\n\t * Return the generated inline js source.\n\t *\n\t * @return string Embedded asset content.\n\t */\n\tprivate function inline_js() {\n\t\treturn <<<'QEFI_JS'\n/* global jQuery, inlineEditPost, wp, qefi_strings */\n/**\n * Initialize native Quick Edit image controls after the admin DOM is ready.\n * @param {Function} $ WordPress-provided jQuery instance.\n * @returns {void} Registers editing and media callbacks.\n */\njQuery(function ($) {\n\t'use strict';\n\n\t// Core saves Quick Edit on Enter. Let image buttons perform their own action.\n\t/**\n\t * Keep Enter on image buttons from reaching the native row-save handler.\n\t * @param {KeyboardEvent} event Button keyboard event.\n\t * @returns {void} Stops Enter propagation without suppressing the button action.\n\t */\n\t$('.qefi-featured-image button').on('keydown.qefi', function (event) {\n\t\tif (event.which === 13) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t});\n\n\t/**\n\t * Render one edit session without changing the source table row.\n\t * @param {Object} row jQuery wrapper for the current inline-edit row.\n\t * @param {Object} image Featured-image ID and thumbnail URL.\n\t * @returns {void} Updates the row controls and enabled hidden field.\n\t */\n\tfunction renderImageState(row, image) {\n\t\tconst button = row.find('.qefi-upload-img');\n\t\tconst hasImage = image.id > 0 && !!image.url;\n\t\tconst label = hasImage ? qefi_strings.change_featured_image : qefi_strings.set_featured_image;\n\t\tbutton.empty().toggleClass('button', !hasImage).attr({ 'aria-label': label, title: label });\n\t\tif (hasImage) {\n\t\t\t$('<img>', { src: image.url, alt: '' }).appendTo(button);\n\t\t} else {\n\t\t\tbutton.text(qefi_strings.set_featured_image);\n\t\t}\n\t\trow.find('.qefi-thumbnail-id').val(image.id).prop('disabled', false);\n\t\trow.find('.qefi-remove-img').prop('hidden', !hasImage);\n\t\tconst original = row.data('qefi-original-image');\n\t\trow.find('.qefi-save-hint').prop('hidden', !original || Number(original.id) === Number(image.id));\n\t}\n\n\t/**\n\t * Open a single-image media picker for the current editing row.\n\t * @param {MouseEvent} event Image-selection button event.\n\t * @returns {void} Registers a media frame scoped to this edit session.\n\t */\n\t$('body').on('click.qefi', '.qefi-upload-img', function (event) {\n\t\tevent.preventDefault();\n\t\tconst row = $(this).closest('tr.inline-edit-row');\n\t\tconst field = row.find('.qefi-thumbnail-id');\n\t\tconst uploader = wp.media({\n\t\t\ttitle: $(this).attr('aria-label'),\n\t\t\tlibrary: { type: 'image' },\n\t\t\tbutton: { text: qefi_strings.set_featured_image },\n\t\t\tmultiple: false\n\t\t});\n\t\t/**\n\t\t * Preselect the current attachment when opening the media frame.\n\t\t * @returns {void} Updates the media selection only.\n\t\t */\n\t\tuploader.on('open', function () {\n\t\t\tconst id = Number(field.val());\n\t\t\tif (id > 0) {\n\t\t\t\tconst attachment = wp.media.attachment(id);\n\t\t\t\tattachment.fetch();\n\t\t\t\tuploader.state().get('selection').add(attachment);\n\t\t\t}\n\t\t});\n\t\t/**\n\t\t * Apply a chosen image only while the originating edit row remains active.\n\t\t * @returns {void} Updates this row or ignores empty/expired selections.\n\t\t */\n\t\tuploader.on('select', function () {\n\t\t\tconst selected = uploader.state().get('selection').first();\n\t\t\t// Cancel/save removes the cloned row. A late selection must not affect another post.\n\t\t\tif (!selected || !$.contains(document, row[0]) || !row.is(':visible')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst attachment = selected.toJSON();\n\t\t\tconst size = attachment.sizes && attachment.sizes.thumbnail;\n\t\t\trenderImageState(row, { id: attachment.id, url: size ? size.url : attachment.url });\n\t\t\twp.a11y.speak(row.find('.qefi-save-hint').prop('hidden') ? qefi_strings.image_restored : qefi_strings.image_selected, 'polite');\n\t\t});\n\t\tuploader.open();\n\t});\n\n\t/**\n\t * Clear the current row using WordPress’s native removal sentinel.\n\t * @param {MouseEvent} event Remove-image button event.\n\t * @returns {void} Resets the editable state without saving the post.\n\t */\n\t$('body').on('click.qefi', '.qefi-remove-img', function (event) {\n\t\tevent.preventDefault();\n\t\tconst row = $(this).closest('tr.inline-edit-row');\n\t\trenderImageState(row, { id: -1, url: '' });\n\t\twp.a11y.speak(row.find('.qefi-save-hint').prop('hidden') ? qefi_strings.image_restored : qefi_strings.image_removed, 'polite');\n\t\trow.find('.qefi-upload-img').trigger('focus');\n\t});\n\n\tconst originalEdit = inlineEditPost.edit;\n\t/**\n\t * Initialize image state after the original WordPress Quick Edit handler.\n\t * @param {number|Object} id Post ID or native table-button object.\n\t * @returns {*} Unchanged return value from the original handler.\n\t */\n\tinlineEditPost.edit = function (id) {\n\t\tconst result = originalEdit.apply(this, arguments);\n\t\tconst postId = parseInt(typeof id === 'object' ? this.getId(id) : id, 10);\n\t\tif (postId > 0) {\n\t\t\tconst row = $('#edit-' + postId);\n\t\t\tconst image = $('#post-' + postId).find('.qefi-image-data');\n\t\t\tif (row.find('.qefi-thumbnail-id').length && image.length) {\n\t\t\t\tconst initial = { id: parseInt(image.attr('data-id'), 10) || -1, url: image.attr('data-url') || '' };\n\t\t\t\trow.data('qefi-original-image', initial);\n\t\t\t\trenderImageState(row, initial);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t};\n});\nQEFI_JS;\n\t}\n\t// END GENERATED ASSETS\n\n\t/**\n\t * Register the pinned shared updater once for the installed WordPress plugin.\n\t *\n\t * @return void Adds isolated update hooks, or records a compatibility notice.\n\t */\n\tpublic function register_updater() {\n\t\tif ( $this->updater_registered || ! $this->is_plugin_file() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->updater_registered = true;\n\t\tif ( version_compare( PHP_VERSION, '8.1', '<' ) ) {\n\t\t\t$this->component_error = true;\n\t\t\treturn;\n\t\t}\n\t\t$updater_class = require __DIR__ . '/includes/deckerweb-github-release-updater-v2.php';\n\t\tif ( ! is_string( $updater_class ) || ! class_exists( $updater_class, false )\n\t\t\t|| ! defined( $updater_class . '::SUPPORTS_HOST_TRANSLATIONS' )\n\t\t\t|| ! defined( $updater_class . '::SUPPORTS_CATALOG_PROVIDER' ) ) {\n\t\t\t$this->component_error = true;\n\t\t\treturn;\n\t\t}\n\t\t$artwork_locale = 0 === strpos( determine_locale(), 'de' ) ? '-de' : '-en';\n\t\t$updater = new $updater_class(\n\t\t\t__FILE__,\n\t\t\t'https://github.com/deckerweb/quick-edit-featured-image',\n\t\t\t'Quick Edit Featured Image',\n\t\t\t__( 'This lightweight plugin allows to set and remove a Featured Image via the Quick Edit action screen in Post Type List Tables within the WordPress Admin. Out of the box this works for Posts, Pages and any public Post Type which supports Featured Images.', 'quick-edit-featured-image' ),\n\t\t\tarray(\n\t\t\t\t'icons' => array(\n\t\t\t\t\t'svg' => plugins_url( 'assets/icon.svg', __FILE__ ),\n\t\t\t\t\t'1x' => plugins_url( 'assets/icon-128x128.png', __FILE__ ),\n\t\t\t\t\t'2x' => plugins_url( 'assets/icon-256x256.png', __FILE__ ),\n\t\t\t\t),\n\t\t\t\t'banners' => array(\n\t\t\t\t\t'low' => plugins_url( 'assets/banner-update' . $artwork_locale . '-772x250.png', __FILE__ ),\n\t\t\t\t\t'high' => plugins_url( 'assets/banner-update' . $artwork_locale . '-1544x500.png', __FILE__ ),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray_merge(\n\t\t\t\tdeckerweb_library_updater_options_v1( __FILE__, 'https://github.com/deckerweb/quick-edit-featured-image' ),\n\t\t\t\tarray( 'translate' => require __DIR__ . '/includes/updater-translations.php' )\n\t\t\t)\n\t\t);\n\t\t$updater->register();\n\t\tadd_filter( 'plugins_api', array( $this, 'plugin_information' ), 30, 3 );\n\t\tadd_filter( 'http_request_args', array( $this, 'updater_request_args' ), 20, 2 );\n\t\tadd_filter( 'upgrader_source_selection', array( $this, 'validate_update_source' ), 30, 4 );\n\t}\n\n\t/**\n\t * Explain unavailable shared components without blocking featured-image editing.\n\t *\n\t * @return void Outputs an escaped notice to administrators only.\n\t */\n\tpublic function component_notice() {\n\t\tif ( ! $this->component_error || ! current_user_can( 'update_plugins' ) ) {\n\t\t\treturn;\n\t\t}\n\t\techo '<div class=\"notice notice-warning\"><p>' . esc_html__( 'Quick Edit Featured Image: the shared updater and catalog require WordPress, PHP 8.1 or newer, and a compatible deckerweb Updater. Featured-image editing remains available.', 'quick-edit-featured-image' ) . '</p></div>';\n\t}\n\n\t/**\n\t * Supply localized, bundled release history and documentation in this plugin's dialog.\n\t *\n\t * @param object|false|WP_Error $result Existing plugin information response.\n\t * @param string               $action Requested plugin API action.\n\t * @param object               $args   Plugin API arguments with the requested slug.\n\t * @return object|false|WP_Error Response with local history, or the untouched result.\n\t */\n\tpublic function plugin_information( $result, $action, $args ) {\n\t\tif ( 'plugin_information' !== $action || 'quick-edit-featured-image' !== ( $args->slug ?? '' ) || ! is_object( $result ) || is_wp_error( $result ) ) {\n\t\t\treturn $result;\n\t\t}\n\t\t$de = 0 === strpos( determine_locale(), 'de' );\n\t\t$history = require __DIR__ . '/includes/plugin-history.php';\n\t\t$result->sections['changelog'] = $history( $de );\n\t\t$result->homepage = 'https://github.com/deckerweb/quick-edit-featured-image/blob/main/docs/' . ( $de ? 'GUIDE-de.md' : 'GUIDE.md' );\n\t\treturn $result;\n\t}\n\n\t/**\n\t * Bound this repository metadata request while preserving unrelated requests.\n\t *\n\t * @param array $args Existing WordPress HTTP request options.\n\t * @param string $url Absolute request URL.\n\t * @return array Request options with limits for this repository only.\n\t */\n\tpublic function updater_request_args( $args, $url ) {\n\t\tif ( 'https://api.github.com/repos/deckerweb/quick-edit-featured-image/releases/latest' === $url ) {\n\t\t\t$args['sslverify'] = true;\n\t\t\t$args['timeout'] = 6;\n\t\t\t$args['redirection'] = 2;\n\t\t\t$args['limit_response_size'] = 1024 * 1024;\n\t\t}\n\t\treturn $args;\n\t}\n\n\t/**\n\t * Validate an offered candidate after updater directory normalization.\n\t *\n\t * @param string|WP_Error $source Extracted plugin directory or previous failure.\n\t * @param string $remote_source Original extracted download directory.\n\t * @param WP_Upgrader $upgrader Native upgrader performing the operation.\n\t * @param array $hook_extra Per-package plugin/update context, including bulk variants.\n\t * @return string|WP_Error Original source on success, or a localized rejection before replacement.\n\t */\n\tpublic function validate_update_source( $source, $remote_source, $upgrader, $hook_extra ) {\n\t\tif ( is_wp_error( $source ) || ! is_string( $source ) || ! is_array( $hook_extra )\n\t\t\t|| ( $hook_extra['plugin'] ?? '' ) !== plugin_basename( __FILE__ )\n\t\t\t|| ( isset( $hook_extra['type'] ) && 'plugin' !== $hook_extra['type'] )\n\t\t\t|| ( isset( $hook_extra['action'] ) && 'update' !== $hook_extra['action'] )\n\t\t\t|| ( ! isset( $hook_extra['type'], $hook_extra['action'] ) && ! ( $upgrader instanceof \\Plugin_Upgrader && true === $upgrader->bulk ) ) ) {\n\t\t\treturn $source;\n\t\t}\n\t\tglobal $wp_filesystem;\n\t\tif ( ! $wp_filesystem ) {\n\t\t\treturn new WP_Error( 'qefi_update_filesystem', __( 'Could not access the update filesystem.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\t$root = untrailingslashit( $source );\n\t\tif ( $wp_filesystem->is_file( $root . '/quick-edit-featured-image/quick-edit-featured-image.php' ) ) {\n\t\t\t$root .= '/quick-edit-featured-image';\n\t\t}\n\t\t$main = $root . '/quick-edit-featured-image.php';\n\t\t$size = $wp_filesystem->size( $main );\n\t\tif ( ! is_numeric( $size ) || $size < 1 || $size > 256 * 1024 ) {\n\t\t\treturn new WP_Error( 'qefi_update_identity', __( 'The update package is not Quick Edit Featured Image.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\t$contents = $wp_filesystem->get_contents( $main );\n\t\t$headers = array();\n\t\tforeach ( array( 'Plugin Name', 'Update URI', 'Requires at least', 'Requires PHP', 'Version' ) as $header ) {\n\t\t\tpreg_match( '/^[ \\t\\/*#@]*' . preg_quote( $header, '/' ) . ':[ \\t]*(.+)$/mi', is_string( $contents ) ? substr( $contents, 0, 8192 ) : '', $match );\n\t\t\t$headers[ $header ] = isset( $match[1] ) ? trim( $match[1] ) : '';\n\t\t}\n\t\tif ( 'Quick Edit Featured Image' !== $headers['Plugin Name'] || 'https://github.com/deckerweb/quick-edit-featured-image' !== $headers['Update URI'] || ! preg_match( '/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/D', $headers['Version'] ) ) {\n\t\t\treturn new WP_Error( 'qefi_update_identity', __( 'The update package is not Quick Edit Featured Image.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\tglobal $wp_version;\n\t\tif ( ! preg_match( '/^\\d+(?:\\.\\d+){1,2}$/D', $headers['Requires PHP'] ) || version_compare( PHP_VERSION, $headers['Requires PHP'], '<' ) || ! preg_match( '/^\\d+(?:\\.\\d+){1,2}$/D', $headers['Requires at least'] ) || version_compare( $wp_version, $headers['Requires at least'], '<' ) ) {\n\t\t\treturn new WP_Error( 'qefi_update_compatibility', __( 'The update package requires a newer WordPress or PHP version.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\t$updates = get_site_transient( 'update_plugins' );\n\t\t$offer = is_object( $updates ) ? ( $updates->response[ plugin_basename( __FILE__ ) ] ?? null ) : null;\n\t\t$version = is_object( $offer ) ? ( $offer->new_version ?? $offer->version ?? '' ) : '';\n\t\tif ( ! is_string( $version ) || '' === $version || $version !== $headers['Version'] || ! version_compare( $headers['Version'], self::VERSION, '>' ) ) {\n\t\t\treturn new WP_Error( 'qefi_update_version', __( 'The update package does not match the offered newer version.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\tforeach ( array( 'includes/deckerweb-github-release-updater-v2.php', 'includes/updater-translations.php', 'includes/plugin-history.php', 'includes/deckerweb-plugin-library/bootstrap.php', 'includes/deckerweb-plugin-library/compatibility.json', 'uninstall.php', 'assets/icon.svg', 'assets/icon-128x128.png', 'assets/icon-256x256.png', 'assets/banner-update-772x250.png', 'assets/banner-update-1544x500.png', 'assets/banner-update-en-772x250.png', 'assets/banner-update-en-1544x500.png', 'assets/banner-update-de-772x250.png', 'assets/banner-update-de-1544x500.png' ) as $file ) {\n\t\t\tif ( ! $wp_filesystem->is_file( $root . '/' . $file ) ) {\n\t\t\t\treturn new WP_Error( 'qefi_update_incomplete', __( 'The update package is missing required plugin files.', 'quick-edit-featured-image' ) );\n\t\t\t}\n\t\t}\n\t\t$manifest_file = $root . '/includes/deckerweb-plugin-library/compatibility.json';\n\t\tif ( $wp_filesystem->size( $manifest_file ) > 64 * 1024 ) {\n\t\t\treturn new WP_Error( 'qefi_update_incomplete', __( 'The update package is missing required plugin files.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\t$manifest = json_decode( (string) $wp_filesystem->get_contents( $manifest_file ), true );\n\t\tif ( ! is_array( $manifest ) || 2 !== ( $manifest['protocol'] ?? null ) || ! is_array( $manifest['files'] ?? null ) || ! is_array( $manifest['hashes'] ?? null ) || count( $manifest['files'] ) > 200 ) {\n\t\t\treturn new WP_Error( 'qefi_update_incomplete', __( 'The update package is missing required plugin files.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\t$required = array( 'bootstrap.php', 'runtime.php', 'lifecycle.php', 'version.php', 'src/Library.php', 'src/Catalog.php', 'src/Package.php', 'src/Requirements.php', 'src/I18n.php', 'src/History.php', 'catalog.json', 'languages/de_DE.mo', 'languages/de_DE_formal.mo' );\n\t\tif ( count( array_filter( $manifest['files'], 'is_string' ) ) !== count( $manifest['files'] )\n\t\t\t|| ! is_string( $manifest['version'] ?? null ) || ! is_string( $manifest['requires_php'] ?? null ) || ! is_string( $manifest['requires_wp'] ?? null )\n\t\t\t|| array_diff( $required, $manifest['files'] ) || ! preg_match( '/^\\d+\\.\\d+\\.\\d+$/D', $manifest['version'] ?? '' )\n\t\t\t|| ! preg_match( '/^\\d+(?:\\.\\d+){1,2}$/D', $manifest['requires_php'] ?? '' )\n\t\t\t|| ! preg_match( '/^\\d+(?:\\.\\d+){1,2}$/D', $manifest['requires_wp'] ?? '' )\n\t\t\t|| version_compare( PHP_VERSION, $manifest['requires_php'], '<' ) || version_compare( $wp_version, $manifest['requires_wp'], '<' ) ) {\n\t\t\treturn new WP_Error( 'qefi_update_incomplete', __( 'The update package is missing required plugin files.', 'quick-edit-featured-image' ) );\n\t\t}\n\t\t$total = 0;\n\t\tforeach ( $manifest['files'] as $file ) {\n\t\t\t$expected = is_string( $file ) ? ( $manifest['hashes'][ $file ] ?? '' ) : '';\n\t\t\tif ( ! is_string( $file ) || ! preg_match( '~^[a-zA-Z0-9_/.-]+$~D', $file ) || false !== strpos( $file, '..' ) || ! is_string( $expected ) || ! preg_match( '/^[a-f0-9]{64}$/D', $expected ) ) {\n\t\t\t\treturn new WP_Error( 'qefi_update_incomplete', __( 'The update package is missing required plugin files.', 'quick-edit-featured-image' ) );\n\t\t\t}\n\t\t\t$path = $root . '/includes/deckerweb-plugin-library/' . $file;\n\t\t\t$size = $wp_filesystem->size( $path );\n\t\t\t$total += is_numeric( $size ) ? (int) $size : 0;\n\t\t\tif ( $total > 16 * 1024 * 1024 || ! $wp_filesystem->is_file( $path ) || ! is_numeric( $size ) || $size > 2 * 1024 * 1024 || ! hash_equals( $expected, hash( 'sha256', (string) $wp_filesystem->get_contents( $path ) ) ) ) {\n\t\t\t\treturn new WP_Error( 'qefi_update_incomplete', __( 'The update package is missing required plugin files.', 'quick-edit-featured-image' ) );\n\t\t\t}\n\t\t}\n\t\treturn $source;\n\t}\n\n\t/**\n\t * Add additional plugin related info to the Site Health Debug Info section.\n\t *\n\t * @link https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/\n\t *\n\t * @param array $debug_info Array holding all Debug Info items.\n\t * @return array Modified array of Debug Info.\n\t */\n\tpublic function site_health_debug_info( $debug_info ) {\n\t\t\n\t\t$this->load_translations();\n\t\t\n\t\t$string_undefined = esc_html_x( 'Undefined', 'Site Health Debug info', 'quick-edit-featured-image' );\n\t\t$string_enabled   = esc_html_x( 'Enabled', 'Site Health Debug info', 'quick-edit-featured-image' );\n\t\t$string_disabled  = esc_html_x( 'Disabled', 'Site Health Debug info', 'quick-edit-featured-image' );\n\t\t$string_value     = ' – ' . esc_html_x( 'value', 'Site Health Debug info', 'quick-edit-featured-image' ) . ': ';\n\t\t\n\t\t/** Add our Debug info */\n\t\t$debug_info[ 'quick-edit-featured-image' ] = array(\n\t\t\t'label'  => esc_html__( 'Quick Edit Featured Image', 'quick-edit-featured-image' ) . ' (' . esc_html__( 'Plugin', 'quick-edit-featured-image' ) . ')',\n\t\t\t'fields' => array(\n\t\n\t\t\t\t/** Various values */\n\t\t\t\t'qefi_plugin_version' => array(\n\t\t\t\t\t'label' => esc_html__( 'Plugin version', 'quick-edit-featured-image' ),\n\t\t\t\t\t'value' => self::VERSION,\n\t\t\t\t),\n\t\t\t\t'qefi_install_type' => array(\n\t\t\t\t\t'label' => esc_html__( 'Plugin or Snippet?', 'quick-edit-featured-image' ),\n\t\t\t\t\t'value' => $this->is_plugin_file() ? esc_html__( 'Plugin is active', 'quick-edit-featured-image' ) : esc_html__( 'Snippet is active', 'quick-edit-featured-image' ),\n\t\t\t\t),\n\t\t\t\t'qefi_cms_install_type' => array(\n\t\t\t\t\t'label' => sprintf(\n\t\t\t\t\t\t/* translators: %s – the CMS used, WordPress */\n\t\t\t\t\t\tesc_html__( '%s Install Type', 'quick-edit-featured-image' ),\n\t\t\t\t\t\t'WordPress'\n\t\t\t\t\t),\n\t\t\t\t\t'value' => ( is_multisite() ? esc_html__( 'Multisite install', 'quick-edit-featured-image' ) : esc_html__( 'Single Site install', 'quick-edit-featured-image' ) ),\n\t\t\t\t),\n\t\n\t\t\t\t/** Quick Edit Featured Image constants */\n\t\t\t\t'QEFI_DISABLED_TYPES' => array(\n\t\t\t\t\t'label' => 'QEFI_DISABLED_TYPES',\n\t\t\t\t\t'value' => ( ! defined( 'QEFI_DISABLED_TYPES' ) ? $string_undefined : ( QEFI_DISABLED_TYPES ? $string_enabled . $string_value . implode( ', ', $this->normalize_post_types( QEFI_DISABLED_TYPES ) ) : $string_disabled ) ),\n\t\t\t\t),\n\t\t\t\t'qefi_all_disabled_types' => array(\n\t\t\t\t\t'label' => esc_html__( 'All disabled post types', 'quick-edit-featured-image' ),\n\t\t\t\t\t'value' => implode( ', ', array_map( 'sanitize_key', $this->post_types_disable() ) ),\n\t\t\t\t),\n\t\t\t\t'QEFI_GERMAN_STRINGS' => array(\n\t\t\t\t\t'label' => 'QEFI_GERMAN_STRINGS',\n\t\t\t\t\t'value' => ( ! defined( 'QEFI_GERMAN_STRINGS' ) ? $string_undefined : ( QEFI_GERMAN_STRINGS ? $string_enabled . $string_value . esc_html( is_scalar( QEFI_GERMAN_STRINGS ) ? (string) QEFI_GERMAN_STRINGS : '' ) : $string_disabled ) ),\n\t\t\t\t),\n\t\t\t),  // end array\n\t\t);\n\t\n\t\t/** Return modified Debug Info array */\n\t\treturn $debug_info;\n\t}\n\t\n} // End class.\n\nnew DDW_Quick_Edit_Featured_Image();\nendif;\n\nif ( ! function_exists( 'ddw_qefi_pluginrow_meta' ) ) :\nadd_filter( 'plugin_row_meta', 'ddw_qefi_pluginrow_meta', 10, 2 );\n\n/**\n * Add support links only to the installed plugin row.\n *\n * @param array $meta Existing metadata links.\n * @param string $file Plugin basename for the displayed row.\n * @return array Original or extended metadata links.\n */\nfunction ddw_qefi_pluginrow_meta( $meta, $file ) {\n\tif ( plugin_basename( __FILE__ ) !== $file || ! current_user_can( 'install_plugins' ) ) {\n\t\treturn $meta;\n\t}\n\t$url = 'https://eepurl.com/gbAUUn';\n\t$meta[] = sprintf(\n\t\t'<a class=\"button button-inline\" href=\"https://ko-fi.com/deckerweb\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">❤ <b>%s</b></a>',\n\t\tesc_html_x( 'Donate', 'Plugins page listing', 'quick-edit-featured-image' )\n\t);\n\t$meta[] = sprintf(\n\t\t'<a class=\"button-primary\" href=\"%s\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">⚡ <b>%s</b></a>',\n\t\tesc_url( $url ),\n\t\tesc_html_x( 'Join the Newsletter', 'Plugins page listing', 'quick-edit-featured-image' )\n\t);\n\t/**\n\t * Filter the additional links on the installed plugin's row.\n\t *\n\t * @since 1.1.0\n\t * @param array $meta Plugin metadata links; return the modified link array.\n\t */\n\treturn apply_filters( 'ddw/admin_extras/pluginrow_meta', $meta );\n}\nendif;\n",
      "scope": "admin",
      "active": false
    }
  ]
}
