Skip to content

Commit

Permalink
add setting that hides red star
Browse files Browse the repository at this point in the history
fixes issue #19
  • Loading branch information
Piet Bos committed Oct 6, 2016
1 parent 7b0d457 commit 95a1e49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
13 changes: 11 additions & 2 deletions includes/class-so-clean-up-wp-seo-settings.php
Expand Up @@ -92,6 +92,7 @@ public function update_network_setting() {
'hide_wpseoanalysis',
'hide_trafficlight',
'hide_issue_counter',
'hide_gopremium_star',
'hide_content_keyword_score',
'hide_helpcenter',
'hide_admin_columns',
Expand Down Expand Up @@ -219,6 +220,13 @@ private function settings_fields () {
'type' => 'checkbox',
'default' => 'on'
),
array(
'id' => 'hide_gopremium_star',
'label' => __( 'Go Premium', 'so-clean-up-wp-seo' ),
'description' => __( 'The Yoast SEO plugin comes with a "Go Premium" sub menu with a red star (since Yoast SEO 3.6). This setting hides the red star.', 'so-clean-up-wp-seo' ),
'type' => 'checkbox',
'default' => 'on'
),
array(
'id' => 'hide_content_keyword_score',
'label' => __( 'Content/Keyword Score', 'so-clean-up-wp-seo' ),
Expand Down Expand Up @@ -380,10 +388,11 @@ public function settings_page () {
$html .= '</div>' . "\n"; // end .top

$html .= '<ul>' . "\n";
$html .= '<li><a href="https://so-wp.com/" target="_blank" title="SO WP">' . esc_attr( __('SO WP', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '<li><a href="https://wpti.ps/" target="_blank" title="WP TIPS">' . esc_attr( __('WP Tips', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '<li><a href="https://bohanintl.com/" target="_blank" title="BHI Consulting">' . esc_attr( __('BHI Consulting', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '<li><a href="https://www.linkedin.com/in/pietbos" target="_blank" title="LinkedIn profile">' . esc_attr( __( 'LinkedIn', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '<li><a href="https://so-wp.com/" target="_blank" title="SO WP">' . esc_attr( __('SO WP', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '<li><a href="https://github.com/senlin" title="on Github">' . esc_attr( __( 'Github', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '<li><a href="https://wpti.ps/" target="_blank" title="WP TIPS">' . esc_attr( __('WP Tips', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '<li><a href="https://profiles.wordpress.org/senlin/" title="on WordPress.org">' . esc_attr( __( 'WordPress.org Profile', 'so-clean-up-wp-seo' ) ) . '</a></li>' . "\n";
$html .= '</ul>' . "\n";

Expand Down
11 changes: 9 additions & 2 deletions includes/class-so-clean-up-wp-seo.php
Expand Up @@ -96,7 +96,7 @@ class CUWS {
*
* @return void
*/
public function __construct ( $file = '', $version = '2.3.0' ) {
public function __construct ( $file = '', $version = '2.5.0' ) {
$this->_version = $version;
$this->_token = 'cuws';

Expand Down Expand Up @@ -199,6 +199,11 @@ public function so_cuws_hide_visibility_css() {
echo '#wpadminbar .yoast-issue-counter,#toplevel_page_wpseo_dashboard .update-plugins .plugin-count{display:none;}'; // @since v2.3.0 hide issue counter from adminbar and plugin menu sidebar
}

// hide red star "Go Premium" submenu
if ( ! empty( $this->options['hide_gopremium_star'] ) ) {
echo '#adminmenu .wpseo-premium-indicator{display:none;}'; // @since v2.5.0 hide star of "Go Premium" submenu
}

// content analysis
if ( ! empty( $this->options['hide_wpseoanalysis'] ) ) {
echo '.wpseoanalysis{display:none;}.wpseo-score-icon{display:none!important;}'; // @since v2.0.0 hide_wpseoanalysis; @modified v2.3.0 to remove the colored ball from the metabox tab too.
Expand Down Expand Up @@ -294,7 +299,7 @@ function i18n() {
*
* @return CUWS $_instance
*/
public static function instance( $file = '', $version = '2.4.0' ) {
public static function instance( $file = '', $version = '2.5.0' ) {
if ( null === self::$_instance ) {
self::$_instance = new self( $file, $version );
}
Expand Down Expand Up @@ -357,6 +362,7 @@ private function _set_defaults() {
update_site_option( 'cuws_hide_addkw_button', 'on' );
update_site_option( 'cuws_hide_trafficlight', 'on' );
update_site_option( 'cuws_hide_issue_counter', 'on' );
update_site_option( 'cuws_hide_gopremium_star', 'on' );
update_site_option( 'cuws_hide_wpseoanalysis', 'on' );
update_site_option( 'cuws_hide_content_keyword_score', 'both' );
update_site_option( 'cuws_hide_helpcenter', 'ad' );
Expand All @@ -381,6 +387,7 @@ public function get_settings_as_array() {
'hide_trafficlight',
'hide_wpseoanalysis',
'hide_issue_counter',
'hide_gopremium_star',
'hide_content_keyword_score',
'hide_helpcenter',
'hide_admin_columns',
Expand Down

0 comments on commit 95a1e49

Please sign in to comment.