Platinum SEO Pack - Version 1.2.8

Version Description

Download this release

Release Info

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

Code changes from version 1.2.7 to 1.2.8

Files changed (2) hide show
  1. Changelog.txt +5 -0
  2. platinum_seo_pack.php +18 -14
Changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  2009-08-30 Rajesh (http://techblissonline.com/) - Version 1.2.7
2
 
3
  * added options to specify meta description and meta tags for Wordpress category and tag pages.
1
+ 2009-09-11 Rajesh (http://techblissonline.com/) - Version 1.2.8
2
+
3
+ * fixed a superficial bug related to function_exists that caused php errors.
4
+ platinum_seo_pack.php
5
+
6
  2009-08-30 Rajesh (http://techblissonline.com/) - Version 1.2.7
7
 
8
  * added options to specify meta description and meta tags for Wordpress category and tag pages.
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.2.7
8
  Author: Rajesh - 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.2.7";
33
 
34
  /** Max numbers of chars in auto-generated description */
35
  var $max_description_length = 160;
@@ -203,7 +203,7 @@ class Platinum_SEO_Pack {
203
 
204
  function nofollow_home_category($output) {
205
  // Loop through the content of each post and add a nofollow to links on home page or a category page.
206
- if (is_home() || is_category() ||is_search() || (function_exists(is_tag) && is_tag()) || is_author()) {
207
  //$anchorPattern = '/<a (.*?)href="(.*?)"(.*?)>(.*?)<\/a>/i';
208
  $anchorPattern = '/<a ([^<>]*?)href="(.*?)"([^<>]*?)>(.*?)<\/a>/i';
209
  $output = preg_replace_callback($anchorPattern,array(get_class($this),'add_nofollow'),$output);
@@ -313,7 +313,7 @@ class Platinum_SEO_Pack {
313
 
314
  }
315
 
316
- } else if ( (is_author() && get_option('psp_author_archives_noindex')) || (is_category() && get_option('psp_category_noindex')) || (is_date() && get_option('psp_archive_noindex')) || (is_search() && get_option('psp_search_results_noindex')) || (function_exists(is_tag) && is_tag() && get_option('psp_tags_noindex')) ) {
317
  $meta .= "noindex,follow";
318
 
319
  } else if (is_home()) {
@@ -322,7 +322,7 @@ class Platinum_SEO_Pack {
322
  } else {
323
  $meta .= "index,follow";
324
  }
325
- }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')) ) {
326
  if (get_option('psp_sub_pages_home_noindex') && get_query_var('paged') > 1) {
327
  $meta .= "noindex,follow";
328
  } else {
@@ -451,9 +451,9 @@ class Platinum_SEO_Pack {
451
  $can_link = get_year_link(get_query_var('year'));
452
  $can_link = $this->paged_link($can_link);
453
  }
454
- } else if (function_exists(is_tag) && is_tag()) {
455
 
456
- if (function_exists(tag_description)) {
457
  $tag_description = tag_description();
458
  $description = $this->get_string_between($tag_description, "[description]", "[/description]");
459
  $keywords = $this->get_string_between($tag_description, "[keywords]", "[/keywords]");
@@ -492,7 +492,7 @@ class Platinum_SEO_Pack {
492
  }
493
  }
494
 
495
- if (isset($description) && (strlen($description) > $this->min_description_length) && !((is_home() && is_paged()) || (is_category() && is_paged()) || (function_exists(is_tag) && is_tag() && is_paged()))) {
496
  $description = trim(strip_tags($description));
497
  $description = str_replace('"', '', $description);
498
 
@@ -521,7 +521,7 @@ class Platinum_SEO_Pack {
521
  $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
522
  }
523
 
524
- if (isset($keywords) && !empty($keywords) && !((is_home() && is_paged()) || (is_category() && is_paged()) || (function_exists(is_tag) && is_tag() && is_paged()))) {
525
  if (isset($meta_string)) {
526
  $meta_string .= "\n";
527
  }
@@ -1072,11 +1072,15 @@ class Platinum_SEO_Pack {
1072
  function get_unique_keywords($keywords) {
1073
  $small_keywords = array();
1074
  foreach ($keywords as $word) {
1075
- if (function_exists('mb_strtolower')) {
1076
- $small_keywords[] = mb_strtolower($word);
1077
- } else {
 
 
 
 
1078
  $small_keywords[] = strtolower($word);
1079
- }
1080
  }
1081
  $keywords_ar = array_unique($small_keywords);
1082
  return implode(',', $keywords_ar);
@@ -1467,7 +1471,7 @@ class Platinum_SEO_Pack {
1467
  | <a target="_blank" title="<?php _e('FAQ', 'platinum_seo_pack') ?>"
1468
  href="http://techblissonline.com/platinum-seo-pack-faq/"><?php _e('FAQ', 'platinum_seo_pack') ?></a>
1469
  | <a target="_blank" title="<?php _e('Platinum SEO Plugin Feedback', 'platinum_seo_pack') ?>" href="http://techblissonline.com/platinum-seo-pack/"><?php _e('Feedback', 'platinum_seo_pack') ?></a>
1470
- | <a target="_blank" title="<?php _e('Platinum SEO - What is new in version 1.2.7?', 'platinum_seo_pack') ?>" href="http://techblissonline.com/wordpress-categories/"><?php _e('What is new in version 1.2.7?', 'platinum_seo_pack') ?></a>
1471
  | <a target="_blank" title="<?php _e('Platinum SEO - Smart Options, Smart Benefits', 'platinum_seo_pack') ?>" href="http://techblissonline.com/wordpress-seo-plugin-smart-options-benefits/"><?php _e('Wordpress SEO options', 'platinum_seo_pack') ?></a>
1472
  | <a target="_blank" title="<?php _e('Donations for Platinum SEO Plugin', 'platinum_seo_pack') ?>" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=rrajeshbab%40gmail%2ecom&item_name=Platinum%20SEO%20plugin%20development%20and%20support%20expenses&item_number=1&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=IN&bn=PP%2dDonationsBF&charset=UTF%2d8"><?php _e('Please Donate', 'platinum_seo_pack') ?></a>
1473
  | <a target="_blank" title="<?php _e('Save Bandwidth with Chennai Central Plugin', 'platinum_seo_pack') ?>" href="http://techblissonline.com/save-bandwidth/"><?php _e('Save Bandwidth with Chennai Central Plugin', 'platinum_seo_pack') ?></a>
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
8
  Author: Rajesh - Techblissonline Dot Com
9
  Author URI: http://techblissonline.com/
10
  */
29
 
30
  class Platinum_SEO_Pack {
31
 
32
+ var $version = "1.2.8";
33
 
34
  /** Max numbers of chars in auto-generated description */
35
  var $max_description_length = 160;
203
 
204
  function nofollow_home_category($output) {
205
  // Loop through the content of each post and add a nofollow to links on home page or a category page.
206
+ if (is_home() || is_category() ||is_search() || (function_exists('is_tag') && is_tag()) || is_author()) {
207
  //$anchorPattern = '/<a (.*?)href="(.*?)"(.*?)>(.*?)<\/a>/i';
208
  $anchorPattern = '/<a ([^<>]*?)href="(.*?)"([^<>]*?)>(.*?)<\/a>/i';
209
  $output = preg_replace_callback($anchorPattern,array(get_class($this),'add_nofollow'),$output);
313
 
314
  }
315
 
316
+ } else if ( (is_author() && get_option('psp_author_archives_noindex')) || (is_category() && get_option('psp_category_noindex')) || (is_date() && get_option('psp_archive_noindex')) || (is_search() && get_option('psp_search_results_noindex')) || (function_exists('is_tag') && is_tag() && get_option('psp_tags_noindex')) ) {
317
  $meta .= "noindex,follow";
318
 
319
  } else if (is_home()) {
322
  } else {
323
  $meta .= "index,follow";
324
  }
325
+ }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')) ) {
326
  if (get_option('psp_sub_pages_home_noindex') && get_query_var('paged') > 1) {
327
  $meta .= "noindex,follow";
328
  } else {
451
  $can_link = get_year_link(get_query_var('year'));
452
  $can_link = $this->paged_link($can_link);
453
  }
454
+ } else if (function_exists('is_tag') && is_tag()) {
455
 
456
+ if (function_exists('tag_description')) {
457
  $tag_description = tag_description();
458
  $description = $this->get_string_between($tag_description, "[description]", "[/description]");
459
  $keywords = $this->get_string_between($tag_description, "[keywords]", "[/keywords]");
492
  }
493
  }
494
 
495
+ if (isset($description) && (strlen($description) > $this->min_description_length) && !((is_home() && is_paged()) || (is_category() && is_paged()) || (function_exists('is_tag') && is_tag() && is_paged()))) {
496
  $description = trim(strip_tags($description));
497
  $description = str_replace('"', '', $description);
498
 
521
  $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
522
  }
523
 
524
+ if (isset($keywords) && !empty($keywords) && !((is_home() && is_paged()) || (is_category() && is_paged()) || (function_exists('is_tag') && is_tag() && is_paged()))) {
525
  if (isset($meta_string)) {
526
  $meta_string .= "\n";
527
  }
1072
  function get_unique_keywords($keywords) {
1073
  $small_keywords = array();
1074
  foreach ($keywords as $word) {
1075
+ /*if (function_exists('mb_strtolower')) {
1076
+ if (mb_detect_encoding($word) == 'UTF8') {
1077
+ $small_keywords[] = mb_strtolower($word, 'UTF8');
1078
+ } else {
1079
+ $small_keywords[] = strtolower($word);
1080
+ }
1081
+ } else {*/
1082
  $small_keywords[] = strtolower($word);
1083
+ /*}*/
1084
  }
1085
  $keywords_ar = array_unique($small_keywords);
1086
  return implode(',', $keywords_ar);
1471
  | <a target="_blank" title="<?php _e('FAQ', 'platinum_seo_pack') ?>"
1472
  href="http://techblissonline.com/platinum-seo-pack-faq/"><?php _e('FAQ', 'platinum_seo_pack') ?></a>
1473
  | <a target="_blank" title="<?php _e('Platinum SEO Plugin Feedback', 'platinum_seo_pack') ?>" href="http://techblissonline.com/platinum-seo-pack/"><?php _e('Feedback', 'platinum_seo_pack') ?></a>
1474
+ | <a target="_blank" title="<?php _e('Platinum SEO - What is new in version 1.2.8?', 'platinum_seo_pack') ?>" href="http://techblissonline.com/wordpress-categories/"><?php _e('What is new in version 1.2.8?', 'platinum_seo_pack') ?></a>
1475
  | <a target="_blank" title="<?php _e('Platinum SEO - Smart Options, Smart Benefits', 'platinum_seo_pack') ?>" href="http://techblissonline.com/wordpress-seo-plugin-smart-options-benefits/"><?php _e('Wordpress SEO options', 'platinum_seo_pack') ?></a>
1476
  | <a target="_blank" title="<?php _e('Donations for Platinum SEO Plugin', 'platinum_seo_pack') ?>" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=rrajeshbab%40gmail%2ecom&item_name=Platinum%20SEO%20plugin%20development%20and%20support%20expenses&item_number=1&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=IN&bn=PP%2dDonationsBF&charset=UTF%2d8"><?php _e('Please Donate', 'platinum_seo_pack') ?></a>
1477
  | <a target="_blank" title="<?php _e('Save Bandwidth with Chennai Central Plugin', 'platinum_seo_pack') ?>" href="http://techblissonline.com/save-bandwidth/"><?php _e('Save Bandwidth with Chennai Central Plugin', 'platinum_seo_pack') ?></a>