Version Description
Download this release
Release Info
Developer | uberdose |
Plugin | All in One SEO Pack |
Version | 1.2.7.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.6.8 to 1.2.7.1
- all_in_one_seo_pack.php +28 -20
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.
|
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.
|
32 |
|
33 |
/**
|
34 |
* Max numbers of chars in auto-generated description.
|
@@ -47,7 +47,13 @@ class All_in_One_SEO_Pack {
|
|
47 |
|
48 |
var $db_version = '0.1';
|
49 |
|
50 |
-
var $
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
function template_redirect() {
|
53 |
if (is_feed()) {
|
@@ -71,7 +77,7 @@ class All_in_One_SEO_Pack {
|
|
71 |
if(function_exists('load_plugin_textdomain')) {
|
72 |
load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
|
73 |
}
|
74 |
-
//$this->db_install();
|
75 |
}
|
76 |
|
77 |
function is_static_front_page() {
|
@@ -94,8 +100,10 @@ class All_in_One_SEO_Pack {
|
|
94 |
// make the title rewrite as short as possible
|
95 |
$active_handlers = ob_list_handlers();
|
96 |
if (sizeof($active_handlers) > 0 && $active_handlers[sizeof($active_handlers) - 1] == 'All_in_One_SEO_Pack::output_callback_for_title') {
|
97 |
-
// if we don't land here there *could* be trouble with another plugin :(
|
98 |
ob_end_flush();
|
|
|
|
|
|
|
99 |
}
|
100 |
}
|
101 |
|
@@ -104,7 +112,12 @@ class All_in_One_SEO_Pack {
|
|
104 |
|
105 |
$meta_string = null;
|
106 |
|
107 |
-
echo "<!-- all in one seo pack $this->version
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
if ((is_home() && !$this->is_static_posts_page() && get_option('aiosp_home_keywords')) || $this->is_static_front_page()) {
|
110 |
$keywords = trim(get_option('aiosp_home_keywords'));
|
@@ -188,9 +201,9 @@ class All_in_One_SEO_Pack {
|
|
188 |
$start = strpos($content, "<title>");
|
189 |
$end = strpos($content, "</title>");
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
|
195 |
if ($start && $end) {
|
196 |
$header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
|
@@ -230,6 +243,11 @@ class All_in_One_SEO_Pack {
|
|
230 |
}
|
231 |
}
|
232 |
} else if (is_single()) {
|
|
|
|
|
|
|
|
|
|
|
233 |
$title = get_post_meta($post->ID, "title", true);
|
234 |
if (!$title) {
|
235 |
$title = get_post_meta($post->ID, "title_tag", true);
|
@@ -240,6 +258,7 @@ class All_in_One_SEO_Pack {
|
|
240 |
$title_format = get_option('aiosp_post_title_format');
|
241 |
$new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
242 |
$new_title = str_replace('%post_title%', $title, $new_title);
|
|
|
243 |
$title = $new_title;
|
244 |
$title = trim($title);
|
245 |
$header = $this->replace_title($header, $title);
|
@@ -637,16 +656,6 @@ class All_in_One_SEO_Pack {
|
|
637 |
</tr>
|
638 |
<tr>
|
639 |
<th scope="row" style="text-align:right; vertical-align:top;">
|
640 |
-
<a target="_blank" title="<?php _e('Help for Option Debug Info', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#debuginfo">
|
641 |
-
<?php _e('Debug Info:', 'all_in_one_seo_pack')?>
|
642 |
-
</a>
|
643 |
-
</td>
|
644 |
-
<td>
|
645 |
-
<input type="checkbox" name="aiosp_debug_info" <?php if (get_option('aiosp_debug_info')) echo "checked=\"1\""; ?>/>
|
646 |
-
</td>
|
647 |
-
</tr>
|
648 |
-
<tr>
|
649 |
-
<th scope="row" style="text-align:right; vertical-align:top;">
|
650 |
<a target="_blank" title="<?php _e('Help for Option Rewrite Titles', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#rewritetitles">
|
651 |
<?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
|
652 |
</a>
|
@@ -796,7 +805,6 @@ add_option("aiosp_category_title_format", '%category_title% | %blog_title%', __(
|
|
796 |
add_option("aiosp_archive_title_format", '%date% | %blog_title%', __('All in One SEO Plugin Archive Title Format', 'all_in_one_seo_pack'), 'yes');
|
797 |
add_option("aiosp_tag_title_format", '%tag% | %blog_title%', __('All in One SEO Plugin Tag Title Format', 'all_in_one_seo_pack'), 'yes');
|
798 |
add_option("aiosp_search_title_format", '%search% | %blog_title%', __('All in One SEO Plugin Search Title Format', 'all_in_one_seo_pack'), 'yes');
|
799 |
-
add_option("aiosp_debug_info", 0, __('All in One SEO Plugin Debug Info', 'all_in_one_seo_pack'), 'yes');
|
800 |
|
801 |
$aiosp = new All_in_One_SEO_Pack();
|
802 |
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.7.1
|
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.7.1";
|
32 |
|
33 |
/**
|
34 |
* Max numbers of chars in auto-generated description.
|
47 |
|
48 |
var $db_version = '0.1';
|
49 |
|
50 |
+
var $ob_start_detected = false;
|
51 |
+
|
52 |
+
var $title_start = -1;
|
53 |
+
|
54 |
+
var $title_end = -1;
|
55 |
+
|
56 |
+
var $orig_title = '';
|
57 |
|
58 |
function template_redirect() {
|
59 |
if (is_feed()) {
|
77 |
if(function_exists('load_plugin_textdomain')) {
|
78 |
load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
|
79 |
}
|
80 |
+
//$this->db_install();
|
81 |
}
|
82 |
|
83 |
function is_static_front_page() {
|
100 |
// make the title rewrite as short as possible
|
101 |
$active_handlers = ob_list_handlers();
|
102 |
if (sizeof($active_handlers) > 0 && $active_handlers[sizeof($active_handlers) - 1] == 'All_in_One_SEO_Pack::output_callback_for_title') {
|
|
|
103 |
ob_end_flush();
|
104 |
+
} else {
|
105 |
+
// if we get here there *could* be trouble with another plugin :(
|
106 |
+
$this->ob_start_detected = true;
|
107 |
}
|
108 |
}
|
109 |
|
112 |
|
113 |
$meta_string = null;
|
114 |
|
115 |
+
echo "<!-- all in one seo pack $this->version ";
|
116 |
+
if ($this->ob_start_detected) {
|
117 |
+
echo "ob_start_detected ";
|
118 |
+
}
|
119 |
+
echo "[$this->title_start,$this->title_end,$this->orig_title] ";
|
120 |
+
echo "-->\n";
|
121 |
|
122 |
if ((is_home() && !$this->is_static_posts_page() && get_option('aiosp_home_keywords')) || $this->is_static_front_page()) {
|
123 |
$keywords = trim(get_option('aiosp_home_keywords'));
|
201 |
$start = strpos($content, "<title>");
|
202 |
$end = strpos($content, "</title>");
|
203 |
|
204 |
+
$this->title_start = $start;
|
205 |
+
$this->title_end = $end;
|
206 |
+
$this->orig_title = $title;
|
207 |
|
208 |
if ($start && $end) {
|
209 |
$header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
|
243 |
}
|
244 |
}
|
245 |
} else if (is_single()) {
|
246 |
+
$categories = get_the_category();
|
247 |
+
$category = '';
|
248 |
+
if (count($categories) > 0) {
|
249 |
+
$category = $categories[0]->cat_name;
|
250 |
+
}
|
251 |
$title = get_post_meta($post->ID, "title", true);
|
252 |
if (!$title) {
|
253 |
$title = get_post_meta($post->ID, "title_tag", true);
|
258 |
$title_format = get_option('aiosp_post_title_format');
|
259 |
$new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
|
260 |
$new_title = str_replace('%post_title%', $title, $new_title);
|
261 |
+
$new_title = str_replace('%category%', $category, $new_title);
|
262 |
$title = $new_title;
|
263 |
$title = trim($title);
|
264 |
$header = $this->replace_title($header, $title);
|
656 |
</tr>
|
657 |
<tr>
|
658 |
<th scope="row" style="text-align:right; vertical-align:top;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
659 |
<a target="_blank" title="<?php _e('Help for Option Rewrite Titles', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#rewritetitles">
|
660 |
<?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
|
661 |
</a>
|
805 |
add_option("aiosp_archive_title_format", '%date% | %blog_title%', __('All in One SEO Plugin Archive Title Format', 'all_in_one_seo_pack'), 'yes');
|
806 |
add_option("aiosp_tag_title_format", '%tag% | %blog_title%', __('All in One SEO Plugin Tag Title Format', 'all_in_one_seo_pack'), 'yes');
|
807 |
add_option("aiosp_search_title_format", '%search% | %blog_title%', __('All in One SEO Plugin Search Title Format', 'all_in_one_seo_pack'), 'yes');
|
|
|
808 |
|
809 |
$aiosp = new All_in_One_SEO_Pack();
|
810 |
add_action('wp_head', array($aiosp, 'wp_head'));
|