Platinum SEO Pack - Version 1.2

Version Description

Download this release

Release Info

Developer Rajesh Babu
Plugin Icon 128x128 Platinum SEO Pack
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

Files changed (2) hide show
  1. Changelog.txt +5 -0
  2. platinum_seo_pack.php +71 -18
Changelog.txt CHANGED
@@ -1,3 +1,8 @@
1
2008-07-17 Rajesh (http://techblissonline.com/)
2
3
* Updated for wordpress 2.6
1
+ 2008-08-17 Rajesh (http://techblissonline.com/)
2
+
3
+ * Updated for providing Nofollow option for archive listings
4
+ platinum_seo_pack.php
5
+
6
2008-07-17 Rajesh (http://techblissonline.com/)
7
8
* Updated for wordpress 2.6
platinum_seo_pack.php CHANGED
@@ -4,7 +4,7 @@
4
Plugin Name: Platinum SEO Pack
5
Plugin URI: http://techblissonline.com/platinum-seo-pack/
6
Description: Complete SEO solution for your Wordpress blog.
7
- Version: 1.1
8
Author: Techblissonline Dot Com
9
Author URI: http://techblissonline.com/
10
*/
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29
30
class Platinum_SEO_Pack {
31
32
- var $version = "1.1";
33
34
/** Max numbers of chars in auto-generated description */
35
var $max_description_length = 160;
@@ -172,7 +172,7 @@ class Platinum_SEO_Pack {
172
173
function add_nofollow($matches) {
174
$origin = get_bloginfo('wpurl');
175
- if ((strpos($matches[2],$origin)) === false && ( strpos($matches[1],'rel="nofollow"') === false ) && ( strpos($matches[3],'rel="nofollow"') === false ) ) {
176
$nofollow = ' rel="nofollow" ';
177
} else {
178
$nofollow = '';
@@ -183,7 +183,8 @@ class Platinum_SEO_Pack {
183
function nofollow_home_category($output) {
184
// Loop through the content of each post and add a nofollow to links on home page or a category page.
185
if (is_home() || is_category() ||is_search() || (function_exists(is_tag) && is_tag()) || is_author()) {
186
- $anchorPattern = '/<a (.*?)href="(.*?)"(.*?)>(.*?)<\/a>/i';
187
$output = preg_replace_callback($anchorPattern,array(get_class($this),'add_nofollow'),$output);
188
}
189
return $output;
@@ -213,6 +214,18 @@ class Platinum_SEO_Pack {
213
return $output;
214
}
215
}
216
217
function nofollow_taglinks($output) {
218
@@ -280,7 +293,7 @@ class Platinum_SEO_Pack {
280
} else {
281
$meta .= "index,follow";
282
}
283
- }else if ((function_exists(is_tag) && is_tag() && !get_option('psp_tags_noindex'))|| (is_category() && !get_option('psp_category_noindex')) || (is_author() && !get_option('psp_author_archives_noindex')) || (is_date() && !get_option('psp_archive_noindex')) || (is_search() && !get_option('psp_search_results_noindex')) || (is_author() && !get_option('psp_author_archives_noindex')) ) {
284
if (get_option('psp_sub_pages_home_noindex') && get_query_var('paged') > 1) {
285
$meta .= "noindex,follow";
286
} else {
@@ -324,17 +337,17 @@ class Platinum_SEO_Pack {
324
echo "[$this->title_start,$this->title_end] ";
325
echo "-->\n";
326
327
- if ((is_home() && get_option('aiosp_home_keywords')) || $this->is_static_front_page()) {
328
$keywords = trim($this->internationalize(get_option('aiosp_home_keywords')));
329
} else {
330
$keywords = $this->get_all_keywords();
331
}
332
if (is_single() || is_page()) {
333
- if ($this->is_static_front_page()) {
334
- $description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
335
- } else {
336
$description = $this->get_post_description($post);
337
- }
338
} else if (is_home()) {
339
$description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
340
} else if (is_category()) {
@@ -617,11 +630,11 @@ class Platinum_SEO_Pack {
617
} else if (is_page()) {
618
// we're not in the loop :(
619
$authordata = get_userdata($post->post_author);
620
- if ($this->is_static_front_page()) {
621
- if ($this->internationalize(get_option('aiosp_home_title'))) {
622
- $header = $this->replace_title($header, $this->internationalize(get_option('aiosp_home_title')));
623
- }
624
- } else {
625
$title = $this->internationalize(get_post_meta($post->ID, "title", true));
626
if (!$title) {
627
$title = $this->internationalize(wp_title('', false));
@@ -636,7 +649,7 @@ class Platinum_SEO_Pack {
636
$new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
637
$title = trim($new_title);
638
$header = $this->replace_title($header, $title);
639
- }
640
} else if (function_exists('is_tag') && is_tag()) {
641
global $utw;
642
if ($utw) {
@@ -1178,6 +1191,8 @@ class Platinum_SEO_Pack {
1178
update_option('psp_noydir_metatag', $_POST['psp_noydir_metatag']);
1179
update_option('psp_nofollow_cat_pages', $_POST['psp_nofollow_cat_pages']);
1180
update_option('psp_nofollow_cat_posts', $_POST['psp_nofollow_cat_posts']);
1181
update_option('psp_nofollow_ext_links', $_POST['psp_nofollow_ext_links']);
1182
update_option('psp_nofollow_login_reg', $_POST['psp_nofollow_login_reg']);
1183
update_option('psp_nofollow_tag_pages', $_POST['psp_nofollow_tag_pages']);
@@ -1617,14 +1632,14 @@ _e('Check this for excluding all search result pages from being indexed.', 'plat
1617
<tr>
1618
<th scope="row" style="text-align:right; vertical-align:top;">
1619
<a style="cursor:pointer;" title="<?php _e('Click for Help!', 'platinum_seo_pack')?>" onclick="toggleVisibility('psp_sub_pages_home_noindex_tip');">
1620
- <?php _e('Use noindex for sub pages of home:', 'platinum_seo_pack')?>
1621
</a>
1622
</td>
1623
<td>
1624
<input type="checkbox" name="psp_sub_pages_home_noindex" <?php if (get_option('psp_sub_pages_home_noindex')) echo "checked=\"1\""; ?>/>
1625
<div style="max-width:500px; text-align:left; display:none" id="psp_sub_pages_home_noindex_tip">
1626
<?php
1627
- _e('Check this for excluding all sub pages of home from being indexed.', 'platinum_seo_pack');
1628
?>
1629
</div>
1630
</td>
@@ -1710,6 +1725,38 @@ _e('Check this to nofollow category listings on posts (Not recommended)', 'plati
1710
</td>
1711
</tr>
1712
1713
<tr>
1714
<th scope="row" style="text-align:right; vertical-align:top;">
1715
<a style="cursor:pointer;" title="<?php _e('Click for Help!', 'platinum_seo_pack')?>" onclick="toggleVisibility('psp_nofollow_ext_links_tip');">
@@ -1868,6 +1915,8 @@ add_option("psp_noodp_metatag", 1, 'Platinum SEO Plugin noodp metatag', 'yes');
1868
add_option("psp_noydir_metatag", 1, 'Platinum SEO Plugin noydir metatag', 'yes');
1869
add_option("psp_nofollow_cat_pages", 0, 'Platinum SEO Plugin Nofollow categories on pages', 'yes');
1870
add_option("psp_nofollow_cat_posts", 0, 'Platinum SEO Plugin Nofollow categories on single posts', 'yes');
1871
add_option("psp_nofollow_ext_links", 0, 'Platinum SEO Plugin Nofollow external links on front page', 'yes');
1872
add_option("psp_nofollow_login_reg", 1, 'Platinum SEO Plugin Nofollow login and register links', 'yes');
1873
add_option("psp_nofollow_tag_pages", 0, 'Platinum SEO Plugin Nofollow links to tag pages', 'yes');
@@ -1921,6 +1970,10 @@ if (get_option('psp_rss_feeds_noindex')) {
1921
if (get_option('psp_nofollow_cat_pages') || get_option('psp_nofollow_cat_posts')) {
1922
add_filter('wp_list_categories',array($psp,'nofollow_category_listing'));
1923
}
1924
if (get_option('psp_nofollow_login_reg')) {
1925
add_filter('loginout',array($psp,'nofollow_link'));
1926
add_filter('register',array($psp,'nofollow_link'));
4
Plugin Name: Platinum SEO Pack
5
Plugin URI: http://techblissonline.com/platinum-seo-pack/
6
Description: Complete SEO solution for your Wordpress blog.
7
+ Version: 1.2
8
Author: Techblissonline Dot Com
9
Author URI: http://techblissonline.com/
10
*/
29
30
class Platinum_SEO_Pack {
31
32
+ var $version = "1.2";
33
34
/** Max numbers of chars in auto-generated description */
35
var $max_description_length = 160;
172
173
function add_nofollow($matches) {
174
$origin = get_bloginfo('wpurl');
175
+ if ((strpos($matches[2],$origin)) === false && ( strpos($matches[1],'rel="nofollow"') === false ) && ( strpos($matches[3],'rel="nofollow"') === false ) && ( strpos($matches[1],'rel="external nofollow"') === false ) && ( strpos($matches[3],'rel="external nofollow"') === false )) {
176
$nofollow = ' rel="nofollow" ';
177
} else {
178
$nofollow = '';
183
function nofollow_home_category($output) {
184
// Loop through the content of each post and add a nofollow to links on home page or a category page.
185
if (is_home() || is_category() ||is_search() || (function_exists(is_tag) && is_tag()) || is_author()) {
186
+ //$anchorPattern = '/<a (.*?)href="(.*?)"(.*?)>(.*?)<\/a>/i';
187
+ $anchorPattern = '/<a ([^<>]*?)href="(.*?)"([^<>]*?)>(.*?)<\/a>/i';
188
$output = preg_replace_callback($anchorPattern,array(get_class($this),'add_nofollow'),$output);
189
}
190
return $output;
214
return $output;
215
}
216
}
217
+
218
+ function nofollow_archive_listing($output) {
219
+
220
+ if ( (get_option('psp_nofollow_arc_posts') && (is_single() || is_search()) ) || (get_option('psp_nofollow_arc_pages') && (is_home() || is_page() || is_category() || is_tag()) ) ) {
221
+ $output = $this->nofollow_link($output);
222
+ return $output;
223
+
224
+ } else {
225
+
226
+ return $output;
227
+ }
228
+ }
229
230
function nofollow_taglinks($output) {
231
293
} else {
294
$meta .= "index,follow";
295
}
296
+ }else if ((function_exists(is_tag) && is_tag() && !get_option('psp_tags_noindex'))|| (is_category() && !get_option('psp_category_noindex')) || (is_author() && !get_option('psp_author_archives_noindex')) || (is_date() && !get_option('psp_archive_noindex')) || (is_search() && !get_option('psp_search_results_noindex')) ) {
297
if (get_option('psp_sub_pages_home_noindex') && get_query_var('paged') > 1) {
298
$meta .= "noindex,follow";
299
} else {
337
echo "[$this->title_start,$this->title_end] ";
338
echo "-->\n";
339
340
+ if ((is_home() && get_option('aiosp_home_keywords'))) { // || $this->is_static_front_page()) {
341
$keywords = trim($this->internationalize(get_option('aiosp_home_keywords')));
342
} else {
343
$keywords = $this->get_all_keywords();
344
}
345
if (is_single() || is_page()) {
346
+ //if ($this->is_static_front_page()) {
347
+ // $description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
348
+ //} else {
349
$description = $this->get_post_description($post);
350
+ // }
351
} else if (is_home()) {
352
$description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
353
} else if (is_category()) {
630
} else if (is_page()) {
631
// we're not in the loop :(
632
$authordata = get_userdata($post->post_author);
633
+ //if ($this->is_static_front_page()) {
634
+ //if ($this->internationalize(get_option('aiosp_home_title'))) {
635
+ // $header = $this->replace_title($header, $this->internationalize(get_option('aiosp_home_title')));
636
+ //}
637
+ //} else {
638
$title = $this->internationalize(get_post_meta($post->ID, "title", true));
639
if (!$title) {
640
$title = $this->internationalize(wp_title('', false));
649
$new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
650
$title = trim($new_title);
651
$header = $this->replace_title($header, $title);
652
+ //}
653
} else if (function_exists('is_tag') && is_tag()) {
654
global $utw;
655
if ($utw) {
1191
update_option('psp_noydir_metatag', $_POST['psp_noydir_metatag']);
1192
update_option('psp_nofollow_cat_pages', $_POST['psp_nofollow_cat_pages']);
1193
update_option('psp_nofollow_cat_posts', $_POST['psp_nofollow_cat_posts']);
1194
+ update_option('psp_nofollow_arc_pages', $_POST['psp_nofollow_arc_pages']);
1195
+ update_option('psp_nofollow_arc_posts', $_POST['psp_nofollow_arc_posts']);
1196
update_option('psp_nofollow_ext_links', $_POST['psp_nofollow_ext_links']);
1197
update_option('psp_nofollow_login_reg', $_POST['psp_nofollow_login_reg']);
1198
update_option('psp_nofollow_tag_pages', $_POST['psp_nofollow_tag_pages']);
1632
<tr>
1633
<th scope="row" style="text-align:right; vertical-align:top;">
1634
<a style="cursor:pointer;" title="<?php _e('Click for Help!', 'platinum_seo_pack')?>" onclick="toggleVisibility('psp_sub_pages_home_noindex_tip');">
1635
+ <?php _e('Use noindex for sub pages:', 'platinum_seo_pack')?>
1636
</a>
1637
</td>
1638
<td>
1639
<input type="checkbox" name="psp_sub_pages_home_noindex" <?php if (get_option('psp_sub_pages_home_noindex')) echo "checked=\"1\""; ?>/>
1640
<div style="max-width:500px; text-align:left; display:none" id="psp_sub_pages_home_noindex_tip">
1641
<?php
1642
+ _e('Check this for excluding all sub pages of home, categories, date based archives, tag, search and author pages from being indexed.', 'platinum_seo_pack');
1643
?>
1644
</div>
1645
</td>
1725
</td>
1726
</tr>
1727
1728
+ <tr>
1729
+ <th scope="row" style="text-align:right; vertical-align:top;">
1730
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'platinum_seo_pack')?>" onclick="toggleVisibility('psp_nofollow_arc_pages_tip');">
1731
+ <?php _e('nofollow archive listings on pages:', 'platinum_seo_pack')?>
1732
+ </a>
1733
+ </td>
1734
+ <td>
1735
+ <input type="checkbox" name="psp_nofollow_arc_pages" <?php if (get_option('psp_nofollow_arc_pages')) echo "checked=\"1\""; ?>/>
1736
+ <div style="max-width:500px; text-align:left; display:none" id="psp_nofollow_arc_pages_tip">
1737
+ <?php
1738
+ _e('Check this to nofollow archive listings on pages.', 'platinum_seo_pack');
1739
+ ?>
1740
+ </div>
1741
+ </td>
1742
+ </tr>
1743
+
1744
+ <tr>
1745
+ <th scope="row" style="text-align:right; vertical-align:top;">
1746
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'platinum_seo_pack')?>" onclick="toggleVisibility('psp_nofollow_arc_posts_tip');">
1747
+ <?php _e('nofollow archive listings on posts:', 'platinum_seo_pack')?>
1748
+ </a>
1749
+ </td>
1750
+ <td>
1751
+ <input type="checkbox" name="psp_nofollow_arc_posts" <?php if (get_option('psp_nofollow_arc_posts')) echo "checked=\"1\""; ?>/>
1752
+ <div style="max-width:500px; text-align:left; display:none" id="psp_nofollow_arc_posts_tip">
1753
+ <?php
1754
+ _e('Check this to nofollow archive listings on posts (Not recommended)', 'platinum_seo_pack');
1755
+ ?>
1756
+ </div>
1757
+ </td>
1758
+ </tr>
1759
+
1760
<tr>
1761
<th scope="row" style="text-align:right; vertical-align:top;">
1762
<a style="cursor:pointer;" title="<?php _e('Click for Help!', 'platinum_seo_pack')?>" onclick="toggleVisibility('psp_nofollow_ext_links_tip');">
1915
add_option("psp_noydir_metatag", 1, 'Platinum SEO Plugin noydir metatag', 'yes');
1916
add_option("psp_nofollow_cat_pages", 0, 'Platinum SEO Plugin Nofollow categories on pages', 'yes');
1917
add_option("psp_nofollow_cat_posts", 0, 'Platinum SEO Plugin Nofollow categories on single posts', 'yes');
1918
+ add_option("psp_nofollow_arc_pages", 0, 'Platinum SEO Plugin Nofollow archives on pages', 'yes');
1919
+ add_option("psp_nofollow_arc_posts", 0, 'Platinum SEO Plugin Nofollow archives on single posts', 'yes');
1920
add_option("psp_nofollow_ext_links", 0, 'Platinum SEO Plugin Nofollow external links on front page', 'yes');
1921
add_option("psp_nofollow_login_reg", 1, 'Platinum SEO Plugin Nofollow login and register links', 'yes');
1922
add_option("psp_nofollow_tag_pages", 0, 'Platinum SEO Plugin Nofollow links to tag pages', 'yes');
1970
if (get_option('psp_nofollow_cat_pages') || get_option('psp_nofollow_cat_posts')) {
1971
add_filter('wp_list_categories',array($psp,'nofollow_category_listing'));
1972
}
1973
+
1974
+ if (get_option('psp_nofollow_arc_pages') || get_option('psp_nofollow_arc_posts')) {
1975
+ add_filter('get_archives_link',array($psp,'nofollow_archive_listing'));
1976
+ }
1977
if (get_option('psp_nofollow_login_reg')) {
1978
add_filter('loginout',array($psp,'nofollow_link'));
1979
add_filter('register',array($psp,'nofollow_link'));