diff -r be944660c56a -r 3d72ae0968f4 wp/wp-content/plugins/portfolio/bws_menu/class-bws-settings.php --- a/wp/wp-content/plugins/portfolio/bws_menu/class-bws-settings.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-content/plugins/portfolio/bws_menu/class-bws-settings.php Tue Sep 27 16:37:53 2022 +0200 @@ -1,6 +1,7 @@ '', - 'prefix' => '', - 'plugins_info' => array(), - 'default_options' => array(), - 'options' => array(), - 'is_network_options' => false, - 'tabs' => array(), - 'doc_link' => '', - 'doc_video_link' => '', - 'wp_slug' => '', - 'demo_data' => false, - /* if this is free version and pro exist */ - 'link_key' => '', - 'link_pn' => '', - 'trial_days' => false, - 'licenses' => array() - ) ); + $args = wp_parse_args( + $args, + array( + 'plugin_basename' => '', + 'prefix' => '', + 'plugins_info' => array(), + 'default_options' => array(), + 'options' => array(), + 'is_network_options' => false, + 'tabs' => array(), + 'doc_link' => '', + 'doc_video_link' => '', + 'wp_slug' => '', + 'demo_data' => false, + /* if this is free version and pro exist */ + 'link_key' => '', + 'link_pn' => '', + 'trial_days' => false, + 'licenses' => array(), + ) + ); $args['plugins_info']['Name'] = str_replace( ' by BestWebSoft', '', $args['plugins_info']['Name'] ); - $this->plugin_basename = $args['plugin_basename']; - $this->prefix = $args['prefix']; - $this->plugins_info = $args['plugins_info']; - $this->options = $args['options']; - $this->default_options = $args['default_options']; - $this->wp_slug = $args['wp_slug']; - $this->demo_data = $args['demo_data']; + $this->plugin_basename = $args['plugin_basename']; + $this->prefix = $args['prefix']; + $this->plugins_info = $args['plugins_info']; + $this->options = $args['options']; + $this->default_options = $args['default_options']; + $this->wp_slug = $args['wp_slug']; + $this->demo_data = $args['demo_data']; - $this->tabs = $args['tabs']; - $this->is_network_options = $args['is_network_options']; + $this->tabs = $args['tabs']; + $this->is_network_options = $args['is_network_options']; - $this->doc_link = $args['doc_link']; - $this->doc_video_link = $args['doc_video_link']; + $this->doc_link = $args['doc_link']; + $this->doc_video_link = $args['doc_video_link']; - $this->link_key = $args['link_key']; - $this->link_pn = $args['link_pn']; - $this->trial_days = $args['trial_days']; - $this->licenses = $args['licenses']; + $this->link_key = $args['link_key']; + $this->link_pn = $args['link_pn']; + $this->trial_days = $args['trial_days']; + $this->licenses = $args['licenses']; $this->pro_page = $this->bws_license_plugin = ''; /* get $bws_plugins */ - require( dirname( __FILE__ ) . '/product_list.php' ); + require dirname( __FILE__ ) . '/product_list.php'; if ( isset( $bws_plugins[ $this->plugin_basename ] ) ) { if ( isset( $bws_plugins[ $this->plugin_basename ]['pro_settings'] ) ) { - $this->pro_page = $bws_plugins[ $this->plugin_basename ]['pro_settings']; - $this->bws_license_plugin = $bws_plugins[ $this->plugin_basename ]['pro_version']; - } + $this->pro_page = $bws_plugins[ $this->plugin_basename ]['pro_settings']; + $this->bws_license_plugin = $bws_plugins[ $this->plugin_basename ]['pro_version']; + } - $this->bws_plugin_link = substr( $bws_plugins[ $this->plugin_basename ]['link'],0 , strpos( $bws_plugins[ $this->plugin_basename ]['link'], '?' ) ); + $this->bws_plugin_link = substr( $bws_plugins[ $this->plugin_basename ]['link'], 0, strpos( $bws_plugins[ $this->plugin_basename ]['link'], '?' ) ); - if ( ! empty( $this->link_key ) && ! empty( $this->link_pn ) ) - $this->bws_plugin_link .= '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version; + if ( ! empty( $this->link_key ) && ! empty( $this->link_pn ) ) { + $this->bws_plugin_link .= '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info['Version'] . '&wp_v=' . $wp_version; + } } $this->hide_pro_tabs = bws_hide_premium_options_check( $this->options ); - $this->version = '1.0.0'; - $this->is_multisite = is_multisite(); + $this->version = '1.0.0'; + $this->is_multisite = is_multisite(); if ( empty( $this->pro_page ) && array_key_exists( 'license', $this->tabs ) ) { - $this->is_pro = true; + $this->is_pro = true; $this->licenses[ $this->plugins_info['TextDomain'] ] = array( 'name' => $this->plugins_info['Name'], 'slug' => $this->plugins_info['TextDomain'], - 'basename' => $this->plugin_basename + 'basename' => $this->plugin_basename, ); } else { $this->licenses[ $this->plugins_info['TextDomain'] ] = array( - 'name' => $this->plugins_info['Name'], - 'slug' => $this->plugins_info['TextDomain'], - 'pro_slug' => substr( $this->bws_license_plugin, 0, stripos( $this->bws_license_plugin, '/' ) ), - 'basename' => $this->plugin_basename, - 'pro_basename' => $this->bws_license_plugin + 'name' => $this->plugins_info['Name'], + 'slug' => $this->plugins_info['TextDomain'], + 'pro_slug' => substr( $this->bws_license_plugin, 0, stripos( $this->bws_license_plugin, '/' ) ), + 'basename' => $this->plugin_basename, + 'pro_basename' => $this->bws_license_plugin, ); } } /** * Displays the content of the "Settings" on the plugin settings page + * * @access public * @param void * @return void @@ -155,34 +162,41 @@ $this->demo_data->bws_demo_confirm(); } else { bws_show_settings_notice(); ?> -