Remove Yoast SEO Comments - Version 1.0.3

Version Description

  • Removed anonymous functions: RYSC is now more light-weight than ever
Download this release

Release Info

Developer lowest
Plugin Icon wp plugin Remove Yoast SEO Comments
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

Files changed (2) hide show
  1. readme.txt +9 -6
  2. remove-yoast-seo-comments.php +12 -20
readme.txt CHANGED
@@ -16,7 +16,11 @@ A light-weight plugin which will remove the advertisement HTML comments coming f
16
 
17
  This is a must-have plugin if you have Yoast SEO or Yoast SEO Premium installed.
18
 
19
- *Note: This plugin requires [Yoast SEO](http://wordpress.org/plugins/wordpress-seo/) or Yoast SEO Premium. If you do not have Yoast SEO or Yoast SEO Premium activated, this plugin will not work.*
 
 
 
 
20
 
21
  == Installation ==
22
 
@@ -28,22 +32,21 @@ This is a must-have plugin if you have Yoast SEO or Yoast SEO Premium installed.
28
 
29
  = When Yoast SEO updates their plugin, will the HTML comments stay removed? =
30
 
31
- Yes, they will stay removed.
32
 
33
  = Does this plugin add any configuration options? =
34
 
35
  No, activate the plugin and you are done! This plugin will not add any extra tables or such to your database.
36
 
37
- = Why does this plugin exist? =
38
-
39
- The HTML comments coming from the Yoast SEO plugin give out information such as plugin version and type. When there is a exploit in the Yoast SEO plugin, hackers may take advantage of that exploit to hack your website. A good reason to remove them.
40
-
41
  = Will this plugin modify any of my Yoast SEO plugin files? =
42
 
43
  No, this plugin will not modify any of your Yoast SEO plugin files.
44
 
45
  == Changelog ==
46
 
 
 
 
47
  = 1.0.2 =
48
  * Minor changes to all files
49
  * Removed a unnecessary file
16
 
17
  This is a must-have plugin if you have Yoast SEO or Yoast SEO Premium installed.
18
 
19
+ = Note =
20
+ This plugin requires [Yoast SEO](http://wordpress.org/plugins/wordpress-seo/) or Yoast SEO Premium. If you do not have Yoast SEO or Yoast SEO Premium activated, this plugin will not work.
21
+
22
+ = Like this plugin? =
23
+ If you like this plugin, make sure to rate it 5 stars. Also check out [Remove Google Analytics comments](https://wordpress.org/plugins/remove-google-analytics-comments/)!
24
 
25
  == Installation ==
26
 
32
 
33
  = When Yoast SEO updates their plugin, will the HTML comments stay removed? =
34
 
35
+ Yes, they will stay removed as long as Yoast does not change any file names.
36
 
37
  = Does this plugin add any configuration options? =
38
 
39
  No, activate the plugin and you are done! This plugin will not add any extra tables or such to your database.
40
 
 
 
 
 
41
  = Will this plugin modify any of my Yoast SEO plugin files? =
42
 
43
  No, this plugin will not modify any of your Yoast SEO plugin files.
44
 
45
  == Changelog ==
46
 
47
+ = 1.0.3 =
48
+ * Removed anonymous functions: RYSC is now more light-weight than ever
49
+
50
  = 1.0.2 =
51
  * Minor changes to all files
52
  * Removed a unnecessary file
remove-yoast-seo-comments.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Remove Yoast SEO comments
4
  * Plugin URI: https://wordpress.org/plugins/remove-yoast-seo-comments/
5
  * Description: Removes the Yoast SEO advertisement HTML comments from your front-end source code.
6
- * Version: 1.0.2
7
  * Author: Mitch
8
  * Author URI: https://profiles.wordpress.org/lowest
9
  * License: GPL-2.0+
@@ -42,15 +42,7 @@ function rysc_active( $plugin ) {
42
  return in_array( $plugin, get_option( 'active_plugins' ) ) || $network_active;
43
  }
44
 
45
- function rysc_notice() {
46
- echo '<div class="notice notice-error is-dismissible"><p>Cannot activate <strong>Remove Yoast SEO comments</strong>: Please activate <a href="http://wordpress.org/plugins/wordpress-seo/" target="_blank">Yoast SEO</a> or Yoast SEO Premium plugin first before activating this plugin.</p></div>';
47
- }
48
-
49
- function rysc_deactivate() {
50
- deactivate_plugins( plugin_basename( RYSC_FILE ) );
51
- }
52
-
53
- function rysc_do() {
54
  add_action('get_header',function (){
55
  ob_start(function ($o) {
56
  return preg_replace('/\n?<.*?yoast.*?>/mi','',$o);
@@ -59,17 +51,17 @@ function rysc_do() {
59
  add_action('wp_head',function (){
60
  ob_end_flush();
61
  }, 999);
62
- }
63
-
64
- function rysc_noyoast() {
65
- add_action( 'admin_notices', 'rysc_notice' );
66
- add_action( 'admin_init', 'rysc_deactivate' );
67
- }
68
-
69
- if ( rysc_active( 'wordpress-seo/wp-seo.php' ) || rysc_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) {
70
- rysc_do();
71
  } else {
72
- rysc_noyoast();
 
 
 
 
 
73
  }
74
 
75
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), function($link) {
3
  * Plugin Name: Remove Yoast SEO comments
4
  * Plugin URI: https://wordpress.org/plugins/remove-yoast-seo-comments/
5
  * Description: Removes the Yoast SEO advertisement HTML comments from your front-end source code.
6
+ * Version: 1.0.3
7
  * Author: Mitch
8
  * Author URI: https://profiles.wordpress.org/lowest
9
  * License: GPL-2.0+
42
  return in_array( $plugin, get_option( 'active_plugins' ) ) || $network_active;
43
  }
44
 
45
+ if ( rysc_active( 'wordpress-seo/wp-seo.php' ) || rysc_active( 'wordpress-seo-premium/wp-seo-premium.php' ) ) {
 
 
 
 
 
 
 
 
46
  add_action('get_header',function (){
47
  ob_start(function ($o) {
48
  return preg_replace('/\n?<.*?yoast.*?>/mi','',$o);
51
  add_action('wp_head',function (){
52
  ob_end_flush();
53
  }, 999);
54
+ } elseif(defined('WPSEO_VERSION')) {
55
+ add_action( 'admin_notices', function() {
56
+ echo '<div class="notice notice-error is-dismissible"><p>Gevonden.</p></div>';
57
+ });
 
 
 
 
 
58
  } else {
59
+ add_action( 'admin_notices', function() {
60
+ echo '<div class="notice notice-error is-dismissible"><p>Cannot activate <strong>Remove Yoast SEO comments</strong>: Please activate <a href="http://wordpress.org/plugins/wordpress-seo/" target="_blank">Yoast SEO</a> or Yoast SEO Premium plugin first before activating this plugin.</p></div>';
61
+ });
62
+ add_action( 'admin_init', function() {
63
+ deactivate_plugins( plugin_basename( RYSC_FILE ) );
64
+ });
65
  }
66
 
67
  add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), function($link) {