All in One SEO Pack - Version 1.2.3.1

Version Description

Download this release

Release Info

Developer uberdose
Plugin Icon 128x128 All in One SEO Pack
Version 1.2.3.1
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.3.1

all_in_one_seo_pack-he_IL.po ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: all in one seo pack\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-07-03 09:58+0200\n"
6
+ "Last-Translator: Hannit Cohen <hannit@gmail.com>\n"
7
+ "Language-Team: hannit <webmaster@dakars.info>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: Hebrew\n"
12
+ "X-Poedit-Country: ISRAEL\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: all_in_one_seo_pack.php:263
19
+ #: all_in_one_seo_pack.php:288
20
+ msgid "Title:"
21
+ msgstr "כותרת דפדפן (Title):"
22
+
23
+ #: all_in_one_seo_pack.php:267
24
+ #: all_in_one_seo_pack.php:292
25
+ msgid "Keywords (comma separated):"
26
+ msgstr "מילות מפתח (מופרדות בפסיקים):"
27
+
28
+ #: all_in_one_seo_pack.php:284
29
+ #, fuzzy
30
+ msgid "All in One SEO Pack"
31
+ msgstr "All in One SEO"
32
+
33
+ #: all_in_one_seo_pack.php:296
34
+ msgid "Description:"
35
+ msgstr "תיאור:"
36
+
37
+ #: all_in_one_seo_pack.php:304
38
+ msgid "All in One SEO"
39
+ msgstr "All in One SEO"
40
+
41
+ #: all_in_one_seo_pack.php:309
42
+ msgid "All in One SEO Options Updated."
43
+ msgstr "האפשרויות עודכנו"
44
+
45
+ #: all_in_one_seo_pack.php:333
46
+ msgid "All in One SEO Plugin Options"
47
+ msgstr " אפשרויות All in One SEO"
48
+
49
+ #: all_in_one_seo_pack.php:335
50
+ msgid "<a target=\"_blank\" title=\"All in One SEO Plugin Feedback\" href=\"http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond\">Feedback</a>"
51
+ msgstr "<a target=\"_blank\" title=\"All in One SEO Plugin Feedback\" href=\"http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond\">הביעו דעה</a>"
52
+
53
+ #: all_in_one_seo_pack.php:336
54
+ msgid "<a target=\"_blank\" title=\"All in One SEO Plugin Help\" href=\"http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/\">Help</a>"
55
+ msgstr "<a target=\"_blank\" title=\"All in One SEO Plugin Help\" href=\"http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/\">עזרה</a>"
56
+
57
+ #: all_in_one_seo_pack.php:342
58
+ msgid "Help for Option Home Title"
59
+ msgstr "עזרה לאפשרות כותרת דף הבית"
60
+
61
+ #: all_in_one_seo_pack.php:343
62
+ msgid "Home Title:"
63
+ msgstr "כותרת דף הבית (title):"
64
+
65
+ #: all_in_one_seo_pack.php:352
66
+ msgid "Help for Option Home Description"
67
+ msgstr "עזרה לאפשרות תיאור דף הבית"
68
+
69
+ #: all_in_one_seo_pack.php:353
70
+ msgid "Home Description:"
71
+ msgstr "תיאור דף הבית:"
72
+
73
+ #: all_in_one_seo_pack.php:362
74
+ msgid "Help for Option Home Keywords"
75
+ msgstr "עזרה לאפשרות מילות מפתח בדף הבית"
76
+
77
+ #: all_in_one_seo_pack.php:363
78
+ msgid "Home Keywords (comma separated):"
79
+ msgstr "תגיות מפתח לדף הבית (מופרדות בפסיקים):"
80
+
81
+ #: all_in_one_seo_pack.php:372
82
+ msgid "Help for Option Rewrite Titles"
83
+ msgstr "עזרה לאפשרות שכתוב כותרות"
84
+
85
+ #: all_in_one_seo_pack.php:373
86
+ msgid "Rewrite Titles:"
87
+ msgstr "שכתוב כותרות:"
88
+
89
+ #: all_in_one_seo_pack.php:382
90
+ msgid "Help for Option Categories for META keywords"
91
+ msgstr "עזרה לאפשרות קטגוריות בתור תגיות מטא"
92
+
93
+ #: all_in_one_seo_pack.php:383
94
+ msgid "Use Categories for META keywords:"
95
+ msgstr "שימוש בקטגוריות עבור תגיות מפתח:"
96
+
97
+ #: all_in_one_seo_pack.php:391
98
+ msgid "Help for Option Category Description as Title"
99
+ msgstr "עזרה לאפשרות תאור קטגוריות בתור כותרת"
100
+
101
+ #: all_in_one_seo_pack.php:392
102
+ msgid "Use Category Description as Title:"
103
+ msgstr "שימוש בתיאור הקטגוריות ככותרת:"
104
+
105
+ #: all_in_one_seo_pack.php:401
106
+ msgid "Help for Option noindex for Categories"
107
+ msgstr "עזרה לאפרות ביטול אינדוקס קטגוריות"
108
+
109
+ #: all_in_one_seo_pack.php:402
110
+ msgid "Use noindex for Categories:"
111
+ msgstr "לא לאנדקס את דפי הקטגוריות:"
112
+
113
+ #: all_in_one_seo_pack.php:411
114
+ msgid "Help for Option noindex for Archives"
115
+ msgstr "עזרה לאפשרות ביטול אינדוקס ארכיון"
116
+
117
+ #: all_in_one_seo_pack.php:412
118
+ msgid "Use noindex for Archives:"
119
+ msgstr "לא לאנדקס את דפי הארכיון:"
120
+
121
+ #: all_in_one_seo_pack.php:421
122
+ msgid "Help for Autogenerate Descriptions"
123
+ msgstr "עזרה לאפשרות יצירת תיאור אוטומטי"
124
+
125
+ #: all_in_one_seo_pack.php:422
126
+ msgid "Autogenerate Descriptions:"
127
+ msgstr "ייצור תיאור אוטומטי:"
128
+
129
+ #: all_in_one_seo_pack.php:431
130
+ msgid "Help for Option Max Number of Words in Auto-Generated Descriptions"
131
+ msgstr "עזרה לאפשרות מספר מקסימלי של מילים בתיאור אוטומטי"
132
+
133
+ #: all_in_one_seo_pack.php:432
134
+ msgid "Max Number of Words in Auto-Generated Descriptions:"
135
+ msgstr "מספר מילים מקסימלי בתיאור שיוצר אוטומטית:"
136
+
137
+ #: all_in_one_seo_pack.php:443
138
+ msgid "Update Options"
139
+ msgstr "עדכון אפשרויות"
140
+
141
+ #: all_in_one_seo_pack.php:453
142
+ msgid "All in One SEO Plugin Home Description"
143
+ msgstr "תיאור דף הבית"
144
+
145
+ #: all_in_one_seo_pack.php:454
146
+ msgid "All in One SEO Plugin Home Title"
147
+ msgstr "כותרת דף הבית"
148
+
149
+ #: all_in_one_seo_pack.php:455
150
+ msgid "All in One SEO Plugin Rewrite Titles"
151
+ msgstr "שיכתוב כותרות"
152
+
153
+ #: all_in_one_seo_pack.php:456
154
+ msgid "All in One SEO Plugin Use Categories"
155
+ msgstr "שימוש בקטגוריות"
156
+
157
+ #: all_in_one_seo_pack.php:457
158
+ msgid "All in One SEO Plugin Maximum Number of Words in Auto-Generated Descriptions"
159
+ msgstr "מספר מקסימלי של מילים לשימוש בתיאר המיוצר אוטומטית"
160
+
161
+ #: all_in_one_seo_pack.php:458
162
+ msgid "Use Category Description for Title"
163
+ msgstr "שימוש בתיאור הקטגוריות ככותרת"
164
+
165
+ #: all_in_one_seo_pack.php:459
166
+ msgid "All in One SEO Plugin Noindex for Categories"
167
+ msgstr "שימוש ב-noindex לדפי קטגוריות"
168
+
169
+ #: all_in_one_seo_pack.php:460
170
+ msgid "All in One SEO Plugin Noindex for Archives"
171
+ msgstr "שימוש ב-noindex לדפי ארכיון"
172
+
173
+ #: all_in_one_seo_pack.php:461
174
+ msgid "All in One SEO Plugin Autogenerate Descriptions"
175
+ msgstr "ייצור תיאור אוטומטי"
176
+
all_in_one_seo_pack-zh_CN.mo CHANGED
Binary file
all_in_one_seo_pack-zh_CN.po ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: all in one seo pack\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-06-16 01:24-0800\n"
6
+ "Last-Translator: 72pines <webmaster@72pines.com>\n"
7
+ "Language-Team: 72pines\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: Chinese\n"
12
+ "X-Poedit-Country: CHINA\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: all_in_one_seo_pack.php:263
19
+ #: all_in_one_seo_pack.php:288
20
+ msgid "Title:"
21
+ msgstr "标题: "
22
+
23
+ #: all_in_one_seo_pack.php:267
24
+ #: all_in_one_seo_pack.php:292
25
+ msgid "Keywords (comma separated):"
26
+ msgstr "关键词 (半角的逗号分开)"
27
+
28
+ #: all_in_one_seo_pack.php:284
29
+ #, fuzzy
30
+ msgid "All in One SEO Pack"
31
+ msgstr "All in One SEO"
32
+
33
+ #: all_in_one_seo_pack.php:296
34
+ msgid "Description:"
35
+ msgstr "站点描述: "
36
+
37
+ #: all_in_one_seo_pack.php:304
38
+ msgid "All in One SEO"
39
+ msgstr "All in One SEO"
40
+
41
+ #: all_in_one_seo_pack.php:309
42
+ msgid "All in One SEO Options Updated."
43
+ msgstr "更新选项成功。"
44
+
45
+ #: all_in_one_seo_pack.php:333
46
+ msgid "All in One SEO Plugin Options"
47
+ msgstr "All in One SEO 选项"
48
+
49
+ #: all_in_one_seo_pack.php:335
50
+ msgid "<a target=\"_blank\" title=\"All in One SEO Plugin Feedback\" href=\"http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond\">Feedback</a>"
51
+ msgstr "<a target=\"_blank\" title=\"All in One SEO Plugin Feedback\" href=\"http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond\">反馈意见</a>"
52
+
53
+ #: all_in_one_seo_pack.php:336
54
+ msgid "<a target=\"_blank\" title=\"All in One SEO Plugin Help\" href=\"http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/\">Help</a>"
55
+ msgstr "<a target=\"_blank\" title=\"All in One SEO Plugin Help\" href=\"http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/\">帮助文档</a>"
56
+
57
+ #: all_in_one_seo_pack.php:342
58
+ msgid "Help for Option Home Title"
59
+ msgstr "首页标题选项的帮助"
60
+
61
+ #: all_in_one_seo_pack.php:343
62
+ msgid "Home Title:"
63
+ msgstr "首页标题: "
64
+
65
+ #: all_in_one_seo_pack.php:352
66
+ #, fuzzy
67
+ msgid "Help for Option Home Description"
68
+ msgstr "首页描述: "
69
+
70
+ #: all_in_one_seo_pack.php:353
71
+ msgid "Home Description:"
72
+ msgstr "首页描述: "
73
+
74
+ #: all_in_one_seo_pack.php:362
75
+ msgid "Help for Option Home Keywords"
76
+ msgstr "首页关键词选项的帮助"
77
+
78
+ #: all_in_one_seo_pack.php:363
79
+ msgid "Home Keywords (comma separated):"
80
+ msgstr "首页关键词 (半角的逗号分开)"
81
+
82
+ #: all_in_one_seo_pack.php:372
83
+ #, fuzzy
84
+ msgid "Help for Option Rewrite Titles"
85
+ msgstr "是否对所有文章使用 “标题名 | 博客名” 的优化格式: "
86
+
87
+ #: all_in_one_seo_pack.php:373
88
+ msgid "Rewrite Titles:"
89
+ msgstr "是否对所有文章使用 “标题名 | 博客名” 的优化格式: "
90
+
91
+ #: all_in_one_seo_pack.php:382
92
+ #, fuzzy
93
+ msgid "Help for Option Categories for META keywords"
94
+ msgstr "使用分类名作为关键字: "
95
+
96
+ #: all_in_one_seo_pack.php:383
97
+ msgid "Use Categories for META keywords:"
98
+ msgstr "使用分类名作为关键字: "
99
+
100
+ #: all_in_one_seo_pack.php:391
101
+ #, fuzzy
102
+ msgid "Help for Option Category Description as Title"
103
+ msgstr "使用分类描述作为标题: "
104
+
105
+ #: all_in_one_seo_pack.php:392
106
+ msgid "Use Category Description as Title:"
107
+ msgstr "使用分类描述作为标题: "
108
+
109
+ #: all_in_one_seo_pack.php:401
110
+ #, fuzzy
111
+ msgid "Help for Option noindex for Categories"
112
+ msgstr "不让搜索引擎抓取分类页:"
113
+
114
+ #: all_in_one_seo_pack.php:402
115
+ msgid "Use noindex for Categories:"
116
+ msgstr "不让搜索引擎抓取分类页:"
117
+
118
+ #: all_in_one_seo_pack.php:411
119
+ #, fuzzy
120
+ msgid "Help for Option noindex for Archives"
121
+ msgstr "不让搜索引擎抓取档案页:"
122
+
123
+ #: all_in_one_seo_pack.php:412
124
+ msgid "Use noindex for Archives:"
125
+ msgstr "不让搜索引擎抓取档案页:"
126
+
127
+ #: all_in_one_seo_pack.php:421
128
+ #, fuzzy
129
+ msgid "Help for Autogenerate Descriptions"
130
+ msgstr "自动生成文章描述: "
131
+
132
+ #: all_in_one_seo_pack.php:422
133
+ msgid "Autogenerate Descriptions:"
134
+ msgstr "自动生成文章描述: "
135
+
136
+ #: all_in_one_seo_pack.php:431
137
+ #, fuzzy
138
+ msgid "Help for Option Max Number of Words in Auto-Generated Descriptions"
139
+ msgstr "自动生成文章描述时的字数限制: "
140
+
141
+ #: all_in_one_seo_pack.php:432
142
+ msgid "Max Number of Words in Auto-Generated Descriptions:"
143
+ msgstr "自动生成文章描述时的字数限制: "
144
+
145
+ #: all_in_one_seo_pack.php:443
146
+ msgid "Update Options"
147
+ msgstr "更新选项"
148
+
149
+ #: all_in_one_seo_pack.php:453
150
+ #, fuzzy
151
+ msgid "All in One SEO Plugin Home Description"
152
+ msgstr "All in One SEO 选项"
153
+
154
+ #: all_in_one_seo_pack.php:454
155
+ #, fuzzy
156
+ msgid "All in One SEO Plugin Home Title"
157
+ msgstr "All in One SEO 选项"
158
+
159
+ #: all_in_one_seo_pack.php:455
160
+ #, fuzzy
161
+ msgid "All in One SEO Plugin Rewrite Titles"
162
+ msgstr "All in One SEO 选项"
163
+
164
+ #: all_in_one_seo_pack.php:456
165
+ #, fuzzy
166
+ msgid "All in One SEO Plugin Use Categories"
167
+ msgstr "All in One SEO 选项"
168
+
169
+ #: all_in_one_seo_pack.php:457
170
+ #, fuzzy
171
+ msgid "All in One SEO Plugin Maximum Number of Words in Auto-Generated Descriptions"
172
+ msgstr "自动生成文章描述时的字数限制: "
173
+
174
+ #: all_in_one_seo_pack.php:458
175
+ #, fuzzy
176
+ msgid "Use Category Description for Title"
177
+ msgstr "使用分类描述作为标题: "
178
+
179
+ #: all_in_one_seo_pack.php:459
180
+ #, fuzzy
181
+ msgid "All in One SEO Plugin Noindex for Categories"
182
+ msgstr "All in One SEO 选项"
183
+
184
+ #: all_in_one_seo_pack.php:460
185
+ #, fuzzy
186
+ msgid "All in One SEO Plugin Noindex for Archives"
187
+ msgstr "All in One SEO 选项"
188
+
189
+ #: all_in_one_seo_pack.php:461
190
+ #, fuzzy
191
+ msgid "All in One SEO Plugin Autogenerate Descriptions"
192
+ msgstr "All in One SEO 选项"
193
+
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.3
8
  Author: uberdose
