Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/wp-smushit/core/external/wpmudev-blackfriday/build/banner.min.asset.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/build/banner.min.asset.php
@@ -0,0 +1 @@
+<?php return array('dependencies' => array('wp-dom-ready', 'wp-element'), 'version' => 'fa30e4b957aee5169ee3');
--- a/wp-smushit/core/external/wpmudev-blackfriday/build/widget.min.asset.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/build/widget.min.asset.php
@@ -0,0 +1 @@
+<?php return array('dependencies' => array(), 'version' => 'dfaea73625d94f42f15e');
--- a/wp-smushit/core/external/wpmudev-blackfriday/campaign.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/campaign.php
@@ -0,0 +1,188 @@
+<?php
+/**
+ * WPMUDEV Black Friday common module
+ *
+ * Used by wordpress.org free plugins only to show Black Friday deal on admin dashboard.
+ *
+ * @since 1.0
+ * @author WPMUDEV
+ * @package WPMUDEVBlackFriday
+ */
+
+namespace WPMUDEVModulesBlackFriday;
+
+// If this file is called directly, abort.
+if ( ! defined( 'WPINC' ) ) {
+ die;
+}
+
+// Sub-module version.
+if ( ! defined( 'WPMUDEV_MODULE_BLACK_FRIDAY_VERSION' ) ) {
+ define( 'WPMUDEV_MODULE_BLACK_FRIDAY_VERSION', '2.1.0' );
+}
+
+// Sub-module directory.
+if ( ! defined( 'WPMUDEV_MODULE_BLACK_FRIDAY_DIR' ) ) {
+ define( 'WPMUDEV_MODULE_BLACK_FRIDAY_DIR', plugin_dir_path( __FILE__ ) );
+}
+
+// Sub-module url.
+if ( ! defined( 'WPMUDEV_MODULE_BLACK_FRIDAY_URL' ) ) {
+ define( 'WPMUDEV_MODULE_BLACK_FRIDAY_URL', plugin_dir_url( __FILE__ ) );
+}
+
+// Sub-module Assets url.
+if ( ! defined( 'WPMUDEV_MODULE_BLACK_FRIDAY_ASSETS_URL' ) ) {
+ define( 'WPMUDEV_MODULE_BLACK_FRIDAY_ASSETS_URL', untrailingslashit( WPMUDEV_MODULE_BLACK_FRIDAY_URL ) . '/build' );
+}
+
+if ( ! class_exists( __NAMESPACE__ . '\Campaign' ) ) {
+ /**
+ * Class Load.
+ *
+ * @since 1.0
+ * @package WPMUDEVBlackFridayCampaign
+ */
+ class Campaign {
+ /**
+ * Start date of the campaign. Date format : dd-mm-yyyy.
+ *
+ * @var string
+ */
+ protected $campaign_start_date = '16-11-2026';
+
+ /**
+ * End date of the campaign. Date format : dd-mm-yyyy.
+ *
+ * @var string
+ */
+ protected $campaign_end_date = '03-12-2026';
+
+ /**
+ * Construct handler class.
+ *
+ * @since 1.0
+ *
+ * @param array $props Campaign props.
+ *
+ * @return void
+ */
+ public function __construct( $props = array() ) {
+ $props['campaign_url'] = $props['campaign_url'] ?? 'https://wpmudev.com/black-friday/';
+ $props['utm_campaign'] = $props['utm_campaign'] ?? 'black-friday-2026';
+ $props['utm_medium'] = $props['utm_medium'] ?? 'plugin';
+ $props['priority'] = $props['priority'] ?? 10;
+
+ add_action( 'init', array( $this, 'add_textdomain' ) );
+
+ $this->load_modules( $props );
+ }
+
+ /**
+ * Load required modules.
+ *
+ * @since 2.0.0
+ *
+ * @param array $props Campaign props.
+ *
+ * @return void
+ */
+ public function load_modules( $props = array() ) {
+ static $loaded = false;
+
+ // Load Utils first, can_load() needs it.
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-utils.php';
+
+ if ( $loaded || ! $this->can_load() ) {
+ return;
+ }
+ $loaded = true;
+
+ require_once 'includes/class-banner.php';
+
+ if ( class_exists( 'WPMUDEVModulesBlackFridayBanner' ) ) {
+ new Banner( $props );
+ }
+
+ require_once 'includes/class-admin-menu.php';
+
+ if ( class_exists( 'WPMUDEVModulesBlackFridayAdmin_Menu' ) ) {
+ new Admin_Menu( $props );
+ }
+
+ require_once 'includes/class-action-links.php';
+ if ( class_exists( 'WPMUDEVModulesBlackFridayAction_Links' ) ) {
+ new Action_Links( $props );
+ }
+
+ require_once 'includes/class-upsell-widget.php';
+ if ( class_exists( 'WPMUDEVModulesBlackFridayUpsell_Widget' ) ) {
+ new Upsell_Widget( $props );
+ }
+ }
+
+ /**
+ * Checks if plugin's Black Friday deal can be loaded.
+ *
+ * @since 1.0
+ *
+ * @return boolean
+ */
+ public function can_load() {
+ if (
+ ! Utils::current_user_can_view() ||
+ $this->event_expired() ||
+ $this->dashboard_plugin_installed()
+ ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Checks if offer has expired.
+ *
+ * @since 1.0
+ *
+ * @return boolean
+ */
+ public function event_expired() {
+ $current_date = apply_filters( 'wpmudev_blackfriday_current_date', 'd-m-Y' );
+ $start_date = apply_filters( 'wpmudev_blackfriday_start_date', $this->campaign_start_date );
+ $expire_date = apply_filters( 'wpmudev_blackfriday_expire_date', $this->campaign_end_date );
+
+ // Expires on 29 Nov 2026.
+ return (
+ date_create( date_i18n( $current_date ) )->getTimestamp() < date_create( date_i18n( $start_date ) )->getTimestamp() ||
+ date_create( date_i18n( $current_date ) )->getTimestamp() >= date_create( date_i18n( $expire_date ) )->getTimestamp()
+ );
+ }
+
+ /**
+ * Checks if Dashboard plugin is installed.
+ *
+ * @since 1.0
+ *
+ * @return boolean
+ */
+ public function dashboard_plugin_installed() {
+ return class_exists( 'WPMUDEV_Dashboard' );
+ }
+
+ /**
+ * Load sub-module textdomain.
+ *
+ * @since 2.0.0
+ *
+ * @return void
+ */
+ public function add_textdomain() {
+ load_plugin_textdomain(
+ 'wpmudev-black-friday',
+ false,
+ dirname( plugin_basename( __FILE__ ) ) . '/languages/'
+ );
+ }
+ }
+}
--- a/wp-smushit/core/external/wpmudev-blackfriday/includes/class-action-links.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/includes/class-action-links.php
@@ -0,0 +1,262 @@
+<?php
+/**
+ * WPMUDEV Black Friday Action Links class
+ *
+ * Handles the addition of Black Friday action links in the plugins table.
+ *
+ * @since 2.0.0
+ * @author WPMUDEV
+ * @package WPMUDEVModulesBlackFriday
+ */
+
+namespace WPMUDEVModulesBlackFriday;
+
+// Exit if accessed directly.
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+/**
+ * Class Action_Links
+ *
+ * Manages Black Friday action links in the plugins table.
+ *
+ * @since 2.0.0
+ */
+class Action_Links {
+ /**
+ * Action Links version.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $version = '2.0.0';
+
+ /**
+ * Campaign URL.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $campaign_url = '';
+
+ /**
+ * Link text.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $link_text = '';
+
+ /**
+ * UTM content for the menu.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $utm_content = 'BF-Plugins-2026';
+
+ /**
+ * UTM campaign for the menu.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $utm_campaign = 'BF-Plugins-2026-plugins-list';
+
+ /**
+ * Constructor.
+ *
+ * @since 2.0.0
+ *
+ * @param array $args Optional. Action links configuration arguments.
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'campaign_url' => 'https://wpmudev.com/blackfriday',
+ 'link_text' => __( 'Get Black Friday Deal', 'wpmudev-black-friday' ),
+ );
+
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->campaign_url = esc_url( $args['campaign_url'] );
+ $this->link_text = sanitize_text_field( $args['link_text'] );
+
+ $this->init_hooks();
+ }
+
+ /**
+ * Initialize WordPress hooks.
+ *
+ * @since 2.0.0
+ *
+ * @return void
+ */
+ private function init_hooks() {
+ // Get all WPMU DEV plugins.
+ $plugins_list = Utils::get_plugins_list();
+
+ // Add action link filter for each plugin.
+ foreach ( $plugins_list as $plugin_data ) {
+ if ( empty( $plugin_data['slug'] ) ) {
+ continue;
+ }
+
+ $action_links_hook = ( is_multisite() && is_network_admin() ) ? 'network_admin_plugin_action_links_' : 'plugin_action_links_';
+ $plugin_path = $plugin_data['path'];
+ $plugin_utm_source = $plugin_data['utm_source'];
+ $plugin_base_url = Utils::get_campaign_url( $plugin_data, $this->campaign_url );
+
+ add_filter(
+ $action_links_hook . $plugin_path,
+ function ( $actions ) use ( $plugin_utm_source, $plugin_base_url ) {
+ // Modify the campaign URL to include the correct UTM source.
+ $campaign_url = add_query_arg(
+ array(
+ 'utm_source' => $plugin_utm_source,
+ 'utm_campaign' => $plugin_utm_source . '-' . $this->utm_campaign,
+ 'utm_medium' => 'plugin',
+ 'utm_content' => $this->utm_content,
+ ),
+ $plugin_base_url
+ );
+
+ // Create Black Friday link.
+ $black_friday_link = sprintf(
+ '<a href="%s" target="_blank" rel="noopener noreferrer" class="wpmudev-bf-action-link"><span>%s</span></a>',
+ esc_url( $campaign_url ),
+ esc_html( $this->link_text )
+ );
+
+ // Add Black Friday link.
+ $actions['wpmudev_black_friday'] = $black_friday_link;
+
+ return $this->handle_action_links( $actions );
+ },
+ 998,
+ 1
+ );
+ }
+
+ // Enqueue styles for action links.
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
+ }
+
+ /**
+ * Handle action links to ensure proper ordering.
+ *
+ * Ensures that 'deactivate' is the last item and 'wpmudev_black_friday' is second to last. Also removes other offers links.
+ *
+ * @since 2.0.0
+ *
+ * @param array $actions An array of plugin action links.
+ *
+ * @return array Modified array of plugin action links.
+ */
+ public function handle_action_links( $actions ) {
+ if ( ! Utils::current_user_can_view() ) {
+ return $actions;
+ }
+
+ // Store the deactivate link if it exists.
+ $deactivate_link = null;
+ if ( isset( $actions['deactivate'] ) ) {
+ $deactivate_link = $actions['deactivate'];
+ unset( $actions['deactivate'] );
+ }
+
+ // Add deactivate link back as the last item.
+ if ( ! is_null( $deactivate_link ) ) {
+ $actions['deactivate'] = $deactivate_link;
+ }
+
+ if ( isset( $actions['upgrade'] ) ) {
+ unset( $actions['upgrade'] );
+ }
+
+ if ( isset( $actions['smush_upgrade'] ) ) {
+ unset( $actions['smush_upgrade'] );
+ }
+
+ // Forminator uses renew.
+ if ( isset( $actions['renew'] ) ) {
+ unset( $actions['renew'] );
+ }
+
+ foreach ( $actions as $key => $action ) {
+ if ( strpos( $action, 'smartcrawl_pluginlist_upgrade' ) !== false ||
+ strpos( $action, 'hummingbird_pluginlist_upgrade' ) !== false ) {
+ unset( $actions[ $key ] );
+ }
+ }
+
+ return $actions;
+ }
+
+ /**
+ * Enqueue custom styles for the Black Friday action links.
+ *
+ * @since 2.0.0
+ *
+ * @param string $hook_suffix The current admin page.
+ *
+ * @return void
+ */
+ public function enqueue_styles( $hook_suffix ) {
+ // Only load on plugins page.
+ if ( 'plugins.php' !== $hook_suffix ) {
+ return;
+ }
+
+ if ( ! Utils::current_user_can_view() ) {
+ return;
+ }
+
+ $custom_css = '
+ .wpmudev-bf-action-link > span {
+ color: #00ff00 !important;
+ background: #000000 !important;
+ line-height: 16px !important;
+ font-weight: 500 !important;
+ padding: 3px 6px !important;
+ margin: 4px 0 !important;
+ border-radius: 2px !important;
+ white-space: nowrap !important;
+ font-size: inherit !important;
+ display: inline-block !important;
+ transition: background-color 0.3s ease, color 0.3s ease !important;
+ }
+ .wpmudev-bf-action-link:hover > span,
+ .wpmudev-bf-action-link:focus > span {
+ background: #00ff00 !important;
+ color: #000000 !important;
+ }
+ ';
+
+ wp_register_style( 'wpmudev-bf-action-links', false, array(), $this->version );
+ wp_enqueue_style( 'wpmudev-bf-action-links' );
+ wp_add_inline_style( 'wpmudev-bf-action-links', $custom_css );
+ }
+
+ /**
+ * Get campaign URL.
+ *
+ * @since 2.0.0
+ *
+ * @return string The campaign URL.
+ */
+ public function get_campaign_url() {
+ return $this->campaign_url;
+ }
+
+ /**
+ * Get link text.
+ *
+ * @since 2.0.0
+ *
+ * @return string The link text.
+ */
+ public function get_link_text() {
+ return $this->link_text;
+ }
+}
--- a/wp-smushit/core/external/wpmudev-blackfriday/includes/class-admin-menu.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/includes/class-admin-menu.php
@@ -0,0 +1,422 @@
+<?php
+/**
+ * WPMUDEV Black Friday Admin Menu class
+ *
+ * Handles the addition of admin menu page for Black Friday campaign.
+ *
+ * @since 2.0.0
+ * @author WPMUDEV
+ * @package WPMUDEVModulesBlackFriday
+ */
+
+namespace WPMUDEVModulesBlackFriday;
+
+// Exit if accessed directly.
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+/**
+ * Class Admin_Menu
+ *
+ * Manages Black Friday admin menu page.
+ *
+ * @since 2.0.0
+ */
+class Admin_Menu {
+
+ /**
+ * Campaign URL.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $campaign_url = '';
+
+ /**
+ * Menu title.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $menu_title = '';
+
+ /**
+ * Page title.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $page_title = '';
+
+ /**
+ * Menu slug.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $menu_slug = 'wpmudev-black-friday';
+
+ /**
+ * UTM content for the menu.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $utm_content = 'BF-Plugins-2026';
+
+ /**
+ * UTM campaign for the menu.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $utm_campaign = 'BF-Plugins-2026-menu';
+
+ /**
+ * Constructor.
+ *
+ * @since 2.0.0
+ *
+ * @param array $args Optional. Admin menu configuration arguments.
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'campaign_url' => 'https://wpmudev.com/black-friday/',
+ 'menu_title' => __( 'Black Friday', 'wpmudev-black-friday' ),
+ 'page_title' => __( 'WPMUDEV Black Friday Deal', 'wpmudev-black-friday' ),
+ 'menu_slug' => 'wpmudev-black-friday',
+ );
+
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->campaign_url = esc_url( $args['campaign_url'] );
+ $this->menu_title = sanitize_text_field( $args['menu_title'] );
+ $this->page_title = sanitize_text_field( $args['page_title'] );
+ $this->menu_slug = sanitize_key( $args['menu_slug'] );
+
+ $this->init_hooks();
+ }
+
+ /**
+ * Initialize WordPress hooks.
+ *
+ * @since 2.0.0
+ *
+ * @return void
+ */
+ private function init_hooks() {
+ $hook = ( is_multisite() && is_network_admin() ) ? 'network_admin_menu' : 'admin_menu';
+ add_action( $hook, array( $this, 'add_admin_page' ), 99999 );
+ // Normally we would remove the admin pages on admin_menu hook, we will use admin_head though which is used in some plugins.
+ add_action( 'admin_head', array( $this, 'remove_admin_pages' ), 99999 );
+ // Admin Menu Editor replaces the menu with its own copy after admin_head, so remove the items from that copy too.
+ add_action( 'admin_menu_editor-menu_replaced', array( $this, 'remove_admin_pages' ) );
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_menu_styles' ), 999999 );
+ }
+
+ /**
+ * Add admin menu page.
+ *
+ * @since 2.0.0
+ *
+ * @return void
+ */
+ public function add_admin_page() {
+ // Only for users who can see the campaign.
+ if ( ! Utils::current_user_can_view() ) {
+ return;
+ }
+
+ // Get all WPMU DEV plugins data.
+ $plugins_list = Utils::get_plugins_list();
+
+ foreach ( $plugins_list as $plugin_key => $plugin_data ) {
+ $utm_source = $plugin_data['utm_source'] ?? 'admin_menu';
+ $parent_slug = $plugin_data['admin_parent_page'] ?? '';
+
+ // Skip plugins whose parent menu is not registered, to avoid orphan submenus.
+ if ( empty( $parent_slug ) || ! $this->parent_menu_exists( $parent_slug ) ) {
+ continue;
+ }
+
+ $menu_url = add_query_arg(
+ array(
+ 'utm_source' => $utm_source,
+ 'utm_medium' => 'plugin',
+ 'utm_campaign' => $utm_source . '-' . $this->utm_campaign,
+ 'utm_content' => $this->utm_content,
+ ),
+ Utils::get_campaign_url( $plugin_data, $this->campaign_url )
+ );
+
+ // Skip if the menu item has already been added, eg by another copy of the module.
+ if ( $this->submenu_exists( $parent_slug, $menu_url ) ) {
+ continue;
+ }
+
+ add_submenu_page(
+ $parent_slug,
+ $this->page_title,
+ $this->get_menu_title_html(),
+ 'manage_options',
+ $menu_url,
+ null,
+ PHP_INT_MAX // Position as last submenu item.
+ );
+
+ }
+ }
+
+ /**
+ * Get the menu title markup: the title, a "Sale" tag and an external link arrow.
+ *
+ * @since 2.1.0
+ *
+ * @return string The menu title HTML.
+ */
+ private function get_menu_title_html() {
+ return sprintf(
+ '%1$s <span class="wpmudev-bf-menu-tag"><span class="wpmudev-bf-menu-sale">%2$s</span><span class="wpmudev-bf-menu-arrow" aria-hidden="true"></span></span>',
+ esc_html( $this->menu_title ),
+ esc_html__( 'Sale', 'wpmudev-black-friday' )
+ );
+ }
+
+ /**
+ * Checks if a top level admin menu is registered.
+ *
+ * @since 2.1.0
+ *
+ * @param string $parent_slug The parent menu slug.
+ *
+ * @return bool
+ */
+ private function parent_menu_exists( $parent_slug ) {
+ global $menu;
+
+ if ( empty( $menu ) || ! is_array( $menu ) ) {
+ return false;
+ }
+
+ return in_array( $parent_slug, wp_list_pluck( $menu, 2 ), true );
+ }
+
+ /**
+ * Checks if a submenu item is already registered under the given parent.
+ *
+ * @since 2.1.0
+ *
+ * @param string $parent_slug The parent menu slug.
+ * @param string $menu_slug The submenu slug.
+ *
+ * @return bool
+ */
+ private function submenu_exists( $parent_slug, $menu_slug ) {
+ global $submenu;
+
+ if ( empty( $submenu[ $parent_slug ] ) || ! is_array( $submenu[ $parent_slug ] ) ) {
+ return false;
+ }
+
+ // Core runs the slug through plugin_basename() when registering it.
+ return in_array( plugin_basename( $menu_slug ), wp_list_pluck( $submenu[ $parent_slug ], 2 ), true );
+ }
+
+ /**
+ * Remove sales/offers and cross-sell admin menus to replace them with Black Friday campaign.
+ *
+ * @since 2.0.0
+ *
+ * @return void
+ */
+ public function remove_admin_pages() {
+ global $submenu;
+
+ $parent_menu_slugs = Utils::get_plugin_parent_screens();
+
+ foreach ( $parent_menu_slugs as $parent_slug ) {
+ if ( empty( $parent_slug ) || empty( $submenu[ $parent_slug ] ) ) {
+ continue;
+ }
+
+ $prefix = 'https://wpmudev.com/project/';
+
+ foreach ( $submenu[ $parent_slug ] as $index => $item ) {
+ $slug = $item[2] ?? '';
+
+ // Don't remove our own menu item.
+ if ( ! is_string( $slug ) || $this->is_campaign_menu_url( $slug ) ) {
+ continue;
+ }
+
+ // Match the submenu URL.
+ if ( strpos( $slug, $prefix ) === 0 || Utils::str_ends_with( $slug, '_cross_sell' ) || Utils::str_ends_with( $slug, 'cross-sell' ) ) {
+ unset( $submenu[ $parent_slug ][ $index ] );
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks if a submenu URL is our Black Friday menu item.
+ *
+ * Uses the UTM campaign, because the URL can look like the plugin's own upgrade links.
+ *
+ * @since 2.1.0
+ *
+ * @param string $url The submenu URL.
+ *
+ * @return bool
+ */
+ private function is_campaign_menu_url( $url ) {
+ return str_contains( $url, $this->utm_campaign );
+ }
+
+ /**
+ * Get the CSS selector for the Black Friday menu links.
+ *
+ * Uses the UTM campaign, because each plugin's link goes to a different page.
+ *
+ * @since 2.1.0
+ *
+ * @return string
+ */
+ private function get_menu_link_attribute() {
+ return 'a[href*="' . esc_attr( $this->utm_campaign ) . '"]';
+ }
+
+ /**
+ * Get campaign URL.
+ *
+ * @since 2.0.0
+ *
+ * @return string The campaign URL.
+ */
+ public function get_campaign_url() {
+ return $this->campaign_url;
+ }
+
+ /**
+ * Get menu slug.
+ *
+ * @since 2.0.0
+ *
+ * @return string The menu slug.
+ */
+ public function get_menu_slug() {
+ return $this->menu_slug;
+ }
+
+ /**
+ * Enqueue custom styles for the Black Friday menu items.
+ *
+ * @since 2.0.0
+ *
+ * @return void
+ */
+ public function enqueue_menu_styles() {
+ if ( ! Utils::current_user_can_view() ) {
+ return;
+ }
+
+ $link = $this->get_menu_link_selectors();
+ $arrow_svg = '<svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" viewBox="0 0 9 9" fill="none"><path d="M0.75 8.25L8 1M2 0.75H8.25V7" stroke="black" stroke-width="1.5"/></svg>';
+ $arrow_mask = 'url("data:image/svg+xml,' . rawurlencode( $arrow_svg ) . '") no-repeat center / contain';
+
+ // All plugins share the same design. The title keeps the admin menu's system font.
+ $custom_css = $link . ' {
+ background: #00ff08 !important;
+ color: #000 !important;
+ font-size: 14px !important;
+ font-weight: 400 !important;
+ padding-right: 8px !important; /* More room, so the title fits on one line. */
+ transition: background-color 0.3s ease !important;
+ }
+
+ ' . $this->get_menu_link_selectors( ':hover' ) . ' {
+ background: #72A441 !important;
+ color: #000 !important;
+ box-shadow: none !important;
+ }
+
+ /* A focused link, eg after a click opened the new tab, looks the same as when idle. */
+ ' . $this->get_menu_link_selectors( ':focus:not(:hover)' ) . ' {
+ background: #00ff08 !important;
+ color: #000 !important;
+ }
+
+ /* The "Sale" tag and arrow wrap together, so the arrow is never on its own line. */
+ #adminmenu ' . $this->get_menu_link_attribute() . ' .wpmudev-bf-menu-tag {
+ white-space: nowrap;
+ }
+
+ /* The "Sale" tag uses Roboto when the page has it loaded. */
+ #adminmenu ' . $this->get_menu_link_attribute() . ' .wpmudev-bf-menu-sale {
+ display: inline-block;
+ margin-left: 1px;
+ padding: 0 5px;
+ border: 1px solid currentColor;
+ border-radius: 100px;
+ font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ font-size: 12px;
+ font-weight: 400;
+ line-height: 14px;
+ vertical-align: 1px;
+ }
+
+ /* Drawn with CSS, as some menu editors remove svg tags from menu titles, eg Branda. It uses the text color. */
+ #adminmenu ' . $this->get_menu_link_attribute() . ' .wpmudev-bf-menu-arrow {
+ display: inline-block;
+ width: 9px;
+ height: 9px;
+ margin-left: 6px;
+ vertical-align: 0;
+ background-color: currentColor;
+ -webkit-mask: ' . $arrow_mask . ';
+ mask: ' . $arrow_mask . ';
+ }
+ ';
+
+ wp_add_inline_style( 'admin-menu', $custom_css );
+
+ // Open the Black Friday menu links in a new tab.
+ wp_add_inline_script(
+ 'common',
+ 'document.querySelectorAll(' . wp_json_encode( '#adminmenu ' . $this->get_menu_link_attribute() ) . ').forEach(function(a){a.target="_blank";a.rel="noopener noreferrer";});'
+ );
+ }
+
+ /**
+ * Get the CSS selectors of the Black Friday menu links.
+ *
+ * Some plugins style the last item of their menu, which is our link, eg Hustle's
+ * `#adminmenu #toplevel_page_hustle .wp-submenu li:last-child a[href^="https://wpmudev.com"]`.
+ * So each plugin's menu gets a selector with two ids and the top level item's core classes to win.
+ *
+ * @since 2.1.0
+ *
+ * @param string $state Optional. A state to append to the link, eg `:hover`.
+ *
+ * @return string Comma separated selectors.
+ */
+ private function get_menu_link_selectors( $state = '' ) {
+ $link = $this->get_menu_link_attribute();
+ $selectors = array( '#adminmenu ' . $link . $state );
+
+ foreach ( Utils::get_plugins_list() as $plugin_data ) {
+ $parent_slug = $plugin_data['admin_parent_page'] ?? '';
+
+ if ( empty( $parent_slug ) ) {
+ continue;
+ }
+
+ // Same as core builds the top level menu item id.
+ $menu_id = preg_replace( '|[^a-zA-Z0-9_:.]|', '-', 'toplevel_page_' . $parent_slug );
+ $selectors[] = '#adminmenu #' . $menu_id . '.menu-top.wp-has-submenu .wp-submenu li ' . $link . $state;
+ }
+
+ return implode( ",nttt", $selectors );
+ }
+
+}
--- a/wp-smushit/core/external/wpmudev-blackfriday/includes/class-banner.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/includes/class-banner.php
@@ -0,0 +1,443 @@
+<?php
+/**
+ * WPMUDEV Black Friday Banner class
+ *
+ * Handles the display and rendering of Black Friday promotional banners.
+ *
+ * @since 2.0.0
+ * @author WPMUDEV
+ * @package WPMUDEVModulesBlackFriday
+ */
+
+namespace WPMUDEVModulesBlackFriday;
+
+// Exit if accessed directly.
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+/**
+ * Class Banner
+ *
+ * Manages Black Friday banner display and interactions.
+ *
+ * @since 2.0.0
+ */
+class Banner {
+
+ /**
+ * Banner version.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $version = '2.1.0';
+
+ /**
+ * Campaign URL.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $campaign_url = '';
+
+ /**
+ * Campaign UTM link.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $utm_campaign = 'BF-Plugins-2026-banner';
+
+ /**
+ * Option name to store data.
+ *
+ * @since 1.0
+ * @var string $option_name
+ */
+ protected $option_name = 'wpmudev_black_friday_2026_flag';
+
+ /**
+ * DOM element ID for the banner.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $dom_element_id = '';
+
+ /**
+ * Script version.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ protected $script_version;
+
+ /**
+ * Nonce.
+ *
+ * @since 1.0
+ * @var string $nonce
+ */
+ protected $nonce = 'wpmudev-bf-common';
+
+ /**
+ * UTM content for the banner.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ private $utm_content = 'BF-Plugins-2026';
+
+ /**
+ * Constructor.
+ *
+ * @since 2.0.0
+ *
+ * @param array $args Optional. Banner configuration arguments.
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'campaign_url' => 'https://wpmudev.com/black-friday/',
+ );
+
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->campaign_url = esc_url( $args['campaign_url'] );
+ $this->script_version = ! empty( Utils::script_data( 'banner', 'version' ) ) ? Utils::script_data( 'banner', 'version' ) : $this->version;
+ $this->dom_element_id = 'wpmudev-bf-banner-' . $this->script_version;
+
+ $this->set_actions();
+ }
+
+ /**
+ * Set the wp hooks-actions for module Banner (The admin notice).
+ *
+ * @return void
+ */
+ protected function set_actions() {
+ // Enqueue scripts and styles for the banner.
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
+
+ // Render the banner in admin notices.
+ add_action( 'admin_notices', array( $this, 'render' ) );
+ add_action( 'network_admin_notices', array( $this, 'render' ) );
+
+ // Ajax request to dismiss.
+ add_action( 'wp_ajax_wpmudev_bf_dismiss', array( $this, 'dismiss_banner' ) );
+ }
+
+ /**
+ * Enqueue assets for banner module of the BF sub-module.
+ *
+ * @return void
+ */
+ public function enqueue_assets() {
+ if ( ! $this->can_display() ) {
+ return;
+ }
+
+ $this->enqueue_styles();
+ $this->enqueue_scripts();
+ }
+
+ /**
+ * Enqueues scripts and styles for the banner.
+ *
+ * @since 1.0
+ *
+ * @return void
+ */
+ public function enqueue_styles() {
+ wp_enqueue_style(
+ 'wpmudev-bf-common',
+ WPMUDEV_MODULE_BLACK_FRIDAY_ASSETS_URL . '/banner.min.css',
+ array(),
+ $this->script_version
+ );
+
+ // Hide the banner while the plugin shows a full screen view, eg Smush's onboarding wizard.
+ // The plugin adds the body class in PHP, so the banner is hidden from the first paint, and shows again if the class is removed.
+ $hidden_body_class = sanitize_html_class( Utils::get_current_page_plugin()['banner_hidden_body_class'] ?? '' );
+
+ if ( ! empty( $hidden_body_class ) ) {
+ wp_add_inline_style(
+ 'wpmudev-bf-common',
+ sprintf( 'body.%s #wpbody-content .wpmudev-bf-banner { display: none !important; }', $hidden_body_class )
+ );
+ }
+ }
+
+ /**
+ * Enqueues js scripts for the banner.
+ *
+ * @since 1.0
+ *
+ * @return void
+ */
+ public function enqueue_scripts() {
+ $dependencies = ! empty( Utils::script_data( 'banner', 'dependencies' ) )
+ ? Utils::script_data( 'banner', 'dependencies' )
+ : array(
+ 'react',
+ 'wp-element',
+ 'wp-i18n',
+ 'wp-is-shallow-equal',
+ 'wp-polyfill',
+ 'wp-dom-ready',
+ );
+
+ $plugin_data = Utils::get_current_page_plugin();
+ $utm_source = $plugin_data['utm_source'] ?? '';
+ $campaign_url = add_query_arg(
+ array(
+ 'utm_source' => $utm_source,
+ 'utm_medium' => 'plugin',
+ 'utm_campaign' => $utm_source . '-' . $this->utm_campaign,
+ 'utm_content' => $this->utm_content,
+ ),
+ Utils::get_campaign_url( $plugin_data, $this->campaign_url )
+ );
+
+ wp_enqueue_script(
+ 'wpmudev-bf-common',
+ WPMUDEV_MODULE_BLACK_FRIDAY_ASSETS_URL . '/banner.min.js',
+ $dependencies,
+ $this->script_version,
+ true
+ );
+
+ $data = array(
+ 'nonce' => wp_create_nonce( $this->nonce ),
+ 'campaign_url' => $campaign_url,
+ 'dom_element_id' => $this->dom_element_id,
+ 'container' => Utils::get_current_page_plugin()['banner_container'] ?? '',
+ 'translation_texts' => $this->translation_texts(),
+ 'root_url' => esc_url( WPMUDEV_MODULE_BLACK_FRIDAY_URL ),
+ );
+
+ /**
+ * Filters the banner data, eg its texts or campaign URL.
+ *
+ * @since 2.1.0
+ *
+ * @param array $data The banner script data.
+ */
+ $data = (array) apply_filters( 'wpmudev_blackfriday_banner_data', $data );
+
+ $data['campaign_url'] = esc_url_raw( $data['campaign_url'] ?? '' );
+
+ wp_localize_script( 'wpmudev-bf-common', 'wpmudevBFBanner', $data );
+ }
+
+ /**
+ * Render the banner HTML.
+ *
+ * @since 2.0.0
+ *
+ * @return void
+ */
+ public function render() {
+ if ( ! $this->can_display() ) {
+ return;
+ }
+
+ static $printed = false;
+
+ if ( $printed ) {
+ return;
+ }
+ $printed = true;
+
+ ?>
+ <div id="<?php echo esc_attr( $this->dom_element_id ); ?>" class="wpmudev-bf-banner notice"></div>
+ <?php
+ }
+
+ /**
+ * Check if banner can be displayed.
+ *
+ * @since 2.0.0
+ *
+ * @return bool True if banner can be displayed, false otherwise.
+ */
+ private function can_display() {
+ static $can_display = null;
+
+ if ( ! is_null( $can_display ) ) {
+ return $can_display;
+ }
+
+ // Check user capabilities, if banner/notice has been dismissed (closed) and if current page is one of our plugins admin pages.
+ if ( ! Utils::current_user_can_view() || $this->is_dismissed() || ! $this->is_allowed_page() ) {
+ $can_display = false;
+ } else {
+ $can_display = true;
+ }
+
+ return $can_display;
+ }
+
+ /**
+ * Check if current page is one of our plugins admin pages.
+ *
+ * @since 2.0.0
+ *
+ * @return bool True if current page is allowed, false otherwise.
+ */
+ private function is_allowed_page() {
+ if ( ! function_exists( 'get_current_screen' ) ) {
+ return false;
+ }
+
+ $screen = get_current_screen();
+
+ if ( empty( $screen ) || empty( $screen->id ) ) {
+ return false;
+ }
+
+ $allowed_slugs = $this->get_plugin_screens();
+ $current_page = $screen->id;
+
+ foreach ( $allowed_slugs as $slug ) {
+ if ( is_string( $slug ) && str_contains( $current_page, $slug ) ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get's the admin screens of each WPMU DEV plugin.
+ *
+ * @return array
+ */
+ protected function get_plugin_screens() {
+ return Utils::get_plugin_screens();
+ }
+
+ /**
+ * Get's all plugin data from plugins_list file.
+ *
+ * @return array
+ */
+ protected function get_plugins_list() {
+ return Utils::get_plugins_list();
+ }
+
+ /**
+ * Ajax request handler for banner dismissal.
+ *
+ * @since 2.0
+ *
+ * @return void
+ */
+ public function dismiss_banner() {
+ // Verify nonce.
+ check_ajax_referer( $this->nonce, 'nonce' );
+
+ // Anyone who can see the banner can dismiss it, for everyone.
+ if ( ! Utils::current_user_can_view() ) {
+ wp_send_json_error( array( 'success' => false ), 403 );
+ }
+
+ // Dismiss notice.
+ update_site_option( $this->option_name, true );
+
+ wp_send_json_success( array( 'success' => true ) );
+ }
+
+ /**
+ * Check if the banner has been dismissed.
+ *
+ * @since 2.0.0
+ *
+ * @return bool True if dismissed, false otherwise.
+ */
+ private function is_dismissed() {
+ return (bool) get_site_option( $this->option_name, false );
+ }
+
+ /**
+ * Get the DOM element ID.
+ *
+ * @since 2.0.0
+ *
+ * @return string The DOM element ID.
+ */
+ public function get_dom_element_id() {
+ return $this->dom_element_id;
+ }
+
+ /**
+ * Get UTM link.
+ *
+ * @since 2.0.0
+ *
+ * @return string The UTM link.
+ */
+ public function get_utm_campaign() {
+ return $this->utm_campaign;
+ }
+
+ /**
+ * Get banner version.
+ *
+ * @since 2.0.0
+ *
+ * @return string The version number.
+ */
+ public function get_version() {
+ return $this->version;
+ }
+
+ /**
+ * Gets assets data for given key.
+ *
+ * @param string $key The requested portion of data, an array key, usually version or dependencies.
+ *
+ * @return string|array
+ */
+ protected function script_data( $key = '' ) {
+ return Utils::script_data( 'banner', $key );
+ }
+
+ /**
+ * Gets the script data from assets php file.
+ *
+ * @return array
+ */
+ protected function raw_script_data() {
+ return Utils::raw_script_data( 'banner' );
+ }
+
+ /**
+ * Get translation texts for the banner.
+ *
+ * @since 2.0.0
+ *
+ * @return array The translation texts.
+ */
+ protected function translation_texts() {
+ /**
+ * Filters the deal price shown in the banner subtext.
+ *
+ * @since 2.1.0
+ *
+ * @param string $price The deal price, eg $3.33/m.
+ */
+ $price = apply_filters( 'wpmudev_blackfriday_deal_price', '$3.33/m' );
+
+ return array(
+ 'dismiss_button' => __( 'Dismiss', 'wpmudev-black-friday' ),
+ 'black_friday_special' => __( 'Black Friday Special', 'wpmudev-black-friday' ),
+ 'subtext' => sprintf(
+ /* translators: %s: The deal price, eg $3.33/m. */
+ __( '%s for unlimited sites', 'wpmudev-black-friday' ),
+ $price
+ ),
+ 'button_text' => __( 'See the deal', 'wpmudev-black-friday' ),
+ );
+ }
+}
--- a/wp-smushit/core/external/wpmudev-blackfriday/includes/class-upsell-widget.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/includes/class-upsell-widget.php
@@ -0,0 +1,203 @@
+<?php
+/**
+ * WPMUDEV Black Friday Upsell Widget class
+ *
+ * Restyles the plugins' upsell widgets for the Black Friday campaign.
+ *
+ * @since 2.1.0
+ * @author WPMUDEV
+ * @package WPMUDEVModulesBlackFriday
+ */
+
+namespace WPMUDEVModulesBlackFriday;
+
+// Exit if accessed directly.
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+/**
+ * Class Upsell_Widget
+ *
+ * Plugins don't provide hooks for their upsell widgets, so the widgets are found and changed with js.
+ * Each plugin sets its widget selectors in plugins-list.php under the `upsell_widget` key.
+ *
+ * @since 2.1.0
+ */
+class Upsell_Widget {
+
+ /**
+ * Script version.
+ *
+ * @since 2.1.0
+ * @var string
+ */
+ private $version = '2.1.0';
+
+ /**
+ * Campaign URL.
+ *
+ * @since 2.1.0
+ * @var string
+ */
+ private $campaign_url = '';
+
+ /**
+ * UTM campaign for the widget.
+ *
+ * @since 2.1.0
+ * @var string
+ */
+ private $utm_campaign = 'BF-Plugins-2026-widget';
+
+ /**
+ * UTM content for the widget.
+ *
+ * @since 2.1.0
+ * @var string
+ */
+ private $utm_content = 'BF-Plugins-2026';
+
+ /**
+ * Constructor.
+ *
+ * @since 2.1.0
+ *
+ * @param array $args Optional. Widget configuration arguments.
+ */
+ public function __construct( $args = array() ) {
+ $defaults = array(
+ 'campaign_url' => 'https://wpmudev.com/black-friday/',
+ );
+
+ $args = wp_parse_args( $args, $defaults );
+
+ $this->campaign_url = esc_url( $args['campaign_url'] );
+
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
+ }
+
+ /**
+ * Enqueue widget assets on the screens of plugins that have an upsell widget.
+ *
+ * @since 2.1.0
+ *
+ * @return void
+ */
+ public function enqueue_assets() {
+ if ( ! Utils::current_user_can_view() ) {
+ return;
+ }
+
+ $widgets = $this->get_current_screen_widgets();
+
+ if ( empty( $widgets ) ) {
+ return;
+ }
+
+ // Read the asset file directly. Utils::script_data() returns the whole array when a key is empty, eg no dependencies.
+ $asset = Utils::raw_script_data( 'widget' );
+ $script_version = ! empty( $asset['version'] ) ? $asset['version'] : $this->version;
+ $dependencies = $asset['dependencies'] ?? array();
+
+ wp_enqueue_style(
+ 'wpmudev-bf-widget',
+ WPMUDEV_MODULE_BLACK_FRIDAY_ASSETS_URL . '/widget.min.css',
+ array(),
+ $script_version
+ );
+
+ wp_enqueue_script(
+ 'wpmudev-bf-widget',
+ WPMUDEV_MODULE_BLACK_FRIDAY_ASSETS_URL . '/widget.min.js',
+ $dependencies,
+ $script_version,
+ false // In the head, so the widget is restyled while it's parsed. See src/widget.js.
+ );
+
+ /**
+ * Filters the upsell widget data, eg its texts or campaign URLs.
+ *
+ * @since 2.1.0
+ *
+ * @param array $data The widget script data.
+ */
+ $data = (array) apply_filters(
+ 'wpmudev_blackfriday_widget_data',
+ array(
+ 'widgets' => $widgets,
+ 'translation_texts' => $this->translation_texts(),
+ )
+ );
+
+ foreach ( (array) ( $data['widgets'] ?? array() ) as $key => $widget ) {
+ $data['widgets'][ $key ]['campaign_url'] = esc_url_raw( $widget['campaign_url'] ?? '' );
+ }
+
+ wp_localize_script( 'wpmudev-bf-widget', 'wpmudevBFWidget', $data );
+ }
+
+ /**
+ * Get the upsell widgets settings for the current screen.
+ *
+ * @since 2.1.0
+ *
+ * @return array The widgets settings, each with its campaign url.
+ */
+ private function get_current_screen_widgets() {
+ if ( ! function_exists( 'get_current_screen' ) ) {
+ return array();
+ }
+
+ $screen = get_current_screen();
+
+ if ( empty( $screen ) || empty( $screen->id ) ) {
+ return array();
+ }
+
+ $widgets = array();
+
+ foreach ( Utils::get_plugins_list() as $plugin_key => $plugin_data ) {
+ $widget = $plugin_data['upsell_widget'] ?? array();
+
+ if ( empty( $widget['screens'] ) || empty( $widget['button'] ) || ! in_array( $screen->id, (array) $widget['screens'], true ) ) {
+ continue;
+ }
+
+ $utm_source = $plugin_data['utm_source'] ?? '';
+
+ $widgets[] = array(
+ 'plugin' => sanitize_html_class( $plugin_key ),
+ 'button' => $widget['button'],
+ 'container' => $widget['container'] ?? '',
+ 'title' => $widget['title'] ?? '',
+ 'hide' => $widget['hide'] ?? '',
+ 'campaign_url' => add_query_arg(
+ array(
+ 'utm_source' => $utm_source,
+ 'utm_medium' => 'plugin',
+ 'utm_campaign' => $utm_source . '-' . $this->utm_campaign,
+ 'utm_content' => $this->utm_content,
+ ),
+ Utils::get_campaign_url( $plugin_data, $this->campaign_url )
+ ),
+ );
+ }
+
+ return $widgets;
+ }
+
+ /**
+ * Get translation texts for the widget.
+ *
+ * @since 2.1.0
+ *
+ * @return array The translation texts.
+ */
+ protected function translation_texts() {
+ return array(
+ 'black_friday_special' => __( 'Black Friday Special', 'wpmudev-black-friday' ),
+ 'button_text' => __( 'See the deal', 'wpmudev-black-friday' ),
+ );
+ }
+}
--- a/wp-smushit/core/external/wpmudev-blackfriday/includes/class-utils.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/includes/class-utils.php
@@ -0,0 +1,270 @@
+<?php
+/**
+ * WPMUDEV Black Friday Utils class
+ *
+ * Common utility methods for the Black Friday module.
+ *
+ * @since 2.0.0
+ * @author WPMUDEV
+ * @package WPMUDEVModulesBlackFriday
+ */
+
+namespace WPMUDEVModulesBlackFriday;
+
+// Exit if accessed directly.
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+/**
+ * Class Utils
+ *
+ * Common utility methods for the Black Friday module.
+ *
+ * @since 2.0.0
+ */
+class Utils {
+
+ /**
+ * Gets the script data from assets php file.
+ *
+ * @since 2.0.0
+ *
+ * @param string $handle The script handle (e.g., 'banner').
+ *
+ * @return array The script data.
+ */
+ public static function raw_script_data( $handle = '' ) {
+ static $script_data = array();
+
+ if ( empty( $handle ) ) {
+ return array();
+ }
+
+ if ( isset( $script_data[ $handle ] ) ) {
+ return $script_data[ $handle ];
+ }
+
+ $file_path = WPMUDEV_MODULE_BLACK_FRIDAY_DIR . 'build/' . $handle . '.min.asset.php';
+
+ if ( file_exists( $file_path ) ) {
+ $script_data[ $handle ] = include $file_path;
+ } else {
+ $script_data[ $handle ] = array();
+ }
+
+ return (array) $script_data[ $handle ];
+ }
+
+ /**
+ * Gets assets data for given key.
+ *
+ * @since 2.0.0
+ *
+ * @param string $handle The script handle (e.g., 'banner').
+ * @param string $key The requested portion of data, an array key, usually version or dependencies.
+ *
+ * @return string|array The script data or specific key value.
+ */
+ public static function script_data( $handle = '', $key = '' ) {
+ $raw_script_data = self::raw_script_data( $handle );
+
+ return ! empty( $key ) && ! empty( $raw_script_data[ $key ] ) ? $raw_script_data[ $key ] : $raw_script_data;
+ }
+
+ /**
+ * Get's all plugin data from plugins_list file.
+ *
+ * @since 2.0.0
+ *
+ * @return array The plugins list.
+ */
+ public static function get_plugins_list() {
+ static $plugins_list = null;
+
+ if ( is_null( $plugins_list ) ) {
+ $plugins_file = untrailingslashit( WPMUDEV_MODULE_BLACK_FRIDAY_DIR ) . '/includes/plugins-list.php';
+
+ if ( file_exists( $plugins_file ) ) {
+ $plugins_list = require_once $plugins_file;
+ }
+ }
+
+ return is_array( $plugins_list ) ? $plugins_list : array();
+ }
+
+ /**
+ * Get's the admin screens of each WPMU DEV plugin.
+ *
+ * @since 2.0.0
+ *
+ * @return array The plugin screen slugs.
+ */
+ public static function get_plugin_screens() {
+ static $plugins_screens = null;
+
+ if ( is_null( $plugins_screens ) ) {
+ $plugins_list = self::get_plugins_list();
+ $plugins_screens = array();
+
+ // Extract admin_url_page from each plugin.
+ $admin_pages = wp_list_pluck( $plugins_list, 'admin_url_page' );
+
+ // Flatten in case admin_url_page is an array.
+ foreach ( $admin_pages as $page ) {
+ if ( is_array( $page ) ) {
+ // If it's an array, add each item.
+ $plugins_screens = array_merge( $plugins_screens, $page );
+ } elseif ( ! empty( $page ) ) {
+ // If it's a single value, add it directly.
+ $plugins_screens[] = $page;
+ }
+ }
+
+ // Remove duplicates and reindex.
+ $plugins_screens = array_values( array_unique( $plugins_screens ) );
+ }
+
+ return $plugins_screens;
+ }
+
+ /**
+ * Get's the parent admin screens of each WPMU DEV plugin.
+ *
+ * @since 2.0.0
+ *
+ * @return array The plugin parent screen slugs.
+ */
+ public static function get_plugin_parent_screens() {
+ $plugins_list = self::get_plugins_list();
+ return array_values(
+ wp_list_pluck( $plugins_list, 'admin_parent_page' )
+ );
+ }
+
+ /**
+ * Get's the parent menu slugs of each WPMU DEV plugin.
+ *
+ * @since 2.0.0
+ *
+ * @return array The parent menu slugs.
+ */
+ public static function get_parent_menu_slugs() {
+ return self::get_plugin_screens();
+ }
+
+ /**
+ * Polyfill for str_ends_with function for PHP versions < 8.0 and WP versions < 5.9. BLC supports from WP 5.2+.
+ *
+ * @since 2.0.0
+ *
+ * @param string $haystack The string to search in.
+ * @param string $needle The substring to search for.
+ *
+ * @return bool True if $haystack ends with $needle, false otherwise.
+ */
+ public static function str_ends_with( $haystack, $needle ) {
+ if ( function_exists( 'str_ends_with' ) ) {
+ return str_ends_with( $haystack, $needle );
+ }
+
+ $length = strlen( $needle );
+ if ( 0 === $length ) {
+ return true;
+ }
+
+ return substr( $haystack, -$length ) === $needle;
+ }
+
+ /**
+ * Get UTM source for given plugin key.
+ *
+ * @since 2.0.0
+ *
+ * @param string $key The plugin key.
+ *
+ * @return string The UTM source.
+ */
+ public static function get_utm_source( $key = '' ) {
+ $plugins_list = self::get_plugins_list();
+ $utm_source = '';
+
+ if ( isset( $plugins_list[ $key ] ) && isset( $plugins_list[ $key ]['utm_source'] ) ) {
+ $utm_source = $plugins_list[ $key ]['utm_source'];
+ }
+
+ return $utm_source;
+ }
+
+ /**
+ * Get the plugin's campaign URL, or the shared one if it has none.
+ *
+ * @since 2.1.0
+ *
+ * @param array $plugin_data The plugin data from the plugins list.
+ * @param string $default_url The shared campaign URL.
+ *
+ * @return string The campaign URL, without UTM parameters.
+ */
+ public static function get_campaign_url( $plugin_data, $default_url ) {
+ return ! empty( $plugin_data['campaign_url'] ) ? (string) $plugin_data['campaign_url'] : $default_url;
+ }
+
+ /**
+ * Checks if the current user can see and dismiss the campaign.
+ *
+ * Single site: admins. Multisite: super admins, on the main site and network admin only.
+ *
+ * @since 2.1.0
+ *
+ * @return bool
+ */
+ public static function current_user_can_view() {
+ if ( is_multisite() ) {
+ return is_main_site() && is_super_admin();
+ }
+
+ return current_user_can( 'manage_options' );
+ }
+
+ /**
+ * Get UTM source for the current admin page.
+ *
+ * @since 2.0.0
+ *
+ * @return string The UTM source.
+ */
+ public static function get_current_page_utm_source() {
+ $plugin_data = self::get_current_page_plugin();
+
+ return $plugin_data['utm_source'] ?? '';
+ }
+
+ /**
+ * Get the plugin data for the current admin page.
+ *
+ * @since 2.1.0
+ *
+ * @return array The plugin data from plugins-list.php, empty if the page doesn't belong to any plugin.
+ */
+ public static function get_current_page_plugin() {
+ $current_screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
+
+ if ( empty( $current_screen ) || empty( $current_screen->id ) ) {
+ return array();
+ }
+
+ $current_page = $current_screen->id;
+
+ foreach ( self::get_plugins_list() as $plugin_data ) {
+ // Can be a string or an array of page slugs, eg Defender.
+ foreach ( (array) ( $plugin_data['admin_url_page'] ?? array() ) as $admin_url_page ) {
+ if ( is_string( $admin_url_page ) && '' !== $admin_url_page && str_contains( $current_page, $admin_url_page ) ) {
+ return $plugin_data;
+ }
+ }
+ }
+
+ return array();
+ }
+}
--- a/wp-smushit/core/external/wpmudev-blackfriday/includes/plugins-list.php
+++ b/wp-smushit/core/external/wpmudev-blackfriday/includes/plugins-list.php
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Plugin list of WPMU DEV for the black-friday sub-module.
+ *
+ * @link https://wpmudev.com/
+ * @since 2.0.0
+ *
+ * @author WPMUDEV (https://wpmudev.com)
+ * @package WPMUDEVPlugin_Cross_Sell
+ *
+ * @copyright (c) 2025, WPMU DEV (http://wpmudev.com)
+ */
+
+return array(
+ 'forminator' => array(
+ 'slug' => 'forminator',
+ 'path' => 'forminator/forminator.php',
+ 'utm_source' => 'forminator',
+ 'utm_campaign' => 'blackfriday_plugin_forminator',
+ // Optional. The plugin's own campaign page, instead of the shared one.
+ 'campaign_url' => 'https://wpmudev.com/project/forminator-pro/',
+ 'admin_url_page' => 'forminator',
+ 'admin_parent_page' => 'forminator',
+ 'upsell_widget' => array(
+ // Screen ids where the upsell widget is displayed.
+ 'screens' => array( 'toplevel_page_forminator', 'toplevel_page_forminator-network' ),
+ // The widget's upgrade button. Used to find the widget, as it has no id or unique class.
+ 'button' => 'a[href*="forminator_dashboard_upsellwidget_button"]',
+ // The widget wrapper, the closest parent of the button.
+ 'container' => '.sui-box',
+ // The badge image is added at the end of the title.
+ 'title' => '.sui-box-title',
+ // Elements to hide, eg the PRO tag.
+ 'hide' => '.sui-tag-pro',
+ ),
+ ),
+ 'smush' => array(
+ 'slug' => 'wp-smushit',
+ 'path' => 'wp-smushit/wp-smush.php',
+ 'utm_source' => 'smush',
+ 'utm_campaign' => 'blackfriday_plugin_smush',
+ 'campaign_url' => 'https://wpmudev.com/project/wp-smush-pro/',
+ 'admin_url_page' => 'smush',
+ 'admin_parent_page' => 'smush',
+ // Optional. The plugin uses the new UI, so its menu gets the full Black Friday design.
+ 'new_ui' => true,
+ // The banner is moved to the top of this element, below the plugin's page header. Rendered with js by the plugin.
+ 'banner_container' => '.smush-main-content-inner',
+ // The banner is hidden while the body has this class. Smush adds it on all its pages while its onboarding wizard is shown.
+ 'banner_hidden_body_class' => 'smush-onboarding-wizard',
+ ),
+ 'hummingbird' => array(
+ 'slug' => 'hummingbird-performance',
+ 'path' => 'hummingbird-performance/wp-hummingbird.php',
+ 'utm_source' => 'hummingbird',
+ 'utm_campaign' => 'blackfriday_plugin_hummingbird',
+ 'campaign_url' => 'https://wpmudev.com/project/wp-hummingbird/',
+ 'admin_url_page' => 'wphb',
+ 'admin_parent_page' => 'wphb',
+ 'new_ui' => true,
+ 'banner_container' => '.wpmudev-hb-main-content-inner',
+ ),
+ 'defender' => array(
+ 'slug' => 'defender-security',
+ 'path' => 'defender-security/wp-defender.php',
+ 'utm_source' => 'defender',
+ 'utm_campaign' => 'blackfriday_plugin_defender',
+ 'campaign_url' => 'https://wpmudev.com/project/wp-defender/',
+ 'admin_url_page' => array( 'wp-defender', 'wdf-' ),
+ 'admin_parent_page' => 'wp-defender',
+ 'new_ui' => true,
+ 'banner_container' => '.defender-main-content-inner',
+ ),
+ 'smartcrawl' => array(
+ 'slug' => 'smartcrawl-seo',
+ 'path' => 'smartcrawl-seo/wpmu-dev-seo.php',
+ 'utm_source' => 'smartcrawl',
+ 'utm_campaign' => 'blackfriday_plugin_smartcrawl',
+ 'campaign_url' => 'https://wpmudev.com/project/smartcrawl-wordpress-seo/',
+ 'admin_url_page' => 'wds',
+ 'admin_parent_page' => 'wds_wizard',
+ 'upsell_widget' => array(
+ 'screens' => array( 'toplevel_page_wds_wizard', 'toplevel_page_wds_wizard-network' ),
+ 'button' => 'a[href*="smartcrawl_dashboard_upsellwidget_button"]',
+ 'container' => '#wds-upgrade',
+ 'title' => '.sui-box-title',
+ 'hide' => '.sui-tag-pro',
+ ),
+ ),
+ 'hustle' => array(
+ 'slug' => 'wordpress-popup',
+ 'path' => 'wordpress-popup/popover.php',
+ 'utm_source' => 'hustle',
+ 'utm_campaign' => 'blackfriday_plugin_hustle',
+ 'campaign_url' => 'https://wpmudev.com/project/hustle/',
+ 'admin_url_page' => 'hustle',
+ 'admin_parent_page' => 'hustle',
+ 'upsell_widget' => array(
+ 'screens' => array( 'toplevel_page_hustle' ),
+ 'button' => 'a[href*="hustle_dashboard_upsellwidget_button"]',
+ 'container' => '.hui-box-upsell',
+ 'title' => '.sui-box-title',
+ 'hide' => '.sui-tag-pro',
+ ),
+ ),
+ 'branda' => array(
+ 'slug' => 'branda-white-labeling',
+ 'path' => 'branda-white-labeling/ultimate-branding.php',
+ 'utm_source' => 'branda',
+ 'utm_campaign' => 'blackfriday_plugin_branda',
+ 'campaign_url' => 'https://wpmudev.com/project/ultimate-branding/',
+ 'admin_url_page' => 'branding',
+ 'admin_parent_page' => 'branding',
+ 'upsell_widget' => array(
+ 'screens' => array( 'toplevel_page_branding', 'toplevel_page_branding-network' ),
+ 'button' => 'a[href*="branda_dashboard_upsellwidget_button"]',
+ 'container' => '#branda-dashboard-widget-upsell',
+ 'title' => '.sui-box-title',
+ 'hide' => '.sui-tag-pro',
+ ),
+ ),
+ 'beehive' => array(
+ 'slug' => 'beehive-analytics',
+ 'path' => 'beehive-analytics/beehive-analytics.php',
+ 'utm_source' => 'beehive',
+ 'utm_campaign' => 'blackfriday_plugin_beehive',
+ 'campaign_url' => 'https://wpmudev.com/project/beehive-analytics-pro/',
+ 'admin_url_page' => 'beehive',
+ 'admin_parent_page' => 'beehive',
+ ),
+ 'broken-link-checker' => array(
+ 'slug' => 'broken-link-checker',
+ 'path' => 'broken-link-checker/broken-link-checker.php',
+ 'utm_source' => 'blc',
+ 'utm_campaign' => 'blackfriday_plugin_blc',
+ 'campaign_url' => 'https://wpmudev.com/black-friday/',
+ 'admin_url_page' => 'blc',
+ 'admin_parent_page' => 'blc_dash',
+ ),
+);
--- a/wp-smushit/core/parser/class-parser.php
+++ b/wp-smushit/core/parser/class-parser.php
@@ -447,18 +447,50 @@
}
public function get_element_attribute_value( $element_markup, $attribute_name ) {
- if ( strpos( $element_markup, $attribute_name ) === false ) {
+ if ( false === stripos( $element_markup, $attribute_name ) ) {
return '';
}
- $pattern = '#' . $attribute_name . 's*=s*(['|"])(?<value>(?:(?!1).)*)1#is';
+ $pattern = '#' . preg_quote( $attribute_name, '#' ) . 's*=s*(['"])(?<value>(?:(?!1).)*)1#is';
if ( ! preg_match_all( $pattern, $element_markup, $matches, PREG_SET_ORDER ) ) {
return '';
}
- return empty( $matches[0]['value'] )
- ? ''
- : $matches[0]['value'];
+ $value = $matches[0]['value'];
+ if ( '' === $value ) {
+ return '';
+ }
+
+ if ( ! $this->is_valid_element_attribute_value( $element_markup, $attribute_name, $value ) ) {
+ return '';
+ }
+
+ // Preserve the original entity encoding used by existing callers/replacements.
+ return $value;
+ }
+
+ /**
+ * Validate a regex-extracted value against the actual HTML attribute.
+ *
+ * @param string $element_markup Element markup.
+ * @param string $attribute_name Attribute name.
+ * @param string $value Regex-extracted attribute value.
+ * @return bool
+ */
+ private function is_valid_element_attribute_value( $element_markup, $attribute_name, $value ) {
+ if ( ! class_exists( 'WP_HTML_Tag_Processor' ) ) {
+ return false;
+ }
+
+ $processor = new WP_HTML_Tag_Processor( $element_markup );
+ if ( ! $processor->next_tag() ) {
+ return false;
+ }
+
+ $actual_value = $processor->get_attribute( $attribute_name );
+ $decoded_value = html_entity_decode( $value, ENT_QUOTES | ENT_HTML5, 'UTF-8' );
+
+ return is_string( $actual_value ) && $decoded_value === $actual_value;
}
public function markup_contains_noscript( $markup ) {
--- a/wp-smushit/wp-smush.php
+++ b/wp-smushit/wp-smush.php
@@ -13,7 +13,7 @@
* Plugin Name: Smush
* Plugin URI: https://wpmudev.com/project/wp-smush-pro/
* Description: Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://wpmudev.com/">WPMU DEV</a> WordPress Smush API.
- * Version: 4.3.6
+ * Version: 4.3.7
* Requires at least: 6.4
* Requires PHP: 7.4
* Author: WPMU DEV
@@ -54,10 +54,10 @@
}
if ( ! defined( 'WP_SMUSH_VERSION' ) ) {
- define( 'WP_SMUSH_VERSION', '4.3.6' );
+ define( 'WP_SMUSH_VERSION', '4.3.7' );
}
if ( ! defined( 'WP_SMUSH_RELEASE_DATE' ) ) {
- define( 'WP_SMUSH_RELEASE_DATE', '2026-11-02' );
+ define( 'WP_SMUSH_RELEASE_DATE', '2026-11-16' );
}
// Used to define body class.
if ( ! defined( 'WP_SHARED_UI_VERSION' ) ) {
@@ -324,6 +324,7 @@
// The dash-notification actions are hooked into "init" with a priority of 10.
add_action( 'init', array( $this, 'register_pro_modules' ), 5 );
+ add_action( 'init', array( $this, 'load_blackfriday_module' ), 5 );
add_action( 'init', array( $this, 'do_plugin_activated_action' ) );
@@ -574,6 +575,22 @@
}
/**
+ * Loads the Black Friday campaign module.
+ */
+ public function load_blackfriday_module() {
+ if ( self::is_pro() || class_exists( 'WPMUDEVModulesBlackFridayCampaign' ) ) {
+ return;
+ }
+
+ $black_friday_path = WP_SMUSH_DIR . 'core/external/wpmudev-blackfriday/campaign.php';
+
+ if ( file_exists( $black_friday_path ) ) {
+ require_once $black_friday_path;
+ new WPMUDEVModulesBlackFridayCampaign();
+ }
+ }
+
+ /**
* Determines the menu position for the Cross-Sell module based on multisite and network access settings.
*
* @return int Menu position for the admin menu.