Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wp-smush.../core/external/plugin-n...
File: notice.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPMUDEV - Recommended Plugins Notice
[2] Fix | Delete
*
[3] Fix | Delete
* @author WPMUDEV (https://wpmudev.com)
[4] Fix | Delete
* @license GPLv2
[5] Fix | Delete
* @package WPMUDEV_Recommended_Plugins_Notice_Registered_Plugin
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
if ( ! class_exists( 'WPMUDEV_Recommended_Plugins_Notice_Registered_Plugin' ) ) {
[9] Fix | Delete
/**
[10] Fix | Delete
* Class WPMUDEV_Recommended_Plugins_Notice_Registered_Plugin
[11] Fix | Delete
*
[12] Fix | Delete
* Hold registered plugin as object
[13] Fix | Delete
*/
[14] Fix | Delete
class WPMUDEV_Recommended_Plugins_Notice_Registered_Plugin { //phpcs:ignore
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* Plugin basename
[18] Fix | Delete
* plugin-dir/plugin-name.php
[19] Fix | Delete
*
[20] Fix | Delete
* @var string
[21] Fix | Delete
*/
[22] Fix | Delete
protected $basename = '';
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Plugin nice name
[26] Fix | Delete
*
[27] Fix | Delete
* `My Plugin`
[28] Fix | Delete
*
[29] Fix | Delete
* @var string
[30] Fix | Delete
*/
[31] Fix | Delete
public $name = '';
[32] Fix | Delete
[33] Fix | Delete
/**
[34] Fix | Delete
* Screens which notice should be displayed
[35] Fix | Delete
*
[36] Fix | Delete
* @var array
[37] Fix | Delete
*/
[38] Fix | Delete
public $screens = array();
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* Time the plugin registered to notice
[42] Fix | Delete
*
[43] Fix | Delete
* @var int
[44] Fix | Delete
*/
[45] Fix | Delete
public $registered_at = 0;
[46] Fix | Delete
[47] Fix | Delete
/**
[48] Fix | Delete
* Element selector which notice should be append-ed
[49] Fix | Delete
*
[50] Fix | Delete
* @var array
[51] Fix | Delete
*/
[52] Fix | Delete
public $selector = array();
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Current active screen being displayed
[56] Fix | Delete
*
[57] Fix | Delete
* @var string
[58] Fix | Delete
*/
[59] Fix | Delete
protected $active_screen = '';
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* WPMUDEV_Recommended_Plugins_Notice_Registered_Plugin constructor.
[63] Fix | Delete
*
[64] Fix | Delete
* @param string $basename Plugin basename.
[65] Fix | Delete
*/
[66] Fix | Delete
public function __construct( $basename ) {
[67] Fix | Delete
$this->basename = $basename;
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* Get plugin basename
[72] Fix | Delete
*
[73] Fix | Delete
* @return string
[74] Fix | Delete
*/
[75] Fix | Delete
public function get_basename() {
[76] Fix | Delete
return $this->basename;
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* Build object properties from array
[81] Fix | Delete
*
[82] Fix | Delete
* @param array $data Notice data.
[83] Fix | Delete
*/
[84] Fix | Delete
public function from_array( $data ) {
[85] Fix | Delete
if ( is_array( $data ) ) {
[86] Fix | Delete
if ( isset( $data['registered_at'] ) ) {
[87] Fix | Delete
$this->registered_at = (int) $data['registered_at'];
[88] Fix | Delete
}
[89] Fix | Delete
}
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
/**
[93] Fix | Delete
* Export to array
[94] Fix | Delete
*
[95] Fix | Delete
* @return array
[96] Fix | Delete
*/
[97] Fix | Delete
public function to_array() {
[98] Fix | Delete
return array(
[99] Fix | Delete
'registered_at' => $this->registered_at,
[100] Fix | Delete
);
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
/**
[104] Fix | Delete
* Check if screen is listen on plugin screen
[105] Fix | Delete
*
[106] Fix | Delete
* @param string $screen_id Screen ID.
[107] Fix | Delete
*
[108] Fix | Delete
* @return bool
[109] Fix | Delete
*/
[110] Fix | Delete
public function is_my_screen( $screen_id ) {
[111] Fix | Delete
foreach ( $this->screens as $screen ) {
[112] Fix | Delete
if ( $screen_id === $screen ) {
[113] Fix | Delete
$this->active_screen = $screen_id;
[114] Fix | Delete
[115] Fix | Delete
return true;
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
return false;
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* Get where notice should be moved
[124] Fix | Delete
*
[125] Fix | Delete
* @return array
[126] Fix | Delete
*/
[127] Fix | Delete
public function get_selector() {
[128] Fix | Delete
$selector = $this->selector;
[129] Fix | Delete
$active_screen = $this->active_screen;
[130] Fix | Delete
[131] Fix | Delete
/**
[132] Fix | Delete
* Filter selector which notice should be moved to
[133] Fix | Delete
*
[134] Fix | Delete
* @param array $selector
[135] Fix | Delete
* @param string $active_screen
[136] Fix | Delete
*
[137] Fix | Delete
* @return array
[138] Fix | Delete
*/
[139] Fix | Delete
return apply_filters( "wpmudev-recommended-plugin-$this->basename-notice-selector", $selector, $active_screen );
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
/**
[143] Fix | Delete
* Check whether now is the time to display
[144] Fix | Delete
*
[145] Fix | Delete
* @return bool
[146] Fix | Delete
*/
[147] Fix | Delete
public function is_time_to_display_notice() {
[148] Fix | Delete
$active_screen = $this->active_screen;
[149] Fix | Delete
$seconds_after_registered = 14 * DAY_IN_SECONDS;
[150] Fix | Delete
[151] Fix | Delete
/**
[152] Fix | Delete
* Filter how many seconds after registered before notice displayed
[153] Fix | Delete
*
[154] Fix | Delete
* This filter is globally used.
[155] Fix | Delete
*
[156] Fix | Delete
* @param int $seconds_after_registered
[157] Fix | Delete
* @param string $active_screen
[158] Fix | Delete
*
[159] Fix | Delete
* @return string
[160] Fix | Delete
*/
[161] Fix | Delete
$seconds_after_registered = apply_filters( "wpmudev-recommended-plugins-notice-display-seconds-after-registered", $seconds_after_registered, $active_screen );
[162] Fix | Delete
[163] Fix | Delete
/**
[164] Fix | Delete
* Filter how many seconds after registered before notice displayed
[165] Fix | Delete
*
[166] Fix | Delete
* This filter is for plugin based, overriding global value.
[167] Fix | Delete
*
[168] Fix | Delete
* @param int $seconds_after_registered
[169] Fix | Delete
* @param string $active_screen
[170] Fix | Delete
*
[171] Fix | Delete
* @return string
[172] Fix | Delete
*/
[173] Fix | Delete
$seconds_after_registered = apply_filters( "wpmudev-recommended-plugin-{$this->basename}-notice-display-seconds-after-registered", $seconds_after_registered, $active_screen );
[174] Fix | Delete
[175] Fix | Delete
$now = time();
[176] Fix | Delete
[177] Fix | Delete
if ( $now >= ( $this->registered_at + $seconds_after_registered ) ) {
[178] Fix | Delete
return true;
[179] Fix | Delete
}
[180] Fix | Delete
[181] Fix | Delete
return false;
[182] Fix | Delete
}
[183] Fix | Delete
[184] Fix | Delete
/**
[185] Fix | Delete
* Get pre text on displayed notice
[186] Fix | Delete
*
[187] Fix | Delete
* @return string
[188] Fix | Delete
*/
[189] Fix | Delete
public function get_pre_text_notice() {
[190] Fix | Delete
$pre_text_notice = sprintf( /* translators: %s - plugin name */
[191] Fix | Delete
__( 'Enjoying %s? Try out a few of our other popular free plugins...', 'wpmudev_recommended_plugins_notice' ),
[192] Fix | Delete
$this->name
[193] Fix | Delete
);
[194] Fix | Delete
[195] Fix | Delete
/**
[196] Fix | Delete
* Filter pre text on displayed notice
[197] Fix | Delete
*
[198] Fix | Delete
* @param string $pre_text_notice
[199] Fix | Delete
*
[200] Fix | Delete
* @return string
[201] Fix | Delete
*/
[202] Fix | Delete
return apply_filters( "wpmudev-recommended-plugin-$this->basename-pre-text-notice", $pre_text_notice );
[203] Fix | Delete
}
[204] Fix | Delete
[205] Fix | Delete
}
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
if ( ! class_exists( 'WPMUDEV_Recommended_Plugins_Notice' ) ) {
[209] Fix | Delete
[210] Fix | Delete
/**
[211] Fix | Delete
* Class WPMUDEV_Recommended_Plugins_Notice
[212] Fix | Delete
*
[213] Fix | Delete
* @internal
[214] Fix | Delete
*/
[215] Fix | Delete
class WPMUDEV_Recommended_Plugins_Notice {//phpcs:ignore
[216] Fix | Delete
/**
[217] Fix | Delete
* Class instance.
[218] Fix | Delete
*
[219] Fix | Delete
* @var WPMUDEV_Recommended_Plugins_Notice
[220] Fix | Delete
*/
[221] Fix | Delete
private static $instance = null;
[222] Fix | Delete
[223] Fix | Delete
/**
[224] Fix | Delete
* Collection of recommended plugins
[225] Fix | Delete
*
[226] Fix | Delete
* @var array
[227] Fix | Delete
*/
[228] Fix | Delete
protected $recommended_plugins = array();
[229] Fix | Delete
[230] Fix | Delete
/**
[231] Fix | Delete
* Version
[232] Fix | Delete
*/
[233] Fix | Delete
const VERSION = '1.0.0';
[234] Fix | Delete
[235] Fix | Delete
/**
[236] Fix | Delete
* Pointer name
[237] Fix | Delete
*/
[238] Fix | Delete
const POINTER_NAME = 'wpmudev_recommended_plugins';
[239] Fix | Delete
[240] Fix | Delete
/**
[241] Fix | Delete
* Registered plugins
[242] Fix | Delete
*/
[243] Fix | Delete
const OPTION_NAME = 'wpmudev_recommended_plugins_registered';
[244] Fix | Delete
[245] Fix | Delete
/**
[246] Fix | Delete
* Collection of registered plugins to use this notice
[247] Fix | Delete
*
[248] Fix | Delete
* @var WPMUDEV_Recommended_Plugins_Notice_Registered_Plugin[]
[249] Fix | Delete
*/
[250] Fix | Delete
protected $registered_plugins = array();
[251] Fix | Delete
[252] Fix | Delete
/**
[253] Fix | Delete
* Active registered plugin on this screen
[254] Fix | Delete
*
[255] Fix | Delete
* @var null
[256] Fix | Delete
*/
[257] Fix | Delete
protected $active_registered_plugin = null;
[258] Fix | Delete
[259] Fix | Delete
/**
[260] Fix | Delete
* WPMUDEV_Recommended_Plugins_Notice constructor.
[261] Fix | Delete
*/
[262] Fix | Delete
public function __construct() {
[263] Fix | Delete
// Only do things when its on admin screen.
[264] Fix | Delete
if ( is_admin() ) {
[265] Fix | Delete
$this->init_recommended_plugins();
[266] Fix | Delete
[267] Fix | Delete
$this->parse_saved_registered_plugins();
[268] Fix | Delete
add_action( 'wpmudev-recommended-plugins-register-notice', array( $this, 'register' ), 10, 4 );
[269] Fix | Delete
[270] Fix | Delete
add_action( 'all_admin_notices', array( $this, 'display' ), 6 );
[271] Fix | Delete
}
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
/**
[275] Fix | Delete
* Init recommended plugins
[276] Fix | Delete
*
[277] Fix | Delete
* @return void
[278] Fix | Delete
*/
[279] Fix | Delete
private function init_recommended_plugins() {
[280] Fix | Delete
$recommended_plugins = array(
[281] Fix | Delete
array(
[282] Fix | Delete
'name' => 'Smush Image Compression',
[283] Fix | Delete
'desc' => __( 'Resize, optimize and compress all of your images to the max.', 'wpmudev_recommended_plugins_notice' ),
[284] Fix | Delete
'image' => trailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/images/plugins-smush.png',
[285] Fix | Delete
'free_slug' => 'wp-smushit/wp-smush.php',
[286] Fix | Delete
'pro_slug' => 'wp-smush-pro/wp-smush.php',
[287] Fix | Delete
'install_link' => 'https://wordpress.org/plugins/wp-smushit/',
[288] Fix | Delete
),
[289] Fix | Delete
array(
[290] Fix | Delete
'name' => 'Hummingbird Performance',
[291] Fix | Delete
'desc' => __( 'Add powerful caching and optimize your assets.', 'wpmudev_recommended_plugins_notice' ),
[292] Fix | Delete
'image' => trailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/images/plugins-hummingbird.png',
[293] Fix | Delete
'free_slug' => 'hummingbird-performance/wp-hummingbird.php',
[294] Fix | Delete
'pro_slug' => 'wp-hummingbird/wp-hummingbird.php',
[295] Fix | Delete
'install_link' => 'https://wordpress.org/plugins/hummingbird-performance/',
[296] Fix | Delete
),
[297] Fix | Delete
array(
[298] Fix | Delete
'name' => 'Defender Security',
[299] Fix | Delete
'desc' => __( 'Secure and protect your site from malicious hackers and bots.', 'wpmudev_recommended_plugins_notice' ),
[300] Fix | Delete
'image' => trailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/images/plugins-defender.png',
[301] Fix | Delete
'free_slug' => 'defender-security/wp-defender.php',
[302] Fix | Delete
'pro_slug' => 'wp-defender/wp-defender.php',
[303] Fix | Delete
'install_link' => 'https://wordpress.org/plugins/defender-security/',
[304] Fix | Delete
),
[305] Fix | Delete
array(
[306] Fix | Delete
'name' => 'SmartCrawl SEO',
[307] Fix | Delete
'desc' => __( 'Configure your markup for optimal page and social ranking.', 'wpmudev_recommended_plugins_notice' ),
[308] Fix | Delete
'image' => trailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/images/plugins-smartcrawl.png',
[309] Fix | Delete
'free_slug' => 'smartcrawl-seo/wpmu-dev-seo.php',
[310] Fix | Delete
'pro_slug' => 'wpmu-dev-seo/wpmu-dev-seo.php',
[311] Fix | Delete
'install_link' => 'https://wordpress.org/plugins/smartcrawl-seo/',
[312] Fix | Delete
),
[313] Fix | Delete
array(
[314] Fix | Delete
'name' => 'Forminator Forms, Polls & Quizzes',
[315] Fix | Delete
'desc' => __( 'Create dynamic forms easily and quickly with our form builder.', 'wpmudev_recommended_plugins_notice' ),
[316] Fix | Delete
'image' => trailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/images/plugins-forminator.png',
[317] Fix | Delete
'free_slug' => 'forminator/forminator.php',
[318] Fix | Delete
'pro_slug' => '',
[319] Fix | Delete
'install_link' => 'https://wordpress.org/plugins/forminator/',
[320] Fix | Delete
),
[321] Fix | Delete
array(
[322] Fix | Delete
'name' => 'Hustle Marketing',
[323] Fix | Delete
'desc' => __( 'Generate leads with pop-ups, slide-ins and email opt-ins.', 'wpmudev_recommended_plugins_notice' ),
[324] Fix | Delete
'image' => trailingslashit( plugin_dir_url( __FILE__ ) ) . '/assets/images/plugins-hustle.png',
[325] Fix | Delete
'free_slug' => 'wordpress-popup/popover.php',
[326] Fix | Delete
'pro_slug' => 'hustle/opt-in.php',
[327] Fix | Delete
'install_link' => 'https://wordpress.org/plugins/wordpress-popup/',
[328] Fix | Delete
),
[329] Fix | Delete
);
[330] Fix | Delete
[331] Fix | Delete
$recommended_plugins = apply_filters( 'wpmudev-all-recommended-plugins', $recommended_plugins );
[332] Fix | Delete
[333] Fix | Delete
$this->recommended_plugins = $recommended_plugins;
[334] Fix | Delete
}
[335] Fix | Delete
[336] Fix | Delete
/**
[337] Fix | Delete
* Get recommended plugins to be displayed on notice
[338] Fix | Delete
*
[339] Fix | Delete
* This function will only return recommended plugins that `not installed` yet
[340] Fix | Delete
*
[341] Fix | Delete
* @param int $min Minimum plugins to be displayed.
[342] Fix | Delete
* @param int $max Maximum plugins to be displayed.
[343] Fix | Delete
*
[344] Fix | Delete
* @return array
[345] Fix | Delete
*/
[346] Fix | Delete
protected function get_recommended_plugins_for_notice( $min = 2, $max = 2 ) {
[347] Fix | Delete
$recommended_plugins_for_notice = array();
[348] Fix | Delete
$recommended_plugins = $this->recommended_plugins;
[349] Fix | Delete
[350] Fix | Delete
foreach ( $recommended_plugins as $recommended_plugin ) {
[351] Fix | Delete
[352] Fix | Delete
if ( $this->is_plugin_installed( $recommended_plugin ) ) {
[353] Fix | Delete
continue;
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
$recommended_plugins_for_notice[] = $recommended_plugin;
[357] Fix | Delete
// Stop when we reached max.
[358] Fix | Delete
if ( count( $recommended_plugins_for_notice ) >= $max ) {
[359] Fix | Delete
break;
[360] Fix | Delete
}
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
// Not enough!
[364] Fix | Delete
if ( count( $recommended_plugins_for_notice ) < $min ) {
[365] Fix | Delete
$recommended_plugins_for_notice = array();
[366] Fix | Delete
}
[367] Fix | Delete
[368] Fix | Delete
/**
[369] Fix | Delete
* Filter recommended plugins to be displayed on notice
[370] Fix | Delete
*
[371] Fix | Delete
* @param array $recommended_plugins_for_notice recommended plugins to be displayed
[372] Fix | Delete
* @param array $recommended_plugins all recommended plugins
[373] Fix | Delete
* @param int $min minimum plugins to be displayed
[374] Fix | Delete
* @param int $max maximum plugins to be displayed
[375] Fix | Delete
*
[376] Fix | Delete
* @return array
[377] Fix | Delete
*/
[378] Fix | Delete
return apply_filters( 'wpmudev-recommended-plugins', $recommended_plugins_for_notice, $recommended_plugins, $min, $max );
[379] Fix | Delete
}
[380] Fix | Delete
[381] Fix | Delete
/**
[382] Fix | Delete
* Check whether plugin is installed
[383] Fix | Delete
*
[384] Fix | Delete
* @uses get_plugins()
[385] Fix | Delete
*
[386] Fix | Delete
* @param array $plugin_data Plugin data.
[387] Fix | Delete
*
[388] Fix | Delete
* @return bool
[389] Fix | Delete
*/
[390] Fix | Delete
protected function is_plugin_installed( $plugin_data ) {
[391] Fix | Delete
$is_installed = false;
[392] Fix | Delete
[393] Fix | Delete
if ( ! function_exists( 'get_plugins' ) ) {
[394] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
$installed_plugins = get_plugins();
[398] Fix | Delete
[399] Fix | Delete
// Check the free one.
[400] Fix | Delete
if ( isset( $plugin_data['free_slug'] ) && ! empty( $plugin_data['free_slug'] ) ) {
[401] Fix | Delete
[402] Fix | Delete
if ( isset( $installed_plugins[ $plugin_data['free_slug'] ] ) ) {
[403] Fix | Delete
$is_installed = true;
[404] Fix | Delete
}
[405] Fix | Delete
}
[406] Fix | Delete
[407] Fix | Delete
// Check the pro one.
[408] Fix | Delete
if ( ! $is_installed ) {
[409] Fix | Delete
if ( isset( $plugin_data['pro_slug'] ) && ! empty( $plugin_data['pro_slug'] ) ) {
[410] Fix | Delete
if ( isset( $installed_plugins[ $plugin_data['pro_slug'] ] ) ) {
[411] Fix | Delete
$is_installed = true;
[412] Fix | Delete
}
[413] Fix | Delete
}
[414] Fix | Delete
}
[415] Fix | Delete
[416] Fix | Delete
/**
[417] Fix | Delete
* Filter is_installed status of recommended plugin
[418] Fix | Delete
*
[419] Fix | Delete
* @param bool $is_installed
[420] Fix | Delete
* @param array $plugin_data plugin to be check
[421] Fix | Delete
* @param array $installed_plugins current installed plugins
[422] Fix | Delete
*
[423] Fix | Delete
* @return bool
[424] Fix | Delete
*/
[425] Fix | Delete
return apply_filters( 'wpmudev-recommended-plugin-is-installed', $is_installed, $plugin_data, $installed_plugins );
[426] Fix | Delete
}
[427] Fix | Delete
[428] Fix | Delete
/**
[429] Fix | Delete
* Display the notice
[430] Fix | Delete
*
[431] Fix | Delete
* @return void
[432] Fix | Delete
*/
[433] Fix | Delete
public function display() {
[434] Fix | Delete
/**
[435] Fix | Delete
* Fires before displaying notice
[436] Fix | Delete
*
[437] Fix | Delete
* This action fired before any check done.
[438] Fix | Delete
*/
[439] Fix | Delete
do_action( 'wpmudev-recommended-plugins-before-display' );
[440] Fix | Delete
[441] Fix | Delete
$is_displayable = $this->is_displayable();
[442] Fix | Delete
[443] Fix | Delete
/**
[444] Fix | Delete
* Filter whether notice is displayable
[445] Fix | Delete
*
[446] Fix | Delete
* @param bool $is_displayable
[447] Fix | Delete
*
[448] Fix | Delete
* @return bool
[449] Fix | Delete
*/
[450] Fix | Delete
$is_displayable = apply_filters( 'wpmudev-recommended-plugins-is-displayable', $is_displayable );
[451] Fix | Delete
if ( ! $is_displayable ) {
[452] Fix | Delete
return;
[453] Fix | Delete
}
[454] Fix | Delete
[455] Fix | Delete
$active_registered_plugin = $this->active_registered_plugin;
[456] Fix | Delete
[457] Fix | Delete
/**
[458] Fix | Delete
* Filter whether notice is displayable
[459] Fix | Delete
*
[460] Fix | Delete
* @param bool $is_displayable
[461] Fix | Delete
*
[462] Fix | Delete
* @return bool
[463] Fix | Delete
*/
[464] Fix | Delete
$active_registered_plugin = apply_filters( 'wpmudev-recommended-plugin-active-registered', $active_registered_plugin );
[465] Fix | Delete
[466] Fix | Delete
if ( ! $active_registered_plugin instanceof WPMUDEV_Recommended_Plugins_Notice_Registered_Plugin ) {
[467] Fix | Delete
return;
[468] Fix | Delete
}
[469] Fix | Delete
[470] Fix | Delete
$recommended_plugins = $this->get_recommended_plugins_for_notice();
[471] Fix | Delete
[472] Fix | Delete
// no plugins to be recommended.
[473] Fix | Delete
if ( empty( $recommended_plugins ) ) {
[474] Fix | Delete
return;
[475] Fix | Delete
}
[476] Fix | Delete
[477] Fix | Delete
wp_register_style( 'wpmudev-recommended-plugins-css', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'assets/css/notice.css', array(), self::VERSION );
[478] Fix | Delete
wp_enqueue_style( 'wpmudev-recommended-plugins-css' );
[479] Fix | Delete
[480] Fix | Delete
wp_register_script( 'wpmudev-recommended-plugins-js', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'assets/js/notice.js', array( 'jquery' ), self::VERSION, true );
[481] Fix | Delete
wp_enqueue_script( 'wpmudev-recommended-plugins-js' );
[482] Fix | Delete
[483] Fix | Delete
$dismissed_text = __( 'Dismiss', 'wpmudev_recommended_plugins_notice' );
[484] Fix | Delete
[485] Fix | Delete
/**
[486] Fix | Delete
* Filter dismissed text
[487] Fix | Delete
*
[488] Fix | Delete
* @param string $dismissed_text
[489] Fix | Delete
*
[490] Fix | Delete
* @return string
[491] Fix | Delete
*/
[492] Fix | Delete
$dismissed_text = apply_filters( 'wpmudev-recommended-plugins-dismissed-text', $dismissed_text );
[493] Fix | Delete
[494] Fix | Delete
// placement customizer.
[495] Fix | Delete
$selector = $active_registered_plugin->get_selector();
[496] Fix | Delete
$data_selector_el = '';
[497] Fix | Delete
$data_selector_fn = '';
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function