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/wp-conte.../plugins/portfoli.../bws_menu
File: bws_functions.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @package BWS Menu
[2] Fix | Delete
* @version 2.4.3
[3] Fix | Delete
* Main functions
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[7] Fix | Delete
exit;
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* General functions for BestWebSoft plugins
[12] Fix | Delete
*/
[13] Fix | Delete
require dirname( __FILE__ ) . '/deprecated.php';
[14] Fix | Delete
require_once dirname( __FILE__ ) . '/deactivation-form.php';
[15] Fix | Delete
[16] Fix | Delete
[17] Fix | Delete
if ( ! function_exists( 'bws_get_mofile' ) ) {
[18] Fix | Delete
/**
[19] Fix | Delete
* Function to add 'bestwebsoft' slug for BWS_Menu MO file if BWS_Menu loaded from theme.
[20] Fix | Delete
*
[21] Fix | Delete
* @since 1.9.7
[22] Fix | Delete
* @param string $mofile Mo file name.
[23] Fix | Delete
* @param string $domain Domain name.
[24] Fix | Delete
*/
[25] Fix | Delete
function bws_get_mofile( $mofile, $domain ) {
[26] Fix | Delete
if ( 'bestwebsoft' === $domain ) {
[27] Fix | Delete
$locale = get_locale();
[28] Fix | Delete
return str_replace( $locale, "bestwebsoft-{$locale}", $mofile );
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
return $mofile;
[32] Fix | Delete
}
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* Internationalization, first(!)
[37] Fix | Delete
*
[38] Fix | Delete
* @since 1.9.7
[39] Fix | Delete
*/
[40] Fix | Delete
if ( isset( $bws_menu_source ) && 'themes' === $bws_menu_source ) {
[41] Fix | Delete
add_filter( 'load_textdomain_mofile', 'bws_get_mofile', 10, 2 );
[42] Fix | Delete
load_theme_textdomain( 'bestwebsoft', get_stylesheet_directory() . '/inc/bws_menu/languages' );
[43] Fix | Delete
remove_filter( 'load_textdomain_mofile', 'bws_get_mofile' );
[44] Fix | Delete
} else {
[45] Fix | Delete
load_plugin_textdomain( 'bestwebsoft', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
if ( ! function_exists( 'bws_menu_url' ) ) {
[49] Fix | Delete
/**
[50] Fix | Delete
* Function to getting url to current BWS_Menu.
[51] Fix | Delete
*
[52] Fix | Delete
* @since 1.9.7
[53] Fix | Delete
* @param string $path Plugin path.
[54] Fix | Delete
*/
[55] Fix | Delete
if ( ! isset( $bws_menu_source ) || 'plugins' === $bws_menu_source ) {
[56] Fix | Delete
function bws_menu_url( $path = '' ) {
[57] Fix | Delete
return plugins_url( $path, __FILE__ );
[58] Fix | Delete
}
[59] Fix | Delete
} else {
[60] Fix | Delete
function bws_menu_url( $path = '' ) {
[61] Fix | Delete
$bws_menu_current_dir = str_replace( '\\', '/', dirname( __FILE__ ) );
[62] Fix | Delete
$bws_menu_abspath = str_replace( '\\', '/', ABSPATH );
[63] Fix | Delete
$bws_menu_current_url = site_url( str_replace( $bws_menu_abspath, '', $bws_menu_current_dir ) );
[64] Fix | Delete
[65] Fix | Delete
return sprintf( '%s/%s', $bws_menu_current_url, $path );
[66] Fix | Delete
}
[67] Fix | Delete
}
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
if ( ! function_exists( 'bws_wp_min_version_check' ) ) {
[71] Fix | Delete
/**
[72] Fix | Delete
* Function check if plugin is compatible with current WP version
[73] Fix | Delete
*
[74] Fix | Delete
* @param string $plugin_basename Plugin basename.
[75] Fix | Delete
* @param array $plugin_info Plugin info.
[76] Fix | Delete
* @param string $require_wp Wp version.
[77] Fix | Delete
* @param string $min_wp (Optional) Flag for min WP version.
[78] Fix | Delete
*/
[79] Fix | Delete
function bws_wp_min_version_check( $plugin_basename, $plugin_info, $require_wp, $min_wp = false ) {
[80] Fix | Delete
global $wp_version, $bws_versions_notice_array;
[81] Fix | Delete
if ( false === $min_wp ) {
[82] Fix | Delete
$min_wp = $require_wp;
[83] Fix | Delete
}
[84] Fix | Delete
if ( version_compare( $wp_version, $min_wp, '<' ) ) {
[85] Fix | Delete
include_once ABSPATH . 'wp-admin/includes/plugin.php';
[86] Fix | Delete
if ( is_plugin_active( $plugin_basename ) ) {
[87] Fix | Delete
deactivate_plugins( $plugin_basename );
[88] Fix | Delete
$admin_url = ( function_exists( 'get_admin_url' ) ) ? get_admin_url( null, 'plugins.php' ) : esc_url( '/wp-admin/plugins.php' );
[89] Fix | Delete
wp_die(
[90] Fix | Delete
sprintf(
[91] Fix | Delete
"<strong>%s</strong> %s <strong>WordPress %s</strong> %s <br /><br />%s <a href='%s'>%s</a>.",
[92] Fix | Delete
esc_html( $plugin_info['Name'] ),
[93] Fix | Delete
esc_html__( 'requires', 'bestwebsoft' ),
[94] Fix | Delete
esc_html( $require_wp ),
[95] Fix | Delete
esc_html__( 'or higher, that is why it has been deactivated! Please upgrade WordPress and try again.', 'bestwebsoft' ),
[96] Fix | Delete
esc_html__( 'Back to the WordPress', 'bestwebsoft' ),
[97] Fix | Delete
esc_url( $admin_url ),
[98] Fix | Delete
esc_html__( 'Plugins page', 'bestwebsoft' )
[99] Fix | Delete
)
[100] Fix | Delete
);
[101] Fix | Delete
}
[102] Fix | Delete
} elseif ( version_compare( $wp_version, $require_wp, '<' ) ) {
[103] Fix | Delete
$bws_versions_notice_array[] = array(
[104] Fix | Delete
'name' => $plugin_info['Name'],
[105] Fix | Delete
'version' => $require_wp,
[106] Fix | Delete
);
[107] Fix | Delete
}
[108] Fix | Delete
}
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
if ( ! function_exists( 'bws_plugin_reviews_block' ) ) {
[112] Fix | Delete
/**
[113] Fix | Delete
* Function display review block
[114] Fix | Delete
*
[115] Fix | Delete
* @param string $plugin_name Plugin name.
[116] Fix | Delete
* @param string $plugin_slug Plugin slug.
[117] Fix | Delete
* @echo string
[118] Fix | Delete
*/
[119] Fix | Delete
function bws_plugin_reviews_block( $plugin_name, $plugin_slug ) { ?>
[120] Fix | Delete
<div class="bws-plugin-reviews">
[121] Fix | Delete
<div class="bws-plugin-reviews-rate">
[122] Fix | Delete
<?php esc_html_e( 'Like the plugin?', 'bestwebsoft' ); ?>
[123] Fix | Delete
<a href="https://wordpress.org/support/view/plugin-reviews/<?php echo esc_attr( $plugin_slug ); ?>?filter=5" target="_blank" title="<?php printf( esc_html__( '%s reviews', 'bestwebsoft' ), esc_html( sanitize_text_field( $plugin_name ) ) ); ?>">
[124] Fix | Delete
<?php esc_html_e( 'Rate it', 'bestwebsoft' ); ?>
[125] Fix | Delete
<span class="dashicons dashicons-star-filled"></span>
[126] Fix | Delete
<span class="dashicons dashicons-star-filled"></span>
[127] Fix | Delete
<span class="dashicons dashicons-star-filled"></span>
[128] Fix | Delete
<span class="dashicons dashicons-star-filled"></span>
[129] Fix | Delete
<span class="dashicons dashicons-star-filled"></span>
[130] Fix | Delete
</a>
[131] Fix | Delete
</div>
[132] Fix | Delete
<div class="bws-plugin-reviews-support">
[133] Fix | Delete
<?php esc_html_e( 'Need help?', 'bestwebsoft' ); ?>
[134] Fix | Delete
<a href="https://support.bestwebsoft.com"><?php esc_html_e( 'Visit Help Center', 'bestwebsoft' ); ?></a>
[135] Fix | Delete
</div>
[136] Fix | Delete
<div class="bws-plugin-reviews-donate">
[137] Fix | Delete
<?php esc_html_e( 'Want to support the plugin?', 'bestwebsoft' ); ?>
[138] Fix | Delete
<a href="https://bestwebsoft.com/donate/"><?php esc_html_e( 'Donate', 'bestwebsoft' ); ?></a>
[139] Fix | Delete
</div>
[140] Fix | Delete
</div>
[141] Fix | Delete
<?php
[142] Fix | Delete
}
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
if ( ! function_exists( 'bws_plugin_update_row' ) ) {
[146] Fix | Delete
/**
[147] Fix | Delete
* Function display license notification
[148] Fix | Delete
*
[149] Fix | Delete
* @param string $plugin_key Plugin key.
[150] Fix | Delete
* @param string $link_slug (Optional) Link slug.
[151] Fix | Delete
* @param string $free_plugin_name (Optional) Free version plugin name.
[152] Fix | Delete
* @echo string
[153] Fix | Delete
*/
[154] Fix | Delete
function bws_plugin_update_row( $plugin_key, $link_slug = false, $free_plugin_name = false ) {
[155] Fix | Delete
global $bstwbsftwppdtplgns_options, $wp_version;
[156] Fix | Delete
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
[157] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $plugin_key ] ) ) {
[158] Fix | Delete
$explode_plugin_key = explode( '/', $plugin_key );
[159] Fix | Delete
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
[160] Fix | Delete
$style = ( $wp_version < 4.6 ) ? ' style="background-color: #FFEBE8;border-color: #CC0000;"' : '';
[161] Fix | Delete
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
[162] Fix | Delete
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . esc_attr( $class ) . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
[163] Fix | Delete
<td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
[164] Fix | Delete
<div class="update-message' . esc_attr( $div_class ) . '"' . wp_kses_post( $style ) . '>';
[165] Fix | Delete
if ( $wp_version >= 4.6 ) {
[166] Fix | Delete
echo '<p>';
[167] Fix | Delete
}
[168] Fix | Delete
echo '<strong>' . esc_html__( 'WARNING: Illegal use notification', 'bestwebsoft' ) . '.</strong> ' . esc_html__( 'You can use one license of the Pro plugin for one domain only. Please check and edit your license or domain if necessary using your personal Client Area. We strongly recommend you to solve the problem within 24 hours, otherwise the Pro plugin will be deactivated.', 'bestwebsoft' ) . ' <a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/articles/204240089">' . esc_html__( 'Learn More', 'bestwebsoft' ) . '</a>';
[169] Fix | Delete
if ( $wp_version >= 4.6 ) {
[170] Fix | Delete
echo '</p>';
[171] Fix | Delete
}
[172] Fix | Delete
echo '</div>
[173] Fix | Delete
</td>
[174] Fix | Delete
</tr>';
[175] Fix | Delete
} elseif ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( gmdate( 'm/d/Y' ) ) ) {
[176] Fix | Delete
$explode_plugin_key = explode( '/', $plugin_key );
[177] Fix | Delete
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
[178] Fix | Delete
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
[179] Fix | Delete
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
[180] Fix | Delete
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . esc_attr( $class ) . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
[181] Fix | Delete
<td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
[182] Fix | Delete
<div class="update-message' . esc_attr( $div_class ) . '"' . wp_kses_post( $style ) . '>';
[183] Fix | Delete
if ( $wp_version >= 4.6 ) {
[184] Fix | Delete
echo '<p>';
[185] Fix | Delete
}
[186] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) && false !== $link_slug ) {
[187] Fix | Delete
echo esc_html__( 'Notice: Your Pro Trial license has expired. To continue using the plugin, you should buy a Pro license', 'bestwebsoft' ) . ' - <a href="https://bestwebsoft.com/products/wordpress/plugins/' . esc_attr( $link_slug ) . '/">https://bestwebsoft.com/products/wordpress/plugins/' . esc_attr( $link_slug ) . '/</a>';
[188] Fix | Delete
} else {
[189] Fix | Delete
echo esc_html__( 'Your license has expired. To continue getting top-priority support and plugin updates, you should extend it.', 'bestwebsoft' ) . ' <a target="_new" href="https://support.bestwebsoft.com/entries/53487136">' . esc_html__( 'Learn more', 'bestwebsoft' ) . '</a>';
[190] Fix | Delete
}
[191] Fix | Delete
if ( $wp_version >= 4.6 ) {
[192] Fix | Delete
echo '</p>';
[193] Fix | Delete
}
[194] Fix | Delete
echo '</div>
[195] Fix | Delete
</td>
[196] Fix | Delete
</tr>';
[197] Fix | Delete
} elseif ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) ) {
[198] Fix | Delete
$explode_plugin_key = explode( '/', $plugin_key );
[199] Fix | Delete
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
[200] Fix | Delete
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
[201] Fix | Delete
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
[202] Fix | Delete
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . esc_attr( $class ) . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
[203] Fix | Delete
<td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
[204] Fix | Delete
<div class="update-message' . esc_attr( $div_class ) . '"' . wp_kses_post( $style ) . '>';
[205] Fix | Delete
if ( $wp_version >= 4.6 ) {
[206] Fix | Delete
echo '<p>';
[207] Fix | Delete
}
[208] Fix | Delete
if ( false !== $free_plugin_name ) {
[209] Fix | Delete
printf( esc_html__( 'Notice: You are using the Pro Trial license of %s plugin.', 'bestwebsoft' ), esc_html( $free_plugin_name ) );
[210] Fix | Delete
} else {
[211] Fix | Delete
esc_html_e( 'Notice: You are using the Pro Trial license of plugin.', 'bestwebsoft' );
[212] Fix | Delete
}
[213] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) ) {
[214] Fix | Delete
echo ' ' . esc_html__( 'The Pro Trial license will expire on', 'bestwebsoft' ) . ' ' . esc_html( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) . '.';
[215] Fix | Delete
}
[216] Fix | Delete
if ( $wp_version >= 4.6 ) {
[217] Fix | Delete
echo '</p>';
[218] Fix | Delete
}
[219] Fix | Delete
echo '</div>
[220] Fix | Delete
</td>
[221] Fix | Delete
</tr>';
[222] Fix | Delete
}
[223] Fix | Delete
}
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
if ( ! function_exists( 'bws_admin_notices' ) ) {
[227] Fix | Delete
/**
[228] Fix | Delete
* Function display admin notices
[229] Fix | Delete
*
[230] Fix | Delete
* @echo string
[231] Fix | Delete
*/
[232] Fix | Delete
function bws_admin_notices() {
[233] Fix | Delete
global $bws_versions_notice_array, $bws_plugin_banner_to_settings, $bstwbsftwppdtplgns_options, $bws_plugin_banner_go_pro, $bstwbsftwppdtplgns_banner_array, $bws_plugin_banner_timeout;
[234] Fix | Delete
[235] Fix | Delete
/* bws_plugin_banner_go_pro */
[236] Fix | Delete
if ( ! empty( $bws_plugin_banner_go_pro ) ) {
[237] Fix | Delete
/* get $bws_plugins */
[238] Fix | Delete
require dirname( __FILE__ ) . '/product_list.php';
[239] Fix | Delete
[240] Fix | Delete
foreach ( $bstwbsftwppdtplgns_banner_array as $value ) {
[241] Fix | Delete
if ( isset( $bws_plugin_banner_go_pro[ $value[0] ] ) && ! isset( $_COOKIE[ $value[0] ] ) ) {
[242] Fix | Delete
[243] Fix | Delete
if ( isset( $bws_plugins[ $value[1] ]['pro_version'] ) && is_plugin_active( $bws_plugins[ $value[1] ]['pro_version'] ) ) {
[244] Fix | Delete
continue;
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
$single_banner_value = $bws_plugin_banner_go_pro[ $value[0] ];
[248] Fix | Delete
?>
[249] Fix | Delete
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
[250] Fix | Delete
<div class="<?php echo esc_attr( $single_banner_value['prefix'] ); ?>_message bws_banner_on_plugin_page bws_go_pro_banner" style="display: none;">
[251] Fix | Delete
<button class="<?php echo esc_attr( $single_banner_value['prefix'] ); ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
[252] Fix | Delete
<div class="icon">
[253] Fix | Delete
<img title="" src="<?php echo esc_attr( $single_banner_value['banner_url'] ); ?>" alt="" />
[254] Fix | Delete
</div>
[255] Fix | Delete
<div class="text">
[256] Fix | Delete
<?php esc_html_e( 'It’s time to upgrade your', 'bestwebsoft' ); ?> <strong><?php echo esc_html( $single_banner_value['plugin_info']['Name'] ); ?> plugin</strong> <?php esc_html_e( 'to', 'bestwebsoft' ); ?> <strong>Pro</strong> <?php esc_html_e( 'version!', 'bestwebsoft' ); ?><br />
[257] Fix | Delete
<span><?php esc_html_e( 'Extend standard plugin functionality with new great options.', 'bestwebsoft' ); ?></span>
[258] Fix | Delete
</div>
[259] Fix | Delete
<div class="button_div">
[260] Fix | Delete
<a class="button" target="_blank" href="<?php echo esc_url( $single_banner_value['bws_link'] ); ?>"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
[261] Fix | Delete
</div>
[262] Fix | Delete
</div>
[263] Fix | Delete
</div>
[264] Fix | Delete
<?php
[265] Fix | Delete
break;
[266] Fix | Delete
}
[267] Fix | Delete
}
[268] Fix | Delete
}
[269] Fix | Delete
[270] Fix | Delete
/* $bws_plugin_banner_timeout */
[271] Fix | Delete
if ( ! empty( $bws_plugin_banner_timeout ) ) {
[272] Fix | Delete
foreach ( $bws_plugin_banner_timeout as $banner_value ) {
[273] Fix | Delete
?>
[274] Fix | Delete
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
[275] Fix | Delete
<div class="<?php echo esc_attr( $banner_value['prefix'] ); ?>_message_timeout bws_banner_on_plugin_page bws_banner_timeout" style="display:none;">
[276] Fix | Delete
<button class="<?php echo esc_attr( $banner_value['prefix'] ); ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
[277] Fix | Delete
<div class="icon">
[278] Fix | Delete
<img title="" src="<?php echo esc_url( $banner_value['banner_url'] ); ?>" alt="" />
[279] Fix | Delete
</div>
[280] Fix | Delete
<div class="text"><?php printf( esc_html__( "Your license key for %1\$s expires on %2\$s and you won't be granted TOP-PRIORITY SUPPORT or UPDATES.", 'bestwebsoft' ), '<strong>' . esc_html( $banner_value['plugin_name'] ) . '</strong>', esc_html( $bstwbsftwppdtplgns_options['time_out'][ $banner_value['plugin_key'] ] ) ); ?> <a target="_new" href="https://support.bestwebsoft.com/entries/53487136"><?php esc_html_e( 'Learn more', 'bestwebsoft' ); ?></a></div>
[281] Fix | Delete
</div>
[282] Fix | Delete
</div>
[283] Fix | Delete
<?php
[284] Fix | Delete
}
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
/* versions notice */
[288] Fix | Delete
if ( ! empty( $bws_versions_notice_array ) ) {
[289] Fix | Delete
foreach ( $bws_versions_notice_array as $key => $value ) {
[290] Fix | Delete
?>
[291] Fix | Delete
<div class="update-nag">
[292] Fix | Delete
<?php
[293] Fix | Delete
printf(
[294] Fix | Delete
'<strong>%s</strong> %s <strong>WordPress %s</strong> %s',
[295] Fix | Delete
esc_html( $value['name'] ),
[296] Fix | Delete
esc_html__( 'requires', 'bestwebsoft' ),
[297] Fix | Delete
esc_html( $value['version'] ),
[298] Fix | Delete
esc_html__( 'or higher! We do not guarantee that our plugin will work correctly. Please upgrade to WordPress latest version.', 'bestwebsoft' )
[299] Fix | Delete
);
[300] Fix | Delete
?>
[301] Fix | Delete
</div>
[302] Fix | Delete
<?php
[303] Fix | Delete
}
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
/* banner_to_settings notice */
[307] Fix | Delete
if ( ! empty( $bws_plugin_banner_to_settings ) ) {
[308] Fix | Delete
if ( 1 === count( $bws_plugin_banner_to_settings ) ) {
[309] Fix | Delete
?>
[310] Fix | Delete
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
[311] Fix | Delete
<div class="bws_banner_on_plugin_page bws_banner_to_settings">
[312] Fix | Delete
<div class="icon">
[313] Fix | Delete
<img title="" src="<?php echo esc_url( $bws_plugin_banner_to_settings[0]['banner_url'] ); ?>" alt="" />
[314] Fix | Delete
</div>
[315] Fix | Delete
<div class="text">
[316] Fix | Delete
<strong><?php printf( esc_html__( 'Thank you for installing %s plugin!', 'bestwebsoft' ), esc_html( $bws_plugin_banner_to_settings[0]['plugin_info']['Name'] ) ); ?></strong>
[317] Fix | Delete
<br />
[318] Fix | Delete
<?php esc_html_e( "Let's get started", 'bestwebsoft' ); ?>:
[319] Fix | Delete
<a href="<?php echo esc_url( self_admin_url( $bws_plugin_banner_to_settings[0]['settings_url'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
[320] Fix | Delete
<?php if ( false !== $bws_plugin_banner_to_settings[0]['post_type_url'] ) { ?>
[321] Fix | Delete
<?php esc_html_e( 'or', 'bestwebsoft' ); ?>
[322] Fix | Delete
<a href="<?php echo esc_url( self_admin_url( $bws_plugin_banner_to_settings[0]['post_type_url'] ) ); ?>"><?php esc_html_e( 'Add New', 'bestwebsoft' ); ?></a>
[323] Fix | Delete
<?php } ?>
[324] Fix | Delete
</div>
[325] Fix | Delete
<form action="" method="post">
[326] Fix | Delete
<button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
[327] Fix | Delete
<input type="hidden" name="bws_hide_settings_notice_<?php echo esc_html( $bws_plugin_banner_to_settings[0]['plugin_options_name'] ); ?>" value="hide" />
[328] Fix | Delete
<?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_settings_nonce_name' ); ?>
[329] Fix | Delete
</form>
[330] Fix | Delete
</div>
[331] Fix | Delete
</div>
[332] Fix | Delete
<?php } else { ?>
[333] Fix | Delete
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
[334] Fix | Delete
<div class="bws_banner_on_plugin_page bws_banner_to_settings_joint">
[335] Fix | Delete
<form action="" method="post">
[336] Fix | Delete
<button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
[337] Fix | Delete
<div class="bws-text">
[338] Fix | Delete
<div class="icon">
[339] Fix | Delete
<span class="dashicons dashicons-admin-plugins"></span>
[340] Fix | Delete
</div>
[341] Fix | Delete
<strong><?php esc_html_e( 'Thank you for installing plugins by BestWebSoft!', 'bestwebsoft' ); ?></strong>
[342] Fix | Delete
<div class="hide-if-no-js bws-more-links">
[343] Fix | Delete
<a href="#" class="bws-more"><?php esc_html_e( 'More Details', 'bestwebsoft' ); ?></a>
[344] Fix | Delete
<a href="#" class="bws-less hidden"><?php esc_html_e( 'Less Details', 'bestwebsoft' ); ?></a>
[345] Fix | Delete
</div>
[346] Fix | Delete
<?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_settings_nonce_name' ); ?>
[347] Fix | Delete
<div class="clear"></div>
[348] Fix | Delete
</div>
[349] Fix | Delete
<div class="bws-details hide-if-js">
[350] Fix | Delete
<?php foreach ( $bws_plugin_banner_to_settings as $value ) { ?>
[351] Fix | Delete
<div>
[352] Fix | Delete
<strong><?php echo esc_html( str_replace( ' by BestWebSoft', '', $value['plugin_info']['Name'] ) ); ?></strong>&ensp;<a href="<?php echo esc_url( self_admin_url( $value['settings_url'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
[353] Fix | Delete
<?php if ( false !== $value['post_type_url'] ) { ?>
[354] Fix | Delete
&ensp;|&ensp;<a target="_blank" href="<?php echo esc_url( self_admin_url( $value['post_type_url'] ) ); ?>"><?php esc_html_e( 'Add New', 'bestwebsoft' ); ?></a>
[355] Fix | Delete
<?php } ?>
[356] Fix | Delete
<input type="hidden" name="bws_hide_settings_notice_<?php echo esc_html( $value['plugin_options_name'] ); ?>" value="hide" />
[357] Fix | Delete
</div>
[358] Fix | Delete
<?php } ?>
[359] Fix | Delete
</div>
[360] Fix | Delete
</div>
[361] Fix | Delete
</form>
[362] Fix | Delete
</div>
[363] Fix | Delete
<?php
[364] Fix | Delete
}
[365] Fix | Delete
}
[366] Fix | Delete
[367] Fix | Delete
/**
[368] Fix | Delete
* Show notices about deprecated_function
[369] Fix | Delete
*
[370] Fix | Delete
* @since 1.9.8
[371] Fix | Delete
*/
[372] Fix | Delete
if ( ! empty( $bstwbsftwppdtplgns_options['deprecated_function'] ) ) {
[373] Fix | Delete
?>
[374] Fix | Delete
<div class="update-nag">
[375] Fix | Delete
<strong><?php esc_html_e( 'Deprecated function(-s) is used on the site here:', 'bestwebsoft' ); ?></strong>
[376] Fix | Delete
<?php
[377] Fix | Delete
$i = 1;
[378] Fix | Delete
foreach ( $bstwbsftwppdtplgns_options['deprecated_function'] as $function_name => $attr ) {
[379] Fix | Delete
if ( 1 !== $i ) {
[380] Fix | Delete
echo ' ,';
[381] Fix | Delete
}
[382] Fix | Delete
if ( ! empty( $attr['product-name'] ) ) {
[383] Fix | Delete
echo esc_html( $attr['product-name'] );
[384] Fix | Delete
} elseif ( ! empty( $attr['file'] ) ) {
[385] Fix | Delete
echo esc_url( $attr['file'] );
[386] Fix | Delete
}
[387] Fix | Delete
unset( $bstwbsftwppdtplgns_options['deprecated_function'][ $function_name ] );
[388] Fix | Delete
$i++;
[389] Fix | Delete
}
[390] Fix | Delete
?>
[391] Fix | Delete
.
[392] Fix | Delete
<br/>
[393] Fix | Delete
<?php esc_html_e( 'This function(-s) will be removed over time. Please update the product(-s).', 'bestwebsoft' ); ?>
[394] Fix | Delete
</div>
[395] Fix | Delete
<?php
[396] Fix | Delete
if ( is_multisite() ) {
[397] Fix | Delete
update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
[398] Fix | Delete
} else {
[399] Fix | Delete
update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
[400] Fix | Delete
}
[401] Fix | Delete
}
[402] Fix | Delete
}
[403] Fix | Delete
}
[404] Fix | Delete
[405] Fix | Delete
if ( ! function_exists( 'bws_plugin_banner_go_pro' ) ) {
[406] Fix | Delete
/**
[407] Fix | Delete
* Function display banner
[408] Fix | Delete
*
[409] Fix | Delete
* @param array $plugin_options Plugin options array.
[410] Fix | Delete
* @param array $plugin_info Plugin info array.
[411] Fix | Delete
* @param string $this_banner_prefix Banner prefix.
[412] Fix | Delete
* @param string $bws_link_slug Slug for link.
[413] Fix | Delete
* @param string $link_key Key for plugin.
[414] Fix | Delete
* @param string $link_pn PN for plugin.
[415] Fix | Delete
* @param string $banner_url_or_slug Url or slug for icon.
[416] Fix | Delete
* @return array
[417] Fix | Delete
*/
[418] Fix | Delete
function bws_plugin_banner_go_pro( $plugin_options, $plugin_info, $this_banner_prefix, $bws_link_slug, $link_key, $link_pn, $banner_url_or_slug ) {
[419] Fix | Delete
global $bws_plugin_banner_go_pro, $wp_version, $bstwbsftwppdtplgns_banner_array;
[420] Fix | Delete
[421] Fix | Delete
if ( ! isset( $plugin_options['first_install'] ) || strtotime( '-1 week' ) < $plugin_options['first_install'] ) {
[422] Fix | Delete
return;
[423] Fix | Delete
}
[424] Fix | Delete
[425] Fix | Delete
$bws_link = esc_url( 'https://bestwebsoft.com/products/wordpress/plugins/' . $bws_link_slug . '/?k=' . $link_key . '&pn=' . $link_pn . '&v=' . $plugin_info['Version'] . '&wp_v=' . $wp_version );
[426] Fix | Delete
[427] Fix | Delete
if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
[428] Fix | Delete
$banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
[429] Fix | Delete
}
[430] Fix | Delete
[431] Fix | Delete
$bws_plugin_banner_go_pro[ $this_banner_prefix . '_hide_banner_on_plugin_page' ] = array(
[432] Fix | Delete
'plugin_info' => $plugin_info,
[433] Fix | Delete
'prefix' => $this_banner_prefix,
[434] Fix | Delete
'bws_link' => $bws_link,
[435] Fix | Delete
'banner_url' => $banner_url_or_slug,
[436] Fix | Delete
);
[437] Fix | Delete
[438] Fix | Delete
if ( empty( $bstwbsftwppdtplgns_banner_array ) ) {
[439] Fix | Delete
if ( ! function_exists( 'bws_get_banner_array' ) ) {
[440] Fix | Delete
require_once dirname( __FILE__ ) . '/bws_menu.php';
[441] Fix | Delete
}
[442] Fix | Delete
bws_get_banner_array();
[443] Fix | Delete
}
[444] Fix | Delete
}
[445] Fix | Delete
}
[446] Fix | Delete
[447] Fix | Delete
if ( ! function_exists( 'bws_add_plugin_banner_timeout' ) ) {
[448] Fix | Delete
/**
[449] Fix | Delete
* Function update banner params
[450] Fix | Delete
*
[451] Fix | Delete
* @param string $plugin_key Plugin key.
[452] Fix | Delete
* @param string $plugin_prefix Plugin prefix.
[453] Fix | Delete
* @param string $plugin_name Plugin name.
[454] Fix | Delete
* @param string $banner_url_or_slug Url or slug for icon.
[455] Fix | Delete
*/
[456] Fix | Delete
function bws_add_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $banner_url_or_slug ) {
[457] Fix | Delete
global $bws_plugin_banner_timeout;
[458] Fix | Delete
[459] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( gmdate( 'm/d/Y' ) . '+1 month' ) ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) > strtotime( gmdate( 'm/d/Y' ) ) ) ) {
[460] Fix | Delete
[461] Fix | Delete
if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
[462] Fix | Delete
$banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
[463] Fix | Delete
}
[464] Fix | Delete
[465] Fix | Delete
$bws_plugin_banner_timeout[] = array(
[466] Fix | Delete
'plugin_key' => $plugin_key,
[467] Fix | Delete
'prefix' => $plugin_prefix,
[468] Fix | Delete
'plugin_name' => $plugin_name,
[469] Fix | Delete
'banner_url' => $banner_url_or_slug,
[470] Fix | Delete
);
[471] Fix | Delete
}
[472] Fix | Delete
}
[473] Fix | Delete
}
[474] Fix | Delete
[475] Fix | Delete
if ( ! function_exists( 'bws_plugin_banner_to_settings' ) ) {
[476] Fix | Delete
/**
[477] Fix | Delete
* Function settings for banner
[478] Fix | Delete
*
[479] Fix | Delete
* @param array $plugin_info Plugin info.
[480] Fix | Delete
* @param array $plugin_options_name Plugin option name.
[481] Fix | Delete
* @param array $banner_url_or_slug Url or slug for icon.
[482] Fix | Delete
* @param array $settings_url Url for settings.
[483] Fix | Delete
* @param array $post_type_url (Optional) Url for banner.
[484] Fix | Delete
* @return global array
[485] Fix | Delete
*/
[486] Fix | Delete
function bws_plugin_banner_to_settings( $plugin_info, $plugin_options_name, $banner_url_or_slug, $settings_url, $post_type_url = false ) {
[487] Fix | Delete
global $bws_plugin_banner_to_settings;
[488] Fix | Delete
[489] Fix | Delete
$is_network_admin = is_network_admin();
[490] Fix | Delete
[491] Fix | Delete
$plugin_options = $is_network_admin ? get_site_option( $plugin_options_name ) : get_option( $plugin_options_name );
[492] Fix | Delete
[493] Fix | Delete
if ( isset( $plugin_options['display_settings_notice'] ) && 0 === $plugin_options['display_settings_notice'] ) {
[494] Fix | Delete
return;
[495] Fix | Delete
}
[496] Fix | Delete
[497] Fix | Delete
if ( isset( $_POST[ 'bws_hide_settings_notice_' . $plugin_options_name ] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_settings_nonce_name' ) ) {
[498] Fix | Delete
$plugin_options['display_settings_notice'] = 0;
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function