Ultimate Nofollow - Version 0.1.2

Version Description

  • Stable beta version.
  • Add/remove nofollow from all links in comments.
Download this release

Release Info

Developer bitacre
Plugin Icon wp plugin Ultimate Nofollow
Version 0.1.2
Comparing to
See all releases

Code changes from version 0.1.1 to 0.1.2

Files changed (2) hide show
  1. nofollow.php +47 -28
  2. readme.txt +12 -7
nofollow.php CHANGED
@@ -3,12 +3,16 @@
3
  Plugin Name: Ultimate Nofollow
4
  Plugin URI: http://wikiduh.com/plugins/nofollow
5
  Description: A suite of tools that gives you complete control over the rel=nofollow tag on an individual link basis.
6
- Version: 0.1.1
7
  Author: bitacre
8
  Author URI: http://wikiduh.com
9
  License: GPLv2
10
  Copyright 2012 bitacre (plugins@wikiduh.com)
11
 
 
 
 
 
12
  */
13
 
14
  /***********************
@@ -20,7 +24,7 @@ function ultnofo_options_init() {
20
  register_setting( 'ultnofo_options_options', 'ultnofo_item', 'ultnofo_options_validate' );
21
 
22
  // if option doesn't exist, set defaults
23
- if( !get_option( 'ultnofo_item' ) ) add_option( 'ultnofo_item', array( 'nofollow_comments' => 1 ), '', 'no' );
24
  }
25
 
26
  /* add link to plugin's settings page under 'settings' on the admin menu */
