diff -r bf1778c34b9a -r d8a8807227e4 wp/wp-content/plugins/portfolio/bws_menu/class-bws-settings.php --- a/wp/wp-content/plugins/portfolio/bws_menu/class-bws-settings.php Mon Oct 14 18:35:50 2019 +0200 +++ b/wp/wp-content/plugins/portfolio/bws_menu/class-bws-settings.php Tue Oct 15 11:56:20 2019 +0200 @@ -14,10 +14,10 @@ public $plugin_basename; public $prefix; public $wp_slug; - + public $options; public $default_options; - public $is_network_options; + public $is_network_options; public $plugins_info = array(); public $hide_pro_tabs = false; public $demo_data; @@ -28,8 +28,9 @@ public $link_key; public $link_pn; public $is_trial = false; + public $licenses; public $trial_days; - public $bws_hide_pro_option_exist = true; + public $bws_hide_pro_option_exist = true; public $forbid_view = false; public $change_permission_attr = ''; @@ -48,35 +49,36 @@ * The child class should call this constructor from its own constructor to override * the default $args. * @access public - * + * * @param array|string $args */ public function __construct( $args = array() ) { $args = wp_parse_args( $args, array( 'plugin_basename' => '', 'prefix' => '', - 'plugins_info' => array(), + 'plugins_info' => array(), 'default_options' => array(), 'options' => array(), 'is_network_options' => false, 'tabs' => array(), - 'doc_link' => '', - 'doc_video_link' => '', - 'wp_slug' => '', - 'demo_data' => false, + 'doc_link' => '', + 'doc_video_link' => '', + 'wp_slug' => '', + 'demo_data' => false, /* if this is free version and pro exist */ - 'pro_page' => '', - 'bws_license_plugin'=> '', - 'link_key' => '', - 'link_pn' => '', - 'trial_days' => false + 'pro_page' => '', + 'bws_license_plugin' => '', + '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->plugins_info = $args['plugins_info']; $this->options = $args['options']; $this->default_options = $args['default_options']; $this->wp_slug = $args['wp_slug']; @@ -93,13 +95,28 @@ $this->link_key = $args['link_key']; $this->link_pn = $args['link_pn']; $this->trial_days = $args['trial_days']; + $this->licenses = $args['licenses']; $this->hide_pro_tabs = bws_hide_premium_options_check( $this->options ); $this->version = '1.0.0'; $this->is_multisite = is_multisite(); - if ( empty( $this->pro_page ) && array_key_exists( 'license', $this->tabs ) ) + if ( empty( $this->pro_page ) && array_key_exists( 'license', $this->tabs ) ) { $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 + ); + } else { + $this->licenses[ $this->plugins_info['TextDomain'] ] = array( + 'name' => $this->plugins_info['Name'], + 'slug' => $this->plugins_info['TextDomain'], + 'pro_slug' => stristr( $this->bws_license_plugin, '/', TRUE ), + 'basename' => $this->plugin_basename, + 'pro_basename' => $this->bws_license_plugin + ); + } } /** @@ -124,20 +141,20 @@ $this->demo_data->bws_demo_confirm(); } else { bws_show_settings_notice(); ?> -