9
  Author URI: http://wp.uberdose.com/
10
  */
@@ -28,120 +28,64 @@ 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.3";
32
 
33
  /**
34
- * Max numbers of chars in auto-generated description.
35
  */
36
- var $maximum_description_length = 160;
37
-
38
  /**
39
  * Minimum number of chars an excerpt should be so that it can be used
40
  * as description. Touch only if you know what you're doing.
41
  */
42
- var $minimum_description_length = 1;
43
-
44
- var $table_prefix = "aiosp_";
45
-
46
- var $table_categries;
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()) {
60
- return;
61
- }
62
-
63
- if (get_option('aiosp_rewrite_titles')) {
64
- ob_start(array($this, 'output_callback_for_title'));
65
  }
 
66
  }
67
 
68
  function output_callback_for_title($content) {
69
  return $this->rewrite_title($content);
70
  }
71
 
72
- function init() {
73
  if(function_exists('load_plugin_textdomain')) {
74
  load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
75
- }
76
  }
77
 
78
- function is_static_front_page() {
79
- global $wp_query;
80
- $post = $wp_query->get_queried_object();
81
- return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
82
- }
83
-
84
- function is_static_posts_page() {
85
- global $wp_query;
86
- $post = $wp_query->get_queried_object();
87
- return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
88
- }
89
-
90
  function wp_head() {
91
  if (is_feed()) {
92
  return;
93
  }
94
- if (get_option('aiosp_rewrite_titles')) {
95
- // make the title rewrite as short as possible
96
- $active_handlers = ob_list_handlers();
97
- if (sizeof($active_handlers) > 0 &&
98
- strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
99
- strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
100
- ob_end_flush();
101
- } else {
102
- // if we get here there *could* be trouble with another plugin :(
103
- $this->ob_start_detected = true;
104
- echo "\n";
105
- foreach (ob_list_handlers() as $handler) {
106
- echo "<!-- all in one seo pack output handler $handler -->\n";
107
- }
108
- }
109
- }
110
-
111
- global $wp_query;
112
- $post = $wp_query->get_queried_object();
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'));
124
  } else {
125
  $keywords = $this->get_all_keywords();
126
  }
 
127
  if (is_single() || is_page()) {
128
- if ($this->is_static_front_page()) {
129
- $description = trim(stripslashes(get_option('aiosp_home_description')));
130
- } else {
131
- $description = $this->get_post_description($post);
132
- }
133
- } else if (is_home()) {
134
- if ($this->is_static_posts_page()) {
135
- $description = $this->get_post_description(get_post(get_option('page_for_posts')));
136
- } else {
137
- $description = trim(stripslashes(get_option('aiosp_home_description')));
138
  }
139
- } else if (is_category()) {
140
- $description = category_description();
141
  }
142
 
143
- if (isset($description) && strlen($description) > $this->minimum_description_length) {
144
- $description = trim(strip_tags($description));
145
  $description = str_replace('"', '', $description);
146
 
147
  // replace newlines on mac / windows?
@@ -152,8 +96,6 @@ class All_in_One_SEO_Pack {
152
 
153
  if (isset($meta_string)) {
154
  $meta_string .= "\n";
155
- } else {
156
- $meta_string = '';
157
  }
158
  $meta_string .= sprintf("<meta name=\"description\" content=\"%s\"/>", $description);
159
  }
@@ -165,13 +107,9 @@ class All_in_One_SEO_Pack {
165
  $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\"/>", $keywords);
166
  }
167
 
168
- if (function_exists('is_tag')) {
169
- $is_tag = is_tag();
170
- }
171
-
172
- if ((is_category() && get_option('aiosp_category_noindex')) ||
173
- (!is_category() && is_archive() &&!$is_tag && get_option('aiosp_archive_noindex')) ||
174
- (get_option('aiosp_tags_noindex') && $is_tag)) {
175
  if (isset($meta_string)) {
176
  $meta_string .= "\n";
177
  }
@@ -183,155 +121,51 @@ class All_in_One_SEO_Pack {
183
  }
184
  }
185
 
186
- function get_post_description($post) {
187
- $description = trim(stripslashes(get_post_meta($post->ID, "description", true)));
188
- if (!$description) {
189
- $description = $this->trim_excerpt_without_filters_full_length($post->post_excerpt);
190
- if (!$description && get_option("aiosp_generate_descriptions")) {
191
- $description = $this->trim_excerpt_without_filters($post->post_content);
192
- }
193
- }
194
- return $description;
195
- }
196
-
197
  function replace_title($content, $title) {
198
- $title = trim(strip_tags($title));
199
- $title_tag_start = "<title>";
200
- $title_tag_end = "</title>";
201
- $len_start = strlen($title_tag_start);
202
- $len_end = strlen($title_tag_end);
203
- $title = stripslashes(trim($title));
204
- $start = strpos($content, "<title>");
205
- $end = strpos($content, "</title>");
206
-
207
- $this->title_start = $start;
208
- $this->title_end = $end;
209
- $this->orig_title = $title;
210
-
211
- if ($start && $end) {
212
- $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
213
- } else {
214
- // this breaks some sitemap plugins (like wpg2)
215
- //$header = $content . "<title>$title</title>";
216
- }
217
-
218
  return $header;
219
  }
220
 
