All in One SEO Pack - Version 1.6.14.3

Version Description

Download this release

Release Info

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

Code changes from version 1.6.14.1 to 1.6.14.3

aioseop.class.php CHANGED
@@ -1,2437 +1,2420 @@
1
- <?php
2
-
3
- class All_in_One_SEO_Pack {
4
-
5
- var $version = "1.6.14.1";
6
-
7
- /** Max numbers of chars in auto-generated description */
8
- var $maximum_description_length = 160;
9
-
10
- /** Minimum number of chars an excerpt should be so that it can be used
11
- * as description. Touch only if you know what you're doing
12
- */
13
- var $minimum_description_length = 1;
14
-
15
- var $ob_start_detected = false;
16
-
17
- var $title_start = -1;
18
-
19
- var $title_end = -1;
20
-
21
- /** The title before rewriting */
22
- var $orig_title = '';
23
-
24
- /** Temp filename for the latest version. */
25
- // var $upgrade_filename = 'temp.zip';
26
-
27
- /** Where to extract the downloaded newest version. */
28
- // var $upgrade_folder;
29
-
30
- /** Any error in upgrading. */
31
- // var $upgrade_error;
32
-
33
- /** Which zip to download in order to upgrade .*/
34
- // var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
35
-
36
- /** Filename of log file. */
37
- var $log_file;
38
-
39
- /** Flag whether there should be logging. */
40
- var $do_log;
41
-
42
- var $wp_version;
43
-
44
- var $aioseop_op;
45
- //var $aioseop_options = get_option('aioseop_options');
46
-
47
- function All_in_One_SEO_Pack() {
48
- global $wp_version;
49
- global $aioseop_options;
50
- $this->wp_version = $wp_version;
51
-
52
- $this->log_file = dirname(__FILE__) . '/all_in_one_seo_pack.log';
53
- if ($aioseop_options['aiosp_do_log']) {
54
- $this->do_log = true;
55
- } else {
56
- $this->do_log = false;
57
- }
58
-
59
- // $this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
60
- // $this->upgrade_folder = dirname(__FILE__);
61
- }
62
-
63
-
64
- /*** Case conversion; handle non UTF-8 encodings and fallback ***/
65
-
66
- function convert_case( $str, $mode = 'upper' ) {
67
- static $charset = null;
68
- if ($charset == null) $charset = get_bloginfo( 'charset' );
69
- if ( $charset == 'UTF-8' ) {
70
- global $UTF8_TABLES;
71
- include_once( 'aioseop_utility.php' );
72
- }
73
- if ( $charset == 'UTF-8' && is_array($UTF8_TABLES) ) {
74
- if ( $mode == 'upper' ) return strtr( $str, $UTF8_TABLES['strtoupper'] );
75
- if ( $mode == 'lower' ) return strtr( $str, $UTF8_TABLES['strtolower'] );
76
- return $str;
77
- } else {
78
- if ( $mode == 'upper' && function_exists( 'mb_strtoupper' ) ) {
79
- return mb_strtoupper( $str, $charset );
80
- } elseif ( $mode == 'lower' && function_exists( 'mb_strtolower' ) ) {
81
- return mb_strtolower( $str, $charset );
82
- } else {
83
- if ( $mode == 'upper' ) return strtoupper( $str );
84
- if ( $mode == 'lower' ) return strtolower( $str );
85
- return $str;
86
- }
87
- }
88
- }
89
-
90
- /**
91
- * Convert a string to lower case
92
- * Compatible with mb_strtolower(), an UTF-8 friendly replacement for strtolower()
93
- */
94
-
95
- function strtolower( $str ) {
96
- return $this->convert_case( $str, 'lower' );
97
- }
98
-
99
- /**
100
- * Convert a string to upper case
101
- * Compatible with mb_strtoupper(), an UTF-8 friendly replacement for strtoupper()
102
- */
103
- function strtoupper( $str ) {
104
- return $this->convert_case( $str, 'upper' );
105
- }
106
-
107
- function template_redirect() {
108
- global $wp_query;
109
- global $aioseop_options;
110
-
111
- $post = $wp_query->get_queried_object();
112
-
113
- if( $this->aioseop_mrt_exclude_this_page()){
114
- return;
115
- }
116
-
117
- if (is_feed()) {
118
- return;
119
- }
120
-
121
- if (is_single() || is_page()) {
122
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
123
- if ($aiosp_disable) {
124
- return;
125
- }
126
- }
127
-
128
-
129
-
130
- if ($aioseop_options['aiosp_rewrite_titles']) {
131
- ob_start(array($this, 'output_callback_for_title'));
132
- }
133
- }
134
-
135
- function aioseop_mrt_exclude_this_page(){
136
- global $aioseop_options;
137
- $currenturl = trim($_SERVER['REQUEST_URI'],'/');
138
- /* echo "<br /><br />";
139
- echo $aioseop_options['aiosp_ex_pages'];
140
- echo "<br /><br />";
141
- */
142
- if ( !isset( $aioseop_options['aiosp_ex_pages'] ) ) $aioseop_options['aiosp_ex_pages'] = '';
143
- $excludedstuff = explode(',',$aioseop_options['aiosp_ex_pages']);
144
- foreach($excludedstuff as $exedd){
145
- //echo $exedd;
146
- $exedd = trim($exedd);
147
- if($exedd){
148
- if(stristr($currenturl, $exedd)){
149
- return true;
150
- }
151
- }
152
- }
153
- return false;
154
- }
155
-
156
- function output_callback_for_title($content) {
157
- return $this->rewrite_title($content);
158
- }
159
-
160
-
161
-
162
-
163
-
164
-
165
- //
166
- //CHECK IF ARRAY EXISTS IN DB, IF SO, GET ARRAY, ADD EVERYTHING, CHECK FOR ISSET?
167
- //
168
- function init() {
169
- if ( !defined('WP_PLUGIN_DIR') ) {
170
- load_plugin_textdomain('all_in_one_seo_pack', str_replace( ABSPATH, '', dirname(__FILE__)));
171
- } else {
172
- load_plugin_textdomain('all_in_one_seo_pack', false, dirname(plugin_basename(__FILE__)));
173
- }
174
-
175
- /*
176
- if (function_exists('load_plugin_textdomain')) {
177
- load_plugin_textdomain('all_in_one_seo_pack', WP_PLUGIN_DIR . '/all-in-one-seo-pack');
178
- }
179
- */
180
-
181
- }
182
-
183
- function is_static_front_page() {
184
- global $wp_query;
185
- global $aioseop_options;
186
- $post = $wp_query->get_queried_object();
187
- return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
188
- }
189
-
190
- function is_static_posts_page() {
191
- global $wp_query;
192
- $post = $wp_query->get_queried_object();
193
- return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
194
- }
195
-
196
- function get_base() {
197
- return '/'.end(explode('/', str_replace(array('\\','/all_in_one_seo_pack.php'),array('/',''),__FILE__)));
198
- }
199
-
200
- function seo_mrt_admin_head() {
201
- $home = get_settings('siteurl');
202
- $stylesheet = WP_PLUGIN_URL . '/all-in-one-seo-pack/style.css';
203
- echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
204
- }
205
-
206
-
207
- function wp_head() {
208
- if (is_feed()) {
209
- return;
210
- }
211
-
212
- global $wp_query;
213
- global $aioseop_options;
214
- $post = $wp_query->get_queried_object();
215
- $meta_string = null;
216
- if($this->is_static_posts_page()){
217
- $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
218
-
219
- }
220
- //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());
221
-
222
- if (is_single() || is_page()) {
223
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
224
- if ($aiosp_disable) {
225
- return;
226
- }
227
- }
228
-
229
- if( $this->aioseop_mrt_exclude_this_page()==TRUE ){
230
- return;
231
- }
232
-
233
- if ($aioseop_options['aiosp_rewrite_titles']) {
234
- // make the title rewrite as short as possible
235
- if (function_exists('ob_list_handlers')) {
236
- $active_handlers = ob_list_handlers();
237
- } else {
238
- $active_handlers = array();
239
- }
240
- if (sizeof($active_handlers) > 0 &&
241
- strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
242
- strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
243
- ob_end_flush();
244
- } else {
245
- $this->log("another plugin interfering?");
246
- // if we get here there *could* be trouble with another plugin :(
247
- $this->ob_start_detected = true;
248
- if (function_exists('ob_list_handlers')) {
249
- foreach (ob_list_handlers() as $handler) {
250
- $this->log("detected output handler $handler");
251
- }
252
- }
253
- }
254
- }
255
-
256
- echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
257
- if ($this->ob_start_detected) {
258
- echo "ob_start_detected ";
259
- }
260
- echo "[$this->title_start,$this->title_end] ";
261
- echo "-->\n";
262
- if ((is_home() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page()) || $this->is_static_front_page()) {
263
- $keywords = trim($this->internationalize($aioseop_options['aiosp_home_keywords']));
264
- } elseif($this->is_static_posts_page() && !$aioseop_options['aiosp_dynamic_postspage_keywords']){ // and if option = use page set keywords instead of keywords from recent posts
265
- //$keywords = "posts keyyysss" . stripcslashes(get_post_meta($post->ID,'keywords',true));
266
- $keywords = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
267
-
268
- // $keywords = $this->get_unique_keywords($keywords);
269
-
270
- } else {
271
- $keywords = $this->get_all_keywords();
272
- }
273
- if (is_single() || is_page() || $this->is_static_posts_page()) {
274
- if ($this->is_static_front_page()) {
275
- $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
276
- } else {
277
- $description = $this->get_post_description($post);
278
- $description = apply_filters('aioseop_description',$description);
279
- }
280
- } else if (is_home()) {
281
- $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
282
- } else if (is_category()) {
283
- $description = $this->internationalize(category_description());
284
- }
285
-
286
- if (isset($description) && (strlen($description) > $this->minimum_description_length) && !(is_home() && is_paged())) {
287
- $description = trim(strip_tags($description));
288
- $description = str_replace('"', '', $description);
289
-
290
- // replace newlines on mac / windows?
291
- $description = str_replace("\r\n", ' ', $description);
292
-
293
- // maybe linux uses this alone
294
- $description = str_replace("\n", ' ', $description);
295
-
296
- if (isset($meta_string)) {
297
- //$meta_string .= "\n";
298
- } else {
299
- $meta_string = '';
300
- }
301
-
302
- // description format
303
- $description_format = $aioseop_options['aiosp_description_format'];
304
- if (!isset($description_format) || empty($description_format)) {
305
- $description_format = "%description%";
306
- }
307
- $description = str_replace('%description%', apply_filters('aioseop_description_override', $description), $description_format);
308
- $description = str_replace('%blog_title%', get_bloginfo('name'), $description);
309
- $description = str_replace('%blog_description%', get_bloginfo('description'), $description);
310
- $description = str_replace('%wp_title%', $this->get_original_title(), $description);
311
- //$description = html_entity_decode($description, ENT_COMPAT, get_bloginfo('charset'));
312
- if($aioseop_options['aiosp_can'] && is_attachment()){
313
- $url = $this->aiosp_mrt_get_url($wp_query);
314
- if ($url) {
315
- preg_match_all('/(\d+)/', $url, $matches);
316
- if (is_array($matches)){
317
- $uniqueDesc = join('',$matches[0]);
318
- }
319
- }
320
- $description .= ' ' . $uniqueDesc;
321
- }
322
- $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
323
- }
324
- $keywords = apply_filters('aioseop_keywords',$keywords);
325
- if (isset ($keywords) && !empty($keywords) && !(is_home() && is_paged())) {
326
- if (isset($meta_string)) {
327
- $meta_string .= "\n";
328
- }
329
- $keywords = str_replace('"','',$keywords);
330
- $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\" />", $keywords);
331
- }
332
-
333
- $is_tag = is_tag();
334
-
335
- if ((is_category() && $aioseop_options['aiosp_category_noindex']) || (!is_category() && is_archive() &&!$is_tag && $aioseop_options['aiosp_archive_noindex']) || ($aioseop_options['aiosp_tags_noindex'] && $is_tag)) {
336
- if (isset($meta_string)) {
337
- $meta_string .= "\n";
338
- }
339
- $meta_string .= '<meta name="robots" content="noindex,follow" />';
340
- }
341
-
342
- $page_meta = stripcslashes($aioseop_options['aiosp_page_meta_tags']);
343
- $post_meta = stripcslashes($aioseop_options['aiosp_post_meta_tags']);
344
- $home_meta = stripcslashes($aioseop_options['aiosp_home_meta_tags']);
345
- if (is_page() && isset($page_meta) && !empty($page_meta) || $this->is_static_posts_page()) {
346
- if (isset($meta_string)) {
347
- $meta_string .= "\n";
348
- }
349
- echo "\n$page_meta";
350
- }
351
-
352
- if (is_single() && isset($post_meta) && !empty($post_meta)) {
353
- if (isset($meta_string)) {
354
- $meta_string .= "\n";
355
- }
356
- $meta_string .= "$post_meta";
357
- }
358
-
359
- if (is_home() && !empty($home_meta)) {
360
- if (isset($meta_string)) {
361
- $meta_string .= "\n";
362
- }
363
- $meta_string .= "$home_meta";
364
- }
365
-
366
- if ($meta_string != null) {
367
- echo "$meta_string\n";
368
- }
369
-
370
- if($aioseop_options['aiosp_can']){
371
- $url = $this->aiosp_mrt_get_url($wp_query);
372
- if ($url) {
373
- $url = apply_filters('aioseop_canonical_url',$url);
374
-
375
- echo "".'<link rel="canonical" href="'.$url.'" />'."\n";
376
- }
377
-
378
-
379
-
380
- }
381
-
382
- echo "<!-- /all in one seo pack -->\n";
383
- }
384
-
385
- function aiosp_google_analytics(){
386
- global $aioseop_options;
387
-
388
- ?>
389
- <script type="text/javascript">
390
-
391
- var _gaq = _gaq || [];
392
- _gaq.push(['_setAccount', '<?php echo $aioseop_options['aiosp_google_analytics_id']; ?>']);
393
- _gaq.push(['_trackPageview']);
394
-
395
- (function() {
396
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
397
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
398
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
399
- })();
400
-
401
- </script>
402
- <?php
403
- if ($aioseop_options['aiosp_ga_track_outbound_links']) {
404
- ?>
405
- <script type="text/javascript">
406
- function recordOutboundLink(link, category, action) {
407
- _gat._getTrackerByName()._trackEvent(category, action);
408
- setTimeout('document.location = "' + link.href + '"', 100);
409
- }
410
-
411
- if(typeof jQuery == 'function') { /* use jQuery if it exists because it is a more elegant solution */
412
- jQuery(function () {
413
- jQuery('a').click(function () {
414
- var href = this.attr('href');
415
- if ( ( typeof href != 'undefined' ) && (href.match(/^http/)) && (! href.match(document.domain)) ) {
416
- recordOutboundLink(this, 'Outbound Links', document.domain);
417
- }
418
- });
419
- });
420
- }
421
- else { /* use regular Javascript if jQuery does not exist */
422
- window.onload = function () {
423
- var links = document.getElementsByTagName('a');
424
- for (var x=0; x < links.length; x++) {
425
- links[x].onclick = function () {
426
- var mydomain = new RegExp(document.domain, 'i');
427
- if(!mydomain.test(this.getAttribute('href'))) {
428
- recordOutboundLink(this, 'Outbound Links', document.domain);
429
- }
430
- };
431
- }
432
- };
433
- }
434
- </script>
435
-
436
- <?php
437
-
438
- }}
439
-
440
- // Thank you, Yoast de Valk, for much of this code.
441
-
442
- function aiosp_mrt_get_url($query) {
443
- global $aioseop_options;
444
- if ($query->is_404 || $query->is_search) {
445
- return false;
446
- }
447
- $haspost = count($query->posts) > 0;
448
- $has_ut = function_exists('user_trailingslashit');
449
-
450
- if (get_query_var('m')) {
451
- $m = preg_replace('/[^0-9]/', '', get_query_var('m'));
452
- switch (strlen($m)) {
453
- case 4:
454
- $link = get_year_link($m);
455
- break;
456
- case 6:
457
- $link = get_month_link(substr($m, 0, 4), substr($m, 4, 2));
458
- break;
459
- case 8:
460
- $link = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2));
461
- break;
462
- default:
463
- return false;
464
- }
465
- } elseif (($query->is_single || $query->is_page) && $haspost) {
466
- $post = $query->posts[0];
467
- $link = get_permalink($post->ID);
468
- $link = $this->yoast_get_paged($link);
469
- } elseif (($query->is_single || $query->is_page) && $haspost) {
470
- $post = $query->posts[0];
471
- $link = get_permalink($post->ID);
472
- $link = $this->yoast_get_paged($link);
473
- } elseif ($query->is_author && $haspost) {
474
- global $wp_version;
475
- if ($wp_version >= '2') {
476
- $author = get_userdata(get_query_var('author'));
477
- if ($author === false)
478
- return false;
479
- $link = get_author_link(false, $author->ID, $author->user_nicename);
480
- } else {
481
- global $cache_userdata;
482
- $userid = get_query_var('author');
483
- $link = get_author_link(false, $userid, $cache_userdata[$userid]->user_nicename);
484
- }
485
- } elseif ($query->is_category && $haspost) {
486
- $link = get_category_link(get_query_var('cat'));
487
- $link = $this->yoast_get_paged($link);
488
- } else if ($query->is_tag && $haspost) {
489
- $tag = get_term_by('slug',get_query_var('tag'),'post_tag');
490
- if (!empty($tag->term_id)) {
491
- $link = get_tag_link($tag->term_id);
492
- }
493
- $link = $this->yoast_get_paged($link);
494
- } elseif ($query->is_day && $haspost) {
495
- $link = get_day_link(get_query_var('year'),
496
- get_query_var('monthnum'),
497
- get_query_var('day'));
498
- } elseif ($query->is_month && $haspost) {
499
- $link = get_month_link(get_query_var('year'),
500
- get_query_var('monthnum'));
501
- } elseif ($query->is_year && $haspost) {
502
- $link = get_year_link(get_query_var('year'));
503
- } elseif ($query->is_home) {
504
- if ((get_option('show_on_front') == 'page') &&
505
- ($pageid = get_option('page_for_posts'))) {
506
- $link = get_permalink($pageid);
507
- $link = $this->yoast_get_paged($link);
508
- $link = trailingslashit($link);
509
- } else {
510
- if ( function_exists( 'icl_get_home_url' ) ) {
511
- $link = icl_get_home_url();
512
- } else {
513
- $link = get_option( 'home' );
514
- }
515
- $link = $this->yoast_get_paged($link);
516
- $link = trailingslashit($link);
517
- }
518
- } elseif ($query->is_tax && $haspost ) {
519
- $taxonomy = get_query_var( 'taxonomy' );
520
- $term = get_query_var( 'term' );
521
- $link = get_term_link( $term, $taxonomy );
522
- $link = $this->yoast_get_paged( $link );
523
- } else {
524
- return false;
525
- }
526
-
527
- return $link;
528
-
529
- }
530
-
531
-
532
- function yoast_get_paged($link) {
533
- $page = get_query_var('paged');
534
- if ($page && $page > 1) {
535
- $link = trailingslashit($link) ."page/". "$page";
536
- if ($has_ut) {
537
- $link = user_trailingslashit($link, 'paged');
538
- } else {
539
- $link .= '/';
540
- }
541
- }
542
- return $link;
543
- }
544
-
545
-
546
- function get_post_description($post) {
547
- global $aioseop_options;
548
- $description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_description", true))));
549
- if (!$description) {
550
- $description = $this->trim_excerpt_without_filters_full_length($this->internationalize($post->post_excerpt));
551
- if (!$description && $aioseop_options["aiosp_generate_descriptions"]) {
552
- $description = $this->trim_excerpt_without_filters($this->internationalize($post->post_content));
553
- }
554
- }
555
-
556
- // "internal whitespace trim"
557
- $description = preg_replace("/\s\s+/", " ", $description);
558
-
559
- return $description;
560
- }
561
-
562
- function replace_title($content, $title) {
563
- $title = trim(strip_tags($title));
564
-
565
- $title_tag_start = "<title>";
566
- $title_tag_end = "</title>";
567
- $len_start = strlen($title_tag_start);
568
- $len_end = strlen($title_tag_end);
569
- $title = stripcslashes(trim($title));
570
- $start = strpos($content, $title_tag_start);
571
- $end = strpos($content, $title_tag_end);
572
-
573
- $this->title_start = $start;
574
- $this->title_end = $end;
575
- $this->orig_title = $title;
576
-
577
- if ($start && $end) {
578
- $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
579
- } else {
580
- // this breaks some sitemap plugins (like wpg2)
581
- //$header = $content . "<title>$title</title>";
582
-
583
- $header = $content;
584
- }
585
-
586
- return $header;
587
- }
588
-
589
- function internationalize($in) {
590
- if (function_exists('langswitch_filter_langs_with_message')) {
591
- $in = langswitch_filter_langs_with_message($in);
592
- }
593
- if (function_exists('polyglot_filter')) {
594
- $in = polyglot_filter($in);
595
- }
596
- if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
597
- $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
598
- }
599
- $in = apply_filters('localization', $in);
600
- return $in;
601
- }
602
-
603
- /** @return The original title as delivered by WP (well, in most cases) */
604
- function get_original_title() {
605
- global $wp_query;
606
- global $aioseop_options;
607
- if (!$wp_query) {
608
- return null;
609
- }
610
-
611
- $post = $wp_query->get_queried_object();
612
-
613
- // the_search_query() is not suitable, it cannot just return
614
- global $s;
615
-
616
- $title = null;
617
-
618
- if (is_home()) {
619
- $title = get_option('blogname');
620
- } else if (is_single()) {
621
- $title = $this->internationalize(wp_title('', false));
622
- } else if (is_search() && isset($s) && !empty($s)) {
623
- $search = esc_attr(stripcslashes($s));
624
- $search = $this->capitalize($search);
625
- $title = $search;
626
- } else if (is_category() && !is_feed()) {
627
- $category_description = $this->internationalize(category_description());
628
- $category_name = ucwords($this->internationalize(single_cat_title('', false)));
629
- $title = $category_name;
630
- } else if (is_page()) {
631
- $title = $this->internationalize(wp_title('', false));
632
- } else if (is_tag()) {
633
- global $utw;
634
- if ($utw) {
635
- $tags = $utw->GetCurrentTagSet();
636
- $tag = $tags[0]->tag;
637
- $tag = str_replace('-', ' ', $tag);
638
- } else {
639
- // wordpress > 2.3
640
- $tag = $this->internationalize(wp_title('', false));
641
- }
642
- if ($tag) {
643
- $title = $tag;
644
- }
645
- } else if (is_archive()) {
646
- $title = $this->internationalize(wp_title('', false));
647
- } else if (is_404()) {
648
- $title_format = $aioseop_options['aiosp_404_title_format'];
649
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
650
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
651
- $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
652
- $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
653
- $title = $new_title;
654
- }
655
-
656
- return trim($title);
657
- }
658
-
659
- function paged_title($title) {
660
- // the page number if paged
661
- global $paged;
662
- global $aioseop_options;
663
- // simple tagging support
664
- global $STagging;
665
-
666
- if (is_paged() || (isset($STagging) && $STagging->is_tag_view() && $paged)) {
667
- $part = $this->internationalize($aioseop_options['aiosp_paged_format']);
668
- if (isset($part) || !empty($part)) {
669
- $part = " " . trim($part);
670
- $part = str_replace('%page%', $paged, $part);
671
- $this->log("paged_title() [$title] [$part]");
672
- $title .= $part;
673
- }
674
- }
675
- return $title;
676
- }
677
-
678
- function rewrite_title($header) {
679
- global $aioseop_options;
680
- global $wp_query;
681
- if (!$wp_query) {
682
- $header .= "<!-- no wp_query found! -->\n";
683
- return $header;
684
- }
685
-
686
- $post = $wp_query->get_queried_object();
687
-
688
- // the_search_query() is not suitable, it cannot just return
689
- global $s;
690
-
691
- global $STagging;
692
-
693
- if (is_home() && !$this->is_static_posts_page()) {
694
- $title = $this->internationalize($aioseop_options['aiosp_home_title']);
695
- if (empty($title)) {
696
- $title = $this->internationalize(get_option('blogname'));
697
- }
698
- $title = $this->paged_title($title);
699
- $header = $this->replace_title($header, $title);
700
- } else if (is_attachment()) {
701
- $title = get_the_title($post->post_parent).' '.$post->post_title.' – '.get_option('blogname');
702
- $header = $this->replace_title($header,$title);
703
- } else if (is_single()) {
704
- // we're not in the loop :(
705
- $authordata = get_userdata($post->post_author);
706
- $categories = get_the_category();
707
- $category = '';
708
- if (count($categories) > 0) {
709
- $category = $categories[0]->cat_name;
710
- }
711
- $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
712
- if (!$title) {
713
- $title = $this->internationalize(get_post_meta($post->ID, "title_tag", true));
714
- if (!$title) {
715
- $title = $this->internationalize(wp_title('', false));
716
- }
717
- }
718
- $title_format = $aioseop_options['aiosp_post_title_format'];
719
- /*
720
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
721
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
722
- $new_title = str_replace('%post_title%', $title, $new_title);
723
- $new_title = str_replace('%category%', $category, $new_title);
724
- $new_title = str_replace('%category_title%', $category, $new_title);
725
- $new_title = str_replace('%post_author_login%', $authordata->user_login, $new_title);
726
- $new_title = str_replace('%post_author_nicename%', $authordata->user_nicename, $new_title);
727
- $new_title = str_replace('%post_author_firstname%', ucwords($authordata->first_name), $new_title);
728
- $new_title = str_replace('%post_author_lastname%', ucwords($authordata->last_name), $new_title);
729
- */
730
- $r_title = array('%blog_title%','%blog_description%','%post_title%','%category%','%category_title%','%post_author_login%','%post_author_nicename%','%post_author_firstname%','%post_author_lastname%');
731
- $d_title = array($this->internationalize(get_bloginfo('name')),$this->internationalize(get_bloginfo('description')),$title, $category, $category, $authordata->user_login, $authordata->user_nicename, ucwords($authordata->first_name), ucwords($authordata->last_name));
732
- $title = trim(str_replace($r_title, $d_title, $title_format));
733
-
734
- // $title = $new_title;
735
- // $title = trim($title);
736
- $title = apply_filters('aioseop_title_single',$title);
737
- $header = $this->replace_title($header, $title);
738
- } else if (is_search() && isset($s) && !empty($s)) {
739
- $search = esc_attr(stripcslashes($s));
740
- $search = $this->capitalize($search);
741
- $title_format = $aioseop_options['aiosp_search_title_format'];
742
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
743
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
744
- $title = str_replace('%search%', $search, $title);
745
- $header = $this->replace_title($header, $title);
746
- } else if (is_category() && !is_feed()) {
747
- $category_description = $this->internationalize(category_description());
748
- if($aioseop_options['aiosp_cap_cats']){
749
- $category_name = ucwords($this->internationalize(single_cat_title('', false)));
750
- }else{
751
- $category_name = $this->internationalize(single_cat_title('', false));
752
- }
753
- //$category_name = ucwords($this->internationalize(single_cat_title('', false)));
754
- $title_format = $aioseop_options['aiosp_category_title_format'];
755
- $title = str_replace('%category_title%', $category_name, $title_format);
756
- $title = str_replace('%category_description%', $category_description, $title);
757
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title);
758
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
759
- $title = $this->paged_title($title);
760
- $header = $this->replace_title($header, $title);
761
- } else if (is_page() || $this->is_static_posts_page()) {
762
- // we're not in the loop :(
763
- $authordata = get_userdata($post->post_author);
764
- if ($this->is_static_front_page()) {
765
- if ($this->internationalize($aioseop_options['aiosp_home_title'])) {
766
-
767
- //home title filter
768
- $home_title = $this->internationalize($aioseop_options['aiosp_home_title']);
769
- $home_title = apply_filters('aioseop_home_page_title',$home_title);
770
- $header = $this->replace_title($header, $home_title);
771
-
772
- }
773
- } else {
774
- $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
775
- if (!$title) {
776
- $title = $this->internationalize(wp_title('', false));
777
- }
778
- $title_format = $aioseop_options['aiosp_page_title_format'];
779
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
780
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
781
- $new_title = str_replace('%page_title%', $title, $new_title);
782
- $new_title = str_replace('%page_author_login%', $authordata->user_login, $new_title);
783
- $new_title = str_replace('%page_author_nicename%', $authordata->user_nicename, $new_title);
784
- $new_title = str_replace('%page_author_firstname%', ucwords($authordata->first_name), $new_title);
785
- $new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
786
- $title = trim($new_title);
787
- $title = $this->paged_title($title);
788
- $title = apply_filters('aioseop_title_page',$title);
789
- $header = $this->replace_title($header, $title);
790
- }
791
- } else if (is_tag()) {
792
- global $utw;
793
- if ($utw) {
794
- $tags = $utw->GetCurrentTagSet();
795
- $tag = $tags[0]->tag;
796
- $tag = str_replace('-', ' ', $tag);
797
- } else {
798
- // wordpress > 2.3
799
- $tag = $this->internationalize(wp_title('', false));
800
- }
801
- if ($tag) {
802
- $tag = $this->capitalize($tag);
803
- $title_format = $aioseop_options['aiosp_tag_title_format'];
804
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
805
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
806
- $title = str_replace('%tag%', $tag, $title);
807
- $title = $this->paged_title($title);
808
- $header = $this->replace_title($header, $title);
809
- }
810
- } else if (isset($STagging) && $STagging->is_tag_view()) { // simple tagging support
811
- $tag = $STagging->search_tag;
812
- if ($tag) {
813
- $tag = $this->capitalize($tag);
814
- $title_format = $aioseop_options['aiosp_tag_title_format'];
815
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
816
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
817
- $title = str_replace('%tag%', $tag, $title);
818
- $title = $this->paged_title($title);
819
- $header = $this->replace_title($header, $title);
820
- }
821
- } else if (is_archive()) {
822
- $date = $this->internationalize(wp_title('', false));
823
- $title_format = $aioseop_options['aiosp_archive_title_format'];
824
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
825
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
826
- $new_title = str_replace('%date%', $date, $new_title);
827
- $title = trim($new_title);
828
- $title = $this->paged_title($title);
829
- $header = $this->replace_title($header, $title);
830
- } else if (is_404()) {
831
- $title_format = $aioseop_options['aiosp_404_title_format'];
832
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
833
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
834
- $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
835
- $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
836
- $new_title = str_replace('%404_title%', $this->internationalize(wp_title('', false)), $new_title);
837
- $header = $this->replace_title($header, $new_title);
838
- }
839
-
840
- return $header;
841
-
842
- }
843
-
844
- /**
845
- * @return User-readable nice words for a given request.
846
- */
847
- function request_as_words($request) {
848
- $request = htmlspecialchars($request);
849
- $request = str_replace('.html', ' ', $request);
850
- $request = str_replace('.htm', ' ', $request);
851
- $request = str_replace('.', ' ', $request);
852
- $request = str_replace('/', ' ', $request);
853
- $request_a = explode(' ', $request);
854
- $request_new = array();
855
- foreach ($request_a as $token) {
856
- $request_new[] = ucwords(trim($token));
857
- }
858
- $request = implode(' ', $request_new);
859
- return $request;
860
- }
861
-
862
- function capitalize($s) {
863
- $s = trim($s);
864
- $tokens = explode(' ', $s);
865
- while (list($key, $val) = each($tokens)) {
866
- $tokens[$key] = trim($tokens[$key]);
867
- $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
868
- }
869
- $s = implode(' ', $tokens);
870
- return $s;
871
- }
872
-
873
- function trim_excerpt_without_filters($text) {
874
- $text = str_replace(']]>', ']]&gt;', $text);
875
- $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
876
- $text = strip_tags($text);
877
- $max = $this->maximum_description_length;
878
-
879
- if ($max < strlen($text)) {
880
- while($text[$max] != ' ' && $max > $this->minimum_description_length) {
881
- $max--;
882
- }
883
- }
884
- $text = substr($text, 0, $max);
885
- return trim(stripcslashes($text));
886
- }
887
-
888
- function trim_excerpt_without_filters_full_length($text) {
889
- $text = str_replace(']]>', ']]&gt;', $text);
890
- $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
891
- $text = strip_tags($text);
892
- return trim(stripcslashes($text));
893
- }
894
-
895
- /**
896
- * @return comma-separated list of unique keywords
897
- */
898
- function get_all_keywords() {
899
- global $posts;
900
- global $aioseop_options;
901
-
902
- if (is_404()) {
903
- return null;
904
- }
905
-
906
- // if we are on synthetic pages
907
- if (!is_home() && !is_page() && !is_single() &&!$this->is_static_front_page() && !$this->is_static_posts_page()) {
908
- return null;
909
- }
910
-
911
- $keywords = array();
912
- if (is_array($posts)) {
913
- foreach ($posts as $post) {
914
- if ($post) {
915
-
916
- // custom field keywords
917
- $keywords_a = $keywords_i = null;
918
- $description_a = $description_i = null;
919
-
920
- $id = (is_attachment())?($post->post_parent):($post->ID); // if attachment then use parent post id
921
- $keywords_i = stripcslashes($this->internationalize(get_post_meta($id, "_aioseop_keywords", true)));
922
- //$id = $post->ID;
923
- //$keywords_i = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
924
- $keywords_i = str_replace('"', '', $keywords_i);
925
- if (isset($keywords_i) && !empty($keywords_i)) {
926
- $traverse = explode(',', $keywords_i);
927
- foreach ($traverse as $keyword) {
928
- $keywords[] = $keyword;
929
- }
930
- }
931
-
932
- // WP 2.3 tags
933
- if ($aioseop_options['aiosp_use_tags_as_keywords']){
934
- if (function_exists('get_the_tags')) {
935
- //$tags = get_the_tags($post->ID);
936
- $tags = get_the_tags($id);
937
- if ($tags && is_array($tags)) {
938
- foreach ($tags as $tag) {
939
- $keywords[] = $this->internationalize($tag->name);
940
- }
941
- }
942
- }
943
- }
944
- // Ultimate Tag Warrior integration
945
- global $utw;
946
- if ($utw) {
947
- $tags = $utw->GetTagsForPost($post);
948
- if (is_array($tags)) {
949
- foreach ($tags as $tag) {
950
- $tag = $tag->tag;
951
- $tag = str_replace('_',' ', $tag);
952
- $tag = str_replace('-',' ',$tag);
953
- $tag = stripcslashes($tag);
954
- $keywords[] = $tag;
955
- }
956
- }
957
- }
958
-
959
- // autometa
960
- $autometa = stripcslashes(get_post_meta($id, 'autometa', true));
961
- //$autometa = stripcslashes(get_post_meta($post->ID, "autometa", true));
962
- if (isset($autometa) && !empty($autometa)) {
963
- $autometa_array = explode(' ', $autometa);
964
- foreach ($autometa_array as $e) {
965
- $keywords[] = $e;
966
- }
967
- }
968
-
969
- if ($aioseop_options['aiosp_use_categories'] && !is_page()) {
970
- $categories = get_the_category($id);
971
- //$categories = get_the_category($post->ID);
972
- foreach ($categories as $category) {
973
- $keywords[] = $this->internationalize($category->cat_name);
974
- }
975
- }
976
-
977
- }
978
- }
979
- }
980
-
981
- return $this->get_unique_keywords($keywords);
982
- }
983
-
984
- function get_meta_keywords() {
985
- global $posts;
986
-
987
- $keywords = array();
988
- if (is_array($posts)) {
989
- foreach ($posts as $post) {
990
- if ($post) {
991
- // custom field keywords
992
- $keywords_a = $keywords_i = null;
993
- $description_a = $description_i = null;
994
- $id = $post->ID;
995
- $keywords_i = stripcslashes(get_post_meta($post->ID, "_aioseop_keywords", true));
996
- $keywords_i = str_replace('"', '', $keywords_i);
997
- if (isset($keywords_i) && !empty($keywords_i)) {
998
- $keywords[] = $keywords_i;
999
- }
1000
- }
1001
- }
1002
- }
1003
-
1004
- return $this->get_unique_keywords($keywords);
1005
- }
1006
-
1007
- function get_unique_keywords($keywords) {
1008
- $small_keywords = array();
1009
- foreach ($keywords as $word) {
1010
- if (function_exists('mb_strtolower'))
1011
- $small_keywords[] = mb_strtolower($word, get_bloginfo('charset'));
1012
- else
1013
- $small_keywords[] = $this->strtolower($word);
1014
- }
1015
- $keywords_ar = array_unique($small_keywords);
1016
- return implode(',', $keywords_ar);
1017
- }
1018
-
1019
- function get_url($url) {
1020
- if (function_exists('file_get_contents')) {
1021
- $file = file_get_contents($url);
1022
- } else {
1023
- $curl = curl_init($url);
1024
- curl_setopt($curl, CURLOPT_HEADER, 0);
1025
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
1026
- $file = curl_exec($curl);
1027
- curl_close($curl);
1028
- }
1029
- return $file;
1030
- }
1031
-
1032
- function log($message) {
1033
- if ($this->do_log) {
1034
- error_log(date('Y-m-d H:i:s') . " " . $message . "\n", 3, $this->log_file);
1035
- }
1036
- }
1037
-
1038
- function download_newest_version() {
1039
- $success = true;
1040
- $file_content = $this->get_url($this->upgrade_url);
1041
- if ($file_content === false) {
1042
- $this->upgrade_error = sprintf(__("Could not download distribution (%s)"), $this->upgrade_url);
1043
- $success = false;
1044
- } else if (strlen($file_content) < 100) {
1045
- $this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
1046
- $success = false;
1047
- } else {
1048
- $this->log(sprintf("filesize of download ZIP: %d", strlen($file_content)));
1049
- $fh = @fopen($this->upgrade_filename, 'w');
1050
- $this->log("fh is $fh");
1051
- if (!$fh) {
1052
- $this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
1053
- $this->upgrade_error .= "<br />";
1054
- $this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
1055
- $success = false;
1056
- } else {
1057
- $bytes_written = @fwrite($fh, $file_content);
1058
- $this->log("wrote $bytes_written bytes");
1059
- if (!$bytes_written) {
1060
- $this->upgrade_error = sprintf(__("Could not write to %s"), $this->upgrade_filename);
1061
- $success = false;
1062
- }
1063
- }
1064
- if ($success) {
1065
- fclose($fh);
1066
- }
1067
- }
1068
- return $success;
1069
- }
1070
-
1071
- function install_newest_version() {
1072
- $success = $this->download_newest_version();
1073
- if ($success) {
1074
- $success = $this->extract_plugin();
1075
- unlink($this->upgrade_filename);
1076
- }
1077
- return $success;
1078
- }
1079
-
1080
- function extract_plugin() {
1081
- if (!class_exists('PclZip')) {
1082
- require_once ('pclzip.lib.php');
1083
- }
1084
- $archive = new PclZip($this->upgrade_filename);
1085
- $files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
1086
- $this->log("files is $files");
1087
- if (is_array($files)) {
1088
- $num_extracted = sizeof($files);
1089
- $this->log("extracted $num_extracted files to $this->upgrade_folder");
1090
- $this->log(print_r($files, true));
1091
- return true;
1092
- } else {
1093
- $this->upgrade_error = $archive->errorInfo();
1094
- return false;
1095
- }
1096
- }
1097
-
1098
- /** crude approximization of whether current user is an admin */
1099
- function is_admin() {
1100
- return current_user_can('level_8');
1101
- }
1102
-
1103
-
1104
- function is_directory_writable($directory) {
1105
- $filename = $directory . '/' . 'tmp_file_' . time();
1106
- $fh = @fopen($filename, 'w');
1107
- if (!$fh) {
1108
- return false;
1109
- }
1110
-
1111
- $written = fwrite($fh, "test");
1112
- fclose($fh);
1113
- unlink($filename);
1114
- if ($written) {
1115
- return true;
1116
- } else {
1117
- return false;
1118
- }
1119
- }
1120
-
1121
-
1122
- function is_upgrade_directory_writable() {
1123
- //return $this->is_directory_writable($this->upgrade_folder);
1124
- // let's assume it is
1125
- return true;
1126
- }
1127
-
1128
-
1129
- function post_meta_tags($id) {
1130
- $awmp_edit = $_POST["aiosp_edit"];
1131
- $nonce = $_POST['nonce-aioseop-edit'];
1132
- // if (!wp_verify_nonce($nonce, 'edit-aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1133
- if (isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce')) {
1134
-
1135
- foreach (Array('keywords', 'description', 'title', 'meta', 'disable', 'titleatr', 'menulabel', 'togglekeywords') as $f) {
1136
- $field = "aiosp_$f";
1137
- if ( isset( $_POST[$field] ) ) $$field = $_POST[$field];
1138
- }
1139
- if ( isset( $aiosp_keywords ) ) $keywords = $aiosp_keywords;
1140
- if ( isset( $aiosp_description ) ) $description = $aiosp_description;
1141
- if ( isset( $aiosp_title ) ) $title = $aiosp_title;
1142
-
1143
- delete_post_meta($id, '_aioseop_keywords');
1144
- delete_post_meta($id, '_aioseop_description');
1145
- delete_post_meta($id, '_aioseop_title');
1146
- delete_post_meta($id, '_aioseop_titleatr');
1147
- delete_post_meta($id, '_aioseop_menulabel');
1148
-
1149
-
1150
- if ($this->is_admin()) {
1151
- delete_post_meta($id, '_aioseop_disable');
1152
- }
1153
- //delete_post_meta($id, 'aiosp_meta');
1154
-
1155
- if (isset($keywords) && !empty($keywords)) {
1156
- add_post_meta($id, '_aioseop_keywords', $keywords);
1157
- }
1158
- if (isset($description) && !empty($description)) {
1159
- add_post_meta($id, '_aioseop_description', $description);
1160
- }
1161
- if (isset($title) && !empty($title)) {
1162
- add_post_meta($id, '_aioseop_title', $title);
1163
- }
1164
- if (isset($aiosp_titleatr) && !empty($aiosp_titleatr)) {
1165
- add_post_meta($id, '_aioseop_titleatr', $aiosp_titleatr);
1166
- }
1167
- if (isset($aiosp_menulabel) && !empty($aiosp_menulabel)) {
1168
- add_post_meta($id, '_aioseop_menulabel', $aiosp_menulabel);
1169
- }
1170
- if (isset($aiosp_disable) && !empty($aiosp_disable) && $this->is_admin()) {
1171
- add_post_meta($id, '_aioseop_disable', $aiosp_disable);
1172
- }
1173
- /*
1174
- if (isset($aiosp_meta) && !empty($aiosp_meta)) {
1175
- add_post_meta($id, 'aiosp_meta', $aiosp_meta);
1176
- }
1177
- */
1178
- }
1179
- }
1180
-
1181
- function edit_category($id) {
1182
- global $wpdb;
1183
- $id = $wpdb->escape($id);
1184
- $awmp_edit = $_POST["aiosp_edit"];
1185
- if (isset($awmp_edit) && !empty($awmp_edit)) {
1186
- $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
1187
- $title = $wpdb->escape($_POST["aiosp_title"]);
1188
- $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
1189
- if ($old_category) {
1190
- $wpdb->query($wpdb->prepare("update $this->table_categories
1191
- set meta_title='$title', meta_keywords='$keywords'
1192
- where category_id=$id"));
1193
- } else {
1194
- $wpdb->query($wpdb->prepare("insert into $this->table_categories(meta_title, meta_keywords, category_id)
1195
- values ('$title', '$keywords', $id"));
1196
- }
1197
- //$wpdb->query($wpdb->prepare("insert into $this->table_categories"))
1198
- /*
1199
- delete_post_meta($id, 'keywords');
1200
- delete_post_meta($id, 'description');
1201
- delete_post_meta($id, 'title');
1202
-
1203
- if (isset($keywords) && !empty($keywords)) {
1204
- add_post_meta($id, 'keywords', $keywords);
1205
- }
1206
- if (isset($description) && !empty($description)) {
1207
- add_post_meta($id, 'description', $description);
1208
- }
1209
- if (isset($title) && !empty($title)) {
1210
- add_post_meta($id, 'title', $title);
1211
- }
1212
- */
1213
- }
1214
- }
1215
-
1216
- /**
1217
- * @deprecated This was for the feature of dedicated meta tags for categories which never went mainstream.
1218
- */
1219
- function edit_category_form() {
1220
- global $post;
1221
- $keywords = stripcslashes(get_post_meta($post->ID, '_aioseop_keywords', true));
1222
- $title = stripcslashes(get_post_meta($post->ID, '_aioseop_title', true));
1223
- $description = stripcslashes(get_post_meta($post->ID, '_aioseop_description', true));
1224
- ?>
1225
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
1226
- <table class="editform" width="100%" cellspacing="2" cellpadding="5">
1227
- <tr>
1228
- <th width="33%" scope="row" valign="top">
1229
- <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>
1230
- </th>
1231
- </tr>
1232
- <tr>
1233
- <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
1234
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
1235
- </tr>
1236
- <tr>
1237
- <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
1238
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
1239
- </tr>
1240
- </table>
1241
- <?php
1242
- }
1243
-
1244
- function add_meta_tags_textinput() {
1245
- global $post;
1246
- $post_id = $post;
1247
- if (is_object($post_id)) {
1248
- $post_id = $post_id->ID;
1249
- }
1250
- $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_keywords', true)));
1251
- $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_title', true)));
1252
- $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_description', true)));
1253
- $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_meta', true)));
1254
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable', true)));
1255
- $aiosp_titleatr = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_titleatr', true)));
1256
- $aiosp_menulabel = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_menulabel', true)));
1257
-
1258
- ?>
1259
- <SCRIPT LANGUAGE="JavaScript">
1260
- <!-- Begin
1261
- function countChars(field,cntfield) {
1262
- cntfield.value = field.value.length;
1263
- }
1264
- // End -->
1265
- </script>
1266
-
1267
- <div id="postaiosp" class="postbox closed">
1268
- <h3><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
1269
- <div class="inside">
1270
- <div id="postaiosp">
1271
-
1272
- <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>
1273
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
1274
- <table style="margin-bottom:40px">
1275
- <tr>
1276
- <th style="text-align:left;" colspan="2">
1277
- </th>
1278
- </tr>
1279
- <tr>
1280
- <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
1281
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="62"/></td>
1282
- </tr>
1283
- <tr>
1284
- <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
1285
- <td><textarea name="aiosp_description" rows="1" cols="60" onKeyDown="countChars(document.post.aiosp_description,document.post.length1)" onKeyUp="countChars(document.post.aiosp_description,document.post.length1)"><?php echo $description ?>
1286
- </textarea><br />
1287
- <input readonly type="text" name="length1" size="3" maxlength="3" value="<?php echo strlen($description);?>" />
1288
- <?php _e(' characters. Most search engines use a maximum of 160 chars for the description.', 'all_in_one_seo_pack') ?>
1289
- </td>
1290
- </tr>
1291
- <tr>
1292
- <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
1293
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="62"/></td>
1294
- </tr>
1295
- <input type="hidden" name="nonce-aioseop-edit" value="<?php echo wp_create_nonce('edit-aioseop-nonce'); ?>" />
1296
- <?php if ($this->is_admin()) { ?>
1297
- <tr>
1298
- <th scope="row" style="text-align:right; vertical-align:top;">
1299
- <?php _e('Disable on this page/post:', 'all_in_one_seo_pack')?>
1300
- </th>
1301
- <td>
1302
- <input type="checkbox" name="aiosp_disable" <?php if ($aiosp_disable) echo "checked=\"1\""; ?>/>
1303
- </td>
1304
- </tr>
1305
-
1306
- <tr>
1307
- <th scope="row" style="text-align:right;"><?php _e('Title Attribute:', 'all_in_one_seo_pack') ?></th>
1308
- <td><input value="<?php echo $aiosp_titleatr ?>" type="text" name="aiosp_titleatr" size="62"/></td>
1309
- </tr>
1310
- <tr>
1311
- <th scope="row" style="text-align:right;"><?php _e('Menu Label:', 'all_in_one_seo_pack') ?></th>
1312
- <td><input value="<?php echo $aiosp_menulabel ?>" type="text" name="aiosp_menulabel" size="62"/></td>
1313
- </tr>
1314
- <?php } ?>
1315
- </table>
1316
-
1317
- </div>
1318
- </div>
1319
- </div>
1320
-
1321
- <?php
1322
- }
1323
-
1324
- function admin_menu() {
1325
- $file = __FILE__;
1326
-
1327
- //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'));
1328
- add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 'manage_options', $file, array($this, 'options_panel'));
1329
- }
1330
-
1331
- function management_panel() {
1332
- $message = null;
1333
- $base_url = "edit.php?page=" . __FILE__;
1334
- //echo($base_url);
1335
- $type = $_REQUEST['type'];
1336
- if (!isset($type)) {
1337
- $type = "posts";
1338
- }
1339
- ?>
1340
-
1341
- <ul class="aiosp_menu">
1342
- <li><a href="<?php echo $base_url ?>&type=posts">Posts</a>
1343
- </li>
1344
- <li><a href="<?php echo $base_url ?>&type=pages">Pages</a>
1345
- </li>
1346
- </ul>
1347
-
1348
- <?php
1349
-
1350
- if ($type == "posts") {
1351
- echo("posts");
1352
- } elseif ($type == "pages") {
1353
- echo("pages");
1354
- }
1355
- }
1356
-
1357
- function options_panel() {
1358
- $message = null;
1359
- //$message_updated = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1360
- global $aioseop_options;
1361
-
1362
- if(!$aioseop_options['aiosp_cap_cats']) {
1363
- $aioseop_options['aiosp_cap_cats'] = '1';
1364
- }
1365
-
1366
-
1367
- if (isset($_POST['action']) && $_POST['action'] == 'aiosp_update' && isset($_POST['Submit_Default'])) {
1368
- $nonce = $_POST['nonce-aioseop'];
1369
- if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1370
- $message = __("All in One SEO Options Reset.", 'all_in_one_seo_pack');
1371
- delete_option('aioseop_options');
1372
- $res_aioseop_options = array(
1373
- "aiosp_can"=>1,
1374
- "aiosp_donate"=>0,
1375
- "aiosp_home_title"=>null,
1376
- "aiosp_home_description"=>'',
1377
- "aiosp_home_keywords"=>null,
1378
- "aiosp_max_words_excerpt"=>'something',
1379
- "aiosp_rewrite_titles"=>1,
1380
- "aiosp_post_title_format"=>'%post_title% | %blog_title%',
1381
- "aiosp_page_title_format"=>'%page_title% | %blog_title%',
1382
- "aiosp_category_title_format"=>'%category_title% | %blog_title%',
1383
- "aiosp_archive_title_format"=>'%date% | %blog_title%',
1384
- "aiosp_tag_title_format"=>'%tag% | %blog_title%',
1385
- "aiosp_search_title_format"=>'%search% | %blog_title%',
1386
- "aiosp_description_format"=>'%description%',
1387
- "aiosp_404_title_format"=>'Nothing found for %request_words%',
1388
- "aiosp_paged_format"=>' - Part %page%',
1389
- "aiosp_google_analytics_id"=>null,
1390
- "aiosp_ga_track_outbound_links"=>0,
1391
- "aiosp_use_categories"=>0,
1392
- "aiosp_dynamic_postspage_keywords"=>1,
1393
- "aiosp_category_noindex"=>1,
1394
- "aiosp_archive_noindex"=>1,
1395
- "aiosp_tags_noindex"=>0,
1396
- "aiosp_cap_cats"=>1,
1397
- "aiosp_generate_descriptions"=>1,
1398
- "aiosp_debug_info"=>null,
1399
- "aiosp_post_meta_tags"=>'',
1400
- "aiosp_enablecpost"=>'0',
1401
- "aiosp_page_meta_tags"=>'',
1402
- "aiosp_home_meta_tags"=>'',
1403
- "aiosp_enabled" =>0,
1404
- "aiosp_use_tags_as_keywords" =>1,
1405
- "aiosp_seopostcol" => 1,
1406
- "aiosp_seocustptcol" => 0,
1407
- "aiosp_posttypecolumns" => array('post','page'),
1408
- "aiosp_do_log"=>null);
1409
- update_option('aioseop_options', $res_aioseop_options);
1410
- }
1411
-
1412
-
1413
- // update options
1414
- if(isset($_POST['action'])){
1415
- if ($_POST['action'] && $_POST['action'] == 'aiosp_update' && !empty( $_POST['Submit'] ) ) {
1416
- $nonce = $_POST['nonce-aioseop'];
1417
- if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1418
- $message = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1419
-
1420
- $options = Array( "aiosp_can", "aiosp_donate", "aiosp_home_title", "aiosp_home_description", "aiosp_home_keywords", "aiosp_max_words_excerpt",
1421
- "aiosp_rewrite_titles", "aiosp_post_title_format", "aiosp_page_title_format", "aiosp_category_title_format",
1422
- "aiosp_archive_title_format", "aiosp_tag_title_format", "aiosp_search_title_format", "aiosp_description_format",
1423
- "aiosp_404_title_format", "aiosp_paged_format", "aiosp_google_analytics_id", "aiosp_ga_track_outbound_links",
1424
- "aiosp_use_categories", "aiosp_dynamic_postspage_keywords", "aiosp_category_noindex", "aiosp_archive_noindex",
1425
- "aiosp_tags_noindex", "aiosp_generate_descriptions", "aiosp_cap_cats", "aiosp_enablecpost", "aiosp_debug_info",
1426
- "aiosp_post_meta_tags", "aiosp_page_meta_tags", "aiosp_home_meta_tags", "aiosp_ex_pages", "aiosp_do_log",
1427
- "aiosp_enabled", "aiosp_use_tags_as_keywords", "aiosp_seopostcol", "aiosp_seocustptcol", "aiosp_posttypecolumns");
1428
-
1429
- $esc_options = Array( "aiosp_home_title", "aiosp_home_description", "aiosp_google_analytics_id" );
1430
-
1431
- foreach( $options as $o ) {
1432
- $aioseop_options[$o] = '';
1433
- if ( in_array( $o, $esc_options ) ) {
1434
- if ( isset( $_POST[$o] ) ) $aioseop_options[$o] = esc_attr( $_POST[$o] );
1435
- } else {
1436
- if ( isset( $_POST[$o] ) ) $aioseop_options[$o] = $_POST[$o];
1437
- }
1438
- }
1439
-
1440
- update_option('aioseop_options', $aioseop_options);
1441
-
1442
- wp_cache_flush();
1443
- }
1444
- } /*elseif ($_POST['aiosp_upgrade']) {
1445
- $message = __("Upgraded to newest version. Please revisit the options page to make sure you see the newest version.", 'all_in_one_seo_pack');
1446
- $success = $this->install_newest_version();
1447
- if (!$success) {
1448
- $message = __("Upgrade failed", 'all_in_one_seo_pack');
1449
- if (isset($this->upgrade_error) && !empty($this->upgrade_error)) {
1450
- $message .= ": " . $this->upgrade_error;
1451
- } else {
1452
- $message .= ".";
1453
- }
1454
- }
1455
- }*/
1456
-
1457
- if ($message){
1458
- echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>";
1459
- }
1460
- ?>
1461
- <div id="dropmessage" class="updated" style="display:none;"></div>
1462
- <div class="wrap">
1463
-
1464
- <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
1465
- by <strong>Michael Torbert</strong> of <strong>Semper Fi Web Design</strong>
1466
- <p>
1467
- <div style="float:left;">
1468
-
1469
- <?php //_e("This is version ", 'all_in_one_seo_pack') ?><?php //_e("$this->version ", 'all_in_one_seo_pack') ?>
1470
- &nbsp;<a target="_blank" title="<?php _e('All in One SEO Plugin Release History', 'all_in_one_seo_pack')?>"
1471
- href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-pack-release-history/"><?php _e("Changelog", 'all_in_one_seo_pack')?>
1472
- </a>
1473
- | <a target="_blank" title="<?php _e('FAQ', 'all_in_one_seo_pack') ?>"
1474
- href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/"><?php _e('FAQ', 'all_in_one_seo_pack') ?></a>
1475
- | <a target="_blank" title="<?php _e('All in One SEO Plugin Support Forum', 'all_in_one_seo_pack') ?>"
1476
- href="http://semperfiwebdesign.com/forum/"><?php _e('Support', 'all_in_one_seo_pack') ?></a>
1477
- | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
1478
- 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>
1479
- | <strong><a target="_blank" title="<?php _e('Pro Version', 'all_in_one_seo_pack') ?>"
1480
- href="http://wpplugins.com/plugin/50/all-in-one-seo-pack-pro-version"><?php _e('UPGRADE TO PRO VERSION', 'all_in_one_seo_pack') ?></a></strong>
1481
- </div>
1482
-
1483
- <div style="width:600px;margin-top:40px;">
1484
- <form action="http://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
1485
- <span>Join our mailing list for tips, tricks, and WordPress secrets.<br /><em><strong>Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress</strong></em> ($39 value).</span>
1486
- <div>
1487
- <label for="mce-EMAIL">Email Address </label>
1488
- <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL">
1489
-
1490
-
1491
- <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn">
1492
- </div>
1493
- </form>
1494
- </div>
1495
- <div style="clear:both;">
1496
-
1497
- <br />
1498
- <!--<div style="width:75%;background-color:yellow;">
1499
- <em>Thank you for using <strong>All in One SEO Pack</strong> by <strong>Michael Torbert</strong> of <strong>Semper Fi Web Design</strong>. If you like this plugin and find it useful, feel free to click the <strong>donate</strong> button or send me a gift from my <strong>Amazon wishlist</strong>. Also, don't forget to follow me on <strong>Twitter</strong>.</em>
1500
- </div>
1501
- -->
1502
- <!--
1503
- <a target="_blank" title="<?php //echo 'Donate' ?>"
1504
- 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"><img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" width="" alt="Donate" /><?php //echo 'Donate' ?></a>
1505
- | <a target="_blank" title="Amazon Wish List" href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web"><img src="https://images-na.ssl-images-amazon.com/images/G/01/gifts/registries/wishlist/v2/web/wl-btn-74-b._V46774601_.gif" width="74" alt="My Amazon.com Wish List" height="42" border="0" /></a>
1506
- | <a target="_blank" title="<?php //_e('Follow us on Twitter', 'all_in_one_seo_pack') ?>"
1507
- href="http://twitter.com/michaeltorbert/"><img src="<?php //echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/twitter.png" alt="<?php //_e('Follow Us on Twitter', 'all_in_one_seo_pack') ?>" height="47px" /></a>
1508
- -->
1509
- </p>
1510
-
1511
- <div style="width:905px;">
1512
- <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;margin-right:15px;border: 1px solid #ddd;height:200px;margin-bottom:2px;">
1513
- <div style="width:423px;height:130px;">
1514
- <h3>Donate</h3>
1515
- <em>If you like this plugin and find it useful, help keep this plugin free and actively developed by clicking the <a 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" target="_blank"><strong>donate</strong></a> button or send me a gift from my <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank"><strong>Amazon wishlist</strong></a>. Also, don't forget to follow me on <a href="http://twitter.com/michaeltorbert/" target="_blank"><strong>Twitter</strong></a>.</em>
1516
- </div>
1517
- <a target="_blank" title="<?php echo 'Donate' ?>"
1518
- 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">
1519
- <img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/donate.jpg" alt="<?php _e('Donate with Paypal', 'all_in_one_seo_pack') ?>" /> </a>
1520
- <a target="_blank" title="Amazon Wish List" href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web">
1521
- <img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/amazon.jpg" alt="<?php _e('My Amazon Wish List', 'all_in_one_seo_pack') ?>" /> </a>
1522
- <a target="_blank" title="<?php _e('Follow us on Twitter', 'all_in_one_seo_pack') ?>" href="http://twitter.com/michaeltorbert/">
1523
- <img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/twitter.jpg" alt="<?php _e('Follow Us on Twitter', 'all_in_one_seo_pack') ?>" /> </a>
1524
- </div>
1525
-
1526
-
1527
- <div style="clear:both;">
1528
- <div style="float:left;background-color:white;padding:10px;border:1px solid #ddd;height:200px;margin-right:15px;">
1529
- <div style="width:423px;height:130px">
1530
- <h3>Drag and Drop WordPress Design</h3>
1531
- <p><a href="http://semperfiwebdesign.com/headwayaio/" target="_blank">Headway Themes</a> allows you to easily create your own stunning website designs! Stop using premade themes start making your own design with Headway's easy to use Drag and Drop interface. All in One SEO Pack users have an exclusive discount by using coupon code <strong>SEMPERFI30</strong> at checkout.</p>
1532
- </div>
1533
- <a href="http://semperfiwebdesign.com/headwayaio/" target="_blank"><img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/headwaybanner.png"></a>
1534
- </div>
1535
-
1536
- <div style="float:left;background-color:white;padding:10px;border:1px solid #ddd;height:200px;">
1537
- <div style="width:423px;height:130px;">
1538
- <h3>Reliable WordPress Hosting</h3>
1539
- <p><a title="WebHostingHub.com" target="_blank"
1540
- href="http://ref.webhostinghub.com/scripts/click.php?ref_id=rsuog2&ad_id=54c8d95f">WebHostingHub.com</a>
1541
- is a true leader in WordPress hosting and configured for WordPress
1542
- blogs. Hub's account includes UNLIMITED Hosting, NO-DOWNTIME Transfer,
1543
- 24/7 U.S. Support & 90-Day FULL Money Back.<br />
1544
- Check our <a title="WebHostingHub reviews" target="_blank"
1545
- href="http://webhostingrating.com/companies/web-hosting-hub/">customer
1546
- reviews</a> at WebHostingRating.com.</p>
1547
- </div>
1548
- <a title="WebHostingHub.com" target="_blank"
1549
- href="http://ref.webhostinghub.com/scripts/click.php?ref_id=rsuog2&ad_id=54c8d95f"><img
1550
- src="http://webhostingrating.com/images/hub_420_wordpress.png"
1551
- alt="WebHostingHub.com" width="420" height="53" border="0" /></a>
1552
- </div>
1553
- </div>
1554
-
1555
- <div style="clear:both;">
1556
-
1557
- <div style="float:left;background-color:white;padding:10px 10px 10px 10px;border:1px solid #ddd;margin-right:15px;margin-top:2px">
1558
- <div style="width:423px;height:130px">
1559
- <h3>Secure your WordPress Blog with WebsiteDefender.com</h3>
1560
- <p><a href="http://www.websitedefender.com">WebsiteDefender.com</a> is an online service that checks your WordPress blog by checking for malware, security vulnerabilities and hacker activity. Don’t take the risk of getting blacklisted by Google.
1561
- <strong><a href="https://dashboard.websitedefender.com/register-for-free-website-scan.php">Sign up for FREE</a> and keep your blog safe!</strong></p>
1562
- </div>
1563
- <a href="http://www.websitedefender.com/wordpress-security-with-websitedefender/" target="_blank"><img src="http://www.websitedefender.com/adverts/WD_wordpress_450x50.gif" alt="Sign up for a free WebsiteDefender account and secure your WordPress blog"></a>
1564
- </div>
1565
-
1566
-
1567
- <div style="float:left;background-color:white;padding:10px 10px 10px 10px;border:1px solid #ddd;margin-top:2px">
1568
- <div style="width:423px;height:130px;">
1569
- <h3>Awesome WordPress Hosting</h3>
1570
- <a title="GreenGeeks.com" target="_blank"
1571
- href="http://www.greengeeks.com/cgi-bin/affiliates/clickthru.cgi?id=allin1seo&page=1">GreenGeeks.com</a>
1572
- the world's #1 most eco-friendly web host, provides Awesome WordPress Hosting! 99.9% Uptime Guarantee. 24x7x365 Customer Support. FREE SITE MIGRATION. 30 day money back guarantee. Find out why we're Awesome! 877-ECO-SITE / 877-326-7483.
1573
- <br />
1574
- Get $30 OFF when you order. Use Coupon code: <strong>ALLIN1SEO</strong>.
1575
- </div>
1576
- <a title="GreenGeeks" target="_blank"
1577
- href="http://www.greengeeks.com/cgi-bin/affiliates/clickthru.cgi?id=allin1seo&page=1"><img
1578
- src="http://www.greengeeks.com/images/mktg/420x53-greengeeks-wordpress.png"
1579
- alt="GreenGeeks" width="420" height="53" border="0" /></a>
1580
- </div>
1581
- </div>
1582
-
1583
-
1584
-
1585
-
1586
- <!--
1587
- <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;border: 1px solid #ddd;">
1588
- <div style="width:365px;height:130px;">
1589
-
1590
- <form action="http://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
1591
- <span>Join our mailing list for tips, tricks, and WordPress secrets. Also receive discounts on top commercial plugins and themes.<br /><em><strong>Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress</strong></em>.</span>
1592
- <div class="mc-field-group">
1593
- <label for="mce-EMAIL">Email Address </label>
1594
- <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL">
1595
- </div>
1596
-
1597
- <div><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn"></div>
1598
- </form>
1599
- </div>
1600
- </div>
1601
- -->
1602
- </div>
1603
- <div style="clear:both";></div>
1604
- <!--
1605
- <p>
1606
- <?php
1607
- //$canwrite = $this->is_upgrade_directory_writable();
1608
- //$canwrite = false;
1609
- ?>
1610
- <form class="form-table" name="dofollow" action="" method="post">
1611
- <p class="submit">
1612
- <input type="submit" <?php //if (!$canwrite) echo(' disabled="disabled" ');?> name="aiosp_upgrade" value="<?php //_e('One Click Upgrade', 'all_in_one_seo_pack')?> &raquo;" />
1613
- <strong><?php //_e("(Remember: Backup early, backup often!)", 'all_in_one_seo_pack') ?></strong>
1614
- </form>
1615
- </p>
1616
- <p></p>
1617
-
1618
-
1619
- <?php //if (!$canwrite) {
1620
- //echo("<p><strong>"); echo(sprintf(__("Please make sure that %s is writable.", 'all_in_one_seo_pack'), $this->upgrade_folder)); echo("</p></strong>");
1621
- // } ?>
1622
- </p>
1623
- -->
1624
-
1625
- <script type="text/javascript">
1626
- <!--
1627
- function toggleVisibility(id) {
1628
- var e = document.getElementById(id);
1629
- if(e.style.display == 'block')
1630
- e.style.display = 'none';
1631
- else
1632
- e.style.display = 'block';
1633
- }
1634
- //-->
1635
- </script>
1636
-
1637
- <h3><?php _e('Click on option titles to get help!', 'all_in_one_seo_pack') ?></h3>
1638
-
1639
- <?php
1640
- function aioseop_mrt_df(){
1641
-
1642
- if(function_exists('fetch_feed')){
1643
- // start new feed
1644
- echo "Highest Donations";
1645
- // Get RSS Feed(s)
1646
- include_once(ABSPATH . WPINC . '/feed.php');
1647
-
1648
- // Get a SimplePie feed object from the specified feed source.
1649
- $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/highest-donations/feed/');
1650
-
1651
- // Figure out how many total items there are, but limit it to 5.
1652
- $maxitems = $rss->get_item_quantity(3);
1653
-
1654
- // Build an array of all the items, starting with element 0 (first element).
1655
- $rss_items = $rss->get_items(0, $maxitems);
1656
- ?>
1657
-
1658
- <ul>
1659
- <?php if ($maxitems == 0) echo '<li>No items.</li>';
1660
- else
1661
- // Loop through each feed item and display each item as a hyperlink.
1662
- foreach ( $rss_items as $item ) : ?>
1663
- <li>
1664
- <a href='<?php echo $item->get_permalink(); ?>'
1665
- title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
1666
- <?php echo $item->get_title(); ?></a>
1667
- </li>
1668
- <?php endforeach; ?>
1669
- </ul>
1670
-
1671
- <?php echo "Latest Donations"; ?>
1672
- <?php // Get RSS Feed(s)
1673
- include_once(ABSPATH . WPINC . '/feed.php');
1674
-
1675
- // Get a SimplePie feed object from the specified feed source.
1676
- $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/');
1677
-
1678
- // Figure out how many total items there are, but limit it to 5.
1679
- $maxitems = $rss->get_item_quantity(3);
1680
-
1681
- // Build an array of all the items, starting with element 0 (first element).
1682
- $rss_items = $rss->get_items(0, $maxitems);
1683
- ?>
1684
-
1685
- <ul>
1686
- <?php if ($maxitems == 0) echo '<li>No items.</li>';
1687
- else
1688
- // Loop through each feed item and display each item as a hyperlink.
1689
- foreach ( $rss_items as $item ) : ?>
1690
- <li>
1691
- <a href='<?php echo $item->get_permalink(); ?>'
1692
- title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
1693
- <?php echo $item->get_title(); ?></a>
1694
- </li>
1695
- <?php endforeach; ?>
1696
- </ul>
1697
-
1698
-
1699
- <?php // end new feed
1700
- }else{
1701
-
1702
- $uri = "feed://donations.semperfiwebdesign.com/category/highest-donations/feed/";
1703
- include_once(ABSPATH . WPINC . '/rss.php');
1704
- $rss = fetch_rss($uri);
1705
- if($rss){
1706
- echo "Highest Donations";
1707
- $maxitems = 5;
1708
- if(is_array($rss->items)){
1709
- $items = array_slice($rss->items, 0, $maxitems);
1710
- ?>
1711
- <ul>
1712
- <?php if (empty($items)) echo '<li>No items</li>';
1713
- else
1714
- foreach ( $items as $item ) : ?>
1715
- <li><a href='<?php echo $item['description']; ?>'
1716
- title='<?php echo $item['title']; ?>'>
1717
- <?php echo $item['title']; ?>
1718
- </a></li>
1719
- <?php endforeach; ?>
1720
- </ul>
1721
- <?php } }else{
1722
- //do something else for feed here
1723
- }
1724
-
1725
-
1726
- ?>
1727
-
1728
- <?php
1729
- $uri = "feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/";
1730
- include_once(ABSPATH . WPINC . '/rss.php');
1731
- $rss = fetch_rss($uri);
1732
- if($rss){
1733
- echo "Latest Donations";
1734
- $maxitems = 5;
1735
- if(is_array($rss->items)){
1736
- $items = array_slice($rss->items, 0, $maxitems);
1737
- ?>
1738
- <ul>
1739
- <?php if (empty($items)) echo '<li>No items</li>';
1740
- else
1741
- foreach ( $items as $item ) : ?>
1742
- <li><a href='<?php echo $item['link']; ?>'
1743
- title='<?php echo $item['title']; ?>'>
1744
- <?php echo $item['title']; ?>
1745
- </a></li>
1746
- <?php endforeach; ?>
1747
- </ul>
1748
- <?php } }else{
1749
- //fall back on something else for feed here
1750
- }
1751
- }
1752
- }
1753
-
1754
- //aioseop_mrt_df();
1755
-
1756
- ?>
1757
-
1758
-
1759
-
1760
- <?php
1761
- global $wpdb;
1762
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'keywords'");
1763
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'title'") + $somecount;
1764
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'description'") + $somecount;
1765
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_meta'") + $somecount;
1766
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_disable'") + $somecount;
1767
- if($somecount > 0){
1768
- echo "<div class='error' style='text-align:center;'><p><strong>Your database meta needs to be updated. " . $somecount . " old fields remaining</strong> <em>(Back up your database before updating.)</em>
1769
- <FORM action='' method='post' name='aioseop-migrate'>
1770
- <input type='hidden' name='nonce-aioseop-migrate' value='" . wp_create_nonce('aioseop-migrate-nonce') . "' />
1771
- <input type='submit' name='aioseop_migrate' class='button-primary' value='Update Database'>
1772
- </FORM>
1773
- </p></div>";
1774
- }
1775
-
1776
- if(!get_option('aioseop_options')){
1777
- echo "<div class='error' style='text-align:center;'><p><strong>Your database options need to be updated.</strong><em>(Back up your database before updating.)</em>
1778
- <FORM action='' method='post' name='aioseop-migrate-options'>
1779
- <input type='hidden' name='nonce-aioseop-migrate-options' value='" . wp_create_nonce('aioseop-migrate-nonce-options') . "' />
1780
- <input type='submit' name='aioseop_migrate_options' class='button-primary' value='Update Database Options'>
1781
- </FORM>
1782
- </p></div>";
1783
-
1784
- }
1785
-
1786
- ?>
1787
-
1788
-
1789
- <form name="dofollow" action="" method="post">
1790
- <table class="form-table">
1791
- <?php $aioseop_options = get_option('aioseop_options'); ?>
1792
- <?php if (!$aioseop_options['aiosp_donate']){?>
1793
- <tr>
1794
- <th scope="row" style="text-align:right; vertical-align:top;">
1795
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
1796
- <?php _e('I enjoy this plugin and have made a donation:', 'all_in_one_seo_pack'); ?>
1797
- </a>
1798
- </td>
1799
- <td>
1800
- <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
1801
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
1802
- <?php
1803
- _e('All donations support continued development of this free software.', 'all_in_one_seo_pack');
1804
- ?>
1805
- </div>
1806
- </td>
1807
- </tr>
1808
- <?php } ?>
1809
-
1810
- <tr>
1811
- <th scope="row" style="text-align:right; vertical-align:top;">
1812
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack'); ?>" onclick="toggleVisibility('aiosp_enabled_tip');">
1813
- <?php _e('Plugin Status:', 'all_in_one_seo_pack')?>
1814
- </a>
1815
- </td>
1816
- <td>
1817
- <input type="radio" name="aiosp_enabled" value="1" <?php if($aioseop_options['aiosp_enabled']) echo "checked"?> > <?php _e('Enabled', 'all_in_one_seo_pack'); ?><br>
1818
- <input type="radio" name="aiosp_enabled" value="0" <?php if(!$aioseop_options['aiosp_enabled']) echo "checked"?>> <?php _e('Disabled', 'all_in_one_seo_pack'); ?>
1819
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_enabled_tip">
1820
- <?php
1821
- _e('All in One SEO Pack must be enabled for use.', 'all_in_one_seo_pack');
1822
- ?>
1823
- </div>
1824
- </td>
1825
- </tr>
1826
-
1827
- <tr>
1828
- <th scope="row" style="text-align:right; vertical-align:top;">
1829
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_title_tip');">
1830
- <?php _e('Home Title:', 'all_in_one_seo_pack')?>
1831
- </a>
1832
- </td>
1833
- <td>
1834
- <textarea cols="57" rows="2" name="aiosp_home_title"><?php echo stripcslashes($aioseop_options['aiosp_home_title']); ?></textarea>
1835
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_title_tip">
1836
- <?php
1837
- _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');
1838
- ?>
1839
- </div>
1840
- </td>
1841
- </tr>
1842
-
1843
- <tr>
1844
- <th scope="row" style="text-align:right; vertical-align:top;">
1845
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_description_tip');">
1846
- <?php _e('Home Description:', 'all_in_one_seo_pack')?>
1847
- </a>
1848
- </td>
1849
- <td>
1850
- <textarea cols="57" rows="2" name="aiosp_home_description"><?php echo stripcslashes($aioseop_options['aiosp_home_description']); ?></textarea>
1851
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_description_tip">
1852
- <?php
1853
- _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');
1854
- ?>
1855
- </div>
1856
- </td>
1857
- </tr>
1858
-
1859
- <tr>
1860
- <th scope="row" style="text-align:right; vertical-align:top;">
1861
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_keywords_tip');">
1862
- <?php _e('Home Keywords (comma separated):', 'all_in_one_seo_pack')?>
1863
- </a>
1864
- </td>
1865
- <td>
1866
- <textarea cols="57" rows="2" name="aiosp_home_keywords"><?php echo stripcslashes($aioseop_options['aiosp_home_keywords']); ?></textarea>
1867
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_keywords_tip">
1868
- <?php
1869
- _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');
1870
- ?>
1871
- </div>
1872
- </td>
1873
- </tr>
1874
-
1875
- <tr>
1876
- <th scope="row" style="text-align:right; vertical-align:top;">
1877
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_can_tip');">
1878
- <?php _e('Canonical URLs:', 'all_in_one_seo_pack')?>
1879
- </a>
1880
- </td>
1881
- <td>
1882
- <input type="checkbox" name="aiosp_can" <?php if ($aioseop_options['aiosp_can']) echo "checked=\"1\""; ?>/>
1883
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_can_tip">
1884
- <?php
1885
- _e("This option will automatically generate Canonical URLS for your entire WordPress installation. This will help to prevent duplicate content penalties by <a href='http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html' target='_blank'>Google</a>.", 'all_in_one_seo_pack');
1886
- ?>
1887
- </div>
1888
- </td>
1889
- </tr>
1890
-
1891
- <tr>
1892
- <th scope="row" style="text-align:right; vertical-align:top;">
1893
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_rewrite_titles_tip');">
1894
- <?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
1895
- </a>
1896
- </td>
1897
- <td>
1898
- <input type="checkbox" name="aiosp_rewrite_titles" <?php if ($aioseop_options['aiosp_rewrite_titles']) echo "checked=\"1\""; ?>/>
1899
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_rewrite_titles_tip">
1900
- <?php
1901
- _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');
1902
- ?>
1903
- </div>
1904
- </td>
1905
- </tr>
1906
-
1907
- <tr>
1908
- <th scope="row" style="text-align:right; vertical-align:top;">
1909
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_title_format_tip');">
1910
- <?php _e('Post Title Format:', 'all_in_one_seo_pack')?>
1911
- </a>
1912
- </td>
1913
- <td>
1914
- <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_post_title_format']); ?>"/>
1915
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_title_format_tip">
1916
- <?php
1917
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1918
- echo('<ul>');
1919
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1920
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1921
- echo('<li>'); _e('%post_title% - The original title of the post', 'all_in_one_seo_pack'); echo('</li>');
1922
- echo('<li>'); _e('%category_title% - The (main) category of the post', 'all_in_one_seo_pack'); echo('</li>');
1923
- echo('<li>'); _e('%category% - Alias for %category_title%', 'all_in_one_seo_pack'); echo('</li>');
1924
- echo('<li>'); _e("%post_author_login% - This post's author' login", 'all_in_one_seo_pack'); echo('</li>');
1925
- echo('<li>'); _e("%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1926
- echo('<li>'); _e("%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1927
- echo('<li>'); _e("%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1928
- echo('</ul>');
1929
- ?>
1930
- </div>
1931
- </td>
1932
- </tr>
1933
-
1934
- <tr>
1935
- <th scope="row" style="text-align:right; vertical-align:top;">
1936
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_title_format_tip');">
1937
- <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
1938
- </a>
1939
- </td>
1940
- <td>
1941
- <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_page_title_format']); ?>"/>
1942
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_title_format_tip">
1943
- <?php
1944
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1945
- echo('<ul>');
1946
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1947
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1948
- echo('<li>'); _e('%page_title% - The original title of the page', 'all_in_one_seo_pack'); echo('</li>');
1949
- echo('<li>'); _e("%page_author_login% - This page's author' login", 'all_in_one_seo_pack'); echo('</li>');
1950
- echo('<li>'); _e("%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1951
- echo('<li>'); _e("%page_author_firstname% - This page's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1952
- echo('<li>'); _e("%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1953
- echo('</ul>');
1954
- ?>
1955
- </div>
1956
- </td>
1957
- </tr>
1958
-
1959
- <tr>
1960
- <th scope="row" style="text-align:right; vertical-align:top;">
1961
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_title_format_tip');">
1962
- <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
1963
- </a>
1964
- </td>
1965
- <td>
1966
- <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_category_title_format']); ?>"/>
1967
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_title_format_tip">
1968
- <?php
1969
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1970
- echo('<ul>');
1971
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1972
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1973
- echo('<li>'); _e('%category_title% - The original title of the category', 'all_in_one_seo_pack'); echo('</li>');
1974
- echo('<li>'); _e('%category_description% - The description of the category', 'all_in_one_seo_pack'); echo('</li>');
1975
- echo('</ul>');
1976
- ?>
1977
- </div>
1978
- </td>
1979
- </tr>
1980
-
1981
- <tr>
1982
- <th scope="row" style="text-align:right; vertical-align:top;">
1983
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_title_format_tip');">
1984
- <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
1985
- </a>
1986
- </td>
1987
- <td>
1988
- <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_archive_title_format']); ?>"/>
1989
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_title_format_tip">
1990
- <?php
1991
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1992
- echo('<ul>');
1993
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1994
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1995
- echo('<li>'); _e('%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack'); echo('</li>');
1996
- echo('</ul>');
1997
- ?>
1998
- </div>
1999
- </td>
2000
- </tr>
2001
-
2002
- <tr>
2003
- <th scope="row" style="text-align:right; vertical-align:top;">
2004
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tag_title_format_tip');">
2005
- <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
2006
- </a>
2007
- </td>
2008
- <td>
2009
- <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_tag_title_format']); ?>"/>
2010
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_tag_title_format_tip">
2011
- <?php
2012
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2013
- echo('<ul>');
2014
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2015
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2016
- echo('<li>'); _e('%tag% - The name of the tag', 'all_in_one_seo_pack'); echo('</li>');
2017
- echo('</ul>');
2018
- ?>
2019
- </div>
2020
- </td>
2021
- </tr>
2022
-
2023
- <tr>
2024
- <th scope="row" style="text-align:right; vertical-align:top;">
2025
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_search_title_format_tip');">
2026
- <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
2027
- </a>
2028
- </td>
2029
- <td>
2030
- <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_search_title_format']); ?>"/>
2031
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_search_title_format_tip">
2032
- <?php
2033
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2034
- echo('<ul>');
2035
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2036
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2037
- echo('<li>'); _e('%search% - What was searched for', 'all_in_one_seo_pack'); echo('</li>');
2038
- echo('</ul>');
2039
- ?>
2040
- </div>
2041
- </td>
2042
- </tr>
2043
-
2044
- <tr>
2045
- <th scope="row" style="text-align:right; vertical-align:top;">
2046
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_description_format_tip');">
2047
- <?php _e('Description Format:', 'all_in_one_seo_pack')?>
2048
- </a>
2049
- </td>
2050
- <td>
2051
- <input size="59" name="aiosp_description_format" value="<?php echo stripcslashes($aioseop_options['aiosp_description_format']); ?>"/>
2052
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_description_format_tip">
2053
- <?php
2054
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2055
- echo('<ul>');
2056
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2057
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2058
- 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>');
2059
- echo('<li>'); _e('%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack'); echo('</li>');
2060
- echo('</ul>');
2061
- ?>
2062
- </div>
2063
- </td>
2064
- </tr>
2065
-
2066
- <tr>
2067
- <th scope="row" style="text-align:right; vertical-align:top;">
2068
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_404_title_format_tip');">
2069
- <?php _e('404 Title Format:', 'all_in_one_seo_pack')?>
2070
- </a>
2071
- </td>
2072
- <td>
2073
- <input size="59" name="aiosp_404_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_404_title_format']); ?>"/>
2074
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_404_title_format_tip">
2075
- <?php
2076
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2077
- echo('<ul>');
2078
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2079
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2080
- echo('<li>'); _e('%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack'); echo('</li>');
2081
- 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>');
2082
- echo('<li>'); _e('%404_title% - Additional 404 title input"', 'all_in_one_seo_pack'); echo('</li>');
2083
- echo('</ul>');
2084
- ?>
2085
- </div>
2086
- </td>
2087
- </tr>
2088
-
2089
- <tr>
2090
- <th scope="row" style="text-align:right; vertical-align:top;">
2091
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_paged_format_tip');">
2092
- <?php _e('Paged Format:', 'all_in_one_seo_pack')?>
2093
- </a>
2094
- </td>
2095
- <td>
2096
- <input size="59" name="aiosp_paged_format" value="<?php echo stripcslashes($aioseop_options['aiosp_paged_format']); ?>"/>
2097
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_paged_format_tip">
2098
- <?php
2099
- _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');
2100
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2101
- echo('<ul>');
2102
- echo('<li>'); _e('%page% - The page number', 'all_in_one_seo_pack'); echo('</li>');
2103
- echo('</ul>');
2104
- ?>
2105
- </div>
2106
- </td>
2107
- </tr>
2108
-
2109
- <tr>
2110
- <th scope="row" style="text-align:right; vertical-align:top;">
2111
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_enablecpost_tip');">
2112
- <?php _e('SEO for Custom Post Types:', 'all_in_one_seo_pack')?>
2113
- </td>
2114
- <td>
2115
- <input type="checkbox" name="aiosp_enablecpost" <?php if ($aioseop_options['aiosp_enablecpost']) echo "checked=\"1\""; ?>/>
2116
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_enablecpost_tip">
2117
- <?php
2118
- _e('Check this if you want your enable AIOSEOP support for Custom Post Types on this site.', 'all_in_one_seo_pack');
2119
- ?>
2120
- </div>
2121
- </td>
2122
- </tr>
2123
- <tr>
2124
- <th scope="row" style="text-align:right; vertical-align:top;">
2125
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('123_tip');">
2126
- <?php _e('Custom Post Types for SEO Column Support:', 'all_in_one_seo_pack')?>
2127
- </td>
2128
- <td><select name="aiosp_posttypecolumns[]" MULTIPLE style="height:70px;width:300px;">
2129
- <?php
2130
- $typeswehave = array('post,revision'); //$aioseop_options['aiosp_posttypecolumns'];
2131
- $post_types=get_post_types('','names');
2132
- $rempost = array('attachment','revision','nav_menu_item');
2133
- $post_types = array_diff($post_types,$rempost);
2134
- foreach ($post_types as $post_type ) {
2135
- echo "<option ";
2136
- if(is_array($aioseop_options['aiosp_posttypecolumns']) && in_array($post_type,$aioseop_options['aiosp_posttypecolumns'])) echo "selected ";
2137
- echo "name=\"aiosp_posttypecolumns\">$post_type";
2138
- }
2139
-
2140
- ?>
2141
- </select>
2142
-
2143
- <div style="max-width:500px; text-align:left; display:none" id="123_tip">
2144
- <?php
2145
- _e('Choose which post types you want to have SEO columns on the edit.php screen. You can select as many as you like.', 'all_in_one_seo_pack');
2146
- ?>
2147
- </div>
2148
- </td>
2149
- </tr>
2150
- <tr>
2151
- <th scope="row" style="text-align:right; vertical-align:top;">
2152
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_google_analytics_id_tip');">
2153
- <?php _e('Google Analytics ID:', 'all_in_one_seo_pack')?>
2154
- </td>
2155
- <td>
2156
- <input type="text" name="aiosp_google_analytics_id" value="<?php echo $aioseop_options['aiosp_google_analytics_id']; ?>" size="38"/>
2157
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_google_analytics_id_tip">
2158
- <?php
2159
- _e('Enter your Google Analytics ID here to track your site with Google Analytics.', 'all_in_one_seo_pack');
2160
- ?>
2161
- </div>
2162
- </td>
2163
- </tr>
2164
- <?php
2165
- if ( isset( $aioseop_options['aiosp_google_analytics_id'] ) && $aioseop_options['aiosp_google_analytics_id'] ) {
2166
- ?>
2167
- <tr>
2168
- <th scope="row" style="text-align:right; vertical-align:top;">
2169
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ga_track_outbound_links_tip');">
2170
- <?php _e('Track Outbound Links:', 'all_in_one_seo_pack')?>
2171
- </td>
2172
- <td>
2173
- <input type="checkbox" name="aiosp_ga_track_outbound_links" <?php if ($aioseop_options['aiosp_ga_track_outbound_links']) echo "checked=\"1\""; ?>/>
2174
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_ga_track_outbound_links_tip">
2175
- <?php
2176
- _e('Add functionality to track outbound links with Google Analytics.', 'all_in_one_seo_pack');
2177
- ?>
2178
- </div>
2179
- </td>
2180
- </tr>
2181
-
2182
- <?php
2183
- }
2184
- ?>
2185
-
2186
- <tr>
2187
- <th scope="row" style="text-align:right; vertical-align:top;">
2188
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_categories_tip');">
2189
- <?php _e('Use Categories for META keywords:', 'all_in_one_seo_pack')?>
2190
- </td>
2191
- <td>
2192
- <input type="checkbox" name="aiosp_use_categories" <?php if ($aioseop_options['aiosp_use_categories']) echo "checked=\"1\""; ?>/>
2193
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_categories_tip">
2194
- <?php
2195
- _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');
2196
- ?>
2197
- </div>
2198
- </td>
2199
- </tr>
2200
-
2201
- <tr>
2202
- <th scope="row" style="text-align:right; vertical-align:top;">
2203
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_tags_as_keywords_tip');">
2204
- <?php _e('Use Tags for META keywords:', 'all_in_one_seo_pack')?>
2205
- </td>
2206
- <td>
2207
- <input type="checkbox" name="aiosp_use_tags_as_keywords" <?php if ($aioseop_options['aiosp_use_tags_as_keywords']) echo "checked=\"1\""; ?>/>
2208
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_tags_as_keywords_tip">
2209
- <?php
2210
- _e('Check this if you want your tags for a given post used as the META keywords for this post (in addition to any keywords you specify on the post edit page).', 'all_in_one_seo_pack');
2211
- ?>
2212
- </div>
2213
- </td>
2214
- </tr>
2215
-
2216
-
2217
-
2218
-
2219
- <tr>
2220
- <th scope="row" style="text-align:right; vertical-align:top;">
2221
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_dynamic_postspage_keywords_tip');">
2222
- <?php _e('Dynamically Generate Keywords for Posts Page:', 'all_in_one_seo_pack')?>
2223
- </td>
2224
- <td>
2225
- <input type="checkbox" name="aiosp_dynamic_postspage_keywords" <?php if ($aioseop_options['aiosp_dynamic_postspage_keywords']) echo "checked=\"1\""; ?>/>
2226
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_dynamic_postspage_keywords_tip">
2227
- <?php
2228
- _e('Check this if you want your keywords on a custom posts page (set it in options->reading) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all_in_one_seo_pack');
2229
- ?>
2230
- </div>
2231
- </td>
2232
- </tr>
2233
-
2234
- <tr>
2235
- <th scope="row" style="text-align:right; vertical-align:top;">
2236
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_noindex_tip');">
2237
- <?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
2238
- </a>
2239
- </td>
2240
- <td>
2241
- <input type="checkbox" name="aiosp_category_noindex" <?php if ($aioseop_options['aiosp_category_noindex']) echo "checked=\"1\""; ?>/>
2242
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_noindex_tip">
2243
- <?php
2244
- _e('Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2245
- ?>
2246
- </div>
2247
- </td>
2248
- </tr>
2249
-
2250
- <tr>
2251
- <th scope="row" style="text-align:right; vertical-align:top;">
2252
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_noindex_tip');">
2253
- <?php _e('Use noindex for Archives:', 'all_in_one_seo_pack')?>
2254
- </a>
2255
- </td>
2256
- <td>
2257
- <input type="checkbox" name="aiosp_archive_noindex" <?php if ($aioseop_options['aiosp_archive_noindex']) echo "checked=\"1\""; ?>/>
2258
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_noindex_tip">
2259
- <?php
2260
- _e('Check this for excluding archive pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2261
- ?>
2262
- </div>
2263
- </td>
2264
- </tr>
2265
-
2266
- <tr>
2267
- <th scope="row" style="text-align:right; vertical-align:top;">
2268
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tags_noindex_tip');">
2269
- <?php _e('Use noindex for Tag Archives:', 'all_in_one_seo_pack')?>
2270
- </a>
2271
- </td>
2272
- <td>
2273
- <input type="checkbox" name="aiosp_tags_noindex" <?php if ($aioseop_options['aiosp_tags_noindex']) echo "checked=\"1\""; ?>/>
2274
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_tags_noindex_tip">
2275
- <?php
2276
- _e('Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2277
- ?>
2278
- </div>
2279
- </td>
2280
- </tr>
2281
-
2282
- <tr>
2283
- <th scope="row" style="text-align:right; vertical-align:top;">
2284
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_generate_descriptions_tip');">
2285
- <?php _e('Autogenerate Descriptions:', 'all_in_one_seo_pack')?>
2286
- </a>
2287
- </td>
2288
- <td>
2289
- <input type="checkbox" name="aiosp_generate_descriptions" <?php if ($aioseop_options['aiosp_generate_descriptions']) echo "checked=\"1\""; ?>/>
2290
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_generate_descriptions_tip">
2291
- <?php
2292
- _e("Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack');
2293
- ?>
2294
- </div>
2295
- </td>
2296
- </tr>
2297
-
2298
- <tr>
2299
- <th scope="row" style="text-align:right; vertical-align:top;">
2300
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_cap_cats_tip');">
2301
- <?php _e('Capitalize Category Titles:', 'all_in_one_seo_pack')?>
2302
- </a>
2303
- </td>
2304
- <td>
2305
- <input type="checkbox" name="aiosp_cap_cats" <?php if ($aioseop_options['aiosp_cap_cats']) echo "checked=\"1\""; ?>/>
2306
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_cap_cats_tip">
2307
- <?php
2308
- _e("Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack');
2309
- ?>
2310
- </div>
2311
- </td>
2312
- </tr>
2313
-
2314
- <!-- new crap start -->
2315
- <tr>
2316
- <th scope="row" style="text-align:right; vertical-align:top;">
2317
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ex_pages_tip');">
2318
- <?php _e('Exclude Pages:', 'all_in_one_seo_pack')?>
2319
- </a>
2320
- </td>
2321
- <td>
2322
- <textarea cols="57" rows="2" name="aiosp_ex_pages"><?php
2323
- if ( !isset( $aioseop_options['aiosp_ex_pages'] ) ) $aioseop_options['aiosp_ex_pages'] = '';
2324
- echo stripcslashes($aioseop_options['aiosp_ex_pages']); ?></textarea>
2325
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_ex_pages_tip">
2326
- <?php
2327
- _e("Enter any comma separated pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: <em>/forum/,/contact/</em> For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is give forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage will be excluded from All in One SEO Pack.", 'all_in_one_seo_pack');
2328
- ?>
2329
- </div>
2330
- </td>
2331
- </tr>
2332
- <!-- new crap end -->
2333
-
2334
- <tr>
2335
- <th scope="row" style="text-align:right; vertical-align:top;">
2336
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_meta_tags_tip');">
2337
- <?php _e('Additional Post Headers:', 'all_in_one_seo_pack')?>
2338
- </a>
2339
- </td>
2340
- <td>
2341
- <textarea cols="57" rows="2" name="aiosp_post_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_post_meta_tags']); ?></textarea>
2342
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_meta_tags_tip">
2343
- <?php
2344
- _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');
2345
- ?>
2346
- </div>
2347
- </td>
2348
- </tr>
2349
-
2350
- <tr>
2351
- <th scope="row" style="text-align:right; vertical-align:top;">
2352
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_meta_tags_tip');">
2353
- <?php _e('Additional Page Headers:', 'all_in_one_seo_pack')?>
2354
- </a>
2355
- </td>
2356
- <td>
2357
- <textarea cols="57" rows="2" name="aiosp_page_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_page_meta_tags']); ?></textarea>
2358
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_meta_tags_tip">
2359
- <?php
2360
- _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');
2361
- ?>
2362
- </div>
2363
- </td>
2364
- </tr>
2365
-
2366
- <tr>
2367
- <th scope="row" style="text-align:right; vertical-align:top;">
2368
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_meta_tags_tip');">
2369
- <?php _e('Additional Home Headers:', 'all_in_one_seo_pack')?>
2370
- </a>
2371
- </td>
2372
- <td>
2373
- <textarea cols="57" rows="2" name="aiosp_home_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_home_meta_tags']); ?></textarea>
2374
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_meta_tags_tip">
2375
- <?php
2376
- _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');
2377
- ?>
2378
- </div>
2379
- </td>
2380
- </tr>
2381
-
2382
- <tr>
2383
- <th scope="row" style="text-align:right; vertical-align:top;">
2384
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'auto_social')?>" onclick="toggleVisibility('aiosp_do_log_tip');">
2385
- <?php _e('Log important events:', 'all_in_one_seo_pack')?>
2386
- </a>
2387
- </td>
2388
- <td>
2389
- <input type="checkbox" name="aiosp_do_log" <?php if ($aioseop_options['aiosp_do_log']) echo "checked=\"1\""; ?>/>
2390
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_do_log_tip">
2391
- <?php
2392
- _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');
2393
- ?>
2394
- </div>
2395
- </td>
2396
- </tr>
2397
-
2398
- <?php if ($aioseop_options['aiosp_donate']){?>
2399
- <tr>
2400
- <th scope="row" style="text-align:right; vertical-align:top;">
2401
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
2402
- <?php _e('Thank you for your donation:', 'all_in_one_seo_pack')?>
2403
- </a>
2404
- </td>
2405
- <td>
2406
- <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
2407
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
2408
- <?php _e('All donations support continued development of this free software.', 'all_in_one_seo_pack'); ?>
2409
- </div>
2410
- </td>
2411
- </tr>
2412
- <?php } ?>
2413
-
2414
- </table>
2415
- <p class="submit">
2416
- <?php if($aioseop_options) { ?>
2417
-
2418
- <input type="hidden" name="action" value="aiosp_update" />
2419
- <input type="hidden" name="nonce-aioseop" value="<?php echo wp_create_nonce('aioseop-nonce'); ?>" />
2420
- <input type="hidden" name="page_options" value="aiosp_home_description" />
2421
- <input type="submit" class='button-primary' name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
2422
- <input type="submit" class='button-primary' name="Submit_Default" value="<?php _e('Reset Settings to Defaults', 'all_in_one_seo_pack')?> &raquo;" />
2423
- </p>
2424
- <?php } ?>
2425
-
2426
- <p><br />
2427
- <strong><?php _e('Check out these other great plugins!','all_in_one_seo_pack'); ?></strong><br />
2428
- <a href="http://semperfiwebdesign.com/custom-applications/sms-text-message/" title="SMS Text Message WordPress plugin">SMS Text Message</a> - <?php _e('sends SMS updates to your readers','all_in_one_seo_pack'); ?><br />
2429
- <a href="http://semperfiwebdesign.com/custom-applications/wp-security-scan/" title="WordPress Security">WordPress Security Scan</a> - <?php _e('provides vital security for your WordPress site','all_in_one_seo_pack'); ?>
2430
- </p>
2431
- </form>
2432
- </div>
2433
- <?php
2434
-
2435
- } // options_panel
2436
-
2437
- }
1
+ <?php
2
+
3
+ class All_in_One_SEO_Pack {
4
+
5
+ var $version = "1.6.14.3";
6
+
7
+ /** Max numbers of chars in auto-generated description */
8
+ var $maximum_description_length = 160;
9
+
10
+ /** Minimum number of chars an excerpt should be so that it can be used
11
+ * as description. Touch only if you know what you're doing
12
+ */
13
+ var $minimum_description_length = 1;
14
+
15
+ var $ob_start_detected = false;
16
+
17
+ var $title_start = -1;
18
+
19
+ var $title_end = -1;
20
+
21
+ /** The title before rewriting */
22
+ var $orig_title = '';
23
+
24
+ /** Temp filename for the latest version. */
25
+ // var $upgrade_filename = 'temp.zip';
26
+
27
+ /** Where to extract the downloaded newest version. */
28
+ // var $upgrade_folder;
29
+
30
+ /** Any error in upgrading. */
31
+ // var $upgrade_error;
32
+
33
+ /** Which zip to download in order to upgrade .*/
34
+ // var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
35
+
36
+ /** Filename of log file. */
37
+ var $log_file;
38
+
39
+ /** Flag whether there should be logging. */
40
+ var $do_log;
41
+
42
+ var $wp_version;
43
+
44
+ var $aioseop_op;
45
+ //var $aioseop_options = get_option('aioseop_options');
46
+
47
+ function All_in_One_SEO_Pack() {
48
+ global $wp_version;
49
+ global $aioseop_options;
50
+ $this->wp_version = $wp_version;
51
+
52
+ $this->log_file = dirname(__FILE__) . '/all_in_one_seo_pack.log';
53
+ if ($aioseop_options['aiosp_do_log']) {
54
+ $this->do_log = true;
55
+ } else {
56
+ $this->do_log = false;
57
+ }
58
+
59
+ // $this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
60
+ // $this->upgrade_folder = dirname(__FILE__);
61
+ }
62
+
63
+
64
+ /*** Case conversion; handle non UTF-8 encodings and fallback ***/
65
+
66
+ function convert_case( $str, $mode = 'upper' ) {
67
+ static $charset = null;
68
+ if ($charset == null) $charset = get_bloginfo( 'charset' );
69
+ if ( $charset == 'UTF-8' ) {
70
+ global $UTF8_TABLES;
71
+ include_once( 'aioseop_utility.php' );
72
+ }
73
+ if ( $charset == 'UTF-8' && is_array($UTF8_TABLES) ) {
74
+ if ( $mode == 'upper' ) return strtr( $str, $UTF8_TABLES['strtoupper'] );
75
+ if ( $mode == 'lower' ) return strtr( $str, $UTF8_TABLES['strtolower'] );
76
+ return $str;
77
+ } else {
78
+ if ( $mode == 'upper' && function_exists( 'mb_strtoupper' ) ) {
79
+ return mb_strtoupper( $str, $charset );
80
+ } elseif ( $mode == 'lower' && function_exists( 'mb_strtolower' ) ) {
81
+ return mb_strtolower( $str, $charset );
82
+ } else {
83
+ if ( $mode == 'upper' ) return strtoupper( $str );
84
+ if ( $mode == 'lower' ) return strtolower( $str );
85
+ return $str;
86
+ }
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Convert a string to lower case
92
+ * Compatible with mb_strtolower(), an UTF-8 friendly replacement for strtolower()
93
+ */
94
+
95
+ function strtolower( $str ) {
96
+ return $this->convert_case( $str, 'lower' );
97
+ }
98
+
99
+ /**
100
+ * Convert a string to upper case
101
+ * Compatible with mb_strtoupper(), an UTF-8 friendly replacement for strtoupper()
102
+ */
103
+ function strtoupper( $str ) {
104
+ return $this->convert_case( $str, 'upper' );
105
+ }
106
+
107
+ function template_redirect() {
108
+ global $wp_query;
109
+ global $aioseop_options;
110
+
111
+ $post = $wp_query->get_queried_object();
112
+
113
+ if( $this->aioseop_mrt_exclude_this_page()){
114
+ return;
115
+ }
116
+
117
+ if (is_feed()) {
118
+ return;
119
+ }
120
+
121
+ if (is_single() || is_page()) {
122
+ $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
123
+ if ($aiosp_disable) {
124
+ return;
125
+ }
126
+ }
127
+
128
+
129
+
130
+ if ($aioseop_options['aiosp_rewrite_titles']) {
131
+ ob_start(array($this, 'output_callback_for_title'));
132
+ }
133
+ }
134
+
135
+ function aioseop_mrt_exclude_this_page(){
136
+ global $aioseop_options;
137
+ $currenturl = trim($_SERVER['REQUEST_URI'],'/');
138
+ /* echo "<br /><br />";
139
+ echo $aioseop_options['aiosp_ex_pages'];
140
+ echo "<br /><br />";
141
+ */
142
+ if ( !isset( $aioseop_options['aiosp_ex_pages'] ) ) $aioseop_options['aiosp_ex_pages'] = '';
143
+ $excludedstuff = explode(',',$aioseop_options['aiosp_ex_pages']);
144
+ foreach($excludedstuff as $exedd){
145
+ //echo $exedd;
146
+ $exedd = trim($exedd);
147
+ if($exedd){
148
+ if(stristr($currenturl, $exedd)){
149
+ return true;
150
+ }
151
+ }
152
+ }
153
+ return false;
154
+ }
155
+
156
+ function output_callback_for_title($content) {
157
+ return $this->rewrite_title($content);
158
+ }
159
+
160
+
161
+
162
+
163
+
164
+
165
+ //
166
+ //CHECK IF ARRAY EXISTS IN DB, IF SO, GET ARRAY, ADD EVERYTHING, CHECK FOR ISSET?
167
+ //
168
+ function init() {
169
+ if ( !defined('WP_PLUGIN_DIR') ) {
170
+ load_plugin_textdomain('all_in_one_seo_pack', str_replace( ABSPATH, '', dirname(__FILE__)));
171
+ } else {
172
+ load_plugin_textdomain('all_in_one_seo_pack', false, dirname(plugin_basename(__FILE__)));
173
+ }
174
+
175
+ /*
176
+ if (function_exists('load_plugin_textdomain')) {
177
+ load_plugin_textdomain('all_in_one_seo_pack', WP_PLUGIN_DIR . '/all-in-one-seo-pack');
178
+ }
179
+ */
180
+
181
+ }
182
+
183
+ function is_static_front_page() {
184
+ global $wp_query;
185
+ global $aioseop_options;
186
+ $post = $wp_query->get_queried_object();
187
+ return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
188
+ }
189
+
190
+ function is_static_posts_page() {
191
+ global $wp_query;
192
+ $post = $wp_query->get_queried_object();
193
+ return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
194
+ }
195
+
196
+ function get_base() {
197
+ return '/'.end(explode('/', str_replace(array('\\','/all_in_one_seo_pack.php'),array('/',''),__FILE__)));
198
+ }
199
+
200
+ function seo_mrt_admin_head() {
201
+ $home = get_settings('siteurl');
202
+ $stylesheet = AIOSEOP_PLUGIN_URL . 'style.css';
203
+ echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
204
+ }
205
+
206
+
207
+ function wp_head() {
208
+ if (is_feed()) {
209
+ return;
210
+ }
211
+
212
+ global $wp_query;
213
+ global $aioseop_options;
214
+ $post = $wp_query->get_queried_object();
215
+ $meta_string = null;
216
+ if($this->is_static_posts_page()){
217
+ $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
218
+
219
+ }
220
+ //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());
221
+
222
+ if (is_single() || is_page()) {
223
+ $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
224
+ if ($aiosp_disable) {
225
+ return;
226
+ }
227
+ }
228
+
229
+ if( $this->aioseop_mrt_exclude_this_page()==TRUE ){
230
+ return;
231
+ }
232
+
233
+ if ($aioseop_options['aiosp_rewrite_titles']) {
234
+ // make the title rewrite as short as possible
235
+ if (function_exists('ob_list_handlers')) {
236
+ $active_handlers = ob_list_handlers();
237
+ } else {
238
+ $active_handlers = array();
239
+ }
240
+ if (sizeof($active_handlers) > 0 &&
241
+ strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
242
+ strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
243
+ ob_end_flush();
244
+ } else {
245
+ $this->log("another plugin interfering?");
246
+ // if we get here there *could* be trouble with another plugin :(
247
+ $this->ob_start_detected = true;
248
+ if (function_exists('ob_list_handlers')) {
249
+ foreach (ob_list_handlers() as $handler) {
250
+ $this->log("detected output handler $handler");
251
+ }
252
+ }
253
+ }
254
+ }
255
+
256
+ echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
257
+ if ($this->ob_start_detected) {
258
+ echo "ob_start_detected ";
259
+ }
260
+ echo "[$this->title_start,$this->title_end] ";
261
+ echo "-->\n";
262
+ if ((is_home() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page()) || $this->is_static_front_page()) {
263
+ $keywords = trim($this->internationalize($aioseop_options['aiosp_home_keywords']));
264
+ } elseif($this->is_static_posts_page() && !$aioseop_options['aiosp_dynamic_postspage_keywords']){ // and if option = use page set keywords instead of keywords from recent posts
265
+ //$keywords = "posts keyyysss" . stripcslashes(get_post_meta($post->ID,'keywords',true));
266
+ $keywords = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
267
+
268
+ // $keywords = $this->get_unique_keywords($keywords);
269
+
270
+ } else {
271
+ $keywords = $this->get_all_keywords();
272
+ }
273
+ if (is_single() || is_page() || $this->is_static_posts_page()) {
274
+ if ($this->is_static_front_page()) {
275
+ $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
276
+ } else {
277
+ $description = $this->get_post_description($post);
278
+ $description = apply_filters('aioseop_description',$description);
279
+ }
280
+ } else if (is_home()) {
281
+ $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
282
+ } else if (is_category()) {
283
+ $description = $this->internationalize(category_description());
284
+ }
285
+
286
+ if (isset($description) && (strlen($description) > $this->minimum_description_length) && !(is_home() && is_paged())) {
287
+ $description = trim(strip_tags($description));
288
+ $description = str_replace('"', '', $description);
289
+
290
+ // replace newlines on mac / windows?
291
+ $description = str_replace("\r\n", ' ', $description);
292
+
293
+ // maybe linux uses this alone
294
+ $description = str_replace("\n", ' ', $description);
295
+
296
+ if (isset($meta_string)) {
297
+ //$meta_string .= "\n";
298
+ } else {
299
+ $meta_string = '';
300
+ }
301
+
302
+ // description format
303
+ $description_format = $aioseop_options['aiosp_description_format'];
304
+ if (!isset($description_format) || empty($description_format)) {
305
+ $description_format = "%description%";
306
+ }
307
+ $description = str_replace('%description%', apply_filters('aioseop_description_override', $description), $description_format);
308
+ $description = str_replace('%blog_title%', get_bloginfo('name'), $description);
309
+ $description = str_replace('%blog_description%', get_bloginfo('description'), $description);
310
+ $description = str_replace('%wp_title%', $this->get_original_title(), $description);
311
+ //$description = html_entity_decode($description, ENT_COMPAT, get_bloginfo('charset'));
312
+ if($aioseop_options['aiosp_can'] && is_attachment()){
313
+ $url = $this->aiosp_mrt_get_url($wp_query);
314
+ if ($url) {
315
+ preg_match_all('/(\d+)/', $url, $matches);
316
+ if (is_array($matches)){
317
+ $uniqueDesc = join('',$matches[0]);
318
+ }
319
+ }
320
+ $description .= ' ' . $uniqueDesc;
321
+ }
322
+ $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
323
+ }
324
+ $keywords = apply_filters('aioseop_keywords',$keywords);
325
+ if (isset ($keywords) && !empty($keywords) && !(is_home() && is_paged())) {
326
+ if (isset($meta_string)) {
327
+ $meta_string .= "\n";
328
+ }
329
+ $keywords = str_replace('"','',$keywords);
330
+ $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\" />", $keywords);
331
+ }
332
+
333
+ $is_tag = is_tag();
334
+
335
+ if ((is_category() && $aioseop_options['aiosp_category_noindex']) || (!is_category() && is_archive() &&!$is_tag && $aioseop_options['aiosp_archive_noindex']) || ($aioseop_options['aiosp_tags_noindex'] && $is_tag)) {
336
+ if (isset($meta_string)) {
337
+ $meta_string .= "\n";
338
+ }
339
+ $meta_string .= '<meta name="robots" content="noindex,follow" />';
340
+ }
341
+
342
+ $page_meta = stripcslashes($aioseop_options['aiosp_page_meta_tags']);
343
+ $post_meta = stripcslashes($aioseop_options['aiosp_post_meta_tags']);
344
+ $home_meta = stripcslashes($aioseop_options['aiosp_home_meta_tags']);
345
+ if (is_page() && isset($page_meta) && !empty($page_meta) || $this->is_static_posts_page()) {
346
+ if (isset($meta_string)) {
347
+ $meta_string .= "\n";
348
+ }
349
+ echo "\n$page_meta";
350
+ }
351
+
352
+ if (is_single() && isset($post_meta) && !empty($post_meta)) {
353
+ if (isset($meta_string)) {
354
+ $meta_string .= "\n";
355
+ }
356
+ $meta_string .= "$post_meta";
357
+ }
358
+
359
+ if (is_home() && !empty($home_meta)) {
360
+ if (isset($meta_string)) {
361
+ $meta_string .= "\n";
362
+ }
363
+ $meta_string .= "$home_meta";
364
+ }
365
+
366
+ if ($meta_string != null) {
367
+ echo "$meta_string\n";
368
+ }
369
+
370
+ if($aioseop_options['aiosp_can']){
371
+ $url = $this->aiosp_mrt_get_url($wp_query);
372
+ if ($url) {
373
+ $url = apply_filters('aioseop_canonical_url',$url);
374
+
375
+ echo "".'<link rel="canonical" href="'.$url.'" />'."\n";
376
+ }
377
+
378
+
379
+
380
+ }
381
+
382
+ echo "<!-- /all in one seo pack -->\n";
383
+ }
384
+
385
+ function aiosp_google_analytics(){
386
+ global $aioseop_options;
387
+
388
+ ?>
389
+ <script type="text/javascript">
390
+
391
+ var _gaq = _gaq || [];
392
+ _gaq.push(['_setAccount', '<?php echo $aioseop_options['aiosp_google_analytics_id']; ?>']);
393
+ _gaq.push(['_trackPageview']);
394
+
395
+ (function() {
396
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
397
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
398
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
399
+ })();
400
+
401
+ </script>
402
+ <?php
403
+ if ($aioseop_options['aiosp_ga_track_outbound_links']) {
404
+ ?>
405
+ <script type="text/javascript">
406
+ function recordOutboundLink(link, category, action) {
407
+ _gat._getTrackerByName()._trackEvent(category, action);
408
+ setTimeout('document.location = "' + link.href + '"', 100);
409
+ }
410
+ /* use regular Javascript for this */
411
+ function getAttr(ele, attr) {
412
+ var result = (ele.getAttribute && ele.getAttribute(attr)) || null;
413
+ if( !result ) {
414
+ var attrs = ele.attributes;
415
+ var length = attrs.length;
416
+ for(var i = 0; i < length; i++)
417
+ if(attr[i].nodeName === attr) result = attr[i].nodeValue;
418
+ }
419
+ return result;
420
+ }
421
+
422
+ window.onload = function () {
423
+ var links = document.getElementsByTagName('a');
424
+ for (var x=0; x < links.length; x++) {
425
+ links[x].onclick = function () {
426
+ var mydomain = new RegExp(document.domain, 'i');
427
+ href = getAttr(this, 'href');
428
+ if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
429
+ recordOutboundLink(this, 'Outbound Links', href);
430
+ }
431
+ };
432
+ }
433
+ };
434
+ </script>
435
+
436
+ <?php
437
+
438
+ }}
439
+
440
+ // Thank you, Yoast de Valk, for much of this code.
441
+
442
+ function aiosp_mrt_get_url($query) {
443
+ global $aioseop_options;
444
+ if ($query->is_404 || $query->is_search) {
445
+ return false;
446
+ }
447
+ $haspost = count($query->posts) > 0;
448
+ $has_ut = function_exists('user_trailingslashit');
449
+
450
+ if (get_query_var('m')) {
451
+ $m = preg_replace('/[^0-9]/', '', get_query_var('m'));
452
+ switch (strlen($m)) {
453
+ case 4:
454
+ $link = get_year_link($m);
455
+ break;
456
+ case 6:
457
+ $link = get_month_link(substr($m, 0, 4), substr($m, 4, 2));
458
+ break;
459
+ case 8:
460
+ $link = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2));
461
+ break;
462
+ default:
463
+ return false;
464
+ }
465
+ } elseif (($query->is_single || $query->is_page) && $haspost) {
466
+ $post = $query->posts[0];
467
+ $link = get_permalink($post->ID);
468
+ $link = $this->yoast_get_paged($link);
469
+ } elseif (($query->is_single || $query->is_page) && $haspost) {
470
+ $post = $query->posts[0];
471
+ $link = get_permalink($post->ID);
472
+ $link = $this->yoast_get_paged($link);
473
+ } elseif ($query->is_author && $haspost) {
474
+ global $wp_version;
475
+ if ($wp_version >= '2') {
476
+ $author = get_userdata(get_query_var('author'));
477
+ if ($author === false)
478
+ return false;
479
+ $link = get_author_link(false, $author->ID, $author->user_nicename);
480
+ } else {
481
+ global $cache_userdata;
482
+ $userid = get_query_var('author');
483
+ $link = get_author_link(false, $userid, $cache_userdata[$userid]->user_nicename);
484
+ }
485
+ } elseif ($query->is_category && $haspost) {
486
+ $link = get_category_link(get_query_var('cat'));
487
+ $link = $this->yoast_get_paged($link);
488
+ } else if ($query->is_tag && $haspost) {
489
+ $tag = get_term_by('slug',get_query_var('tag'),'post_tag');
490
+ if (!empty($tag->term_id)) {
491
+ $link = get_tag_link($tag->term_id);
492
+ }
493
+ $link = $this->yoast_get_paged($link);
494
+ } elseif ($query->is_day && $haspost) {
495
+ $link = get_day_link(get_query_var('year'),
496
+ get_query_var('monthnum'),
497
+ get_query_var('day'));
498
+ } elseif ($query->is_month && $haspost) {
499
+ $link = get_month_link(get_query_var('year'),
500
+ get_query_var('monthnum'));
501
+ } elseif ($query->is_year && $haspost) {
502
+ $link = get_year_link(get_query_var('year'));
503
+ } elseif ($query->is_home) {
504
+ if ((get_option('show_on_front') == 'page') &&
505
+ ($pageid = get_option('page_for_posts'))) {
506
+ $link = get_permalink($pageid);
507
+ $link = $this->yoast_get_paged($link);
508
+ $link = trailingslashit($link);
509
+ } else {
510
+ if ( function_exists( 'icl_get_home_url' ) ) {
511
+ $link = icl_get_home_url();
512
+ } else {
513
+ $link = get_option( 'home' );
514
+ }
515
+ $link = $this->yoast_get_paged($link);
516
+ $link = trailingslashit($link);
517
+ }
518
+ } elseif ($query->is_tax && $haspost ) {
519
+ $taxonomy = get_query_var( 'taxonomy' );
520
+ $term = get_query_var( 'term' );
521
+ $link = get_term_link( $term, $taxonomy );
522
+ $link = $this->yoast_get_paged( $link );
523
+ } else {
524
+ return false;
525
+ }
526
+
527
+ return $link;
528
+
529
+ }
530
+
531
+
532
+ function yoast_get_paged($link) {
533
+ $page = get_query_var('paged');
534
+ if ($page && $page > 1) {
535
+ $link = trailingslashit($link) ."page/". "$page";
536
+ if ($has_ut) {
537
+ $link = user_trailingslashit($link, 'paged');
538
+ } else {
539
+ $link .= '/';
540
+ }
541
+ }
542
+ return $link;
543
+ }
544
+
545
+
546
+ function get_post_description($post) {
547
+ global $aioseop_options;
548
+ $description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_description", true))));
549
+ if (!$description) {
550
+ $description = $this->trim_excerpt_without_filters_full_length($this->internationalize($post->post_excerpt));
551
+ if (!$description && $aioseop_options["aiosp_generate_descriptions"]) {
552
+ $description = $this->trim_excerpt_without_filters($this->internationalize($post->post_content));
553
+ }
554
+ }
555
+
556
+ // "internal whitespace trim"
557
+ $description = preg_replace("/\s\s+/u", " ", $description);
558
+
559
+ return $description;
560
+ }
561
+
562
+ function replace_title($content, $title) {
563
+ $title = trim(strip_tags($title));
564
+
565
+ $title_tag_start = "<title>";
566
+ $title_tag_end = "</title>";
567
+ $len_start = strlen($title_tag_start);
568
+ $len_end = strlen($title_tag_end);
569
+ $title = stripcslashes(trim($title));
570
+ $start = strpos($content, $title_tag_start);
571
+ $end = strpos($content, $title_tag_end);
572
+
573
+ $this->title_start = $start;
574
+ $this->title_end = $end;
575
+ $this->orig_title = $title;
576
+
577
+ if ($start && $end) {
578
+ $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
579
+ } else {
580
+ // this breaks some sitemap plugins (like wpg2)
581
+ //$header = $content . "<title>$title</title>";
582
+
583
+ $header = $content;
584
+ }
585
+
586
+ return $header;
587
+ }
588
+
589
+ function internationalize($in) {
590
+ if (function_exists('langswitch_filter_langs_with_message')) {
591
+ $in = langswitch_filter_langs_with_message($in);
592
+ }
593
+ if (function_exists('polyglot_filter')) {
594
+ $in = polyglot_filter($in);
595
+ }
596
+ if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
597
+ $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
598
+ }
599
+ $in = apply_filters('localization', $in);
600
+ return $in;
601
+ }
602
+
603
+ /** @return The original title as delivered by WP (well, in most cases) */
604
+ function get_original_title() {
605
+ global $wp_query;
606
+ global $aioseop_options;
607
+ if (!$wp_query) {
608
+ return null;
609
+ }
610
+
611
+ $post = $wp_query->get_queried_object();
612
+
613
+ // the_search_query() is not suitable, it cannot just return
614
+ global $s;
615
+
616
+ $title = null;
617
+
618
+ if (is_home()) {
619
+ $title = get_option('blogname');
620
+ } else if (is_single()) {
621
+ $title = $this->internationalize(wp_title('', false));
622
+ } else if (is_search() && isset($s) && !empty($s)) {
623
+ $search = esc_attr(stripcslashes($s));
624
+ $search = $this->capitalize($search);
625
+ $title = $search;
626
+ } else if (is_category() && !is_feed()) {
627
+ $category_description = $this->internationalize(category_description());
628
+ $category_name = ucwords($this->internationalize(single_cat_title('', false)));
629
+ $title = $category_name;
630
+ } else if (is_page()) {
631
+ $title = $this->internationalize(wp_title('', false));
632
+ } else if (is_tag()) {
633
+ global $utw;
634
+ if ($utw) {
635
+ $tags = $utw->GetCurrentTagSet();
636
+ $tag = $tags[0]->tag;
637
+ $tag = str_replace('-', ' ', $tag);
638
+ } else {
639
+ // wordpress > 2.3
640
+ $tag = $this->internationalize(wp_title('', false));
641
+ }
642
+ if ($tag) {
643
+ $title = $tag;
644
+ }
645
+ } else if (is_archive()) {
646
+ $title = $this->internationalize(wp_title('', false));
647
+ } else if (is_404()) {
648
+ $title_format = $aioseop_options['aiosp_404_title_format'];
649
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
650
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
651
+ $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
652
+ $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
653
+ $title = $new_title;
654
+ }
655
+
656
+ return trim($title);
657
+ }
658
+
659
+ function paged_title($title) {
660
+ // the page number if paged
661
+ global $paged;
662
+ global $aioseop_options;
663
+ // simple tagging support
664
+ global $STagging;
665
+
666
+ if (is_paged() || (isset($STagging) && $STagging->is_tag_view() && $paged)) {
667
+ $part = $this->internationalize($aioseop_options['aiosp_paged_format']);
668
+ if (isset($part) || !empty($part)) {
669
+ $part = " " . trim($part);
670
+ $part = str_replace('%page%', $paged, $part);
671
+ $this->log("paged_title() [$title] [$part]");
672
+ $title .= $part;
673
+ }
674
+ }
675
+ return $title;
676
+ }
677
+
678
+ function rewrite_title($header) {
679
+ global $aioseop_options;
680
+ global $wp_query;
681
+ if (!$wp_query) {
682
+ $header .= "<!-- no wp_query found! -->\n";
683
+ return $header;
684
+ }
685
+
686
+ $post = $wp_query->get_queried_object();
687
+
688
+ // the_search_query() is not suitable, it cannot just return
689
+ global $s;
690
+
691
+ global $STagging;
692
+
693
+ if (is_home() && !$this->is_static_posts_page()) {
694
+ $title = $this->internationalize($aioseop_options['aiosp_home_title']);
695
+ if (empty($title)) {
696
+ $title = $this->internationalize(get_option('blogname'));
697
+ }
698
+ $title = $this->paged_title($title);
699
+ $header = $this->replace_title($header, $title);
700
+ } else if (is_attachment()) {
701
+ $title = get_the_title($post->post_parent).' '.$post->post_title.' – '.get_option('blogname');
702
+ $header = $this->replace_title($header,$title);
703
+ } else if (is_single()) {
704
+ // we're not in the loop :(
705
+ $authordata = get_userdata($post->post_author);
706
+ $categories = get_the_category();
707
+ $category = '';
708
+ if (count($categories) > 0) {
709
+ $category = $categories[0]->cat_name;
710
+ }
711
+ $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
712
+ if (!$title) {
713
+ $title = $this->internationalize(get_post_meta($post->ID, "title_tag", true));
714
+ if (!$title) {
715
+ $title = $this->internationalize(wp_title('', false));
716
+ }
717
+ }
718
+ $title_format = $aioseop_options['aiosp_post_title_format'];
719
+ /*
720
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
721
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
722
+ $new_title = str_replace('%post_title%', $title, $new_title);
723
+ $new_title = str_replace('%category%', $category, $new_title);
724
+ $new_title = str_replace('%category_title%', $category, $new_title);
725
+ $new_title = str_replace('%post_author_login%', $authordata->user_login, $new_title);
726
+ $new_title = str_replace('%post_author_nicename%', $authordata->user_nicename, $new_title);
727
+ $new_title = str_replace('%post_author_firstname%', ucwords($authordata->first_name), $new_title);
728
+ $new_title = str_replace('%post_author_lastname%', ucwords($authordata->last_name), $new_title);
729
+ */
730
+ $r_title = array('%blog_title%','%blog_description%','%post_title%','%category%','%category_title%','%post_author_login%','%post_author_nicename%','%post_author_firstname%','%post_author_lastname%');
731
+ $d_title = array($this->internationalize(get_bloginfo('name')),$this->internationalize(get_bloginfo('description')),$title, $category, $category, $authordata->user_login, $authordata->user_nicename, ucwords($authordata->first_name), ucwords($authordata->last_name));
732
+ $title = trim(str_replace($r_title, $d_title, $title_format));
733
+
734
+ // $title = $new_title;
735
+ // $title = trim($title);
736
+ $title = apply_filters('aioseop_title_single',$title);
737
+ $header = $this->replace_title($header, $title);
738
+ } else if (is_search() && isset($s) && !empty($s)) {
739
+ $search = esc_attr(stripcslashes($s));
740
+ $search = $this->capitalize($search);
741
+ $title_format = $aioseop_options['aiosp_search_title_format'];
742
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
743
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
744
+ $title = str_replace('%search%', $search, $title);
745
+ $header = $this->replace_title($header, $title);
746
+ } else if (is_category() && !is_feed()) {
747
+ $category_description = $this->internationalize(category_description());
748
+ if($aioseop_options['aiosp_cap_cats']){
749
+ $category_name = ucwords($this->internationalize(single_cat_title('', false)));
750
+ }else{
751
+ $category_name = $this->internationalize(single_cat_title('', false));
752
+ }
753
+ //$category_name = ucwords($this->internationalize(single_cat_title('', false)));
754
+ $title_format = $aioseop_options['aiosp_category_title_format'];
755
+ $title = str_replace('%category_title%', $category_name, $title_format);
756
+ $title = str_replace('%category_description%', $category_description, $title);
757
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title);
758
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
759
+ $title = $this->paged_title($title);
760
+ $header = $this->replace_title($header, $title);
761
+ } else if (is_page() || $this->is_static_posts_page()) {
762
+ // we're not in the loop :(
763
+ $authordata = get_userdata($post->post_author);
764
+ if ($this->is_static_front_page()) {
765
+ if ($this->internationalize($aioseop_options['aiosp_home_title'])) {
766
+
767
+ //home title filter
768
+ $home_title = $this->internationalize($aioseop_options['aiosp_home_title']);
769
+ $home_title = apply_filters('aioseop_home_page_title',$home_title);
770
+ $header = $this->replace_title($header, $home_title);
771
+
772
+ }
773
+ } else {
774
+ $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
775
+ if (!$title) {
776
+ $title = $this->internationalize(wp_title('', false));
777
+ }
778
+ $title_format = $aioseop_options['aiosp_page_title_format'];
779
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
780
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
781
+ $new_title = str_replace('%page_title%', $title, $new_title);
782
+ $new_title = str_replace('%page_author_login%', $authordata->user_login, $new_title);
783
+ $new_title = str_replace('%page_author_nicename%', $authordata->user_nicename, $new_title);
784
+ $new_title = str_replace('%page_author_firstname%', ucwords($authordata->first_name), $new_title);
785
+ $new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
786
+ $title = trim($new_title);
787
+ $title = $this->paged_title($title);
788
+ $title = apply_filters('aioseop_title_page',$title);
789
+ $header = $this->replace_title($header, $title);
790
+ }
791
+ } else if (is_tag()) {
792
+ global $utw;
793
+ if ($utw) {
794
+ $tags = $utw->GetCurrentTagSet();
795
+ $tag = $tags[0]->tag;
796
+ $tag = str_replace('-', ' ', $tag);
797
+ } else {
798
+ // wordpress > 2.3
799
+ $tag = $this->internationalize(wp_title('', false));
800
+ }
801
+ if ($tag) {
802
+ $tag = $this->capitalize($tag);
803
+ $title_format = $aioseop_options['aiosp_tag_title_format'];
804
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
805
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
806
+ $title = str_replace('%tag%', $tag, $title);
807
+ $title = $this->paged_title($title);
808
+ $header = $this->replace_title($header, $title);
809
+ }
810
+ } else if (isset($STagging) && $STagging->is_tag_view()) { // simple tagging support
811
+ $tag = $STagging->search_tag;
812
+ if ($tag) {
813
+ $tag = $this->capitalize($tag);
814
+ $title_format = $aioseop_options['aiosp_tag_title_format'];
815
+ $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
816
+ $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
817
+ $title = str_replace('%tag%', $tag, $title);
818
+ $title = $this->paged_title($title);
819
+ $header = $this->replace_title($header, $title);
820
+ }
821
+ } else if (is_archive()) {
822
+ $date = $this->internationalize(wp_title('', false));
823
+ $title_format = $aioseop_options['aiosp_archive_title_format'];
824
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
825
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
826
+ $new_title = str_replace('%date%', $date, $new_title);
827
+ $title = trim($new_title);
828
+ $title = $this->paged_title($title);
829
+ $header = $this->replace_title($header, $title);
830
+ } else if (is_404()) {
831
+ $title_format = $aioseop_options['aiosp_404_title_format'];
832
+ $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
833
+ $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
834
+ $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
835
+ $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
836
+ $new_title = str_replace('%404_title%', $this->internationalize(wp_title('', false)), $new_title);
837
+ $header = $this->replace_title($header, $new_title);
838
+ }
839
+
840
+ return $header;
841
+
842
+ }
843
+
844
+ /**
845
+ * @return User-readable nice words for a given request.
846
+ */
847
+ function request_as_words($request) {
848
+ $request = htmlspecialchars($request);
849
+ $request = str_replace('.html', ' ', $request);
850
+ $request = str_replace('.htm', ' ', $request);
851
+ $request = str_replace('.', ' ', $request);
852
+ $request = str_replace('/', ' ', $request);
853
+ $request_a = explode(' ', $request);
854
+ $request_new = array();
855
+ foreach ($request_a as $token) {
856
+ $request_new[] = ucwords(trim($token));
857
+ }
858
+ $request = implode(' ', $request_new);
859
+ return $request;
860
+ }
861
+
862
+ function capitalize($s) {
863
+ $s = trim($s);
864
+ $tokens = explode(' ', $s);
865
+ while (list($key, $val) = each($tokens)) {
866
+ $tokens[$key] = trim($tokens[$key]);
867
+ $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
868
+ }
869
+ $s = implode(' ', $tokens);
870
+ return $s;
871
+ }
872
+
873
+ function trim_excerpt_without_filters($text) {
874
+ $text = str_replace(']]>', ']]&gt;', $text);
875
+ $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
876
+ $text = strip_tags($text);
877
+ $max = $this->maximum_description_length;
878
+
879
+ if ($max < strlen($text)) {
880
+ while($text[$max] != ' ' && $max > $this->minimum_description_length) {
881
+ $max--;
882
+ }
883
+ }
884
+ $text = substr($text, 0, $max);
885
+ return trim(stripcslashes($text));
886
+ }
887
+
888
+ function trim_excerpt_without_filters_full_length($text) {
889
+ $text = str_replace(']]>', ']]&gt;', $text);
890
+ $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
891
+ $text = strip_tags($text);
892
+ return trim(stripcslashes($text));
893
+ }
894
+
895
+ /**
896
+ * @return comma-separated list of unique keywords
897
+ */
898
+ function get_all_keywords() {
899
+ global $posts;
900
+ global $aioseop_options;
901
+
902
+ if (is_404()) {
903
+ return null;
904
+ }
905
+
906
+ // if we are on synthetic pages
907
+ if (!is_home() && !is_page() && !is_single() &&!$this->is_static_front_page() && !$this->is_static_posts_page()) {
908
+ return null;
909
+ }
910
+
911
+ $keywords = array();
912
+ if (is_array($posts)) {
913
+ foreach ($posts as $post) {
914
+ if ($post) {
915
+
916
+ // custom field keywords
917
+ $keywords_a = $keywords_i = null;
918
+ $description_a = $description_i = null;
919
+
920
+ $id = (is_attachment())?($post->post_parent):($post->ID); // if attachment then use parent post id
921
+ $keywords_i = stripcslashes($this->internationalize(get_post_meta($id, "_aioseop_keywords", true)));
922
+ //$id = $post->ID;
923
+ //$keywords_i = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
924
+ $keywords_i = str_replace('"', '', $keywords_i);
925
+ if (isset($keywords_i) && !empty($keywords_i)) {
926
+ $traverse = explode(',', $keywords_i);
927
+ foreach ($traverse as $keyword) {
928
+ $keywords[] = $keyword;
929
+ }
930
+ }
931
+
932
+ // WP 2.3 tags
933
+ if ($aioseop_options['aiosp_use_tags_as_keywords']){
934
+ if (function_exists('get_the_tags')) {
935
+ //$tags = get_the_tags($post->ID);
936
+ $tags = get_the_tags($id);
937
+ if ($tags && is_array($tags)) {
938
+ foreach ($tags as $tag) {
939
+ $keywords[] = $this->internationalize($tag->name);
940
+ }
941
+ }
942
+ }
943
+ }
944
+ // Ultimate Tag Warrior integration
945
+ global $utw;
946
+ if ($utw) {
947
+ $tags = $utw->GetTagsForPost($post);
948
+ if (is_array($tags)) {
949
+ foreach ($tags as $tag) {
950
+ $tag = $tag->tag;
951
+ $tag = str_replace('_',' ', $tag);
952
+ $tag = str_replace('-',' ',$tag);
953
+ $tag = stripcslashes($tag);
954
+ $keywords[] = $tag;
955
+ }
956
+ }
957
+ }
958
+
959
+ // autometa
960
+ $autometa = stripcslashes(get_post_meta($id, 'autometa', true));
961
+ //$autometa = stripcslashes(get_post_meta($post->ID, "autometa", true));
962
+ if (isset($autometa) && !empty($autometa)) {
963
+ $autometa_array = explode(' ', $autometa);
964
+ foreach ($autometa_array as $e) {
965
+ $keywords[] = $e;
966
+ }
967
+ }
968
+
969
+ if ($aioseop_options['aiosp_use_categories'] && !is_page()) {
970
+ $categories = get_the_category($id);
971
+ //$categories = get_the_category($post->ID);
972
+ foreach ($categories as $category) {
973
+ $keywords[] = $this->internationalize($category->cat_name);
974
+ }
975
+ }
976
+
977
+ }
978
+ }
979
+ }
980
+
981
+ return $this->get_unique_keywords($keywords);
982
+ }
983
+
984
+ function get_meta_keywords() {
985
+ global $posts;
986
+
987
+ $keywords = array();
988
+ if (is_array($posts)) {
989
+ foreach ($posts as $post) {
990
+ if ($post) {
991
+ // custom field keywords
992
+ $keywords_a = $keywords_i = null;
993
+ $description_a = $description_i = null;
994
+ $id = $post->ID;
995
+ $keywords_i = stripcslashes(get_post_meta($post->ID, "_aioseop_keywords", true));
996
+ $keywords_i = str_replace('"', '', $keywords_i);
997
+ if (isset($keywords_i) && !empty($keywords_i)) {
998
+ $keywords[] = $keywords_i;
999
+ }
1000
+ }
1001
+ }
1002
+ }
1003
+
1004
+ return $this->get_unique_keywords($keywords);
1005
+ }
1006
+
1007
+ function get_unique_keywords($keywords) {
1008
+ $small_keywords = array();
1009
+ foreach ($keywords as $word) {
1010
+ if (function_exists('mb_strtolower'))
1011
+ $small_keywords[] = mb_strtolower($word, get_bloginfo('charset'));
1012
+ else
1013
+ $small_keywords[] = $this->strtolower($word);
1014
+ }
1015
+ $keywords_ar = array_unique($small_keywords);
1016
+ return implode(',', $keywords_ar);
1017
+ }
1018
+
1019
+ function get_url($url) {
1020
+ if (function_exists('file_get_contents')) {
1021
+ $file = file_get_contents($url);
1022
+ } else {
1023
+ $curl = curl_init($url);
1024
+ curl_setopt($curl, CURLOPT_HEADER, 0);
1025
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
1026
+ $file = curl_exec($curl);
1027
+ curl_close($curl);
1028
+ }
1029
+ return $file;
1030
+ }
1031
+
1032
+ function log($message) {
1033
+ if ($this->do_log) {
1034
+ error_log(date('Y-m-d H:i:s') . " " . $message . "\n", 3, $this->log_file);
1035
+ }
1036
+ }
1037
+
1038
+ function download_newest_version() {
1039
+ $success = true;
1040
+ $file_content = $this->get_url($this->upgrade_url);
1041
+ if ($file_content === false) {
1042
+ $this->upgrade_error = sprintf(__("Could not download distribution (%s)"), $this->upgrade_url);
1043
+ $success = false;
1044
+ } else if (strlen($file_content) < 100) {
1045
+ $this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
1046
+ $success = false;
1047
+ } else {
1048
+ $this->log(sprintf("filesize of download ZIP: %d", strlen($file_content)));
1049
+ $fh = @fopen($this->upgrade_filename, 'w');
1050
+ $this->log("fh is $fh");
1051
+ if (!$fh) {
1052
+ $this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
1053
+ $this->upgrade_error .= "<br />";
1054
+ $this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
1055
+ $success = false;
1056
+ } else {
1057
+ $bytes_written = @fwrite($fh, $file_content);
1058
+ $this->log("wrote $bytes_written bytes");
1059
+ if (!$bytes_written) {
1060
+ $this->upgrade_error = sprintf(__("Could not write to %s"), $this->upgrade_filename);
1061
+ $success = false;
1062
+ }
1063
+ }
1064
+ if ($success) {
1065
+ fclose($fh);
1066
+ }
1067
+ }
1068
+ return $success;
1069
+ }
1070
+
1071
+ function install_newest_version() {
1072
+ $success = $this->download_newest_version();
1073
+ if ($success) {
1074
+ $success = $this->extract_plugin();
1075
+ unlink($this->upgrade_filename);
1076
+ }
1077
+ return $success;
1078
+ }
1079
+
1080
+ function extract_plugin() {
1081
+ if (!class_exists('PclZip')) {
1082
+ require_once ('pclzip.lib.php');
1083
+ }
1084
+ $archive = new PclZip($this->upgrade_filename);
1085
+ $files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
1086
+ $this->log("files is $files");
1087
+ if (is_array($files)) {
1088
+ $num_extracted = sizeof($files);
1089
+ $this->log("extracted $num_extracted files to $this->upgrade_folder");
1090
+ $this->log(print_r($files, true));
1091
+ return true;
1092
+ } else {
1093
+ $this->upgrade_error = $archive->errorInfo();
1094
+ return false;
1095
+ }
1096
+ }
1097
+
1098
+ /** crude approximization of whether current user is an admin */
1099
+ function is_admin() {
1100
+ return current_user_can('level_8');
1101
+ }
1102
+
1103
+
1104
+ function is_directory_writable($directory) {
1105
+ $filename = $directory . '/' . 'tmp_file_' . time();
1106
+ $fh = @fopen($filename, 'w');
1107
+ if (!$fh) {
1108
+ return false;
1109
+ }
1110
+
1111
+ $written = fwrite($fh, "test");
1112
+ fclose($fh);
1113
+ unlink($filename);
1114
+ if ($written) {
1115
+ return true;
1116
+ } else {
1117
+ return false;
1118
+ }
1119
+ }
1120
+
1121
+
1122
+ function is_upgrade_directory_writable() {
1123
+ //return $this->is_directory_writable($this->upgrade_folder);
1124
+ // let's assume it is
1125
+ return true;
1126
+ }
1127
+
1128
+
1129
+ function post_meta_tags($id) {
1130
+ $awmp_edit = $_POST["aiosp_edit"];
1131
+ $nonce = $_POST['nonce-aioseop-edit'];
1132
+ // if (!wp_verify_nonce($nonce, 'edit-aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1133
+ if (isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce')) {
1134
+
1135
+ foreach (Array('keywords', 'description', 'title', 'meta', 'disable', 'titleatr', 'menulabel', 'togglekeywords') as $f) {
1136
+ $field = "aiosp_$f";
1137
+ if ( isset( $_POST[$field] ) ) $$field = $_POST[$field];
1138
+ }
1139
+ if ( isset( $aiosp_keywords ) ) $keywords = $aiosp_keywords;
1140
+ if ( isset( $aiosp_description ) ) $description = $aiosp_description;
1141
+ if ( isset( $aiosp_title ) ) $title = $aiosp_title;
1142
+
1143
+ delete_post_meta($id, '_aioseop_keywords');
1144
+ delete_post_meta($id, '_aioseop_description');
1145
+ delete_post_meta($id, '_aioseop_title');
1146
+ delete_post_meta($id, '_aioseop_titleatr');
1147
+ delete_post_meta($id, '_aioseop_menulabel');
1148
+
1149
+
1150
+ if ($this->is_admin()) {
1151
+ delete_post_meta($id, '_aioseop_disable');
1152
+ }
1153
+ //delete_post_meta($id, 'aiosp_meta');
1154
+
1155
+ if (isset($keywords) && !empty($keywords)) {
1156
+ add_post_meta($id, '_aioseop_keywords', $keywords);
1157
+ }
1158
+ if (isset($description) && !empty($description)) {
1159
+ add_post_meta($id, '_aioseop_description', $description);
1160
+ }
1161
+ if (isset($title) && !empty($title)) {
1162
+ add_post_meta($id, '_aioseop_title', $title);
1163
+ }
1164
+ if (isset($aiosp_titleatr) && !empty($aiosp_titleatr)) {
1165
+ add_post_meta($id, '_aioseop_titleatr', $aiosp_titleatr);
1166
+ }
1167
+ if (isset($aiosp_menulabel) && !empty($aiosp_menulabel)) {
1168
+ add_post_meta($id, '_aioseop_menulabel', $aiosp_menulabel);
1169
+ }
1170
+ if (isset($aiosp_disable) && !empty($aiosp_disable) && $this->is_admin()) {
1171
+ add_post_meta($id, '_aioseop_disable', $aiosp_disable);
1172
+ }
1173
+ /*
1174
+ if (isset($aiosp_meta) && !empty($aiosp_meta)) {
1175
+ add_post_meta($id, 'aiosp_meta', $aiosp_meta);
1176
+ }
1177
+ */
1178
+ }
1179
+ }
1180
+
1181
+ function edit_category($id) {
1182
+ global $wpdb;
1183
+ $id = $wpdb->escape($id);
1184
+ $awmp_edit = $_POST["aiosp_edit"];
1185
+ if (isset($awmp_edit) && !empty($awmp_edit)) {
1186
+ $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
1187
+ $title = $wpdb->escape($_POST["aiosp_title"]);
1188
+ $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
1189
+ if ($old_category) {
1190
+ $wpdb->query($wpdb->prepare("update $this->table_categories
1191
+ set meta_title='$title', meta_keywords='$keywords'
1192
+ where category_id=$id"));
1193
+ } else {
1194
+ $wpdb->query($wpdb->prepare("insert into $this->table_categories(meta_title, meta_keywords, category_id)
1195
+ values ('$title', '$keywords', $id"));
1196
+ }
1197
+ //$wpdb->query($wpdb->prepare("insert into $this->table_categories"))
1198
+ /*
1199
+ delete_post_meta($id, 'keywords');
1200
+ delete_post_meta($id, 'description');
1201
+ delete_post_meta($id, 'title');
1202
+
1203
+ if (isset($keywords) && !empty($keywords)) {
1204
+ add_post_meta($id, 'keywords', $keywords);
1205
+ }
1206
+ if (isset($description) && !empty($description)) {
1207
+ add_post_meta($id, 'description', $description);
1208
+ }
1209
+ if (isset($title) && !empty($title)) {
1210
+ add_post_meta($id, 'title', $title);
1211
+ }
1212
+ */
1213
+ }
1214
+ }
1215
+
1216
+ /**
1217
+ * @deprecated This was for the feature of dedicated meta tags for categories which never went mainstream.
1218
+ */
1219
+ function edit_category_form() {
1220
+ global $post;
1221
+ $keywords = stripcslashes(get_post_meta($post->ID, '_aioseop_keywords', true));
1222
+ $title = stripcslashes(get_post_meta($post->ID, '_aioseop_title', true));
1223
+ $description = stripcslashes(get_post_meta($post->ID, '_aioseop_description', true));
1224
+ ?>
1225
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
1226
+ <table class="editform" width="100%" cellspacing="2" cellpadding="5">
1227
+ <tr>
1228
+ <th width="33%" scope="row" valign="top">
1229
+ <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>
1230
+ </th>
1231
+ </tr>
1232
+ <tr>
1233
+ <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
1234
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
1235
+ </tr>
1236
+ <tr>
1237
+ <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
1238
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
1239
+ </tr>
1240
+ </table>
1241
+ <?php
1242
+ }
1243
+
1244
+ function add_meta_tags_textinput() {
1245
+ global $post;
1246
+ $post_id = $post;
1247
+ if (is_object($post_id)) {
1248
+ $post_id = $post_id->ID;
1249
+ }
1250
+ $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_keywords', true)));
1251
+ $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_title', true)));
1252
+ $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_description', true)));
1253
+ $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_meta', true)));
1254
+ $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable', true)));
1255
+ $aiosp_titleatr = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_titleatr', true)));
1256
+ $aiosp_menulabel = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_menulabel', true)));
1257
+
1258
+ ?>
1259
+ <SCRIPT LANGUAGE="JavaScript">
1260
+ <!-- Begin
1261
+ function countChars(field,cntfield) {
1262
+ cntfield.value = field.value.length;
1263
+ }
1264
+ // End -->
1265
+ </script>
1266
+
1267
+ <div id="postaiosp" class="postbox closed">
1268
+ <h3><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
1269
+ <div class="inside">
1270
+ <div id="postaiosp">
1271
+
1272
+ <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>
1273
+ <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
1274
+ <table style="margin-bottom:40px">
1275
+ <tr>
1276
+ <th style="text-align:left;" colspan="2">
1277
+ </th>
1278
+ </tr>
1279
+ <tr>
1280
+ <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
1281
+ <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="62"/></td>
1282
+ </tr>
1283
+ <tr>
1284
+ <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
1285
+ <td><textarea name="aiosp_description" rows="1" cols="60" onKeyDown="countChars(document.post.aiosp_description,document.post.length1)" onKeyUp="countChars(document.post.aiosp_description,document.post.length1)"><?php echo $description ?>
1286
+ </textarea><br />
1287
+ <input readonly type="text" name="length1" size="3" maxlength="3" value="<?php echo strlen($description);?>" />
1288
+ <?php _e(' characters. Most search engines use a maximum of 160 chars for the description.', 'all_in_one_seo_pack') ?>
1289
+ </td>
1290
+ </tr>
1291
+ <tr>
1292
+ <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
1293
+ <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="62"/></td>
1294
+ </tr>
1295
+ <input type="hidden" name="nonce-aioseop-edit" value="<?php echo wp_create_nonce('edit-aioseop-nonce'); ?>" />
1296
+ <?php if ($this->is_admin()) { ?>
1297
+ <tr>
1298
+ <th scope="row" style="text-align:right; vertical-align:top;">
1299
+ <?php _e('Disable on this page/post:', 'all_in_one_seo_pack')?>
1300
+ </th>
1301
+ <td>
1302
+ <input type="checkbox" name="aiosp_disable" <?php if ($aiosp_disable) echo "checked=\"1\""; ?>/>
1303
+ </td>
1304
+ </tr>
1305
+
1306
+ <tr>
1307
+ <th scope="row" style="text-align:right;"><?php _e('Title Attribute:', 'all_in_one_seo_pack') ?></th>
1308
+ <td><input value="<?php echo $aiosp_titleatr ?>" type="text" name="aiosp_titleatr" size="62"/></td>
1309
+ </tr>
1310
+ <tr>
1311
+ <th scope="row" style="text-align:right;"><?php _e('Menu Label:', 'all_in_one_seo_pack') ?></th>
1312
+ <td><input value="<?php echo $aiosp_menulabel ?>" type="text" name="aiosp_menulabel" size="62"/></td>
1313
+ </tr>
1314
+ <?php } ?>
1315
+ </table>
1316
+
1317
+ </div>
1318
+ </div>
1319
+ </div>
1320
+
1321
+ <?php
1322
+ }
1323
+
1324
+ function admin_menu() {
1325
+ $file = __FILE__;
1326
+
1327
+ //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'));
1328
+ add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 'manage_options', $file, array($this, 'options_panel'));
1329
+ }
1330
+
1331
+ function management_panel() {
1332
+ $message = null;
1333
+ $base_url = "edit.php?page=" . __FILE__;
1334
+ //echo($base_url);
1335
+ $type = $_REQUEST['type'];
1336
+ if (!isset($type)) {
1337
+ $type = "posts";
1338
+ }
1339
+ ?>
1340
+
1341
+ <ul class="aiosp_menu">
1342
+ <li><a href="<?php echo $base_url ?>&type=posts">Posts</a>
1343
+ </li>
1344
+ <li><a href="<?php echo $base_url ?>&type=pages">Pages</a>
1345
+ </li>
1346
+ </ul>
1347
+
1348
+ <?php
1349
+
1350
+ if ($type == "posts") {
1351
+ echo("posts");
1352
+ } elseif ($type == "pages") {
1353
+ echo("pages");
1354
+ }
1355
+ }
1356
+
1357
+ function options_panel() {
1358
+ $message = null;
1359
+ //$message_updated = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1360
+ global $aioseop_options;
1361
+
1362
+ if(!$aioseop_options['aiosp_cap_cats']) {
1363
+ $aioseop_options['aiosp_cap_cats'] = '1';
1364
+ }
1365
+
1366
+
1367
+ if (isset($_POST['action']) && $_POST['action'] == 'aiosp_update' && isset($_POST['Submit_Default'])) {
1368
+ $nonce = $_POST['nonce-aioseop'];
1369
+ if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1370
+ $message = __("All in One SEO Options Reset.", 'all_in_one_seo_pack');
1371
+ delete_option('aioseop_options');
1372
+ $res_aioseop_options = array(
1373
+ "aiosp_can"=>1,
1374
+ "aiosp_donate"=>0,
1375
+ "aiosp_home_title"=>null,
1376
+ "aiosp_home_description"=>'',
1377
+ "aiosp_home_keywords"=>null,
1378
+ "aiosp_max_words_excerpt"=>'something',
1379
+ "aiosp_rewrite_titles"=>1,
1380
+ "aiosp_post_title_format"=>'%post_title% | %blog_title%',
1381
+ "aiosp_page_title_format"=>'%page_title% | %blog_title%',
1382
+ "aiosp_category_title_format"=>'%category_title% | %blog_title%',
1383
+ "aiosp_archive_title_format"=>'%date% | %blog_title%',
1384
+ "aiosp_tag_title_format"=>'%tag% | %blog_title%',
1385
+ "aiosp_search_title_format"=>'%search% | %blog_title%',
1386
+ "aiosp_description_format"=>'%description%',
1387
+ "aiosp_404_title_format"=>'Nothing found for %request_words%',
1388
+ "aiosp_paged_format"=>' - Part %page%',
1389
+ "aiosp_google_analytics_id"=>null,
1390
+ "aiosp_ga_track_outbound_links"=>0,
1391
+ "aiosp_use_categories"=>0,
1392
+ "aiosp_dynamic_postspage_keywords"=>1,
1393
+ "aiosp_category_noindex"=>1,
1394
+ "aiosp_archive_noindex"=>1,
1395
+ "aiosp_tags_noindex"=>0,
1396
+ "aiosp_cap_cats"=>1,
1397
+ "aiosp_generate_descriptions"=>1,
1398
+ "aiosp_debug_info"=>null,
1399
+ "aiosp_post_meta_tags"=>'',
1400
+ "aiosp_enablecpost"=>'0',
1401
+ "aiosp_page_meta_tags"=>'',
1402
+ "aiosp_home_meta_tags"=>'',
1403
+ "aiosp_enabled" =>0,
1404
+ "aiosp_use_tags_as_keywords" =>1,
1405
+ "aiosp_seopostcol" => 1,
1406
+ "aiosp_seocustptcol" => 0,
1407
+ "aiosp_posttypecolumns" => array('post','page'),
1408
+ "aiosp_do_log"=>null);
1409
+ update_option('aioseop_options', $res_aioseop_options);
1410
+ }
1411
+
1412
+
1413
+ // update options
1414
+ if(isset($_POST['action'])){
1415
+ if ($_POST['action'] && $_POST['action'] == 'aiosp_update' && !empty( $_POST['Submit'] ) ) {
1416
+ $nonce = $_POST['nonce-aioseop'];
1417
+ if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1418
+ $message = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1419
+
1420
+ $options = Array( "aiosp_can", "aiosp_donate", "aiosp_home_title", "aiosp_home_description", "aiosp_home_keywords", "aiosp_max_words_excerpt",
1421
+ "aiosp_rewrite_titles", "aiosp_post_title_format", "aiosp_page_title_format", "aiosp_category_title_format",
1422
+ "aiosp_archive_title_format", "aiosp_tag_title_format", "aiosp_search_title_format", "aiosp_description_format",
1423
+ "aiosp_404_title_format", "aiosp_paged_format", "aiosp_google_analytics_id", "aiosp_ga_track_outbound_links",
1424
+ "aiosp_use_categories", "aiosp_dynamic_postspage_keywords", "aiosp_category_noindex", "aiosp_archive_noindex",
1425
+ "aiosp_tags_noindex", "aiosp_generate_descriptions", "aiosp_cap_cats", "aiosp_enablecpost", "aiosp_debug_info",
1426
+ "aiosp_post_meta_tags", "aiosp_page_meta_tags", "aiosp_home_meta_tags", "aiosp_ex_pages", "aiosp_do_log",
1427
+ "aiosp_enabled", "aiosp_use_tags_as_keywords", "aiosp_seopostcol", "aiosp_seocustptcol", "aiosp_posttypecolumns");
1428
+
1429
+ $esc_options = Array( "aiosp_home_title", "aiosp_home_description", "aiosp_google_analytics_id" );
1430
+
1431
+ foreach( $options as $o ) {
1432
+ $aioseop_options[$o] = '';
1433
+ if ( in_array( $o, $esc_options ) ) {
1434
+ if ( isset( $_POST[$o] ) ) $aioseop_options[$o] = esc_attr( $_POST[$o] );
1435
+ } else {
1436
+ if ( isset( $_POST[$o] ) ) $aioseop_options[$o] = $_POST[$o];
1437
+ }
1438
+ }
1439
+
1440
+ update_option('aioseop_options', $aioseop_options);
1441
+
1442
+ wp_cache_flush();
1443
+ }
1444
+ } /*elseif ($_POST['aiosp_upgrade']) {
1445
+ $message = __("Upgraded to newest version. Please revisit the options page to make sure you see the newest version.", 'all_in_one_seo_pack');
1446
+ $success = $this->install_newest_version();
1447
+ if (!$success) {
1448
+ $message = __("Upgrade failed", 'all_in_one_seo_pack');
1449
+ if (isset($this->upgrade_error) && !empty($this->upgrade_error)) {
1450
+ $message .= ": " . $this->upgrade_error;
1451
+ } else {
1452
+ $message .= ".";
1453
+ }
1454
+ }
1455
+ }*/
1456
+
1457
+ if ($message){
1458
+ echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>";
1459
+ }
1460
+ ?>
1461
+ <div id="dropmessage" class="updated" style="display:none;"></div>
1462
+ <div class="wrap">
1463
+
1464
+ <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
1465
+ by <strong>Michael Torbert</strong> of <strong>Semper Fi Web Design</strong>
1466
+ <p>
1467
+ <div style="float:left;">
1468
+
1469
+ <?php //_e("This is version ", 'all_in_one_seo_pack') ?><?php //_e("$this->version ", 'all_in_one_seo_pack') ?>
1470
+ &nbsp;<a target="_blank" title="<?php _e('All in One SEO Plugin Release History', 'all_in_one_seo_pack')?>"
1471
+ href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-pack-release-history/"><?php _e("Changelog", 'all_in_one_seo_pack')?>
1472
+ </a>
1473
+ | <a target="_blank" title="<?php _e('FAQ', 'all_in_one_seo_pack') ?>"
1474
+ href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/"><?php _e('FAQ', 'all_in_one_seo_pack') ?></a>
1475
+ | <a target="_blank" title="<?php _e('All in One SEO Plugin Support Forum', 'all_in_one_seo_pack') ?>"
1476
+ href="http://semperfiwebdesign.com/forum/"><?php _e('Support', 'all_in_one_seo_pack') ?></a>
1477
+ | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
1478
+ 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>
1479
+ | <strong><a target="_blank" title="<?php _e('Pro Version', 'all_in_one_seo_pack') ?>"
1480
+ href="http://wpplugins.com/plugin/50/all-in-one-seo-pack-pro-version"><?php _e('UPGRADE TO PRO VERSION', 'all_in_one_seo_pack') ?></a></strong>
1481
+ </div>
1482
+
1483
+ <div style="width:600px;margin-top:40px;">
1484
+ <form action="http://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
1485
+ <span>Join our mailing list for tips, tricks, and WordPress secrets.<br /><em><strong>Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress</strong></em> ($39 value).</span>
1486
+ <div>
1487
+ <label for="mce-EMAIL">Email Address </label>
1488
+ <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL">
1489
+
1490
+
1491
+ <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn">
1492
+ </div>
1493
+ </form>
1494
+ </div>
1495
+ <div style="clear:both;">
1496
+
1497
+ <br />
1498
+ </p>
1499
+
1500
+ <div style="width:905px;">
1501
+ <div style="float:left;background-color:white;padding: 10px;margin-right:15px;border: 1px solid #ddd;height:200px;margin-bottom:2px;">
1502
+ <div style="width:423px;height:130px;">
1503
+ <h3>Donate</h3>
1504
+ <em>If you like this plugin and find it useful, help keep this plugin free and actively developed by clicking the <a 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" target="_blank"><strong>donate</strong></a> button or send me a gift from my <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank"><strong>Amazon wishlist</strong></a>. Also, don't forget to follow me on <a href="http://twitter.com/michaeltorbert/" target="_blank"><strong>Twitter</strong></a>.</em>
1505
+ </div>
1506
+ <a target="_blank" title="<?php echo 'Donate' ?>"
1507
+ 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">
1508
+ <img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>donate.jpg" alt="<?php _e('Donate with Paypal', 'all_in_one_seo_pack') ?>" /> </a>
1509
+ <a target="_blank" title="Amazon Wish List" href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web">
1510
+ <img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>amazon.jpg" alt="<?php _e('My Amazon Wish List', 'all_in_one_seo_pack') ?>" /> </a>
1511
+ <a target="_blank" title="<?php _e('Follow us on Twitter', 'all_in_one_seo_pack') ?>" href="http://twitter.com/michaeltorbert/">
1512
+ <img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>twitter.jpg" alt="<?php _e('Follow Us on Twitter', 'all_in_one_seo_pack') ?>" /> </a>
1513
+ </div>
1514
+
1515
+ <div style="float:left;background-color:white;padding:10px;border:1px solid #ddd;height:200px;">
1516
+ <div style="width:423px;height:130px">
1517
+ <h3>Drag and Drop WordPress Design</h3>
1518
+ <p><a href="http://semperfiwebdesign.com/headwayaio/" target="_blank">Headway Themes</a> allows you to easily create your own stunning website designs! Stop using premade themes start making your own design with Headway's easy to use Drag and Drop interface. All in One SEO Pack users have an exclusive discount by using coupon code <strong>SEMPERFI30</strong> at checkout.</p>
1519
+ </div>
1520
+ <a href="http://semperfiwebdesign.com/headwayaio/" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>headwaybanner.png"></a>
1521
+ </div>
1522
+
1523
+ <div style="clear:both;">
1524
+
1525
+
1526
+ <div style="float:left;background-color:white;padding:10px;border:1px solid #ddd;height:200px;margin: 2px 15px 2px 0px;">
1527
+ <div style="width:423px;height:130px;">
1528
+ <h3>Reliable WordPress Hosting</h3>
1529
+ <p><a title="WebHostingHub.com" target="_blank"
1530
+ href="http://ref.webhostinghub.com/scripts/click.php?ref_id=rsuog2&ad_id=54c8d95f">WebHostingHub.com</a>
1531
+ is a true leader in WordPress hosting and configured for WordPress
1532
+ blogs. Hub's account includes UNLIMITED Hosting, NO-DOWNTIME Transfer,
1533
+ 24/7 U.S. Support & 90-Day FULL Money Back.<br />
1534
+ Check our <a title="WebHostingHub reviews" target="_blank"
1535
+ href="http://webhostingrating.com/companies/web-hosting-hub/">customer
1536
+ reviews</a> at WebHostingRating.com.</p>
1537
+ </div>
1538
+ <a title="WebHostingHub.com" target="_blank"
1539
+ href="http://ref.webhostinghub.com/scripts/click.php?ref_id=rsuog2&ad_id=54c8d95f"><img
1540
+ src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>hub_420_wordpress.png"
1541
+ alt="WebHostingHub.com" width="420" height="53" border="0" /></a>
1542
+ </div>
1543
+
1544
+ <div style="float:left;background-color:white;padding:10px;border:1px solid #ddd;margin-top:2px;">
1545
+ <div style="width:423px;height:130px">
1546
+ <h3>Secure your WordPress Blog with WebsiteDefender.com</h3>
1547
+ <p><a href="http://www.websitedefender.com">WebsiteDefender.com</a> is an online service that checks your WordPress blog by checking for malware, security vulnerabilities and hacker activity. Don’t take the risk of getting blacklisted by Google.
1548
+ <strong><a href="https://dashboard.websitedefender.com/register-for-free-website-scan.php">Sign up for FREE</a> and keep your blog safe!</strong></p>
1549
+ </div>
1550
+ <a href="http://www.websitedefender.com/wordpress-security-with-websitedefender/" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>WD_wordpress_450x50.gif" alt="Sign up for a free WebsiteDefender account and secure your WordPress blog"></a>
1551
+ </div>
1552
+
1553
+ </div>
1554
+
1555
+ <div style="clear:both;">
1556
+
1557
+ <?php $themefuse_ab = ( mt_rand( 0, 1 ) ) ? 'a' : 'b'; ?>
1558
+ <div style="float:left;background-color:white;margin-top:3px;">
1559
+ <a title="ThemeFuse" target="_blank"
1560
+ href="http://themefuse.com/wp-themes-shop/?plugin=all-in-one-seo-pack&v=<?php echo $themefuse_ab; ?>"><img
1561
+ src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>themefuse_banner_<?php echo $themefuse_ab; ?>.jpg"
1562
+ alt="ThemeFuse" width="445" height="220" border="0" /></a>
1563
+ </div>
1564
+ </div>
1565
+
1566
+
1567
+
1568
+
1569
+ <!--
1570
+ <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;border: 1px solid #ddd;">
1571
+ <div style="width:365px;height:130px;">
1572
+
1573
+ <form action="http://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
1574
+ <span>Join our mailing list for tips, tricks, and WordPress secrets. Also receive discounts on top commercial plugins and themes.<br /><em><strong>Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress</strong></em>.</span>
1575
+ <div class="mc-field-group">
1576
+ <label for="mce-EMAIL">Email Address </label>
1577
+ <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL">
1578
+ </div>
1579
+
1580
+ <div><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn"></div>
1581
+ </form>
1582
+ </div>
1583
+ </div>
1584
+ -->
1585
+ </div>
1586
+ <div style="clear:both";></div>
1587
+ <!--
1588
+ <p>
1589
+ <?php
1590
+ //$canwrite = $this->is_upgrade_directory_writable();
1591
+ //$canwrite = false;
1592
+ ?>
1593
+ <form class="form-table" name="dofollow" action="" method="post">
1594
+ <p class="submit">
1595
+ <input type="submit" <?php //if (!$canwrite) echo(' disabled="disabled" ');?> name="aiosp_upgrade" value="<?php //_e('One Click Upgrade', 'all_in_one_seo_pack')?> &raquo;" />
1596
+ <strong><?php //_e("(Remember: Backup early, backup often!)", 'all_in_one_seo_pack') ?></strong>
1597
+ </form>
1598
+ </p>
1599
+ <p></p>
1600
+
1601
+
1602
+ <?php //if (!$canwrite) {
1603
+ //echo("<p><strong>"); echo(sprintf(__("Please make sure that %s is writable.", 'all_in_one_seo_pack'), $this->upgrade_folder)); echo("</p></strong>");
1604
+ // } ?>
1605
+ </p>
1606
+ -->
1607
+
1608
+ <script type="text/javascript">
1609
+ <!--
1610
+ function toggleVisibility(id) {
1611
+ var e = document.getElementById(id);
1612
+ if(e.style.display == 'block')
1613
+ e.style.display = 'none';
1614
+ else
1615
+ e.style.display = 'block';
1616
+ }
1617
+ //-->
1618
+ </script>
1619
+
1620
+ <h3><?php _e('Click on option titles to get help!', 'all_in_one_seo_pack') ?></h3>
1621
+
1622
+ <?php
1623
+ function aioseop_mrt_df(){
1624
+
1625
+ if(function_exists('fetch_feed')){
1626
+ // start new feed
1627
+ echo "Highest Donations";
1628
+ // Get RSS Feed(s)
1629
+ include_once(ABSPATH . WPINC . '/feed.php');
1630
+
1631
+ // Get a SimplePie feed object from the specified feed source.
1632
+ $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/highest-donations/feed/');
1633
+
1634
+ // Figure out how many total items there are, but limit it to 5.
1635
+ $maxitems = $rss->get_item_quantity(3);
1636
+
1637
+ // Build an array of all the items, starting with element 0 (first element).
1638
+ $rss_items = $rss->get_items(0, $maxitems);
1639
+ ?>
1640
+
1641
+ <ul>
1642
+ <?php if ($maxitems == 0) echo '<li>No items.</li>';
1643
+ else
1644
+ // Loop through each feed item and display each item as a hyperlink.
1645
+ foreach ( $rss_items as $item ) : ?>
1646
+ <li>
1647
+ <a href='<?php echo $item->get_permalink(); ?>'
1648
+ title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
1649
+ <?php echo $item->get_title(); ?></a>
1650
+ </li>
1651
+ <?php endforeach; ?>
1652
+ </ul>
1653
+
1654
+ <?php echo "Latest Donations"; ?>
1655
+ <?php // Get RSS Feed(s)
1656
+ include_once(ABSPATH . WPINC . '/feed.php');
1657
+
1658
+ // Get a SimplePie feed object from the specified feed source.
1659
+ $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/');
1660
+
1661
+ // Figure out how many total items there are, but limit it to 5.
1662
+ $maxitems = $rss->get_item_quantity(3);
1663
+
1664
+ // Build an array of all the items, starting with element 0 (first element).
1665
+ $rss_items = $rss->get_items(0, $maxitems);
1666
+ ?>
1667
+
1668
+ <ul>
1669
+ <?php if ($maxitems == 0) echo '<li>No items.</li>';
1670
+ else
1671
+ // Loop through each feed item and display each item as a hyperlink.
1672
+ foreach ( $rss_items as $item ) : ?>
1673
+ <li>
1674
+ <a href='<?php echo $item->get_permalink(); ?>'
1675
+ title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
1676
+ <?php echo $item->get_title(); ?></a>
1677
+ </li>
1678
+ <?php endforeach; ?>
1679
+ </ul>
1680
+
1681
+
1682
+ <?php // end new feed
1683
+ }else{
1684
+
1685
+ $uri = "feed://donations.semperfiwebdesign.com/category/highest-donations/feed/";
1686
+ include_once(ABSPATH . WPINC . '/rss.php');
1687
+ $rss = fetch_rss($uri);
1688
+ if($rss){
1689
+ echo "Highest Donations";
1690
+ $maxitems = 5;
1691
+ if(is_array($rss->items)){
1692
+ $items = array_slice($rss->items, 0, $maxitems);
1693
+ ?>
1694
+ <ul>
1695
+ <?php if (empty($items)) echo '<li>No items</li>';
1696
+ else
1697
+ foreach ( $items as $item ) : ?>
1698
+ <li><a href='<?php echo $item['description']; ?>'
1699
+ title='<?php echo $item['title']; ?>'>
1700
+ <?php echo $item['title']; ?>
1701
+ </a></li>
1702
+ <?php endforeach; ?>
1703
+ </ul>
1704
+ <?php } }else{
1705
+ //do something else for feed here
1706
+ }
1707
+
1708
+
1709
+ ?>
1710
+
1711
+ <?php
1712
+ $uri = "feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/";
1713
+ include_once(ABSPATH . WPINC . '/rss.php');
1714
+ $rss = fetch_rss($uri);
1715
+ if($rss){
1716
+ echo "Latest Donations";
1717
+ $maxitems = 5;
1718
+ if(is_array($rss->items)){
1719
+ $items = array_slice($rss->items, 0, $maxitems);
1720
+ ?>
1721
+ <ul>
1722
+ <?php if (empty($items)) echo '<li>No items</li>';
1723
+ else
1724
+ foreach ( $items as $item ) : ?>
1725
+ <li><a href='<?php echo $item['link']; ?>'
1726
+ title='<?php echo $item['title']; ?>'>
1727
+ <?php echo $item['title']; ?>
1728
+ </a></li>
1729
+ <?php endforeach; ?>
1730
+ </ul>
1731
+ <?php } }else{
1732
+ //fall back on something else for feed here
1733
+ }
1734
+ }
1735
+ }
1736
+
1737
+ //aioseop_mrt_df();
1738
+
1739
+ ?>
1740
+
1741
+
1742
+
1743
+ <?php
1744
+ global $wpdb;
1745
+ $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'keywords'");
1746
+ $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'title'") + $somecount;
1747
+ $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'description'") + $somecount;
1748
+ $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_meta'") + $somecount;
1749
+ $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_disable'") + $somecount;
1750
+ if($somecount > 0){
1751
+ echo "<div class='error' style='text-align:center;'><p><strong>Your database meta needs to be updated. " . $somecount . " old fields remaining</strong> <em>(Back up your database before updating.)</em>
1752
+ <FORM action='' method='post' name='aioseop-migrate'>
1753
+ <input type='hidden' name='nonce-aioseop-migrate' value='" . wp_create_nonce('aioseop-migrate-nonce') . "' />
1754
+ <input type='submit' name='aioseop_migrate' class='button-primary' value='Update Database'>
1755
+ </FORM>
1756
+ </p></div>";
1757
+ }
1758
+
1759
+ if(!get_option('aioseop_options')){
1760
+ echo "<div class='error' style='text-align:center;'><p><strong>Your database options need to be updated.</strong><em>(Back up your database before updating.)</em>
1761
+ <FORM action='' method='post' name='aioseop-migrate-options'>
1762
+ <input type='hidden' name='nonce-aioseop-migrate-options' value='" . wp_create_nonce('aioseop-migrate-nonce-options') . "' />
1763
+ <input type='submit' name='aioseop_migrate_options' class='button-primary' value='Update Database Options'>
1764
+ </FORM>
1765
+ </p></div>";
1766
+
1767
+ }
1768
+
1769
+ ?>
1770
+
1771
+
1772
+ <form name="dofollow" action="" method="post">
1773
+ <table class="form-table">
1774
+ <?php $aioseop_options = get_option('aioseop_options'); ?>
1775
+ <?php if (!$aioseop_options['aiosp_donate']){?>
1776
+ <tr>
1777
+ <th scope="row" style="text-align:right; vertical-align:top;">
1778
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
1779
+ <?php _e('I enjoy this plugin and have made a donation:', 'all_in_one_seo_pack'); ?>
1780
+ </a>
1781
+ </td>
1782
+ <td>
1783
+ <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
1784
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
1785
+ <?php
1786
+ _e('All donations support continued development of this free software.', 'all_in_one_seo_pack');
1787
+ ?>
1788
+ </div>
1789
+ </td>
1790
+ </tr>
1791
+ <?php } ?>
1792
+
1793
+ <tr>
1794
+ <th scope="row" style="text-align:right; vertical-align:top;">
1795
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack'); ?>" onclick="toggleVisibility('aiosp_enabled_tip');">
1796
+ <?php _e('Plugin Status:', 'all_in_one_seo_pack')?>
1797
+ </a>
1798
+ </td>
1799
+ <td>
1800
+ <input type="radio" name="aiosp_enabled" value="1" <?php if($aioseop_options['aiosp_enabled']) echo "checked"?> > <?php _e('Enabled', 'all_in_one_seo_pack'); ?><br>
1801
+ <input type="radio" name="aiosp_enabled" value="0" <?php if(!$aioseop_options['aiosp_enabled']) echo "checked"?>> <?php _e('Disabled', 'all_in_one_seo_pack'); ?>
1802
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_enabled_tip">
1803
+ <?php
1804
+ _e('All in One SEO Pack must be enabled for use.', 'all_in_one_seo_pack');
1805
+ ?>
1806
+ </div>
1807
+ </td>
1808
+ </tr>
1809
+
1810
+ <tr>
1811
+ <th scope="row" style="text-align:right; vertical-align:top;">
1812
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_title_tip');">
1813
+ <?php _e('Home Title:', 'all_in_one_seo_pack')?>
1814
+ </a>
1815
+ </td>
1816
+ <td>
1817
+ <textarea cols="57" rows="2" name="aiosp_home_title"><?php echo stripcslashes($aioseop_options['aiosp_home_title']); ?></textarea>
1818
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_title_tip">
1819
+ <?php
1820
+ _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');
1821
+ ?>
1822
+ </div>
1823
+ </td>
1824
+ </tr>
1825
+
1826
+ <tr>
1827
+ <th scope="row" style="text-align:right; vertical-align:top;">
1828
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_description_tip');">
1829
+ <?php _e('Home Description:', 'all_in_one_seo_pack')?>
1830
+ </a>
1831
+ </td>
1832
+ <td>
1833
+ <textarea cols="57" rows="2" name="aiosp_home_description"><?php echo stripcslashes($aioseop_options['aiosp_home_description']); ?></textarea>
1834
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_description_tip">
1835
+ <?php
1836
+ _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');
1837
+ ?>
1838
+ </div>
1839
+ </td>
1840
+ </tr>
1841
+
1842
+ <tr>
1843
+ <th scope="row" style="text-align:right; vertical-align:top;">
1844
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_keywords_tip');">
1845
+ <?php _e('Home Keywords (comma separated):', 'all_in_one_seo_pack')?>
1846
+ </a>
1847
+ </td>
1848
+ <td>
1849
+ <textarea cols="57" rows="2" name="aiosp_home_keywords"><?php echo stripcslashes($aioseop_options['aiosp_home_keywords']); ?></textarea>
1850
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_keywords_tip">
1851
+ <?php
1852
+ _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');
1853
+ ?>
1854
+ </div>
1855
+ </td>
1856
+ </tr>
1857
+
1858
+ <tr>
1859
+ <th scope="row" style="text-align:right; vertical-align:top;">
1860
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_can_tip');">
1861
+ <?php _e('Canonical URLs:', 'all_in_one_seo_pack')?>
1862
+ </a>
1863
+ </td>
1864
+ <td>
1865
+ <input type="checkbox" name="aiosp_can" <?php if ($aioseop_options['aiosp_can']) echo "checked=\"1\""; ?>/>
1866
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_can_tip">
1867
+ <?php
1868
+ _e("This option will automatically generate Canonical URLS for your entire WordPress installation. This will help to prevent duplicate content penalties by <a href='http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html' target='_blank'>Google</a>.", 'all_in_one_seo_pack');
1869
+ ?>
1870
+ </div>
1871
+ </td>
1872
+ </tr>
1873
+
1874
+ <tr>
1875
+ <th scope="row" style="text-align:right; vertical-align:top;">
1876
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_rewrite_titles_tip');">
1877
+ <?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
1878
+ </a>
1879
+ </td>
1880
+ <td>
1881
+ <input type="checkbox" name="aiosp_rewrite_titles" <?php if ($aioseop_options['aiosp_rewrite_titles']) echo "checked=\"1\""; ?>/>
1882
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_rewrite_titles_tip">
1883
+ <?php
1884
+ _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');
1885
+ ?>
1886
+ </div>
1887
+ </td>
1888
+ </tr>
1889
+
1890
+ <tr>
1891
+ <th scope="row" style="text-align:right; vertical-align:top;">
1892
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_title_format_tip');">
1893
+ <?php _e('Post Title Format:', 'all_in_one_seo_pack')?>
1894
+ </a>
1895
+ </td>
1896
+ <td>
1897
+ <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_post_title_format']); ?>"/>
1898
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_title_format_tip">
1899
+ <?php
1900
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1901
+ echo('<ul>');
1902
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1903
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1904
+ echo('<li>'); _e('%post_title% - The original title of the post', 'all_in_one_seo_pack'); echo('</li>');
1905
+ echo('<li>'); _e('%category_title% - The (main) category of the post', 'all_in_one_seo_pack'); echo('</li>');
1906
+ echo('<li>'); _e('%category% - Alias for %category_title%', 'all_in_one_seo_pack'); echo('</li>');
1907
+ echo('<li>'); _e("%post_author_login% - This post's author' login", 'all_in_one_seo_pack'); echo('</li>');
1908
+ echo('<li>'); _e("%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1909
+ echo('<li>'); _e("%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1910
+ echo('<li>'); _e("%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1911
+ echo('</ul>');
1912
+ ?>
1913
+ </div>
1914
+ </td>
1915
+ </tr>
1916
+
1917
+ <tr>
1918
+ <th scope="row" style="text-align:right; vertical-align:top;">
1919
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_title_format_tip');">
1920
+ <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
1921
+ </a>
1922
+ </td>
1923
+ <td>
1924
+ <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_page_title_format']); ?>"/>
1925
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_title_format_tip">
1926
+ <?php
1927
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1928
+ echo('<ul>');
1929
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1930
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1931
+ echo('<li>'); _e('%page_title% - The original title of the page', 'all_in_one_seo_pack'); echo('</li>');
1932
+ echo('<li>'); _e("%page_author_login% - This page's author' login", 'all_in_one_seo_pack'); echo('</li>');
1933
+ echo('<li>'); _e("%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1934
+ echo('<li>'); _e("%page_author_firstname% - This page's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1935
+ echo('<li>'); _e("%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1936
+ echo('</ul>');
1937
+ ?>
1938
+ </div>
1939
+ </td>
1940
+ </tr>
1941
+
1942
+ <tr>
1943
+ <th scope="row" style="text-align:right; vertical-align:top;">
1944
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_title_format_tip');">
1945
+ <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
1946
+ </a>
1947
+ </td>
1948
+ <td>
1949
+ <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_category_title_format']); ?>"/>
1950
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_title_format_tip">
1951
+ <?php
1952
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1953
+ echo('<ul>');
1954
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1955
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1956
+ echo('<li>'); _e('%category_title% - The original title of the category', 'all_in_one_seo_pack'); echo('</li>');
1957
+ echo('<li>'); _e('%category_description% - The description of the category', 'all_in_one_seo_pack'); echo('</li>');
1958
+ echo('</ul>');
1959
+ ?>
1960
+ </div>
1961
+ </td>
1962
+ </tr>
1963
+
1964
+ <tr>
1965
+ <th scope="row" style="text-align:right; vertical-align:top;">
1966
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_title_format_tip');">
1967
+ <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
1968
+ </a>
1969
+ </td>
1970
+ <td>
1971
+ <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_archive_title_format']); ?>"/>
1972
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_title_format_tip">
1973
+ <?php
1974
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1975
+ echo('<ul>');
1976
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1977
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1978
+ echo('<li>'); _e('%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack'); echo('</li>');
1979
+ echo('</ul>');
1980
+ ?>
1981
+ </div>
1982
+ </td>
1983
+ </tr>
1984
+
1985
+ <tr>
1986
+ <th scope="row" style="text-align:right; vertical-align:top;">
1987
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tag_title_format_tip');">
1988
+ <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
1989
+ </a>
1990
+ </td>
1991
+ <td>
1992
+ <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_tag_title_format']); ?>"/>
1993
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_tag_title_format_tip">
1994
+ <?php
1995
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
1996
+ echo('<ul>');
1997
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1998
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1999
+ echo('<li>'); _e('%tag% - The name of the tag', 'all_in_one_seo_pack'); echo('</li>');
2000
+ echo('</ul>');
2001
+ ?>
2002
+ </div>
2003
+ </td>
2004
+ </tr>
2005
+
2006
+ <tr>
2007
+ <th scope="row" style="text-align:right; vertical-align:top;">
2008
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_search_title_format_tip');">
2009
+ <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
2010
+ </a>
2011
+ </td>
2012
+ <td>
2013
+ <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_search_title_format']); ?>"/>
2014
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_search_title_format_tip">
2015
+ <?php
2016
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
2017
+ echo('<ul>');
2018
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2019
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2020
+ echo('<li>'); _e('%search% - What was searched for', 'all_in_one_seo_pack'); echo('</li>');
2021
+ echo('</ul>');
2022
+ ?>
2023
+ </div>
2024
+ </td>
2025
+ </tr>
2026
+
2027
+ <tr>
2028
+ <th scope="row" style="text-align:right; vertical-align:top;">
2029
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_description_format_tip');">
2030
+ <?php _e('Description Format:', 'all_in_one_seo_pack')?>
2031
+ </a>
2032
+ </td>
2033
+ <td>
2034
+ <input size="59" name="aiosp_description_format" value="<?php echo stripcslashes($aioseop_options['aiosp_description_format']); ?>"/>
2035
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_description_format_tip">
2036
+ <?php
2037
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
2038
+ echo('<ul>');
2039
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2040
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2041
+ 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>');
2042
+ echo('<li>'); _e('%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack'); echo('</li>');
2043
+ echo('</ul>');
2044
+ ?>
2045
+ </div>
2046
+ </td>
2047
+ </tr>
2048
+
2049
+ <tr>
2050
+ <th scope="row" style="text-align:right; vertical-align:top;">
2051
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_404_title_format_tip');">
2052
+ <?php _e('404 Title Format:', 'all_in_one_seo_pack')?>
2053
+ </a>
2054
+ </td>
2055
+ <td>
2056
+ <input size="59" name="aiosp_404_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_404_title_format']); ?>"/>
2057
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_404_title_format_tip">
2058
+ <?php
2059
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
2060
+ echo('<ul>');
2061
+ echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2062
+ echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2063
+ echo('<li>'); _e('%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack'); echo('</li>');
2064
+ 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>');
2065
+ echo('<li>'); _e('%404_title% - Additional 404 title input"', 'all_in_one_seo_pack'); echo('</li>');
2066
+ echo('</ul>');
2067
+ ?>
2068
+ </div>
2069
+ </td>
2070
+ </tr>
2071
+
2072
+ <tr>
2073
+ <th scope="row" style="text-align:right; vertical-align:top;">
2074
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_paged_format_tip');">
2075
+ <?php _e('Paged Format:', 'all_in_one_seo_pack')?>
2076
+ </a>
2077
+ </td>
2078
+ <td>
2079
+ <input size="59" name="aiosp_paged_format" value="<?php echo stripcslashes($aioseop_options['aiosp_paged_format']); ?>"/>
2080
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_paged_format_tip">
2081
+ <?php
2082
+ _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');
2083
+ _e('The following macros are supported:', 'all_in_one_seo_pack');
2084
+ echo('<ul>');
2085
+ echo('<li>'); _e('%page% - The page number', 'all_in_one_seo_pack'); echo('</li>');
2086
+ echo('</ul>');
2087
+ ?>
2088
+ </div>
2089
+ </td>
2090
+ </tr>
2091
+
2092
+ <tr>
2093
+ <th scope="row" style="text-align:right; vertical-align:top;">
2094
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_enablecpost_tip');">
2095
+ <?php _e('SEO for Custom Post Types:', 'all_in_one_seo_pack')?>
2096
+ </td>
2097
+ <td>
2098
+ <input type="checkbox" name="aiosp_enablecpost" <?php if ($aioseop_options['aiosp_enablecpost']) echo "checked=\"1\""; ?>/>
2099
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_enablecpost_tip">
2100
+ <?php
2101
+ _e('Check this if you want your enable AIOSEOP support for Custom Post Types on this site.', 'all_in_one_seo_pack');
2102
+ ?>
2103
+ </div>
2104
+ </td>
2105
+ </tr>
2106
+ <tr>
2107
+ <th scope="row" style="text-align:right; vertical-align:top;">
2108
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('123_tip');">
2109
+ <?php _e('Custom Post Types for SEO Column Support:', 'all_in_one_seo_pack')?>
2110
+ </td>
2111
+ <td><select name="aiosp_posttypecolumns[]" MULTIPLE style="height:70px;width:300px;">
2112
+ <?php
2113
+ $typeswehave = array('post,revision'); //$aioseop_options['aiosp_posttypecolumns'];
2114
+ $post_types=get_post_types('','names');
2115
+ $rempost = array('attachment','revision','nav_menu_item');
2116
+ $post_types = array_diff($post_types,$rempost);
2117
+ foreach ($post_types as $post_type ) {
2118
+ echo "<option ";
2119
+ if(is_array($aioseop_options['aiosp_posttypecolumns']) && in_array($post_type,$aioseop_options['aiosp_posttypecolumns'])) echo "selected ";
2120
+ echo "name=\"aiosp_posttypecolumns\">$post_type";
2121
+ }
2122
+
2123
+ ?>
2124
+ </select>
2125
+
2126
+ <div style="max-width:500px; text-align:left; display:none" id="123_tip">
2127
+ <?php
2128
+ _e('Choose which post types you want to have SEO columns on the edit.php screen. You can select as many as you like.', 'all_in_one_seo_pack');
2129
+ ?>
2130
+ </div>
2131
+ </td>
2132
+ </tr>
2133
+ <tr>
2134
+ <th scope="row" style="text-align:right; vertical-align:top;">
2135
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_google_analytics_id_tip');">
2136
+ <?php _e('Google Analytics ID:', 'all_in_one_seo_pack')?>
2137
+ </td>
2138
+ <td>
2139
+ <input type="text" name="aiosp_google_analytics_id" value="<?php echo $aioseop_options['aiosp_google_analytics_id']; ?>" size="38"/>
2140
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_google_analytics_id_tip">
2141
+ <?php
2142
+ _e('Enter your Google Analytics ID here to track your site with Google Analytics.', 'all_in_one_seo_pack');
2143
+ ?>
2144
+ </div>
2145
+ </td>
2146
+ </tr>
2147
+ <?php
2148
+ if ( isset( $aioseop_options['aiosp_google_analytics_id'] ) && $aioseop_options['aiosp_google_analytics_id'] ) {
2149
+ ?>
2150
+ <tr>
2151
+ <th scope="row" style="text-align:right; vertical-align:top;">
2152
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ga_track_outbound_links_tip');">
2153
+ <?php _e('Track Outbound Links:', 'all_in_one_seo_pack')?>
2154
+ </td>
2155
+ <td>
2156
+ <input type="checkbox" name="aiosp_ga_track_outbound_links" <?php if ($aioseop_options['aiosp_ga_track_outbound_links']) echo "checked=\"1\""; ?>/>
2157
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_ga_track_outbound_links_tip">
2158
+ <?php
2159
+ _e('Add functionality to track outbound links with Google Analytics.', 'all_in_one_seo_pack');
2160
+ ?>
2161
+ </div>
2162
+ </td>
2163
+ </tr>
2164
+
2165
+ <?php
2166
+ }
2167
+ ?>
2168
+
2169
+ <tr>
2170
+ <th scope="row" style="text-align:right; vertical-align:top;">
2171
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_categories_tip');">
2172
+ <?php _e('Use Categories for META keywords:', 'all_in_one_seo_pack')?>
2173
+ </td>
2174
+ <td>
2175
+ <input type="checkbox" name="aiosp_use_categories" <?php if ($aioseop_options['aiosp_use_categories']) echo "checked=\"1\""; ?>/>
2176
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_categories_tip">
2177
+ <?php
2178
+ _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');
2179
+ ?>
2180
+ </div>
2181
+ </td>
2182
+ </tr>
2183
+
2184
+ <tr>
2185
+ <th scope="row" style="text-align:right; vertical-align:top;">
2186
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_tags_as_keywords_tip');">
2187
+ <?php _e('Use Tags for META keywords:', 'all_in_one_seo_pack')?>
2188
+ </td>
2189
+ <td>
2190
+ <input type="checkbox" name="aiosp_use_tags_as_keywords" <?php if ($aioseop_options['aiosp_use_tags_as_keywords']) echo "checked=\"1\""; ?>/>
2191
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_tags_as_keywords_tip">
2192
+ <?php
2193
+ _e('Check this if you want your tags for a given post used as the META keywords for this post (in addition to any keywords you specify on the post edit page).', 'all_in_one_seo_pack');
2194
+ ?>
2195
+ </div>
2196
+ </td>
2197
+ </tr>
2198
+
2199
+
2200
+
2201
+
2202
+ <tr>
2203
+ <th scope="row" style="text-align:right; vertical-align:top;">
2204
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_dynamic_postspage_keywords_tip');">
2205
+ <?php _e('Dynamically Generate Keywords for Posts Page:', 'all_in_one_seo_pack')?>
2206
+ </td>
2207
+ <td>
2208
+ <input type="checkbox" name="aiosp_dynamic_postspage_keywords" <?php if ($aioseop_options['aiosp_dynamic_postspage_keywords']) echo "checked=\"1\""; ?>/>
2209
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_dynamic_postspage_keywords_tip">
2210
+ <?php
2211
+ _e('Check this if you want your keywords on a custom posts page (set it in options->reading) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all_in_one_seo_pack');
2212
+ ?>
2213
+ </div>
2214
+ </td>
2215
+ </tr>
2216
+
2217
+ <tr>
2218
+ <th scope="row" style="text-align:right; vertical-align:top;">
2219
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_noindex_tip');">
2220
+ <?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
2221
+ </a>
2222
+ </td>
2223
+ <td>
2224
+ <input type="checkbox" name="aiosp_category_noindex" <?php if ($aioseop_options['aiosp_category_noindex']) echo "checked=\"1\""; ?>/>
2225
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_noindex_tip">
2226
+ <?php
2227
+ _e('Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2228
+ ?>
2229
+ </div>
2230
+ </td>
2231
+ </tr>
2232
+
2233
+ <tr>
2234
+ <th scope="row" style="text-align:right; vertical-align:top;">
2235
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_noindex_tip');">
2236
+ <?php _e('Use noindex for Archives:', 'all_in_one_seo_pack')?>
2237
+ </a>
2238
+ </td>
2239
+ <td>
2240
+ <input type="checkbox" name="aiosp_archive_noindex" <?php if ($aioseop_options['aiosp_archive_noindex']) echo "checked=\"1\""; ?>/>
2241
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_noindex_tip">
2242
+ <?php
2243
+ _e('Check this for excluding archive pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2244
+ ?>
2245
+ </div>
2246
+ </td>
2247
+ </tr>
2248
+
2249
+ <tr>
2250
+ <th scope="row" style="text-align:right; vertical-align:top;">
2251
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tags_noindex_tip');">
2252
+ <?php _e('Use noindex for Tag Archives:', 'all_in_one_seo_pack')?>
2253
+ </a>
2254
+ </td>
2255
+ <td>
2256
+ <input type="checkbox" name="aiosp_tags_noindex" <?php if ($aioseop_options['aiosp_tags_noindex']) echo "checked=\"1\""; ?>/>
2257
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_tags_noindex_tip">
2258
+ <?php
2259
+ _e('Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2260
+ ?>
2261
+ </div>
2262
+ </td>
2263
+ </tr>
2264
+
2265
+ <tr>
2266
+ <th scope="row" style="text-align:right; vertical-align:top;">
2267
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_generate_descriptions_tip');">
2268
+ <?php _e('Autogenerate Descriptions:', 'all_in_one_seo_pack')?>
2269
+ </a>
2270
+ </td>
2271
+ <td>
2272
+ <input type="checkbox" name="aiosp_generate_descriptions" <?php if ($aioseop_options['aiosp_generate_descriptions']) echo "checked=\"1\""; ?>/>
2273
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_generate_descriptions_tip">
2274
+ <?php
2275
+ _e("Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack');
2276
+ ?>
2277
+ </div>
2278
+ </td>
2279
+ </tr>
2280
+
2281
+ <tr>
2282
+ <th scope="row" style="text-align:right; vertical-align:top;">
2283
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_cap_cats_tip');">
2284
+ <?php _e('Capitalize Category Titles:', 'all_in_one_seo_pack')?>
2285
+ </a>
2286
+ </td>
2287
+ <td>
2288
+ <input type="checkbox" name="aiosp_cap_cats" <?php if ($aioseop_options['aiosp_cap_cats']) echo "checked=\"1\""; ?>/>
2289
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_cap_cats_tip">
2290
+ <?php
2291
+ _e("Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack');
2292
+ ?>
2293
+ </div>
2294
+ </td>
2295
+ </tr>
2296
+
2297
+ <!-- new crap start -->
2298
+ <tr>
2299
+ <th scope="row" style="text-align:right; vertical-align:top;">
2300
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ex_pages_tip');">
2301
+ <?php _e('Exclude Pages:', 'all_in_one_seo_pack')?>
2302
+ </a>
2303
+ </td>
2304
+ <td>
2305
+ <textarea cols="57" rows="2" name="aiosp_ex_pages"><?php
2306
+ if ( !isset( $aioseop_options['aiosp_ex_pages'] ) ) $aioseop_options['aiosp_ex_pages'] = '';
2307
+ echo stripcslashes($aioseop_options['aiosp_ex_pages']); ?></textarea>
2308
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_ex_pages_tip">
2309
+ <?php
2310
+ _e("Enter any comma separated pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: <em>/forum/,/contact/</em> For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is give forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage will be excluded from All in One SEO Pack.", 'all_in_one_seo_pack');
2311
+ ?>
2312
+ </div>
2313
+ </td>
2314
+ </tr>
2315
+ <!-- new crap end -->
2316
+
2317
+ <tr>
2318
+ <th scope="row" style="text-align:right; vertical-align:top;">
2319
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_meta_tags_tip');">
2320
+ <?php _e('Additional Post Headers:', 'all_in_one_seo_pack')?>
2321
+ </a>
2322
+ </td>
2323
+ <td>
2324
+ <textarea cols="57" rows="2" name="aiosp_post_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_post_meta_tags']); ?></textarea>
2325
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_meta_tags_tip">
2326
+ <?php
2327
+ _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');
2328
+ ?>
2329
+ </div>
2330
+ </td>
2331
+ </tr>
2332
+
2333
+ <tr>
2334
+ <th scope="row" style="text-align:right; vertical-align:top;">
2335
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_meta_tags_tip');">
2336
+ <?php _e('Additional Page Headers:', 'all_in_one_seo_pack')?>
2337
+ </a>
2338
+ </td>
2339
+ <td>
2340
+ <textarea cols="57" rows="2" name="aiosp_page_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_page_meta_tags']); ?></textarea>
2341
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_meta_tags_tip">
2342
+ <?php
2343
+ _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');
2344
+ ?>
2345
+ </div>
2346
+ </td>
2347
+ </tr>
2348
+
2349
+ <tr>
2350
+ <th scope="row" style="text-align:right; vertical-align:top;">
2351
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_meta_tags_tip');">
2352
+ <?php _e('Additional Home Headers:', 'all_in_one_seo_pack')?>
2353
+ </a>
2354
+ </td>
2355
+ <td>
2356
+ <textarea cols="57" rows="2" name="aiosp_home_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_home_meta_tags']); ?></textarea>
2357
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_meta_tags_tip">
2358
+ <?php
2359
+ _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');
2360
+ ?>
2361
+ </div>
2362
+ </td>
2363
+ </tr>
2364
+
2365
+ <tr>
2366
+ <th scope="row" style="text-align:right; vertical-align:top;">
2367
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'auto_social')?>" onclick="toggleVisibility('aiosp_do_log_tip');">
2368
+ <?php _e('Log important events:', 'all_in_one_seo_pack')?>
2369
+ </a>
2370
+ </td>
2371
+ <td>
2372
+ <input type="checkbox" name="aiosp_do_log" <?php if ($aioseop_options['aiosp_do_log']) echo "checked=\"1\""; ?>/>
2373
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_do_log_tip">
2374
+ <?php
2375
+ _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');
2376
+ ?>
2377
+ </div>
2378
+ </td>
2379
+ </tr>
2380
+
2381
+ <?php if ($aioseop_options['aiosp_donate']){?>
2382
+ <tr>
2383
+ <th scope="row" style="text-align:right; vertical-align:top;">
2384
+ <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
2385
+ <?php _e('Thank you for your donation:', 'all_in_one_seo_pack')?>
2386
+ </a>
2387
+ </td>
2388
+ <td>
2389
+ <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
2390
+ <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
2391
+ <?php _e('All donations support continued development of this free software.', 'all_in_one_seo_pack'); ?>
2392
+ </div>
2393
+ </td>
2394
+ </tr>
2395
+ <?php } ?>
2396
+
2397
+ </table>
2398
+ <p class="submit">
2399
+ <?php if($aioseop_options) { ?>
2400
+
2401
+ <input type="hidden" name="action" value="aiosp_update" />
2402
+ <input type="hidden" name="nonce-aioseop" value="<?php echo wp_create_nonce('aioseop-nonce'); ?>" />
2403
+ <input type="hidden" name="page_options" value="aiosp_home_description" />
2404
+ <input type="submit" class='button-primary' name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
2405
+ <input type="submit" class='button-primary' name="Submit_Default" value="<?php _e('Reset Settings to Defaults', 'all_in_one_seo_pack')?> &raquo;" />
2406
+ </p>
2407
+ <?php } ?>
2408
+
2409
+ <p><br />
2410
+ <strong><?php _e('Check out these other great plugins!','all_in_one_seo_pack'); ?></strong><br />
2411
+ <a href="http://semperfiwebdesign.com/custom-applications/sms-text-message/" title="SMS Text Message WordPress plugin">SMS Text Message</a> - <?php _e('sends SMS updates to your readers','all_in_one_seo_pack'); ?><br />
2412
+ <a href="http://semperfiwebdesign.com/custom-applications/wp-security-scan/" title="WordPress Security">WordPress Security Scan</a> - <?php _e('provides vital security for your WordPress site','all_in_one_seo_pack'); ?>
2413
+ </p>
2414
+ </form>
2415
+ </div>
2416
+ <?php
2417
+
2418
+ } // options_panel
2419
+
2420
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aioseop_functions.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  /** Ajax callback functions for quickedit functionality */
7
- add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta');
8
 
9
  if (!function_exists('aioseop_activate')) {
10
  function aioseop_activate() {
@@ -178,16 +178,16 @@ if (!function_exists('aioseop_addmycolumns')) {
178
  if (!function_exists('aioseop_mrt_pcolumns')) {
179
  function aioseop_mrt_pcolumns($aioseopc) {
180
  global $aioseop_options;
181
- $aioseopc['seotitle'] = __('SEO Title');
182
- if ($aioseop_options['aiosp_togglekeywords'] == '') $aioseopc['seokeywords'] = __('SEO Keywords');
183
- $aioseopc['seodesc'] = __('SEO Description');
184
- return $aioseopc;
185
  }
186
  }
187
 
188
  if (!function_exists('aioseop_admin_head')) {
189
  function aioseop_admin_head() {
190
- echo '<script type="text/javascript" src="' . AIOSEOP_PLUGIN_URL . 'quickedit_functions.js" ></script>';
191
  ?><style>
192
  .aioseop_edit_button {
193
  margin: 0 0 0 5px;
@@ -248,29 +248,15 @@ if (!function_exists('aioseop_ajax_save_meta')) {
248
 
249
  if (!function_exists('aioseop_mrt_pccolumn')) {
250
  function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
251
- $id = $aioseoppi;
252
- $target = null;
253
- if( $aioseopcn == 'seotitle' ) $target = 'title';
254
- if( $aioseopcn == 'seokeywords' ) $target = 'keywords';
255
- if( $aioseopcn == 'seodesc' ) $target = 'description';
256
- if ( !$target ) return;
257
- if( current_user_can( 'edit_post', $id ) ) { ?>
258
- <div class="aioseop_mpc_admin_meta_container">
259
- <div class="aioseop_mpc_admin_meta_options"
260
- id="aioseop_<?php print $target; ?>_<?php echo $id; ?>"
261
- style="float:left;">
262
- <?php $content = htmlspecialchars( stripcslashes( get_post_meta( $id, "_aioseop_" . $target, TRUE ) ) );
263
- if( !empty($content) ): $label = str_replace( "'", "\'", $content );
264
- else: $label = ''; $content = '<strong><i>No ' . $target . '</i></strong>' ; endif;
265
- print $content . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick="aioseop_ajax_edit_meta_form(' .
266
- $id . ', \'' . $label . '\', \'' . $target . '\');return false;" title="' . __('Edit') . '">';
267
- print "<img class='aioseop_edit_button'
268
- id='aioseop_edit_id'
269
- src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a>";
270
- ?>
271
- </div>
272
- </div>
273
- <?php }
274
  }
275
  }
276
 
4
  */
5
 
6
  /** Ajax callback functions for quickedit functionality */
7
+ //add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta');
8
 
9
  if (!function_exists('aioseop_activate')) {
10
  function aioseop_activate() {
178
  if (!function_exists('aioseop_mrt_pcolumns')) {
179
  function aioseop_mrt_pcolumns($aioseopc) {
180
  global $aioseop_options;
181
+ $aioseopc['seotitle'] = __('SEO Title');
182
+ $aioseopc['seokeywords'] = __('SEO Keywords');
183
+ $aioseopc['seodesc'] = __('SEO Description');
184
+ return $aioseopc;
185
  }
186
  }
187
 
188
  if (!function_exists('aioseop_admin_head')) {
189
  function aioseop_admin_head() {
190
+ // echo '<script type="text/javascript" src="' . AIOSEOP_PLUGIN_URL . 'quickedit_functions.js" ></script>';
191
  ?><style>
192
  .aioseop_edit_button {
193
  margin: 0 0 0 5px;
248
 
249
  if (!function_exists('aioseop_mrt_pccolumn')) {
250
  function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
251
+ if( $aioseopcn == 'seotitle' ) {
252
+ echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_title',TRUE)));
253
+ }
254
+ if( $aioseopcn == 'seokeywords' ) {
255
+ echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_keywords',TRUE)));
256
+ }
257
+ if( $aioseopcn == 'seodesc' ) {
258
+ echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_description',TRUE)));
259
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  }
261
  }
262
 
all_in_one_seo_pack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: All in One SEO Pack
4
  Plugin URI: http://semperfiwebdesign.com
5
  Description: Out-of-the-box SEO for your WordPress blog. <a href="options-general.php?page=all-in-one-seo-pack/aioseop.class.php">Options configuration panel</a> | <a href="http://wpplugins.com/plugin/50/all-in-one-seo-pack-pro-version">Upgrade to Pro Version</a> | <a 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">Donate</a> | <a href="http://semperfiwebdesign.com/forum/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
6
- Version: 1.6.14.1
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
@@ -30,11 +30,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
- * @version 1.6.14.1
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
- define( 'AIOSEOP_VERSION', '1.6.14.1' );
38
 
39
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) )
40
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
3
  Plugin Name: All in One SEO Pack
4
  Plugin URI: http://semperfiwebdesign.com
5
  Description: Out-of-the-box SEO for your WordPress blog. <a href="options-general.php?page=all-in-one-seo-pack/aioseop.class.php">Options configuration panel</a> | <a href="http://wpplugins.com/plugin/50/all-in-one-seo-pack-pro-version">Upgrade to Pro Version</a> | <a 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">Donate</a> | <a href="http://semperfiwebdesign.com/forum/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
6
+ Version: 1.6.14.3
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
+ * @version 1.6.14.3
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
+ define( 'AIOSEOP_VERSION', '1.6.14.3' );
38
 
39
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) )
40
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
images/WD_wordpress_450x50.gif ADDED
Binary file
images/hub_420_wordpress.png ADDED
Binary file
images/themefuse_banner_a.jpg ADDED
Binary file
images/themefuse_banner_b.jpg ADDED
Binary file