@@ -46,9 +50,12 @@ function ultnofo_options_do_page() {
46
  <?php settings_fields( 'ultnofo_options_options' ); // nonce settings page ?>
47
  <?php $options = get_option( 'ultnofo_item' ); // populate $options array from database ?>
48
  <table class="form-table">
49
- <tr valign="top"><th scope="row">Add Nofollow to links in comments?</th>
 
50
  <td><input name="ultnofo_item[nofollow_comments]" type="checkbox" value="1" <?php checked( '1', $options[ 'nofollow_comments' ] ); ?> /></td>
51
  </tr>
 
 
52
  <!-- <tr valign="top"><th scope="row">Text:</th>
53
  <td>
54
  UA-<input type="text" name="ssga_item[sometext1]" value="<?php // echo $options[ 'test_text_1']; ?>" style="width:90px;" maxlength="8" />
@@ -63,6 +70,16 @@ function ultnofo_options_do_page() {
63
  <?php
64
  }
65
 
 
 
 
 
 
 
 
 
 
 
66
  /******************************
67
  * NOFOLLOW SHORTCODES SECTION *
68
  *******************************/
@@ -138,31 +155,7 @@ function ultnofo_nofollow_link( $atts, $content = NULL ) {
138
  return '<a' . $href_chunk . $target_chunk . $title_chunk . ' rel="nofollow">' . $content_chunk . '</a>';
139
  }
140
 
141
- /****************************
142
- * BLOGROLL NOFOLLOW SECTION *
143
- *****************************/
144
-
145
- /**********************************************
146
- * ADD LINK DIALOGUE NOFOLLOW CHECKBOX SECTION *
147
- ***********************************************/
148
-
149
- /*******************************
150
- * NOFOLLOW ON COMMENTS SECTION *
151
- ********************************/
152
-
153
- /************
154
- * ADD HOOKS *
155
- *************/
156
-
157
- // add meta links to plugin's section on 'plugins' page (10=priority, 2=num of args)
158
- add_filter( 'plugin_row_meta', 'set_plugin_meta_ultnofo', 10, 2 );
159
-
160
- // add plugin's options to white list on admin initialization
161
- add_action('admin_init', 'ultnofo_options_init' );
162
-
163
- // add link to plugin's settings page in 'settings' menu on admin menu initilization
164
- add_action('admin_menu', 'ultnofo_options_add_page');
165
-
166
  // add shortcodes
167
  $shortcodes = array(
168
  'relnofollow',
@@ -172,4 +165,30 @@ $shortcodes = array(
172
  'nf'
173
  );
174
  foreach( $shortcodes as $shortcode ) add_shortcode( $shortcode, 'ultnofo_nofollow_link' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  ?>
3
  Plugin Name: Ultimate Nofollow
4
  Plugin URI: http://wikiduh.com/plugins/nofollow
5
  Description: A suite of tools that gives you complete control over the rel=nofollow tag on an individual link basis.
6
+ Version: 0.1.2
7
  Author: bitacre
8
  Author URI: http://wikiduh.com
9
  License: GPLv2
10
  Copyright 2012 bitacre (plugins@wikiduh.com)
11
 
12
+ This plugin contains several tools in one to significantly increase your control of the nofollow rel tag on every link on your blog, on both an individual and type basis. It is designed to give you fine-grained control of linking for SEO purposes.
13
+
14
+ Notice: This plugin is still in beta. While it is stable, not all functions listed are included yet
15
+
16
  */
17
 
18
  /***********************
24
  register_setting( 'ultnofo_options_options', 'ultnofo_item', 'ultnofo_options_validate' );
25
 
26
  // if option doesn't exist, set defaults
27
+ if( !get_option( 'ultnofo_item' ) ) add_option( 'ultnofo_item', array( 'nofollow_comments' => 1, 'nofollow_blogroll' => 0 ), '', 'no' );
28
  }
29
 
30
  /* add link to plugin's settings page under 'settings' on the admin menu */
50
  <?php settings_fields( 'ultnofo_options_options' ); // nonce settings page ?>
51
  <?php $options = get_option( 'ultnofo_item' ); // populate $options array from database ?>
52
  <table class="form-table">
53
+
54
+ <tr valign="top"><th scope="row">Add nofollow to links in comments?</th>
55
  <td><input name="ultnofo_item[nofollow_comments]" type="checkbox" value="1" <?php checked( '1', $options[ 'nofollow_comments' ] ); ?> /></td>
56
  </tr>
57
+
58
+
59
  <!-- <tr valign="top"><th scope="row">Text:</th>
60
  <td>
61
  UA-<input type="text" name="ssga_item[sometext1]" value="<?php // echo $options[ 'test_text_1']; ?>" style="width:90px;" maxlength="8" />
70
  <?php
71
  }
72
 
73
+ /* add hooks/filters */
74
+ // add meta links to plugin's section on 'plugins' page (10=priority, 2=num of args)
75
+ add_filter( 'plugin_row_meta', 'set_plugin_meta_ultnofo', 10, 2 );
76
+
77
+ // add plugin's options to white list on admin initialization
78
+ add_action('admin_init', 'ultnofo_options_init' );
79
+
80
+ // add link to plugin's settings page in 'settings' menu on admin menu initilization
81
+ add_action('admin_menu', 'ultnofo_options_add_page');
82
+
83
  /******************************
84
  * NOFOLLOW SHORTCODES SECTION *
85
  *******************************/
155
  return '<a' . $href_chunk . $target_chunk . $title_chunk . ' rel="nofollow">' . $content_chunk . '</a>';
156
  }
157
 
158
+ /* add hooks/filters */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  // add shortcodes
160
  $shortcodes = array(
161
  'relnofollow',
165
  'nf'
166
  );
167
  foreach( $shortcodes as $shortcode ) add_shortcode( $shortcode, 'ultnofo_nofollow_link' );
168
+
169
+ /****************************
170
+ * BLOGROLL NOFOLLOW SECTION *
171
+ *****************************/
172
+
173
+ /**********************************************
174
+ * ADD LINK DIALOGUE NOFOLLOW CHECKBOX SECTION *
175
+ ***********************************************/
176
+
177
+ /************************************
178
+ * NOFOLLOW ON COMMENT LINKS SECTION *
179
+ *************************************/
180
+
181
+ // add/remove nofollow from all comment links
182
+ function ultnofo_comment_links( $comment ) {
183
+ $options = get_option( 'ultnofo_item' );
184
+ if( !$options[ 'nofollow_comments' ] )
185
+ $comment = str_replace( 'rel="nofollow"', '', $comment );
186
+ elseif( !strpos( $comment, 'rel="nofollow"' ) )
187
+ $comment = str_replace( '<a ', '<a rel="nofollow"', $comment );
188
+ return $comment;
189
+ }
190
+
191
+ /* add hooks/filters */
192
+ // add/remove nofollow from comment links
193
+ add_filter('comment_text', 'ultnofo_comment_links', 10);
194
  ?>
readme.txt CHANGED
@@ -5,21 +5,22 @@ Donate link: http://wikiduh.com/donate
5
  Tags: nofollow,link,meta,rel,rel nofollow,seo,link meta,nofollow links,shortcode
6
  Requires at least: 2.8
7
  Tested up to: 3.3.1
8
- Stable tag: 0.1.1
9
 
10
  A suite of tools that gives you complete control over the rel=nofollow tag on an individual link basis.
11
 
12
  == Description ==
13
  This plugin contains several tools in one to significantly increase your control of the nofollow rel tag on every link on your blog, on both an individual and type basis. It is designed to give you fine-grained control of linking for SEO purposes.
14
 
15
- Notice: This plugin is still in beta. While it is stable, not all functions listed are included yet.
16
 
17
  The plugin's main features are:
 
18
  * a nofollow checkbox to the `insert link` dialogue box,
19
- * several nofollow `shortcodes` (added in v0.1.0),
20
  * a nofollow option for individual `blogroll links`,
21
- * plus the ability to globally add or remove the nofollow tag in `comments`,
22
- * plugin settings page (added in v0.1.1).
23
 
24
  == Installation ==
25
 
@@ -35,10 +36,14 @@ See the manpages.
35
 
36
  == Screenshots ==
37
 
38
- 1. Source code of a link inserted with the [nofollow] shortcode.
39
 
40
  == Changelog ==
41
 
 
 
 
 
42
  = 0.1.1 =
43
  * Stable beta version.
44
  * Adds full nofollow shortcodes.
@@ -49,7 +54,7 @@ See the manpages.
49
  * Stable, but not all functions active yet.
50
 
51
  == Upgrade Notice ==
52
- Nothing to upgrade yet!
53
 
54
  == Readme Generator ==
55
  * This plugin's readme.txt file was generated by the [WikiDuh Readme Generator](http://wikiduh.com/project/readme-gen) for WordPress Plugins.
5
  Tags: nofollow,link,meta,rel,rel nofollow,seo,link meta,nofollow links,shortcode
6
  Requires at least: 2.8
7
  Tested up to: 3.3.1
8
+ Stable tag: 0.1.2
9
 
10
  A suite of tools that gives you complete control over the rel=nofollow tag on an individual link basis.
11
 
12
  == Description ==
13
  This plugin contains several tools in one to significantly increase your control of the nofollow rel tag on every link on your blog, on both an individual and type basis. It is designed to give you fine-grained control of linking for SEO purposes.
14
 
15
+ **Notice**: This plugin is still in beta. While it is stable, not all functions listed are included yet.
16
 
17
  The plugin's main features are:
18
+
19
  * a nofollow checkbox to the `insert link` dialogue box,
20
+ * several nofollow `shortcodes` *(added in v0.1.0)*,
21
  * a nofollow option for individual `blogroll links`,
22
+ * add or remove the nofollow tag from all links in `comments` *(added in v0.1.2)*,
23
+ * plugin settings page *(added in v0.1.1)*.
24
 
25
  == Installation ==
26
 
36
 
37
  == Screenshots ==
38
 
39
+ 1. Settings page on the Dashboard.
40
 
41
  == Changelog ==
42
 
43
+ = 0.1.2 =
44
+ * Stable beta version.
45
+ * Add/remove nofollow from all links in comments.
46
+
47
  = 0.1.1 =
48
  * Stable beta version.
49
  * Adds full nofollow shortcodes.
54
  * Stable, but not all functions active yet.
55
 
56
  == Upgrade Notice ==
57
+ New features!
58
 
59
  == Readme Generator ==
60
  * This plugin's readme.txt file was generated by the [WikiDuh Readme Generator](http://wikiduh.com/project/readme-gen) for WordPress Plugins.