221
  function rewrite_title($header) {
222
- global $wp_query;
223
- if (!$wp_query) {
224
- $header .= "<!-- no wp_query found! -->\n";
225
- return $header;
226
- }
227
-
228
- $post = $wp_query->get_queried_object();
229
-
230
- // the_search_query() is not suitable, it cannot just return
231
- global $s;
232
 
233
  if (is_home()) {
234
- if ($this->is_static_posts_page()) {
235
- $title = get_post_meta(get_option('page_for_posts'), "title", true);
236
- if (!$title) {
237
- $title = wp_title('', false);
238
- }
239
- $title_format = get_option('aiosp_page_title_format');
240
- $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
241
- $new_title = str_replace('%page_title%', $title, $new_title);
242
- $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
243
- $title = trim($new_title);
244
- $header = $this->replace_title($header, $title);
245
- } else {
246
- if (get_option('aiosp_home_title')) {
247
- $header = $this->replace_title($header, get_option('aiosp_home_title'));
248
- }
249
  }
250
  } else if (is_single()) {
251
- $categories = get_the_category();
252
- $category = '';
253
- if (count($categories) > 0) {
254
- $category = $categories[0]->cat_name;
255
- }
256
  $title = get_post_meta($post->ID, "title", true);
257
- if (!$title) {
258
- $title = get_post_meta($post->ID, "title_tag", true);
259
- if (!$title) {
260
- $title = wp_title('', false);
261
- }
 
 
 
 
 
262
  }
263
- $title_format = get_option('aiosp_post_title_format');
264
- $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
265
- $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
266
- $new_title = str_replace('%post_title%', $title, $new_title);
267
- $new_title = str_replace('%category%', $category, $new_title);
268
- $new_title = str_replace('%category_title%', $category, $new_title);
269
- $title = $new_title;
270
- $title = trim($title);
271
- $header = $this->replace_title($header, $title);
272
  } else if (is_search() && isset($s) && !empty($s)) {
273
  if (function_exists('attribute_escape')) {
274
- $search = attribute_escape(stripslashes($s));
275
  } else {
276
- $search = wp_specialchars(stripslashes($s), true);
277
  }
278
- $search = $this->capitalize($search);
279
- $title_format = get_option('aiosp_search_title_format');
280
- $title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
281
- $title = str_replace('%blog_description%', get_bloginfo('description'), $title);
282
- $title = str_replace('%search%', $search, $title);
283
  $header = $this->replace_title($header, $title);
284
- } else if (is_category() && !is_feed()) {
285
- $category_description = category_description();
286
- $category_name = ucwords(single_cat_title('', false));
287
- $title_format = get_option('aiosp_category_title_format');
288
- $title = str_replace('%category_title%', $category_name, $title_format);
289
- $title = str_replace('%category_description%', $category_description, $title);
290
- $title = str_replace('%blog_title%', get_bloginfo('name'), $title);
291
- $title = str_replace('%blog_description%', get_bloginfo('description'), $title);
292
  $header = $this->replace_title($header, $title);
293
  } else if (is_page()) {
294
- if ($this->is_static_front_page()) {
295
- if (get_option('aiosp_home_title')) {
296
- $header = $this->replace_title($header, get_option('aiosp_home_title'));
297
- }
298
- } else {
299
- $title = get_post_meta($post->ID, "title", true);
300
- if (!$title) {
301
- $title = wp_title('', false);
302
- }
303
- $title_format = get_option('aiosp_page_title_format');
304
- $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
305
- $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
306
- $new_title = str_replace('%page_title%', $title, $new_title);
307
- $title = trim($new_title);
308
- $header = $this->replace_title($header, $title);
309
- }
310
- } else if (function_exists('is_tag') && is_tag()) {
311
- global $utw;
312
- if ($utw) {
313
- $tags = $utw->GetCurrentTagSet();
314
- $tag = $tags[0]->tag;
315
- $tag = str_replace('-', ' ', $tag);
316
- } else {
317
- // wordpress > 2.3
318
- $tag = wp_title('', false);
319
- }
320
- if ($tag) {
321
- $tag = $this->capitalize($tag);
322
- $title_format = get_option('aiosp_tag_title_format');
323
- $title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
324
- $title = str_replace('%blog_description%', get_bloginfo('description'), $title);
325
- $title = str_replace('%tag%', $tag, $title);
326
- $header = $this->replace_title($header, $title);
327
  }
328
- } else if (is_archive()) {
329
- $date = wp_title('', false);
330
- $title_format = get_option('aiosp_archive_title_format');
331
- $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
332
- $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
333
- $new_title = str_replace('%date%', $date, $new_title);
334
- $title = trim($new_title);
335
  $header = $this->replace_title($header, $title);
336
  }
337
 
@@ -339,33 +173,24 @@ class All_in_One_SEO_Pack {
339
 
340
  }
341
 
342
- function capitalize($s) {
343
- $s = trim($s);
344
- $tokens = explode(' ', $s);
345
- while (list($key, $val) = each($tokens)) {
346
- $tokens[$key] = trim($tokens[$key]);
347
- $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
348
- }
349
- $s = implode(' ', $tokens);
350
- return $s;
351
- }
352
-
353
  function trim_excerpt_without_filters($text) {
354
  $text = str_replace(']]>', ']]&gt;', $text);
355
  $text = strip_tags($text);
356
- $max = $this->maximum_description_length;
357
- if ($max < strlen($text)) {
358
- while($text[$max] != ' ' && $max > $this->minimum_description_length) {
359
- $max--;
360
- }
 
361
  }
362
- $text = substr($text, 0, $max);
363
  return trim(stripslashes($text));
364
  }
365
 
366
  function trim_excerpt_without_filters_full_length($text) {
367
  $text = str_replace(']]>', ']]&gt;', $text);
368
  $text = strip_tags($text);
 
 
369
  return trim(stripslashes($text));
370
  }
371
 
@@ -398,65 +223,21 @@ class All_in_One_SEO_Pack {
398
  $keywords[] = $tag;
399
  }
400
  }
401
-
402
- // WP 2.3 tags
403
- if (function_exists('get_the_tags')) {
404
- $tags = get_the_tags($post->ID);
405
- if ($tags && is_array($tags)) {
406
- foreach ($tags as $tag) {
407
- $keywords[] = $tag->name;
408
- }
409
- }
410
- }
411
 
412
- // custom field keywords
413
  $keywords_a = $keywords_i = null;
414
  $description_a = $description_i = null;
415
  $id = $post->ID;
416
  $keywords_i = stripslashes(get_post_meta($post->ID, "keywords", true));
417
- $keywords_i = str_replace('"', '', $keywords_i);
418
  if (isset($keywords_i) && !empty($keywords_i)) {
419
  $keywords[] = $keywords_i;
420
  }
421
-
422
- // autometa
423
- $autometa = stripslashes(get_post_meta($post->ID, "autometa", true));
424
- if (isset($autometa) && !empty($autometa)) {
425
- $autometa_array = explode(' ', $autometa);
426
- foreach ($autometa_array as $e) {
427
- $keywords[] = $e;
428
- }
429
- }
430
  }
431
  }
432
  }
433
 
434
  return $this->get_unique_keywords($keywords);
435
  }
436
-
437
- function get_meta_keywords() {
438
- global $posts;
439
 
440
- $keywords = array();
441
- if (is_array($posts)) {
442
- foreach ($posts as $post) {
443
- if ($post) {
444
- // custom field keywords
445
- $keywords_a = $keywords_i = null;
446
- $description_a = $description_i = null;
447
- $id = $post->ID;
448
- $keywords_i = stripslashes(get_post_meta($post->ID, "keywords", true));
449
- $keywords_i = str_replace('"', '', $keywords_i);
450
- if (isset($keywords_i) && !empty($keywords_i)) {
451
- $keywords[] = $keywords_i;
452
- }
453
- }
454
- }
455
- }
456
-
457
- return $this->get_unique_keywords($keywords);
458
- }
459
-
460
  function get_unique_keywords($keywords) {
461
  $keywords_ar = array_unique($keywords);
462
  return implode(',', $keywords_ar);
@@ -485,91 +266,17 @@ class All_in_One_SEO_Pack {
485
  }
486
  }
487
 
