Version Description
- Introducing more modern, better and faster functions
- RYSC can now be activated without Yoast SEO activated
Download this release
Release Info
Developer | lowest |
Plugin | Remove Yoast SEO Comments |
Version | 2.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 2.0
- readme.txt +5 -1
- remove-yoast-seo-comments.php +25 -29
readme.txt
CHANGED
@@ -32,7 +32,7 @@ If you like this plugin, make sure to rate it 5 stars. Also check out [Remove Go
|
|
32 |
|
33 |
= When Yoast SEO updates their plugin, will the HTML comments stay removed? =
|
34 |
|
35 |
-
Yes, they will stay removed
|
36 |
|
37 |
= Does this plugin add any configuration options? =
|
38 |
|
@@ -44,6 +44,10 @@ No, this plugin will not modify any of your Yoast SEO plugin files.
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
|
|
47 |
= 1.0.5 =
|
48 |
* Fixed an security vulnerability regarding `target="_blank"` ([read more](https://core.trac.wordpress.org/ticket/36809))
|
49 |
* Added support for WordPress 4.7
|
32 |
|
33 |
= When Yoast SEO updates their plugin, will the HTML comments stay removed? =
|
34 |
|
35 |
+
Yes, they will stay removed.
|
36 |
|
37 |
= Does this plugin add any configuration options? =
|
38 |
|
44 |
|
45 |
== Changelog ==
|
46 |
|
47 |
+
= 2.0 =
|
48 |
+
* Introducing more modern, better and faster functions
|
49 |
+
* RYSC can now be activated without Yoast SEO activated
|
50 |
+
|
51 |
= 1.0.5 =
|
52 |
* Fixed an security vulnerability regarding `target="_blank"` ([read more](https://core.trac.wordpress.org/ticket/36809))
|
53 |
* Added support for WordPress 4.7
|
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:
|
7 |
* Author: Mitch
|
8 |
* Author URI: https://profiles.wordpress.org/lowest
|
9 |
* License: GPL-2.0+
|
@@ -29,37 +29,33 @@
|
|
29 |
|
30 |
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
31 |
|
32 |
-
if ( ! defined( '
|
33 |
|
34 |
-
function
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
$network_active = true;
|
40 |
-
}
|
41 |
}
|
42 |
-
return in_array( $plugin, get_option( 'active_plugins' ) ) || $network_active;
|
43 |
}
|
|
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
add_action( 'admin_init', function() {
|
59 |
-
deactivate_plugins( plugin_basename( RYSC_FILE ) );
|
60 |
-
});
|
61 |
}
|
62 |
|
63 |
-
|
64 |
-
return array_merge( $link, array('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VYPRGME8QELC" target="_blank" rel="noopener noreferrer">Donate</a>') );
|
65 |
-
}
|
|
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: 2.0
|
7 |
* Author: Mitch
|
8 |
* Author URI: https://profiles.wordpress.org/lowest
|
9 |
* License: GPL-2.0+
|
29 |
|
30 |
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
31 |
|
32 |
+
if ( ! defined( 'RYSC_VERSION' ) ) { define( 'RYSC_VERSION', '1.0' ); }
|
33 |
|
34 |
+
function rysc_bundle() {
|
35 |
+
if(defined( 'WPSEO_VERSION' ) && class_exists('WPSEO_Frontend')) {
|
36 |
+
remove_action( 'wpseo_head', array( WPSEO_Frontend::get_instance(), 'debug_marker' ) , 2);
|
37 |
+
remove_action( 'wp_head', array( WPSEO_Frontend::get_instance(), 'head' ) , 1);
|
38 |
+
add_action( 'wp_head', 'rysc_rewrite' , 1);
|
|
|
|
|
39 |
}
|
|
|
40 |
}
|
41 |
+
add_action( 'init', 'rysc_bundle' );
|
42 |
|
43 |
+
function rysc_rewrite() {
|
44 |
+
$rewrite = new ReflectionMethod( 'WPSEO_Frontend', 'head' );
|
45 |
+
|
46 |
+
$filename = $rewrite->getFileName();
|
47 |
+
$start_line = $rewrite->getStartLine();
|
48 |
+
$end_line = $rewrite->getEndLine()-1;
|
49 |
+
|
50 |
+
$length = $end_line - $start_line;
|
51 |
+
$source = file($filename);
|
52 |
+
$body = implode("", array_slice($source, $start_line, $length));
|
53 |
+
$body = preg_replace( '/echo \'\<\!(.*?)\n/', '', $body);
|
54 |
+
|
55 |
+
eval($body);
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
+
function rysc_links( $link ) {
|
59 |
+
return array_merge( $link, array('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VYPRGME8QELC" target="_blank" rel="noopener noreferrer">' . __('Donate') . '</a>') );
|
60 |
+
}
|
61 |
+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'rysc_links');
|