diff --git a/class-ti-about-page.php b/class-ti-about-page.php index 37be5fb..eb52892 100644 --- a/class-ti-about-page.php +++ b/class-ti-about-page.php @@ -54,9 +54,10 @@ private function setup_config() { $theme = wp_get_theme(); - $this->theme_args['name'] = $theme->__get( 'Name' ); + $this->theme_args['name'] = apply_filters( 'ti_wl_theme_name', $theme->__get( 'Name' ) ); + $this->theme_args['template'] = $theme->get('Template'); $this->theme_args['version'] = $theme->__get( 'Version' ); - $this->theme_args['description'] = $theme->__get( 'Description' ); + $this->theme_args['description'] = apply_filters( 'ti_wl_theme_description', $theme->__get( 'Description' ) ); $this->theme_args['slug'] = $theme->__get( 'stylesheet' ); } @@ -86,12 +87,15 @@ public function setup_actions() { * Based on visibility flag the plugin should be shown/hidden in recommended_plugins tab */ public function set_recommended_plugins_visibility() { + $recommended_plugins = get_option('ti_about_recommended_plugins'); + if( !empty($recommended_plugins) ){ + return; + } $required_plugins = $this->get_recommended_plugins(); $required_plugins_visbility = array(); foreach ( $required_plugins as $slug => $req_plugin ) { $required_plugins_visbility[ $slug ] = 'visible'; } - update_option( 'ti_about_recommended_plugins', $required_plugins_visbility ); } @@ -131,11 +135,12 @@ public function register() { $menu_name .= '' . esc_html( $required_actions ) . ''; } + $theme_page = !empty( $theme['template'] ) ? $theme['template'] . '-welcome' : $theme['slug'] . '-welcome'; add_theme_page( $page_title, $menu_name, 'activate_plugins', - $theme['slug'] . '-welcome', + $theme_page, array( $this, 'render', @@ -182,12 +187,12 @@ public function render() { */ public function enqueue() { $screen = get_current_screen(); - if ( ! isset( $screen->id ) ) { return; } - - if ( $screen->id !== 'appearance_page_' . $this->theme_args['slug'] . '-welcome' ) { + $theme = $this->theme_args; + $theme_page = !empty( $theme['template'] ) ? $theme['template'] . '-welcome' : $theme['slug'] . '-welcome'; + if ( $screen->id !== 'appearance_page_' . $theme_page ) { return; } @@ -210,6 +215,7 @@ public function enqueue() { array( 'nr_actions_required' => $this->get_recommended_actions_left(), 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce('ti-about-nonce'), 'template_directory' => get_template_directory_uri(), 'activating_string' => esc_html__( 'Activating', 'textdomain' ), ) @@ -223,7 +229,10 @@ public function enqueue() { * Update recommended plugins visibility flag if the user dismiss one of them */ public function update_recommended_plugins_visibility() { - + $nonce = $_POST['nonce']; + if ( ! wp_verify_nonce( $nonce, 'ti-about-nonce' ) ) { + return; + } $recommended_plugins = get_option( 'ti_about_recommended_plugins' ); $plugin_to_update = $_POST['slug']; diff --git a/composer.json b/composer.json index 1996d87..8f2600f 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "codeinwp/ti-about-page", "description": "The theme about page for themeisle themes.", - "version": "1.0.1", + "version": "1.0.2", "type": "library", "license": "GPL-3.0-or-later", "minimum-stability": "dev", diff --git a/css/style.css b/css/style.css index b973817..f539ec4 100644 --- a/css/style.css +++ b/css/style.css @@ -17,6 +17,10 @@ overflow: hidden; } +.about-wrap #about-tabs { + display: none; +} + .about-col i.dashicons { position: relative; top: 5px; @@ -452,6 +456,7 @@ border-bottom: 1px solid #eeeeee; padding: 8px 12px; display: inline-table; + margin: 0 0 1.33em; } .about-footer-col .inside{ diff --git a/includes/class-ti-about-render.php b/includes/class-ti-about-render.php index 277ed6f..90d0cc9 100644 --- a/includes/class-ti-about-render.php +++ b/includes/class-ti-about-render.php @@ -75,7 +75,14 @@ private function render_header() {

Welcome to theme['name'] ); ?>! - Version theme['version'] ); ?>

- + + + +