488
- function edit_category($id) {
489
- global $wpdb;
490
- $id = $wpdb->escape($id);
491
- $awmp_edit = $_POST["aiosp_edit"];
492
- if (isset($awmp_edit) && !empty($awmp_edit)) {
493
- $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
494
- $title = $wpdb->escape($_POST["aiosp_title"]);
495
- $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
496
- if ($old_category) {
497
- $wpdb->query("update $this->table_categories
498
- set meta_title='$title', meta_keywords='$keywords'
499
- where category_id=$id");
500
- } else {
501
- $wpdb->query("insert into $this->table_categories(meta_title, meta_keywords, category_id)
502
- values ('$title', '$keywords', $id");
503
- }
504
- //$wpdb->query("insert into $this->table_categories")
505
- /*
506
- delete_post_meta($id, 'keywords');
507
- delete_post_meta($id, 'description');
508
- delete_post_meta($id, 'title');
509
-
510
- if (isset($keywords) && !empty($keywords)) {
511
- add_post_meta($id, 'keywords', $keywords);
512
- }
513
- if (isset($description) && !empty($description)) {
514
- add_post_meta($id, 'description', $description);
515
- }
516
- if (isset($title) && !empty($title)) {
517
- add_post_meta($id, 'title', $title);
518
- }
519
- */
520
- }
521
- }
522
-
523
- function edit_category_form() {
524
  global $post;
525
  $keywords = stripslashes(get_post_meta($post->ID, 'keywords', true));
526
  $title = stripslashes(get_post_meta($post->ID, 'title', true));
527
  $description = stripslashes(get_post_meta($post->ID, 'description', true));
528
  ?>
529
  <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
530
- <table class="editform" width="100%" cellspacing="2" cellpadding="5">
531
- <tr>
532
- <th width="33%" scope="row" valign="top">
533
- <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></a>
534
- </th>
535
- </tr>
536
- <tr>
537
- <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
538
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
539
- </tr>
540
- <tr>
541
- <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
542
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
543
- </tr>
544
- </table>
545
- <?php
546
- }
547
-
548
- function add_meta_tags_textinput() {
549
- global $post;
550
- $post_id = $post;
551
- if (is_object($post_id)) {
552
- $post_id = $post_id->ID;
553
- }
554
- $keywords = htmlspecialchars(stripslashes(get_post_meta($post_id, 'keywords', true)));
555
- $title = htmlspecialchars(stripslashes(get_post_meta($post_id, 'title', true)));
556
- $description = htmlspecialchars(stripslashes(get_post_meta($post_id, 'description', true)));
557
- ?>
558
- <SCRIPT LANGUAGE="JavaScript">
559
- <!-- Begin
560
- function countChars(field,cntfield,maxlimit) {
561
- if (field.value.length > maxlimit)
562
- field.value = field.value.substring(0, maxlimit);
563
- else
564
- cntfield.value = maxlimit - field.value.length;
565
- }
566
- // End -->
567
- </script>
568
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
569
  <table style="margin-bottom:40px; margin-top:30px;">
570
  <tr>
571
  <th style="text-align:left;" colspan="2">
572
- <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></a>
573
  </th>
574
  </tr>
575
  <tr>
@@ -578,12 +285,7 @@ class All_in_One_SEO_Pack {
578
  </tr>
579
  <tr>
580
  <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
581
- <td><textarea name="aiosp_description" rows="1" cols="78"
582
- onKeyDown="countChars(document.post.aiosp_description,document.post.length1,160)"
583
- onKeyUp="countChars(document.post.aiosp_description,document.post.length1,160)"><?php echo $description ?></textarea><br/>
584
- <input readonly type="text" name="length1" size="3" maxlength="3" value="160" />
585
- <?php _e(' characters left (most search engines use a maximum of 160 chars for the description)', 'all_in_one_seo_pack') ?>
586
- </td>
587
  </tr>
588
  <tr>
589
  <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
@@ -595,21 +297,11 @@ class All_in_One_SEO_Pack {
595
 
596
  function add_meta_tags_page_textinput() {
597
  global $post;
598
- $keywords = htmlspecialchars(stripslashes(get_post_meta($post->ID, 'keywords', true)));
599
- $description = htmlspecialchars(stripslashes(get_post_meta($post->ID, 'description', true)));
600
- $title = htmlspecialchars(stripslashes(get_post_meta($post->ID, 'title', true)));
601
  ?>
602
- <SCRIPT LANGUAGE="JavaScript">
603
- <!-- Begin
604
- function countChars(field,cntfield,maxlimit) {
605
- if (field.value.length > maxlimit)
606
- field.value = field.value.substring(0, maxlimit);
607
- else
608
- cntfield.value = maxlimit - field.value.length;
609
- }
610
- // End -->
611
- </script>
612
- <input value="aiosp_edit" type="hidden" name="aiosp_edit"/>
613
  <table style="margin-bottom:40px; margin-top:30px;">
614
  <tr>
615
  <th style="text-align:left;" colspan="2">
@@ -618,38 +310,27 @@ class All_in_One_SEO_Pack {
618
  </tr>
619
  <tr>
620
  <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
621
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="80" tabindex="1000"/></td>
622
  </tr>
623
  <tr>
624
  <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
625
- <td><textarea name="aiosp_description" rows="1" cols="78" tabindex="1001"
626
- onKeyDown="countChars(document.post.aiosp_description,document.post.length1,160)"
627
- onKeyUp="countChars(document.post.aiosp_description,document.post.length1,160)"><?php echo $description ?></textarea><br/>
628
- <input readonly type="text" name="length1" size="3" maxlength="3" value="160" />
629
- <?php _e(' characters left (most search engines use a maximum of 160 chars for the description)', 'all_in_one_seo_pack')?></td>
630
  </tr>
631
  <tr>
632
  <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
633
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="80" tabindex="1002"/></td>
634
  </tr>
635
  </table>
636
  <?php
637
  }
638
 
639
  function admin_menu() {
640
- $file = __FILE__;
641
-
642
- // hack for 1.5
643
- global $wp_version;
644
- if (substr($wp_version, 0, 3) == '1.5') {
645
- $file = 'all-in-one-seo-pack/all_in_one_seo_pack.php';
646
- }
647
- add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 5, $file, array($this, 'plugin_menu'));
648
  }
649
 
650
  function plugin_menu() {
651
  $message = null;
652
- $message_updated = __('All in One SEO', "All in One SEO Options Updated.");
653
 
654
  // update options
655
  if ($_POST['action'] && $_POST['action'] == 'aiosp_update') {
@@ -660,20 +341,12 @@ class All_in_One_SEO_Pack {
660
  update_option('aiosp_max_words_excerpt', $_POST['aiosp_max_words_excerpt']);
661
  update_option('aiosp_rewrite_titles', $_POST['aiosp_rewrite_titles']);
662
  update_option('aiosp_post_title_format', $_POST['aiosp_post_title_format']);
663
- update_option('aiosp_page_title_format', $_POST['aiosp_page_title_format']);
664
- update_option('aiosp_category_title_format', $_POST['aiosp_category_title_format']);
665
- update_option('aiosp_archive_title_format', $_POST['aiosp_archive_title_format']);
666
- update_option('aiosp_tag_title_format', $_POST['aiosp_tag_title_format']);
667
- update_option('aiosp_search_title_format', $_POST['aiosp_search_title_format']);
668
  update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
669
  update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
670
  update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
671
  update_option('aiosp_tags_noindex', $_POST['aiosp_tags_noindex']);
672
  update_option('aiosp_generate_descriptions', $_POST['aiosp_generate_descriptions']);
673
- update_option('aiosp_debug_info', $_POST['aiosp_debug_info']);
674
- if (function_exists('wp_cache_flush')) {
675
- wp_cache_flush();
676
- }
677
  }
678
 
679
  ?>
@@ -684,20 +357,13 @@ class All_in_One_SEO_Pack {
684
  <div class="wrap">
685
  <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
686
  <p>
687
- <?php _e("This is version ", 'all_in_one_seo_pack') ?><?php _e("$this->version. ", 'all_in_one_seo_pack') ?>
688
- <a target="_blank" title="<?php _e('All in One SEO Plugin Release History', 'all_in_one_seo_pack')?>"
689
- href="http://wp.uberdose.com/2007/07/27/all-in-one-seo-pack-release-history/"><php _e("Should I upgrade?", 'all_in_one_seo_pack')?>
690
- </a>
691
  </p>
692
  <p>
693
- <a target="_blank" title="<?php _e('All in One SEO Plugin Help', 'all_in_one_seo_pack') ?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/">
694
- <?php _e('Help', 'all_in_one_seo_pack') ?></a>
695
- | <a target="_blank" title="<?php _e('FAQ', 'all_in_one_seo_pack') ?>"
696
- href="http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/"><?php _e('FAQ', 'all_in_one_seo_pack') ?></a>
697
- | <a target="_blank" title="<?php _e('All in One SEO Plugin Feedback', 'all_in_one_seo_pack') ?>"
698
- href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond"><?php _e('Feedback', 'all_in_one_seo_pack') ?></a>
699
- | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
700
- href="http://wp.uberdose.com/2007/10/02/translations-for-all-in-one-seo-pack/"><?php _e('Translations', 'all_in_one_seo_pack') ?></a>
701
  </p>
702
  <form name="dofollow" action="" method="post">
703
  <table>
@@ -751,60 +417,6 @@ href="http://wp.uberdose.com/2007/10/02/translations-for-all-in-one-seo-pack/"><
751
  <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes(get_option('aiosp_post_title_format')); ?>"/>
752
  </td>
753
  </tr>
754
- <tr>
755
- <th scope="row" style="text-align:right; vertical-align:top;">
756
- <a target="_blank" title="<?php _e('Help for Page Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#pagetitleformat">
757
- <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
758
- </a>
759
- </td>
760
- <td>
761
- <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes(get_option('aiosp_page_title_format')); ?>"/>
762
- </td>
763
- </tr>
764
- <tr>
765
- <th scope="row" style="text-align:right; vertical-align:top;">
766
- <a target="_blank" title="<?php _e('Help for Category Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#categorytitleformat">
767
- <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
768
- </a>
769
- </td>
770
- <td>
771
- <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes(get_option('aiosp_category_title_format')); ?>"/>
772
- </td>
773
- </tr>
774
-
775
- <tr>
776
- <th scope="row" style="text-align:right; vertical-align:top;">
777
- <a target="_blank" title="<?php _e('Help for Archive Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#archivetitleformat">
778
- <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
779
- </a>
780
- </td>
781
- <td>
782
- <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes(get_option('aiosp_archive_title_format')); ?>"/>
783
- </td>
784
- </tr>
785
-
786
- <tr>
787
- <th scope="row" style="text-align:right; vertical-align:top;">
788
- <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">
789
- <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
790
- </a>
791
- </td>
792
- <td>
793
- <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes(get_option('aiosp_tag_title_format')); ?>"/>
794
- </td>
795
- </tr>
796
-
797
- <tr>
798
- <th scope="row" style="text-align:right; vertical-align:top;">
799
- <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">
800
- <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
801
- </a>
802
- </td>
803
- <td>
804
- <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes(get_option('aiosp_search_title_format')); ?>"/>
805
- </td>
806
- </tr>
807
-
808
  <tr>
809
  <th scope="row" style="text-align:right; vertical-align:top;">
810
  <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">
@@ -854,11 +466,21 @@ href="http://wp.uberdose.com/2007/10/02/translations-for-all-in-one-seo-pack/"><
854
  <input type="checkbox" name="aiosp_generate_descriptions" <?php if (get_option('aiosp_generate_descriptions')) echo "checked=\"1\""; ?>/>
855
  </td>
856
  </tr>
 
 
 
 
 
 
 
 
 
 
857
  </table>
858
  <p class="submit">
859
  <input type="hidden" name="action" value="aiosp_update" />
860
  <input type="hidden" name="page_options" value="aiosp_home_description" />
861
- <input type="submit" name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
862
  </p>
863
  </form>
864
  </div>
@@ -868,37 +490,31 @@ href="http://wp.uberdose.com/2007/10/02/translations-for-all-in-one-seo-pack/"><
868
 
869
  }
870
 
871
- add_option("aiosp_home_description", null, 'All in One SEO Plugin Home Description', 'yes');
872
- add_option("aiosp_home_title", null, 'All in One SEO Plugin Home Title', 'yes');
873
- add_option("aiosp_rewrite_titles", 1, 'All in One SEO Plugin Rewrite Titles', 'yes');
874
- add_option("aiosp_use_categories", 1, 'All in One SEO Plugin Use Categories', 'yes');
875
- add_option("aiosp_category_noindex", 1, 'All in One SEO Plugin Noindex for Categories', 'yes');
876
- add_option("aiosp_archive_noindex", 1, 'All in One SEO Plugin Noindex for Archives', 'yes');
877
- add_option("aiosp_tags_noindex", 1, 'All in One SEO Plugin Noindex for Tag Archives', 'yes');
878
- add_option("aiosp_generate_descriptions", 0, 'All in One SEO Plugin Autogenerate Descriptions', 'yes');
879
- add_option("aiosp_post_title_format", '%post_title% | %blog_title%', 'All in One SEO Plugin Post Title Format', 'yes');
880
- add_option("aiosp_page_title_format", '%page_title% | %blog_title%', 'All in One SEO Plugin Page Title Format', 'yes');
881
- add_option("aiosp_category_title_format", '%category_title% | %blog_title%', 'All in One SEO Plugin Category Title Format', 'yes');
882
- add_option("aiosp_archive_title_format", '%date% | %blog_title%', 'All in One SEO Plugin Archive Title Format', 'yes');
883
- add_option("aiosp_tag_title_format", '%tag% | %blog_title%', 'All in One SEO Plugin Tag Title Format', 'yes');
884
- add_option("aiosp_search_title_format", '%search% | %blog_title%', 'All in One SEO Plugin Search Title Format', 'yes');
885
 
886
  $aiosp = new All_in_One_SEO_Pack();
887
  add_action('wp_head', array($aiosp, 'wp_head'));
888
  add_action('template_redirect', array($aiosp, 'template_redirect'));
889
 
890
- add_action('init', array($aiosp, 'init'));
891
 
892
  add_action('simple_edit_form', array($aiosp, 'add_meta_tags_textinput'));
893
  add_action('edit_form_advanced', array($aiosp, 'add_meta_tags_textinput'));
894
  add_action('edit_page_form', array($aiosp, 'add_meta_tags_page_textinput'));
895
- //add_action('edit_category_form', array($aiosp, 'edit_category_form'));
896
 
897
  add_action('edit_post', array($aiosp, 'post_meta_tags'));
898
  add_action('publish_post', array($aiosp, 'post_meta_tags'));
899
  add_action('save_post', array($aiosp, 'post_meta_tags'));
900
  add_action('edit_page_form', array($aiosp, 'post_meta_tags'));
901
- //add_action('edit_category', array($aiosp, 'edit_category'));
902
 
903
  add_action('admin_menu', array($aiosp, 'admin_menu'));
904
 
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.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.3.1";
32
 
33
  /**
34
+ * Number of words to be used (max) for generating an excerpt.
35
  */
36
+ var $maximum_excerpt_length = 25;
37
+
38
  /**
39
  * Minimum number of chars an excerpt should be so that it can be used
40
  * as description. Touch only if you know what you're doing.
41
  */
42
+ var $minimum_excerpt_length = 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  function template_redirect() {
45
+ if (get_option('aiosp_max_words_excerpt') && is_numeric(get_option('aiosp_max_words_excerpt'))) {
46
+ $this->maximum_excerpt_length = get_option('aiosp_max_words_excerpt');
 
 
 
 
47
  }
48
+ ob_start(array($this, 'output_callback_for_title'));
49
  }
50
 
51
  function output_callback_for_title($content) {
52
  return $this->rewrite_title($content);
53
  }
54
 
55
+ function init_textdomain() {
56
  if(function_exists('load_plugin_textdomain')) {
57
  load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
58
+ }
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  function wp_head() {
62
  if (is_feed()) {
63
  return;
64
  }
65
+ global $post;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  $meta_string = null;
67
 
68
+ echo "<!-- all in one seo pack $this->version -->\n";
 
 
 
 
 
69
 
70
+ if (is_home() && get_option('aiosp_home_keywords')) {
71
  $keywords = trim(get_option('aiosp_home_keywords'));
72
  } else {
73
  $keywords = $this->get_all_keywords();
74
  }
75
+
76
  if (is_single() || is_page()) {
77
+ $description = trim(stripslashes(get_post_meta($post->ID, "description", true)));
78
+ if (!$description) {
79
+ $description = $this->trim_excerpt_without_filters_full_length($post->post_excerpt);
80
+ if (!$description && get_option("aiosp_generate_descriptions")) {
81
+ $description = $this->trim_excerpt_without_filters($post->post_content);
82
+ }
 
 
 
 
83
  }
84
+ } else if (is_home()) {
85
+ $description = trim(stripslashes(get_option('aiosp_home_description')));
86
  }
87
 
88
+ if (isset($description) && strlen($description) > $this->minimum_excerpt_length) {
 
89
  $description = str_replace('"', '', $description);
90
 
91
  // replace newlines on mac / windows?
96
 
97
  if (isset($meta_string)) {
98
  $meta_string .= "\n";
 
 
99
  }
100
  $meta_string .= sprintf("<meta name=\"description\" content=\"%s\"/>", $description);
101
  }
107
  $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\"/>", $keywords);
108
  }
109
 
110
+ if((is_category() && get_option('aiosp_category_noindex')) ||
111
+ (!is_category() && is_archive() && get_option('aiosp_archive_noindex')) ||
112
+ (get_option('aiosp_tags_noindex') && function_exists('is_tag') && is_tag())) {
 
 
 
 
113
  if (isset($meta_string)) {
114
  $meta_string .= "\n";
115
  }
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()) {
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
 
173
 
174
  }
175
 
 
 
 
 
 
 
 
 
 
 
 
176
  function trim_excerpt_without_filters($text) {
177
  $text = str_replace(']]>', ']]&gt;', $text);
178
  $text = strip_tags($text);
179
+ $excerpt_length = $this->maximum_excerpt_length;
180
+ $words = explode(' ', $text, $excerpt_length + 1);
181
+ if (count($words) > $excerpt_length) {
182
+ array_pop($words);
183
+ array_push($words, '...');
184
+ $text = implode(' ', $words);
185
  }
 
186
  return trim(stripslashes($text));
187
  }
188
 
189
  function trim_excerpt_without_filters_full_length($text) {
190
  $text = str_replace(']]>', ']]&gt;', $text);
191
  $text = strip_tags($text);
192
+ $excerpt_length = $this->maximum_excerpt_length;
193
+ $words = explode(' ', $text, $excerpt_length + 1);
194
  return trim(stripslashes($text));
195
  }
196
 
223
  $keywords[] = $tag;
224
  }
225
  }
 
 
 
 
 
 
 
 
 
 
226
 
 
227
  $keywords_a = $keywords_i = null;
228
  $description_a = $description_i = null;
229
  $id = $post->ID;
230
  $keywords_i = stripslashes(get_post_meta($post->ID, "keywords", true));
 
231
  if (isset($keywords_i) && !empty($keywords_i)) {
232
  $keywords[] = $keywords_i;
233
  }
 
 
 
 
 
 
 
 
 
234
  }
235
  }
236
  }
237
 
238
  return $this->get_unique_keywords($keywords);
239
  }
 
 
 
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  function get_unique_keywords($keywords) {
242
  $keywords_ar = array_unique($keywords);
243
  return implode(',', $keywords_ar);
266
  }
267
  }
268
 
269
+ function add_meta_tags_textinput() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  global $post;
271
  $keywords = stripslashes(get_post_meta($post->ID, 'keywords', true));
272
  $title = stripslashes(get_post_meta($post->ID, 'title', true));
273
  $description = stripslashes(get_post_meta($post->ID, 'description', true));
274
  ?>
275
  <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  <table style="margin-bottom:40px; margin-top:30px;">
277
  <tr>
278
  <th style="text-align:left;" colspan="2">
279
+ <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/">All in One SEO Pack</a>
280
  </th>
281
  </tr>
282
  <tr>
285
  </tr>
286
  <tr>
287
  <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
288
+ <td><textarea name="aiosp_description" rows="1" cols="78"><?php echo $description ?></textarea></td>
 
 
 
 
 
289
  </tr>
290
  <tr>
291
  <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
297
 
298
  function add_meta_tags_page_textinput() {
299
  global $post;
300
+ $keywords = stripslashes(get_post_meta($post->ID, 'keywords', true));
301
+ $description = stripslashes(get_post_meta($post->ID, 'description', true));
302
+ $title = stripslashes(get_post_meta($post->ID, 'title', true));
303
  ?>
304
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
 
 
 
 
 
 
 
 
 
 
305
  <table style="margin-bottom:40px; margin-top:30px;">
306
  <tr>
307
  <th style="text-align:left;" colspan="2">
310
  </tr>
311
  <tr>
312
  <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
313
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="80"/></td>
314
  </tr>
315
  <tr>
316
  <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
317
+ <td><textarea name="aiosp_description" rows="1" cols="78"><?php echo $description ?></textarea></td>
 
 
 
 
318
  </tr>
319
  <tr>
320
  <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
321
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="80"/></td>
322
  </tr>
323
  </table>
324
  <?php
325
  }
326
 
327
  function admin_menu() {
328
+ add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 5, __FILE__, array($this, 'plugin_menu'));
 
 
 
 
 
 
 
329
  }
