Version Description
Download this release
Release Info
| Developer | uberdose |
| Plugin | |
| Version | 1.2.3.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.2.2 to 1.2.3.2
- all_in_one_seo_pack.php +39 -41
all_in_one_seo_pack.php
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
Plugin Name: All in One SEO Pack
|
| 5 |
Plugin URI: http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/
|
| 6 |
Description: Out-of-the-box SEO for your Wordpress blog.
|
| 7 |
-
Version: 1.2.2
|
| 8 |
Author: uberdose
|
| 9 |
Author URI: http://wp.uberdose.com/
|
| 10 |
*/
|
|
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
| 28 |
|
| 29 |
class All_in_One_SEO_Pack {
|
| 30 |
|
| 31 |
-
var $version = "1.2.2";
|
| 32 |
|
| 33 |
/**
|
| 34 |
* Number of words to be used (max) for generating an excerpt.
|
|
@@ -121,46 +121,56 @@ class All_in_One_SEO_Pack {
|
|
| 121 |
}
|
| 122 |
}
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
function rewrite_title($header) {
|
| 125 |
-
global $post;
|
| 126 |
|
| 127 |
if (is_home()) {
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
$title = stripslashes(get_post_meta($post->ID, "title", true));
|
| 131 |
-
} else if (is_category() && get_option('aiosp_use_category_description_as_title')) {
|
| 132 |
-
$title = category_description();
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
if ($title) {
|
| 136 |
-
$title = addslashes($title);
|
| 137 |
-
$header = preg_replace_callback("/<title>.*<\/title>/",
|
| 138 |
-
create_function('$match',"return '<title>$title</title>';"), $header);
|
| 139 |
-
} else if (get_option('aiosp_rewrite_titles')) {
|
| 140 |
-
global $s;
|
| 141 |
-
if (is_search() && isset($s) && !empty($s)) {
|
| 142 |
-
if (function_exists('attribute_escape')) {
|
| 143 |
-
$title = attribute_escape(stripslashes($s));
|
| 144 |
-
} else {
|
| 145 |
-
$title = wp_specialchars(stripslashes($s), true);
|
| 146 |
-
}
|
| 147 |
-
} else if (is_single() || is_page()) {
|
| 148 |
-
$title = stripslashes(get_post_meta($post->ID, "title", true));
|
| 149 |
-
}
|
| 150 |
-
if (!$title) {
|
| 151 |
-
$title = wp_title('', false);
|
| 152 |
}
|
|
|
|
|
|
|
| 153 |
if ($title) {
|
|
|
|
|
|
|
|
|
|
| 154 |
$title_format = get_option('aiosp_post_title_format');
|
| 155 |
$new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
| 156 |
$new_title = str_replace('%post_title%', $title, $new_title);
|
| 157 |
$title = $new_title;
|
| 158 |
$title = trim($title);
|
| 159 |
-
$header =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
}
|
| 162 |
-
|
| 163 |
return $header;
|
|
|
|
| 164 |
}
|
| 165 |
|
| 166 |
function trim_excerpt_without_filters($text) {
|
|
@@ -332,7 +342,6 @@ class All_in_One_SEO_Pack {
|
|
| 332 |
update_option('aiosp_rewrite_titles', $_POST['aiosp_rewrite_titles']);
|
| 333 |
update_option('aiosp_post_title_format', $_POST['aiosp_post_title_format']);
|
| 334 |
update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
|
| 335 |
-
update_option('aiosp_use_category_description_as_title', $_POST['aiosp_use_category_description_as_title']);
|
| 336 |
update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
|
| 337 |
update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
|
| 338 |
update_option('aiosp_tags_noindex', $_POST['aiosp_tags_noindex']);
|
|
@@ -419,16 +428,6 @@ class All_in_One_SEO_Pack {
|
|
| 419 |
</tr>
|
| 420 |
<tr>
|
| 421 |
<th scope="row" style="text-align:right; vertical-align:top;">
|
| 422 |
-
<a target="_blank" title="<?php _e('Help for Option Category Description as Title', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#usecategorydescriptionastitle">
|
| 423 |
-
<?php _e('Use Category Description as Title:', 'all_in_one_seo_pack')?>
|
| 424 |
-
</a>
|
| 425 |
-
</td>
|
| 426 |
-
<td>
|
| 427 |
-
<input type="checkbox" name="aiosp_use_category_description_as_title" <?php if (get_option('aiosp_use_category_description_as_title')) echo "checked=\"1\""; ?>/>
|
| 428 |
-
</td>
|
| 429 |
-
</tr>
|
| 430 |
-
<tr>
|
| 431 |
-
<th scope="row" style="text-align:right; vertical-align:top;">
|
| 432 |
<a target="_blank" title="<?php _e('Help for Option noindex for Categories', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#usenoindexforcategories">
|
| 433 |
<?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
|
| 434 |
</a>
|
|
@@ -496,7 +495,6 @@ add_option("aiosp_home_title", null, __('All in One SEO Plugin Home Title', 'all
|
|
| 496 |
add_option("aiosp_rewrite_titles", 1, __('All in One SEO Plugin Rewrite Titles', 'all_in_one_seo_pack'), 'yes');
|
| 497 |
add_option("aiosp_use_categories", 1, __('All in One SEO Plugin Use Categories', 'all_in_one_seo_pack'), 'yes');
|
| 498 |
add_option("aiosp_max_words_excerpt", 25, __('All in One SEO Plugin Maximum Number of Words in Auto-Generated Descriptions', 'all_in_one_seo_pack'), 'yes');
|
| 499 |
-
add_option("aiosp_use_category_description_as_title", 0, __('Use Category Description for Title', 'all_in_one_seo_pack'), 'yes');
|
| 500 |
add_option("aiosp_category_noindex", 1, __('All in One SEO Plugin Noindex for Categories', 'all_in_one_seo_pack'), 'yes');
|
| 501 |
add_option("aiosp_archive_noindex", 1, __('All in One SEO Plugin Noindex for Archives', 'all_in_one_seo_pack'), 'yes');
|
| 502 |
add_option("aiosp_tags_noindex", 1, __('All in One SEO Plugin Noindex for Tag Archives', 'all_in_one_seo_pack'), 'yes');
|
| 4 |
Plugin Name: All in One SEO Pack
|
| 5 |
Plugin URI: http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/
|
| 6 |
Description: Out-of-the-box SEO for your Wordpress blog.
|
| 7 |
+
Version: 1.2.3.2
|
| 8 |
Author: uberdose
|
| 9 |
Author URI: http://wp.uberdose.com/
|
| 10 |
*/
|
| 28 |
|
| 29 |
class All_in_One_SEO_Pack {
|
| 30 |
|
| 31 |
+
var $version = "1.2.3.2";
|
| 32 |
|
| 33 |
/**
|
| 34 |
* Number of words to be used (max) for generating an excerpt.
|
| 121 |
}
|
| 122 |
}
|
| 123 |
|
| 124 |
+
function replace_title($content, $title) {
|
| 125 |
+
$title = trim(stripslashes(addslashes($title)));
|
| 126 |
+
$header = preg_replace_callback("/<title>.*<\/title>/",
|
| 127 |
+
create_function('$match_not_needed',"return '<title>$title</title>';"), $content);
|
| 128 |
+
return $header;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
function rewrite_title($header) {
|
| 132 |
+
global $post, $s;
|
| 133 |
|
| 134 |
if (is_home()) {
|
| 135 |
+
if (get_option('aiosp_home_title')) {
|
| 136 |
+
$header = $this->replace_title($header, get_option('aiosp_home_title'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
}
|
| 138 |
+
} else if (is_single()) {
|
| 139 |
+
$title = get_post_meta($post->ID, "title", true);
|
| 140 |
if ($title) {
|
| 141 |
+
$header = $this->replace_title($header, $title);
|
| 142 |
+
} else if (get_option('aiosp_rewrite_titles')) {
|
| 143 |
+
$title = wp_title('', false);
|
| 144 |
$title_format = get_option('aiosp_post_title_format');
|
| 145 |
$new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
| 146 |
$new_title = str_replace('%post_title%', $title, $new_title);
|
| 147 |
$title = $new_title;
|
| 148 |
$title = trim($title);
|
| 149 |
+
$header = $this->replace_title($header, $title);
|
| 150 |
+
}
|
| 151 |
+
} else if (is_search() && isset($s) && !empty($s)) {
|
| 152 |
+
if (function_exists('attribute_escape')) {
|
| 153 |
+
$title = attribute_escape(stripslashes($s));
|
| 154 |
+
} else {
|
| 155 |
+
$title = wp_specialchars(stripslashes($s), true);
|
| 156 |
+
}
|
| 157 |
+
$header = $this->replace_title($header, $title);
|
| 158 |
+
} else if (is_category() && !is_feed) {
|
| 159 |
+
$title = category_description();
|
| 160 |
+
if (!$title) {
|
| 161 |
+
$title = single_cat_title('', false);
|
| 162 |
}
|
| 163 |
+
$header = $this->replace_title($header, $title);
|
| 164 |
+
} else if (is_page()) {
|
| 165 |
+
$title = get_post_meta($post->ID, "title", true);
|
| 166 |
+
if (!$title) {
|
| 167 |
+
$title = wp_title('', false);
|
| 168 |
+
}
|
| 169 |
+
$header = $this->replace_title($header, $title);
|
| 170 |
}
|
| 171 |
+
|
| 172 |
return $header;
|
| 173 |
+
|
| 174 |
}
|
| 175 |
|
| 176 |
function trim_excerpt_without_filters($text) {
|
| 342 |
update_option('aiosp_rewrite_titles', $_POST['aiosp_rewrite_titles']);
|
| 343 |
update_option('aiosp_post_title_format', $_POST['aiosp_post_title_format']);
|
| 344 |
update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
|
|
|
|
| 345 |
update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
|
| 346 |
update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
|
| 347 |
update_option('aiosp_tags_noindex', $_POST['aiosp_tags_noindex']);
|
| 428 |
</tr>
|
| 429 |
<tr>
|
| 430 |
<th scope="row" style="text-align:right; vertical-align:top;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 431 |
<a target="_blank" title="<?php _e('Help for Option noindex for Categories', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#usenoindexforcategories">
|
| 432 |
<?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
|
| 433 |
</a>
|
| 495 |
add_option("aiosp_rewrite_titles", 1, __('All in One SEO Plugin Rewrite Titles', 'all_in_one_seo_pack'), 'yes');
|
| 496 |
add_option("aiosp_use_categories", 1, __('All in One SEO Plugin Use Categories', 'all_in_one_seo_pack'), 'yes');
|
| 497 |
add_option("aiosp_max_words_excerpt", 25, __('All in One SEO Plugin Maximum Number of Words in Auto-Generated Descriptions', 'all_in_one_seo_pack'), 'yes');
|
|
|
|
| 498 |
add_option("aiosp_category_noindex", 1, __('All in One SEO Plugin Noindex for Categories', 'all_in_one_seo_pack'), 'yes');
|
| 499 |
add_option("aiosp_archive_noindex", 1, __('All in One SEO Plugin Noindex for Archives', 'all_in_one_seo_pack'), 'yes');
|
| 500 |
add_option("aiosp_tags_noindex", 1, __('All in One SEO Plugin Noindex for Tag Archives', 'all_in_one_seo_pack'), 'yes');
|
