Platinum SEO Pack - Version 1.2.7

Version Description

Download this release

Release Info

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

Code changes from version 1.2.6 to 1.2.7

Files changed (3) hide show
  1. Changelog.txt +5 -0
  2. platinum_seo_pack.php +134 -15
  3. readme.txt +2 -2
Changelog.txt CHANGED
@@ -1,3 +1,8 @@
1
2009-05-25 Rajesh (http://techblissonline.com/) - Version 1.2.6
2
3
* Corrected a minor problem with canonical link.
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.
4
+ platinum_seo_pack.php
5
+
6
2009-05-25 Rajesh (http://techblissonline.com/) - Version 1.2.6
7
8
* Corrected a minor problem with canonical link.
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.6
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.6";
33
34
/** Max numbers of chars in auto-generated description */
35
var $max_description_length = 160;
@@ -71,6 +71,16 @@ class Platinum_SEO_Pack {
71
function Platinum_SEO_Pack() {
72
global $wp_version;
73
$this->wp_version = $wp_version;
74
75
$this->log_file = dirname(__FILE__) . '/platinum_seo_pack.log';
76
if (get_option('aiosp_do_log')) {
@@ -110,9 +120,18 @@ class Platinum_SEO_Pack {
110
111
function has_permalink_changed() {
112
113
- if( is_404() ) {
114
115
- $slug = basename( $_SERVER['REQUEST_URI'] );
116
117
if( $ID = $this->does_post_exist( $slug )) {
118
@@ -154,7 +173,9 @@ class Platinum_SEO_Pack {
154
155
function init() {
156
if (function_exists('load_plugin_textdomain')) {
157
- load_plugin_textdomain('platinum_seo_pack', 'wp-content/plugins/platinum-seo-pack');
158
}
159
}
160
@@ -362,7 +383,9 @@ class Platinum_SEO_Pack {
362
}
363
// }
364
} else if (is_home()) {
365
$description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
366
if ($canonical) {
367
if ((get_option('show_on_front') == 'page') && ($pageid = get_option('page_for_posts')))
368
{
@@ -376,7 +399,20 @@ class Platinum_SEO_Pack {
376
}
377
}
378
} else if (is_category()) {
379
- $description = $this->internationalize(category_description());
380
if ($canonical) {
381
$cat_link = get_category_link(get_query_var('cat'));
382
$can_link = $this->paged_link($cat_link);
@@ -415,12 +451,31 @@ class Platinum_SEO_Pack {
415
$can_link = get_year_link(get_query_var('year'));
416
$can_link = $this->paged_link($can_link);
417
}
418
- } else if (function_exists(is_tag) && is_tag() && ($canonical)) {
419
$tag = get_term_by('slug',get_query_var('tag'),'post_tag');
420
if (!empty($tag->term_id)) {
421
$tag_link = get_tag_link($tag->term_id);
422
}
423
- $can_link = $this->paged_link($tag_link);
424
} else if (is_author() && ($canonical)) {
425
global $wp_version;
426
if ($wp_version >= '2') {
@@ -432,12 +487,12 @@ class Platinum_SEO_Pack {
432
} else {
433
global $cache_userdata;
434
$userid = get_query_var('author');
435
- $can_link = get_author_link(false, $userid, $cache_userdata[$userid]->user_nicename);
436
$can_link = $this->paged_link($auth_link);
437
}
438
}
439
440
- if (isset($description) && (strlen($description) > $this->min_description_length) && !(is_home() && is_paged())) {
441
$description = trim(strip_tags($description));
442
$description = str_replace('"', '', $description);
443
@@ -466,7 +521,7 @@ class Platinum_SEO_Pack {
466
$meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
467
}
468
469
- if (isset ($keywords) && !empty($keywords) && !(is_home() && is_paged())) {
470
if (isset($meta_string)) {
471
$meta_string .= "\n";
472
}
@@ -521,6 +576,50 @@ class Platinum_SEO_Pack {
521
}
522
return $link;
523
}
524
525
function get_post_description($post) {
526
$description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "description", true))));
@@ -536,6 +635,15 @@ class Platinum_SEO_Pack {
536
537
return $description;
538
}
539
540
function replace_title($content, $title) {
541
$title = trim(strip_tags($title));
@@ -867,7 +975,7 @@ class Platinum_SEO_Pack {
867
}
868
869
// if we are on synthetic pages
870
- if (!is_home() && !is_page() && !is_single() &&!$this->is_static_front_page() && !$this->is_static_posts_page()) {
871
return null;
872
}
873
@@ -1067,7 +1175,8 @@ class Platinum_SEO_Pack {
1067
1068
function add_meta_index_tags($id) {
1069
$awmp_edit = $_POST["psp_edit"];
1070
- if (isset($awmp_edit) && !empty($awmp_edit)) {
1071
$keywords = $_POST["psp_keywords"];
1072
$description = $_POST["psp_description"];
1073
$title = $_POST["psp_title"];
@@ -1180,6 +1289,7 @@ class Platinum_SEO_Pack {
1180
<th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'platinum_seo_pack') ?></th>
1181
<td><input value="<?php echo $keywords ?>" type="text" name="psp_keywords" size="62"/></td>
1182
</tr>
1183
1184
<?php if ( current_user_can('edit_posts') ) { ?>
1185
<tr>
@@ -1282,6 +1392,8 @@ class Platinum_SEO_Pack {
1282
1283
// update options
1284
if ($_POST['action'] && $_POST['action'] == 'psp_update') {
1285
$message = $message_updated;
1286
update_option('aiosp_home_title', $_POST['psp_home_title']);
1287
update_option('aiosp_home_description', $_POST['psp_home_description']);
@@ -1355,9 +1467,10 @@ class Platinum_SEO_Pack {
1355
| <a target="_blank" title="<?php _e('FAQ', 'platinum_seo_pack') ?>"
1356
href="http://techblissonline.com/platinum-seo-pack-faq/"><?php _e('FAQ', 'platinum_seo_pack') ?></a>
1357
| <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>
1358
- | <a target="_blank" title="<?php _e('Platinum SEO Plugin Feedback', 'platinum_seo_pack') ?>"
1359
- href="http://techblissonline.com/wordpress-seo-plugin-smart-options-benefits/"><?php _e('Wordpress SEO options', 'platinum_seo_pack') ?></a>
1360
| <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>
1361
</p>
1362
1363
<script type="text/javascript">
@@ -2091,6 +2204,7 @@ _e('Check this to link to Platinum SEO and spread the word.If you do not want to
2091
</table>
2092
<p class="submit">
2093
<input type="hidden" name="action" value="psp_update" />
2094
<input type="submit" name="Submit" value="<?php _e('Update Options', 'platinum_seo_pack')?> &raquo;" />
2095
</p>
2096
</form>
@@ -2191,6 +2305,11 @@ if (get_option('psp_link_home')) {
2191
add_action('wp_footer',array($psp,'add_footer_link'));
2192
}
2193
2194
/** if (get_option('psp_nofollow_ext_links')) {
2195
add_filter('the_content',array($psp,'nofollow_home_category'));
2196
} **/
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
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;
71
function Platinum_SEO_Pack() {
72
global $wp_version;
73
$this->wp_version = $wp_version;
74
+
75
+ // Pre-2.6 compatibility
76
+ if ( ! defined( 'WP_CONTENT_URL' ) )
77
+ define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
78
+ if ( ! defined( 'WP_CONTENT_DIR' ) )
79
+ define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
80
+ if ( ! defined( 'WP_PLUGIN_URL' ) )
81
+ define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
82
+ if ( ! defined( 'WP_PLUGIN_DIR' ) )
83
+ define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
84
85
$this->log_file = dirname(__FILE__) . '/platinum_seo_pack.log';
86
if (get_option('aiosp_do_log')) {
120
121
function has_permalink_changed() {
122
123
+ if( is_404() ) {
124
125
+ $slug = basename( $_SERVER['REQUEST_URI'] );
126
+
127
+ $exts=array("/",".php",".html",".htm");
128
+
129
+ // works with PHP version <= 5.x.x
130
+ foreach( $exts as $ext )
131
+ {
132
+ $slug = str_replace( $ext, "", $slug );
133
+ $slug = trim($slug);
134
+ }
135
136
if( $ID = $this->does_post_exist( $slug )) {
137
173
174
function init() {
175
if (function_exists('load_plugin_textdomain')) {
176
+
177
+ load_plugin_textdomain('platinum_seo_pack', WP_PLUGIN_DIR . '/platinum-seo-pack');
178
+
179
}
180
}
181
383
}
384
// }
385
} else if (is_home()) {
386
+
387
$description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
388
+
389
if ($canonical) {
390
if ((get_option('show_on_front') == 'page') && ($pageid = get_option('page_for_posts')))
391
{
399
}
400
}
401
} else if (is_category()) {
402
+
403
+ $cat_description = category_description();
404
+ $description = $this->get_string_between($cat_description, "[description]", "[/description]");
405
+ $keywords = $this->get_string_between($cat_description, "[keywords]", "[/keywords]");
406
+
407
+ if ($description == "" || $description == null) {
408
+ $description = $this->trim_excerpt_without_filters($this->internationalize($cat_description));
409
+ } else {
410
+ $description = $this->trim_excerpt_without_filters($this->internationalize($description));
411
+ }
412
+
413
+ if ($keywords != "" || $keywords != null) {
414
+ $keywords = $this->internationalize($keywords);
415
+ }
416
if ($canonical) {
417
$cat_link = get_category_link(get_query_var('cat'));
418
$can_link = $this->paged_link($cat_link);
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]");
460
+
461
+ if ($description == "" || $description == null) {
462
+ $description = $this->trim_excerpt_without_filters($this->internationalize($tag_description));
463
+ } else {
464
+ $description = $this->trim_excerpt_without_filters($this->internationalize($description));
465
+ }
466
+
467
+ if ($keywords != "" || $keywords != null) {
468
+ $keywords = $this->internationalize($keywords);
469
+ }
470
+ }
471
+
472
+ if ($canonical) {
473
$tag = get_term_by('slug',get_query_var('tag'),'post_tag');
474
if (!empty($tag->term_id)) {
475
$tag_link = get_tag_link($tag->term_id);
476
}
477
+ $can_link = $this->paged_link($tag_link);
478
+ }
479
} else if (is_author() && ($canonical)) {
480
global $wp_version;
481
if ($wp_version >= '2') {
487
} else {
488
global $cache_userdata;
489
$userid = get_query_var('author');
490
+ $auth_link = get_author_link(false, $userid, $cache_userdata[$userid]->user_nicename);
491
$can_link = $this->paged_link($auth_link);
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
}
576
}
577
return $link;
578
}
579
+
580
+ function psp_category_description() {
581
+ $cat_description = category_description();
582
+
583
+ $description = $this->get_string_between($cat_description, "[description]", "[/description]");
584
+ if ($description == "" || $description == null) {
585
+ $description = $this->internationalize($cat_description);
586
+ } else {
587
+ $description = $this->internationalize($description);
588
+ }
589
+ echo "$description"."\n";
590
+ }
591
+
592
+ function psp_category_keywords() {
593
+ $cat_description = category_description();
594
+ $keywords = $this->get_string_between($cat_description, "[keywords]", "[/keywords]");
595
+
596
+ if ($keywords != "" || $keywords != null) {
597
+ $keywords = $this->internationalize($keywords);
598
+ }
599
+ echo "$keywords"."\n";
600
+ }
601
+
602
+ function psp_tag_description() {
603
+ $tag_description = tag_description();
604
+
605
+ $description = $this->get_string_between($tag_description, "[description]", "[/description]");
606
+ if ($description == "" || $description == null) {
607
+ $description = $this->internationalize($tag_description);
608
+ } else {
609
+ $description = $this->internationalize($description);
610
+ }
611
+ echo "$description"."\n";
612
+ }
613
+
614
+ function psp_tag_keywords() {
615
+ $tag_description = tag_description();
616
+ $keywords = $this->get_string_between($tag_description, "[keywords]", "[/keywords]");
617
+
618
+ if ($keywords != "" || $keywords != null) {
619
+ $keywords = $this->internationalize($keywords);
620
+ }
621
+ echo "$keywords"."\n";
622
+ }
623
624
function get_post_description($post) {
625
$description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "description", true))));
635
636
return $description;
637
}
638
+
639
+ function get_string_between($string, $start, $end){
640
+ $string = " ".$string;
641
+ $ini = strpos($string,$start);
642
+ if ($ini == 0) return "";
643
+ $ini += strlen($start);
644
+ $len = strpos($string,$end,$ini) - $ini;
645
+ return substr($string,$ini,$len);
646
+ }
647
648
function replace_title($content, $title) {
649
$title = trim(strip_tags($title));
975
}
976
977
// if we are on synthetic pages
978
+ if (!is_home() && !is_page() && !is_single() && !$this->is_static_front_page() && !$this->is_static_posts_page()) {
979
return null;
980
}
981
1175
1176
function add_meta_index_tags($id) {
1177
$awmp_edit = $_POST["psp_edit"];
1178
+ $nonce = $_POST['psp-meta-nonce'];
1179
+ if (isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'psp-meta-nonce')) {
1180
$keywords = $_POST["psp_keywords"];
1181
$description = $_POST["psp_description"];
1182
$title = $_POST["psp_title"];
1289
<th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'platinum_seo_pack') ?></th>
1290
<td><input value="<?php echo $keywords ?>" type="text" name="psp_keywords" size="62"/></td>
1291
</tr>
1292
+ <input type="hidden" name="psp-meta-nonce" value="<?php echo wp_create_nonce('psp-meta-nonce') ?>" />
1293
1294
<?php if ( current_user_can('edit_posts') ) { ?>
1295
<tr>
1392
1393
// update options
1394
if ($_POST['action'] && $_POST['action'] == 'psp_update') {
1395
+ $nonce = $_POST['psp-options-nonce'];
1396
+ if (!wp_verify_nonce($nonce, 'psp-options-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1397
$message = $message_updated;
1398
update_option('aiosp_home_title', $_POST['psp_home_title']);
1399
update_option('aiosp_home_description', $_POST['psp_home_description']);
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>
1474
</p>
1475
1476
<script type="text/javascript">
2204
</table>
2205
<p class="submit">
2206
<input type="hidden" name="action" value="psp_update" />
2207
+ <input type="hidden" name="psp-options-nonce" value="<?php echo wp_create_nonce('psp-options-nonce'); ?>" />
2208
<input type="submit" name="Submit" value="<?php _e('Update Options', 'platinum_seo_pack')?> &raquo;" />
2209
</p>
2210
</form>
2305
add_action('wp_footer',array($psp,'add_footer_link'));
2306
}
2307
2308
+ add_action('get_psp_category_description',array($psp,'psp_category_description'));
2309
+ add_action('get_psp_category_keywords',array($psp,'psp_category_keywords'));
2310
+ add_action('get_psp_tag_description',array($psp,'psp_tag_description'));
2311
+ add_action('get_psp_tag_keywords',array($psp,'psp_tag_keywords'));
2312
+
2313
/** if (get_option('psp_nofollow_ext_links')) {
2314
add_filter('the_content',array($psp,'nofollow_home_category'));
2315
} **/
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Techblissonline Dot Com (Rajesh)
3
Donate link: http://techblissonline.com/platinum-seo-pack/
4
Tags: seo, plugin, wordpress, posts, google, meta index,meta keywords,meta description,title,post, wordpress seo, platinum seo, seo plugin
5
Requires at least: 1.5
6
- Tested up to: 2.7.1
7
Stable tag: trunk
8
9
Platinum SEO Plugin offers Complete onsite SEO solution for your Wordpress blog.Platinum SEO Plugin offers all the functionalities of All In One SEO plus more cooler onsite SEO options. It is automatic and also imports all your current settings in All in one SEO Plugin.But you need to disable All In One SEO before enabling Platinum SEO.
@@ -34,7 +34,7 @@ Some features:
34
1. Unzip into your `/wp-content/plugins/` directory. If you're uploading it make sure to upload
35
the top-level folder. Don't just upload all the php files and put them in `/wp-content/plugins/`.
36
2. Activate the plugin through the 'Plugins' menu in WordPress
37
- 3. Visit your SEO options (*Options - Platinum SEO*) for Wordpress 2.3.x, (*Settings - Platinum SEO*) for Wordpress 2.5.x, 2.6.x & 2.7
38
That's all folks!
39
40
If you have to upgrade manually simply repeat the installation steps.
3
Donate link: http://techblissonline.com/platinum-seo-pack/
4
Tags: seo, plugin, wordpress, posts, google, meta index,meta keywords,meta description,title,post, wordpress seo, platinum seo, seo plugin
5
Requires at least: 1.5
6
+ Tested up to: 2.8.4
7
Stable tag: trunk
8
9
Platinum SEO Plugin offers Complete onsite SEO solution for your Wordpress blog.Platinum SEO Plugin offers all the functionalities of All In One SEO plus more cooler onsite SEO options. It is automatic and also imports all your current settings in All in one SEO Plugin.But you need to disable All In One SEO before enabling Platinum SEO.
34
1. Unzip into your `/wp-content/plugins/` directory. If you're uploading it make sure to upload
35
the top-level folder. Don't just upload all the php files and put them in `/wp-content/plugins/`.
36
2. Activate the plugin through the 'Plugins' menu in WordPress
37
+ 3. Visit your SEO options (*Options - Platinum SEO*) for Wordpress 2.3.x, (*Settings - Platinum SEO*) for Wordpress 2.5.x, 2.6.x, 2.7.x, & 2.8.x
38
That's all folks!
39
40
If you have to upgrade manually simply repeat the installation steps.