diff --git a/README.md b/README.md
index 8b77c89..998093f 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,12 @@
[![plugin version](https://img.shields.io/wordpress/plugin/v/so-clean-up-wp-seo.svg)](https://wordpress.org/plugins/so-clean-up-wp-seo)
-###### Last updated on 2015.12.26
+###### Last updated on 2016.02.04
###### requires at least WordPress 4.0
-###### tested up to WordPress 4.4.1
+###### tested up to WordPress 4.4.2
###### Author: [Piet Bos](https://github.com/senlin)
-Hide most of the bloat that the Yoast SEO plugin adds to your WordPress Dashboard
+Hide most of the bloat that the Yoast SEO plugin adds to your WordPress Dashboard, now with Settings Page!
## Description
@@ -15,35 +15,64 @@ Almost anyone that uses Yoast SEO by Team Yoast will agree that it is a great SE
The purpose of the SO Hide SEO Bloat plugin is to clean up all those unwanted things.
-As per the current release, the plugin removes and/or disables the following unwanted items:
+Since v2.0.0 (released on February 4, 2016) we have a Settings page!
-* removes sidebar ads on all Yoast SEO settings pages
-* removes the Yoast SEO settings from the Admin Bar
-* removes updated nag
-* sets plugin-intro-tour user_meta to true (means done)
-* removes the keyword/description columns on edit Posts/Pages pages
-* removes the overview dashboard widget that was introduced in version 2.3 of the Yoast SEO plugin
-* remove GSC (Google Search Console) nag that was introduced in Yoast SEO 2.3.3
-* remove yst_opengraph_image_warning nag that was added to Yoast SEO 2.1, but we never noticed it before. In the changelog it has been described as "validation error", which of course is nonsense, because the world is larger than social media. The nag manifests itself by placing thick red borders around your Featured Image as well as a red-bordered warning message when your Featured Image is smaller than 200x200 pixels.
-* remove + icon from new Edit screen UI as it serves only to show an ad for the premium version of Yoast SEO
-* remove wpseo-score traffic light next to Move to trash on Edit Post/Page screen
-* remove SEO score algorithm recalculate nag
+The purpose of the settings page is that you can fine-tune what is hidden or removed to your liking. By default most of the bloat that the Yoast SEO plugin generates is hidden or removed, just like before when there were no settings yet.
+
+It is a good idea to have a look at the Settings page if only to see what you can fine-tune. The link to the page has been added to the Yoast SEO menu and of course there is also a link to it from the Plugins page.
+
+The default settings of the current release are as follows:
-If you like the SO Hide SEO Bloat plugin, please consider leaving a [review](https://wordpress.org/support/view/plugin-reviews/so-clean-up-wp-seo?rate=5#postform).
+* hide the cartoon-style sidebar ads on almost all settings pages of the Yoast SEO plugin
+* hide about nag that shows on every update of the plugin
+* hide recalculate nag that alerts user that SEO score algorithm has been updated
+* hide tagline nag that shows when your site uses the default WordPress tagline
+* hide robots nag that shows when your site is blocking access to robots, for example on dev and staging sites; it also hides the warning in the advanced tab of Yoast SEO UI in edit Post/Page screen
+* hide Google Search Console nag that warns about not missing any crawl errors by connecting the Yoast SEO plugin to it
+* hide image warning nag that shows in edit Post/Page screen when featured image is smaller than 200x200 pixels
+* hide add keyword button that shows in edit Post/Page and only serves to show an ad for the premium version
+* hide seoscore traffic light in publish/update box on edit Post/Page
+* hide the SEO Score, Title and Meta description admin columns on the Posts/Pages screen; Focus keyword column can be hidden too
+* remove SEO Settings sub menu of SEO menu in admin bar; additional option is to remove the Keyword Research sub menu
+* remove the Yoast SEO widget from the WordPress Dashboard
+* the tour is set to seen (there is no setting for this as the tour can be seen at any moment by going to the General settings of the Yoast SEO plugin)
+
+If you like the SO Hide SEO Bloat plugin, please consider leaving a [review](https://wordpress.org/support/view/plugin-reviews/so-clean-up-wp-seo?rate=5#postform). You can also help a great deal by [translating the plugin](https://translate.wordpress.org/projects/wp-plugins/so-clean-up-wp-seo) into your own language.
Alternatively you are welcome to make a [donation](http://so-wp.com/donations/). Thanks!
## Frequently Asked Questions
-### Where are the Settings?
-
-For [v2.0.0](https://github.com/senlin/so-clean-up-wp-seo/milestones/version%202.0.0) we have planned a complete rewrite of the SO Hide SEO Bloat plugin which includes a Settings page to enable the user to clean up individual items, instead of the current blanket rule.
+### Where is the settings page?
-For now however you can stop looking, there is none yet. Activate the plugin to clean up your WordPress dashboard.
+The link to the page has been added to the Yoast SEO menu and of course there is also a link to it from the Plugins page.
### Can I use SO Hide SEO Bloat on Multisite?
You can, but until further notice you need to activate the plugin on a per-site basis ([see this Github issue](https://github.com/senlin/so-clean-up-wp-seo/issues/4))
+### The name of the plugin is confusing, it hides bloat of which SEO plugin?
+
+Yes, you are right, the name is a bit vague (see Changelog v1.8.0). On the other hand there is only one SEO plugin that adds a lot of bloat to the WordPress Dashboard and that is the Yoast SEO plugin.
+
+### The plugin doesn't do anything!
+
+Do you have the Yoast SEO plugin installed? It hides the bloat from that plugin only.
+If you have and the plugin still doesn't do anything, then please open a [support ticket](https://github.com/senlin/so-clean-up-wp-seo/issues).
+
+### With a settings page comes additional entries in the database; what happens on uninstall?
+
+Great question!
+Indeed the SO Hide SEO Bloat plugin writes its settings to the database. The included `uninstall.php` file removes all the plugin-related entries from the database once you remove the plugin via the WordPress Plugins page (not on deactivation).
+
+### You have only a handful ratings/reviews; why should I install this plugin?
+
+Yes, you are correct and many people say that it is important for a plugin to have a good rating.
+Fortunately there are already quite a few people that have downloaded the plugin, installed it, activated it and keep it activated, as you can see from the Active Installs in the sidebar. There must be something good that the plugin does then, right?
+
+So if you decide to install it and you're happy about the plugin, then please help the next person (and me) by [leaving a 5-star review](https://wordpress.org/support/view/plugin-reviews/so-clean-up-wp-seo?rate=5#postform).
+
+Thank you very much!
+
### I have an issue with this plugin, where can I get support?
Please open an issue here on [Github](https://github.com/senlin/so-clean-up-wp-seo/issues)
@@ -75,6 +104,13 @@ We are looking to release a [new version](https://github.com/senlin/so-clean-up-
## Changelog
+### 2.0.0 (2016.02.04)
+
+* complete rewrite of the plugin
+* new Settings page to fine tune what is hidden/removed to your liking
+* new screenshots
+* tested up to WP 4.4.2
+
### 1.8.0 (2016.01.28)
* name change to avoid "Yoast" trademark violation
@@ -157,6 +193,10 @@ We are looking to release a [new version](https://github.com/senlin/so-clean-up-
## Update Notice
+### 2.0.0
+
+* Version 2.0.0 is a complete rewrite of the SO Hide SEO Bloat plugin. Please visit the Settings page after you have updated to this version, so you can fine tune what is hidden/removed.
+
### 1.8.0
* name change to avoid "Yoast" trademark violation
diff --git a/admin/class-so-clean-up-wp-seo-admin-api.php b/admin/class-so-clean-up-wp-seo-admin-api.php
new file mode 100644
index 0000000..2627205
--- /dev/null
+++ b/admin/class-so-clean-up-wp-seo-admin-api.php
@@ -0,0 +1,125 @@
+ID, $field['id'], true );
+
+ // Get data to display in field
+ if ( isset( $option ) ) {
+ $data = $option;
+ }
+
+ } else {
+
+ // Get saved option
+ $option_name .= $field['id'];
+ $option = get_option( $option_name );
+
+ // Get data to display in field
+ if ( isset( $option ) ) {
+ $data = $option;
+ }
+
+ }
+
+ // Show default data if no option saved and default is supplied
+ if ( $data === false && isset( $field['default'] ) ) {
+ $data = $field['default'];
+ } elseif ( $data === false ) {
+ $data = '';
+ }
+
+ $html = '';
+
+ switch( $field['type'] ) {
+
+ case 'checkbox':
+ $checked = '';
+ if ( $data && 'on' == $data ) {
+ $checked = 'checked="checked"';
+ }
+ $html .= '' . "\n";
+ break;
+
+ case 'checkbox_multi':
+ foreach ( $field['options'] as $k => $v ) {
+ $checked = false;
+ if ( in_array( $k, $data ) ) {
+ $checked = true;
+ }
+ $html .= ' ';
+ }
+ break;
+
+ case 'radio':
+ foreach ( $field['options'] as $k => $v ) {
+ $checked = false;
+ if ( $k == $data ) {
+ $checked = true;
+ }
+ $html .= ' ';
+ }
+ break;
+
+ }
+
+ switch( $field['type'] ) {
+
+ case 'checkbox_multi':
+ case 'radio':
+ $html .= ' ' . $field['description'] . '';
+ break;
+
+ default:
+ if ( ! $post ) {
+ $html .= '' . "\n";
+ }
+ break;
+ }
+
+ if ( ! $echo ) {
+ return $html;
+ }
+
+ echo $html;
+
+ }
+
+}
diff --git a/assets/banner-772x250.png b/assets/banner-772x250.png
index d22d0b8..cfca4c4 100644
Binary files a/assets/banner-772x250.png and b/assets/banner-772x250.png differ
diff --git a/assets/screenshot-1.jpg b/assets/screenshot-1.jpg
index efb4f72..8bbe291 100644
Binary files a/assets/screenshot-1.jpg and b/assets/screenshot-1.jpg differ
diff --git a/assets/screenshot-2.jpg b/assets/screenshot-2.jpg
index 1f6fcea..0b92117 100644
Binary files a/assets/screenshot-2.jpg and b/assets/screenshot-2.jpg differ
diff --git a/assets/screenshot-3.jpg b/assets/screenshot-3.jpg
index d7abfc6..1f49a6b 100644
Binary files a/assets/screenshot-3.jpg and b/assets/screenshot-3.jpg differ
diff --git a/assets/screenshot-4.jpg b/assets/screenshot-4.jpg
index 41fc697..e6c0c23 100644
Binary files a/assets/screenshot-4.jpg and b/assets/screenshot-4.jpg differ
diff --git a/assets/screenshot-5.jpg b/assets/screenshot-5.jpg
index 21e09fd..be1c4d0 100644
Binary files a/assets/screenshot-5.jpg and b/assets/screenshot-5.jpg differ
diff --git a/css/admin.css b/css/admin.css
new file mode 100644
index 0000000..67321ad
--- /dev/null
+++ b/css/admin.css
@@ -0,0 +1,59 @@
+/**
+ * All of the CSS for the admin-specific functionality is included in this file.
+ * @since v2.0.0
+ */
+
+.seo_page_cuws_settings .wrap > h2 {
+ background-image: url("../images/so-icon.png");
+ background-position: 0 0;
+ background-repeat: no-repeat;
+ background-size: 32px auto;
+ display: block;
+ min-height: 32px;
+ padding-left: 40px !important;
+ padding-top: 2px !important;
+}
+.seo_page_cuws_settings .wrap > p {
+ font-size: 16px;
+}
+.seo_page_cuws_settings .wrap > form span.description {
+ font-size: 14px;
+}
+.rate-this-plugin {
+ color: #0074A2;
+ font-style: italic;
+ font-size: 16px;
+}
+.support,
+.translate {
+ font-size: 16px;
+}
+.author.postbox {
+ max-width: 500px;
+}
+.author.postbox .hndle {
+ border-bottom: 1px solid #DDD;
+ margin-bottom: 0;
+ padding: 5px;
+}
+.author.postbox .inside {
+ display: block;
+ margin: 0;
+ overflow: hidden;
+}
+.author.postbox .inside .top {
+ min-height: 90px;
+}
+.author.postbox .inside > .top > .author-image {
+ border: 1px solid #DFDFDF;
+ float: left;
+ margin-right: 10px;
+ padding: 3px;
+}
+.author.postbox .inside > ul {
+ clear: both;
+}
+.author.postbox .inside li {
+ float: left;
+ width: 50%;
+}
diff --git a/images/pietbos-80x80.jpg b/images/pietbos-80x80.jpg
new file mode 100644
index 0000000..c9958c6
Binary files /dev/null and b/images/pietbos-80x80.jpg differ
diff --git a/images/so-icon.png b/images/so-icon.png
new file mode 100644
index 0000000..c9d6ded
Binary files /dev/null and b/images/so-icon.png differ
diff --git a/includes/class-so-clean-up-wp-seo-settings.php b/includes/class-so-clean-up-wp-seo-settings.php
new file mode 100644
index 0000000..07b0c5b
--- /dev/null
+++ b/includes/class-so-clean-up-wp-seo-settings.php
@@ -0,0 +1,368 @@
+parent = $parent;
+
+ $this->base = 'cuws_';
+
+ // Initialise settings
+ add_action( 'init', array( $this, 'init_settings' ), 11 );
+
+ // Register plugin settings
+ add_action( 'admin_init' , array( $this, 'register_settings' ) );
+
+ // Add settings page to menu
+ add_action( 'admin_menu' , array( $this, 'add_menu_item' ) );
+
+ // Add settings link to plugins page
+ add_filter( 'plugin_action_links_' . plugin_basename( $this->parent->file ) , array( $this, 'add_settings_link' ) );
+
+ }
+
+ /**
+ * Initialise settings
+ * @return void
+ * @since v2.0.0
+ */
+ public function init_settings () {
+ $this->settings = $this->settings_fields();
+ }
+
+ /**
+ * Add settings page to admin menu
+ * @return void
+ * @since v2.0.0
+ */
+ public function add_menu_item () {
+ $page = add_submenu_page(
+ 'wpseo_dashboard',
+ __( 'SO Hide SEO Bloat Settings', 'so-clean-up-wp-seo' ),
+ __( 'Hide Bloat', 'so-clean-up-wp-seo' ),
+ 'manage_options',
+ $this->parent->_token . '_settings',
+ array( $this, 'settings_page' )
+ );
+ }
+
+ /**
+ * Add settings link to plugin list table
+ * @param array $links Existing links
+ * @return array Modified links
+ * @since v2.0.0
+ */
+ public function add_settings_link ( $links ) {
+ $settings_link = '' . __( 'Settings', 'so-clean-up-wp-seo' ) . '';
+ array_unshift( $links, $settings_link );
+ return $links;
+ }
+
+ /**
+ * Build settings fields
+ * @return array Fields to be displayed on settings page
+ * @since v2.0.0
+ */
+ private function settings_fields () {
+
+ $settings['standard'] = array(
+ 'title' => __( 'Without further ado: Hide the bloat', 'so-clean-up-wp-seo' ),
+ //'description' => __( 'description' ),
+ 'fields' => array(
+ array(
+ 'id' => 'hide_ads',
+ 'label' => __( 'Sidebar Ads', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide the cartoon-style sidebar ads on almost all settings pages of the Yoast SEO plugin.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_about_nag',
+ 'label' => __( 'About nag', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide about nag that shows on every update of the plugin.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_recalc_nag',
+ 'label' => __( 'Recalculate nag', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide recalculate nag that alerts user that SEO score algorithm has been updated.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_tagline_nag',
+ 'label' => __( 'Tagline nag', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide tagline nag that shows when your site uses the default WordPress tagline.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_robots_nag',
+ 'label' => __( 'Robots nag', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide robots nag that shows when your site is blocking access to robots, for example on dev and staging sites.', 'so-clean-up-wp-seo' ) . ' ' . __( ' It also hides the warning in the advanced tab of Yoast SEO UI in edit Post/Page screen.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_gsc_nag',
+ 'label' => __( 'GSC nag', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide Google Search Console nag that warns about not missing any crawl errors by connecting the Yoast SEO plugin to it.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_imgwarning_nag',
+ 'label' => __( 'Featured image nag', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide image warning nag that shows in edit Post/Page screen when featured image is smaller than 200x200 pixels.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_addkw_button',
+ 'label' => __( 'Add keyword button', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide add keyword button that shows in edit Post/Page and only serves to show an ad for the premium version.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_trafficlight',
+ 'label' => __( 'Trafficlight', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide seoscore traffic light in publish/update box on edit Post/Page.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_wpseoanalysis',
+ 'label' => __( 'Content analysis', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Hide content analysis that adds colored balls to the edit Post/Page screens', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ ),
+ array(
+ 'id' => 'hide_admin_columns',
+ 'label' => __( 'Admin columns', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'The Yoast SEO plugin adds 4 admin columns on the Posts/Pages screen, choose here which ones to hide (possible to select multiple, ticking minimum one box is required).', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox_multi',
+ 'options' => array( 'all' => __( 'Hide all columns', 'so-clean-up-wp-seo' ), 'seoscore' => __( 'Hide SEO score column', 'so-clean-up-wp-seo' ), 'title' => __( 'Hide title column', 'so-clean-up-wp-seo' ), 'metadescr' => __( 'Hide meta description column', 'so-clean-up-wp-seo' ), 'focuskw' => __( 'Hide focus keyword column', 'so-clean-up-wp-seo' ), 'none' => __( 'Show all columns', 'so-clean-up-wp-seo' ) ),
+ 'default' => array( 'seoscore', 'title', 'metadescr' )
+ ),
+ array(
+ 'id' => 'remove_adminbar',
+ 'label' => __( 'SEO menu admin bar', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'The adminbar contains an SEO menu with 2 options; select here what to remove.', 'so-clean-up-wp-seo' ),
+ 'type' => 'radio',
+ 'options' => array( 'seo' => __( 'SEO Settings', 'so-clean-up-wp-seo' ), 'keyword' => __( 'Keyword Research', 'so-clean-up-wp-seo' ), 'both' => __( 'Both', 'so-clean-up-wp-seo' ), 'none' => __( 'None', 'so-clean-up-wp-seo' ) ),
+ 'default' => 'seo'
+ ),
+ array(
+ 'id' => 'remove_dbwidget',
+ 'label' => __( 'Dashboard widget', 'so-clean-up-wp-seo' ),
+ 'description' => __( 'Remove the Yoast SEO widget from the WordPress Dashboard.', 'so-clean-up-wp-seo' ),
+ 'type' => 'checkbox',
+ 'default' => 'on'
+ )
+ )
+ );
+
+ $settings = apply_filters( $this->parent->_token . '_settings_fields', $settings );
+
+ return $settings;
+ }
+
+ /**
+ * Register plugin settings
+ * @return void
+ * @since v2.0.0
+ */
+ public function register_settings () {
+ if ( is_array( $this->settings ) ) {
+
+ // Check posted/selected tab
+ $current_section = '';
+ if ( isset( $_POST['tab'] ) && $_POST['tab'] ) {
+ $current_section = $_POST['tab'];
+ } else {
+ if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {
+ $current_section = $_GET['tab'];
+ }
+ }
+
+ foreach ( $this->settings as $section => $data ) {
+
+ if ( $current_section && $current_section != $section ) continue;
+
+ // Add section to page
+ add_settings_section( $section, $data['title'], array( $this, 'settings_section' ), $this->parent->_token . '_settings' );
+
+ foreach ( $data['fields'] as $field ) {
+
+ // Validation callback for field
+ $validation = '';
+ if ( isset( $field['callback'] ) ) {
+ $validation = $field['callback'];
+ }
+
+ // Register field
+ $option_name = $this->base . $field['id'];
+ register_setting( $this->parent->_token . '_settings', $option_name, $validation );
+
+ // Add field to page
+ add_settings_field( $field['id'], $field['label'], array( $this->parent->admin, 'display_field' ), $this->parent->_token . '_settings', $section, array( 'field' => $field, 'prefix' => $this->base ) );
+ }
+
+ if ( ! $current_section ) break;
+ }
+ }
+ }
+
+ public function settings_section ( $section ) {
+ $html = "\n";
+ echo $html;
+ }
+
+ /**
+ * Load settings page content
+ * @return void
+ * @since v2.0.0
+ */
+ public function settings_page () {
+
+ // Build page HTML
+ $html = '
' . esc_attr( __( 'With version 2.0.0 we have added this settings page, so you can adjust things here and there to your liking.', 'so-clean-up-wp-seo' ) ) . '
' . "\n";
+
+ $html .= '
' . esc_attr( __( 'The default setting, when you activate the plugin, is that almost all boxes have been ticked; why else would you install our plugin?', 'so-clean-up-wp-seo' ) ) . '
' . "\n";
+
+ $html .= '
' . esc_attr( __( 'The intro tour pop up balloon is set to "seen" by default and there is no setting to show it as you can find it in the Yoast SEO Settings.', 'so-clean-up-wp-seo' ) ) . '
' . "\n";
+
+ $html .= '
' . esc_attr( __( 'If you ever want to remove the SO Hide SEO Bloat plugin, then you can rest assured that it cleans up after itself:', 'so-clean-up-wp-seo' ) ) . ' ' . esc_attr( __( 'upon deletion it removes all options automatically.', 'so-clean-up-wp-seo' ) ) . '
' . "\n";
+
+ $html .= '' . "\n";
+
+
+ // see //codex.wordpress.org/I18n_for_WordPress_Developers#HTML for instructions on i18n of $html
+ $rateurl = 'https://wordpress.org/support/view/plugin-reviews/so-clean-up-wp-seo?rate=5#postform';
+ $html .= '
' . sprintf( wp_kses( __( 'If you have found this plugin at all useful, please give it a favourable rating in the WordPress Plugin Repository.', 'so-clean-up-wp-seo' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( $rateurl ) ) . '
' . sprintf( wp_kses( __( 'You can also help a great deal by translating the plugin into your own language.', 'so-clean-up-wp-seo' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( $translateurl ) ) . '
' . sprintf( wp_kses( __( 'If you have an issue with this plugin or want to leave a feature request, please note that we give support via Github only.', 'so-clean-up-wp-seo' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( $supporturl ) ) . '
' . sprintf( wp_kses( __( 'Hi, my name is Piet Bos, I hope you like this plugin! Please check out any of my other plugins on SO WP Plugins. You can find out more information about me via the following links:', 'so-clean-up-wp-seo' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( $sowpurl ) ) . '
', $errors ),
- $name[0]
- );
- deactivate_plugins( plugin_basename( __FILE__ ) );
-
-}
+// Load plugin libraries
+require_once( 'admin/class-so-clean-up-wp-seo-admin-api.php' );
/**
- * Add the actions and filters that clean up the entire Yoast SEO experience
+ * Returns the main instance of CUWS to prevent the need to use globals.
*
- * @since 1.0
- * @modified 1.7.2 (take out the conditional that checked for required plugin)
+ * @since v2.0.0
+ * @return object CUWS
*/
-add_action( 'admin_head', 'so_cuws_display_none_the_lot' );
-
-add_action( 'admin_init', 'so_cuws_ignore_tour', 999 ); // since 1.4
-
-add_action( 'admin_bar_menu', 'so_cuws_remove_adminbar_settings', 999 ); // since 1.3
-
-add_action( 'wp_dashboard_setup', 'so_cuws_remove_wpseo_dashboard_overview_widget' ); // since 1.5
-
-add_filter( 'wpseo_use_page_analysis', '__return_false' );
-
-// Remove irritating ads sidebar
-// @since 1.3.1 remove tour option/introduction
-// @since 1.4 remove updated nag (introduced with Yoast SEO version 2.2.1)
-// @since 1.6 remove GSC nag
-// @since 1.7 remove yst_opengraph_image_warning nag
-// @since 1.7.3 remove + icon from new Edit screen UI as it serves only to show an ad for the premium version of Yoast SEO
-// @since 1.7.4 remove wpseo-score traffic light next to Move to trash on Edit Post/Page screen
-// @since 1.7.5 remove SEO score algorithm recalculate nag
-
-/* On a Dutch language site I noticed an irritating box begging for help with translations. The ID of the box is "#i18n_promo_box", the irritating thing about that box is that it says the current language is not yet a translated language, but Dutch obviously is, so this box should not even show on a Dutch site. Once we change this plugin to have settings instead of blanket removal, we can add this in. But for now, let's leave it out. Clicking on the X to remove the box adds the following string to the URL: wp-admin/admin.php?page=wpseo_titles&remove_i18n_promo=1 */
-function so_cuws_display_none_the_lot() {
- echo '';
-}
+function CUWS () {
+ $instance = CUWS::instance( __FILE__, '2.0.0' );
-// @since 1.4 replaces previous so_cuws_remove_about_tour() function that has become redundant from Yoast SEO 2.2.1 onwards
-function so_cuws_ignore_tour() {
- update_user_meta( get_current_user_id(), 'wpseo_ignore_tour', true );
-}
-
-// Remove Settings submenu in admin bar
-// also shows how to remove other menus
-// @since 1.3 - inspired by [Lee Rickler](https://profiles.wordpress.org/lee-rickler/)
-function so_cuws_remove_adminbar_settings() {
-
- global $wp_admin_bar;
-
- // remove the entire menu
- //$wp_admin_bar->remove_node( 'wpseo-menu' );
-
- // remove Yoast SEO Settings
- $wp_admin_bar->remove_node( 'wpseo-settings' );
+ if ( is_null( $instance->settings ) ) {
+ $instance->settings = CUWS_Settings::instance( $instance );
+ }
- // remove keyword research information
- //$wp_admin_bar->remove_node( 'wpseo-kwresearch' );
-
-}
-
-// Version 2.3 of Yoast SEO introduced a dashboard widget
-// This function removes this widget
-// @since v1.5
-function so_cuws_remove_wpseo_dashboard_overview_widget() {
- remove_meta_box( 'wpseo-dashboard-overview', 'dashboard', 'side' );
+ return $instance;
}
-
+CUWS();
diff --git a/uninstall.php b/uninstall.php
new file mode 100644
index 0000000..fdb62da
--- /dev/null
+++ b/uninstall.php
@@ -0,0 +1,27 @@
+query( "DELETE FROM `{$wpdb->prefix}options` WHERE `option_name` LIKE '%cuws_%'" );
+
+