330
 
331
  function plugin_menu() {
332
  $message = null;
333
+ $message_updated = __("All in One SEO Options Updated.");
334
 
335
  // update options
336
  if ($_POST['action'] && $_POST['action'] == 'aiosp_update') {
341
  update_option('aiosp_max_words_excerpt', $_POST['aiosp_max_words_excerpt']);
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']);
348
  update_option('aiosp_generate_descriptions', $_POST['aiosp_generate_descriptions']);
349
+ wp_cache_flush();
 
 
 
350
  }
351
 
352
  ?>
357
  <div class="wrap">
358
  <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
359
  <p>
360
+ <?php _e("This is version $this->version. " .
361
+ '<a target="_blank" title="All in One SEO Plugin Release History" href="http://wp.uberdose.com/2007/07/27/all-in-one-seo-pack-release-history/">Should I upgrade?</a>', 'all_in_one_seo_pack') ?>
 
 
362
  </p>
363
  <p>
364
+ <?php _e('<a target="_blank" title="All in One SEO Plugin Help" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/">Help</a>', 'all_in_one_seo_pack') ?>
365
+ | <?php _e('<a target="_blank" title="FAQ" href="http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/">FAQ</a>', 'all_in_one_seo_pack') ?>
366
+ | <?php _e('<a target="_blank" title="All in One SEO Plugin Feedback" href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond">Feedback</a>', 'all_in_one_seo_pack') ?>
 
 
 
 
 
367
  </p>
368
  <form name="dofollow" action="" method="post">
369
  <table>
417
  <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes(get_option('aiosp_post_title_format')); ?>"/>
418
  </td>
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 Categories for META keywords', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#categorymetakeywords">
466
  <input type="checkbox" name="aiosp_generate_descriptions" <?php if (get_option('aiosp_generate_descriptions')) echo "checked=\"1\""; ?>/>
467
  </td>
468
  </tr>
469
+ <tr>
470
+ <th scope="row" style="text-align:right; vertical-align:top;">
471
+ <a target="_blank" title="<?php _e('Help for Option Max Number of Words in Auto-Generated Descriptions', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#maxwordsdescription">
472
+ <?php _e('Max Number of Words in Auto-Generated Descriptions:', 'all_in_one_seo_pack')?>
473
+ </a>
474
+ </td>
475
+ <td>
476
+ <input size="5" name="aiosp_max_words_excerpt" value="<?php echo stripcslashes(get_option('aiosp_max_words_excerpt')); ?>"/>
477
+ </td>
478
+ </tr>
479
  </table>
480
  <p class="submit">
481
  <input type="hidden" name="action" value="aiosp_update" />
482
  <input type="hidden" name="page_options" value="aiosp_home_description" />
483
+ <input type="submit" name="Submit" value="<?php _e('Update Options')?> &raquo;" />
484
  </p>
485
  </form>
486
  </div>
490
 
491
  }
492
 
493
+ add_option("aiosp_home_description", null, __('All in One SEO Plugin Home Description', 'all_in_one_seo_pack'), 'yes');
494
+ add_option("aiosp_home_title", null, __('All in One SEO Plugin Home Title', 'all_in_one_seo_pack'), 'yes');
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');
501
+ add_option("aiosp_generate_descriptions", 0, __('All in One SEO Plugin Autogenerate Descriptions', 'all_in_one_seo_pack'), 'yes');
502
+ add_option("aiosp_post_title_format", '%post_title% | %blog_title%', __('All in One SEO Plugin Title Format', 'all_in_one_seo_pack'), 'yes');
 
 
 
 
503
 
504
  $aiosp = new All_in_One_SEO_Pack();
505
  add_action('wp_head', array($aiosp, 'wp_head'));
506
  add_action('template_redirect', array($aiosp, 'template_redirect'));
507
 
508
+ add_action('init', array($aiosp, 'init_textdomain'));
509
 
510
  add_action('simple_edit_form', array($aiosp, 'add_meta_tags_textinput'));
511
  add_action('edit_form_advanced', array($aiosp, 'add_meta_tags_textinput'));
512
  add_action('edit_page_form', array($aiosp, 'add_meta_tags_page_textinput'));
 
513
 
514
  add_action('edit_post', array($aiosp, 'post_meta_tags'));
515
  add_action('publish_post', array($aiosp, 'post_meta_tags'));
516
  add_action('save_post', array($aiosp, 'post_meta_tags'));
517
  add_action('edit_page_form', array($aiosp, 'post_meta_tags'));
 
518
 
519
  add_action('admin_menu', array($aiosp, 'admin_menu'));
520
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: uberdose
3
  Donate link: http://wp.uberdose.com/contribute/
4
  Tags: post,google,seo,meta,meta keywords,meta description,title
5
- Requires at least: 1.5
6
- Tested up to: 2.3
7
  Stable tag: trunk
8
 
9
  Optimizes your Wordpress blog for Search Engines (Search Engine Optimization).
@@ -12,15 +12,16 @@ Optimizes your Wordpress blog for Search Engines (Search Engine Optimization).
12
 
13
  **Optimizes** your Wordpress blog for Search Engines (**Search Engine Optimization**) by
14
 
15
- * Automatically optimizing your **titles** for search engines and letting you tweak them further
16
- * Generating **META tags** automatically *and* letting you define them
17
  * Avoiding indexing of duplicate content.
18
 
19
  **[Download now!](http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip)**
20
 
