All in One SEO Pack - Version 1.6.14.4

Version Description

Download this release

Release Info

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

Code changes from version 1.6.14.3 to 1.6.14.4

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