All in One SEO Pack - Version 1.4.6.10

Version Description

Download this release

Release Info

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

Code changes from version 1.4.6.8 to 1.4.6.10

all_in_one_seo_pack-bg_BG.mo CHANGED
Binary file
all_in_one_seo_pack-bg_NO.mo CHANGED
Binary file
all_in_one_seo_pack-da_DK.mo CHANGED
Binary file
all_in_one_seo_pack-de_DE.mo CHANGED
Binary file
all_in_one_seo_pack-es_ES.mo CHANGED
Binary file
all_in_one_seo_pack-fr_FR.mo CHANGED
Binary file
all_in_one_seo_pack-he_IL.mo CHANGED
Binary file
all_in_one_seo_pack-hu_HU.mo CHANGED
Binary file
all_in_one_seo_pack-it_IT.mo CHANGED
Binary file
all_in_one_seo_pack-ja.mo CHANGED
Binary file
all_in_one_seo_pack-nl_NL.mo CHANGED
Binary file
all_in_one_seo_pack-pl_PL.mo CHANGED
Binary file
all_in_one_seo_pack-pt_BR.mo CHANGED
Binary file
all_in_one_seo_pack-ru_RU.mo CHANGED
Binary file
all_in_one_seo_pack-tr_TR.mo CHANGED
Binary file
all_in_one_seo_pack-uk.mo CHANGED
Binary file
all_in_one_seo_pack-zh_CN.mo CHANGED
Binary file
all_in_one_seo_pack-zh_TW.mo CHANGED
Binary file
all_in_one_seo_pack.php CHANGED
@@ -1,1620 +1,1627 @@
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.4.6.8
8
- Author: uberdose
9
- Author URI: http://wp.uberdose.com/
10
- */
11
-
12
- /*
13
- Copyright (C) 2008 uberdose.com (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.4.6.8";
32
-
33
- /** Max numbers of chars in auto-generated description */
34
- var $maximum_description_length = 160;
35
-
36
- /** Minimum number of chars an excerpt should be so that it can be used
37
- * as description. Touch only if you know what you're doing
38
- */
39
- var $minimum_description_length = 1;
40
-
41
- var $ob_start_detected = false;
42
-
43
- var $title_start = -1;
44
-
45
- var $title_end = -1;
46
-
47
- /** The title before rewriting */
48
- var $orig_title = '';
49
-
50
- /** Temp filename for the latest version. */
51
- var $upgrade_filename = 'temp.zip';
52
-
53
- /** Where to extract the downloaded newest version. */
54
- var $upgrade_folder;
55
-
56
- /** Any error in upgrading. */
57
- var $upgrade_error;
58
-
59
- /** Which zip to download in order to upgrade .*/
60
- var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
61
-
62
- /** Filename of log file. */
63
- var $log_file;
64
-
65
- /** Flag whether there should be logging. */
66
- var $do_log;
67
-
68
- var $wp_version;
69
-
70
- function All_in_One_SEO_Pack() {
71
- global $wp_version;
72
- $this->wp_version = $wp_version;
73
-
74
- $this->log_file = dirname(__FILE__) . '/all_in_one_seo_pack.log';
75
- if (get_option('aiosp_do_log')) {
76
- $this->do_log = true;
77
- } else {
78
- $this->do_log = false;
79
- }
80
-
81
- $this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
82
- $this->upgrade_folder = dirname(__FILE__);
83
- }
84
-
85
- function template_redirect() {
86
- global $wp_query;
87
- $post = $wp_query->get_queried_object();
88
-
89
- if (is_feed()) {
90
- return;
91
- }
92
-
93
- if (is_single() || is_page()) {
94
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, 'aiosp_disable', true)));
95
- if ($aiosp_disable) {
96
- return;
97
- }
98
- }
99
-
100
- if (get_option('aiosp_rewrite_titles')) {
101
- ob_start(array($this, 'output_callback_for_title'));
102
- }
103
- }
104
-
105
- function output_callback_for_title($content) {
106
- return $this->rewrite_title($content);
107
- }
108
-
109
- function init() {
110
- if (function_exists('load_plugin_textdomain')) {
111
- load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
112
- }
113
- }
114
-
115
- function is_static_front_page() {
116
- global $wp_query;
117
- $post = $wp_query->get_queried_object();
118
- return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
119
- }
120
-
121
- function is_static_posts_page() {
122
- global $wp_query;
123
- $post = $wp_query->get_queried_object();
124
- return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
125
- }
126
-
127
- function get_base() {
128
- return '/'.end(explode('/', str_replace(array('\\','/all_in_one_seo_pack.php'),array('/',''),__FILE__)));
129
- }
130
-
131
- function admin_head() {
132
- $home = get_settings('siteurl');
133
- $stylesheet = $home.'/wp-content/plugins' . $this->get_base() . '/css/all_in_one_seo_pack.css';
134
- echo('<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />');
135
- }
136
-
137
- function wp_head() {
138
- if (is_feed()) {
139
- return;
140
- }
141
-
142
- global $wp_query;
143
- $post = $wp_query->get_queried_object();
144
- $meta_string = null;
145
-
146
- //echo("wp_head() " . wp_title('', false) . " is_home() => " . is_home() . ", is_page() => " . is_page() . ", is_single() => " . is_single() . ", is_static_front_page() => " . $this->is_static_front_page() . ", is_static_posts_page() => " . $this->is_static_posts_page());
147
-
148
- if (is_single() || is_page()) {
149
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, 'aiosp_disable', true)));
150
- if ($aiosp_disable) {
151
- return;
152
- }
153
- }
154
-
155
- if (get_option('aiosp_rewrite_titles')) {
156
- // make the title rewrite as short as possible
157
- if (function_exists('ob_list_handlers')) {
158
- $active_handlers = ob_list_handlers();
159
- } else {
160
- $active_handlers = array();
161
- }
162
- if (sizeof($active_handlers) > 0 &&
163
- strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
164
- strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
165
- ob_end_flush();
166
- } else {
167
- $this->log("another plugin interfering?");
168
- // if we get here there *could* be trouble with another plugin :(
169
- $this->ob_start_detected = true;
170
- if (function_exists('ob_list_handlers')) {
171
- foreach (ob_list_handlers() as $handler) {
172
- $this->log("detected output handler $handler");
173
- }
174
- }
175
- }
176
- }
177
-
178
- echo "\n<!-- all in one seo pack $this->version ";
179
- if ($this->ob_start_detected) {
180
- echo "ob_start_detected ";
181
- }
182
- echo "[$this->title_start,$this->title_end] ";
183
- echo "-->\n";
184
-
185
- if ((is_home() && get_option('aiosp_home_keywords')) || $this->is_static_front_page()) {
186
- $keywords = trim($this->internationalize(get_option('aiosp_home_keywords')));
187
- } else {
188
- $keywords = $this->get_all_keywords();
189
- }
190
- if (is_single() || is_page()) {
191
- if ($this->is_static_front_page()) {
192
- $description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
193
- } else {
194
- $description = $this->get_post_description($post);
195
- }
196
- } else if (is_home()) {
197
- $description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
198
- } else if (is_category()) {
199
- $description = $this->internationalize(category_description());
200
- }
201
-
202
- if (isset($description) && (strlen($description) > $this->minimum_description_length) && !(is_home() && is_paged())) {
203
- $description = trim(strip_tags($description));
204
- $description = str_replace('"', '', $description);
205
-
206
- // replace newlines on mac / windows?
207
- $description = str_replace("\r\n", ' ', $description);
208
-
209
- // maybe linux uses this alone
210
- $description = str_replace("\n", ' ', $description);
211
-
212
- if (isset($meta_string)) {
213
- //$meta_string .= "\n";
214
- } else {
215
- $meta_string = '';
216
- }
217
-
218
- // description format
219
- $description_format = get_option('aiosp_description_format');
220
- if (!isset($description_format) || empty($description_format)) {
221
- $description_format = "%description%";
222
- }
223
- $description = str_replace('%description%', $description, $description_format);
224
- $description = str_replace('%blog_title%', get_bloginfo('name'), $description);
225
- $description = str_replace('%blog_description%', get_bloginfo('description'), $description);
226
- $description = str_replace('%wp_title%', $this->get_original_title(), $description);
227
-
228
- $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
229
- }
230
-
231
- if (isset ($keywords) && !empty($keywords) && !(is_home() && is_paged())) {
232
- if (isset($meta_string)) {
233
- $meta_string .= "\n";
234
- }
235
- $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\" />", $keywords);
236
- }
237
-
238
- if (function_exists('is_tag')) {
239
- $is_tag = is_tag();
240
- }
241
-
242
- if ((is_category() && get_option('aiosp_category_noindex')) ||
243
- (!is_category() && is_archive() &&!$is_tag && get_option('aiosp_archive_noindex')) ||
244
- (get_option('aiosp_tags_noindex') && $is_tag)) {
245
- if (isset($meta_string)) {
246
- $meta_string .= "\n";
247
- }
248
- $meta_string .= '<meta name="robots" content="noindex,follow" />';
249
- }
250
-
251
- $page_meta = stripcslashes(get_option('aiosp_page_meta_tags'));
252
- $post_meta = stripcslashes(get_option('aiosp_post_meta_tags'));
253
- $home_meta = stripcslashes(get_option('aiosp_home_meta_tags'));
254
- if (is_page() && isset($page_meta) && !empty($page_meta)) {
255
- if (isset($meta_string)) {
256
- $meta_string .= "\n";
257
- }
258
- echo "\n$page_meta";
259
- }
260
-
261
- if (is_single() && isset($post_meta) && !empty($post_meta)) {
262
- if (isset($meta_string)) {
263
- $meta_string .= "\n";
264
- }
265
- $meta_string .= "$post_meta";
266
- }
267
-
268
- if (is_home() && !empty($home_meta)) {
269
- if (isset($meta_string)) {
270
- $meta_string .= "\n";
271
- }
272
- $meta_string .= "$home_meta";
273
- }
274
-
275
- if ($meta_string != null) {
276
- echo "$meta_string\n";
277
- }
278
-
279
- echo "<!-- /all in one seo pack -->\n";
280
- }
281
-
282
- function get_post_description($post) {
283
- $description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "description", true))));
284
- if (!$description) {
285
- $description = $this->trim_excerpt_without_filters_full_length($this->internationalize($post->post_excerpt));
286
- if (!$description && get_option("aiosp_generate_descriptions")) {
287
- $description = $this->trim_excerpt_without_filters($this->internationalize($post->post_content));
288
- }
289
- }
290
-
291
- // "internal whitespace trim"
292
- $description = preg_replace("/\s\s+/", " ", $description);
293
-
294
- return $description;
295
- }
296
-
297
- function replace_title($content, $title) {
298
- $title = trim(strip_tags($title));
299
-
300
- $title_tag_start = "<title>";
301
- $title_tag_end = "</title>";
302
- $len_start = strlen($title_tag_start);
303
- $len_end = strlen($title_tag_end);
304
- $title = stripcslashes(trim($title));
305
- $start = strpos($content, $title_tag_start);
306
- $end = strpos($content, $title_tag_end);
307
-
308
- $this->title_start = $start;
309
- $this->title_end = $end;
310
- $this->orig_title = $title;
311
-
312
- if ($start && $end) {
313
- $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
314
- } else {
315
- // this breaks some sitemap plugins (like wpg2)
316
- //$header = $content . "<title>$title</title>";
317
-
318
- $header = $content;
319
- }
320
-
321
- return $header;
322
- }
323
-
324
- function internationalize($in) {
325
- if (function_exists('langswitch_filter_langs_with_message')) {
326
- $in = langswitch_filter_langs_with_message($in);
327
- }
328
- if (function_exists('polyglot_filter')) {
329
- $in = polyglot_filter($in);
330
- }
331
- if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
332
- $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
333
- }
334
- $in = apply_filters('localization', $in);
335
- return $in;
336
- }
337
-
338
- /** @return The original title as delivered by WP (well, in most cases) */
339
- function get_original_title() {
340
- global $wp_query;
341
- if (!$wp_query) {
342
- return null;
343
- }
344
-
345
- $post = $wp_query->get_queried_object();
346
-
347
- // the_search_query() is not suitable, it cannot just return
348
- global $s;
349
-
350
- $title = null;
351
-
352
- if (is_home()) {
353
- $title = get_option('blogname');
354
- } else if (is_single()) {
355
- $title = $this->internationalize(wp_title('', false));
356
- } else if (is_search() && isset($s) && !empty($s)) {
357
- if (function_exists('attribute_escape')) {
358
- $search = attribute_escape(stripcslashes($s));
359
- } else {
360
- $search = wp_specialchars(stripcslashes($s), true);
361
- }
362
- $search = $this->capitalize($search);
363
- $title = $search;
364
- } else if (is_category() && !is_feed()) {
365
- $category_description = $this->internationalize(category_description());
366
- $category_name = ucwords($this->internationalize(single_cat_title('', false)));
367
- $title = $category_name;
368
- } else if (is_page()) {
369
- $title = $this->internationalize(wp_title('', false));
370
- } else if (function_exists('is_tag') && is_tag()) {
371
- global $utw;
372
- if ($utw) {
373
- $tags = $utw->GetCurrentTagSet();
374
- $tag = $tags[0]->tag;
375
- $tag = str_replace('-', ' ', $tag);
376
- } else {
377
- // wordpress > 2.3
378
- $tag = $this->internationalize(wp_title('', false));
379
- }
380
- if ($tag) {
381
- $title = $tag;
382
- }
383
- } else if (is_archive()) {
384
- $title = $this->internationalize(wp_title('', false));
385
- } else if (is_404()) {
386
- $title_format = get_option('aiosp_404_title_format');
387
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
388
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
389
- $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
390
- $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
391
- $title = $new_title;
392
- }
393
-
394
- return trim($title);
395
- }
396
-
397
- function paged_title($title) {
398
- // the page number if paged
399
- global $paged;
400
-
401
- // simple tagging support
402
- global $STagging;
403
-
404
- if (is_paged() || (isset($STagging) && $STagging->is_tag_view() && $paged)) {
405
- $part = $this->internationalize(get_option('aiosp_paged_format'));
406
- if (isset($part) || !empty($part)) {
407
- $part = " " . trim($part);
408
- $part = str_replace('%page%', $paged, $part);
409
- $this->log("paged_title() [$title] [$part]");
410
- $title .= $part;
411
- }
412
- }
413
- return $title;
414
- }
415
-
416
- function rewrite_title($header) {
417
- global $wp_query;
418
- if (!$wp_query) {
419
- $header .= "<!-- no wp_query found! -->\n";
420
- return $header;
421
- }
422
-
423
- $post = $wp_query->get_queried_object();
424
-
425
- // the_search_query() is not suitable, it cannot just return
426
- global $s;
427
-
428
- // simple tagging support
429
- global $STagging;
430
-
431
- if (is_home()) {
432
- $title = $this->internationalize(get_option('aiosp_home_title'));
433
- if (empty($title)) {
434
- $title = $this->internationalize(get_option('blogname'));
435
- }
436
- $title = $this->paged_title($title);
437
- $header = $this->replace_title($header, $title);
438
- } else if (is_single()) {
439
- // we're not in the loop :(
440
- $authordata = get_userdata($post->post_author);
441
- $categories = get_the_category();
442
- $category = '';
443
- if (count($categories) > 0) {
444
- $category = $categories[0]->cat_name;
445
- }
446
- $title = $this->internationalize(get_post_meta($post->ID, "title", true));
447
- if (!$title) {
448
- $title = $this->internationalize(get_post_meta($post->ID, "title_tag", true));
449
- if (!$title) {
450
- $title = $this->internationalize(wp_title('', false));
451
- }
452
- }
453
- $title_format = get_option('aiosp_post_title_format');
454
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
455
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
456
- $new_title = str_replace('%post_title%', $title, $new_title);
457
- $new_title = str_replace('%category%', $category, $new_title);
458
- $new_title = str_replace('%category_title%', $category, $new_title);
459
- $new_title = str_replace('%post_author_login%', $authordata->user_login, $new_title);
460
- $new_title = str_replace('%post_author_nicename%', $authordata->user_nicename, $new_title);
461
- $new_title = str_replace('%post_author_firstname%', ucwords($authordata->first_name), $new_title);
462
- $new_title = str_replace('%post_author_lastname%', ucwords($authordata->last_name), $new_title);
463
- $title = $new_title;
464
- $title = trim($title);
465
- $header = $this->replace_title($header, $title);
466
- } else if (is_search() && isset($s) && !empty($s)) {
467
- if (function_exists('attribute_escape')) {
468
- $search = attribute_escape(stripcslashes($s));
469
- } else {
470
- $search = wp_specialchars(stripcslashes($s), true);
471
- }
472
- $search = $this->capitalize($search);
473
- $title_format = get_option('aiosp_search_title_format');
474
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
475
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
476
- $title = str_replace('%search%', $search, $title);
477
- $header = $this->replace_title($header, $title);
478
- } else if (is_category() && !is_feed()) {
479
- $category_description = $this->internationalize(category_description());
480
- $category_name = ucwords($this->internationalize(single_cat_title('', false)));
481
- $title_format = get_option('aiosp_category_title_format');
482
- $title = str_replace('%category_title%', $category_name, $title_format);
483
- $title = str_replace('%category_description%', $category_description, $title);
484
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title);
485
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
486
- $title = $this->paged_title($title);
487
- $header = $this->replace_title($header, $title);
488
- } else if (is_page()) {
489
- // we're not in the loop :(
490
- $authordata = get_userdata($post->post_author);
491
- if ($this->is_static_front_page()) {
492
- if ($this->internationalize(get_option('aiosp_home_title'))) {
493
- $header = $this->replace_title($header, $this->internationalize(get_option('aiosp_home_title')));
494
- }
495
- } else {
496
- $title = $this->internationalize(get_post_meta($post->ID, "title", true));
497
- if (!$title) {
498
- $title = $this->internationalize(wp_title('', false));
499
- }
500
- $title_format = get_option('aiosp_page_title_format');
501
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
502
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
503
- $new_title = str_replace('%page_title%', $title, $new_title);
504
- $new_title = str_replace('%page_author_login%', $authordata->user_login, $new_title);
505
- $new_title = str_replace('%page_author_nicename%', $authordata->user_nicename, $new_title);
506
- $new_title = str_replace('%page_author_firstname%', ucwords($authordata->first_name), $new_title);
507
- $new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
508
- $title = trim($new_title);
509
- $header = $this->replace_title($header, $title);
510
- }
511
- } else if (function_exists('is_tag') && is_tag()) {
512
- global $utw;
513
- if ($utw) {
514
- $tags = $utw->GetCurrentTagSet();
515
- $tag = $tags[0]->tag;
516
- $tag = str_replace('-', ' ', $tag);
517
- } else {
518
- // wordpress > 2.3
519
- $tag = $this->internationalize(wp_title('', false));
520
- }
521
- if ($tag) {
522
- $tag = $this->capitalize($tag);
523
- $title_format = get_option('aiosp_tag_title_format');
524
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
525
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
526
- $title = str_replace('%tag%', $tag, $title);
527
- $title = $this->paged_title($title);
528
- $header = $this->replace_title($header, $title);
529
- }
530
- } else if (isset($STagging) && $STagging->is_tag_view()) { // simple tagging support
531
- $tag = $STagging->search_tag;
532
- if ($tag) {
533
- $tag = $this->capitalize($tag);
534
- $title_format = get_option('aiosp_tag_title_format');
535
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
536
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
537
- $title = str_replace('%tag%', $tag, $title);
538
- $title = $this->paged_title($title);
539
- $header = $this->replace_title($header, $title);
540
- }
541
- } else if (is_archive()) {
542
- $date = $this->internationalize(wp_title('', false));
543
- $title_format = get_option('aiosp_archive_title_format');
544
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
545
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
546
- $new_title = str_replace('%date%', $date, $new_title);
547
- $title = trim($new_title);
548
- $title = $this->paged_title($title);
549
- $header = $this->replace_title($header, $title);
550
- } else if (is_404()) {
551
- $title_format = get_option('aiosp_404_title_format');
552
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
553
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
554
- $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
555
- $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
556
- $header = $this->replace_title($header, $new_title);
557
- }
558
-
559
- return $header;
560
-
561
- }
562
-
563
- /**
564
- * @return User-readable nice words for a given request.
565
- */
566
- function request_as_words($request) {
567
- $request = htmlspecialchars($request);
568
- $request = str_replace('.html', ' ', $request);
569
- $request = str_replace('.htm', ' ', $request);
570
- $request = str_replace('.', ' ', $request);
571
- $request = str_replace('/', ' ', $request);
572
- $request_a = explode(' ', $request);
573
- $request_new = array();
574
- foreach ($request_a as $token) {
575
- $request_new[] = ucwords(trim($token));
576
- }
577
- $request = implode(' ', $request_new);
578
- return $request;
579
- }
580
-
581
- function capitalize($s) {
582
- $s = trim($s);
583
- $tokens = explode(' ', $s);
584
- while (list($key, $val) = each($tokens)) {
585
- $tokens[$key] = trim($tokens[$key]);
586
- $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
587
- }
588
- $s = implode(' ', $tokens);
589
- return $s;
590
- }
591
-
592
- function trim_excerpt_without_filters($text) {
593
- $text = str_replace(']]>', ']]&gt;', $text);
594
- $text = strip_tags($text);
595
- $max = $this->maximum_description_length;
596
-
597
- if ($max < strlen($text)) {
598
- while($text[$max] != ' ' && $max > $this->minimum_description_length) {
599
- $max--;
600
- }
601
- }
602
- $text = substr($text, 0, $max);
603
- return trim(stripcslashes($text));
604
- }
605
-
606
- function trim_excerpt_without_filters_full_length($text) {
607
- $text = str_replace(']]>', ']]&gt;', $text);
608
- $text = strip_tags($text);
609
- return trim(stripcslashes($text));
610
- }
611
-
612
- /**
613
- * @return comma-separated list of unique keywords
614
- */
615
- function get_all_keywords() {
616
- global $posts;
617
-
618
- if (is_404()) {
619
- return null;
620
- }
621
-
622
- // if we are on synthetic pages
623
- if (!is_home() && !is_page() && !is_single() &&!$this->is_static_front_page() && !$this->is_static_posts_page()) {
624
- return null;
625
- }
626
-
627
- $keywords = array();
628
- if (is_array($posts)) {
629
- foreach ($posts as $post) {
630
- if ($post) {
631
-
632
- // custom field keywords
633
- $keywords_a = $keywords_i = null;
634
- $description_a = $description_i = null;
635
- $id = $post->ID;
636
- $keywords_i = stripcslashes($this->internationalize(get_post_meta($post->ID, "keywords", true)));
637
- $keywords_i = str_replace('"', '', $keywords_i);
638
- if (isset($keywords_i) && !empty($keywords_i)) {
639
- $traverse = explode(',', $keywords_i);
640
- foreach ($traverse as $keyword) {
641
- $keywords[] = $keyword;
642
- }
643
- }
644
-
645
- // WP 2.3 tags
646
- if (function_exists('get_the_tags')) {
647
- $tags = get_the_tags($post->ID);
648
- if ($tags && is_array($tags)) {
649
- foreach ($tags as $tag) {
650
- $keywords[] = $this->internationalize($tag->name);
651
- }
652
- }
653
- }
654
-
655
- // Ultimate Tag Warrior integration
656
- global $utw;
657
- if ($utw) {
658
- $tags = $utw->GetTagsForPost($post);
659
- if (is_array($tags)) {
660
- foreach ($tags as $tag) {
661
- $tag = $tag->tag;
662
- $tag = str_replace('_',' ', $tag);
663
- $tag = str_replace('-',' ',$tag);
664
- $tag = stripcslashes($tag);
665
- $keywords[] = $tag;
666
- }
667
- }
668
- }
669
-
670
- // autometa
671
- $autometa = stripcslashes(get_post_meta($post->ID, "autometa", true));
672
- if (isset($autometa) && !empty($autometa)) {
673
- $autometa_array = explode(' ', $autometa);
674
- foreach ($autometa_array as $e) {
675
- $keywords[] = $e;
676
- }
677
- }
678
-
679
- if (get_option('aiosp_use_categories') && !is_page()) {
680
- $categories = get_the_category($post->ID);
681
- foreach ($categories as $category) {
682
- $keywords[] = $this->internationalize($category->cat_name);
683
- }
684
- }
685
-
686
- }
687
- }
688
- }
689
-
690
- return $this->get_unique_keywords($keywords);
691
- }
692
-
693
- function get_meta_keywords() {
694
- global $posts;
695
-
696
- $keywords = array();
697
- if (is_array($posts)) {
698
- foreach ($posts as $post) {
699
- if ($post) {
700
- // custom field keywords
701
- $keywords_a = $keywords_i = null;
702
- $description_a = $description_i = null;
703
- $id = $post->ID;
704
- $keywords_i = stripcslashes(get_post_meta($post->ID, "keywords", true));
705
- $keywords_i = str_replace('"', '', $keywords_i);
706
- if (isset($keywords_i) && !empty($keywords_i)) {
707
- $keywords[] = $keywords_i;
708
- }
709
- }
710
- }
711
- }
712
-
713
- return $this->get_unique_keywords($keywords);
714
- }
715
-
716
- function get_unique_keywords($keywords) {
717
- $small_keywords = array();
718
- foreach ($keywords as $word) {
719
- $small_keywords[] = strtolower($word);
720
- }
721
- $keywords_ar = array_unique($small_keywords);
722
- return implode(',', $keywords_ar);
723
- }
724
-
725
- function get_url($url) {
726
- if (function_exists('file_get_contents')) {
727
- $file = file_get_contents($url);
728
- } else {
729
- $curl = curl_init($url);
730
- curl_setopt($curl, CURLOPT_HEADER, 0);
731
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
732
- $file = curl_exec($curl);
733
- curl_close($curl);
734
- }
735
- return $file;
736
- }
737
-
738
- function log($message) {
739
- if ($this->do_log) {
740
- error_log(date('Y-m-d H:i:s') . " " . $message . "\n", 3, $this->log_file);
741
- }
742
- }
743
-
744
- function download_newest_version() {
745
- $success = true;
746
- $file_content = $this->get_url($this->upgrade_url);
747
- if ($file_content === false) {
748
- $this->upgrade_error = sprintf(__("Could not download distribution (%s)"), $this->upgrade_url);
749
- $success = false;
750
- } else if (strlen($file_content) < 100) {
751
- $this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
752
- $success = false;
753
- } else {
754
- $this->log(sprintf("filesize of download ZIP: %d", strlen($file_content)));
755
- $fh = @fopen($this->upgrade_filename, 'w');
756
- $this->log("fh is $fh");
757
- if (!$fh) {
758
- $this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
759
- $this->upgrade_error .= "<br />";
760
- $this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
761
- $success = false;
762
- } else {
763
- $bytes_written = @fwrite($fh, $file_content);
764
- $this->log("wrote $bytes_written bytes");
765
- if (!$bytes_written) {
766
- $this->upgrade_error = sprintf(__("Could not write to %s"), $this->upgrade_filename);
767
- $success = false;
768
- }
769
- }
770
- if ($success) {
771
- fclose($fh);
772
- }
773
- }
774
- return $success;
775
- }
776
-
777
- function install_newest_version() {
778
- $success = $this->download_newest_version();
779
- if ($success) {
780
- $success = $this->extract_plugin();
781
- unlink($this->upgrade_filename);
782
- }
783
- return $success;
784
- }
785
-
786
- function extract_plugin() {
787
- if (!class_exists('PclZip')) {
788
- require_once ('pclzip.lib.php');
789
- }
790
- $archive = new PclZip($this->upgrade_filename);
791
- $files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
792
- $this->log("files is $files");
793
- if (is_array($files)) {
794
- $num_extracted = sizeof($files);
795
- $this->log("extracted $num_extracted files to $this->upgrade_folder");
796
- $this->log(print_r($files, true));
797
- return true;
798
- } else {
799
- $this->upgrade_error = $archive->errorInfo();
800
- return false;
801
- }
802
- }
803
-
804
- /** crude approximization of whether current user is an admin */
805
- function is_admin() {
806
- return current_user_can('level_8');
807
- }
808
-
809
- function is_directory_writable($directory) {
810
- $filename = $directory . '/' . 'tmp_file_' . time();
811
- $fh = @fopen($filename, 'w');
812
- if (!$fh) {
813
- return false;
814
- }
815
-
816
- $written = fwrite($fh, "test");
817
- fclose($fh);
818
- unlink($filename);
819
- if ($written) {
820
- return true;
821
- } else {
822
- return false;
823
- }
824
- }
825
-
826
- function is_upgrade_directory_writable() {
827
- //return $this->is_directory_writable($this->upgrade_folder);
828
- // let's assume it is
829
- return true;
830
- }
831
-
832
- function post_meta_tags($id) {
833
- $awmp_edit = $_POST["aiosp_edit"];
834
- if (isset($awmp_edit) && !empty($awmp_edit)) {
835
- $keywords = $_POST["aiosp_keywords"];
836
- $description = $_POST["aiosp_description"];
837
- $title = $_POST["aiosp_title"];
838
- $aiosp_meta = $_POST["aiosp_meta"];
839
- $aiosp_disable = $_POST["aiosp_disable"];
840
-
841
- delete_post_meta($id, 'keywords');
842
- delete_post_meta($id, 'description');
843
- delete_post_meta($id, 'title');
844
- if ($this->is_admin()) {
845
- delete_post_meta($id, 'aiosp_disable');
846
- }
847
- //delete_post_meta($id, 'aiosp_meta');
848
-
849
- if (isset($keywords) && !empty($keywords)) {
850
- add_post_meta($id, 'keywords', $keywords);
851
- }
852
- if (isset($description) && !empty($description)) {
853
- add_post_meta($id, 'description', $description);
854
- }
855
- if (isset($title) && !empty($title)) {
856
- add_post_meta($id, 'title', $title);
857
- }
858
- if (isset($aiosp_disable) && !empty($aiosp_disable) && $this->is_admin()) {
859
- add_post_meta($id, 'aiosp_disable', $aiosp_disable);
860
- }
861
- /*
862
- if (isset($aiosp_meta) && !empty($aiosp_meta)) {
863
- add_post_meta($id, 'aiosp_meta', $aiosp_meta);
864
- }
865
- */
866
- }
867
- }
868
-
869
- function edit_category($id) {
870
- global $wpdb;
871
- $id = $wpdb->escape($id);
872
- $awmp_edit = $_POST["aiosp_edit"];
873
- if (isset($awmp_edit) && !empty($awmp_edit)) {
874
- $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
875
- $title = $wpdb->escape($_POST["aiosp_title"]);
876
- $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
877
- if ($old_category) {
878
- $wpdb->query("update $this->table_categories
879
- set meta_title='$title', meta_keywords='$keywords'
880
- where category_id=$id");
881
- } else {
882
- $wpdb->query("insert into $this->table_categories(meta_title, meta_keywords, category_id)
883
- values ('$title', '$keywords', $id");
884
- }
885
- //$wpdb->query("insert into $this->table_categories")
886
- /*
887
- delete_post_meta($id, 'keywords');
888
- delete_post_meta($id, 'description');
889
- delete_post_meta($id, 'title');
890
-
891
- if (isset($keywords) && !empty($keywords)) {
892
- add_post_meta($id, 'keywords', $keywords);
893
- }
894
- if (isset($description) && !empty($description)) {
895
- add_post_meta($id, 'description', $description);
896
- }
897
- if (isset($title) && !empty($title)) {
898
- add_post_meta($id, 'title', $title);
899
- }
900
- */
901
- }
902
- }
903
-
904
- /**
905
- * @deprecated This was for the feature of dedicated meta tags for categories which never went mainstream.
906
- */
907
- function edit_category_form() {
908
- global $post;
909
- $keywords = stripcslashes(get_post_meta($post->ID, 'keywords', true));
910
- $title = stripcslashes(get_post_meta($post->ID, 'title', true));
911
- $description = stripcslashes(get_post_meta($post->ID, 'description', true));
912
- ?>
913
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
914
- <table class="editform" width="100%" cellspacing="2" cellpadding="5">
915
- <tr>
916
- <th width="33%" scope="row" valign="top">
917
- <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>
918
- </th>
919
- </tr>
920
- <tr>
921
- <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
922
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
923
- </tr>
924
- <tr>
925
- <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
926
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
927
- </tr>
928
- </table>
929
- <?php
930
- }
931
-
932
- function add_meta_tags_textinput() {
933
- global $post;
934
- $post_id = $post;
935
- if (is_object($post_id)) {
936
- $post_id = $post_id->ID;
937
- }
938
- $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'keywords', true)));
939
- $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'title', true)));
940
- $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'description', true)));
941
- $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'aiosp_meta', true)));
942
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'aiosp_disable', true)));
943
- ?>
944
- <SCRIPT LANGUAGE="JavaScript">
945
- <!-- Begin
946
- function countChars(field,cntfield) {
947
- cntfield.value = field.value.length;
948
- }
949
- // End -->
950
- </script>
951
-
952
- <?php if (substr($this->wp_version, 0, 3) == '2.5') { ?>
953
- <div id="postaiosp" class="postbox closed">
954
- <h3><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
955
- <div class="inside">
956
- <div id="postaiosp">
957
- <?php } else { ?>
958
- <div class="dbx-b-ox-wrapper">
959
- <fieldset id="seodiv" class="dbx-box">
960
- <div class="dbx-h-andle-wrapper">
961
- <h3 class="dbx-handle"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
962
- </div>
963
- <div class="dbx-c-ontent-wrapper">
964
- <div class="dbx-content">
965
- <?php } ?>
966
-
967
- <a target="__blank" href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('Click here for Support', 'all_in_one_seo_pack') ?></a>
968
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
969
- <table style="margin-bottom:40px">
970
- <tr>
971
- <th style="text-align:left;" colspan="2">
972
- </th>
973
- </tr>
974
- <tr>
975
- <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
976
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="62"/></td>
977
- </tr>
978
- <tr>
979
- <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
980
- <td><textarea name="aiosp_description" rows="1" cols="60"
981
- onKeyDown="countChars(document.post.aiosp_description,document.post.length1)"
982
- onKeyUp="countChars(document.post.aiosp_description,document.post.length1)"><?php echo $description ?></textarea><br />
983
- <input readonly type="text" name="length1" size="3" maxlength="3" value="<?php echo strlen($description);?>" />
984
- <?php _e(' characters. Most search engines use a maximum of 160 chars for the description.', 'all_in_one_seo_pack') ?>
985
- </td>
986
- </tr>
987
- <tr>
988
- <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
989
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="62"/></td>
990
- </tr>
991
-
992
- <?php if ($this->is_admin()) { ?>
993
- <tr>
994
- <th scope="row" style="text-align:right; vertical-align:top;">
995
- <?php _e('Disable on this page/post:', 'all_in_one_seo_pack')?>
996
- </th>
997
- <td>
998
- <input type="checkbox" name="aiosp_disable" <?php if ($aiosp_disable) echo "checked=\"1\""; ?>/>
999
- </td>
1000
- </tr>
1001
- <?php } ?>
1002
-
1003
- </table>
1004
-
1005
- <?php if (substr($this->wp_version, 0, 3) == '2.5') { ?>
1006
- </div></div></div>
1007
- <?php } else { ?>
1008
- </div>
1009
- </fieldset>
1010
- </div>
1011
- <?php } ?>
1012
-
1013
- <?php
1014
- }
1015
-
1016
- function admin_menu() {
1017
- $file = __FILE__;
1018
-
1019
- // hack for 1.5
1020
- if (substr($this->wp_version, 0, 3) == '1.5') {
1021
- $file = 'all-in-one-seo-pack/all_in_one_seo_pack.php';
1022
- }
1023
- //add_management_page(__('All in One SEO Title', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 10, $file, array($this, 'management_panel'));
1024
- add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 10, $file, array($this, 'options_panel'));
1025
- }
1026
-
1027
- function management_panel() {
1028
- $message = null;
1029
- $base_url = "edit.php?page=" . __FILE__;
1030
- //echo($base_url);
1031
- $type = $_REQUEST['type'];
1032
- if (!isset($type)) {
1033
- $type = "posts";
1034
- }
1035
- ?>
1036
-
1037
- <ul class="aiosp_menu">
1038
- <li><a href="<?php echo $base_url ?>&type=posts">Posts</a>
1039
- </li>
1040
- <li><a href="<?php echo $base_url ?>&type=pages">Pages</a>
1041
- </li>
1042
- </ul>
1043
-
1044
- <?php
1045
-
1046
- if ($type == "posts") {
1047
- echo("posts");
1048
- } elseif ($type == "pages") {
1049
- echo("pages");
1050
- }
1051
-
1052
- }
1053
-
1054
- function options_panel() {
1055
- $message = null;
1056
- $message_updated = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1057
-
1058
- // update options
1059
- if ($_POST['action'] && $_POST['action'] == 'aiosp_update') {
1060
- $message = $message_updated;
1061
- update_option('aiosp_home_title', $_POST['aiosp_home_title']);
1062
- update_option('aiosp_home_description', $_POST['aiosp_home_description']);
1063
- update_option('aiosp_home_keywords', $_POST['aiosp_home_keywords']);
1064
- update_option('aiosp_max_words_excerpt', $_POST['aiosp_max_words_excerpt']);
1065
- update_option('aiosp_rewrite_titles', $_POST['aiosp_rewrite_titles']);
1066
- update_option('aiosp_post_title_format', $_POST['aiosp_post_title_format']);
1067
- update_option('aiosp_page_title_format', $_POST['aiosp_page_title_format']);
1068
- update_option('aiosp_category_title_format', $_POST['aiosp_category_title_format']);
1069
- update_option('aiosp_archive_title_format', $_POST['aiosp_archive_title_format']);
1070
- update_option('aiosp_tag_title_format', $_POST['aiosp_tag_title_format']);
1071
- update_option('aiosp_search_title_format', $_POST['aiosp_search_title_format']);
1072
- update_option('aiosp_description_format', $_POST['aiosp_description_format']);
1073
- update_option('aiosp_404_title_format', $_POST['aiosp_404_title_format']);
1074
- update_option('aiosp_paged_format', $_POST['aiosp_paged_format']);
1075
- update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
1076
- update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
1077
- update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
1078
- update_option('aiosp_tags_noindex', $_POST['aiosp_tags_noindex']);
1079
- update_option('aiosp_generate_descriptions', $_POST['aiosp_generate_descriptions']);
1080
- update_option('aiosp_debug_info', $_POST['aiosp_debug_info']);
1081
- update_option('aiosp_post_meta_tags', $_POST['aiosp_post_meta_tags']);
1082
- update_option('aiosp_page_meta_tags', $_POST['aiosp_page_meta_tags']);
1083
- update_option('aiosp_home_meta_tags', $_POST['aiosp_home_meta_tags']);
1084
- update_option('aiosp_do_log', $_POST['aiosp_do_log']);
1085
- if (function_exists('wp_cache_flush')) {
1086
- wp_cache_flush();
1087
- }
1088
- } elseif ($_POST['aiosp_upgrade']) {
1089
- $message = __("Upgraded to newest version. Please revisit the options page to make sure you see the newest version.", 'all_in_one_seo_pack');
1090
- $success = $this->install_newest_version();
1091
- if (!$success) {
1092
- $message = __("Upgrade failed", 'all_in_one_seo_pack');
1093
- if (isset($this->upgrade_error) && !empty($this->upgrade_error)) {
1094
- $message .= ": " . $this->upgrade_error;
1095
- } else {
1096
- $message .= ".";
1097
- }
1098
- }
1099
- }
1100
-
1101
- ?>
1102
- <?php if ($message) : ?>
1103
- <div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
1104
- <?php endif; ?>
1105
- <div id="dropmessage" class="updated" style="display:none;"></div>
1106
- <div class="wrap">
1107
- <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
1108
- <p>
1109
- <?php _e("This is version ", 'all_in_one_seo_pack') ?><?php _e("$this->version ", 'all_in_one_seo_pack') ?>
1110
- &nbsp;<a target="_blank" title="<?php _e('All in One SEO Plugin Release History', 'all_in_one_seo_pack')?>"
1111
- 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')?>
1112
- </a>
1113
- | <a target="_blank" title="<?php _e('FAQ', 'all_in_one_seo_pack') ?>"
1114
- href="http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/"><?php _e('FAQ', 'all_in_one_seo_pack') ?></a>
1115
- | <a target="_blank" title="<?php _e('All in One SEO Plugin Feedback', 'all_in_one_seo_pack') ?>"
1116
- href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('Feedback', 'all_in_one_seo_pack') ?></a>
1117
- | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
1118
- href="http://wp.uberdose.com/2007/10/02/translations-for-all-in-one-seo-pack/"><?php _e('Translations', 'all_in_one_seo_pack') ?></a>
1119
- </p>
1120
- <p>
1121
- <?php
1122
- $canwrite = $this->is_upgrade_directory_writable();
1123
- //$canwrite = false;
1124
- ?>
1125
- <form class="form-table" name="dofollow" action="" method="post">
1126
- <p class="submit">
1127
- <input type="submit" <?php if (!$canwrite) echo(' disabled="disabled" ');?> name="aiosp_upgrade" value="<?php _e('One Click Upgrade', 'all_in_one_seo_pack')?> &raquo;" />
1128
- <strong><?php _e("(Remember: Backup early, backup often!)", 'all_in_one_seo_pack') ?></strong>
1129
- </form>
1130
- </p>
1131
- <p></p>
1132
-
1133
- <?php if (!$canwrite) {
1134
- echo("<p><strong>"); echo(sprintf(__("Please make sure that %s is writable.", 'all_in_one_seo_pack'), $this->upgrade_folder)); echo("</p></strong>");
1135
- } ?>
1136
- </p>
1137
-
1138
- <script type="text/javascript">
1139
- <!--
1140
- function toggleVisibility(id) {
1141
- var e = document.getElementById(id);
1142
- if(e.style.display == 'block')
1143
- e.style.display = 'none';
1144
- else
1145
- e.style.display = 'block';
1146
- }
1147
- //-->
1148
- </script>
1149
-
1150
- <h3><?php _e('Click on option titles to get help!', 'all_in_one_seo_pack') ?></h3>
1151
-
1152
- <form name="dofollow" action="" method="post">
1153
- <table class="form-table">
1154
-
1155
- <tr>
1156
- <th scope="row" style="text-align:right; vertical-align:top;">
1157
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_title_tip');">
1158
- <?php _e('Home Title:', 'all_in_one_seo_pack')?>
1159
- </a>
1160
- </td>
1161
- <td>
1162
- <textarea cols="57" rows="2" name="aiosp_home_title"><?php echo stripcslashes(get_option('aiosp_home_title')); ?></textarea>
1163
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_title_tip">
1164
- <?php
1165
- _e('As the name implies, this will be the title of your homepage. This is independent of any other option. If not set, the default blog title will get used.', 'all_in_one_seo_pack');
1166
- ?>
1167
- </div>
1168
- </td>
1169
- </tr>
1170
-
1171
- <tr>
1172
- <th scope="row" style="text-align:right; vertical-align:top;">
1173
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_description_tip');">
1174
- <?php _e('Home Description:', 'all_in_one_seo_pack')?>
1175
- </a>
1176
- </td>
1177
- <td>
1178
- <textarea cols="57" rows="2" name="aiosp_home_description"><?php echo stripcslashes(get_option('aiosp_home_description')); ?></textarea>
1179
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_description_tip">
1180
- <?php
1181
- _e('The META description for your homepage. Independent of any other options, the default is no META description at all if this is not set.', 'all_in_one_seo_pack');
1182
- ?>
1183
- </div>
1184
- </td>
1185
- </tr>
1186
-
1187
- <tr>
1188
- <th scope="row" style="text-align:right; vertical-align:top;">
1189
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_keywords_tip');">
1190
- <?php _e('Home Keywords (comma separated):', 'all_in_one_seo_pack')?>
1191
- </a>
1192
- </td>
1193
- <td>
1194
- <textarea cols="57" rows="2" name="aiosp_home_keywords"><?php echo stripcslashes(get_option('aiosp_home_keywords')); ?></textarea>
1195
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_keywords_tip">
1196
- <?php
1197
- _e("A comma separated list of your most important keywords for your site that will be written as META keywords on your homepage. Don't stuff everything in here.", 'all_in_one_seo_pack');
1198
- ?>
1199
- </div>
1200
- </td>
1201
- </tr>
1202
-
1203
- <tr>
1204
- <th scope="row" style="text-align:right; vertical-align:top;">
1205
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_rewrite_titles_tip');">
1206
- <?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
1207
- </a>
1208
- </td>
1209
- <td>
1210
- <input type="checkbox" name="aiosp_rewrite_titles" <?php if (get_option('aiosp_rewrite_titles')) echo "checked=\"1\""; ?>/>
1211
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_rewrite_titles_tip">
1212
- <?php
1213
- _e("Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the window title bar and of course in the source. If set, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: The default templates puts the title tag of posts like this: “Blog Archive >> Blog Name >> Post Title” (maybe I've overdone slightly). This is far from optimal. With the default post title format, Rewrite Title rewrites this to “Post Title | Blog Name”. If you have manually defined a title (in one of the text fields for All in One SEO Plugin input) this will become the title of your post in the format string.", 'all_in_one_seo_pack');
1214
- ?>
1215
- </div>
1216
- </td>
1217
- </tr>
1218
-
1219
- <tr>
1220
- <th scope="row" style="text-align:right; vertical-align:top;">
1221
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_title_format_tip');">
1222
- <?php _e('Post Title Format:', 'all_in_one_seo_pack')?>
1223
- </a>
1224
- </td>
1225
- <td>
1226
- <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes(get_option('aiosp_post_title_format')); ?>"/>
1227
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_title_format_tip">
1228
- <?php
1229
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1230
- echo('<ul>');
1231
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1232
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1233
- echo('<li>'); _e('%post_title% - The original title of the post', 'all_in_one_seo_pack'); echo('</li>');
1234
- echo('<li>'); _e('%category_title% - The (main) category of the post', 'all_in_one_seo_pack'); echo('</li>');
1235
- echo('<li>'); _e('%category% - Alias for %category_title%', 'all_in_one_seo_pack'); echo('</li>');
1236
- echo('<li>'); _e("%post_author_login% - This post's author' login", 'all_in_one_seo_pack'); echo('</li>');
1237
- echo('<li>'); _e("%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1238
- echo('<li>'); _e("%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1239
- echo('<li>'); _e("%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1240
- echo('</ul>');
1241
- ?>
1242
- </div>
1243
- </td>
1244
- </tr>
1245
-
1246
- <tr>
1247
- <th scope="row" style="text-align:right; vertical-align:top;">
1248
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_title_format_tip');">
1249
- <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
1250
- </a>
1251
- </td>
1252
- <td>
1253
- <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes(get_option('aiosp_page_title_format')); ?>"/>
1254
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_title_format_tip">
1255
- <?php
1256
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1257
- echo('<ul>');
1258
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1259
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1260
- echo('<li>'); _e('%page_title% - The original title of the page', 'all_in_one_seo_pack'); echo('</li>');
1261
- echo('<li>'); _e("%page_author_login% - This page's author' login", 'all_in_one_seo_pack'); echo('</li>');
1262
- echo('<li>'); _e("%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1263
- echo('<li>'); _e("%page_author_firstname% - This page's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1264
- echo('<li>'); _e("%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1265
- echo('</ul>');
1266
- ?>
1267
- </div>
1268
- </td>
1269
- </tr>
1270
-
1271
- <tr>
1272
- <th scope="row" style="text-align:right; vertical-align:top;">
1273
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_title_format_tip');">
1274
- <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
1275
- </a>
1276
- </td>
1277
- <td>
1278
- <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes(get_option('aiosp_category_title_format')); ?>"/>
1279
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_title_format_tip">
1280
- <?php
1281
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1282
- echo('<ul>');
1283
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1284
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1285
- echo('<li>'); _e('%category_title% - The original title of the category', 'all_in_one_seo_pack'); echo('</li>');
1286
- echo('<li>'); _e('%category_description% - The description of the category', 'all_in_one_seo_pack'); echo('</li>');
1287
- echo('</ul>');
1288
- ?>
1289
- </div>
1290
- </td>
1291
- </tr>
1292
-
1293
- <tr>
1294
- <th scope="row" style="text-align:right; vertical-align:top;">
1295
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_title_format_tip');">
1296
- <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
1297
- </a>
1298
- </td>
1299
- <td>
1300
- <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes(get_option('aiosp_archive_title_format')); ?>"/>
1301
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_title_format_tip">
1302
- <?php
1303
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1304
- echo('<ul>');
1305
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1306
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1307
- echo('<li>'); _e('%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack'); echo('</li>');
1308
- echo('</ul>');
1309
- ?>
1310
- </div>
1311
- </td>
1312
- </tr>
1313
-
1314
- <tr>
1315
- <th scope="row" style="text-align:right; vertical-align:top;">
1316
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tag_title_format_tip');">
1317
- <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
1318
- </a>
1319
- </td>
1320
- <td>
1321
- <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes(get_option('aiosp_tag_title_format')); ?>"/>
1322
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_tag_title_format_tip">
1323
- <?php
1324
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1325
- echo('<ul>');
1326
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1327
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1328
- echo('<li>'); _e('%tag% - The name of the tag', 'all_in_one_seo_pack'); echo('</li>');
1329
- echo('</ul>');
1330
- ?>
1331
- </div>
1332
- </td>
1333
- </tr>
1334
-
1335
- <tr>
1336
- <th scope="row" style="text-align:right; vertical-align:top;">
1337
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_search_title_format_tip');">
1338
- <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
1339
- </a>
1340
- </td>
1341
- <td>
1342
- <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes(get_option('aiosp_search_title_format')); ?>"/>
1343
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_search_title_format_tip">
1344
- <?php
1345
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1346
- echo('<ul>');
1347
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1348
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1349
- echo('<li>'); _e('%search% - What was searched for', 'all_in_one_seo_pack'); echo('</li>');
1350
- echo('</ul>');
1351
- ?>
1352
- </div>
1353
- </td>
1354
- </tr>
1355
-
1356
- <tr>
1357
- <th scope="row" style="text-align:right; vertical-align:top;">
1358
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_description_format_tip');">
1359
- <?php _e('Description Format:', 'all_in_one_seo_pack')?>
1360
- </a>
1361
- </td>
1362
- <td>
1363
- <input size="59" name="aiosp_description_format" value="<?php echo stripcslashes(get_option('aiosp_description_format')); ?>"/>
1364
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_description_format_tip">
1365
- <?php
1366
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1367
- echo('<ul>');
1368
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1369
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1370
- echo('<li>'); _e('%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all_in_one_seo_pack'); echo('</li>');
1371
- echo('<li>'); _e('%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack'); echo('</li>');
1372
- echo('</ul>');
1373
- ?>
1374
- </div>
1375
- </td>
1376
- </tr>
1377
-
1378
- <tr>
1379
- <th scope="row" style="text-align:right; vertical-align:top;">
1380
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_404_title_format_tip');">
1381
- <?php _e('404 Title Format:', 'all_in_one_seo_pack')?>
1382
- </a>
1383
- </td>
1384
- <td>
1385
- <input size="59" name="aiosp_404_title_format" value="<?php echo stripcslashes(get_option('aiosp_404_title_format')); ?>"/>
1386
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_404_title_format_tip">
1387
- <?php
1388
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1389
- echo('<ul>');
1390
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1391
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1392
- echo('<li>'); _e('%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack'); echo('</li>');
1393
- echo('<li>'); _e('%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all_in_one_seo_pack'); echo('</li>');
1394
- echo('</ul>');
1395
- ?>
1396
- </div>
1397
- </td>
1398
- </tr>
1399
-
1400
- <tr>
1401
- <th scope="row" style="text-align:right; vertical-align:top;">
1402
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_paged_format_tip');">
1403
- <?php _e('Paged Format:', 'all_in_one_seo_pack')?>
1404
- </a>
1405
- </td>
1406
- <td>
1407
- <input size="59" name="aiosp_paged_format" value="<?php echo stripcslashes(get_option('aiosp_paged_format')); ?>"/>
1408
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_paged_format_tip">
1409
- <?php
1410
- _e('This string gets appended/prepended to titles when they are for paged index pages (like home or archive pages).', 'all_in_one_seo_pack');
1411
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1412
- echo('<ul>');
1413
- echo('<li>'); _e('%page% - The page number', 'all_in_one_seo_pack'); echo('</li>');
1414
- echo('</ul>');
1415
- ?>
1416
- </div>
1417
- </td>
1418
- </tr>
1419
-
1420
- <tr>
1421
- <th scope="row" style="text-align:right; vertical-align:top;">
1422
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_categories_tip');">
1423
- <?php _e('Use Categories for META keywords:', 'all_in_one_seo_pack')?>
1424
- </td>
1425
- <td>
1426
- <input type="checkbox" name="aiosp_use_categories" <?php if (get_option('aiosp_use_categories')) echo "checked=\"1\""; ?>/>
1427
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_categories_tip">
1428
- <?php
1429
- _e('Check this if you want your categories for a given post used as the META keywords for this post (in addition to any keywords and tags you specify on the post edit page).', 'all_in_one_seo_pack');
1430
- ?>
1431
- </div>
1432
- </td>
1433
- </tr>
1434
-
1435
- <tr>
1436
- <th scope="row" style="text-align:right; vertical-align:top;">
1437
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_noindex_tip');">
1438
- <?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
1439
- </a>
1440
- </td>
1441
- <td>
1442
- <input type="checkbox" name="aiosp_category_noindex" <?php if (get_option('aiosp_category_noindex')) echo "checked=\"1\""; ?>/>
1443
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_noindex_tip">
1444
- <?php
1445
- _e('Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
1446
- ?>
1447
- </div>
1448
- </td>
1449
- </tr>
1450
-
1451
- <tr>
1452
- <th scope="row" style="text-align:right; vertical-align:top;">
1453
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_noindex_tip');">
1454
- <?php _e('Use noindex for Archives:', 'all_in_one_seo_pack')?>
1455
- </a>
1456
- </td>
1457
- <td>
1458
- <input type="checkbox" name="aiosp_archive_noindex" <?php if (get_option('aiosp_archive_noindex')) echo "checked=\"1\""; ?>/>
1459
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_noindex_tip">
1460
- <?php
1461
- _e('Check this for excluding archive pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
1462
- ?>
1463
- </div>
1464
- </td>
1465
- </tr>
1466
-
1467
- <tr>
1468
- <th scope="row" style="text-align:right; vertical-align:top;">
1469
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tags_noindex_tip');">
1470
- <?php _e('Use noindex for Tag Archives:', 'all_in_one_seo_pack')?>
1471
- </a>
1472
- </td>
1473
- <td>
1474
- <input type="checkbox" name="aiosp_tags_noindex" <?php if (get_option('aiosp_tags_noindex')) echo "checked=\"1\""; ?>/>
1475
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_tags_noindex_tip">
1476
- <?php
1477
- _e('Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
1478
- ?>
1479
- </div>
1480
- </td>
1481
- </tr>
1482
-
1483
- <tr>
1484
- <th scope="row" style="text-align:right; vertical-align:top;">
1485
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_generate_descriptions_tip');">
1486
- <?php _e('Autogenerate Descriptions:', 'all_in_one_seo_pack')?>
1487
- </a>
1488
- </td>
1489
- <td>
1490
- <input type="checkbox" name="aiosp_generate_descriptions" <?php if (get_option('aiosp_generate_descriptions')) echo "checked=\"1\""; ?>/>
1491
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_generate_descriptions_tip">
1492
- <?php
1493
- _e("Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack');
1494
- ?>
1495
- </div>
1496
- </td>
1497
- </tr>
1498
-
1499
- <tr>
1500
- <th scope="row" style="text-align:right; vertical-align:top;">
1501
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_meta_tags_tip');">
1502
- <?php _e('Additional Post Headers:', 'all_in_one_seo_pack')?>
1503
- </a>
1504
- </td>
1505
- <td>
1506
- <textarea cols="57" rows="2" name="aiosp_post_meta_tags"><?php echo stripcslashes(get_option('aiosp_post_meta_tags')); ?></textarea>
1507
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_meta_tags_tip">
1508
- <?php
1509
- _e('What you enter here will be copied verbatim to your header on post pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
1510
- ?>
1511
- </div>
1512
- </td>
1513
- </tr>
1514
-
1515
- <tr>
1516
- <th scope="row" style="text-align:right; vertical-align:top;">
1517
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_meta_tags_tip');">
1518
- <?php _e('Additional Page Headers:', 'all_in_one_seo_pack')?>
1519
- </a>
1520
- </td>
1521
- <td>
1522
- <textarea cols="57" rows="2" name="aiosp_page_meta_tags"><?php echo stripcslashes(get_option('aiosp_page_meta_tags')); ?></textarea>
1523
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_meta_tags_tip">
1524
- <?php
1525
- _e('What you enter here will be copied verbatim to your header on pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
1526
- ?>
1527
- </div>
1528
- </td>
1529
- </tr>
1530
-
1531
- <tr>
1532
- <th scope="row" style="text-align:right; vertical-align:top;">
1533
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_meta_tags_tip');">
1534
- <?php _e('Additional Home Headers:', 'all_in_one_seo_pack')?>
1535
- </a>
1536
- </td>
1537
- <td>
1538
- <textarea cols="57" rows="2" name="aiosp_home_meta_tags"><?php echo stripcslashes(get_option('aiosp_home_meta_tags')); ?></textarea>
1539
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_meta_tags_tip">
1540
- <?php
1541
- _e('What you enter here will be copied verbatim to your header on the home page. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
1542
- ?>
1543
- </div>
1544
- </td>
1545
- </tr>
1546
-
1547
- <tr>
1548
- <th scope="row" style="text-align:right; vertical-align:top;">
1549
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'auto_social')?>" onclick="toggleVisibility('aiosp_do_log_tip');">
1550
- <?php _e('Log important events:', 'all_in_one_seo_pack')?>
1551
- </a>
1552
- </td>
1553
- <td>
1554
- <input type="checkbox" name="aiosp_do_log" <?php if (get_option('aiosp_do_log')) echo "checked=\"1\""; ?>/>
1555
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_do_log_tip">
1556
- <?php
1557
- _e('Check this and SEO pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging it. Make sure this directory is writable.', 'all_in_one_seo_pack');
1558
- ?>
1559
- </div>
1560
- </td>
1561
- </tr>
1562
-
1563
- </table>
1564
- <p class="submit">
1565
- <input type="hidden" name="action" value="aiosp_update" />
1566
- <input type="hidden" name="page_options" value="aiosp_home_description" />
1567
- <input type="submit" name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
1568
- </p>
1569
- </form>
1570
- </div>
1571
- <?php
1572
-
1573
- } // options_panel
1574
-
1575
- }
1576
-
1577
- add_option("aiosp_home_description", null, 'All in One SEO Plugin Home Description', 'yes');
1578
- add_option("aiosp_home_title", null, 'All in One SEO Plugin Home Title', 'yes');
1579
- add_option("aiosp_rewrite_titles", 1, 'All in One SEO Plugin Rewrite Titles', 'yes');
1580
- add_option("aiosp_use_categories", 0, 'All in One SEO Plugin Use Categories', 'yes');
1581
- add_option("aiosp_category_noindex", 1, 'All in One SEO Plugin Noindex for Categories', 'yes');
1582
- add_option("aiosp_archive_noindex", 1, 'All in One SEO Plugin Noindex for Archives', 'yes');
1583
- add_option("aiosp_tags_noindex", 0, 'All in One SEO Plugin Noindex for Tag Archives', 'yes');
1584
- add_option("aiosp_generate_descriptions", 1, 'All in One SEO Plugin Autogenerate Descriptions', 'yes');
1585
- add_option("aiosp_post_title_format", '%post_title% | %blog_title%', 'All in One SEO Plugin Post Title Format', 'yes');
1586
- add_option("aiosp_page_title_format", '%page_title% | %blog_title%', 'All in One SEO Plugin Page Title Format', 'yes');
1587
- add_option("aiosp_category_title_format", '%category_title% | %blog_title%', 'All in One SEO Plugin Category Title Format', 'yes');
1588
- add_option("aiosp_archive_title_format", '%date% | %blog_title%', 'All in One SEO Plugin Archive Title Format', 'yes');
1589
- add_option("aiosp_tag_title_format", '%tag% | %blog_title%', 'All in One SEO Plugin Tag Title Format', 'yes');
1590
- add_option("aiosp_search_title_format", '%search% | %blog_title%', 'All in One SEO Plugin Search Title Format', 'yes');
1591
- add_option("aiosp_description_format", '%description%', 'All in One SEO Plugin Description Format', 'yes');
1592
- add_option("aiosp_paged_format", ' - Part %page%', 'All in One SEO Plugin Paged Format', 'yes');
1593
- add_option("aiosp_404_title_format", 'Nothing found for %request_words%', 'All in One SEO Plugin 404 Title Format', 'yes');
1594
- add_option("aiosp_post_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
1595
- add_option("aiosp_page_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
1596
- add_option("aiosp_home_meta_tags", '', 'All in One SEO Plugin Additional Home Meta Tags', 'yes');
1597
- add_option("aiosp_do_log", null, 'All in One SEO Plugin write log file', 'yes');
1598
-
1599
- $aiosp = new All_in_One_SEO_Pack();
1600
- add_action('wp_head', array($aiosp, 'wp_head'));
1601
- add_action('template_redirect', array($aiosp, 'template_redirect'));
1602
-
1603
- add_action('init', array($aiosp, 'init'));
1604
-
1605
- if (substr($aiosp->wp_version, 0, 3) == '2.5') {
1606
- add_action('edit_form_advanced', array($aiosp, 'add_meta_tags_textinput'));
1607
- add_action('edit_page_form', array($aiosp, 'add_meta_tags_textinput'));
1608
- } else {
1609
- add_action('dbx_post_advanced', array($aiosp, 'add_meta_tags_textinput'));
1610
- add_action('dbx_page_advanced', array($aiosp, 'add_meta_tags_textinput'));
1611
- }
1612
-
1613
- add_action('edit_post', array($aiosp, 'post_meta_tags'));
1614
- add_action('publish_post', array($aiosp, 'post_meta_tags'));
1615
- add_action('save_post', array($aiosp, 'post_meta_tags'));
1616
- add_action('edit_page_form', array($aiosp, 'post_meta_tags'));
1617
-
1618
- add_action('admin_menu', array($aiosp, 'admin_menu'));
1619
-
1620
- ?>
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: All in One SEO Pack
5
+ Plugin URI: http://semperfiwebdesign.com
6
+ Description: Out-of-the-box SEO for your Wordpress blog.
7
+ Version: 1.4.6.10
8
+ Author: Michael Torbert
9
+ Author URI: http://semperfiwebdesign.com
10
+ */
11
+
12
+ /*
13
+ Copyright (C) 2008 Michael Torbert, semperfiwebdesign.com (michael AT semperfiwebdesign DOT com)
14
+ Original code by uberdose of uberdose.com
15
+
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation; either version 3 of the License, or
19
+ (at your option) any later version.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ class All_in_One_SEO_Pack {
31
+
32
+ var $version = "1.4.6.10";
33
+
34
+ /** Max numbers of chars in auto-generated description */
35
+ var $maximum_description_length = 160;
36
+
37
+ /** Minimum number of chars an excerpt should be so that it can be used
38
+ * as description. Touch only if you know what you're doing
39
+ */
40
+ var $minimum_description_length = 1;
41
+
42
+ var $ob_start_detected = false;
43
+
44
+ var $title_start = -1;
45
+
46
+ var $title_end = -1;
47
+
48
+ /** The title before rewriting */
49
+ var $orig_title = '';
50
+
51
+ /** Temp filename for the latest version. */
52
+ var $upgrade_filename = 'temp.zip';
53
+
54
+ /** Where to extract the downloaded newest version. */
55
+ var $upgrade_folder;
56
+
57
+ /** Any error in upgrading. */
58
+ var $upgrade_error;
59
+
60
+ /** Which zip to download in order to upgrade .*/
61
+ var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
62
+
63
+ /** Filename of log file. */
64
+ var $log_file;
65
+
66
+ /** Flag whether there should be logging. */
67
+ var $do_log;
68
+
69
+ var $wp_version;
70
+
71
+ function All_in_One_SEO_Pack() {
72
+ global $wp_version;
73
+ $this->wp_version = $wp_version;
74
+
75
+ $this->log_file = dirname(__FILE__) . '/all_in_one_seo_pack.log';
76
+ if (get_option('aiosp_do_log')) {
77
+ $this->do_log = true;
78
+ } else {
79
+ $this->do_log = false;
80
+ }
81
+
82
+ $this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
83
+ $this->upgrade_folder = dirname(__FILE__);
84
+ }
85
+
86
+ function template_redirect() {
87
+ global $wp_query;
88
+ $post = $wp_query->get_queried_object();
89
+
90
+ if (is_feed()) {
91
+ return;
92
+ }
93
+
94
+ if (is_single() || is_page()) {
95
+ $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, 'aiosp_disable', true)));
96
+ if ($aiosp_disable) {
97
+ return;
98
+ }
99
+ }
100
+
101
+ if (get_option('aiosp_rewrite_titles')) {
102
+ ob_start(array($this, 'output_callback_for_title'));
103
+ }
104
+ }
105
+
106
+ function output_callback_for_title($content) {
107
+ return $this->rewrite_title($content);
108
+ }
109
+
110
+ function init() {
111
+ if (function_exists('load_plugin_textdomain')) {
112
+ load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
113
+ }
114
+ }
115
+
116
+ function is_static_front_page() {
117
+ global $wp_query;
118
+ $post = $wp_query->get_queried_object();
119
+ return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
120
+ }
121
+
122
+ function is_static_posts_page() {
123
+ global $wp_query;
124
+ $post = $wp_query->get_queried_object();
125
+ return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
126
+ }
127
+
128
+ function get_base() {
129
+ return '/'.end(explode('/', str_replace(array('\\','/all_in_one_seo_pack.php'),array('/',''),__FILE__)));
130
+ }
131
+
132
+ function admin_head() {
133
+ $home = get_settings('siteurl');
134
+ $stylesheet = $home.'/wp-content/plugins' . $this->get_base() . '/css/all_in_one_seo_pack.css';
135
+ echo('<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />');
136
+ }
137
+
138
+ function wp_head() {
139
+ if (is_feed()) {
140
+ return;
141
+ }
142
+
143
+ global $wp_query;
144
+ $post = $wp_query->get_queried_object();
145
+ $meta_string = null;
146
+
147
+ //echo("wp_head() " . wp_title('', false) . " is_home() => " . is_home() . ", is_page() => " . is_page() . ", is_single() => " . is_single() . ", is_static_front_page() => " . $this->is_static_front_page() . ", is_static_posts_page() => " . $this->is_static_posts_page());
148
+
149
+ if (is_single() || is_page()) {
150
+ $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, 'aiosp_disable', true)));
151
+ if ($aiosp_disable) {
152
+ return;
153
+ }
154
+ }
155
+
156
+ if (get_option('aiosp_rewrite_titles')) {
157
+ // make the title rewrite as short as possible
158
+ if (function_exists('ob_list_handlers')) {
159
+ $active_handlers = ob_list_handlers();
160
+ } else {
161
+ $active_handlers = array();
162
+ }
163
+ if (sizeof($active_handlers) > 0 &&
164
+ strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
165
+ strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
166
+ ob_end_flush();
167
+ } else {
168
+ $this->log("another plugin interfering?");
169
+ // if we get here there *could* be trouble with another plugin :(
170
+ $this->ob_start_detected = true;
171
+ if (function_exists('ob_list_handlers')) {
172
+ foreach (ob_list_handlers() as $handler) {
173
+ $this->log("detected output handler $handler");
174
+ }
175
+ }
176
+ }
177
+ }
178
+
179
+ echo "\n<!-- all in one seo pack $this->version ";
180
+ if ($this->ob_start_detected) {
181
+ echo "ob_start_detected ";
182
+ }
183
+ echo "[$this->title_start,$this->title_end] ";
184
+ echo "-->\n";
185
+
186
+ if ((is_home() && get_option('aiosp_home_keywords')) || $this->is_static_front_page()) {
187
+ $keywords = trim($this->internationalize(get_option('aiosp_home_keywords')));
188
+ } else {
189
+ $keywords = $this->get_all_keywords();
190
+ }
191
+ if (is_single() || is_page()) {
192
+ if ($this->is_static_front_page()) {
193
+ $description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
194
+ } else {
195
+ $description = $this->get_post_description($post);
196
+ }
197
+ } else if (is_home()) {
198
+ $description = trim(stripcslashes($this->internationalize(get_option('aiosp_home_description'))));
199
+ } else if (is_category()) {
200
+ $description = $this->internationalize(category_description());
201
+ }
202
+
203
+ if (isset($description) && (strlen($description) > $this->minimum_description_length) && !(is_home() && is_paged())) {
204
+ $description = trim(strip_tags($description));
205
+ $description = str_replace('"', '', $description);
206
+
207
+ // replace newlines on mac / windows?
208
+ $description = str_replace("\r\n", ' ', $description);
209
+
210
+ // maybe linux uses this alone
211
+ $description = str_replace("\n", ' ', $description);
212
+
213
+ if (isset($meta_string)) {
214
+ //$meta_string .= "\n";
215
+ } else {
216
+ $meta_string = '';
217
+ }
218
+
219
+ // description format
220
+ $description_format = get_option('aiosp_description_format');
221
+ if (!isset($description_format) || empty($description_format)) {
222
+ $description_format = "%description%";
223
+ }
224
+ $description = str_replace('%description%', $description, $description_format);
225
+ $description = str_replace('%blog_title%', get_bloginfo('name'), $description);
226
+ $description = str_replace('%blog_description%', get_bloginfo('description'), $description);
227
+ $description = str_replace('%wp_title%', $this->get_original_title(), $description);
228
+
229
+ $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
230
+ }
231
+
232
+ if (isset ($keywords) && !empty($keywords) && !(is_home() && is_paged())) {
233
+ if (isset($meta_string)) {
234
+ $meta_string .= "\n";
235
+ }
236
+ $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\" />", $keywords);
237
+ }
238
+
239
+ if (function_exists('is_tag')) {
240
+ $is_tag = is_tag();
241
+ }
242
+
243
+ if ((is_category() && get_option('aiosp_category_noindex')) ||
244
+ (!is_category() && is_archive() &&!$is_tag && get_option('aiosp_archive_noindex')) ||
245
+ (get_option('aiosp_tags_noindex') && $is_tag)) {
246
+ if (isset($meta_string)) {
247
+ $meta_string .= "\n";
248
+ }
249
+ $meta_string .= '<meta name="robots" content="noindex,follow" />';
250
+ }
251
+
252
+ $page_meta = stripcslashes(get_option('aiosp_page_meta_tags'));
253
+ $post_meta = stripcslashes(get_option('aiosp_post_meta_tags'));
254
+ $home_meta = stripcslashes(get_option('aiosp_home_meta_tags'));
255
+ if (is_page() && isset($page_meta) && !empty($page_meta)) {
256
+ if (isset($meta_string)) {
257
+ $meta_string .= "\n";
258
+ }
259
+ echo "\n$page_meta";
260
+ }
261
+
262
+ if (is_single() && isset($post_meta) && !empty($post_meta)) {
263
+ if (isset($meta_string)) {
264
+ $meta_string .= "\n";
265
+ }
266
+ $meta_string .= "$post_meta";
267
+ }
268
+
269
+ if (is_home() && !empty($home_meta)) {
270
+ if (isset($meta_string)) {
271
+ $meta_string .= "\n";
272
+ }
273
+ $meta_string .= "$home_meta";
274
+ }
275
+
276
+ if ($meta_string != null) {
277
+ echo "$meta_string\n";
278
+ }
279
+
280
+ echo "<!-- /all in one seo pack -->\n";
281
+ }
282
+
283
+ function get_post_description($post) {
284
+ $description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "description", true))));
285
+ if (!$description) {
286
+ $description = $this->trim_excerpt_without_filters_full_length($this->internationalize($post->post_excerpt));
287
+ if (!$description && get_option("aiosp_generate_descriptions")) {
288
+ $description = $this->trim_excerpt_without_filters($this->internationalize($post->post_content));
289
+ }
290
+ }
291
+
292
+ // "internal whitespace trim"
293
+ $description = preg_replace("/\s\s+/", " ", $description);
294
+
295
+ return $description;
296
+ }
297
+
298
+ function replace_title($content, $title) {
299
+ $title = trim(strip_tags($title));
300
+
301
+ $title_tag_start = "<title>";
302
+ $title_tag_end = "</title>";
303
+ $len_start = strlen($title_tag_start);
304
+ $len_end = strlen($title_tag_end);
305
+ $title = stripcslashes(trim($title));
306
+ $start = strpos($content, $title_tag_start);
307
+ $end = strpos($content, $title_tag_end);
308
+
309
+ $this->title_start = $start;
310
+ $this->title_end = $end;
311
+ $this->orig_title = $title;
312
+
313
+ if ($start && $end) {
314
+ $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
315
+ } else {
316
+ // this breaks some sitemap plugins (like wpg2)
317
+ //$header = $content . "<title>$title</title>";
318
+
319
+ $header = $content;
320
+ }
321
+
322
+ return $header;
323
+ }
324
+
325
+ function internationalize($in) {
326
+ if (function_exists('langswitch_filter_langs_with_message')) {
327
+ $in = langswitch_filter_langs_with_message($in);
328
+ }
329
+ if (function_exists('polyglot_filter')) {
330
+ $in = polyglot_filter($in);
331
+ }
332
+ if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
333
+ $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
334
+ }
335
+ $in = apply_filters('localization', $in);
336
+ return $in;
337
+ }
338
+
339
+ /** @return The original title as delivered by WP (well, in most cases) */
340
+ function get_original_title() {
341
+ global $wp_query;
342
+ if (!$wp_query) {
343
+ return null;
344
+ }
345
+
346
+ $post = $wp_query->get_queried_object();
347
+
348
+ // the_search_query() is not suitable, it cannot just return
349
+ global $s;
350
+
351
+ $title = null;
352
+
353
+ if (is_home()) {
354
+ $title = get_option('blogname');
355
+ } else if (is_single()) {
356
+ $title = $this->internationalize(wp_title('', false));
357
+ } else if (is_search() && isset($s) && !empty($s)) {
358
+ if (function_exists('attribute_escape')) {
359
+ $search = attribute_escape(stripcslashes($s));
360
+ } else {
361
+ $search = wp_specialchars(stripcslashes($s), true);
362
+ }
363
+ $search = $this->capitalize($search);
364
+ $title = $search;
365
+ } else if (is_category() && !is_feed()) {
366
+ $category_description = $this->internationalize(category_description());
367
+ $category_name = ucwords($this->internationalize(single_cat_title('', false)));
368
+ $title = $category_name;
369
+ } else if (is_page()) {
370
+ $title = $this->internationalize(wp_title('', false));
371
+ } else if (function_exists('is_tag') && is_tag()) {
372
+ global $utw;
373
+ if ($utw) {
374
+ $tags = $utw->GetCurrentTagSet();
375
+ $tag = $tags[0]->tag;
376
+ $tag = str_replace('-', ' ', $tag);
377
+ } else {
378
+ // wordpress > 2.3
379
+ $tag = $this->internationalize(wp_title('', false));
380
+ }
381
+ if ($tag) {
382
+ $title = $tag;
383
+ }
384
+ } else if (is_archive()) {
385
+ $title = $this->internationalize(wp_title('', false));
386
+ } else if (is_404()) {
387
+ $title_format = get_option('aiosp_404_title_format');
388
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
389
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
390
+ $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
391
+ $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
392
+ $title = $new_title;
393
+ }
394
+
395
+ return trim($title);
396
+ }
397
+
398
+ function paged_title($title) {
399
+ // the page number if paged
400
+ global $paged;
401
+
402
+ // simple tagging support
403
+ global $STagging;
404
+
405
+ if (is_paged() || (isset($STagging) && $STagging->is_tag_view() && $paged)) {
406
+ $part = $this->internationalize(get_option('aiosp_paged_format'));
407
+ if (isset($part) || !empty($part)) {
408
+ $part = " " . trim($part);
409
+ $part = str_replace('%page%', $paged, $part);
410
+ $this->log("paged_title() [$title] [$part]");
411
+ $title .= $part;
412
+ }
413
+ }
414
+ return $title;
415
+ }
416
+
417
+ function rewrite_title($header) {
418
+ global $wp_query;
419
+ if (!$wp_query) {
420
+ $header .= "<!-- no wp_query found! -->\n";
421
+ return $header;
422
+ }
423
+
424
+ $post = $wp_query->get_queried_object();
425
+
426
+ // the_search_query() is not suitable, it cannot just return
427
+ global $s;
428
+
429
+ // simple tagging support
430
+ global $STagging;
431
+
432
+ if (is_home()) {
433
+ $title = $this->internationalize(get_option('aiosp_home_title'));
434
+ if (empty($title)) {
435
+ $title = $this->internationalize(get_option('blogname'));
436
+ }
437
+ $title = $this->paged_title($title);
438
+ $header = $this->replace_title($header, $title);
439
+ } else if (is_single()) {
440
+ // we're not in the loop :(
441
+ $authordata = get_userdata($post->post_author);
442
+ $categories = get_the_category();
443
+ $category = '';
444
+ if (count($categories) > 0) {
445
+ $category = $categories[0]->cat_name;
446
+ }
447
+ $title = $this->internationalize(get_post_meta($post->ID, "title", true));
448
+ if (!$title) {
449
+ $title = $this->internationalize(get_post_meta($post->ID, "title_tag", true));
450
+ if (!$title) {
451
+ $title = $this->internationalize(wp_title('', false));
452
+ }
453
+ }
454
+ $title_format = get_option('aiosp_post_title_format');
455
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
456
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
457
+ $new_title = str_replace('%post_title%', $title, $new_title);
458
+ $new_title = str_replace('%category%', $category, $new_title);
459
+ $new_title = str_replace('%category_title%', $category, $new_title);
460
+ $new_title = str_replace('%post_author_login%', $authordata->user_login, $new_title);
461
+ $new_title = str_replace('%post_author_nicename%', $authordata->user_nicename, $new_title);
462
+ $new_title = str_replace('%post_author_firstname%', ucwords($authordata->first_name), $new_title);
463
+ $new_title = str_replace('%post_author_lastname%', ucwords($authordata->last_name), $new_title);
464
+ $title = $new_title;
465
+ $title = trim($title);
466
+ $header = $this->replace_title($header, $title);
467
+ } else if (is_search() && isset($s) && !empty($s)) {
468
+ if (function_exists('attribute_escape')) {
469
+ $search = attribute_escape(stripcslashes($s));
470
+ } else {
471
+ $search = wp_specialchars(stripcslashes($s), true);
472
+ }
473
+ $search = $this->capitalize($search);
474
+ $title_format = get_option('aiosp_search_title_format');
475
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
476
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
477
+ $title = str_replace('%search%', $search, $title);
478
+ $header = $this->replace_title($header, $title);
479
+ } else if (is_category() && !is_feed()) {
480
+ $category_description = $this->internationalize(category_description());
481
+ $category_name = ucwords($this->internationalize(single_cat_title('', false)));
482
+ $title_format = get_option('aiosp_category_title_format');
483
+ $title = str_replace('%category_title%', $category_name, $title_format);
484
+ $title = str_replace('%category_description%', $category_description, $title);
485
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title);
486
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
487
+ $title = $this->paged_title($title);
488
+ $header = $this->replace_title($header, $title);
489
+ } else if (is_page()) {
490
+ // we're not in the loop :(
491
+ $authordata = get_userdata($post->post_author);
492
+ if ($this->is_static_front_page()) {
493
+ if ($this->internationalize(get_option('aiosp_home_title'))) {
494
+ $header = $this->replace_title($header, $this->internationalize(get_option('aiosp_home_title')));
495
+ }
496
+ } else {
497
+ $title = $this->internationalize(get_post_meta($post->ID, "title", true));
498
+ if (!$title) {
499
+ $title = $this->internationalize(wp_title('', false));
500
+ }
501
+ $title_format = get_option('aiosp_page_title_format');
502
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
503
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
504
+ $new_title = str_replace('%page_title%', $title, $new_title);
505
+ $new_title = str_replace('%page_author_login%', $authordata->user_login, $new_title);
506
+ $new_title = str_replace('%page_author_nicename%', $authordata->user_nicename, $new_title);
507
+ $new_title = str_replace('%page_author_firstname%', ucwords($authordata->first_name), $new_title);
508
+ $new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
509
+ $title = trim($new_title);
510
+ $header = $this->replace_title($header, $title);
511
+ }
512
+ } else if (function_exists('is_tag') && is_tag()) {
513
+ global $utw;
514
+ if ($utw) {
515
+ $tags = $utw->GetCurrentTagSet();
516
+ $tag = $tags[0]->tag;
517
+ $tag = str_replace('-', ' ', $tag);
518
+ } else {
519
+ // wordpress > 2.3
520
+ $tag = $this->internationalize(wp_title('', false));
521
+ }
522
+ if ($tag) {
523
+ $tag = $this->capitalize($tag);
524
+ $title_format = get_option('aiosp_tag_title_format');
525
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
526
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
527
+ $title = str_replace('%tag%', $tag, $title);
528
+ $title = $this->paged_title($title);
529
+ $header = $this->replace_title($header, $title);
530
+ }
531
+ } else if (isset($STagging) && $STagging->is_tag_view()) { // simple tagging support
532
+ $tag = $STagging->search_tag;
533
+ if ($tag) {
534
+ $tag = $this->capitalize($tag);
535
+ $title_format = get_option('aiosp_tag_title_format');
536
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
537
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
538
+ $title = str_replace('%tag%', $tag, $title);
539
+ $title = $this->paged_title($title);
540
+ $header = $this->replace_title($header, $title);
541
+ }
542
+ } else if (is_archive()) {
543
+ $date = $this->internationalize(wp_title('', false));
544
+ $title_format = get_option('aiosp_archive_title_format');
545
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
546
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
547
+ $new_title = str_replace('%date%', $date, $new_title);
548
+ $title = trim($new_title);
549
+ $title = $this->paged_title($title);
550
+ $header = $this->replace_title($header, $title);
551
+ } else if (is_404()) {
552
+ $title_format = get_option('aiosp_404_title_format');
553
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
554
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
555
+ $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
556
+ $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
557
+ $header = $this->replace_title($header, $new_title);
558
+ }
559
+
560
+ return $header;
561
+
562
+ }
563
+
564
+ /**
565
+ * @return User-readable nice words for a given request.
566
+ */
567
+ function request_as_words($request) {
568
+ $request = htmlspecialchars($request);
569
+ $request = str_replace('.html', ' ', $request);
570
+ $request = str_replace('.htm', ' ', $request);
571
+ $request = str_replace('.', ' ', $request);
572
+ $request = str_replace('/', ' ', $request);
573
+ $request_a = explode(' ', $request);
574
+ $request_new = array();
575
+ foreach ($request_a as $token) {
576
+ $request_new[] = ucwords(trim($token));
577
+ }
578
+ $request = implode(' ', $request_new);
579
+ return $request;
580
+ }
581
+
582
+ function capitalize($s) {
583
+ $s = trim($s);
584
+ $tokens = explode(' ', $s);
585
+ while (list($key, $val) = each($tokens)) {
586
+ $tokens[$key] = trim($tokens[$key]);
587
+ $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
588
+ }
589
+ $s = implode(' ', $tokens);
590
+ return $s;
591
+ }
592
+
593
+ function trim_excerpt_without_filters($text) {
594
+ $text = str_replace(']]>', ']]&gt;', $text);
595
+ $text = strip_tags($text);
596
+ $max = $this->maximum_description_length;
597
+
598
+ if ($max < strlen($text)) {
599
+ while($text[$max] != ' ' && $max > $this->minimum_description_length) {
600
+ $max--;
601
+ }
602
+ }
603
+ $text = substr($text, 0, $max);
604
+ return trim(stripcslashes($text));
605
+ }
606
+
607
+ function trim_excerpt_without_filters_full_length($text) {
608
+ $text = str_replace(']]>', ']]&gt;', $text);
609
+ $text = strip_tags($text);
610
+ return trim(stripcslashes($text));
611
+ }
612
+
613
+ /**
614
+ * @return comma-separated list of unique keywords
615
+ */
616
+ function get_all_keywords() {
617
+ global $posts;
618
+
619
+ if (is_404()) {
620
+ return null;
621
+ }
622
+
623
+ // if we are on synthetic pages
624
+ if (!is_home() && !is_page() && !is_single() &&!$this->is_static_front_page() && !$this->is_static_posts_page()) {
625
+ return null;
626
+ }
627
+
628
+ $keywords = array();
629
+ if (is_array($posts)) {
630
+ foreach ($posts as $post) {
631
+ if ($post) {
632
+
633
+ // custom field keywords
634
+ $keywords_a = $keywords_i = null;
635
+ $description_a = $description_i = null;
636
+ $id = $post->ID;
637
+ $keywords_i = stripcslashes($this->internationalize(get_post_meta($post->ID, "keywords", true)));
638
+ $keywords_i = str_replace('"', '', $keywords_i);
639
+ if (isset($keywords_i) && !empty($keywords_i)) {
640
+ $traverse = explode(',', $keywords_i);
641
+ foreach ($traverse as $keyword) {
642
+ $keywords[] = $keyword;
643
+ }
644
+ }
645
+
646
+ // WP 2.3 tags
647
+ if (function_exists('get_the_tags')) {
648
+ $tags = get_the_tags($post->ID);
649
+ if ($tags && is_array($tags)) {
650
+ foreach ($tags as $tag) {
651
+ $keywords[] = $this->internationalize($tag->name);
652
+ }
653
+ }
654
+ }
655
+
656
+ // Ultimate Tag Warrior integration
657
+ global $utw;
658
+ if ($utw) {
659
+ $tags = $utw->GetTagsForPost($post);
660
+ if (is_array($tags)) {
661
+ foreach ($tags as $tag) {
662
+ $tag = $tag->tag;
663
+ $tag = str_replace('_',' ', $tag);
664
+ $tag = str_replace('-',' ',$tag);
665
+ $tag = stripcslashes($tag);
666
+ $keywords[] = $tag;
667
+ }
668
+ }
669
+ }
670
+
671
+ // autometa
672
+ $autometa = stripcslashes(get_post_meta($post->ID, "autometa", true));
673
+ if (isset($autometa) && !empty($autometa)) {
674
+ $autometa_array = explode(' ', $autometa);
675
+ foreach ($autometa_array as $e) {
676
+ $keywords[] = $e;
677
+ }
678
+ }
679
+
680
+ if (get_option('aiosp_use_categories') && !is_page()) {
681
+ $categories = get_the_category($post->ID);
682
+ foreach ($categories as $category) {
683
+ $keywords[] = $this->internationalize($category->cat_name);
684
+ }
685
+ }
686
+
687
+ }
688
+ }
689
+ }
690
+
691
+ return $this->get_unique_keywords($keywords);
692
+ }
693
+
694
+ function get_meta_keywords() {
695
+ global $posts;
696
+
697
+ $keywords = array();
698
+ if (is_array($posts)) {
699
+ foreach ($posts as $post) {
700
+ if ($post) {
701
+ // custom field keywords
702
+ $keywords_a = $keywords_i = null;
703
+ $description_a = $description_i = null;
704
+ $id = $post->ID;
705
+ $keywords_i = stripcslashes(get_post_meta($post->ID, "keywords", true));
706
+ $keywords_i = str_replace('"', '', $keywords_i);
707
+ if (isset($keywords_i) && !empty($keywords_i)) {
708
+ $keywords[] = $keywords_i;
709
+ }
710
+ }
711
+ }
712
+ }
713
+
714
+ return $this->get_unique_keywords($keywords);
715
+ }
716
+
717
+ function get_unique_keywords($keywords) {
718
+ $small_keywords = array();
719
+ foreach ($keywords as $word) {
720
+ $small_keywords[] = mb_strtolower($word);
721
+ }
722
+ $keywords_ar = array_unique($small_keywords);
723
+ return implode(',', $keywords_ar);
724
+ }
725
+
726
+ function get_url($url) {
727
+ if (function_exists('file_get_contents')) {
728
+ $file = file_get_contents($url);
729
+ } else {
730
+ $curl = curl_init($url);
731
+ curl_setopt($curl, CURLOPT_HEADER, 0);
732
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
733
+ $file = curl_exec($curl);
734
+ curl_close($curl);
735
+ }
736
+ return $file;
737
+ }
738
+
739
+ function log($message) {
740
+ if ($this->do_log) {
741
+ error_log(date('Y-m-d H:i:s') . " " . $message . "\n", 3, $this->log_file);
742
+ }
743
+ }
744
+
745
+ function download_newest_version() {
746
+ $success = true;
747
+ $file_content = $this->get_url($this->upgrade_url);
748
+ if ($file_content === false) {
749
+ $this->upgrade_error = sprintf(__("Could not download distribution (%s)"), $this->upgrade_url);
750
+ $success = false;
751
+ } else if (strlen($file_content) < 100) {
752
+ $this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
753
+ $success = false;
754
+ } else {
755
+ $this->log(sprintf("filesize of download ZIP: %d", strlen($file_content)));
756
+ $fh = @fopen($this->upgrade_filename, 'w');
757
+ $this->log("fh is $fh");
758
+ if (!$fh) {
759
+ $this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
760
+ $this->upgrade_error .= "<br />";
761
+ $this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
762
+ $success = false;
763
+ } else {
764
+ $bytes_written = @fwrite($fh, $file_content);
765
+ $this->log("wrote $bytes_written bytes");
766
+ if (!$bytes_written) {
767
+ $this->upgrade_error = sprintf(__("Could not write to %s"), $this->upgrade_filename);
768
+ $success = false;
769
+ }
770
+ }
771
+ if ($success) {
772
+ fclose($fh);
773
+ }
774
+ }
775
+ return $success;
776
+ }
777
+
778
+ function install_newest_version() {
779
+ $success = $this->download_newest_version();
780
+ if ($success) {
781
+ $success = $this->extract_plugin();
782
+ unlink($this->upgrade_filename);
783
+ }
784
+ return $success;
785
+ }
786
+
787
+ function extract_plugin() {
788
+ if (!class_exists('PclZip')) {
789
+ require_once ('pclzip.lib.php');
790
+ }
791
+ $archive = new PclZip($this->upgrade_filename);
792
+ $files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
793
+ $this->log("files is $files");
794
+ if (is_array($files)) {
795
+ $num_extracted = sizeof($files);
796
+ $this->log("extracted $num_extracted files to $this->upgrade_folder");
797
+ $this->log(print_r($files, true));
798
+ return true;
799
+ } else {
800
+ $this->upgrade_error = $archive->errorInfo();
801
+ return false;
802
+ }
803
+ }
804
+
805
+ /** crude approximization of whether current user is an admin */
806
+ function is_admin() {
807
+ return current_user_can('level_8');
808
+ }
809
+
810
+ function is_directory_writable($directory) {
811
+ $filename = $directory . '/' . 'tmp_file_' . time();
812
+ $fh = @fopen($filename, 'w');
813
+ if (!$fh) {
814
+ return false;
815
+ }
816
+
817
+ $written = fwrite($fh, "test");
818
+ fclose($fh);
819
+ unlink($filename);
820
+ if ($written) {
821
+ return true;
822
+ } else {
823
+ return false;
824
+ }
825
+ }
826
+
827
+ function is_upgrade_directory_writable() {
828
+ //return $this->is_directory_writable($this->upgrade_folder);
829
+ // let's assume it is
830
+ return true;
831
+ }
832
+
833
+ function post_meta_tags($id) {
834
+ $awmp_edit = $_POST["aiosp_edit"];
835
+ if (isset($awmp_edit) && !empty($awmp_edit)) {
836
+ $keywords = $_POST["aiosp_keywords"];
837
+ $description = $_POST["aiosp_description"];
838
+ $title = $_POST["aiosp_title"];
839
+ $aiosp_meta = $_POST["aiosp_meta"];
840
+ $aiosp_disable = $_POST["aiosp_disable"];
841
+
842
+ delete_post_meta($id, 'keywords');
843
+ delete_post_meta($id, 'description');
844
+ delete_post_meta($id, 'title');
845
+ if ($this->is_admin()) {
846
+ delete_post_meta($id, 'aiosp_disable');
847
+ }
848
+ //delete_post_meta($id, 'aiosp_meta');
849
+
850
+ if (isset($keywords) && !empty($keywords)) {
851
+ add_post_meta($id, 'keywords', $keywords);
852
+ }
853
+ if (isset($description) && !empty($description)) {
854
+ add_post_meta($id, 'description', $description);
855
+ }
856
+ if (isset($title) && !empty($title)) {
857
+ add_post_meta($id, 'title', $title);
858
+ }
859
+ if (isset($aiosp_disable) && !empty($aiosp_disable) && $this->is_admin()) {
860
+ add_post_meta($id, 'aiosp_disable', $aiosp_disable);
861
+ }
862
+ /*
863
+ if (isset($aiosp_meta) && !empty($aiosp_meta)) {
864
+ add_post_meta($id, 'aiosp_meta', $aiosp_meta);
865
+ }
866
+ */
867
+ }
868
+ }
869
+
870
+ function edit_category($id) {
871
+ global $wpdb;
872
+ $id = $wpdb->escape($id);
873
+ $awmp_edit = $_POST["aiosp_edit"];
874
+ if (isset($awmp_edit) && !empty($awmp_edit)) {
875
+ $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
876
+ $title = $wpdb->escape($_POST["aiosp_title"]);
877
+ $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
878
+ if ($old_category) {
879
+ $wpdb->query("update $this->table_categories
880
+ set meta_title='$title', meta_keywords='$keywords'
881
+ where category_id=$id");
882
+ } else {
883
+ $wpdb->query("insert into $this->table_categories(meta_title, meta_keywords, category_id)
884
+ values ('$title', '$keywords', $id");
885
+ }
886
+ //$wpdb->query("insert into $this->table_categories")
887
+ /*
888
+ delete_post_meta($id, 'keywords');
889
+ delete_post_meta($id, 'description');
890
+ delete_post_meta($id, 'title');
891
+
892
+ if (isset($keywords) && !empty($keywords)) {
893
+ add_post_meta($id, 'keywords', $keywords);
894
+ }
895
+ if (isset($description) && !empty($description)) {
896
+ add_post_meta($id, 'description', $description);
897
+ }
898
+ if (isset($title) && !empty($title)) {
899
+ add_post_meta($id, 'title', $title);
900
+ }
901
+ */
902
+ }
903
+ }
904
+
905
+ /**
906
+ * @deprecated This was for the feature of dedicated meta tags for categories which never went mainstream.
907
+ */
908
+ function edit_category_form() {
909
+ global $post;
910
+ $keywords = stripcslashes(get_post_meta($post->ID, 'keywords', true));
911
+ $title = stripcslashes(get_post_meta($post->ID, 'title', true));
912
+ $description = stripcslashes(get_post_meta($post->ID, 'description', true));
913
+ ?>
914
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
915
+ <table class="editform" width="100%" cellspacing="2" cellpadding="5">
916
+ <tr>
917
+ <th width="33%" scope="row" valign="top">
918
+ <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>
919
+ </th>
920
+ </tr>
921
+ <tr>
922
+ <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
923
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
924
+ </tr>
925
+ <tr>
926
+ <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
927
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
928
+ </tr>
929
+ </table>
930
+ <?php
931
+ }
932
+
933
+ function add_meta_tags_textinput() {
934
+ global $post;
935
+ $post_id = $post;
936
+ if (is_object($post_id)) {
937
+ $post_id = $post_id->ID;
938
+ }
939
+ $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'keywords', true)));
940
+ $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'title', true)));
941
+ $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'description', true)));
942
+ $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'aiosp_meta', true)));
943
+ $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, 'aiosp_disable', true)));
944
+ ?>
945
+ <SCRIPT LANGUAGE="JavaScript">
946
+ <!-- Begin
947
+ function countChars(field,cntfield) {
948
+ cntfield.value = field.value.length;
949
+ }
950
+ // End -->
951
+ </script>
952
+
953
+ <?php if (substr($this->wp_version, 0, 3) == '2.5') { ?>
954
+ <div id="postaiosp" class="postbox closed">
955
+ <h3><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
956
+ <div class="inside">
957
+ <div id="postaiosp">
958
+ <?php } else { ?>
959
+ <div class="dbx-b-ox-wrapper">
960
+ <fieldset id="seodiv" class="dbx-box">
961
+ <div class="dbx-h-andle-wrapper">
962
+ <h3 class="dbx-handle"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
963
+ </div>
964
+ <div class="dbx-c-ontent-wrapper">
965
+ <div class="dbx-content">
966
+ <?php } ?>
967
+
968
+ <a target="__blank" href="http://semperfiwebdesign.com/portfolio/wordpress/wordpress-plugins/all-in-one-seo-pack/"><?php _e('Click here for Support', 'all_in_one_seo_pack') ?></a>
969
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
970
+ <table style="margin-bottom:40px">
971
+ <tr>
972
+ <th style="text-align:left;" colspan="2">
973
+ </th>
974
+ </tr>
975
+ <tr>
976
+ <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
977
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="62"/></td>
978
+ </tr>
979
+ <tr>
980
+ <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
981
+ <td><textarea name="aiosp_description" rows="1" cols="60"
982
+ onKeyDown="countChars(document.post.aiosp_description,document.post.length1)"
983
+ onKeyUp="countChars(document.post.aiosp_description,document.post.length1)"><?php echo $description ?></textarea><br />
984
+ <input readonly type="text" name="length1" size="3" maxlength="3" value="<?php echo strlen($description);?>" />
985
+ <?php _e(' characters. Most search engines use a maximum of 160 chars for the description.', 'all_in_one_seo_pack') ?>
986
+ </td>
987
+ </tr>
988
+ <tr>
989
+ <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
990
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="62"/></td>
991
+ </tr>
992
+
993
+ <?php if ($this->is_admin()) { ?>
994
+ <tr>
995
+ <th scope="row" style="text-align:right; vertical-align:top;">
996
+ <?php _e('Disable on this page/post:', 'all_in_one_seo_pack')?>
997
+ </th>
998
+ <td>
999
+ <input type="checkbox" name="aiosp_disable" <?php if ($aiosp_disable) echo "checked=\"1\""; ?>/>
1000
+ </td>
1001
+ </tr>
1002
+ <?php } ?>
1003
+
1004
+ </table>
1005
+
1006
+ <?php if (substr($this->wp_version, 0, 3) == '2.5') { ?>
1007
+ </div></div></div>
1008
+ <?php } else { ?>
1009
+ </div>
1010
+ </fieldset>
1011
+ </div>
1012
+ <?php } ?>
1013
+
1014
+ <?php
1015
+ }
1016
+
1017
+ function admin_menu() {
1018
+ $file = __FILE__;
1019
+
1020
+ // hack for 1.5
1021
+ if (substr($this->wp_version, 0, 3) == '1.5') {
1022
+ $file = 'all-in-one-seo-pack/all_in_one_seo_pack.php';
1023
+ }
1024
+ //add_management_page(__('All in One SEO Title', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 10, $file, array($this, 'management_panel'));
1025
+ add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 10, $file, array($this, 'options_panel'));
1026
+ }
1027
+
1028
+ function management_panel() {
1029
+ $message = null;
1030
+ $base_url = "edit.php?page=" . __FILE__;
1031
+ //echo($base_url);
1032
+ $type = $_REQUEST['type'];
1033
+ if (!isset($type)) {
1034
+ $type = "posts";
1035
+ }
1036
+ ?>
1037
+
1038
+ <ul class="aiosp_menu">
1039
+ <li><a href="<?php echo $base_url ?>&type=posts">Posts</a>
1040
+ </li>
1041
+ <li><a href="<?php echo $base_url ?>&type=pages">Pages</a>
1042
+ </li>
1043
+ </ul>
1044
+
1045
+ <?php
1046
+
1047
+ if ($type == "posts") {
1048
+ echo("posts");
1049
+ } elseif ($type == "pages") {
1050
+ echo("pages");
1051
+ }
1052
+
1053
+ }
1054
+
1055
+ function options_panel() {
1056
+ $message = null;
1057
+ $message_updated = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1058
+
1059
+ // update options
1060
+ if ($_POST['action'] && $_POST['action'] == 'aiosp_update') {
1061
+ $message = $message_updated;
1062
+ update_option('aiosp_home_title', $_POST['aiosp_home_title']);
1063
+ update_option('aiosp_home_description', $_POST['aiosp_home_description']);
1064
+ update_option('aiosp_home_keywords', $_POST['aiosp_home_keywords']);
1065
+ update_option('aiosp_max_words_excerpt', $_POST['aiosp_max_words_excerpt']);
1066
+ update_option('aiosp_rewrite_titles', $_POST['aiosp_rewrite_titles']);
1067
+ update_option('aiosp_post_title_format', $_POST['aiosp_post_title_format']);
1068
+ update_option('aiosp_page_title_format', $_POST['aiosp_page_title_format']);
1069
+ update_option('aiosp_category_title_format', $_POST['aiosp_category_title_format']);
1070
+ update_option('aiosp_archive_title_format', $_POST['aiosp_archive_title_format']);
1071
+ update_option('aiosp_tag_title_format', $_POST['aiosp_tag_title_format']);
1072
+ update_option('aiosp_search_title_format', $_POST['aiosp_search_title_format']);
1073
+ update_option('aiosp_description_format', $_POST['aiosp_description_format']);
1074
+ update_option('aiosp_404_title_format', $_POST['aiosp_404_title_format']);
1075
+ update_option('aiosp_paged_format', $_POST['aiosp_paged_format']);
1076
+ update_option('aiosp_use_categories', $_POST['aiosp_use_categories']);
1077
+ update_option('aiosp_category_noindex', $_POST['aiosp_category_noindex']);
1078
+ update_option('aiosp_archive_noindex', $_POST['aiosp_archive_noindex']);
1079
+ update_option('aiosp_tags_noindex', $_POST['aiosp_tags_noindex']);
1080
+ update_option('aiosp_generate_descriptions', $_POST['aiosp_generate_descriptions']);
1081
+ update_option('aiosp_debug_info', $_POST['aiosp_debug_info']);
1082
+ update_option('aiosp_post_meta_tags', $_POST['aiosp_post_meta_tags']);
1083
+ update_option('aiosp_page_meta_tags', $_POST['aiosp_page_meta_tags']);
1084
+ update_option('aiosp_home_meta_tags', $_POST['aiosp_home_meta_tags']);
1085
+ update_option('aiosp_do_log', $_POST['aiosp_do_log']);
1086
+ if (function_exists('wp_cache_flush')) {
1087
+ wp_cache_flush();
1088
+ }
1089
+ } elseif ($_POST['aiosp_upgrade']) {
1090
+ $message = __("Upgraded to newest version. Please revisit the options page to make sure you see the newest version.", 'all_in_one_seo_pack');
1091
+ $success = $this->install_newest_version();
1092
+ if (!$success) {
1093
+ $message = __("Upgrade failed", 'all_in_one_seo_pack');
1094
+ if (isset($this->upgrade_error) && !empty($this->upgrade_error)) {
1095
+ $message .= ": " . $this->upgrade_error;
1096
+ } else {
1097
+ $message .= ".";
1098
+ }
1099
+ }
1100
+ }
1101
+
1102
+ ?>
1103
+ <?php if ($message) : ?>
1104
+ <div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
1105
+ <?php endif; ?>
1106
+ <div id="dropmessage" class="updated" style="display:none;"></div>
1107
+ <div class="wrap">
1108
+ <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
1109
+ <p>
1110
+ <?php _e("This is version ", 'all_in_one_seo_pack') ?><?php _e("$this->version ", 'all_in_one_seo_pack') ?>
1111
+ &nbsp;<a target="_blank" title="<?php _e('All in One SEO Plugin Release History', 'all_in_one_seo_pack')?>"
1112
+ href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-pack-release-history/"><?php _e("Should I upgrade?", 'all_in_one_seo_pack')?>
1113
+ </a>
1114
+ | <a target="_blank" title="<?php _e('FAQ', 'all_in_one_seo_pack') ?>"
1115
+ href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/"><?php _e('FAQ', 'all_in_one_seo_pack') ?></a>
1116
+ | <a target="_blank" title="<?php _e('All in One SEO Plugin Feedback', 'all_in_one_seo_pack') ?>"
1117
+ href="http://semperfiwebdesign.com/portfolio/wordpress/wordpress-plugins/all-in-one-seo-pack/"><?php _e('Feedback', 'all_in_one_seo_pack') ?></a>
1118
+ | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
1119
+ href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/translations-for-all-in-one-seo-pack/"><?php _e('Translations', 'all_in_one_seo_pack') ?></a>
1120
+ | <a target="_blank" title="<?php echo 'Donate' ?>"
1121
+ href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8"><?php echo 'Donate' ?></a>
1122
+ </p>
1123
+ <p>
1124
+ <?php
1125
+ $canwrite = $this->is_upgrade_directory_writable();
1126
+ //$canwrite = false;
1127
+ ?>
1128
+ <form class="form-table" name="dofollow" action="" method="post">
1129
+ <p class="submit">
1130
+ <input type="submit" <?php if (!$canwrite) echo(' disabled="disabled" ');?> name="aiosp_upgrade" value="<?php _e('One Click Upgrade', 'all_in_one_seo_pack')?> &raquo;" />
1131
+ <strong><?php _e("(Remember: Backup early, backup often!)", 'all_in_one_seo_pack') ?></strong>
1132
+ </form>
1133
+ </p>
1134
+ <p></p>
1135
+
1136
+ <?php if (!$canwrite) {
1137
+ echo("<p><strong>"); echo(sprintf(__("Please make sure that %s is writable.", 'all_in_one_seo_pack'), $this->upgrade_folder)); echo("</p></strong>");
1138
+ } ?>
1139
+ </p>
1140
+
1141
+ <script type="text/javascript">
1142
+ <!--
1143
+ function toggleVisibility(id) {
1144
+ var e = document.getElementById(id);
1145
+ if(e.style.display == 'block')
1146
+ e.style.display = 'none';
1147
+ else
1148
+ e.style.display = 'block';
1149
+ }
1150
+ //-->
1151
+ </script>
1152
+
1153
+ <h3><?php _e('Click on option titles to get help!', 'all_in_one_seo_pack') ?></h3>
1154
+
1155
+ <form name="dofollow" action="" method="post">
1156
+ <table class="form-table">
1157
+
1158
+ <tr>
1159
+ <th scope="row" style="text-align:right; vertical-align:top;">
1160
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_title_tip');">
1161
+ <?php _e('Home Title:', 'all_in_one_seo_pack')?>
1162
+ </a>
1163
+ </td>
1164
+ <td>
1165
+ <textarea cols="57" rows="2" name="aiosp_home_title"><?php echo stripcslashes(get_option('aiosp_home_title')); ?></textarea>
1166
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_title_tip">
1167
+ <?php
1168
+ _e('As the name implies, this will be the title of your homepage. This is independent of any other option. If not set, the default blog title will get used.', 'all_in_one_seo_pack');
1169
+ ?>
1170
+ </div>
1171
+ </td>
1172
+ </tr>
1173
+
1174
+ <tr>
1175
+ <th scope="row" style="text-align:right; vertical-align:top;">
1176
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_description_tip');">
1177
+ <?php _e('Home Description:', 'all_in_one_seo_pack')?>
1178
+ </a>
1179
+ </td>
1180
+ <td>
1181
+ <textarea cols="57" rows="2" name="aiosp_home_description"><?php echo stripcslashes(get_option('aiosp_home_description')); ?></textarea>
1182
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_description_tip">
1183
+ <?php
1184
+ _e('The META description for your homepage. Independent of any other options, the default is no META description at all if this is not set.', 'all_in_one_seo_pack');
1185
+ ?>
1186
+ </div>
1187
+ </td>
1188
+ </tr>
1189
+
1190
+ <tr>
1191
+ <th scope="row" style="text-align:right; vertical-align:top;">
1192
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_keywords_tip');">
1193
+ <?php _e('Home Keywords (comma separated):', 'all_in_one_seo_pack')?>
1194
+ </a>
1195
+ </td>
1196
+ <td>
1197
+ <textarea cols="57" rows="2" name="aiosp_home_keywords"><?php echo stripcslashes(get_option('aiosp_home_keywords')); ?></textarea>
1198
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_keywords_tip">
1199
+ <?php
1200
+ _e("A comma separated list of your most important keywords for your site that will be written as META keywords on your homepage. Don't stuff everything in here.", 'all_in_one_seo_pack');
1201
+ ?>
1202
+ </div>
1203
+ </td>
1204
+ </tr>
1205
+
1206
+ <tr>
1207
+ <th scope="row" style="text-align:right; vertical-align:top;">
1208
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_rewrite_titles_tip');">
1209
+ <?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
1210
+ </a>
1211
+ </td>
1212
+ <td>
1213
+ <input type="checkbox" name="aiosp_rewrite_titles" <?php if (get_option('aiosp_rewrite_titles')) echo "checked=\"1\""; ?>/>
1214
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_rewrite_titles_tip">
1215
+ <?php
1216
+ _e("Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the window title bar and of course in the source. If set, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: The default templates puts the title tag of posts like this: “Blog Archive >> Blog Name >> Post Title” (maybe I've overdone slightly). This is far from optimal. With the default post title format, Rewrite Title rewrites this to “Post Title | Blog Name”. If you have manually defined a title (in one of the text fields for All in One SEO Plugin input) this will become the title of your post in the format string.", 'all_in_one_seo_pack');
1217
+ ?>
1218
+ </div>
1219
+ </td>
1220
+ </tr>
1221
+
1222
+ <tr>
1223
+ <th scope="row" style="text-align:right; vertical-align:top;">
1224
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_title_format_tip');">
1225
+ <?php _e('Post Title Format:', 'all_in_one_seo_pack')?>
1226
+ </a>
1227
+ </td>
1228
+ <td>
1229
+ <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes(get_option('aiosp_post_title_format')); ?>"/>
1230
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_title_format_tip">
1231
+ <?php
1232
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1233
+ echo('<ul>');
1234
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1235
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1236
+ echo('<li>'); _e('%post_title% - The original title of the post', 'all_in_one_seo_pack'); echo('</li>');
1237
+ echo('<li>'); _e('%category_title% - The (main) category of the post', 'all_in_one_seo_pack'); echo('</li>');
1238
+ echo('<li>'); _e('%category% - Alias for %category_title%', 'all_in_one_seo_pack'); echo('</li>');
1239
+ echo('<li>'); _e("%post_author_login% - This post's author' login", 'all_in_one_seo_pack'); echo('</li>');
1240
+ echo('<li>'); _e("%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1241
+ echo('<li>'); _e("%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1242
+ echo('<li>'); _e("%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1243
+ echo('</ul>');
1244
+ ?>
1245
+ </div>
1246
+ </td>
1247
+ </tr>
1248
+
1249
+ <tr>
1250
+ <th scope="row" style="text-align:right; vertical-align:top;">
1251
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_title_format_tip');">
1252
+ <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
1253
+ </a>
1254
+ </td>
1255
+ <td>
1256
+ <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes(get_option('aiosp_page_title_format')); ?>"/>
1257
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_title_format_tip">
1258
+ <?php
1259
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1260
+ echo('<ul>');
1261
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1262
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1263
+ echo('<li>'); _e('%page_title% - The original title of the page', 'all_in_one_seo_pack'); echo('</li>');
1264
+ echo('<li>'); _e("%page_author_login% - This page's author' login", 'all_in_one_seo_pack'); echo('</li>');
1265
+ echo('<li>'); _e("%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1266
+ echo('<li>'); _e("%page_author_firstname% - This page's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1267
+ echo('<li>'); _e("%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1268
+ echo('</ul>');
1269
+ ?>
1270
+ </div>
1271
+ </td>
1272
+ </tr>
1273
+
1274
+ <tr>
1275
+ <th scope="row" style="text-align:right; vertical-align:top;">
1276
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_title_format_tip');">
1277
+ <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
1278
+ </a>
1279
+ </td>
1280
+ <td>
1281
+ <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes(get_option('aiosp_category_title_format')); ?>"/>
1282
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_title_format_tip">
1283
+ <?php
1284
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1285
+ echo('<ul>');
1286
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1287
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1288
+ echo('<li>'); _e('%category_title% - The original title of the category', 'all_in_one_seo_pack'); echo('</li>');
1289
+ echo('<li>'); _e('%category_description% - The description of the category', 'all_in_one_seo_pack'); echo('</li>');
1290
+ echo('</ul>');
1291
+ ?>
1292
+ </div>
1293
+ </td>
1294
+ </tr>
1295
+
1296
+ <tr>
1297
+ <th scope="row" style="text-align:right; vertical-align:top;">
1298
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_title_format_tip');">
1299
+ <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
1300
+ </a>
1301
+ </td>
1302
+ <td>
1303
+ <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes(get_option('aiosp_archive_title_format')); ?>"/>
1304
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_title_format_tip">
1305
+ <?php
1306
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1307
+ echo('<ul>');
1308
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1309
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1310
+ echo('<li>'); _e('%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack'); echo('</li>');
1311
+ echo('</ul>');
1312
+ ?>
1313
+ </div>
1314
+ </td>
1315
+ </tr>
1316
+
1317
+ <tr>
1318
+ <th scope="row" style="text-align:right; vertical-align:top;">
1319
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tag_title_format_tip');">
1320
+ <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
1321
+ </a>
1322
+ </td>
1323
+ <td>
1324
+ <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes(get_option('aiosp_tag_title_format')); ?>"/>
1325
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_tag_title_format_tip">
1326
+ <?php
1327
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1328
+ echo('<ul>');
1329
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1330
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1331
+ echo('<li>'); _e('%tag% - The name of the tag', 'all_in_one_seo_pack'); echo('</li>');
1332
+ echo('</ul>');
1333
+ ?>
1334
+ </div>
1335
+ </td>
1336
+ </tr>
1337
+
1338
+ <tr>
1339
+ <th scope="row" style="text-align:right; vertical-align:top;">
1340
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_search_title_format_tip');">
1341
+ <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
1342
+ </a>
1343
+ </td>
1344
+ <td>
1345
+ <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes(get_option('aiosp_search_title_format')); ?>"/>
1346
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_search_title_format_tip">
1347
+ <?php
1348
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1349
+ echo('<ul>');
1350
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1351
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1352
+ echo('<li>'); _e('%search% - What was searched for', 'all_in_one_seo_pack'); echo('</li>');
1353
+ echo('</ul>');
1354
+ ?>
1355
+ </div>
1356
+ </td>
1357
+ </tr>
1358
+
1359
+ <tr>
1360
+ <th scope="row" style="text-align:right; vertical-align:top;">
1361
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_description_format_tip');">
1362
+ <?php _e('Description Format:', 'all_in_one_seo_pack')?>
1363
+ </a>
1364
+ </td>
1365
+ <td>
1366
+ <input size="59" name="aiosp_description_format" value="<?php echo stripcslashes(get_option('aiosp_description_format')); ?>"/>
1367
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_description_format_tip">
1368
+ <?php
1369
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1370
+ echo('<ul>');
1371
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1372
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1373
+ echo('<li>'); _e('%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all_in_one_seo_pack'); echo('</li>');
1374
+ echo('<li>'); _e('%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack'); echo('</li>');
1375
+ echo('</ul>');
1376
+ ?>
1377
+ </div>
1378
+ </td>
1379
+ </tr>
1380
+
1381
+ <tr>
1382
+ <th scope="row" style="text-align:right; vertical-align:top;">
1383
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_404_title_format_tip');">
1384
+ <?php _e('404 Title Format:', 'all_in_one_seo_pack')?>
1385
+ </a>
1386
+ </td>
1387
+ <td>
1388
+ <input size="59" name="aiosp_404_title_format" value="<?php echo stripcslashes(get_option('aiosp_404_title_format')); ?>"/>
1389
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_404_title_format_tip">
1390
+ <?php
1391
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1392
+ echo('<ul>');
1393
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1394
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1395
+ echo('<li>'); _e('%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack'); echo('</li>');
1396
+ echo('<li>'); _e('%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all_in_one_seo_pack'); echo('</li>');
1397
+ echo('</ul>');
1398
+ ?>
1399
+ </div>
1400
+ </td>
1401
+ </tr>
1402
+
1403
+ <tr>
1404
+ <th scope="row" style="text-align:right; vertical-align:top;">
1405
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_paged_format_tip');">
1406
+ <?php _e('Paged Format:', 'all_in_one_seo_pack')?>
1407
+ </a>
1408
+ </td>
1409
+ <td>
1410
+ <input size="59" name="aiosp_paged_format" value="<?php echo stripcslashes(get_option('aiosp_paged_format')); ?>"/>
1411
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_paged_format_tip">
1412
+ <?php
1413
+ _e('This string gets appended/prepended to titles when they are for paged index pages (like home or archive pages).', 'all_in_one_seo_pack');
1414
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1415
+ echo('<ul>');
1416
+ echo('<li>'); _e('%page% - The page number', 'all_in_one_seo_pack'); echo('</li>');
1417
+ echo('</ul>');
1418
+ ?>
1419
+ </div>
1420
+ </td>
1421
+ </tr>
1422
+
1423
+ <tr>
1424
+ <th scope="row" style="text-align:right; vertical-align:top;">
1425
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_categories_tip');">
1426
+ <?php _e('Use Categories for META keywords:', 'all_in_one_seo_pack')?>
1427
+ </td>
1428
+ <td>
1429
+ <input type="checkbox" name="aiosp_use_categories" <?php if (get_option('aiosp_use_categories')) echo "checked=\"1\""; ?>/>
1430
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_categories_tip">
1431
+ <?php
1432
+ _e('Check this if you want your categories for a given post used as the META keywords for this post (in addition to any keywords and tags you specify on the post edit page).', 'all_in_one_seo_pack');
1433
+ ?>
1434
+ </div>
1435
+ </td>
1436
+ </tr>
1437
+
1438
+ <tr>
1439
+ <th scope="row" style="text-align:right; vertical-align:top;">
1440
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_noindex_tip');">
1441
+ <?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
1442
+ </a>
1443
+ </td>
1444
+ <td>
1445
+ <input type="checkbox" name="aiosp_category_noindex" <?php if (get_option('aiosp_category_noindex')) echo "checked=\"1\""; ?>/>
1446
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_noindex_tip">
1447
+ <?php
1448
+ _e('Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
1449
+ ?>
1450
+ </div>
1451
+ </td>
1452
+ </tr>
1453
+
1454
+ <tr>
1455
+ <th scope="row" style="text-align:right; vertical-align:top;">
1456
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_noindex_tip');">
1457
+ <?php _e('Use noindex for Archives:', 'all_in_one_seo_pack')?>
1458
+ </a>
1459
+ </td>
1460
+ <td>
1461
+ <input type="checkbox" name="aiosp_archive_noindex" <?php if (get_option('aiosp_archive_noindex')) echo "checked=\"1\""; ?>/>
1462
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_noindex_tip">
1463
+ <?php
1464
+ _e('Check this for excluding archive pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
1465
+ ?>
1466
+ </div>
1467
+ </td>
1468
+ </tr>
1469
+
1470
+ <tr>
1471
+ <th scope="row" style="text-align:right; vertical-align:top;">
1472
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tags_noindex_tip');">
1473
+ <?php _e('Use noindex for Tag Archives:', 'all_in_one_seo_pack')?>
1474
+ </a>
1475
+ </td>
1476
+ <td>
1477
+ <input type="checkbox" name="aiosp_tags_noindex" <?php if (get_option('aiosp_tags_noindex')) echo "checked=\"1\""; ?>/>
1478
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_tags_noindex_tip">
1479
+ <?php
1480
+ _e('Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
1481
+ ?>
1482
+ </div>
1483
+ </td>
1484
+ </tr>
1485
+
1486
+ <tr>
1487
+ <th scope="row" style="text-align:right; vertical-align:top;">
1488
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_generate_descriptions_tip');">
1489
+ <?php _e('Autogenerate Descriptions:', 'all_in_one_seo_pack')?>
1490
+ </a>
1491
+ </td>
1492
+ <td>
1493
+ <input type="checkbox" name="aiosp_generate_descriptions" <?php if (get_option('aiosp_generate_descriptions')) echo "checked=\"1\""; ?>/>
1494
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_generate_descriptions_tip">
1495
+ <?php
1496
+ _e("Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack');
1497
+ ?>
1498
+ </div>
1499
+ </td>
1500
+ </tr>
1501
+
1502
+ <tr>
1503
+ <th scope="row" style="text-align:right; vertical-align:top;">
1504
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_meta_tags_tip');">
1505
+ <?php _e('Additional Post Headers:', 'all_in_one_seo_pack')?>
1506
+ </a>
1507
+ </td>
1508
+ <td>
1509
+ <textarea cols="57" rows="2" name="aiosp_post_meta_tags"><?php echo stripcslashes(get_option('aiosp_post_meta_tags')); ?></textarea>
1510
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_meta_tags_tip">
1511
+ <?php
1512
+ _e('What you enter here will be copied verbatim to your header on post pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
1513
+ ?>
1514
+ </div>
1515
+ </td>
1516
+ </tr>
1517
+
1518
+ <tr>
1519
+ <th scope="row" style="text-align:right; vertical-align:top;">
1520
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_meta_tags_tip');">
1521
+ <?php _e('Additional Page Headers:', 'all_in_one_seo_pack')?>
1522
+ </a>
1523
+ </td>
1524
+ <td>
1525
+ <textarea cols="57" rows="2" name="aiosp_page_meta_tags"><?php echo stripcslashes(get_option('aiosp_page_meta_tags')); ?></textarea>
1526
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_meta_tags_tip">
1527
+ <?php
1528
+ _e('What you enter here will be copied verbatim to your header on pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
1529
+ ?>
1530
+ </div>
1531
+ </td>
1532
+ </tr>
1533
+
1534
+ <tr>
1535
+ <th scope="row" style="text-align:right; vertical-align:top;">
1536
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_meta_tags_tip');">
1537
+ <?php _e('Additional Home Headers:', 'all_in_one_seo_pack')?>
1538
+ </a>
1539
+ </td>
1540
+ <td>
1541
+ <textarea cols="57" rows="2" name="aiosp_home_meta_tags"><?php echo stripcslashes(get_option('aiosp_home_meta_tags')); ?></textarea>
1542
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_meta_tags_tip">
1543
+ <?php
1544
+ _e('What you enter here will be copied verbatim to your header on the home page. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
1545
+ ?>
1546
+ </div>
1547
+ </td>
1548
+ </tr>
1549
+
1550
+ <tr>
1551
+ <th scope="row" style="text-align:right; vertical-align:top;">
1552
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'auto_social')?>" onclick="toggleVisibility('aiosp_do_log_tip');">
1553
+ <?php _e('Log important events:', 'all_in_one_seo_pack')?>
1554
+ </a>
1555
+ </td>
1556
+ <td>
1557
+ <input type="checkbox" name="aiosp_do_log" <?php if (get_option('aiosp_do_log')) echo "checked=\"1\""; ?>/>
1558
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_do_log_tip">
1559
+ <?php
1560
+ _e('Check this and SEO pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging it. Make sure this directory is writable.', 'all_in_one_seo_pack');
1561
+ ?>
1562
+ </div>
1563
+ </td>
1564
+ </tr>
1565
+
1566
+ </table>
1567
+ <p class="submit">
1568
+ <input type="hidden" name="action" value="aiosp_update" />
1569
+ <input type="hidden" name="page_options" value="aiosp_home_description" />
1570
+ <input type="submit" name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
1571
+ </p>
1572
+ <p><br />
1573
+ <strong>Check out these other great plugins!</strong><br />
1574
+ <a href="http://semperfiwebdesign.com/custom-applications/sms-text-message/" title="SMS Text Message WordPress plugin">SMS Text Message</a> - sends SMS updates to your readers<br />
1575
+ <a href="http://semperfiwebdesign.com/custom-applications/wp-security-scan/" title="WordPress Security">WordPress Security Scan</a> - provides vital security for your WordPress site
1576
+ </p>
1577
+ </form>
1578
+ </div>
1579
+ <?php
1580
+
1581
+ } // options_panel
1582
+
1583
+ }
1584
+
1585
+ add_option("aiosp_home_description", null, 'All in One SEO Plugin Home Description', 'yes');
1586
+ add_option("aiosp_home_title", null, 'All in One SEO Plugin Home Title', 'yes');
1587
+ add_option("aiosp_rewrite_titles", 1, 'All in One SEO Plugin Rewrite Titles', 'yes');
1588
+ add_option("aiosp_use_categories", 0, 'All in One SEO Plugin Use Categories', 'yes');
1589
+ add_option("aiosp_category_noindex", 1, 'All in One SEO Plugin Noindex for Categories', 'yes');
1590
+ add_option("aiosp_archive_noindex", 1, 'All in One SEO Plugin Noindex for Archives', 'yes');
1591
+ add_option("aiosp_tags_noindex", 0, 'All in One SEO Plugin Noindex for Tag Archives', 'yes');
1592
+ add_option("aiosp_generate_descriptions", 1, 'All in One SEO Plugin Autogenerate Descriptions', 'yes');
1593
+ add_option("aiosp_post_title_format", '%post_title% | %blog_title%', 'All in One SEO Plugin Post Title Format', 'yes');
1594
+ add_option("aiosp_page_title_format", '%page_title% | %blog_title%', 'All in One SEO Plugin Page Title Format', 'yes');
1595
+ add_option("aiosp_category_title_format", '%category_title% | %blog_title%', 'All in One SEO Plugin Category Title Format', 'yes');
1596
+ add_option("aiosp_archive_title_format", '%date% | %blog_title%', 'All in One SEO Plugin Archive Title Format', 'yes');
1597
+ add_option("aiosp_tag_title_format", '%tag% | %blog_title%', 'All in One SEO Plugin Tag Title Format', 'yes');
1598
+ add_option("aiosp_search_title_format", '%search% | %blog_title%', 'All in One SEO Plugin Search Title Format', 'yes');
1599
+ add_option("aiosp_description_format", '%description%', 'All in One SEO Plugin Description Format', 'yes');
1600
+ add_option("aiosp_paged_format", ' - Part %page%', 'All in One SEO Plugin Paged Format', 'yes');
1601
+ add_option("aiosp_404_title_format", 'Nothing found for %request_words%', 'All in One SEO Plugin 404 Title Format', 'yes');
1602
+ add_option("aiosp_post_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
1603
+ add_option("aiosp_page_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
1604
+ add_option("aiosp_home_meta_tags", '', 'All in One SEO Plugin Additional Home Meta Tags', 'yes');
1605
+ add_option("aiosp_do_log", null, 'All in One SEO Plugin write log file', 'yes');
1606
+
1607
+ $aiosp = new All_in_One_SEO_Pack();
1608
+ add_action('wp_head', array($aiosp, 'wp_head'));
1609
+ add_action('template_redirect', array($aiosp, 'template_redirect'));
1610
+
1611
+ add_action('init', array($aiosp, 'init'));
1612
+
1613
+ if (substr($aiosp->wp_version, 0, 3) == '2.5') {
1614
+ add_action('edit_form_advanced', array($aiosp, 'add_meta_tags_textinput'));
1615
+ add_action('edit_page_form', array($aiosp, 'add_meta_tags_textinput'));
1616
+ } else {
1617
+ add_action('dbx_post_advanced', array($aiosp, 'add_meta_tags_textinput'));
1618
+ add_action('dbx_page_advanced', array($aiosp, 'add_meta_tags_textinput'));
1619
+ }
1620
+
1621
+ add_action('edit_post', array($aiosp, 'post_meta_tags'));
1622
+ add_action('publish_post', array($aiosp, 'post_meta_tags'));
1623
+ add_action('save_post', array($aiosp, 'post_meta_tags'));
1624
+ add_action('edit_page_form', array($aiosp, 'post_meta_tags'));
1625
+
1626
+ add_action('admin_menu', array($aiosp, 'admin_menu'));
1627
+ ?>
readme.txt CHANGED
@@ -1,45 +1,50 @@
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,posts,plugin
5
- Requires at least: 1.5
6
- Tested up to: 2.5
7
- Stable tag: trunk
8
-
9
- Automatically 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**).
14
-
15
- **[Download now!](http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip)**
16
-
17
- [Support](http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/) |
18
- [Version History](http://wp.uberdose.com/2007/07/27/all-in-one-seo-pack-release-history/) |
19
- [FAQ](http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/)
20
-
21
- Some features:
22
-
23
- * Automatically optimizes your **titles** for search engines
24
- * Generates **META tags automatically**
25
- * Avoids the typical duplicate content found on Wordpress blogs
26
- * For Wordpress 2.3 you don't even have to look at the options, it works out-of-the-box. Just install.
27
- * You can override any title and set any META description and any META keywords you want.
28
- * You can fine-tune everything
29
- * Backward-Compatibility with many other plugins, like Auto Meta, Ultimate Tag Warrior and others.
30
-
31
- == Installation ==
32
-
33
- 1. Unzip into your `/wp-content/plugins/` directory. If you're uploading it make sure to upload
34
- the top-level folder. Don't just upload all the php files and put them in `/wp-content/plugins/`.
35
- 1. Activate the plugin through the 'Plugins' menu in WordPress
36
- 1. Visit your SEO options (*Options - All in One SEO*) for Wordpress 2.3.x, (*Settings - All in One SEO*) for Wordpress 2.5.x
37
- 1. That's it!
38
-
39
- For upgrading please use the built-in one-click updater (*Options - All in One SEO*).
40
- If you have to upgrade manually simply repeat the installation steps.
41
-
42
- == Frequently Asked Questions ==
43
-
44
- Please read these **[FAQs](http://wp.uberdose.com/2007/07/11/all-in-one-seo-pack-faq/)** before requesting
45
- **[Support](http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/#respond)**
 
 
 
 
 
1
+ === All in One SEO Pack ===
2
+ Contributors: hallsofmontezuma, uberdose
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
+ Tags: post,google,seo,meta,meta keywords,meta description,title,posts,plugin, search engine optimization
5
+ Requires at least: 1.5
6
+ Tested up to: 2.5
7
+ Stable tag: trunk
8
+
9
+ Automatically 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**).
14
+
15
+ **[Download now!](http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip)**
16
+
17
+ [Support](http://semperfiwebdesign.com/contact/) |
18
+ [Version History](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-pack-release-history/) |
19
+ [FAQ](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/)|
20
+ [Translations](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/translations-for-all-in-one-seo-pack/)
21
+
22
+ Some features:
23
+
24
+ * Automatically optimizes your **titles** for search engines
25
+ * Generates **META tags automatically**
26
+ * Avoids the typical duplicate content found on Wordpress blogs
27
+ * For Wordpress 2.3 you don't even have to look at the options, it works out-of-the-box. Just install.
28
+ * You can override any title and set any META description and any META keywords you want.
29
+ * You can fine-tune everything
30
+ * Backward-Compatibility with many other plugins, like Auto Meta, Ultimate Tag Warrior and others.
31
+
32
+ Be sure to check out:
33
+ [WP Security Scan](http://wordpress.org/extend/plugins/wp-security-scan/)
34
+ [SMS Text Message](http://wordpress.org/extend/plugins/sms-text-message/)
35
+
36
+ == Installation ==
37
+
38
+ 1. Unzip into your `/wp-content/plugins/` directory. If you're uploading it make sure to upload
39
+ the top-level folder. Don't just upload all the php files and put them in `/wp-content/plugins/`.
40
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
41
+ 1. Visit your SEO options (*Options - All in One SEO*) for Wordpress 2.3.x, (*Settings - All in One SEO*) for Wordpress 2.5.x
42
+ 1. That's it!
43
+
44
+ For upgrading please use the built-in one-click updater (*Options - All in One SEO*).
45
+ If you have to upgrade manually simply repeat the installation steps.
46
+
47
+ == Frequently Asked Questions ==
48
+
49
+ Please read these **[FAQs](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/)** before requesting
50
+ **[Support](http://semperfiwebdesign.com/contact/)**