21
- * [SEO Plugin](http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/)
22
  * [Version History](http://wp.uberdose.com/2007/07/27/all-in-one-seo-pack-release-history/)
23
- * [FAQ](http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/)
 
 
24
 
25
  == Installation ==
26
 
@@ -32,4 +33,6 @@ the top-level folder. Don't just upload all the php files and put them in `/wp-c
32
 
33
  == Frequently Asked Questions ==
34
 
35
- Please read these [FAQs](http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/)
 
 
2
  Contributors: uberdose
3
  Donate link: http://wp.uberdose.com/contribute/
4
  Tags: post,google,seo,meta,meta keywords,meta description,title
5
+ Requires at least: 2.0.2
6
+ Tested up to: 2.2
7
  Stable tag: trunk
8
 
9
  Optimizes your Wordpress blog for Search Engines (Search Engine Optimization).
12
 
13
  **Optimizes** your Wordpress blog for Search Engines (**Search Engine Optimization**) by
14
 
15
+ * Generating **META tags** and letting you define them
16
+ * Automatically optimizing your **titles** and letting you specify your own ones
17
  * Avoiding indexing of duplicate content.
18
 
19
  **[Download now!](http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip)**
20
 
 
21
  * [Version History](http://wp.uberdose.com/2007/07/27/all-in-one-seo-pack-release-history/)
22
+ * [SEO Manual](http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/)
23
+ * [See what users are saying](http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#comments)
24
+ * [Get Help](http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond)
25
 
26
  == Installation ==
27
 
33
 
34
  == Frequently Asked Questions ==
35
 
36
+ = Where can I leave feedback? =
37
+
38
+ http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond
all_in_one_seo_pack-bg_BG.mo → trunk/all_in_one_seo_pack-bg_BG.mo RENAMED
File without changes
all_in_one_seo_pack-bg_NO.mo → trunk/all_in_one_seo_pack-bg_NO.mo RENAMED
File without changes
all_in_one_seo_pack-da_DK.mo → trunk/all_in_one_seo_pack-da_DK.mo RENAMED
File without changes
all_in_one_seo_pack-fr_FR.mo → trunk/all_in_one_seo_pack-fr_FR.mo RENAMED
File without changes
trunk/all_in_one_seo_pack-he_IL.mo ADDED
Binary file
all_in_one_seo_pack-it_IT.mo → trunk/all_in_one_seo_pack-it_IT.mo RENAMED
File without changes
all_in_one_seo_pack-tr_TR.mo → trunk/all_in_one_seo_pack-tr_TR.mo RENAMED
File without changes
all_in_one_seo_pack-uk.mo → trunk/all_in_one_seo_pack-uk.mo RENAMED
File without changes
trunk/all_in_one_seo_pack-zh_CN.mo ADDED
Binary file
all_in_one_seo_pack-zh_TW.mo → trunk/all_in_one_seo_pack-zh_TW.mo RENAMED
File without changes
trunk/all_in_one_seo_pack.php ADDED
@@ -0,0 +1,907 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
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.1
8
+ Author: uberdose
9
+ Author URI: http://wp.uberdose.com/
10
+ */
11
+
12
+ /*
13
+ Copyright (C) 2007 uberdose (seopack AT uberdose DOT com)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation; either version 3 of the License, or
18
+ (at your option) any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ class All_in_One_SEO_Pack {
30
+
31
+ var $version = "1.2.3.1";
32
+
33
+ /**
34
+ * Max numbers of chars in auto-generated description.
35
+ */
36
+ var $maximum_description_length = 160;
37
+
38
+ /**
39
+ * Minimum number of chars an excerpt should be so that it can be used
40
+ * as description. Touch only if you know what you're doing.
41
+ */
42
+ var $minimum_description_length = 1;
43
+
44
+ var $table_prefix = "aiosp_";
45
+
46
+ var $table_categries;
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()) {
60
+ return;
61
+ }
62
+
63
+ if (get_option('aiosp_rewrite_titles')) {
64
+ ob_start(array($this, 'output_callback_for_title'));
65
+ }
66
+ }
67
+
68
+ function output_callback_for_title($content) {
69
+ return $this->rewrite_title($content);
70
+ }
71
+
72
+ function init() {
73
+ if(function_exists('load_plugin_textdomain')) {
74
+ load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
75
+ }
76
+ }
77
+
78
+ function is_static_front_page() {
79
+ global $wp_query;
80
+ $post = $wp_query->get_queried_object();
81
+ return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
82
+ }
83
+
84
+ function is_static_posts_page() {
85
+ global $wp_query;
86
+ $post = $wp_query->get_queried_object();
87
+ return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
88
+ }
89
+
90
+ function wp_head() {
91
+ if (is_feed()) {
92
+ return;
93
+ }
94
+ if (get_option('aiosp_rewrite_titles')) {
95
+ // make the title rewrite as short as possible
96
+ $active_handlers = ob_list_handlers();
97
+ if (sizeof($active_handlers) > 0 &&
98
+ strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
99
+ strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
100
+ ob_end_flush();
101
+ } else {
102
+ // if we get here there *could* be trouble with another plugin :(
103
+ $this->ob_start_detected = true;
104
+ echo "\n";
105
+ foreach (ob_list_handlers() as $handler) {
106
+ echo "<!-- all in one seo pack output handler $handler -->\n";
107
+ }
108
+ }
109
+ }
110
+
111
+ global $wp_query;
112
+ $post = $wp_query->get_queried_object();
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'));
124
+ } else {
125
+ $keywords = $this->get_all_keywords();
126
+ }
127
+ if (is_single() || is_page()) {
128
+ if ($this->is_static_front_page()) {
129
+ $description = trim(stripslashes(get_option('aiosp_home_description')));
130
+ } else {
131
+ $description = $this->get_post_description($post);
132
+ }
133
+ } else if (is_home()) {
134
+ if ($this->is_static_posts_page()) {
135
+ $description = $this->get_post_description(get_post(get_option('page_for_posts')));
136
+ } else {
137
+ $description = trim(stripslashes(get_option('aiosp_home_description')));
138
+ }
139
+ } else if (is_category()) {
140
+ $description = category_description();
141
+ }
142
+
143
+ if (isset($description) && strlen($description) > $this->minimum_description_length) {
144
+ $description = trim(strip_tags($description));
145
+ $description = str_replace('"', '', $description);
146
+
147
+ // replace newlines on mac / windows?
148
+ $description = str_replace("\r\n", ' ', $description);
149
+
150
+ // maybe linux uses this alone
151
+ $description = str_replace("\n", ' ', $description);
152
+
153
+ if (isset($meta_string)) {
154
+ $meta_string .= "\n";
155
+ } else {
156
+ $meta_string = '';
157
+ }
158
+ $meta_string .= sprintf("<meta name=\"description\" content=\"%s\"/>", $description);
159
+ }
160
+
161
+ if (isset ($keywords) && !empty($keywords)) {
162
+ if (isset($meta_string)) {
163
+ $meta_string .= "\n";
164
+ }
165
+ $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\"/>", $keywords);
166
+ }
167
+
168
+ if (function_exists('is_tag')) {
169
+ $is_tag = is_tag();
170
+ }
171
+
172
+ if ((is_category() && get_option('aiosp_category_noindex')) ||
173
+ (!is_category() && is_archive() &&!$is_tag && get_option('aiosp_archive_noindex')) ||
174
+ (get_option('aiosp_tags_noindex') && $is_tag)) {
175
+ if (isset($meta_string)) {
176
+ $meta_string .= "\n";
177
+ }
178
+ $meta_string = '<meta name="robots" content="noindex,follow" />';
179
+ }
180
+
181
+ if ($meta_string != null) {
182
+ echo "$meta_string\n";
183
+ }
184
+ }
185
+
186
+ function get_post_description($post) {
187
+ $description = trim(stripslashes(get_post_meta($post->ID, "description", true)));
188
+ if (!$description) {
189
+ $description = $this->trim_excerpt_without_filters_full_length($post->post_excerpt);
190
+ if (!$description && get_option("aiosp_generate_descriptions")) {
191
+ $description = $this->trim_excerpt_without_filters($post->post_content);
192
+ }
193
+ }
194
+ return $description;
195
+ }
196
+
197
+ function replace_title($content, $title) {
198
+ $title = trim(strip_tags($title));
199
+ $title_tag_start = "<title>";
200
+ $title_tag_end = "</title>";
201
+ $len_start = strlen($title_tag_start);
202
+ $len_end = strlen($title_tag_end);
203
+ $title = stripslashes(trim($title));
204
+ $start = strpos($content, "<title>");
205
+ $end = strpos($content, "</title>");
206
+
207
+ $this->title_start = $start;
208
+ $this->title_end = $end;
209
+ $this->orig_title = $title;
210
+
211
+ if ($start && $end) {
212
+ $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
213
+ } else {
214
+ // this breaks some sitemap plugins (like wpg2)
215
+ //$header = $content . "<title>$title</title>";
216
+
217
+ $header = $content;
218
+ }
219
+
220
+ return $header;
221
+ }
222
+
223
+ function rewrite_title($header) {
224
+ global $wp_query;
225
+ if (!$wp_query) {
226
+ $header .= "<!-- no wp_query found! -->\n";
227
+ return $header;
228
+ }
229
+
230
+ $post = $wp_query->get_queried_object();
231
+
232
+ // the_search_query() is not suitable, it cannot just return
233
+ global $s;
234
+
235
+ if (is_home()) {
236
+ if ($this->is_static_posts_page()) {
237
+ $title = get_post_meta(get_option('page_for_posts'), "title", true);
238
+ if (!$title) {
239
+ $title = wp_title('', false);
240
+ }
241
+ $title_format = get_option('aiosp_page_title_format');
242
+ $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
243
+ $new_title = str_replace('%page_title%', $title, $new_title);
244
+ $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
245
+ $title = trim($new_title);
246
+ $header = $this->replace_title($header, $title);
247
+ } else {
248
+ if (get_option('aiosp_home_title')) {
249
+ $header = $this->replace_title($header, get_option('aiosp_home_title'));
250
+ }
251
+ }
252
+ } else if (is_single()) {
253
+ $categories = get_the_category();
254
+ $category = '';
255
+ if (count($categories) > 0) {
256
+ $category = $categories[0]->cat_name;
257
+ }
258
+ $title = get_post_meta($post->ID, "title", true);
259
+ if (!$title) {
260
+ $title = get_post_meta($post->ID, "title_tag", true);
261
+ if (!$title) {
262
+ $title = wp_title('', false);
263
+ }
264
+ }
265
+ $title_format = get_option('aiosp_post_title_format');
266
+ $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
267
+ $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
268
+ $new_title = str_replace('%post_title%', $title, $new_title);
269
+ $new_title = str_replace('%category%', $category, $new_title);
270
+ $new_title = str_replace('%category_title%', $category, $new_title);
271
+ $title = $new_title;
272
+ $title = trim($title);
273
+ $header = $this->replace_title($header, $title);
274
+ } else if (is_search() && isset($s) && !empty($s)) {
275
+ if (function_exists('attribute_escape')) {
276
+ $search = attribute_escape(stripslashes($s));
277
+ } else {
278
+ $search = wp_specialchars(stripslashes($s), true);
279
+ }
280
+ $search = $this->capitalize($search);
281
+ $title_format = get_option('aiosp_search_title_format');
282
+ $title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
283
+ $title = str_replace('%blog_description%', get_bloginfo('description'), $title);
284
+ $title = str_replace('%search%', $search, $title);
285
+ $header = $this->replace_title($header, $title);
286
+ } else if (is_category() && !is_feed()) {
287
+ $category_description = category_description();
288
+ $category_name = ucwords(single_cat_title('', false));
289
+ $title_format = get_option('aiosp_category_title_format');
290
+ $title = str_replace('%category_title%', $category_name, $title_format);
291
+ $title = str_replace('%category_description%', $category_description, $title);
292
+ $title = str_replace('%blog_title%', get_bloginfo('name'), $title);
293
+ $title = str_replace('%blog_description%', get_bloginfo('description'), $title);
294
+ $header = $this->replace_title($header, $title);
295
+ } else if (is_page()) {
296
+ if ($this->is_static_front_page()) {
297
+ if (get_option('aiosp_home_title')) {
298
+ $header = $this->replace_title($header, get_option('aiosp_home_title'));
299
+ }
300
+ } else {
301
+ $title = get_post_meta($post->ID, "title", true);
302
+ if (!$title) {
303
+ $title = wp_title('', false);
304
+ }
305
+ $title_format = get_option('aiosp_page_title_format');
306
+ $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
307
+ $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
308
+ $new_title = str_replace('%page_title%', $title, $new_title);
309
+ $title = trim($new_title);
310
+ $header = $this->replace_title($header, $title);
311
+ }
312
+ } else if (function_exists('is_tag') && is_tag()) {
313
+ global $utw;
314
+ if ($utw) {
315
+ $tags = $utw->GetCurrentTagSet();
316
+ $tag = $tags[0]->tag;
317
+ $tag = str_replace('-', ' ', $tag);
318
+ } else {
319
+ // wordpress > 2.3
320
+ $tag = wp_title('', false);
321
+ }
322
+ if ($tag) {
323
+ $tag = $this->capitalize($tag);
324
+ $title_format = get_option('aiosp_tag_title_format');
325
+ $title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
326
+ $title = str_replace('%blog_description%', get_bloginfo('description'), $title);
327
+ $title = str_replace('%tag%', $tag, $title);
328
+ $header = $this->replace_title($header, $title);
329
+ }
330
+ } else if (is_archive()) {
331
+ $date = wp_title('', false);
332
+ $title_format = get_option('aiosp_archive_title_format');
333
+ $new_title = str_replace('%blog_title%', get_bloginfo('name'), $title_format);
334
+ $new_title = str_replace('%blog_description%', get_bloginfo('description'), $new_title);
335
+ $new_title = str_replace('%date%', $date, $new_title);
336
+ $title = trim($new_title);
337
+ $header = $this->replace_title($header, $title);
338
+ }
339
+
340
+ return $header;
341
+
342
+ }
343
+
344
+ function capitalize($s) {
345
+ $s = trim($s);
346
+ $tokens = explode(' ', $s);
347
+ while (list($key, $val) = each($tokens)) {
348
+ $tokens[$key] = trim($tokens[$key]);
349
+ $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
350
+ }
351
+ $s = implode(' ', $tokens);
352
+ return $s;
353
+ }
354
+
355
+ function trim_excerpt_without_filters($text) {
356
+ $text = str_replace(']]>', ']]&gt;', $text);
357
+ $text = strip_tags($text);
358
+ $max = $this->maximum_description_length;
359
+ if ($max < strlen($text)) {
360
+ while($text[$max] != ' ' && $max > $this->minimum_description_length) {
361
+ $max--;
362
+ }
363
+ }
364
+ $text = substr($text, 0, $max);
365
+ return trim(stripslashes($text));
366
+ }
367
+
368
+ function trim_excerpt_without_filters_full_length($text) {
369
+ $text = str_replace(']]>', ']]&gt;', $text);
370
+ $text = strip_tags($text);
371
+ return trim(stripslashes($text));
372
+ }
373
+
374
+ /**
375
+ * @return comma-separated list of unique keywords
376
+ */
377
+ function get_all_keywords() {
378
+ global $posts;
379
+
380
+ $keywords = array();
381
+ if (is_array($posts)) {
382
+ foreach ($posts as $post) {
383
+ if ($post) {
384
+ if (get_option('aiosp_use_categories') && !is_page()) {
385
+ $categories = get_the_category($post->ID);
386
+ foreach ($categories as $category) {
387
+ $keywords[] = $category->cat_name;
388
+ }
389
+ }
390
+
391
+ // Ultimate Tag Warrior integration
392
+ global $utw;
393
+ if ($utw) {
394
+ $tags = $utw->GetTagsForPost($post);
395
+ foreach ($tags as $tag) {
396
+ $tag = $tag->tag;
397
+ $tag = str_replace('_',' ', $tag);
398
+ $tag = str_replace('-',' ',$tag);
399
+ $tag = stripslashes($tag);
400
+ $keywords[] = $tag;
401
+ }
402
+ }
403
+
404
+ // WP 2.3 tags
405
+ if (function_exists('get_the_tags')) {
406
+ $tags = get_the_tags($post->ID);
407
+ if ($tags && is_array($tags)) {
408
+ foreach ($tags as $tag) {
409
+ $keywords[] = $tag->name;
410
+ }
411
+ }
412
+ }
413
+
414
+ // custom field keywords
415
+ $keywords_a = $keywords_i = null;
416
+ $description_a = $description_i = null;
417
+ $id = $post->ID;
418
+ $keywords_i = stripslashes(get_post_meta($post->ID, "keywords", true));
419
+ $keywords_i = str_replace('"', '', $keywords_i);
420
+ if (isset($keywords_i) && !empty($keywords_i)) {
421
+ $keywords[] = $keywords_i;
422
+ }
423
+
424
+ // autometa
425
+ $autometa = stripslashes(get_post_meta($post->ID, "autometa", true));
426
+ if (isset($autometa) && !empty($autometa)) {
427
+ $autometa_array = explode(' ', $autometa);
428
+ foreach ($autometa_array as $e) {
429
+ $keywords[] = $e;
430
+ }
431
+ }
432
+ }
433
+ }
434
+ }
435
+
436
+ return $this->get_unique_keywords($keywords);
437
+ }
438
+
439
+ function get_meta_keywords() {
440
+ global $posts;
441
+
442
+ $keywords = array();
443
+ if (is_array($posts)) {
444
+ foreach ($posts as $post) {
445
+ if ($post) {
446
+ // custom field keywords
447
+ $keywords_a = $keywords_i = null;
448
+ $description_a = $description_i = null;
449
+ $id = $post->ID;
450
+ $keywords_i = stripslashes(get_post_meta($post->ID, "keywords", true));
451
+ $keywords_i = str_replace('"', '', $keywords_i);
452
+ if (isset($keywords_i) && !empty($keywords_i)) {
453
+ $keywords[] = $keywords_i;
454
+ }
455
+ }
456
+ }
457
+ }
458
+
459
+ return $this->get_unique_keywords($keywords);
460
+ }
461
+
462
+ function get_unique_keywords($keywords) {
463
+ $keywords_ar = array_unique($keywords);
464
+ return implode(',', $keywords_ar);
465
+ }
466
+
467
+ function post_meta_tags($id) {
468
+ $awmp_edit = $_POST["aiosp_edit"];
469
+ if (isset($awmp_edit) && !empty($awmp_edit)) {
470
+ $keywords = $_POST["aiosp_keywords"];
471
+ $description = $_POST["aiosp_description"];
472
+ $title = $_POST["aiosp_title"];
473
+
474
+ delete_post_meta($id, 'keywords');
475
+ delete_post_meta($id, 'description');
476
+ delete_post_meta($id, 'title');
477
+
478
+ if (isset($keywords) && !empty($keywords)) {
479
+ add_post_meta($id, 'keywords', $keywords);
480
+ }
481
+ if (isset($description) && !empty($description)) {
482
+ add_post_meta($id, 'description', $description);
483
+ }
484
+ if (isset($title) && !empty($title)) {
485
+ add_post_meta($id, 'title', $title);
486
+ }
487
+ }
488
+ }
489
+
490
+ function edit_category($id) {
491
+ global $wpdb;
492
+ $id = $wpdb->escape($id);
493
+ $awmp_edit = $_POST["aiosp_edit"];
494
+ if (isset($awmp_edit) && !empty($awmp_edit)) {
495
+ $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
496
+ $title = $wpdb->escape($_POST["aiosp_title"]);
497
+ $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
498
+ if ($old_category) {
499
+ $wpdb->query("update $this->table_categories
500
+ set meta_title='$title', meta_keywords='$keywords'
501
+ where category_id=$id");
502
+ } else {
503
+ $wpdb->query("insert into $this->table_categories(meta_title, meta_keywords, category_id)
504
+ values ('$title', '$keywords', $id");
505
+ }
506
+ //$wpdb->query("insert into $this->table_categories")
507
+ /*
508
+ delete_post_meta($id, 'keywords');
509
+ delete_post_meta($id, 'description');
510
+ delete_post_meta($id, 'title');
511
+
512
+ if (isset($keywords) && !empty($keywords)) {
513
+ add_post_meta($id, 'keywords', $keywords);
514
+ }
515
+ if (isset($description) && !empty($description)) {
516
+ add_post_meta($id, 'description', $description);
517
+ }
518
+ if (isset($title) && !empty($title)) {
519
+ add_post_meta($id, 'title', $title);
520
+ }
521
+ */
522
+ }
523
+ }
524
+
525
+ function edit_category_form() {
526
+ global $post;
527
+ $keywords = stripslashes(get_post_meta($post->ID, 'keywords', true));
528
+ $title = stripslashes(get_post_meta($post->ID, 'title', true));
529
+ $description = stripslashes(get_post_meta($post->ID, 'description', true));
530
+ ?>
531
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
532
+ <table class="editform" width="100%" cellspacing="2" cellpadding="5">
533
+ <tr>
534
+ <th width="33%" scope="row" valign="top">
535
+ <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></a>
536
+ </th>
537
+ </tr>
538
+ <tr>
539
+ <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
540
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
541
+ </tr>
542
+ <tr>
543
+ <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
544
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
545
+ </tr>
546
+ </table>
547
+ <?php
548
+ }
549
+
550
+ function add_meta_tags_textinput() {
551
+ global $post;
552
+ $post_id = $post;
553
+ if (is_object($post_id)) {
554
+ $post_id = $post_id->ID;
555
+ }
556
+ $keywords = htmlspecialchars(stripslashes(get_post_meta($post_id, 'keywords', true)));
557
+ $title = htmlspecialchars(stripslashes(get_post_meta($post_id, 'title', true)));
558
+ $description = htmlspecialchars(stripslashes(get_post_meta($post_id, 'description', true)));
559
+ ?>
560
+ <SCRIPT LANGUAGE="JavaScript">
561
+ <!-- Begin
562
+ function countChars(field,cntfield,maxlimit) {
563
+ if (field.value.length > maxlimit)
564
+ field.value = field.value.substring(0, maxlimit);
565
+ else
566
+ cntfield.value = maxlimit - field.value.length;
567
+ }
568
+ // End -->
569
+ </script>
570
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
571
+ <table style="margin-bottom:40px; margin-top:30px;">
572
+ <tr>
573
+ <th style="text-align:left;" colspan="2">
574
+ <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></a>
575
+ </th>
576
+ </tr>
577
+ <tr>
578
+ <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
579
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="80"/></td>
580
+ </tr>
581
+ <tr>
582
+ <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
583
+ <td><textarea name="aiosp_description" rows="1" cols="78"
584
+ onKeyDown="countChars(document.post.aiosp_description,document.post.length1,160)"
585
+ onKeyUp="countChars(document.post.aiosp_description,document.post.length1,160)"><?php echo $description ?></textarea><br/>
586
+ <input readonly type="text" name="length1" size="3" maxlength="3" value="160" />
587
+ <?php _e(' characters left (most search engines use a maximum of 160 chars for the description)', 'all_in_one_seo_pack') ?>
588
+ </td>
589
+ </tr>
590
+ <tr>
591
+ <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
592
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="80"/></td>
593
+ </tr>
594
+ </table>
595
+ <?php
596
+ }
597
+
598
+ function add_meta_tags_page_textinput() {
599
+ global $post;
600
+ $keywords = htmlspecialchars(stripslashes(get_post_meta($post->ID, 'keywords', true)));
601
+ $description = htmlspecialchars(stripslashes(get_post_meta($post->ID, 'description', true)));
602
+ $title = htmlspecialchars(stripslashes(get_post_meta($post->ID, 'title', true)));
603
+ ?>
604
+ <SCRIPT LANGUAGE="JavaScript">
605
+ <!-- Begin
606
+ function countChars(field,cntfield,maxlimit) {
607
+ if (field.value.length > maxlimit)
608
+ field.value = field.value.substring(0, maxlimit);
609
+ else
610
+ cntfield.value = maxlimit - field.value.length;
611
+ }
612
+ // End -->
613
+ </script>
614
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit"/>
615
+ <table style="margin-bottom:40px; margin-top:30px;">
616
+ <tr>
617
+ <th style="text-align:left;" colspan="2">
618
+ <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack')?></a>
619
+ </th>
620
+ </tr>
621
+ <tr>
622
+ <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
623
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="80" tabindex="1000"/></td>
624
+ </tr>
625
+ <tr>
626
+ <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
627
+ <td><textarea name="aiosp_description" rows="1" cols="78" tabindex="1001"
628
+ onKeyDown="countChars(document.post.aiosp_description,document.post.length1,160)"
629
+ onKeyUp="countChars(document.post.aiosp_description,document.post.length1,160)"><?php echo $description ?></textarea><br/>
630
+ <input readonly type="text" name="length1" size="3" maxlength="3" value="160" />
631
+ <?php _e(' characters left (most search engines use a maximum of 160 chars for the description)', 'all_in_one_seo_pack')?></td>
632
+ </tr>
633
+ <tr>
634
+ <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
635
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="80" tabindex="1002"/></td>
636
+ </tr>
637
+ </table>
638
+ <?php
639
+ }
640
+
641
+ function admin_menu() {
642
+ $file = __FILE__;
643
+
644
+ // hack for 1.5
645
+ global $wp_version;
646
+ if (substr($wp_version, 0, 3) == '1.5') {
647
+ $file = 'all-in-one-seo-pack/all_in_one_seo_pack.php';
648
+ }
649
+ add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 5, $file, array($this, 'plugin_menu'));
650
+ }
651
+
652
+ function plugin_menu() {
653
+ $message = null;
654
+ $message_updated = __('All in One SEO', "All in One SEO Options Updated.");
655
+
656
+ // update options
657
+ if ($_POST['action'] && $_POST['action'] == 'aiosp_update') {
658
+ $message = $message_updated;
659
+ update_option('aiosp_home_title', $_POST['aiosp_home_title']);
660
+ update_option('aiosp_home_description', $_POST['aiosp_home_description']);
661
+ update_option('aiosp_home_keywords', $_POST['aiosp_home_keywords']);
662
+ update_option('aiosp_max_words_excerpt', $_POST['aiosp_max_words_excerpt']);
663
+ update_option('aiosp_rewrite_titles', $_POST['aiosp_rewrite_titles']);
664
+ update_option('aiosp_post_title_format', $_POST['aiosp_post_title_format']);
665
+ update_option('aiosp_page_title_format', $_POST['aiosp_page_title_format']);
666
+ update_option('aiosp_category_title_format', $_POST['aiosp_category_title_format']);
667
+ update_option('aiosp_archive_title_format', $_POST['aiosp_archive_title_format']);
668
+ update_option('aiosp_tag_title_format', $_POST['aiosp_tag_title_format']);
669
+ update_option('aiosp_search_title_format', $_POST['aiosp_search_title_format']);
670
+ update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
671
+ update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
672
+ update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
673
+ update_option('aiosp_tags_noindex', $_POST['aiosp_tags_noindex']);
674
+ update_option('aiosp_generate_descriptions', $_POST['aiosp_generate_descriptions']);
675
+ update_option('aiosp_debug_info', $_POST['aiosp_debug_info']);
676
+ if (function_exists('wp_cache_flush')) {
677
+ wp_cache_flush();
678
+ }
679
+ }
680
+
681
+ ?>
682
+ <?php if ($message) : ?>
683
+ <div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
684
+ <?php endif; ?>
685
+ <div id="dropmessage" class="updated" style="display:none;"></div>
686
+ <div class="wrap">
687
+ <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
688
+ <p>
689
+ <?php _e("This is version ", 'all_in_one_seo_pack') ?><?php _e("$this->version. ", 'all_in_one_seo_pack') ?>
690
+ <a target="_blank" title="<?php _e('All in One SEO Plugin Release History', 'all_in_one_seo_pack')?>"
691
+ href="http://wp.uberdose.com/2007/07/27/all-in-one-seo-pack-release-history/"><php _e("Should I upgrade?", 'all_in_one_seo_pack')?>
692
+ </a>
693
+ </p>
694
+ <p>
695
+ <a target="_blank" title="<?php _e('All in One SEO Plugin Help', 'all_in_one_seo_pack') ?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/">
696
+ <?php _e('Help', 'all_in_one_seo_pack') ?></a>
697
+ | <a target="_blank" title="<?php _e('FAQ', 'all_in_one_seo_pack') ?>"
698
+ href="http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/"><?php _e('FAQ', 'all_in_one_seo_pack') ?></a>
699
+ | <a target="_blank" title="<?php _e('All in One SEO Plugin Feedback', 'all_in_one_seo_pack') ?>"
700
+ href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond"><?php _e('Feedback', 'all_in_one_seo_pack') ?></a>
701
+ | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
702
+ href="http://wp.uberdose.com/2007/10/02/translations-for-all-in-one-seo-pack/"><?php _e('Translations', 'all_in_one_seo_pack') ?></a>
703
+ </p>
704
+ <form name="dofollow" action="" method="post">
705
+ <table>
706
+ <tr>
707
+ <th scope="row" style="text-align:right; vertical-align:top;">
708
+ <a target="_blank" title="<?php _e('Help for Option Home Title', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#hometitle">
709
+ <?php _e('Home Title:', 'all_in_one_seo_pack')?>
710
+ </a>
711
+ </td>
712
+ <td>
713
+ <textarea cols="60" rows="2" name="aiosp_home_title"><?php echo stripcslashes(get_option('aiosp_home_title')); ?></textarea>
714
+ </td>
715
+ </tr>
716
+ <tr>
717
+ <th scope="row" style="text-align:right; vertical-align:top;">
718
+ <a target="_blank" title="<?php _e('Help for Option Home Description', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#homedescription">
719
+ <?php _e('Home Description:', 'all_in_one_seo_pack')?>
720
+ </a>
721
+ </td>
722
+ <td>
723
+ <textarea cols="60" rows="2" name="aiosp_home_description"><?php echo stripcslashes(get_option('aiosp_home_description')); ?></textarea>
724
+ </td>
725
+ </tr>
726
+ <tr>
727
+ <th scope="row" style="text-align:right; vertical-align:top;">
728
+ <a target="_blank" title="<?php _e('Help for Option Home Keywords', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#homekeywords">
729
+ <?php _e('Home Keywords (comma separated):', 'all_in_one_seo_pack')?>
730
+ </a>
731
+ </td>
732
+ <td>
733
+ <textarea cols="60" rows="2" name="aiosp_home_keywords"><?php echo stripcslashes(get_option('aiosp_home_keywords')); ?></textarea>
734
+ </td>
735
+ </tr>
736
+ <tr>
737
+ <th scope="row" style="text-align:right; vertical-align:top;">
738
+ <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">
739
+ <?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
740
+ </a>
741
+ </td>
742
+ <td>
743
+ <input type="checkbox" name="aiosp_rewrite_titles" <?php if (get_option('aiosp_rewrite_titles')) echo "checked=\"1\""; ?>/>
744
+ </td>
745
+ </tr>
746
+ <tr>
747
+ <th scope="row" style="text-align:right; vertical-align:top;">
748
+ <a target="_blank" title="<?php _e('Help for Post Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#posttitleformat">
749
+ <?php _e('Post Title Format:', 'all_in_one_seo_pack')?>
750
+ </a>
751
+ </td>
752
+ <td>
753
+ <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes(get_option('aiosp_post_title_format')); ?>"/>
754
+ </td>
755
+ </tr>
756
+ <tr>
757
+ <th scope="row" style="text-align:right; vertical-align:top;">
758
+ <a target="_blank" title="<?php _e('Help for Page Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#pagetitleformat">
759
+ <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
760
+ </a>
761
+ </td>
762
+ <td>
763
+ <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes(get_option('aiosp_page_title_format')); ?>"/>
764
+ </td>
765
+ </tr>
766
+ <tr>
767
+ <th scope="row" style="text-align:right; vertical-align:top;">
768
+ <a target="_blank" title="<?php _e('Help for Category Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#categorytitleformat">
769
+ <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
770
+ </a>
771
+ </td>
772
+ <td>
773
+ <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes(get_option('aiosp_category_title_format')); ?>"/>
774
+ </td>
775
+ </tr>
776
+
777
+ <tr>
778
+ <th scope="row" style="text-align:right; vertical-align:top;">
779
+ <a target="_blank" title="<?php _e('Help for Archive Title Format', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#archivetitleformat">
780
+ <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
781
+ </a>
782
+ </td>
783
+ <td>
784
+ <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes(get_option('aiosp_archive_title_format')); ?>"/>
785
+ </td>
786
+ </tr>
787
+
788
+ <tr>
789
+ <th scope="row" style="text-align:right; vertical-align:top;">
790
+ <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">
791
+ <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
792
+ </a>
793
+ </td>
794
+ <td>
795
+ <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes(get_option('aiosp_tag_title_format')); ?>"/>
796
+ </td>
797
+ </tr>
798
+
799
+ <tr>
800
+ <th scope="row" style="text-align:right; vertical-align:top;">
801
+ <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">
802
+ <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
803
+ </a>
804
+ </td>
805
+ <td>
806
+ <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes(get_option('aiosp_search_title_format')); ?>"/>
807
+ </td>
808
+ </tr>
809
+
810
+ <tr>
811
+ <th scope="row" style="text-align:right; vertical-align:top;">
812
+ <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">
813
+ <?php _e('Use Categories for META keywords:', 'all_in_one_seo_pack')?>
814
+ </td>
815
+ <td>
816
+ <input type="checkbox" name="aiosp_use_categories" <?php if (get_option('aiosp_use_categories')) echo "checked=\"1\""; ?>/>
817
+ </td>
818
+ </tr>
819
+ <tr>
820
+ <th scope="row" style="text-align:right; vertical-align:top;">
821
+ <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">
822
+ <?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
823
+ </a>
824
+ </td>
825
+ <td>
826
+ <input type="checkbox" name="aiosp_category_noindex" <?php if (get_option('aiosp_category_noindex')) echo "checked=\"1\""; ?>/>
827
+ </td>
828
+ </tr>
829
+ <tr>
830
+ <th scope="row" style="text-align:right; vertical-align:top;">
831
+ <a target="_blank" title="<?php _e('Help for Option noindex for Archives', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#usenoindexforarchives">
832
+ <?php _e('Use noindex for Archives:', 'all_in_one_seo_pack')?>
833
+ </a>
834
+ </td>
835
+ <td>
836
+ <input type="checkbox" name="aiosp_archive_noindex" <?php if (get_option('aiosp_archive_noindex')) echo "checked=\"1\""; ?>/>
837
+ </td>
838
+ </tr>
839
+ <tr>
840
+ <th scope="row" style="text-align:right; vertical-align:top;">
841
+ <a target="_blank" title="<?php _e('Help for Option noindex for Tag Archives', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#usenoindexfortagarchives">
842
+ <?php _e('Use noindex for Tag Archives:', 'all_in_one_seo_pack')?>
843
+ </a>
844
+ </td>
845
+ <td>
846
+ <input type="checkbox" name="aiosp_tags_noindex" <?php if (get_option('aiosp_tags_noindex')) echo "checked=\"1\""; ?>/>
847
+ </td>
848
+ </tr>
849
+ <tr>
850
+ <th scope="row" style="text-align:right; vertical-align:top;">
851
+ <a target="_blank" title="<?php _e('Help for Autogenerate Descriptions', 'all_in_one_seo_pack')?>" href="http://wp.uberdose.com/2007/05/11/all-in-one-seo-pack-help/#autogeneratedescriptions">
852
+ <?php _e('Autogenerate Descriptions:', 'all_in_one_seo_pack')?>
853
+ </a>
854
+ </td>
855
+ <td>
856
+ <input type="checkbox" name="aiosp_generate_descriptions" <?php if (get_option('aiosp_generate_descriptions')) echo "checked=\"1\""; ?>/>
857
+ </td>
858
+ </tr>
859
+ </table>
860
+ <p class="submit">
861
+ <input type="hidden" name="action" value="aiosp_update" />
862
+ <input type="hidden" name="page_options" value="aiosp_home_description" />
863
+ <input type="submit" name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
864
+ </p>
865
+ </form>
866
+ </div>
867
+ <?php
868
+
869
+ } // plugin_menu
870
+
871
+ }
872
+
873
+ add_option("aiosp_home_description", null, 'All in One SEO Plugin Home Description', 'yes');
874
+ add_option("aiosp_home_title", null, 'All in One SEO Plugin Home Title', 'yes');
875
+ add_option("aiosp_rewrite_titles", 1, 'All in One SEO Plugin Rewrite Titles', 'yes');
876
+ add_option("aiosp_use_categories", 1, 'All in One SEO Plugin Use Categories', 'yes');
877
+ add_option("aiosp_category_noindex", 1, 'All in One SEO Plugin Noindex for Categories', 'yes');
878
+ add_option("aiosp_archive_noindex", 1, 'All in One SEO Plugin Noindex for Archives', 'yes');
879
+ add_option("aiosp_tags_noindex", 1, 'All in One SEO Plugin Noindex for Tag Archives', 'yes');
880
+ add_option("aiosp_generate_descriptions", 0, 'All in One SEO Plugin Autogenerate Descriptions', 'yes');
881
+ add_option("aiosp_post_title_format", '%post_title% | %blog_title%', 'All in One SEO Plugin Post Title Format', 'yes');
882
+ add_option("aiosp_page_title_format", '%page_title% | %blog_title%', 'All in One SEO Plugin Page Title Format', 'yes');
883
+ add_option("aiosp_category_title_format", '%category_title% | %blog_title%', 'All in One SEO Plugin Category Title Format', 'yes');
884
+ add_option("aiosp_archive_title_format", '%date% | %blog_title%', 'All in One SEO Plugin Archive Title Format', 'yes');
885
+ add_option("aiosp_tag_title_format", '%tag% | %blog_title%', 'All in One SEO Plugin Tag Title Format', 'yes');
886
+ add_option("aiosp_search_title_format", '%search% | %blog_title%', 'All in One SEO Plugin Search Title Format', 'yes');
887
+
888
+ $aiosp = new All_in_One_SEO_Pack();
889
+ add_action('wp_head', array($aiosp, 'wp_head'));
890
+ add_action('template_redirect', array($aiosp, 'template_redirect'));
891
+
892
+ add_action('init', array($aiosp, 'init'));
893
+
894
+ add_action('simple_edit_form', array($aiosp, 'add_meta_tags_textinput'));
895
+ add_action('edit_form_advanced', array($aiosp, 'add_meta_tags_textinput'));
896
+ add_action('edit_page_form', array($aiosp, 'add_meta_tags_page_textinput'));
897
+ //add_action('edit_category_form', array($aiosp, 'edit_category_form'));
898
+
899
+ add_action('edit_post', array($aiosp, 'post_meta_tags'));
900
+ add_action('publish_post', array($aiosp, 'post_meta_tags'));
901
+ add_action('save_post', array($aiosp, 'post_meta_tags'));
902
+ add_action('edit_page_form', array($aiosp, 'post_meta_tags'));
903
+ //add_action('edit_category', array($aiosp, 'edit_category'));
904
+
905
+ add_action('admin_menu', array($aiosp, 'admin_menu'));
906
+
907
+ ?>
trunk/readme.txt ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === All in One SEO Pack ===
2
+ Contributors: uberdose
3
+ Donate link: http://wp.uberdose.com/contribute/
4
+ Tags: post,google,seo,meta,meta keywords,meta description,title
5
+ Requires at least: 1.5
6
+ Tested up to: 2.3
7
+ Stable tag: trunk
8
+
9
+ Optimizes your Wordpress blog for Search Engines (Search Engine Optimization).
10
+
11
+ == Description ==
12
+
13
+ **Optimizes** your Wordpress blog for Search Engines (**Search Engine Optimization**) by
14
+
15
+ * Automatically optimizing your **titles** for search engines and letting you tweak them further
16
+ * Generating **META tags** automatically *and* letting you define them
17
+ * Avoiding indexing of duplicate content.
18
+
19
+ **[Download now!](http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip)**
20
+
21
+ * [SEO Plugin](http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/)
22
+ * [Version History](http://wp.uberdose.com/2007/07/27/all-in-one-seo-pack-release-history/)
23
+ * [FAQ](http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/)
24
+
25
+ == Installation ==
26
+
27
+ 1. Unzip into your `/wp-content/plugins/` directory. If you're uploading it make sure to upload
28
+ the top-level folder. Don't just upload all the php files and put them in `/wp-content/plugins/`.
29
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
30
+ 1. Visit your SEO options (*Options - All in One SEO*)
31
+ 1. That's it! Don't forget to write good excerpts :)
32
+
33
+ == Frequently Asked Questions ==
34
+
35
+ Please read these [FAQs](http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/)