diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-content/plugins/portfolio/bws_menu/bws_functions.php
--- a/wp/wp-content/plugins/portfolio/bws_menu/bws_functions.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-content/plugins/portfolio/bws_menu/bws_functions.php Fri Sep 05 18:40:08 2025 +0200
@@ -1,10 +1,14 @@
@@ -132,12 +144,15 @@
}
}
-/**
- * Function display license notification
- *
- * @echo string
- */
if ( ! function_exists( 'bws_plugin_update_row' ) ) {
+ /**
+ * Function display license notification
+ *
+ * @param string $plugin_key Plugin key.
+ * @param string $link_slug (Optional) Link slug.
+ * @param string $free_plugin_name (Optional) Free version plugin name.
+ * @echo string
+ */
function bws_plugin_update_row( $plugin_key, $link_slug = false, $free_plugin_name = false ) {
global $bstwbsftwppdtplgns_options, $wp_version;
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
@@ -210,12 +225,12 @@
}
}
-/**
- * Function display admin notices
- *
- * @echo string
- */
if ( ! function_exists( 'bws_admin_notices' ) ) {
+ /**
+ * Function display admin notices
+ *
+ * @echo string
+ */
function bws_admin_notices() {
global $bws_versions_notice_array, $bws_plugin_banner_to_settings, $bstwbsftwppdtplgns_options, $bws_plugin_banner_go_pro, $bstwbsftwppdtplgns_banner_array, $bws_plugin_banner_timeout;
@@ -264,7 +279,7 @@
-
' . esc_html__( $banner_value['plugin_name'] ) . '', esc_html__( $bstwbsftwppdtplgns_options['time_out'][ $banner_value['plugin_key'] ] ) ); ?>
+
' . esc_html( $banner_value['plugin_name'] ) . '', esc_html( $bstwbsftwppdtplgns_options['time_out'][ $banner_value['plugin_key'] ] ) ); ?>
%s %s WordPress %s %s',
- esc_html__( $value['name'] ),
+ esc_html( $value['name'] ),
esc_html__( 'requires', 'bestwebsoft' ),
- esc_html__( $value['version'] ),
+ esc_html( $value['version'] ),
esc_html__( 'or higher! We do not guarantee that our plugin will work correctly. Please upgrade to WordPress latest version.', 'bestwebsoft' )
);
?>
@@ -389,12 +404,19 @@
}
}
-/**
- * Function display banner
- *
- * @return array
- */
if ( ! function_exists( 'bws_plugin_banner_go_pro' ) ) {
+ /**
+ * Function display banner
+ *
+ * @param array $plugin_options Plugin options array.
+ * @param array $plugin_info Plugin info array.
+ * @param string $this_banner_prefix Banner prefix.
+ * @param string $bws_link_slug Slug for link.
+ * @param string $link_key Key for plugin.
+ * @param string $link_pn PN for plugin.
+ * @param string $banner_url_or_slug Url or slug for icon.
+ * @return array
+ */
function bws_plugin_banner_go_pro( $plugin_options, $plugin_info, $this_banner_prefix, $bws_link_slug, $link_key, $link_pn, $banner_url_or_slug ) {
global $bws_plugin_banner_go_pro, $wp_version, $bstwbsftwppdtplgns_banner_array;
@@ -424,12 +446,15 @@
}
}
-/**
- * Function update banner params
- *
- * @return global array
- */
if ( ! function_exists( 'bws_add_plugin_banner_timeout' ) ) {
+ /**
+ * Function update banner params
+ *
+ * @param string $plugin_key Plugin key.
+ * @param string $plugin_prefix Plugin prefix.
+ * @param string $plugin_name Plugin name.
+ * @param string $banner_url_or_slug Url or slug for icon.
+ */
function bws_add_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $banner_url_or_slug ) {
global $bws_plugin_banner_timeout;
@@ -449,12 +474,17 @@
}
}
-/**
- * Function settings for banner
- *
- * @return global array
- */
if ( ! function_exists( 'bws_plugin_banner_to_settings' ) ) {
+ /**
+ * Function settings for banner
+ *
+ * @param array $plugin_info Plugin info.
+ * @param array $plugin_options_name Plugin option name.
+ * @param array $banner_url_or_slug Url or slug for icon.
+ * @param array $settings_url Url for settings.
+ * @param array $post_type_url (Optional) Url for banner.
+ * @return global array
+ */
function bws_plugin_banner_to_settings( $plugin_info, $plugin_options_name, $banner_url_or_slug, $settings_url, $post_type_url = false ) {
global $bws_plugin_banner_to_settings;
@@ -490,12 +520,15 @@
}
}
-/**
- * Function display for feature banner
- *
- * @echo string
- */
if ( ! function_exists( 'bws_plugin_suggest_feature_banner' ) ) {
+ /**
+ * Function display for feature banner
+ *
+ * @param array $plugin_info Plugin info.
+ * @param array $plugin_options_name Plugin option name.
+ * @param array $banner_url_or_slug Url or slug for icon.
+ * @echo string
+ */
function bws_plugin_suggest_feature_banner( $plugin_info, $plugin_options_name, $banner_url_or_slug ) {
$is_network_admin = is_network_admin();
@@ -507,17 +540,20 @@
if ( ! isset( $plugin_options['first_install'] ) ) {
$plugin_options['first_install'] = strtotime( 'now' );
- $update_option = $return = true;
+ $update_option = true;
+ $return = true;
} elseif ( strtotime( '-2 week' ) < $plugin_options['first_install'] ) {
$return = true;
}
if ( ! isset( $plugin_options['go_settings_counter'] ) ) {
$plugin_options['go_settings_counter'] = 1;
- $update_option = $return = true;
+ $update_option = true;
+ $return = true;
} elseif ( 20 > $plugin_options['go_settings_counter'] ) {
$plugin_options['go_settings_counter'] = $plugin_options['go_settings_counter'] + 1;
- $update_option = $return = true;
+ $update_option = true;
+ $return = true;
}
if ( isset( $update_option ) ) {
@@ -567,12 +603,12 @@
}
}
-/**
- * Function display affiliate postbox
- *
- * @echo string
- */
if ( ! function_exists( 'bws_affiliate_postbox' ) ) {
+ /**
+ * Function display affiliate postbox
+ *
+ * @echo string
+ */
function bws_affiliate_postbox() {
$dismissed = get_user_meta( get_current_user_id(), '_bws_affiliate_postbox_dismissed', true );
@@ -621,12 +657,12 @@
}
}
-/**
- * Function display settings notice
- *
- * @echo string
- */
if ( ! function_exists( 'bws_show_settings_notice' ) ) {
+ /**
+ * Function display settings notice
+ *
+ * @echo string
+ */
function bws_show_settings_notice() {
?>
@@ -639,12 +675,13 @@
}
}
-/**
- * Function for hide premium options
- *
- * @echo string
- */
if ( ! function_exists( 'bws_hide_premium_options' ) ) {
+ /**
+ * Function for hide premium options
+ *
+ * @param array $options Plugin options.
+ * @echo string
+ */
function bws_hide_premium_options( $options ) {
if ( ! isset( $options['hide_premium_options'] ) || ! is_array( $options['hide_premium_options'] ) ) {
$options['hide_premium_options'] = array();
@@ -659,12 +696,13 @@
}
}
-/**
- * Function for check checkbox for hide premium options
- *
- * @return bool
- */
if ( ! function_exists( 'bws_hide_premium_options_check' ) ) {
+ /**
+ * Function for check checkbox for hide premium options
+ *
+ * @param array $options Plugin options.
+ * @return bool
+ */
function bws_hide_premium_options_check( $options ) {
if ( ! empty( $options['hide_premium_options'] ) && in_array( get_current_user_id(), $options['hide_premium_options'] ) ) {
return true;
@@ -674,10 +712,10 @@
}
}
-/**
- * Function init fir dashboard
- */
if ( ! function_exists( 'bws_plugins_admin_init' ) ) {
+ /**
+ * Function init fir dashboard
+ */
function bws_plugins_admin_init() {
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . sanitize_text_field( wp_unslash( $_GET['bws_activate_plugin'] ) ) ) ) {
@@ -730,31 +768,47 @@
}
}
-/**
- * Function add scripts ans syles for dashboard
- */
if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
+ /**
+ * Function add scripts ans syles for dashboard
+ */
function bws_admin_enqueue_scripts() {
- global $wp_scripts, $hook_suffix,
+ global $wp_scripts,
+ $hook_suffix,
$post_type,
$bws_plugin_banner_go_pro, $bws_plugin_banner_timeout, $bstwbsftwppdtplgns_banner_array,
$bws_shortcode_list,
- $wp_filesystem;
+ $wp_filesystem,
+ $bws_plugins,
+ $pagenow;
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
- $jquery_ui_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
- WP_Filesystem();
- if ( ! $wp_filesystem->exists( dirname( __FILE__ ) . '/css/jquery-ui-styles/' . $jquery_ui_version . '/' ) ) {
- $jquery_ui_version = '1.12.1';
- }
- if ( 'et_divi_options' !== $page ) {
- wp_enqueue_style( 'jquery-ui-style', bws_menu_url( 'css/jquery-ui-styles/' . $jquery_ui_version . '/jquery-ui.css', array(), $jquery_ui_version ) );
- }
wp_enqueue_style( 'bws-admin-css', bws_menu_url( 'css/general_style.css' ), array(), '2.4.2' );
wp_enqueue_script( 'bws-admin-scripts', bws_menu_url( 'js/general_script.js' ), array( 'jquery', 'jquery-ui-tooltip' ) );
- if ( in_array( $page, array( 'bws_panel', 'bws_themes', 'bws_system_status' ) ) || strpos( $page, '-bws-panel' ) ) {
+ $plugin_dir = explode( '/', plugin_basename( __FILE__ ) )[0];
+ $plugin_file = array_keys( get_plugins( "/$plugin_dir" ) )[0];
+
+ $include_jquery_ui = false;
+ if ( ! empty( $bws_plugins ) ) {
+ $admin_page_free = $pagenow . '?page=' . str_replace( '-pro', '', $page );
+
+ foreach ( $bws_plugins as $bws_plugin ) {
+ if ( $admin_page_free === $bws_plugin['settings'] ) {
+ $include_jquery_ui = true;
+ break;
+ }
+ }
+ }
+
+ if ( in_array( $page, array( 'bws_panel', 'bws_themes', 'bws_system_status', $plugin_file ) ) || $include_jquery_ui || strpos( $page, '-bws-panel' ) ) {
+ $jquery_ui_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
+ WP_Filesystem();
+ if ( ! $wp_filesystem->exists( dirname( __FILE__ ) . '/css/jquery-ui-styles/' . $jquery_ui_version . '/' ) ) {
+ $jquery_ui_version = '1.12.1';
+ }
+ wp_enqueue_style( 'jquery-ui-style', bws_menu_url( 'css/jquery-ui-styles/' . $jquery_ui_version . '/jquery-ui.css', array(), $jquery_ui_version ) );
wp_enqueue_style( 'bws_menu_style', bws_menu_url( 'css/style.css' ), array(), '2.4.2' );
wp_enqueue_script( 'bws_menu_script', bws_menu_url( 'js/bws_menu.js' ), array(), '2.4.2', true );
wp_enqueue_script( 'theme-install' );
@@ -828,6 +882,10 @@
}
}
+ if ( 'multilanguage-languages.php' === $page ) {
+ wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ) );
+ }
+
if ( ! empty( $bws_shortcode_list ) ) {
/* TinyMCE Shortcode Plugin */
$script = "var bws_shortcode_button = {
@@ -866,12 +924,12 @@
}
}
-/**
-* add styles and scripts for Bws_Settings_Tabs
-*
-* @since 1.9.8
-*/
if ( ! function_exists( 'bws_enqueue_settings_scripts' ) ) {
+ /**
+ * Add styles and scripts for Bws_Settings_Tabs
+ *
+ * @since 1.9.8
+ */
function bws_enqueue_settings_scripts() {
wp_enqueue_script( 'jquery-ui-resizable' );
wp_enqueue_script( 'jquery-ui-tabs' );
@@ -879,16 +937,16 @@
}
}
-/**
- * Function add syles into admin head
- *
- * @since 1.9.8
- */
if ( ! function_exists( 'bws_plugins_admin_head' ) ) {
+ /**
+ * Function add syles into admin head
+ *
+ * @since 1.9.8
+ */
function bws_plugins_admin_head() {
$page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
- if ( $page === 'bws_panel' ) {
+ if ( 'bws_panel' === $page ) {
?>