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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/portfoli.../bws_menu
File: bws_functions.php
if ( $is_network_admin ) {
[500] Fix | Delete
update_site_option( $plugin_options_name, $plugin_options );
[501] Fix | Delete
} else {
[502] Fix | Delete
update_option( $plugin_options_name, $plugin_options );
[503] Fix | Delete
}
[504] Fix | Delete
return;
[505] Fix | Delete
}
[506] Fix | Delete
[507] Fix | Delete
if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
[508] Fix | Delete
$banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
$bws_plugin_banner_to_settings[] = array(
[512] Fix | Delete
'plugin_info' => $plugin_info,
[513] Fix | Delete
'plugin_options_name' => $plugin_options_name,
[514] Fix | Delete
'banner_url' => $banner_url_or_slug,
[515] Fix | Delete
'settings_url' => $settings_url,
[516] Fix | Delete
'post_type_url' => $post_type_url,
[517] Fix | Delete
);
[518] Fix | Delete
}
[519] Fix | Delete
}
[520] Fix | Delete
[521] Fix | Delete
if ( ! function_exists( 'bws_plugin_suggest_feature_banner' ) ) {
[522] Fix | Delete
/**
[523] Fix | Delete
* Function display for feature banner
[524] Fix | Delete
*
[525] Fix | Delete
* @param array $plugin_info Plugin info.
[526] Fix | Delete
* @param array $plugin_options_name Plugin option name.
[527] Fix | Delete
* @param array $banner_url_or_slug Url or slug for icon.
[528] Fix | Delete
* @echo string
[529] Fix | Delete
*/
[530] Fix | Delete
function bws_plugin_suggest_feature_banner( $plugin_info, $plugin_options_name, $banner_url_or_slug ) {
[531] Fix | Delete
$is_network_admin = is_network_admin();
[532] Fix | Delete
[533] Fix | Delete
$plugin_options = $is_network_admin ? get_site_option( $plugin_options_name ) : get_option( $plugin_options_name );
[534] Fix | Delete
[535] Fix | Delete
if ( isset( $plugin_options['display_suggest_feature_banner'] ) && 0 === $plugin_options['display_suggest_feature_banner'] ) {
[536] Fix | Delete
return;
[537] Fix | Delete
}
[538] Fix | Delete
[539] Fix | Delete
if ( ! isset( $plugin_options['first_install'] ) ) {
[540] Fix | Delete
$plugin_options['first_install'] = strtotime( 'now' );
[541] Fix | Delete
$update_option = true;
[542] Fix | Delete
$return = true;
[543] Fix | Delete
} elseif ( strtotime( '-2 week' ) < $plugin_options['first_install'] ) {
[544] Fix | Delete
$return = true;
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
if ( ! isset( $plugin_options['go_settings_counter'] ) ) {
[548] Fix | Delete
$plugin_options['go_settings_counter'] = 1;
[549] Fix | Delete
$update_option = true;
[550] Fix | Delete
$return = true;
[551] Fix | Delete
} elseif ( 20 > $plugin_options['go_settings_counter'] ) {
[552] Fix | Delete
$plugin_options['go_settings_counter'] = $plugin_options['go_settings_counter'] + 1;
[553] Fix | Delete
$update_option = true;
[554] Fix | Delete
$return = true;
[555] Fix | Delete
}
[556] Fix | Delete
[557] Fix | Delete
if ( isset( $update_option ) ) {
[558] Fix | Delete
if ( $is_network_admin ) {
[559] Fix | Delete
update_site_option( $plugin_options_name, $plugin_options );
[560] Fix | Delete
} else {
[561] Fix | Delete
update_option( $plugin_options_name, $plugin_options );
[562] Fix | Delete
}
[563] Fix | Delete
}
[564] Fix | Delete
[565] Fix | Delete
if ( isset( $return ) ) {
[566] Fix | Delete
return;
[567] Fix | Delete
}
[568] Fix | Delete
[569] Fix | Delete
if ( isset( $_POST[ 'bws_hide_suggest_feature_banner_' . $plugin_options_name ] ) && check_admin_referer( $plugin_info['Name'], 'bws_settings_nonce_name' ) ) {
[570] Fix | Delete
$plugin_options['display_suggest_feature_banner'] = 0;
[571] Fix | Delete
if ( $is_network_admin ) {
[572] Fix | Delete
update_site_option( $plugin_options_name, $plugin_options );
[573] Fix | Delete
} else {
[574] Fix | Delete
update_option( $plugin_options_name, $plugin_options );
[575] Fix | Delete
}
[576] Fix | Delete
return;
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
[580] Fix | Delete
$banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
[581] Fix | Delete
}
[582] Fix | Delete
?>
[583] Fix | Delete
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
[584] Fix | Delete
<div class="bws_banner_on_plugin_page bws_suggest_feature_banner">
[585] Fix | Delete
<div class="icon">
[586] Fix | Delete
<img title="" src="<?php echo esc_url( $banner_url_or_slug ); ?>" alt="" />
[587] Fix | Delete
</div>
[588] Fix | Delete
<div class="text">
[589] Fix | Delete
<strong><?php printf( esc_html__( 'Thank you for choosing %s plugin!', 'bestwebsoft' ), esc_html( $plugin_info['Name'] ) ); ?></strong><br />
[590] Fix | Delete
<?php esc_html_e( "If you have a feature, suggestion or idea you'd like to see in the plugin, we'd love to hear about it!", 'bestwebsoft' ); ?>
[591] Fix | Delete
<a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/requests/new"><?php esc_html_e( 'Suggest a Feature', 'bestwebsoft' ); ?></a>
[592] Fix | Delete
</div>
[593] Fix | Delete
<form action="" method="post">
[594] Fix | Delete
<button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
[595] Fix | Delete
<input type="hidden" name="bws_hide_suggest_feature_banner_<?php echo esc_html( $plugin_options_name ); ?>" value="hide" />
[596] Fix | Delete
<?php wp_nonce_field( $plugin_info['Name'], 'bws_settings_nonce_name' ); ?>
[597] Fix | Delete
</form>
[598] Fix | Delete
</div>
[599] Fix | Delete
</div>
[600] Fix | Delete
<?php
[601] Fix | Delete
}
[602] Fix | Delete
}
[603] Fix | Delete
[604] Fix | Delete
if ( ! function_exists( 'bws_affiliate_postbox' ) ) {
[605] Fix | Delete
/**
[606] Fix | Delete
* Function display affiliate postbox
[607] Fix | Delete
*
[608] Fix | Delete
* @echo string
[609] Fix | Delete
*/
[610] Fix | Delete
function bws_affiliate_postbox() {
[611] Fix | Delete
[612] Fix | Delete
$dismissed = get_user_meta( get_current_user_id(), '_bws_affiliate_postbox_dismissed', true );
[613] Fix | Delete
[614] Fix | Delete
if ( ! empty( $dismissed ) && strtotime( '-3 month' ) < $dismissed ) {
[615] Fix | Delete
return;
[616] Fix | Delete
}
[617] Fix | Delete
[618] Fix | Delete
if ( isset( $_POST['bws_hide_affiliate_banner'] ) && check_admin_referer( 'bws_affiliate_postbox', 'bws_settings_nonce_name' ) ) {
[619] Fix | Delete
update_user_meta( get_current_user_id(), '_bws_affiliate_postbox_dismissed', strtotime( 'now' ) );
[620] Fix | Delete
return;
[621] Fix | Delete
}
[622] Fix | Delete
[623] Fix | Delete
$bws_link = esc_url( 'https://bestwebsoft.com/affiliate/?utm_source=plugin&utm_medium=settings&utm_campaign=affiliate_program' );
[624] Fix | Delete
?>
[625] Fix | Delete
<div id="bws-affiliate-postbox" class="postbox">
[626] Fix | Delete
<form action="" method="post">
[627] Fix | Delete
<button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
[628] Fix | Delete
<input type="hidden" name="bws_hide_affiliate_banner" value="hide" />
[629] Fix | Delete
<?php wp_nonce_field( 'bws_affiliate_postbox', 'bws_settings_nonce_name' ); ?>
[630] Fix | Delete
</form>
[631] Fix | Delete
<p>BESTWEBSOFT</p>
[632] Fix | Delete
<h3><?php esc_html_e( 'Affiliate Program', 'bestwebsoft' ); ?></h3>
[633] Fix | Delete
<div class="bws-affiliate-get"><?php printf( esc_html__( 'Get %s', 'bestwebsoft' ), '20%' ); ?></div>
[634] Fix | Delete
<div><?php esc_html_e( 'from each BestWebSoft plugin and theme sale you refer', 'bestwebsoft' ); ?></div>
[635] Fix | Delete
<div class="bws-row">
[636] Fix | Delete
<div class="bws-cell">
[637] Fix | Delete
<img src="<?php echo esc_url( bws_menu_url( 'images/join-icon.svg' ) ); ?>" alt="" />
[638] Fix | Delete
<div><?php esc_html_e( 'Join affiliate program', 'bestwebsoft' ); ?></div>
[639] Fix | Delete
</div>
[640] Fix | Delete
<div class="bws-cell">
[641] Fix | Delete
<img src="<?php echo esc_url( bws_menu_url( 'images/promote-icon.svg' ) ); ?>" alt="" />
[642] Fix | Delete
<div><?php esc_html_e( 'Promote and sell products', 'bestwebsoft' ); ?></div>
[643] Fix | Delete
</div>
[644] Fix | Delete
<div class="bws-cell">
[645] Fix | Delete
<img src="<?php echo esc_url( bws_menu_url( 'images/earn-icon.svg' ) ); ?>" alt="" />
[646] Fix | Delete
<div><?php esc_html_e( 'Get commission!', 'bestwebsoft' ); ?></div>
[647] Fix | Delete
</div>
[648] Fix | Delete
</div>
[649] Fix | Delete
<div class="clear"></div>
[650] Fix | Delete
<p>
[651] Fix | Delete
<a class="button" href="<?php echo esc_url( $bws_link ); ?>" target="_blank"><?php esc_html_e( 'Start Now', 'bestwebsoft' ); ?></a>
[652] Fix | Delete
</p>
[653] Fix | Delete
</div>
[654] Fix | Delete
<?php
[655] Fix | Delete
}
[656] Fix | Delete
}
[657] Fix | Delete
[658] Fix | Delete
if ( ! function_exists( 'bws_show_settings_notice' ) ) {
[659] Fix | Delete
/**
[660] Fix | Delete
* Function display settings notice
[661] Fix | Delete
*
[662] Fix | Delete
* @echo string
[663] Fix | Delete
*/
[664] Fix | Delete
function bws_show_settings_notice() {
[665] Fix | Delete
?>
[666] Fix | Delete
<div id="bws_save_settings_notice" class="updated fade below-h2" style="display:none;">
[667] Fix | Delete
<p>
[668] Fix | Delete
<strong><?php esc_html_e( 'Notice', 'bestwebsoft' ); ?></strong>: <?php esc_html_e( "The plugin's settings have been changed.", 'bestwebsoft' ); ?>
[669] Fix | Delete
<a class="bws_save_anchor" href="#bws-submit-button"><?php esc_html_e( 'Save Changes', 'bestwebsoft' ); ?></a>
[670] Fix | Delete
</p>
[671] Fix | Delete
</div>
[672] Fix | Delete
<?php
[673] Fix | Delete
}
[674] Fix | Delete
}
[675] Fix | Delete
[676] Fix | Delete
if ( ! function_exists( 'bws_hide_premium_options' ) ) {
[677] Fix | Delete
/**
[678] Fix | Delete
* Function for hide premium options
[679] Fix | Delete
*
[680] Fix | Delete
* @param array $options Plugin options.
[681] Fix | Delete
* @echo string
[682] Fix | Delete
*/
[683] Fix | Delete
function bws_hide_premium_options( $options ) {
[684] Fix | Delete
if ( ! isset( $options['hide_premium_options'] ) || ! is_array( $options['hide_premium_options'] ) ) {
[685] Fix | Delete
$options['hide_premium_options'] = array();
[686] Fix | Delete
}
[687] Fix | Delete
[688] Fix | Delete
$options['hide_premium_options'][] = get_current_user_id();
[689] Fix | Delete
[690] Fix | Delete
return array(
[691] Fix | Delete
'message' => esc_html__( 'You can always look at premium options by checking the "Pro Options" in the "Misc" tab.', 'bestwebsoft' ),
[692] Fix | Delete
'options' => $options,
[693] Fix | Delete
);
[694] Fix | Delete
}
[695] Fix | Delete
}
[696] Fix | Delete
[697] Fix | Delete
if ( ! function_exists( 'bws_hide_premium_options_check' ) ) {
[698] Fix | Delete
/**
[699] Fix | Delete
* Function for check checkbox for hide premium options
[700] Fix | Delete
*
[701] Fix | Delete
* @param array $options Plugin options.
[702] Fix | Delete
* @return bool
[703] Fix | Delete
*/
[704] Fix | Delete
function bws_hide_premium_options_check( $options ) {
[705] Fix | Delete
if ( ! empty( $options['hide_premium_options'] ) && in_array( get_current_user_id(), $options['hide_premium_options'] ) ) {
[706] Fix | Delete
return true;
[707] Fix | Delete
} else {
[708] Fix | Delete
return false;
[709] Fix | Delete
}
[710] Fix | Delete
}
[711] Fix | Delete
}
[712] Fix | Delete
[713] Fix | Delete
if ( ! function_exists( 'bws_plugins_admin_init' ) ) {
[714] Fix | Delete
/**
[715] Fix | Delete
* Function init fir dashboard
[716] Fix | Delete
*/
[717] Fix | Delete
function bws_plugins_admin_init() {
[718] Fix | Delete
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
[719] Fix | Delete
if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . sanitize_text_field( wp_unslash( $_GET['bws_activate_plugin'] ) ) ) ) {
[720] Fix | Delete
[721] Fix | Delete
$plugin = isset( $_GET['bws_activate_plugin'] ) ? sanitize_text_field( wp_unslash( $_GET['bws_activate_plugin'] ) ) : '';
[722] Fix | Delete
$result = activate_plugin( $plugin, '', is_network_admin() );
[723] Fix | Delete
if ( is_wp_error( $result ) ) {
[724] Fix | Delete
if ( 'unexpected_output' === $result->get_error_code() ) {
[725] Fix | Delete
$redirect = self_admin_url( 'admin.php?page=bws_panel&error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . $plugin );
[726] Fix | Delete
wp_safe_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );
[727] Fix | Delete
exit();
[728] Fix | Delete
} else {
[729] Fix | Delete
wp_die( esc_html( $result ) );
[730] Fix | Delete
}
[731] Fix | Delete
}
[732] Fix | Delete
[733] Fix | Delete
if ( ! is_network_admin() ) {
[734] Fix | Delete
$recent = (array) get_option( 'recently_activated' );
[735] Fix | Delete
unset( $recent[ $plugin ] );
[736] Fix | Delete
update_option( 'recently_activated', $recent );
[737] Fix | Delete
} else {
[738] Fix | Delete
$recent = (array) get_site_option( 'recently_activated' );
[739] Fix | Delete
unset( $recent[ $plugin ] );
[740] Fix | Delete
update_site_option( 'recently_activated', $recent );
[741] Fix | Delete
}
[742] Fix | Delete
/**
[743] Fix | Delete
* @deprecated 1.9.8 (15.12.2016)
[744] Fix | Delete
*/
[745] Fix | Delete
$is_main_page = in_array( $page, array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
[746] Fix | Delete
$tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
[747] Fix | Delete
[748] Fix | Delete
if ( $is_main_page ) {
[749] Fix | Delete
$current_page = 'admin.php?page=' . $page;
[750] Fix | Delete
} else {
[751] Fix | Delete
$current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page;
[752] Fix | Delete
}
[753] Fix | Delete
/*end deprecated */
[754] Fix | Delete
[755] Fix | Delete
wp_safe_redirect( self_admin_url( esc_url( $current_page . '&activate=true' ) ) );
[756] Fix | Delete
exit();
[757] Fix | Delete
}
[758] Fix | Delete
[759] Fix | Delete
if ( 'bws_panel' === $page || strpos( $page, '-bws-panel' ) ) {
[760] Fix | Delete
if ( ! session_id() ) {
[761] Fix | Delete
@session_start();
[762] Fix | Delete
}
[763] Fix | Delete
}
[764] Fix | Delete
[765] Fix | Delete
bws_add_editor_buttons();
[766] Fix | Delete
}
[767] Fix | Delete
}
[768] Fix | Delete
[769] Fix | Delete
if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
[770] Fix | Delete
/**
[771] Fix | Delete
* Function add scripts ans syles for dashboard
[772] Fix | Delete
*/
[773] Fix | Delete
function bws_admin_enqueue_scripts() {
[774] Fix | Delete
global $wp_scripts,
[775] Fix | Delete
$hook_suffix,
[776] Fix | Delete
$post_type,
[777] Fix | Delete
$bws_plugin_banner_go_pro, $bws_plugin_banner_timeout, $bstwbsftwppdtplgns_banner_array,
[778] Fix | Delete
$bws_shortcode_list,
[779] Fix | Delete
$wp_filesystem,
[780] Fix | Delete
$bws_plugins,
[781] Fix | Delete
$pagenow;
[782] Fix | Delete
[783] Fix | Delete
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
[784] Fix | Delete
[785] Fix | Delete
wp_enqueue_style( 'bws-admin-css', bws_menu_url( 'css/general_style.css' ), array(), '2.4.2' );
[786] Fix | Delete
wp_enqueue_script( 'bws-admin-scripts', bws_menu_url( 'js/general_script.js' ), array( 'jquery', 'jquery-ui-tooltip' ) );
[787] Fix | Delete
[788] Fix | Delete
$plugin_dir = explode( '/', plugin_basename( __FILE__ ) )[0];
[789] Fix | Delete
$plugin_file = array_keys( get_plugins( "/$plugin_dir" ) )[0];
[790] Fix | Delete
[791] Fix | Delete
$include_jquery_ui = false;
[792] Fix | Delete
if ( ! empty( $bws_plugins ) ) {
[793] Fix | Delete
$admin_page_free = $pagenow . '?page=' . str_replace( '-pro', '', $page );
[794] Fix | Delete
[795] Fix | Delete
foreach ( $bws_plugins as $bws_plugin ) {
[796] Fix | Delete
if ( $admin_page_free === $bws_plugin['settings'] ) {
[797] Fix | Delete
$include_jquery_ui = true;
[798] Fix | Delete
break;
[799] Fix | Delete
}
[800] Fix | Delete
}
[801] Fix | Delete
}
[802] Fix | Delete
[803] Fix | Delete
if ( in_array( $page, array( 'bws_panel', 'bws_themes', 'bws_system_status', $plugin_file ) ) || $include_jquery_ui || strpos( $page, '-bws-panel' ) ) {
[804] Fix | Delete
$jquery_ui_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
[805] Fix | Delete
WP_Filesystem();
[806] Fix | Delete
if ( ! $wp_filesystem->exists( dirname( __FILE__ ) . '/css/jquery-ui-styles/' . $jquery_ui_version . '/' ) ) {
[807] Fix | Delete
$jquery_ui_version = '1.12.1';
[808] Fix | Delete
}
[809] Fix | Delete
wp_enqueue_style( 'jquery-ui-style', bws_menu_url( 'css/jquery-ui-styles/' . $jquery_ui_version . '/jquery-ui.css', array(), $jquery_ui_version ) );
[810] Fix | Delete
wp_enqueue_style( 'bws_menu_style', bws_menu_url( 'css/style.css' ), array(), '2.4.2' );
[811] Fix | Delete
wp_enqueue_script( 'bws_menu_script', bws_menu_url( 'js/bws_menu.js' ), array(), '2.4.2', true );
[812] Fix | Delete
wp_enqueue_script( 'theme-install' );
[813] Fix | Delete
add_thickbox();
[814] Fix | Delete
wp_enqueue_script( 'plugin-install' );
[815] Fix | Delete
}
[816] Fix | Delete
[817] Fix | Delete
if ( 'plugins.php' === $hook_suffix ) {
[818] Fix | Delete
if ( ! empty( $bws_plugin_banner_go_pro ) || ! empty( $bws_plugin_banner_timeout ) ) {
[819] Fix | Delete
wp_enqueue_script( 'bws_menu_cookie', bws_menu_url( 'js/c_o_o_k_i_e.js' ) );
[820] Fix | Delete
[821] Fix | Delete
if ( ! empty( $bws_plugin_banner_go_pro ) ) {
[822] Fix | Delete
[823] Fix | Delete
foreach ( $bstwbsftwppdtplgns_banner_array as $value ) {
[824] Fix | Delete
if ( isset( $bws_plugin_banner_go_pro[ $value[0] ] ) && ! isset( $_COOKIE[ $value[0] ] ) ) {
[825] Fix | Delete
$prefix = $bws_plugin_banner_go_pro[ $value[0] ]['prefix'];
[826] Fix | Delete
[827] Fix | Delete
$script = "(function($) {
[828] Fix | Delete
$(document).ready( function() {
[829] Fix | Delete
var hide_message = $.cookie( '" . $prefix . "_hide_banner_on_plugin_page' );
[830] Fix | Delete
if ( hide_message === 'true' ) {
[831] Fix | Delete
$( '." . $prefix . "_message' ).css( 'display', 'none' );
[832] Fix | Delete
} else {
[833] Fix | Delete
$( '." . $prefix . "_message' ).css( 'display', 'block' );
[834] Fix | Delete
};
[835] Fix | Delete
$( '." . $prefix . "_close_icon' ).click( function() {
[836] Fix | Delete
$( '." . $prefix . "_message' ).css( 'display', 'none' );
[837] Fix | Delete
$.cookie( '" . $prefix . "_hide_banner_on_plugin_page', 'true', { expires: 32, secure: true } );
[838] Fix | Delete
});
[839] Fix | Delete
});
[840] Fix | Delete
})(jQuery);";
[841] Fix | Delete
[842] Fix | Delete
wp_register_script( $prefix . '_hide_banner_on_plugin_page', '' );
[843] Fix | Delete
wp_enqueue_script( $prefix . '_hide_banner_on_plugin_page' );
[844] Fix | Delete
wp_add_inline_script( $prefix . '_hide_banner_on_plugin_page', sprintf( $script ) );
[845] Fix | Delete
break;
[846] Fix | Delete
}
[847] Fix | Delete
}
[848] Fix | Delete
}
[849] Fix | Delete
[850] Fix | Delete
if ( ! empty( $bws_plugin_banner_timeout ) ) {
[851] Fix | Delete
$script = '(function($) {
[852] Fix | Delete
$(document).ready( function() {';
[853] Fix | Delete
[854] Fix | Delete
foreach ( $bws_plugin_banner_timeout as $banner_value ) {
[855] Fix | Delete
$script .= "var hide_message = $.cookie( '" . $banner_value['prefix'] . "_timeout_hide_banner_on_plugin_page' );
[856] Fix | Delete
if ( hide_message === 'true' ) {
[857] Fix | Delete
$( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'none' );
[858] Fix | Delete
} else {
[859] Fix | Delete
$( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'block' );
[860] Fix | Delete
}
[861] Fix | Delete
$( '." . $banner_value['prefix'] . "_close_icon' ).click( function() {
[862] Fix | Delete
$( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'none' );
[863] Fix | Delete
$.cookie( '" . $banner_value['prefix'] . "_timeout_hide_banner_on_plugin_page', 'true', { expires: 30, secure: true } );
[864] Fix | Delete
});";
[865] Fix | Delete
}
[866] Fix | Delete
[867] Fix | Delete
$script .= '});
[868] Fix | Delete
})(jQuery);';
[869] Fix | Delete
[870] Fix | Delete
wp_register_script( 'plugin_banner_timeout_hide', '' );
[871] Fix | Delete
wp_enqueue_script( 'plugin_banner_timeout_hide' );
[872] Fix | Delete
wp_add_inline_script( 'plugin_banner_timeout_hide', sprintf( $script ) );
[873] Fix | Delete
}
[874] Fix | Delete
}
[875] Fix | Delete
[876] Fix | Delete
if ( ! defined( 'DOING_AJAX' ) ) {
[877] Fix | Delete
wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ) );
[878] Fix | Delete
[879] Fix | Delete
bws_add_deactivation_feedback_dialog_box();
[880] Fix | Delete
}
[881] Fix | Delete
}
[882] Fix | Delete
[883] Fix | Delete
if ( 'multilanguage-languages.php' === $page ) {
[884] Fix | Delete
wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ) );
[885] Fix | Delete
}
[886] Fix | Delete
[887] Fix | Delete
if ( ! empty( $bws_shortcode_list ) ) {
[888] Fix | Delete
/* TinyMCE Shortcode Plugin */
[889] Fix | Delete
$script = "var bws_shortcode_button = {
[890] Fix | Delete
'label': '" . esc_attr__( 'Add BWS Shortcode', 'bestwebsoft' ) . "',
[891] Fix | Delete
'title': '" . esc_attr__( 'Add BWS Plugins Shortcode', 'bestwebsoft' ) . "',
[892] Fix | Delete
'function_name': [";
[893] Fix | Delete
foreach ( $bws_shortcode_list as $value ) {
[894] Fix | Delete
if ( isset( $value['js_function'] ) ) {
[895] Fix | Delete
$script .= "'" . $value['js_function'] . "',";
[896] Fix | Delete
}
[897] Fix | Delete
}
[898] Fix | Delete
$script .= ']
[899] Fix | Delete
};';
[900] Fix | Delete
wp_register_script( 'bws_shortcode_button', '' );
[901] Fix | Delete
wp_enqueue_script( 'bws_shortcode_button' );
[902] Fix | Delete
wp_add_inline_script( 'bws_shortcode_button', sprintf( $script ) );
[903] Fix | Delete
[904] Fix | Delete
/* TinyMCE Shortcode Plugin */
[905] Fix | Delete
if ( isset( $post_type ) && in_array( $post_type, array( 'post', 'page' ) ) ) {
[906] Fix | Delete
$tooltip_args = array(
[907] Fix | Delete
'tooltip_id' => 'bws_shortcode_button_tooltip',
[908] Fix | Delete
'css_selector' => '.mce-bws_shortcode_button',
[909] Fix | Delete
'actions' => array(
[910] Fix | Delete
'click' => false,
[911] Fix | Delete
'onload' => true,
[912] Fix | Delete
),
[913] Fix | Delete
'content' => '<h3>' . esc_html__( 'Add shortcode', 'bestwebsoft' ) . '</h3><p>' . esc_html__( "Add BestWebSoft plugins' shortcodes using this button.", 'bestwebsoft' ) . '</p>',
[914] Fix | Delete
'position' => array(
[915] Fix | Delete
'edge' => 'right',
[916] Fix | Delete
),
[917] Fix | Delete
'set_timeout' => 2000,
[918] Fix | Delete
);
[919] Fix | Delete
bws_add_tooltip_in_admin( $tooltip_args );
[920] Fix | Delete
}
[921] Fix | Delete
}
[922] Fix | Delete
}
[923] Fix | Delete
}
[924] Fix | Delete
[925] Fix | Delete
if ( ! function_exists( 'bws_enqueue_settings_scripts' ) ) {
[926] Fix | Delete
/**
[927] Fix | Delete
* Add styles and scripts for Bws_Settings_Tabs
[928] Fix | Delete
*
[929] Fix | Delete
* @since 1.9.8
[930] Fix | Delete
*/
[931] Fix | Delete
function bws_enqueue_settings_scripts() {
[932] Fix | Delete
wp_enqueue_script( 'jquery-ui-resizable' );
[933] Fix | Delete
wp_enqueue_script( 'jquery-ui-tabs' );
[934] Fix | Delete
wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ), array(), '2.4.2' );
[935] Fix | Delete
}
[936] Fix | Delete
}
[937] Fix | Delete
[938] Fix | Delete
if ( ! function_exists( 'bws_plugins_admin_head' ) ) {
[939] Fix | Delete
/**
[940] Fix | Delete
* Function add syles into admin head
[941] Fix | Delete
*
[942] Fix | Delete
* @since 1.9.8
[943] Fix | Delete
*/
[944] Fix | Delete
function bws_plugins_admin_head() {
[945] Fix | Delete
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
[946] Fix | Delete
[947] Fix | Delete
if ( 'bws_panel' === $page ) {
[948] Fix | Delete
?>
[949] Fix | Delete
<noscript>
[950] Fix | Delete
<style type="text/css">
[951] Fix | Delete
.bws_product_button {
[952] Fix | Delete
display: inline-block;
[953] Fix | Delete
}
[954] Fix | Delete
</style>
[955] Fix | Delete
</noscript>
[956] Fix | Delete
<?php
[957] Fix | Delete
}
[958] Fix | Delete
}
[959] Fix | Delete
}
[960] Fix | Delete
[961] Fix | Delete
if ( ! function_exists( 'bws_plugins_admin_footer' ) ) {
[962] Fix | Delete
/**
[963] Fix | Delete
* Function add syles into admin footer
[964] Fix | Delete
*
[965] Fix | Delete
* @since 1.9.8
[966] Fix | Delete
*/
[967] Fix | Delete
function bws_plugins_admin_footer() {
[968] Fix | Delete
$screen = get_current_screen();
[969] Fix | Delete
if ( 'edit' === $screen->parent_base ) {
[970] Fix | Delete
bws_shortcode_media_button_popup();
[971] Fix | Delete
}
[972] Fix | Delete
}
[973] Fix | Delete
}
[974] Fix | Delete
[975] Fix | Delete
if ( ! function_exists( 'bws_plugins_include_codemirror' ) ) {
[976] Fix | Delete
/**
[977] Fix | Delete
* Function add style and scripts for older version
[978] Fix | Delete
*
[979] Fix | Delete
* @since 1.9.8
[980] Fix | Delete
*/
[981] Fix | Delete
function bws_plugins_include_codemirror() {
[982] Fix | Delete
global $wp_version;
[983] Fix | Delete
if ( version_compare( $wp_version, '4.9.0', '>=' ) ) {
[984] Fix | Delete
wp_enqueue_style( 'wp-codemirror' );
[985] Fix | Delete
wp_enqueue_script( 'wp-codemirror' );
[986] Fix | Delete
}
[987] Fix | Delete
}
[988] Fix | Delete
}
[989] Fix | Delete
[990] Fix | Delete
if ( ! function_exists( 'bws_add_tooltip_in_admin' ) ) {
[991] Fix | Delete
/**
[992] Fix | Delete
* Tooltip block
[993] Fix | Delete
*
[994] Fix | Delete
* @param array $tooltip_args Args for tooltip.
[995] Fix | Delete
*/
[996] Fix | Delete
function bws_add_tooltip_in_admin( $tooltip_args = array() ) {
[997] Fix | Delete
new BWS_Admin_Tooltip( $tooltip_args );
[998] Fix | Delete
}
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function