Version Description
Download this release
Release Info
Developer | uberdose |
Plugin | All in One SEO Pack |
Version | 1.2.6.6 |
Comparing to | |
See all releases |
Code changes from version 1.2.6.3 to 1.2.6.6
- all_in_one_seo_pack.php +67 -9
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.6.
|
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.6.
|
32 |
|
33 |
/**
|
34 |
* Number of words to be used (max) for generating an excerpt.
|
@@ -147,9 +147,13 @@ class All_in_One_SEO_Pack {
|
|
147 |
$meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\"/>", $keywords);
|
148 |
}
|
149 |
|
150 |
-
if((
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
153 |
if (isset($meta_string)) {
|
154 |
$meta_string .= "\n";
|
155 |
}
|
@@ -221,7 +225,10 @@ class All_in_One_SEO_Pack {
|
|
221 |
} else if (is_single()) {
|
222 |
$title = get_post_meta($post->ID, "title", true);
|
223 |
if (!$title) {
|
224 |
-
$title =
|
|
|
|
|
|
|
225 |
}
|
226 |
$title_format = get_option('aiosp_post_title_format');
|
227 |
$new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
@@ -231,10 +238,14 @@ class All_in_One_SEO_Pack {
|
|
231 |
$header = $this->replace_title($header, $title);
|
232 |
} else if (is_search() && isset($s) && !empty($s)) {
|
233 |
if (function_exists('attribute_escape')) {
|
234 |
-
$
|
235 |
} else {
|
236 |
-
$
|
237 |
}
|
|
|
|
|
|
|
|
|
238 |
$header = $this->replace_title($header, $title);
|
239 |
} else if (is_category() && !is_feed()) {
|
240 |
$category_name = ucwords(single_cat_title('', false));
|
@@ -263,7 +274,17 @@ class All_in_One_SEO_Pack {
|
|
263 |
if ($utw) {
|
264 |
$tags = $utw->GetCurrentTagSet();
|
265 |
$tag = $tags[0]->tag;
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
}
|
268 |
} else if (is_archive()) {
|
269 |
$date = wp_title('', false);
|
@@ -278,6 +299,17 @@ class All_in_One_SEO_Pack {
|
|
278 |
|
279 |
}
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
function trim_excerpt_without_filters($text) {
|
282 |
$text = str_replace(']]>', ']]>', $text);
|
283 |
$text = strip_tags($text);
|
@@ -536,6 +568,8 @@ class All_in_One_SEO_Pack {
|
|
536 |
update_option('aiosp_page_title_format', $_POST['aiosp_page_title_format']);
|
537 |
update_option('aiosp_category_title_format', $_POST['aiosp_category_title_format']);
|
538 |
update_option('aiosp_archive_title_format', $_POST['aiosp_archive_title_format']);
|
|
|
|
|
539 |
update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
|
540 |
update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
|
541 |
update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
|
@@ -644,6 +678,28 @@ class All_in_One_SEO_Pack {
|
|
644 |
</td>
|
645 |
</tr>
|
646 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
647 |
<tr>
|
648 |
<th scope="row" style="text-align:right; vertical-align:top;">
|
649 |
<a target="_blank" title="<?php _e('Help for Option Categories for META keywords', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#categorymetakeywords">
|
@@ -730,6 +786,8 @@ add_option("aiosp_post_title_format", '%post_title% | %blog_title%', __('All in
|
|
730 |
add_option("aiosp_page_title_format", '%page_title% | %blog_title%', __('All in One SEO Plugin Page Title Format', 'all_in_one_seo_pack'), 'yes');
|
731 |
add_option("aiosp_category_title_format", '%category_title% | %blog_title%', __('All in One SEO Plugin Category Title Format', 'all_in_one_seo_pack'), 'yes');
|
732 |
add_option("aiosp_archive_title_format", '%date% | %blog_title%', __('All in One SEO Plugin Archive Title Format', 'all_in_one_seo_pack'), 'yes');
|
|
|
|
|
733 |
|
734 |
$aiosp = new All_in_One_SEO_Pack();
|
735 |
add_action('wp_head', array($aiosp, 'wp_head'));
|
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.6.6
|
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.6.6";
|
32 |
|
33 |
/**
|
34 |
* Number of words to be used (max) for generating an excerpt.
|
147 |
$meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\"/>", $keywords);
|
148 |
}
|
149 |
|
150 |
+
if (function_exists('is_tag')) {
|
151 |
+
$is_tag = is_tag();
|
152 |
+
}
|
153 |
+
|
154 |
+
if ((is_category() && get_option('aiosp_category_noindex')) ||
|
155 |
+
(!is_category() && is_archive() &&!$is_tag && get_option('aiosp_archive_noindex')) ||
|
156 |
+
(get_option('aiosp_tags_noindex') && $is_tag)) {
|
157 |
if (isset($meta_string)) {
|
158 |
$meta_string .= "\n";
|
159 |
}
|
225 |
} else if (is_single()) {
|
226 |
$title = get_post_meta($post->ID, "title", true);
|
227 |
if (!$title) {
|
228 |
+
$title = get_post_meta($post->ID, "title_tag", true);
|
229 |
+
if (!$title) {
|
230 |
+
$title = wp_title('', false);
|
231 |
+
}
|
232 |
}
|
233 |
$title_format = get_option('aiosp_post_title_format');
|
234 |
$new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
238 |
$header = $this->replace_title($header, $title);
|
239 |
} else if (is_search() && isset($s) && !empty($s)) {
|
240 |
if (function_exists('attribute_escape')) {
|
241 |
+
$search = attribute_escape(stripslashes($s));
|
242 |
} else {
|
243 |
+
$search = wp_specialchars(stripslashes($s), true);
|
244 |
}
|
245 |
+
$search = $this->capitalize($search);
|
246 |
+
$title_format = get_option('aiosp_search_title_format');
|
247 |
+
$title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
248 |
+
$title = str_replace('%search%', $search, $title);
|
249 |
$header = $this->replace_title($header, $title);
|
250 |
} else if (is_category() && !is_feed()) {
|
251 |
$category_name = ucwords(single_cat_title('', false));
|
274 |
if ($utw) {
|
275 |
$tags = $utw->GetCurrentTagSet();
|
276 |
$tag = $tags[0]->tag;
|
277 |
+
$tag = str_replace('-', ' ', $tag);
|
278 |
+
} else {
|
279 |
+
// wordpress > 2.3
|
280 |
+
$tag = wp_title('', false);
|
281 |
+
}
|
282 |
+
if ($tag) {
|
283 |
+
$tag = $this->capitalize($tag);
|
284 |
+
$title_format = get_option('aiosp_tag_title_format');
|
285 |
+
$title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
286 |
+
$title = str_replace('%tag%', $tag, $title);
|
287 |
+
$header = $this->replace_title($header, $title);
|
288 |
}
|
289 |
} else if (is_archive()) {
|
290 |
$date = wp_title('', false);
|
299 |
|
300 |
}
|
301 |
|
302 |
+
function capitalize($s) {
|
303 |
+
$s = trim($s);
|
304 |
+
$tokens = explode(' ', $s);
|
305 |
+
while (list($key, $val) = each($tokens)) {
|
306 |
+
$tokens[$key] = trim($tokens[$key]);
|
307 |
+
$tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
|
308 |
+
}
|
309 |
+
$s = implode(' ', $tokens);
|
310 |
+
return $s;
|
311 |
+
}
|
312 |
+
|
313 |
function trim_excerpt_without_filters($text) {
|
314 |
$text = str_replace(']]>', ']]>', $text);
|
315 |
$text = strip_tags($text);
|
568 |
update_option('aiosp_page_title_format', $_POST['aiosp_page_title_format']);
|
569 |
update_option('aiosp_category_title_format', $_POST['aiosp_category_title_format']);
|
570 |
update_option('aiosp_archive_title_format', $_POST['aiosp_archive_title_format']);
|
571 |
+
update_option('aiosp_tag_title_format', $_POST['aiosp_tag_title_format']);
|
572 |
+
update_option('aiosp_search_title_format', $_POST['aiosp_search_title_format']);
|
573 |
update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
|
574 |
update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
|
575 |
update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
|
678 |
</td>
|
679 |
</tr>
|
680 |
|
681 |
+
<tr>
|
682 |
+
<th scope="row" style="text-align:right; vertical-align:top;">
|
683 |
+
<a target="_blank" title="<?php _e('Help for Tag Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#tagtitleformat">
|
684 |
+
<?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
|
685 |
+
</a>
|
686 |
+
</td>
|
687 |
+
<td>
|
688 |
+
<input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes(get_option('aiosp_tag_title_format')); ?>"/>
|
689 |
+
</td>
|
690 |
+
</tr>
|
691 |
+
|
692 |
+
<tr>
|
693 |
+
<th scope="row" style="text-align:right; vertical-align:top;">
|
694 |
+
<a target="_blank" title="<?php _e('Help for Search Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#searchtitleformat">
|
695 |
+
<?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
|
696 |
+
</a>
|
697 |
+
</td>
|
698 |
+
<td>
|
699 |
+
<input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes(get_option('aiosp_search_title_format')); ?>"/>
|
700 |
+
</td>
|
701 |
+
</tr>
|
702 |
+
|
703 |
<tr>
|
704 |
<th scope="row" style="text-align:right; vertical-align:top;">
|
705 |
<a target="_blank" title="<?php _e('Help for Option Categories for META keywords', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#categorymetakeywords">
|
786 |
add_option("aiosp_page_title_format", '%page_title% | %blog_title%', __('All in One SEO Plugin Page Title Format', 'all_in_one_seo_pack'), 'yes');
|
787 |
add_option("aiosp_category_title_format", '%category_title% | %blog_title%', __('All in One SEO Plugin Category Title Format', 'all_in_one_seo_pack'), 'yes');
|
788 |
add_option("aiosp_archive_title_format", '%date% | %blog_title%', __('All in One SEO Plugin Archive Title Format', 'all_in_one_seo_pack'), 'yes');
|
789 |
+
add_option("aiosp_tag_title_format", '%tag% | %blog_title%', __('All in One SEO Plugin Tag Title Format', 'all_in_one_seo_pack'), 'yes');
|
790 |
+
add_option("aiosp_search_title_format", '%search% | %blog_title%', __('All in One SEO Plugin Search Title Format', 'all_in_one_seo_pack'), 'yes');
|
791 |
|
792 |
$aiosp = new All_in_One_SEO_Pack();
|
793 |
add_action('wp_head', array($aiosp, 'wp_head'));
|