--- a/branda-white-labeling/external/plugins-cross-sell-page/app/submenus/class-cross-sell.php
+++ b/branda-white-labeling/external/plugins-cross-sell-page/app/submenus/class-cross-sell.php
@@ -162,8 +162,7 @@
}
$current_plugin_slug = $this->submenu_params['slug'];
- $free_plugins = $this->utilities->get_free_plugins();
- $pro_plugins = $this->utilities->get_pro_plugins();
+ $plugins_list = $this->plugins_list();
$handle = 'wpmudev_plugin_cross_sell';
$script_suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
$src = WPMUDEV_MODULE_PLUGIN_CROSS_SELL_ASSETS_URL . '/js/crosssellpage' . $script_suffix . '.js';
@@ -178,6 +177,8 @@
'wp-polyfill',
);
+
+
$this->page_scripts[ $handle ] = array(
'src' => $src,
'style_src' => $style_src,
@@ -191,8 +192,7 @@
'restEndpointGetPlugins' => 'wpmudev_pcs/v1/plugincrosssell/get_plugins', // Gets the list of plugins. The param need include the current plugin slug and type (free|pro).
'restEndpointInstall' => 'wpmudev_pcs/v1/plugincrosssell/install_plugin', // The endpoint to install a plugin.
'restEndpointActivate' => 'wpmudev_pcs/v1/plugincrosssell/activate_plugin', // The endpoint to activate a plugin.
- 'free_plugins' => ! empty( $free_plugins ) ? $this->filter_plugins_list( $free_plugins ) : array(),
- 'pro_plugins' => ! empty( $pro_plugins ) ? $this->filter_plugins_list( $pro_plugins ) : array(),
+ 'plugins_list' => ! empty( $plugins_list ) ? $plugins_list : array(),
'utmSource' => $this->get_utm_source(),
),
);
@@ -263,8 +263,8 @@
public function register_submenu() {
$default_params = array(
'parent_slug' => '',
- 'page_title' => __( 'More free Plugins?', 'plugin-cross-sell-textdomain' ),
- 'menu_title' => __( 'More free Plugins?', 'plugin-cross-sell-textdomain' ),
+ 'page_title' => __( 'Get More Free Plugins', 'plugin-cross-sell-textdomain' ),
+ 'menu_title' => __( 'Get More Free Plugins', 'plugin-cross-sell-textdomain' ),
'capability' => 'manage_options',
'menu_slug' => 'plugins_cross_sell',
'position' => 10,
@@ -302,6 +302,48 @@
);
}
+ // Add custom class to the submenu item.
+ add_action( 'admin_head', function () use ( $submenu_params ) {
+ global $submenu;
+ if ( isset( $submenu[ $submenu_params['parent_slug'] ] ) ) {
+ foreach ( $submenu[ $submenu_params['parent_slug'] ] as $index => $item ) {
+ if ( isset( $item[2] ) && $item[2] === $submenu_params['menu_slug'] ) {
+ // Add your custom class using CSS targeting.
+ echo '<style>
+ #adminmenu .wp-submenu a[href="admin.php?page=' . esc_attr( $submenu_params['menu_slug'] ) . '"] {
+ font-size: 12px;
+ line-height: 22px;
+ font-weight: 400 !important;
+ color: #fefefe !important;
+ position: relative;
+ }
+
+ #adminmenu .wp-submenu a[href="admin.php?page=' . esc_attr( $submenu_params['menu_slug'] ) . '"]:before {
+ content: "";
+ inset: 0;
+ background: linear-gradient(90deg, #1B1DAC 0%, #8D8D8D 100%);
+ position: absolute;
+ z-index: -1;
+ }
+
+ #adminmenu .wp-submenu a[href="admin.php?page=' . esc_attr( $submenu_params['menu_slug'] ) . '"]:after {
+ content: "";
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTEiIGhlaWdodD0iMTEiIHZpZXdCb3g9IjAgMCAxMSAxMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuNSAwLjE4NzVMMTAuODc1IDUuNUw1LjUgMTAuODEyNUw0LjU2MjUgOS44NzVMOC4zMTI1IDYuMTg3NUwwLjE4NzUgNi4xODc1TDAuMTg3NSA0LjgxMjVMOC4zMTI1IDQuODEyNUw0LjU2MjUgMS4xMjVMNS41IDAuMTg3NVoiIGZpbGw9IiNGRUZFRkUiIGZpbGwtb3BhY2l0eT0iMC41Ii8+Cjwvc3ZnPgo=");
+ background-repeat: no-repeat;
+ width: 11px;
+ height: 11px;
+ position: absolute;
+ top: 50%;
+ right: 5px;
+ transform: translateY(-50%);
+ color: #FEFEFE80;
+ }
+ </style>';
+ }
+ }
+ }
+ });
+
add_action( 'load-' . $page, array( $this, 'internal_admin_actions' ) );
return $page;
@@ -364,7 +406,7 @@
if ( empty( $utm_source ) ) {
// Only the Free plugins will show the cross sell page.
// As we're interested in the current plugin's utm_source we'll be checking free plugins list.
- $plugins = $this->utilities->get_free_plugins();
+ $plugins = $this->utilities->get_plugins_list();
$utm_source = $this->submenu_params['utm_source'] ?? '';
if ( empty( $utm_source ) ) {
@@ -384,6 +426,149 @@
return $utm_source;
}
+ public function plugins_list() : array {
+ $plugins_list = $this->utilities->get_plugins_list();
+ $plugins_order = $this->plugins_order();
+ $current_plugin_slug = $this->submenu_params['slug'];
+
+ if ( empty( $plugins_list ) ) {
+ return array();
+ }
+
+ $major_plugins = $plugins_order['major'];
+ $minor_plugins = $plugins_order['minor'];
+ $placeholder = $plugins_order['placeholder'];
+
+ $final_list = array(
+ 'major' => array(),
+ 'minor' => array()
+ );
+
+ // Determine current plugin type
+ $is_major_plugin = in_array( $current_plugin_slug, $major_plugins );
+ $is_minor_plugin = in_array( $current_plugin_slug, $minor_plugins );
+ $is_placeholder_plugin = ( $current_plugin_slug === $placeholder );
+
+ if ( $is_major_plugin ) {
+ // Rule 5: Viewing from major plugin
+ // Major list: 3 remaining major plugins + placeholder at the end
+ foreach ( $major_plugins as $plugin_slug ) {
+ if ( $plugin_slug !== $current_plugin_slug && isset( $plugins_list[ $plugin_slug ] ) ) {
+ $final_list['major'][ $plugin_slug ] = $plugins_list[ $plugin_slug ];
+ }
+ }
+
+ // Add placeholder at the end of major list
+ if ( isset( $plugins_list[ $placeholder ] ) ) {
+ $final_list['major'][ $placeholder ] = $plugins_list[ $placeholder ];
+ }
+
+ // Minor list: all minor plugins
+ foreach ( $minor_plugins as $plugin_slug ) {
+ if ( isset( $plugins_list[ $plugin_slug ] ) ) {
+ $final_list['minor'][] = $plugins_list[ $plugin_slug ];
+ }
+ }
+
+ } elseif ( $is_minor_plugin ) {
+ // Rule 6: Viewing from minor plugin
+ // Major list: all major plugins
+ foreach ( $major_plugins as $plugin_slug ) {
+ if ( isset( $plugins_list[ $plugin_slug ] ) ) {
+ $final_list['major'][ $plugin_slug ] = $plugins_list[ $plugin_slug ];
+ }
+ }
+
+ // Minor list: placeholder first, then remaining minor plugins
+ if ( isset( $plugins_list[ $placeholder ] ) ) {
+ $final_list['minor'][ $placeholder ] = $plugins_list[ $placeholder ];
+ }
+ foreach ( $minor_plugins as $plugin_slug ) {
+ if ( $plugin_slug !== $current_plugin_slug && isset( $plugins_list[ $plugin_slug ] ) ) {
+ $final_list['minor'][ $plugin_slug ] = $plugins_list[ $plugin_slug ];
+ }
+ }
+
+ } else {
+ // Rule 7: Viewing from placeholder or any other plugin
+ // Major list: all major plugins
+ foreach ( $major_plugins as $plugin_slug ) {
+ if ( isset( $plugins_list[ $plugin_slug ] ) ) {
+ $final_list['major'][ $plugin_slug ] = $plugins_list[ $plugin_slug ];
+ }
+ }
+
+ // Minor list: all minor plugins
+ foreach ( $minor_plugins as $plugin_slug ) {
+ if ( isset( $plugins_list[ $plugin_slug ] ) ) {
+ $final_list['minor'][ $plugin_slug ] = $plugins_list[ $plugin_slug ];
+ }
+ }
+ }
+
+ $final_list['major'] = $this->filter_plugins_list( $final_list['major'] );
+ $final_list['minor'] = $this->filter_plugins_list( $final_list['minor'] );
+
+ return $final_list;
+ }
+
+ /**
+ * Returns the structure of plugins to be used in Detailed and Concise views.
+ *
+ * @return array
+ */
+ public function plugins_order() : array {
+ // List of plugins split into major (falgship) and minor ones.
+ // Major plugins are shown first in Detailed view.
+ // Minor plugins are shown second in Concise view.
+ // The placeholder is used in Detailed view to replace one of the major plugins or in Concise view to replace one of the minor plugins.
+ return array(
+ 'major' => array(
+ 'wp-smushit',
+ 'forminator',
+ 'hummingbird-performance',
+ 'defender-security',
+ ),
+ 'minor' => array(
+ 'broken-link-checker',
+ 'smartcrawl-seo',
+ 'branda-white-labeling',
+ 'beehive-analytics',
+ ),
+ 'placeholder' => 'wordpress-popup'
+ );
+ }
+
+ /**
+ * Checks if a plugin is a major one.
+ * @param string $plugin_slug
+ * @return bool
+ */
+ public function is_major_plugin( string $plugin_slug = '' ): bool {
+ $plugins_order = $this->plugins_order();
+ return ! empty( $plugins_order['major'] ) && in_array( $plugin_slug, $plugins_order['major'], true );
+ }
+
+ /**
+ * Checks if a plugin is a minor one.
+ * @param string $plugin_slug
+ * @return bool
+ */
+ public function is_minor_plugin( string $plugin_slug = '' ): bool {
+ $plugins_order = $this->plugins_order();
+ return ! empty( $plugins_order['minor'] ) && in_array( $plugin_slug, $plugins_order['minor'], true );
+ }
+
+ /**
+ * Checks if a plugin is the placeholder one.
+ * @param string $plugin_slug
+ * @return bool
+ */
+ public function is_placeholder_plugin( string $plugin_slug = '' ): bool {
+ $plugins_order = $this->plugins_order();
+ return ! empty( $plugins_order['placeholder'] ) && $plugin_slug === $plugins_order['placeholder'];
+ }
+
/**
* Filters the plugins list.
*
--- a/branda-white-labeling/external/plugins-cross-sell-page/assets/js/crosssellpage.asset.php
+++ b/branda-white-labeling/external/plugins-cross-sell-page/assets/js/crosssellpage.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '181ee83b2eeae973e529');
+<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '565e42f2efde24d07ca2');
--- a/branda-white-labeling/external/plugins-cross-sell-page/core/class-utilities.php
+++ b/branda-white-labeling/external/plugins-cross-sell-page/core/class-utilities.php
@@ -41,36 +41,15 @@
}
/**
- * Returns the list of free plugins.
- *
- * @return array
- */
- public function get_free_plugins(): array {
- $plugins = $this->get_plugins_list();
- return is_array( $plugins ) && ! empty( $plugins['free-plugins'] ) ? $plugins['free-plugins'] : array();
- }
-
- /**
- * Returns the list of pro plugins.
- *
- * @return array
- */
- public function get_pro_plugins(): array {
- $plugins = $this->get_plugins_list();
- return is_array( $plugins ) && ! empty( $plugins['pro-plugins'] ) ? $plugins['pro-plugins'] : array();
- }
-
- /**
* Retrieves the path of a plugin by its slug.
*
* @param string $plugin_slug The plugin slug.
* @return string
*/
public function get_plugin_path_by_slug( string $plugin_slug = '' ): string {
- $free_plugins = $this->get_free_plugins();
- $free_plugins = is_array( $free_plugins ) && ! empty( $free_plugins['free-plugins'] ) ? $free_plugins['free-plugins'] : $free_plugins;
+ $plugins_list = $this->get_plugins_list();
- return $this->get_value_from_associative_array( 'path', $free_plugins, array( 'slug' => $plugin_slug ) );
+ return $this->get_value_from_associative_array( 'path', $plugins_list, array( 'slug' => $plugin_slug ) );
}
/**
--- a/branda-white-labeling/external/plugins-cross-sell-page/core/plugins-list.php
+++ b/branda-white-labeling/external/plugins-cross-sell-page/core/plugins-list.php
@@ -11,274 +11,169 @@
* @copyright (c) 2025, WPMU DEV (http://wpmudev.com)
*/
+// List of plugins
+
return array(
- 'free-plugins' => array(
- array(
- 'slug' => 'wp-smushit',
- 'path' => 'wp-smushit/wp-smush.php',
- 'url' => 'https://wordpress.org/plugins/wp-smushit/',
- 'utm_source' => 'smush',
- 'utm_campaign' => 'cross-sell_plugin_smush',
- 'admin_url_page' => 'smush',
- 'logo' => 'wp-smushit.png',
- 'title' => __( 'Smush', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Smush images down to size for faster page loading.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '1M +',
- ),
- array(
- 'slug' => 'forminator',
- 'path' => 'forminator/forminator.php',
- 'url' => 'https://wordpress.org/plugins/forminator/',
- 'utm_source' => 'forminator',
- 'utm_campaign' => 'cross-sell_plugin_forminator',
- 'admin_url_page' => 'forminator',
- 'logo' => 'forminator.png',
- 'title' => __( 'Forminator', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Surveys, subscriptions, feedback, quizzes: Forminator makes it easy.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.5,
- 'active_installs' => '500k +',
- ),
- array(
- 'slug' => 'defender-security',
- 'path' => 'defender-security/wp-defender.php',
- 'url' => 'https://wordpress.org/plugins/defender-security/',
- 'utm_source' => 'defender',
- 'utm_campaign' => 'cross-sell_plugin_defender',
- 'admin_url_page' => 'wp-defender',
- 'logo' => 'defender-security.png',
- 'title' => __( 'Defender', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Automated and reliable WordPress security in a matter of clicks.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '90k +',
- ),
- array(
- 'slug' => 'hummingbird-performance',
- 'path' => 'hummingbird-performance/wp-hummingbird.php',
- 'url' => 'https://wordpress.org/plugins/hummingbird-performance/',
- 'utm_source' => 'hummingbird',
- 'utm_campaign' => 'cross-sell_plugin_hummingbird',
- 'admin_url_page' => 'wphb',
- 'logo' => 'hummingbird-performance.png',
- 'title' => __( 'Hummingbird', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'For sites that load in one flap of a hummingbird’s wing. ', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.7,
- 'active_installs' => '100k +',
- ),
- array(
- 'slug' => 'smartcrawl-seo',
- 'path' => 'smartcrawl-seo/wpmu-dev-seo.php',
- 'url' => 'https://wordpress.org/plugins/smartcrawl-seo/',
- 'utm_source' => 'smartcrawl',
- 'utm_campaign' => 'cross-sell_plugin_smartcrawl',
- 'admin_url_page' => 'wds_wizard',
- 'logo' => 'smartcrawl-seo.png',
- 'title' => __( 'SmartCrawl', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Take the mystery out of optimizing your site.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '20k +',
- ),
- array(
- 'slug' => 'wordpress-popup',
- 'path' => 'wordpress-popup/popover.php',
- 'url' => 'https://wordpress.org/plugins/wordpress-popup/',
- 'utm_source' => 'hustle',
- 'utm_campaign' => 'cross-sell_plugin_hustle',
- 'admin_url_page' => 'hustle',
- 'logo' => 'wordpress-popup.png',
- 'title' => __( 'Hustle', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Create high-converting and targeted marketing campaigns in minutes.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.6,
- 'active_installs' => '100k +',
- ),
- array(
- 'slug' => 'branda-white-labeling',
- 'path' => 'branda-white-labeling/ultimate-branding.php',
- 'url' => 'https://wordpress.org/plugins/branda-white-labeling/',
- 'utm_source' => 'branda',
- 'utm_campaign' => 'cross-sell_plugin_branda',
- 'admin_url_page' => 'branding',
- 'logo' => 'branda-white-labeling.png',
- 'title' => __( 'Branda', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Rebrand, customize, and white label WordPress without code.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.5,
- 'active_installs' => '20k +',
- ),
- array(
- 'slug' => 'beehive-analytics',
- 'path' => 'beehive-analytics/beehive-analytics.php',
- 'url' => 'https://wordpress.org/plugins/beehive-analytics/',
- 'utm_source' => 'beehive',
- 'utm_campaign' => 'cross-sell_plugin_beehive',
- 'admin_url_page' => 'beehive',
- 'logo' => 'beehive-analytics.png',
- 'title' => __( 'Beehive', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Customizable Google Analytics dashboards, statistics, and reports.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '30k +',
- ),
- array(
- 'slug' => 'broken-link-checker',
- 'path' => 'broken-link-checker/broken-link-checker.php',
- 'url' => 'https://wordpress.org/plugins/broken-link-checker/',
- 'utm_source' => 'blc',
- 'utm_campaign' => 'cross-sell_plugin_blc',
- 'admin_url_page' => 'blc_dash',
- 'logo' => 'broken-link-checker.png',
- 'title' => __( 'Broken Link Checker', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Check posts, pages & content for broken links to improve SEO. ', 'plugin-cross-sell-textdomain' ),
- 'features' => array(),
- 'installed' => false,
- 'active' => false,
- 'rating' => 3.8,
- 'active_installs' => '600k +',
- ),
+ 'wp-smushit' => array(
+ 'slug' => 'wp-smushit',
+ 'path' => 'wp-smushit/wp-smush.php',
+ 'url' => 'https://wordpress.org/plugins/wp-smushit/',
+ 'utm_source' => 'smush',
+ 'utm_campaign' => 'cross-sell_plugin_smush',
+ 'admin_url_page' => 'smush',
+ 'logo' => 'wp-smushit.png',
+ 'title' => __( 'Smush', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'Image Optimization', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'Smush image size down to size for faster page loading.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.8,
+ 'rating_count' => '6,017+ reviews',
+ 'active_installs' => '1,200,000+',
),
-
- 'pro-plugins' => array(
- array(
- 'slug' => 'forminator-pro',
- 'path' => 'forminator-pro/forminator.php',
- 'url' => 'https://wpmudev.com/project/forminator-pro/',
- 'utm_source' => 'forminator',
- 'utm_campaign' => 'cross-sell_plugin_forminator',
- 'admin_url_page' => 'forminator',
- 'logo' => 'forminator.png',
- 'title' => __( 'Forminator Pro', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Surveys, subscriptions, feedback, quizzes: Forminator makes it easy.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(
- __( 'Generate and send PDF files', 'plugin-cross-sell-textdomain' ),
- __( 'Accept recurring payment', 'plugin-cross-sell-textdomain' ),
- __( 'Get form submitter’s geolocation', 'plugin-cross-sell-textdomain' ),
- ),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.5,
- 'active_installs' => '550k +',
- ),
- array(
- 'slug' => 'smush-pro',
- 'path' => 'wp-smush-pro/wp-smush.php',
- 'url' => 'https://wpmudev.com/project/wp-smush-pro/',
- 'utm_source' => 'smush',
- 'utm_campaign' => 'cross-sell_plugin_smush',
- 'admin_url_page' => 'smush',
- 'logo' => 'wp-smushit.png',
- 'title' => __( 'Smush Pro', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Smush images down to size for faster page loading.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(
- __( 'Ultra Smush with 5X compression', 'plugin-cross-sell-textdomain' ),
- __( '123 point CDN + 50GB bandwidth', 'plugin-cross-sell-textdomain' ),
- __( 'Unlimited bulk and auto smushing', 'plugin-cross-sell-textdomain' ),
- ),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '1M +',
- ),
- array(
- 'slug' => 'defender-pro',
- 'path' => 'wp-defender/wp-defender.php',
- 'url' => 'https://wpmudev.com/project/wp-defender/',
- 'utm_source' => 'defender',
- 'utm_campaign' => 'cross-sell_plugin_defender',
- 'admin_url_page' => 'wp-defender',
- 'logo' => 'defender-security.png',
- 'title' => __( 'Defender Pro', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Automated and reliable WordPress security in a matter of clicks.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(
- __( 'Scheduled malware scanning', 'plugin-cross-sell-textdomain' ),
- __( 'AntiBot Global Firewall', 'plugin-cross-sell-textdomain' ),
- __( 'Comprehensive audit logging', 'plugin-cross-sell-textdomain' ),
- ),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '260k +',
- ),
- array(
- 'slug' => 'hummingbird-pro',
- 'path' => 'wp-hummingbird/wp-hummingbird.php',
- 'url' => 'https://wpmudev.com/project/wp-hummingbird/',
- 'utm_source' => 'hummingbird',
- 'utm_campaign' => 'cross-sell_plugin_hummingbird',
- 'admin_url_page' => 'wphb',
- 'logo' => 'hummingbird-performance.png',
- 'title' => __( 'Hummingbird Pro', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'For sites that load in one flap of a hummingbird’s wing.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(
- __( 'Delay JavaScript execution', 'plugin-cross-sell-textdomain' ),
- __( 'Automated critical CSS generation', 'plugin-cross-sell-textdomain' ),
- __( 'Turbocharged asset optimization', 'plugin-cross-sell-textdomain' ),
- ),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '185k +',
- ),
- array(
- 'slug' => 'smartcrawl-pro',
- 'path' => 'wpmu-dev-seo/wpmu-dev-seo.php',
- 'url' => 'https://wpmudev.com/project/smartcrawl-wordpress-seo/',
- 'utm_source' => 'smartcrawl',
- 'utm_campaign' => 'cross-sell_plugin_smartcrawl',
- 'admin_url_page' => 'wds_wizard',
- 'logo' => 'smartcrawl-seo.png',
- 'title' => __( 'SmartCrawl Pro', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Take the mystery out of optimizing your site.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(
- __( 'Site crawler SEO scan & reports', 'plugin-cross-sell-textdomain' ),
- __( 'SEO health audit reports', 'plugin-cross-sell-textdomain' ),
- __( 'Automatic integrated linking', 'plugin-cross-sell-textdomain' ),
- ),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '100k +',
- ),
- array(
- 'slug' => 'snapshot-pro',
- 'path' => 'snapshot-backups/snapshot-backups.php',
- 'url' => 'https://wpmudev.com/project/snapshot/',
- 'utm_source' => 'snapshot',
- 'utm_campaign' => 'cross-sell_plugin_snapshot',
- 'admin_url_page' => 'snapshot',
- 'logo' => 'snapshot.png',
- 'title' => __( 'Snapshot Pro', 'plugin-cross-sell-textdomain' ),
- 'description' => __( 'Space-efficient backups that happen effortlessly while you sleep.', 'plugin-cross-sell-textdomain' ),
- 'features' => array(
- __( 'Our PRO-only backup plugin', 'plugin-cross-sell-textdomain' ),
- __( 'Comes with up to 50GB storage', 'plugin-cross-sell-textdomain' ),
- __( 'Store backups for 50 days', 'plugin-cross-sell-textdomain' ),
- ),
- 'installed' => false,
- 'active' => false,
- 'rating' => 4.8,
- 'active_installs' => '50k +',
- ),
+ 'forminator' => array(
+ 'slug' => 'forminator',
+ 'path' => 'forminator/forminator.php',
+ 'url' => 'https://wordpress.org/plugins/forminator/',
+ 'utm_source' => 'forminator',
+ 'utm_campaign' => 'cross-sell_plugin_forminator',
+ 'admin_url_page' => 'forminator',
+ 'logo' => 'forminator.png',
+ 'title' => __( 'Forminator', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'Forms & Surveys', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'One plugin for every form your site could ever need.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.8,
+ 'rating_count' => '1,967+ reviews',
+ 'active_installs' => '600,000+',
+ ),
+ 'hummingbird-performance' => array(
+ 'slug' => 'hummingbird-performance',
+ 'path' => 'hummingbird-performance/wp-hummingbird.php',
+ 'url' => 'https://wordpress.org/plugins/hummingbird-performance/',
+ 'utm_source' => 'hummingbird',
+ 'utm_campaign' => 'cross-sell_plugin_hummingbird',
+ 'admin_url_page' => 'wphb',
+ 'logo' => 'hummingbird-performance.png',
+ 'title' => __( 'Hummingbird', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'Site performance', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'For sites that load in one flap of a hummingbird’s wing. ', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.7,
+ 'rating_count' => '1,483+ reviews',
+ 'active_installs' => '90,000+',
+ ),
+ 'defender-security' => array(
+ 'slug' => 'defender-security',
+ 'path' => 'defender-security/wp-defender.php',
+ 'url' => 'https://wordpress.org/plugins/defender-security/',
+ 'utm_source' => 'defender',
+ 'utm_campaign' => 'cross-sell_plugin_defender',
+ 'admin_url_page' => 'wp-defender',
+ 'logo' => 'defender-security.png',
+ 'title' => __( 'Defender', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'Security', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'Automated and reliable WordPress security in a matter of clicks.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.8,
+ 'rating_count' => '318+ reviews',
+ 'active_installs' => '90,000+',
+ ),
+ 'wordpress-popup' => array(
+ 'slug' => 'wordpress-popup',
+ 'path' => 'wordpress-popup/popover.php',
+ 'url' => 'https://wordpress.org/plugins/wordpress-popup/',
+ 'utm_source' => 'hustle',
+ 'utm_campaign' => 'cross-sell_plugin_hustle',
+ 'admin_url_page' => 'hustle',
+ 'logo' => 'wordpress-popup.png',
+ 'title' => __( 'Hustle', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'Marketing tools', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'Opt-ins so good, you’ll want to subscribe to yourself.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.4,
+ 'rating_count' => '',
+ 'active_installs' => '100k +',
+ ),
+ 'broken-link-checker' => array(
+ 'slug' => 'broken-link-checker',
+ 'path' => 'broken-link-checker/broken-link-checker.php',
+ 'url' => 'https://wordpress.org/plugins/broken-link-checker/',
+ 'utm_source' => 'blc',
+ 'utm_campaign' => 'cross-sell_plugin_blc',
+ 'admin_url_page' => 'blc_dash',
+ 'logo' => 'broken-link-checker.png',
+ 'title' => __( 'BLC', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'Broken Link Checker', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'Check posts, pages & content for broken links to improve SEO.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 3.8,
+ 'rating_count' => '',
+ 'active_installs' => '600k +',
+ ),
+ 'smartcrawl-seo' => array(
+ 'slug' => 'smartcrawl-seo',
+ 'path' => 'smartcrawl-seo/wpmu-dev-seo.php',
+ 'url' => 'https://wordpress.org/plugins/smartcrawl-seo/',
+ 'utm_source' => 'smartcrawl',
+ 'utm_campaign' => 'cross-sell_plugin_smartcrawl',
+ 'admin_url_page' => 'wds_wizard',
+ 'logo' => 'smartcrawl-seo.png',
+ 'title' => __( 'SmartCrawl', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'SEO', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'Take the mystery out of optimizing your site. Rank higher and better.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.8,
+ 'rating_count' => '',
+ 'active_installs' => '20k +',
+ ),
+ 'branda-white-labeling' => array(
+ 'slug' => 'branda-white-labeling',
+ 'path' => 'branda-white-labeling/ultimate-branding.php',
+ 'url' => 'https://wordpress.org/plugins/branda-white-labeling/',
+ 'utm_source' => 'branda',
+ 'utm_campaign' => 'cross-sell_plugin_branda',
+ 'admin_url_page' => 'branding',
+ 'logo' => 'branda-white-labeling.png',
+ 'title' => __( 'Branda', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'White label WordPress', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'Rebrand, customize, and white label WordPress without code.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.5,
+ 'rating_count' => '',
+ 'active_installs' => '20k +',
+ ),
+ 'beehive-analytics' => array(
+ 'slug' => 'beehive-analytics',
+ 'path' => 'beehive-analytics/beehive-analytics.php',
+ 'url' => 'https://wordpress.org/plugins/beehive-analytics/',
+ 'utm_source' => 'beehive',
+ 'utm_campaign' => 'cross-sell_plugin_beehive',
+ 'admin_url_page' => 'beehive',
+ 'logo' => 'beehive-analytics.png',
+ 'title' => __( 'Beehive', 'plugin-cross-sell-textdomain' ),
+ 'label' => __( 'Customize analytics', 'plugin-cross-sell-textdomain' ),
+ 'description' => __( 'Customizable Google Analytics dashboards, statistics, and reports.', 'plugin-cross-sell-textdomain' ),
+ 'features' => array(),
+ 'installed' => false,
+ 'active' => false,
+ 'rating' => 4.8,
+ 'rating_count' => '',
+ 'active_installs' => '30k +',
),
);
--- a/branda-white-labeling/external/plugins-cross-sell-page/plugin-cross-sell.php
+++ b/branda-white-labeling/external/plugins-cross-sell-page/plugin-cross-sell.php
@@ -4,7 +4,7 @@
*
* Used in free plugins to get a glimpse of other plugins offered by WPMU DEV.
*
- * @since 1.0.0
+ * @version 1.1.0
* @author Panos Lyrakis
* @link https://wpmudev.com
* @package WPMUDEVPlugin_Cross_Sell
@@ -24,7 +24,7 @@
// Sub-module version.
if ( ! defined( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_VERSION' ) ) {
- define( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_VERSION', '1.0.0' );
+ define( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_VERSION', '1.1.0' );
}
// Sub-module directory.
--- a/branda-white-labeling/external/plugins-cross-sell-page/vendor/composer/installed.php
+++ b/branda-white-labeling/external/plugins-cross-sell-page/vendor/composer/installed.php
@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'wpmudev/plugin-cross-sell',
- 'pretty_version' => 'dev-development',
- 'version' => 'dev-development',
- 'reference' => 'd120bbd9abf626c8f9a38850c2294e98fa339b31',
+ 'pretty_version' => 'dev-release/1.1.0',
+ 'version' => 'dev-release/1.1.0',
+ 'reference' => '6204a68632646b122687e5df3f6267fa71de9e61',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -11,9 +11,9 @@
),
'versions' => array(
'wpmudev/plugin-cross-sell' => array(
- 'pretty_version' => 'dev-development',
- 'version' => 'dev-development',
- 'reference' => 'd120bbd9abf626c8f9a38850c2294e98fa339b31',
+ 'pretty_version' => 'dev-release/1.1.0',
+ 'version' => 'dev-release/1.1.0',
+ 'reference' => '6204a68632646b122687e5df3f6267fa71de9e61',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
--- a/branda-white-labeling/inc/class-branda-admin.php
+++ b/branda-white-labeling/inc/class-branda-admin.php
@@ -59,7 +59,7 @@
/**
* set and sanitize variables
*/
- add_action( 'plugins_loaded', array( $this, 'set_and_sanitize_variables' ), 2 );
+ add_action( 'init', array( $this, 'set_and_sanitize_variables' ) );
/**
* run stats
*/
@@ -82,11 +82,13 @@
* @param array $modules available modules array.
*/
$this->modules = apply_filters( 'ultimatebranding_available_modules', $this->modules );
- add_action( 'plugins_loaded', array( $this, 'load_modules' ), 11 );
+ add_action( 'init', array( $this, 'load_modules' ) );
add_action( 'init', array( $this, 'setup_translation' ) );
add_action( 'network_admin_menu', array( $this, 'network_admin_page' ) );
add_action( 'admin_menu', array( $this, 'admin_page' ) );
add_filter( 'admin_title', array( $this, 'admin_title' ), 10, 2 );
+ add_action( 'admin_head', array( $this, 'menu_style' ) );
+ add_action( 'init', array( $this, 'register_email_logs_cpt' ) );
/**
* AJAX
*/
@@ -236,7 +238,7 @@
} else {
if ( is_network_admin() || ! is_multisite() ) {
$url = 'https://wpmudev.com/project/ultimate-branding/?utm_source=branda&utm_medium=plugin&utm_campaign=branda_pluginlist_upgrade';
- $links['upgrade'] = '<a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( __( 'Upgrade For 80% Off!', 'ub' ) ) . '" target="_blank" style="color: #8D00B1;">' . esc_html__( 'Upgrade For 80% Off!', 'ub' ) . '</a>';
+ $links['upgrade'] = '<a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( __( 'Get Branda Pro', 'ub' ) ) . '" target="_blank" style="color: #8D00B1;">' . esc_html__( 'Get Branda Pro', 'ub' ) . '</a>';
}
}
$actions = array_merge( $links, $actions );
@@ -735,11 +737,10 @@
if ( ! Branda_Helper::is_member() ) {
$menu = add_submenu_page(
'branding',
- __( 'Branda Pro', 'ub' ),
- __( 'Branda Pro', 'ub' ),
+ esc_html__( 'Get Branda Pro', 'ub' ),
+ esc_html__( 'Get Branda Pro', 'ub' ),
$capability,
- 'branda_pro',
- array( $this, 'handle_branda_pro' )
+ 'https://wpmudev.com/project/ultimate-branding/?utm_source=branda&utm_medium=plugin&utm_campaign=branda_submenu_upsell',
);
add_action( 'load-' . $menu, array( $this, 'add_admin_header_branding' ) );
}
@@ -785,6 +786,18 @@
}
/**
+ * Adds custom style to the menu item.
+ */
+ public function menu_style() {
+ echo '<style>
+ #toplevel_page_branding ul.wp-submenu li:last-child a[href^="https://wpmudev.com"] { color: #fff !important; background: #8D00B1 !important; letter-spacing: -0.25px !important; font-weight: 500 !important; padding-right: 5px !important; }
+ </style>';
+ echo '<script>
+ jQuery(function() {jQuery('#toplevel_page_branding ul.wp-submenu li:last-child a[href^="https://wpmudev.com"]').attr("target", "_blank");});
+ </script>';
+ }
+
+ /**
* Sort admin sub menus.
*
* We need to make sure the main dashboard menu
@@ -922,21 +935,6 @@
return $modules;
}
- public function handle_branda_pro() {
- add_filter( 'branda_show_manage_all_modules_button', '__return_false' );
- $classes = apply_filters( 'branda_sui_wrap_class', array(), $this->module );
- $template = 'admin/branda-pro';
- printf(
- '<main class="%s">',
- esc_attr( implode( ' ', $classes ) )
- );
- $this->render( $template );
-
- $this->footer();
-
- echo '</main>';
- }
-
public function handle_main_page() {
if ( $this->is_network && ! is_network_admin() ) {
$this->handle_main_page_subsite();
@@ -2895,5 +2893,37 @@
);
return $url;
}
+
+ /**
+ * Register Custom Post Type for Email Logs
+ */
+ public static function register_email_logs_cpt() {
+ $labels = array(
+ 'name' => _x( 'Email Logs', 'Post Type General Name', 'ub' ),
+ 'singular_name' => _x( 'Email Log', 'Post Type Singular Name', 'ub' ),
+ );
+ $args = array(
+ 'label' => __( 'Email Log', 'ub' ),
+ 'description' => __( 'Post Type Description', 'ub' ),
+ 'labels' => $labels,
+ 'supports' => array( 'title', 'editor', 'custom-fields' ),
+ 'hierarchical' => false,
+ 'public' => false,
+ 'show_ui' => false,
+ 'show_in_menu' => false,
+ 'menu_position' => 5,
+ 'show_in_admin_bar' => false,
+ 'show_in_nav_menus' => false,
+ 'can_export' => false,
+ 'has_archive' => false,
+ 'exclude_from_search' => true,
+ 'publicly_queryable' => false,
+ 'rewrite' => false,
+ 'capability_type' => 'page',
+ 'show_in_rest' => false,
+ );
+
+ register_post_type( 'branda_email_log', $args );
+ }
}
}
--- a/branda-white-labeling/inc/class-branda-public.php
+++ b/branda-white-labeling/inc/class-branda-public.php
@@ -8,7 +8,7 @@
*/
public function __construct() {
parent::__construct();
- add_action( 'plugins_loaded', array( $this, 'load_modules' ) );
+ add_action( 'init', array( $this, 'load_modules' ) );
/**
* Add Branda submenu to Customize on Admin Bar
*
--- a/branda-white-labeling/inc/modules/admin/color-schemes.php
+++ b/branda-white-labeling/inc/modules/admin/color-schemes.php
@@ -721,8 +721,10 @@
* @since 3.1.0
*/
public function bar_logo_args( $args ) {
- $colors = array_merge( $this->defaults, $this->get_value( 'settings', 'ultimate' ) );
+ $ultimate = $this->get_value( 'settings', 'ultimate' ) ?: array();
+ $colors = array_merge( $this->defaults, $ultimate );
$args['base'] = $colors['admin_bar_icon_color'];
+
return $args;
}
}
--- a/branda-white-labeling/inc/modules/admin/menu.php
+++ b/branda-white-labeling/inc/modules/admin/menu.php
@@ -173,7 +173,7 @@
if ( ! empty( $submenu[ $menu_slug ] ) ) {
foreach ( $submenu[ $menu_slug ] as $submenu_item_index => $submenu_item ) {
- if ( count( $submenu_item ) < 3 ) {
+ if ( ! is_countable( $submenu_item ) || count( $submenu_item ) < 3 ) {
continue;
}
@@ -824,7 +824,7 @@
$submenu_items = $wp_submenu[ $menu_slug ];
foreach ( $submenu_items as $submenu_item ) {
- if ( count( $submenu_item ) < 3 ) {
+ if ( ! is_countable( $submenu_item ) || count( $submenu_item ) < 3 ) {
continue;
}
--- a/branda-white-labeling/inc/modules/admin/tips.php
+++ b/branda-white-labeling/inc/modules/admin/tips.php
@@ -303,7 +303,7 @@
'nonce_dismiss' => $this->get_nonce_value( $post->ID, 'dismiss' ),
'nonce_hide' => $this->get_nonce_value( $post->ID, 'hide' ),
'content' => $content,
- 'title' => apply_filters( 'the_title', $post->post_title ),
+ 'title' => apply_filters( 'the_title', $post->post_title, $post->ID ),
'user_id' => get_current_user_id(),
);
$template = $this->get_template_name( 'tip' );
--- a/branda-white-labeling/inc/modules/emails/email-logs-cpt.php
+++ b/branda-white-labeling/inc/modules/emails/email-logs-cpt.php
@@ -256,36 +256,5 @@
wp_delete_post( $id, true );
}
}
- /**
- * Register Custom Post Type for Email Logs
- */
- public static function register_email_logs_cpt() {
- $labels = array(
- 'name' => _x( 'Email Logs', 'Post Type General Name', 'ub' ),
- 'singular_name' => _x( 'Email Log', 'Post Type Singular Name', 'ub' ),
- );
- $args = array(
- 'label' => __( 'Email Log', 'ub' ),
- 'description' => __( 'Post Type Description', 'ub' ),
- 'labels' => $labels,
- 'supports' => array( 'title', 'editor', 'custom-fields' ),
- 'hierarchical' => false,
- 'public' => false,
- 'show_ui' => false,
- 'show_in_menu' => false,
- 'menu_position' => 5,
- 'show_in_admin_bar' => false,
- 'show_in_nav_menus' => false,
- 'can_export' => false,
- 'has_archive' => false,
- 'exclude_from_search' => true,
- 'publicly_queryable' => false,
- 'rewrite' => false,
- 'capability_type' => 'page',
- 'show_in_rest' => false,
- );
-
- register_post_type( self::CPT_NAME, $args );
- }
}
}
--- a/branda-white-labeling/inc/modules/emails/email-logs.php
+++ b/branda-white-labeling/inc/modules/emails/email-logs.php
@@ -35,8 +35,6 @@
// Change module content.
add_filter( 'branda_get_module_content', array( $this, 'change_main_content' ), 10, 2 );
- add_action( 'init', array( 'Branda_Email_Logs_CPT', 'register_email_logs_cpt' ), 0 );
-
// `Delete` dialog attrs.
add_filter( 'branda_dialog_delete_attr', array( $this, 'dialog_delete_attr_filter' ), 10, 3 );
--- a/branda-white-labeling/inc/modules/emails/smtp.php
+++ b/branda-white-labeling/inc/modules/emails/smtp.php
@@ -46,6 +46,9 @@
add_action( 'admin_notices', array( $this, 'configure_credentials_notice' ) );
}
add_action( 'phpmailer_init', array( $this, 'init_smtp' ), 999 );
+ // Use high priority to ensure our filters run after other plugins, allowing proper filter chain execution.
+ add_filter( 'wp_mail_from', array( $this, 'filter_mail_from_email' ), PHP_INT_MAX );
+ add_filter( 'wp_mail_from_name', array( $this, 'filter_mail_from_name' ), PHP_INT_MAX );
add_filter( 'ultimatebranding_settings_smtp', array( $this, 'admin_options_page' ) );
add_filter( 'ultimatebranding_settings_smtp_process', array( $this, 'update' ) );
add_filter( 'ultimatebranding_settings_smtp_reset', array( $this, 'reset_module' ) );
@@ -191,7 +194,9 @@
}
$charset = get_bloginfo( 'charset' );
$mail->CharSet = $charset;
- $from_email = $this->get_value( 'header', 'from_email', null, false );
+ // Use filtered values to ensure consistency with wp_mail() behavior
+ $from_email = apply_filters( 'wp_mail_from', get_option( 'admin_email' ) );
+ $from_name = apply_filters( 'wp_mail_from_name', get_option( 'blogname' ) );
$mail->IsSMTP();
// send plain text test email
$mail->ContentType = 'text/plain';
@@ -204,13 +209,6 @@
$mail->Password = $this->decrypt( $this->get_value( 'smtp_authentication', 'smtp_password', null, false ) );
}
- $force = $this->get_value( 'header', 'from_name_force', null, false );
- $from_name = $this->get_value( 'header', 'from_name', null, false );
-
- if ( 'on' === $force && ! empty( $from_name ) ) {
- $mail->FromName = $from_name;
- }
-
/* Set the SMTPSecure value, if set to none, leave this blank */
$type = $this->get_value( 'server', 'smtp_type_encryption', null, false );
if ( 'none' !== $type ) {
@@ -232,7 +230,7 @@
/* Set the other options */
$mail->Host = $this->get_value( 'server', 'smtp_host', null, false );
$mail->Port = $this->get_value( 'server', 'smtp_port', null, false );
- $mail->SetFrom( $from_email, $mail->FromName );
+ $mail->SetFrom( $from_email, $from_name );
// Set Reply To header
$reply_to_email = $this->get_value( 'reply-to', 'email', null, false );
@@ -309,6 +307,37 @@
}
/**
+ * Filter the from email address.
+ *
+ * @param string $from_email The from email address.
+ *
+ * @return string
+ */
+ public function filter_mail_from_email( $from_email ) {
+ $value = $this->get_value( 'header', 'from_email' );
+ if ( ! empty( $value ) && is_email( $value ) ) {
+ return $value;
+ }
+ return $from_email;
+ }
+
+ /**
+ * Filter the from name.
+ *
+ * @param string $from_name The from name.
+ *
+ * @return string
+ */
+ public function filter_mail_from_name( $from_name ) {
+ $force = $this->get_value( 'header', 'from_name_force', null, false );
+ $value = $this->get_value( 'header', 'from_name', null, false );
+ if ( 'on' === $force && ! empty( $value ) ) {
+ return $value;
+ }
+ return $from_name;
+ }
+
+ /**
* Init SMTP
*
* @since 2.0.0
@@ -322,27 +351,6 @@
}
/* Set the mailer type as per config above, this overrides the already called isMail method */
$phpmailer->IsSMTP();
- /**
- * from name
- */
- $from_name = $this->get_value( 'header', 'from_name', null, false );
- $force = $this->get_value( 'header', 'from_name_force', null, false );
-
- if ( 'on' === $force && ! empty( $from_name ) ) {
- $phpmailer->FromName = $from_name;
- }
-
- /**
- * from email
- */
- $from_email = $this->get_value( 'header', 'from_email' );
- /**
- * set PHPMailer
- */
- if ( ! empty( $from_email ) ) {
- $phpmailer->From = $from_email;
- }
-
$phpmailer->SetFrom( $phpmailer->From, $phpmailer->FromName );
/* Set the SMTPSecure value */
$type = $this->get_value( 'server', 'smtp_type_encryption' );
@@ -789,11 +797,11 @@
$smtp_password = $_POST['simple_options']['smtp_authentication']['smtp_password'];
if ( empty( $smtp_password ) ) {
- $fields['smtp_authentication'] = array( 'smtp_password' );
+ $fields['smtp_authentication'][] = 'smtp_password';
}
// The encryption method is stored only by the plugin, so we need to preserve it.
- $fields['smtp_authentication'] = array( 'encryption_method' );
+ $fields['smtp_authentication'][] = 'encryption_method';
return $fields;
}
--- a/branda-white-labeling/inc/modules/login-screen/login-screen.php
+++ b/branda-white-labeling/inc/modules/login-screen/login-screen.php
@@ -89,7 +89,7 @@
*
* @since 1.9.5
*/
- add_action( 'after_setup_theme', array( $this, 'signup_password_init' ) );
+ add_action( 'init', array( $this, 'signup_password_init' ), 11 );
/**
* Force language on login form
*
--- a/branda-white-labeling/inc/modules/login-screen/signup-password.php
+++ b/branda-white-labeling/inc/modules/login-screen/signup-password.php
@@ -21,7 +21,8 @@
add_filter( 'wpmu_validate_user_signup', array( $this, 'password_filter' ) );
add_filter( 'signup_blogform', array( $this, 'password_fields_pass_through' ) );
add_filter( 'add_signup_meta', array( $this, 'password_meta_filter' ), 99 );
- add_filter( 'random_password', array( $this, 'password_random_password_filter' ) );
+ add_action( 'wpmu_activate_user', array( $this, 'wpmu_activate_user_set_password' ), 10, 3 );
+ add_action( 'register_new_user', array( $this, 'register_new_user_set_password' ), 10, 1 );
add_filter( 'wp_new_user_notification_email', array( $this, 'new_user_notification_email' ), 10, 3 );
add_action( 'login_enqueue_scripts', array( $this, 'enqueue_style' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) );
@@ -87,7 +88,7 @@
$password_1 = isset( $_POST['password_1'] ) ? $_POST['password_1'] : '';
if ( ! empty( $password_1 ) ) {
if ( 'yes' === $signup_password_use_encryption ) {
- $password_1 = $this->wpmu_signup_password_encrypt( $password_1 );
+ $password_1 = $this->password_encrypt( $password_1 );
}
$add_meta = array( 'password' => $password_1 );
$meta = array_merge( $add_meta, $meta );
@@ -95,43 +96,44 @@
return $meta;
}
- public function password_random_password_filter( $password ) {
- global $wpdb, $signup_password_use_encryption;
- if ( isset( $_GET['key'] ) && ! empty( $_GET['key'] ) ) {
- $key = $_GET['key'];
- } elseif ( isset( $_POST['key'] ) && ! empty( $_POST['key'] ) ) {
- $key = $_POST['key'];
- }
- if ( ! empty( $_POST['password_1'] ) ) {
- $password = $_POST['password_1'];
- } elseif ( ! empty( $key ) ) {
- $signup = $wpdb->get_row(
- $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE activation_key = '%s'", $key )
- );
- if ( ! ( empty( $signup ) || $signup->active ) ) {
- // check for password in signup meta
- $meta = maybe_unserialize( $signup->meta );
- if ( ! empty( $meta['password'] ) ) {
- if ( 'yes' === $signup_password_use_encryption ) {
- $password = $this->password_decrypt( $meta['password'] );
- } else {
- $password = $meta['password'];
- }
-
- unset( $meta['password'] );
- $meta = maybe_serialize( $meta );
- $wpdb->update(
- $wpdb->signups,
- array( 'meta' => $meta ),
- array( 'activation_key' => $key ),
- array( '%s' ),
- array( '%s' )
- );
- }
- }
- }
- return $password;
- }
+ /**
+ * Set a password for multisite user activation.
+ *
+ * @param int $user_id User ID.
+ * @param string $password Password (will be replaced if stored in meta).
+ * @param array $meta Signup meta.
+ *
+ * @since 3.4.29
+ */
+ public function wpmu_activate_user_set_password( $user_id, $password, $meta ) {
+ global $wpdb, $signup_password_use_encryption;
+
+ if ( ! empty( $meta['password'] ) ) {
+ $stored_password = $meta['password'];
+ if ( 'yes' === $signup_password_use_encryption ) {
+ $stored_password = $this->password_decrypt( $stored_password );
+ }
+
+ if ( ! empty( $stored_password ) ) {
+ // Update user password
+ wp_set_password( $stored_password, $user_id );
+ }
+ }
+ }
+
+ /**
+ * Set a password for single site user registration.
+ *
+ * @param int $user_id User ID.
+ *
+ * @since 3.4.29
+ */
+ public function register_new_user_set_password( $user_id ) {
+ $password_1 = $_POST['password_1'] ?? '';
+ if ( ! empty( $password_1 ) ) {
+ wp_set_password( $password_1, $user_id );
+ }
+ }
public function password_fields_pass_through() {
$password = '';
@@ -222,32 +224,44 @@
wp_enqueue_style( __CLASS__, $file, false, $ub_version );
}
- /**
- * generate new password if is empty
- *
- * @since 1.9.6
- */
- public function pre_insert_user_data( $data, $update, $id ) {
- if ( is_multisite() ) {
- global $wpdb;
- $query = $wpdb->prepare( "select meta from {$wpdb->signups} where user_login = %s", $data['user_login'] );
- $result = $wpdb->get_var( $query );
- $meta = maybe_unserialize( $result );
- if ( is_array( $meta ) && isset( $meta['password'] ) ) {
- $data['user_pass'] = wp_hash_password( $meta['password'] );
- unset( $meta['password'] );
- $wpdb->update(
- $wpdb->signups,
- array( 'meta' => maybe_serialize( $meta ) ),
- array( 'user_login' => $data['user_login'] )
- );
- }
- return $data;
- }
- if ( empty( $data['user_pass'] ) && empty( $_POST['password_1'] ) ) {
- $data['user_pass'] = wp_hash_password( wp_generate_password( 20, false ) );
- }
- return $data;
- }
+ /**
+ * generate new password if is empty
+ *
+ * @since 1.9.6
+ */
+ public function pre_insert_user_data( $data, $update, $id ) {
+ if ( is_multisite() ) {
+ global $wpdb;
+ $query = $wpdb->prepare( "select meta from {$wpdb->signups} where user_login = %s", $data['user_login'] );
+ $result = $wpdb->get_var( $query );
+ $meta = maybe_unserialize( $result );
+ if ( is_array( $meta ) && isset( $meta['password'] ) ) {
+ $stored_password = $meta['password'];
+ global $signup_password_use_encryption;
+ if ( 'yes' === $signup_password_use_encryption ) {
+ $stored_password = $this->password_decrypt( $stored_password );
+ }
+ if ( ! empty( $stored_password ) ) {
+ $data['user_pass'] = wp_hash_password( $stored_password );
+ }
+ unset( $meta['password'] );
+ $wpdb->update(
+ $wpdb->signups,
+ array( 'meta' => maybe_serialize( $meta ) ),
+ array( 'user_login' => $data['user_login'] )
+ );
+ }
+
+ return $data;
+ }
+ if ( empty( $data['user_pass'] ) && empty( $_POST['password_1'] ) ) {
+ $data['user_pass'] = wp_hash_password( wp_generate_password( 20, false ) );
+ } elseif ( ! empty( $_POST['password_1'] ) ) {
+ // Set the password from POST data
+ $data['user_pass'] = wp_hash_password( $_POST['password_1'] );
+ }
+
+ return $data;
+ }
}
}
--- a/branda-white-labeling/ultimate-branding.php
+++ b/branda-white-labeling/ultimate-branding.php
@@ -1,11 +1,11 @@
<?php
/*
Plugin Name: Branda
-Plugin URI: https://wordpress.org/plugins/ultimate-branding/
+Plugin URI: https://wpmudev.com/project/ultimate-branding/
Description: A complete white label and branding solution for multisite. Login images, favicons, remove WordPress links and branding, and much more.
Author: WPMU DEV
-Version: 3.4.24
-Author URI: https://profiles.wordpress.org/wpmudev/
+Version: 3.4.29
+Author URI: https://wpmudev.com/
Requires PHP: 7.4
Text_domain: ub
@@ -83,7 +83,9 @@
}
// Set up my location.
-set_ultimate_branding( __FILE__ );
+add_action( 'init', function () {
+ set_ultimate_branding( __FILE__ );
+}, 9 );
if ( ! defined( 'BRANDA_SUI_VERSION' ) ) {
define( 'BRANDA_SUI_VERSION', '2.12.23' );
--- a/branda-white-labeling/views/admin/branda-pro.php
+++ b/branda-white-labeling/views/admin/branda-pro.php
@@ -1,94 +0,0 @@
-<?php
-/**
- * Branda PRO upgrade page.
- *
- * @since 3.3.1
- */
-
-if ( ! defined( 'ABSPATH' ) ) {
- exit;
-} ?>
-
-<div class="sui-upgrade-page">
- <div class="sui-upgrade-page-header">
- <div class="sui-upgrade-page__container">
- <div class="sui-upgrade-page-header__content">
- <h1><?php esc_html_e( 'Upgrade to Branda Pro', 'ub' ); ?></h1>
- <p><?php esc_html_e( 'Get everything you need to white label your sites with Branda Pro.', 'ub' ); ?></p>
- <p><?php esc_html_e( 'Plus – you'll get a WPMU DEV membership, which includes white label reports, early access to new features in Branda, award-winning image optimization with Smush Pro, 24/7 live support for all things WordPress, unlimited usage of all our premium plugins, managed hosting credits, and more.', 'ub' ); ?></p>
- <a href="https://wpmudev.com/project/ultimate-branding/?utm_source=branda&utm_medium=plugin&utm_campaign=branda_propage_topbutton" class="sui-button sui-button-lg sui-button-purple" target="_blank">
- <?php esc_html_e( 'UNLOCK NOW WITH PRO', 'ub' ); ?>
- </a>
- <div class="sui-reviews">
- <span class="sui-reviews__stars"></span>
- <div class="sui-reviews__rating"><span class="sui-reviews-rating">-</span> / <?php esc_html_e( '5.0 rating from', 'ub' ); ?> <span class="sui-reviews-customer-count">-</span> <?php esc_html_e( 'customers', 'ub' ); ?></div>
- <a class="sui-reviews__link" href="https://www.reviews.io/company-reviews/store/wpmudev-org" target="_blank">
- Reviews.io<i class="sui-icon-arrow-right" aria-hidden="true"></i>
- </a>
- </div>
- </div>
-
- <div class="sui-upgrade-page-header__image"></div>
- </div>
- </div>
- <div class="sui-upgrade-page-features">
- <div class="sui-upgrade-page-features__header">
- <h2><?php esc_html_e( 'Pro Features', 'ub' ); ?></h2>
- <p><?php esc_html_e( 'Upgrading to Pro will get you the following benefits.', 'ub' ); ?></p>
- </div>
- </div>
- <div class="sui-upgrade-page__container">
- <div class="sui-upgrade-page-features__items">
- <div class="sui-upgrade-page-features__item">
- <i class="sui-icon-mail" aria-hidden="true"></i>
- <h3><?php esc_html_e( 'SMTP email logging', 'ub' ); ?></h3>
- <p><?php esc_html_e( 'Get detailed information about your emails with Branda Pro. Track information about your recipients and view and export log history.', 'ub' ); ?></p>
- </div>
- <div class="sui-upgrade-page-features__item">
- <i class="sui-icon-graph-bar" aria-hidden="true"></i>
- <h3><?php esc_html_e( 'White label automated reporting', 'ub' ); ?></h3>
- <p><?php esc_html_e( 'Customize, style, schedule and send white label client and developer reports in just a few clicks with embedded performance, security, SEO, and analytics data.', 'ub' ); ?></p>
- </div>
- <div class="sui-upgrade-page-features__item">
- <i class="sui-icon-smush" aria-hidden="true"></i>
- <h3><?php esc_html_e( 'Smush Pro and Hummingbird Pro - the ultimate site optimization & performance package', 'ub' ); ?></h3>
- <p><?php esc_html_e( 'Smush’s award-winning image optimization + Hummingbird’s performance optimization gives you the fastest possible WordPress site. It’s a powerful combination that your visitors, customers, and search engines will love.', 'ub' ); ?></p>
- </div>
- <div class="sui-upgrade-page-features__item">
- <i class="sui-icon-gdpr" aria-hidden="true"></i>
- <h3><?php esc_html_e( 'Premium WordPress plugins', 'ub' ); ?></h3>
- <p><?php esc_html_e( 'In addition to Branda Pro, you'll get our full suite of premium WordPress plugins. From security to backups to marketing and SEO, you've got all the WordPress solutions you'll need to build, promote and manage your website. Get access to unlimited usage across all your sites. Join more than 1 million users with our plugins.', 'ub' ); ?></p>
- </div>
- <div class="sui-upgrade-page-features__item">
- <i class="sui-icon-hub" aria-hidden="true"></i>
- <h3><?php esc_html_e( 'The Hub - Manage unlimited WordPress sites', 'ub' ); ?></h3>
- <p><?php esc_html_e( 'You can manage unlimited WordPress sites with automated updates, backups, security, and performance checks, all in one place. All of this can be white labeled for your c