All in One SEO Pack - Version 2.0.2

Version Description

Download this release

Release Info

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

Code changes from version 2.0.1 to 2.0.2

aioseop_class.php CHANGED
@@ -291,6 +291,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
291
  'name' => __( 'Google Plus Default Profile:', 'all_in_one_seo_pack' ),
292
  'help_text' => __( 'Enter your Google Plus Profile URL here to link your site\'s pages to Google Plus.', 'all_in_one_seo_pack' ),
293
  'default' => '', 'type' => 'text' ),
 
 
 
 
294
  "google_analytics_id"=> Array(
295
  'name' => __( 'Google Analytics ID:', 'all_in_one_seo_pack' ),
296
  'help_text' => __( 'Enter your Google Analytics ID here to track your site with Google Analytics.', 'all_in_one_seo_pack' ),
@@ -341,6 +345,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
341
  'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ),
342
  'help_text' => __( "Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack' ),
343
  'default' => 1),
 
 
 
 
344
  "unprotect_meta"=> Array(
345
  'name' => __( 'Unprotect Post Meta Fields:', 'all_in_one_seo_pack' ),
346
  'help_text' => __( "Unprotect internal postmeta fields for use with XMLRPC -- if you don't know what that is, leave it unchecked.", 'all_in_one_seo_pack' ),
@@ -427,7 +435,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
427
  ),
428
  'google' => Array(
429
  'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
430
- 'options' => Array( "google_publisher", "google_analytics_id", "ga_domain", "ga_multi_domain", "ga_track_outbound_links" )
431
  ),
432
  'noindex' => Array(
433
  'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
@@ -435,7 +443,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
435
  ),
436
  'advanced' => Array(
437
  'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
438
- 'options' => Array( 'generate_descriptions', 'unprotect_meta', 'ex_pages', 'post_meta_tags', 'page_meta_tags', 'front_meta_tags', 'home_meta_tags' )
439
  )
440
  );
441
 
@@ -443,11 +451,13 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
443
  foreach( $this->layout as $k => $v )
444
  $other_options = array_merge( $other_options, $v['options'] );
445
 
446
- $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
447
-
448
- add_action( "aioseop_global_settings_header", Array( $this, 'display_right_sidebar' ) );
449
- add_action( "aioseop_global_settings_footer", Array( $this, 'display_settings_footer' ) );
450
- add_action( "output_option", Array( $this, 'custom_output_option' ), 10, 2 );
 
 
451
  }
452
 
453
  /*** Use custom callback for outputting snippet ***/
@@ -459,18 +469,28 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
459
  $p = $post; $w = $wp_query;
460
  if (! $post->post_modified_gmt != '' )
461
  $wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );
462
- if ( $post->post_type == 'page' ) $wp_query->is_page = true;
 
 
 
 
 
 
 
 
 
 
 
463
 
464
  $args['options']['type'] = 'html';
465
  $args['options']['nowrap'] = false;
466
  $args['options']['save'] = false;
467
 
468
- $title = false;
469
  $title = $this->wp_title();
470
- if ( !$title ) $title = $post->post_title;
471
 
472
  if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) )
473
- $url = apply_filters( 'aioseop_canonical_url',$url );
474
  if ( !$url ) $url = get_permalink();
475
 
476
  $description = $this->get_post_description( $post );
@@ -478,7 +498,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
478
  if ( strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
479
  if ( strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
480
 
481
- $args['value'] = sprintf( $args['value'], $title, $url, $description );
482
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
483
 
484
  wp_reset_postdata();
@@ -488,10 +508,115 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
488
  return $buf;
489
  }
490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  function add_page_hooks() {
492
  $post_objs = get_post_types( '', 'objects' );
493
  $pt = array_keys( $post_objs );
494
- $rempost = array( 'attachment', 'revision', 'nav_menu_item' );
495
  $pt = array_diff( $pt, $rempost );
496
  $post_types = Array();
497
  foreach ( $pt as $p ) {
@@ -527,17 +652,30 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
527
  $this->layout['cpt']['options'][] = $field;
528
  }
529
  }
530
-
531
- $this->pointers['aioseop_welcome_201'] = Array( 'pointer_target' => '#aiosp_settings_form',
532
- 'pointer_text' => '<h3>' . sprintf( __( 'Welcome to Version %s!', 'all_in_one_seo_pack' ), AIOSEOP_VERSION )
533
- . '</h3><p>' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! New in 2.0: manage your performance with our Performance module; enable it from our new feature manager! And please review your settings, we have added some new ones!', 'all_in_one_seo_pack' ) . '</p>'
534
- );
535
-
536
  $this->setting_options();
537
  add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 3 );
538
  parent::add_page_hooks();
539
  }
540
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541
  function settings_page_init() {
542
  add_filter( "{$this->prefix}submit_options", Array( $this, 'filter_submit' ) );
543
  }
@@ -761,7 +899,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
761
 
762
  if ( is_admin() ) {
763
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
764
- add_action( 'admin_head', 'aioseop_option_page_icon' );
765
  add_action( 'admin_init', 'aioseop_addmycolumns', 1 );
766
  } else {
767
  if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' )
@@ -860,30 +998,33 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
860
  if ( $page_for_posts && ( !is_object( $post ) || ( $page_for_posts != $post->ID ) ) && is_home() )
861
  $blog_page = get_post( $page_for_posts );
862
 
863
- if ( $is_front_page_keywords ) {
864
  $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );
865
- } 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
866
  $keywords = stripcslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_keywords", true ) ) );
867
- } elseif ( $blog_page ) {
868
  $keywords = stripcslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) );
869
- } else {
870
- $keywords = $this->get_all_keywords();
871
- }
872
- if ( is_single() || is_page() || is_home() || $this->is_static_posts_page() )
 
 
 
 
 
 
 
 
 
873
  if ( $this->is_static_front_page() )
874
  $description = trim( stripcslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
875
- elseif ( $blog_page )
876
  $description = $this->get_post_description( $blog_page );
877
- else if ( $is_front_page )
878
- $description = trim( stripcslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
879
- else if ( is_category() )
880
- $description = $this->internationalize( category_description() );
881
-
882
- if ( empty( $description ) && is_object( $post ) )
883
  $description = $this->get_post_description( $post );
884
 
885
- if ( !empty( $description ) )
886
- $description = apply_filters( 'aioseop_description', $description );
887
 
888
  if ( isset($description) && (strlen($description) > $this->minimum_description_length ) && !( $is_front_page && is_paged() ) ) {
889
  $description = trim( strip_tags( $description ) );
@@ -975,15 +1116,14 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
975
  $meta_string .= $post_meta;
976
  }
977
 
978
- if ( !empty( $post ) && isset( $post->post_author ) )
979
  $googleplus = get_the_author_meta( 'googleplus', $post->post_author );
980
 
981
  if ( empty( $googleplus ) && !empty( $aioseop_options['aiosp_google_publisher'] ) )
982
  $googleplus = $aioseop_options['aiosp_google_publisher'];
983
 
984
  if ( $is_front_page && !empty( $aioseop_options['aiosp_google_publisher'] ) )
985
- $meta_string = '<link rel="publisher" href="' . $aioseop_options['aiosp_google_publisher'] . '" />' . "\n" . $meta_string;
986
-
987
  if ( is_singular() && ( $googleplus ) ) {
988
  $meta_string = '<link rel="author" href="' . $googleplus . '" />' . "\n" . $meta_string;
989
  } else if ( !empty( $aioseop_options['aiosp_google_publisher'] ) ) {
@@ -1078,9 +1218,9 @@ function aiosp_google_analytics() {
1078
  // Thank you, Yoast de Valk, for much of this code.
1079
 
1080
  function aiosp_mrt_get_url( $query ) {
1081
- if ( $query->is_404 || $query->is_search ) {
1082
  return false;
1083
- }
1084
  $haspost = count( $query->posts ) > 0;
1085
 
1086
  if ( get_query_var( 'm' ) ) {
@@ -1095,20 +1235,16 @@ function aiosp_google_analytics() {
1095
  } elseif ( ( $query->is_single || $query->is_page ) && $haspost ) {
1096
  $post = $query->posts[0];
1097
  $link = get_permalink( $post->ID );
1098
- $link = $this->yoast_get_paged( $link );
1099
  } elseif ( $query->is_author && $haspost ) {
1100
  $author = get_userdata( get_query_var( 'author' ) );
1101
  if ($author === false) return false;
1102
  $link = get_author_posts_url( $author->ID, $author->user_nicename );
1103
  } elseif ( $query->is_category && $haspost ) {
1104
  $link = get_category_link( get_query_var( 'cat' ) );
1105
- $link = $this->yoast_get_paged( $link );
1106
- } else if ( $query->is_tag && $haspost ) {
1107
  $tag = get_term_by( 'slug', get_query_var( 'tag' ), 'post_tag' );
1108
- if ( !empty( $tag->term_id ) ) {
1109
  $link = get_tag_link( $tag->term_id );
1110
- }
1111
- $link = $this->yoast_get_paged( $link );
1112
  } elseif ( $query->is_day && $haspost ) {
1113
  $link = get_day_link( get_query_var( 'year' ),
1114
  get_query_var( 'monthnum' ),
@@ -1122,53 +1258,71 @@ function aiosp_google_analytics() {
1122
  if ( (get_option( 'show_on_front' ) == 'page' ) &&
1123
  ( $pageid = get_option( 'page_for_posts' ) ) ) {
1124
  $link = get_permalink( $pageid );
1125
- $link = $this->yoast_get_paged( $link );
1126
- $link = trailingslashit( $link );
1127
  } else {
1128
  if ( function_exists( 'icl_get_home_url' ) ) {
1129
  $link = icl_get_home_url();
1130
  } else {
1131
  $link = get_option( 'home' );
1132
  }
1133
- $link = $this->yoast_get_paged( $link );
1134
- $link = trailingslashit( $link );
1135
  }
1136
  } elseif ( $query->is_tax && $haspost ) {
1137
  $taxonomy = get_query_var( 'taxonomy' );
1138
  $term = get_query_var( 'term' );
1139
  $link = get_term_link( $term, $taxonomy );
1140
- $link = $this->yoast_get_paged( $link );
1141
  } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
1142
  $link = get_post_type_archive_link( $post_type );
1143
  } else {
1144
  return false;
1145
  }
1146
-
1147
- return $link;
 
 
 
 
 
 
1148
  }
1149
 
1150
  function yoast_get_paged( $link ) {
1151
- $page = get_query_var( 'page' );
1152
- if ( $page && $page > 1 ) {
1153
  $link = trailingslashit( $link ) ."page/". "$page";
1154
  $link = user_trailingslashit( $link, 'paged' );
1155
  }
1156
  return $link;
1157
  }
1158
 
 
 
 
 
 
 
 
 
 
 
1159
  function get_post_description( $post ) {
1160
  global $aioseop_options;
 
 
 
 
1161
  $description = trim( stripcslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
1162
  if ( !$description ) {
1163
  $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
1164
- if ( !$description && $aioseop_options["aiosp_generate_descriptions"] )
1165
- $description = $this->trim_excerpt_without_filters( $this->internationalize( $post->post_content ) );
 
1166
  }
 
1167
  // "internal whitespace trim"
1168
  $description = preg_replace( "/\s\s+/u", " ", $description );
1169
  return $description;
1170
  }
1171
 
 
1172
  function replace_title( $content, $title ) {
1173
  $title = trim( strip_tags( $title ) );
1174
  $title_tag_start = "<title>";
@@ -1294,6 +1448,46 @@ function aiosp_google_analytics() {
1294
  return $title;
1295
  }
1296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1297
  /*** Gets the title that will be used by AIOSEOP for title rewrites or returns false. ***/
1298
  function get_aioseop_title( $post ) {
1299
  global $aioseop_options;
@@ -1303,17 +1497,26 @@ function aiosp_google_analytics() {
1303
  $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
1304
  if ( empty( $title ) && !empty( $post ) && $this->is_static_front_page() ) {
1305
  $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
1306
- if ( !$title )
1307
  $title = $this->internationalize( $post->post_title );
1308
- if ( !$title )
1309
  $title = $this->internationalize( $this->get_original_title( '', false ) );
 
 
1310
  }
1311
  if (empty( $title ) )
1312
  $title = $this->internationalize( get_option( 'blogname' ) );
1313
  return $this->paged_title( $title );
1314
  } else if ( is_attachment() ) {
1315
  if ( $post === null ) return false;
1316
- return get_the_title( $post->post_parent ) . ' ' . $post->post_title . ' ' . get_option( 'blogname' );
 
 
 
 
 
 
 
1317
  } else if ( is_page() || $this->is_static_posts_page() || ( is_home() && !$this->is_static_posts_page() ) ) {
1318
  if ( $post === null ) return false;
1319
  // we're not in the loop :(
@@ -1323,9 +1526,8 @@ function aiosp_google_analytics() {
1323
  return apply_filters( 'aioseop_home_page_title', $home_title );
1324
  } else {
1325
  $page_for_posts = '';
1326
- if ( is_home() ) {
1327
  $page_for_posts = get_option( 'page_for_posts' );
1328
- }
1329
  if ( $page_for_posts ) {
1330
  $title = $this->internationalize( get_post_meta( $page_for_posts, "_aioseop_title", true ) );
1331
  if ( !$title ) {
@@ -1340,15 +1542,7 @@ function aiosp_google_analytics() {
1340
  if ( !$title )
1341
  $title = $this->internationalize( $this->get_original_title( '', false ) );
1342
 
1343
- $title_format = $aioseop_options['aiosp_page_title_format'];
1344
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1345
- $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1346
- $new_title = str_replace( '%page_title%', $title, $new_title );
1347
- $new_title = str_replace( '%page_author_login%', $authordata->user_login, $new_title );
1348
- $new_title = str_replace( '%page_author_nicename%', $authordata->user_nicename, $new_title );
1349
- $new_title = str_replace( '%page_author_firstname%', ucwords($authordata->first_name ), $new_title );
1350
- $new_title = str_replace( '%page_author_lastname%', ucwords($authordata->last_name ), $new_title );
1351
- $title = trim( $new_title );
1352
  $title = $this->paged_title( $title );
1353
  $title = apply_filters( 'aioseop_title_page', $title );
1354
  if ( $this->is_static_posts_page() )
@@ -1369,18 +1563,9 @@ function aiosp_google_analytics() {
1369
  $title = $this->internationalize( get_post_meta( $post->ID, "title_tag", true ) );
1370
  if ( !$title ) $title = $this->internationalize($this->get_original_title( '', false ) );
1371
  }
1372
- $title_format = $aioseop_options['aiosp_post_title_format'];
1373
- if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostadvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {
1374
- $wp_post_types = $aioseop_options['aiosp_cpostactive'];
1375
- if ( is_singular( $wp_post_types ) && !empty( $aioseop_options["aiosp_cposttitles"] ) ) {
1376
- $post_type = get_post_type();
1377
- if ( !empty( $aioseop_options["aiosp_{$post_type}_title_format"] ) )
1378
- $title_format = $aioseop_options["aiosp_{$post_type}_title_format"];
1379
- }
1380
- }
1381
- $r_title = array( '%blog_title%', '%blog_description%', '%post_title%', '%category%', '%category_title%', '%post_author_login%', '%post_author_nicename%', '%post_author_firstname%', '%post_author_lastname%' );
1382
- $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 ) );
1383
- $title = trim( str_replace( $r_title, $d_title, $title_format ) );
1384
  $title = $this->paged_title( $title );
1385
  return apply_filters( 'aioseop_title_single', $title );
1386
  } else if ( is_search() && isset( $s ) && !empty( $s ) ) {
@@ -1392,20 +1577,6 @@ function aiosp_google_analytics() {
1392
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1393
  $title = str_replace( '%search%', $search, $title);
1394
  return $title;
1395
- } else if ( ( is_tax() || is_category() ) && !is_feed() ) {
1396
- $category_description = $this->internationalize( category_description() );
1397
- if( !empty( $aioseop_options['aiosp_cap_cats'] ) ) {
1398
- $category_name = ucwords( $this->internationalize( single_cat_title( '', false ) ) );
1399
- } else {
1400
- $category_name = $this->internationalize( single_cat_title( '', false ) );
1401
- }
1402
- $title_format = $aioseop_options['aiosp_category_title_format'];
1403
- $title = str_replace( '%category_title%', $category_name, $title_format );
1404
- $title = str_replace( '%category_description%', $category_description, $title );
1405
- $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
1406
- $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1407
- $title = $this->paged_title( $title );
1408
- return $title;
1409
  } else if ( is_tag() ) {
1410
  global $utw;
1411
  if ( $utw ) {
@@ -1426,6 +1597,20 @@ function aiosp_google_analytics() {
1426
  $title = $this->paged_title( $title );
1427
  return $title;
1428
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1429
  } else if ( isset( $STagging ) && $STagging->is_tag_view() ) { // simple tagging support
1430
  $tag = $STagging->search_tag;
1431
  if ( $tag ) {
@@ -1461,9 +1646,11 @@ function aiosp_google_analytics() {
1461
 
1462
  /*** Used to filter wp_title(), get our title. ***/
1463
  function wp_title() {
 
1464
  $title = false;
1465
  $post = $this->get_queried_object();
1466
- $title = $this->get_aioseop_title( $post );
 
1467
  if ( $title === false )
1468
  $title = $this->get_original_title();
1469
  return apply_filters( 'aioseop_title', $title );
@@ -1553,8 +1740,13 @@ function aiosp_google_analytics() {
1553
  // custom field keywords
1554
  $keywords_i = null;
1555
 
1556
- $id = ( is_attachment() ) ? ( $post->post_parent ) : ( $post->ID ); // if attachment then use parent post id
1557
- $keywords_i = stripcslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
 
 
 
 
 
1558
  $keywords_i = str_replace( '"', '', $keywords_i );
1559
  if (isset( $keywords_i ) && !empty( $keywords_i ) ) {
1560
  $traverse = explode( ',', $keywords_i );
@@ -1699,10 +1891,16 @@ function aiosp_google_analytics() {
1699
  $url = menu_page_url( $menu_slug, 0 );
1700
  else
1701
  $url = esc_url( admin_url( 'admin.php?page=' . $menu_slug ) );
1702
- $wp_admin_bar->add_menu( array( 'id' => AIOSEOP_PLUGIN_DIRNAME, 'title' => __( 'AIOSEOP', 'all_in_one_seo_pack' ), 'href' => $url ) );
 
1703
  $aioseop_admin_menu = 1;
1704
  }
1705
  }
 
 
 
 
 
1706
 
1707
  function menu_order() {
1708
  return 5;
@@ -1721,6 +1919,12 @@ function aiosp_google_analytics() {
1721
 
1722
  $this->update_options( );
1723
 
 
 
 
 
 
 
1724
  $donated = false;
1725
  if ( ( isset( $_POST ) ) && ( isset( $_POST['module'] ) ) && ( isset( $_POST['nonce-aioseop'] ) ) && ( $_POST['module'] == 'All_in_One_SEO_Pack' ) && ( wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) ) {
1726
  if ( isset( $_POST["aiosp_donate"] ) )
291
  'name' => __( 'Google Plus Default Profile:', 'all_in_one_seo_pack' ),
292
  'help_text' => __( 'Enter your Google Plus Profile URL here to link your site\'s pages to Google Plus.', 'all_in_one_seo_pack' ),
293
  'default' => '', 'type' => 'text' ),
294
+ "google_disable_profile"=> Array(
295
+ 'name' => __( 'Disable Google Plus Profile:', 'all_in_one_seo_pack' ),
296
+ 'help_text' => __( 'Check this option to remove the Google Plus Profile field on user profile pages.', 'all_in_one_seo_pack' ),
297
+ 'default' => 0, 'type' => 'checkbox' ),
298
  "google_analytics_id"=> Array(
299
  'name' => __( 'Google Analytics ID:', 'all_in_one_seo_pack' ),
300
  'help_text' => __( 'Enter your Google Analytics ID here to track your site with Google Analytics.', 'all_in_one_seo_pack' ),
345
  'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ),
346
  'help_text' => __( "Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack' ),
347
  'default' => 1),
348
+ "hide_paginated_descriptions"=> Array(
349
+ 'name' => __( 'Remove Descriptions For Paginated Pages:', 'all_in_one_seo_pack' ),
350
+ 'help_text' => __( "Check this and your META descriptions will get hidden if on Page 2 or later of paginated content.", 'all_in_one_seo_pack' ),
351
+ 'default' => 0),
352
  "unprotect_meta"=> Array(
353
  'name' => __( 'Unprotect Post Meta Fields:', 'all_in_one_seo_pack' ),
354
  'help_text' => __( "Unprotect internal postmeta fields for use with XMLRPC -- if you don't know what that is, leave it unchecked.", 'all_in_one_seo_pack' ),
435
  ),
436
  'google' => Array(
437
  'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
438
+ 'options' => Array( "google_publisher", "google_disable_profile", "google_analytics_id", "ga_domain", "ga_multi_domain", "ga_track_outbound_links" )
439
  ),
440
  'noindex' => Array(
441
  'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
443
  ),
444
  'advanced' => Array(
445
  'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
446
+ 'options' => Array( 'generate_descriptions', 'hide_paginated_descriptions', 'unprotect_meta', 'ex_pages', 'post_meta_tags', 'page_meta_tags', 'front_meta_tags', 'home_meta_tags' )
447
  )
448
  );
449
 
451
  foreach( $this->layout as $k => $v )
452
  $other_options = array_merge( $other_options, $v['options'] );
453
 
454
+ $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
455
+
456
+ if ( is_admin() ) {
457
+ add_action( "aioseop_global_settings_header", Array( $this, 'display_right_sidebar' ) );
458
+ add_action( "aioseop_global_settings_footer", Array( $this, 'display_settings_footer' ) );
459
+ add_action( "output_option", Array( $this, 'custom_output_option' ), 10, 2 );
460
+ }
461
  }
462
 
463
  /*** Use custom callback for outputting snippet ***/
469
  $p = $post; $w = $wp_query;
470
  if (! $post->post_modified_gmt != '' )
471
  $wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );
472
+ if ( $post->post_type == 'page' )
473
+ $wp_query->is_page = true;
474
+ elseif ( $post->post_type == 'attachment' )
475
+ $wp_query->is_attachment = true;
476
+ else
477
+ $wp_query->is_single = true;
478
+ if ( get_option( 'show_on_front' ) == 'page' ) {
479
+ if ( is_page() && $post->ID == get_option( 'page_on_front' ) )
480
+ $wp_query->is_front_page = true;
481
+ elseif ( $post->ID == get_option( 'page_for_posts' ) )
482
+ $wp_query->is_home = true;
483
+ }
484
 
485
  $args['options']['type'] = 'html';
486
  $args['options']['nowrap'] = false;
487
  $args['options']['save'] = false;
488
 
 
489
  $title = $this->wp_title();
490
+ if ( empty( $title ) ) $title = $post->post_title;
491
 
492
  if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) )
493
+ $url = apply_filters( 'aioseop_canonical_url', $url );
494
  if ( !$url ) $url = get_permalink();
495
 
496
  $description = $this->get_post_description( $post );
498
  if ( strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
499
  if ( strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
500
 
501
+ $args['value'] = sprintf( $args['value'], esc_attr( strip_tags( $title ) ), esc_url( $url ), esc_attr( strip_tags( $description ) ) );
502
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
503
 
504
  wp_reset_postdata();
508
  return $buf;
509
  }
510
 
511
+ function add_page_icon() {
512
+ wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
513
+ wp_enqueue_style( 'wp-pointer' );
514
+ $this->add_admin_pointers();
515
+ ?>
516
+ <style>
517
+ #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
518
+ background: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield-sprite-16.png) no-repeat 6px 6px !important;
519
+ }
520
+ #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img {
521
+ display: none;
522
+ }
523
+ #toplevel_page_all-in-one-seo-pack-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-aioseop_class.wp-has-current-submenu .wp-menu-image {
524
+ background-position: 6px -26px !important;
525
+ }
526
+ #icon-aioseop.icon32 {
527
+ background: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield32.png) no-repeat left top !important;
528
+ }
529
+ #aioseop_settings_header #message {
530
+ padding: 5px 0px 5px 50px;
531
+ background-image: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>update32.png);
532
+ background-repeat: no-repeat;
533
+ background-position: 10px;
534
+ font-size: 14px;
535
+ min-height: 32px;
536
+ }
537
+
538
+ @media
539
+ only screen and (-webkit-min-device-pixel-ratio: 1.5),
540
+ only screen and ( min--moz-device-pixel-ratio: 1.5),
541
+ only screen and ( -o-min-device-pixel-ratio: 3/2),
542
+ only screen and ( min-device-pixel-ratio: 1.5),
543
+ only screen and ( min-resolution: 1.5dppx) {
544
+
545
+ #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
546
+ background-image: url('<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield-sprite-32.png') !important;
547
+ -webkit-background-size: 16px 48px !important;
548
+ -moz-background-size: 16px 48px !important;
549
+ background-size: 16px 48px !important;
550
+ }
551
+
552
+ #icon-aioseop.icon32 {
553
+ background-image: url('<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield64.png') !important;
554
+ -webkit-background-size: 32px 32px !important;
555
+ -moz-background-size: 32px 32px !important;
556
+ background-size: 32px 32px !important;
557
+ }
558
+
559
+ #aioseop_settings_header #message {
560
+ background-image: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>update64.png) !important;
561
+ -webkit-background-size: 32px 32px !important;
562
+ -moz-background-size: 32px 32px !important;
563
+ background-size: 32px 32px !important;
564
+ }
565
+ }
566
+ </style>
567
+ <script>
568
+ function aioseop_show_pointer( handle, value ) {
569
+ if ( typeof( jQuery ) != 'undefined' ) {
570
+ var p_edge = 'bottom';
571
+ var p_align = 'center';
572
+ if ( typeof( jQuery( value.pointer_target ).pointer) != 'undefined' ) {
573
+ if ( typeof( value.pointer_edge ) != 'undefined' ) p_edge = value.pointer_edge;
574
+ if ( typeof( value.pointer_align ) != 'undefined' ) p_align = value.pointer_align;
575
+ jQuery(value.pointer_target).pointer({
576
+ content : value.pointer_text,
577
+ position: {
578
+ edge: p_edge,
579
+ align: p_align
580
+ },
581
+ close : function() {
582
+ jQuery.post( ajaxurl, {
583
+ pointer: handle,
584
+ action: 'dismiss-wp-pointer'
585
+ });
586
+ }
587
+ }).pointer('open');
588
+ }
589
+ }
590
+ }
591
+ <?php
592
+ if ( !empty( $this->pointers ) ) {
593
+ ?>
594
+ if ( typeof( jQuery ) != 'undefined' ) {
595
+ jQuery(document).ready(function() {
596
+ var admin_pointer;
597
+ var admin_index;
598
+ <?php
599
+ foreach( $this->pointers as $k => $p )
600
+ if ( !empty( $p["pointer_scope"] ) && ( $p["pointer_scope"] == 'global' ) ) {
601
+ ?>admin_index = "<?php echo esc_attr($k); ?>";
602
+ admin_pointer = <?php echo json_encode( $p ); ?>;
603
+ aioseop_show_pointer( admin_index, admin_pointer );
604
+ <?php
605
+ }
606
+ ?>
607
+ });
608
+ }
609
+ <?php
610
+ }
611
+ ?>
612
+ </script>
613
+ <?php
614
+ }
615
+
616
  function add_page_hooks() {
617
  $post_objs = get_post_types( '', 'objects' );
618
  $pt = array_keys( $post_objs );
619
+ $rempost = array( 'revision', 'nav_menu_item' );
620
  $pt = array_diff( $pt, $rempost );
621
  $post_types = Array();
622
  foreach ( $pt as $p ) {
652
  $this->layout['cpt']['options'][] = $field;
653
  }
654
  }
655
+
 
 
 
 
 
656
  $this->setting_options();
657
  add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 3 );
658
  parent::add_page_hooks();
659
  }
660
 
661
+ function add_admin_pointers() {
662
+ $this->pointers['aioseop_menu_202'] = Array( 'pointer_target' => '#toplevel_page_all-in-one-seo-pack-aioseop_class',
663
+ 'pointer_text' => '<h3>' . sprintf( __( 'Welcome to Version %s!', 'all_in_one_seo_pack' ), AIOSEOP_VERSION )
664
+ . '</h3><p>' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! Please review your settings, as we\'re always adding new features for you!', 'all_in_one_seo_pack' ) . '</p>',
665
+ 'pointer_edge' => 'top',
666
+ 'pointer_align' => 'left',
667
+ 'pointer_scope' => 'global'
668
+ );
669
+ $this->pointers['aioseop_welcome_202'] = Array( 'pointer_target' => '#aioseop_top_button',
670
+ 'pointer_text' => '<h3>' . sprintf( __( 'Review Your Settings', 'all_in_one_seo_pack' ), AIOSEOP_VERSION )
671
+ . '</h3><p>' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! New in 2.0: manage your performance with our Performance module; enable it from our new feature manager! And please review your settings, we have added some new ones!', 'all_in_one_seo_pack' ) . '</p>',
672
+ 'pointer_edge' => 'bottom',
673
+ 'pointer_align' => 'left',
674
+ 'pointer_scope' => 'local'
675
+ );
676
+ $this->filter_pointers();
677
+ }
678
+
679
  function settings_page_init() {
680
  add_filter( "{$this->prefix}submit_options", Array( $this, 'filter_submit' ) );
681
  }
899
 
900
  if ( is_admin() ) {
901
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
902
+ add_action( 'admin_head', array( $this, 'add_page_icon' ) );
903
  add_action( 'admin_init', 'aioseop_addmycolumns', 1 );
904
  } else {
905
  if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' )
998
  if ( $page_for_posts && ( !is_object( $post ) || ( $page_for_posts != $post->ID ) ) && is_home() )
999
  $blog_page = get_post( $page_for_posts );
1000
 
1001
+ if ( $is_front_page_keywords )
1002
  $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );
1003
+ 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
1004
  $keywords = stripcslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_keywords", true ) ) );
1005
+ elseif ( !empty( $blog_page ) && !$aioseop_options['aiosp_dynamic_postspage_keywords'] )
1006
  $keywords = stripcslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) );
1007
+ else $keywords = $this->get_all_keywords();
1008
+
1009
+ if ( is_category() && $this->show_page_description() )
1010
+ $description = $this->internationalize( category_description() );
1011
+ elseif ( is_tag() && $this->show_page_description() )
1012
+ $description = $this->internationalize( tag_description() );
1013
+ elseif ( is_tax() && $this->show_page_description() )
1014
+ $description = $this->internationalize( term_description() );
1015
+ elseif ( is_author() && $this->show_page_description() )
1016
+ $description = $this->internationalize( get_the_author_meta( 'description' ) );
1017
+ else if ( $is_front_page )
1018
+ $description = trim( stripcslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
1019
+ else if ( is_single() || is_page() || is_home() || $this->is_static_posts_page() )
1020
  if ( $this->is_static_front_page() )
1021
  $description = trim( stripcslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
1022
+ elseif ( !empty( $blog_page ) )
1023
  $description = $this->get_post_description( $blog_page );
1024
+ if ( empty( $description ) && is_object( $post ) && !is_archive() && empty( $blog_page ) )
 
 
 
 
 
1025
  $description = $this->get_post_description( $post );
1026
 
1027
+ $description = apply_filters( 'aioseop_description', $description );
 
1028
 
1029
  if ( isset($description) && (strlen($description) > $this->minimum_description_length ) && !( $is_front_page && is_paged() ) ) {
1030
  $description = trim( strip_tags( $description ) );
1116
  $meta_string .= $post_meta;
1117
  }
1118
 
1119
+ if ( !empty( $post ) && isset( $post->post_author ) && empty( $aioseop_options['aiosp_google_disable_profile'] ) )
1120
  $googleplus = get_the_author_meta( 'googleplus', $post->post_author );
1121
 
1122
  if ( empty( $googleplus ) && !empty( $aioseop_options['aiosp_google_publisher'] ) )
1123
  $googleplus = $aioseop_options['aiosp_google_publisher'];
1124
 
1125
  if ( $is_front_page && !empty( $aioseop_options['aiosp_google_publisher'] ) )
1126
+ $meta_string = '<link rel="publisher" href="' . $aioseop_options['aiosp_google_publisher'] . '" />' . "\n" . $meta_string;
 
1127
  if ( is_singular() && ( $googleplus ) ) {
1128
  $meta_string = '<link rel="author" href="' . $googleplus . '" />' . "\n" . $meta_string;
1129
  } else if ( !empty( $aioseop_options['aiosp_google_publisher'] ) ) {
1218
  // Thank you, Yoast de Valk, for much of this code.
1219
 
1220
  function aiosp_mrt_get_url( $query ) {
1221
+ if ( $query->is_404 || $query->is_search )
1222
  return false;
1223
+
1224
  $haspost = count( $query->posts ) > 0;
1225
 
1226
  if ( get_query_var( 'm' ) ) {
1235
  } elseif ( ( $query->is_single || $query->is_page ) && $haspost ) {
1236
  $post = $query->posts[0];
1237
  $link = get_permalink( $post->ID );
 
1238
  } elseif ( $query->is_author && $haspost ) {
1239
  $author = get_userdata( get_query_var( 'author' ) );
1240
  if ($author === false) return false;
1241
  $link = get_author_posts_url( $author->ID, $author->user_nicename );
1242
  } elseif ( $query->is_category && $haspost ) {
1243
  $link = get_category_link( get_query_var( 'cat' ) );
1244
+ } elseif ( $query->is_tag && $haspost ) {
 
1245
  $tag = get_term_by( 'slug', get_query_var( 'tag' ), 'post_tag' );
1246
+ if ( !empty( $tag->term_id ) )
1247
  $link = get_tag_link( $tag->term_id );
 
 
1248
  } elseif ( $query->is_day && $haspost ) {
1249
  $link = get_day_link( get_query_var( 'year' ),
1250
  get_query_var( 'monthnum' ),
1258
  if ( (get_option( 'show_on_front' ) == 'page' ) &&
1259
  ( $pageid = get_option( 'page_for_posts' ) ) ) {
1260
  $link = get_permalink( $pageid );
 
 
1261
  } else {
1262
  if ( function_exists( 'icl_get_home_url' ) ) {
1263
  $link = icl_get_home_url();
1264
  } else {
1265
  $link = get_option( 'home' );
1266
  }
 
 
1267
  }
1268
  } elseif ( $query->is_tax && $haspost ) {
1269
  $taxonomy = get_query_var( 'taxonomy' );
1270
  $term = get_query_var( 'term' );
1271
  $link = get_term_link( $term, $taxonomy );
 
1272
  } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
1273
  $link = get_post_type_archive_link( $post_type );
1274
  } else {
1275
  return false;
1276
  }
1277
+ return $this->yoast_get_paged( $link );
1278
+ }
1279
+
1280
+ function get_page_number() {
1281
+ $page = get_query_var( 'page' );
1282
+ if ( empty( $page ) )
1283
+ $page = get_query_var( 'paged' );
1284
+ return $page;
1285
  }
1286
 
1287
  function yoast_get_paged( $link ) {
1288
+ $page = $this->get_page_number();
1289
+ if ( !empty( $page ) && $page > 1 ) {
1290
  $link = trailingslashit( $link ) ."page/". "$page";
1291
  $link = user_trailingslashit( $link, 'paged' );
1292
  }
1293
  return $link;
1294
  }
1295
 
1296
+ function show_page_description() {
1297
+ global $aioseop_options;
1298
+ if ( !empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
1299
+ $page = $this->get_page_number();
1300
+ if ( !empty( $page ) && ( $page > 1 ) )
1301
+ return false;
1302
+ }
1303
+ return true;
1304
+ }
1305
+
1306
  function get_post_description( $post ) {
1307
  global $aioseop_options;
1308
+
1309
+ if ( !$this->show_page_description() )
1310
+ return '';
1311
+
1312
  $description = trim( stripcslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
1313
  if ( !$description ) {
1314
  $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
1315
+ if ( !$description && $aioseop_options["aiosp_generate_descriptions"] ) {
1316
+ $description = $this->trim_excerpt_without_filters( $this->internationalize( $post->post_content ) );
1317
+ }
1318
  }
1319
+
1320
  // "internal whitespace trim"
1321
  $description = preg_replace( "/\s\s+/u", " ", $description );
1322
  return $description;
1323
  }
1324
 
1325
+
1326
  function replace_title( $content, $title ) {
1327
  $title = trim( strip_tags( $title ) );
1328
  $title_tag_start = "<title>";
1448
  return $title;
1449
  }
1450
 
1451
+ function get_post_title_format() {
1452
+ global $aioseop_options;
1453
+ $title_format = '%post_title% | %blog_title%';
1454
+ if ( isset( $aioseop_options['aiosp_post_title_format'] ) )
1455
+ $title_format = $aioseop_options['aiosp_post_title_format'];
1456
+ if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostadvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {
1457
+ $wp_post_types = $aioseop_options['aiosp_cpostactive'];
1458
+ if ( is_singular( $wp_post_types ) && !empty( $aioseop_options["aiosp_cposttitles"] ) ) {
1459
+ $post_type = get_post_type();
1460
+ if ( !empty( $aioseop_options["aiosp_{$post_type}_title_format"] ) )
1461
+ $title_format = $aioseop_options["aiosp_{$post_type}_title_format"];
1462
+ }
1463
+ }
1464
+ return $title_format;
1465
+ }
1466
+
1467
+ function apply_post_title_format( $title, $category = '' ) {
1468
+ global $post;
1469
+ $title_format = $this->get_post_title_format();
1470
+ $authordata = get_userdata( $post->post_author );
1471
+ $r_title = array( '%blog_title%', '%blog_description%', '%post_title%', '%category%', '%category_title%', '%post_author_login%', '%post_author_nicename%', '%post_author_firstname%', '%post_author_lastname%' );
1472
+ $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 ) );
1473
+ $title = trim( str_replace( $r_title, $d_title, $title_format ) );
1474
+ return $title;
1475
+ }
1476
+
1477
+ function apply_page_title_format( $title ) {
1478
+ global $aioseop_options;
1479
+ $title_format = $aioseop_options['aiosp_page_title_format'];
1480
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1481
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1482
+ $new_title = str_replace( '%page_title%', $title, $new_title );
1483
+ $new_title = str_replace( '%page_author_login%', $authordata->user_login, $new_title );
1484
+ $new_title = str_replace( '%page_author_nicename%', $authordata->user_nicename, $new_title );
1485
+ $new_title = str_replace( '%page_author_firstname%', ucwords($authordata->first_name ), $new_title );
1486
+ $new_title = str_replace( '%page_author_lastname%', ucwords($authordata->last_name ), $new_title );
1487
+ $title = trim( $new_title );
1488
+ return $title;
1489
+ }
1490
+
1491
  /*** Gets the title that will be used by AIOSEOP for title rewrites or returns false. ***/
1492
  function get_aioseop_title( $post ) {
1493
  global $aioseop_options;
1497
  $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
1498
  if ( empty( $title ) && !empty( $post ) && $this->is_static_front_page() ) {
1499
  $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
1500
+ if ( empty( $title ) )
1501
  $title = $this->internationalize( $post->post_title );
1502
+ if ( empty( $title ) )
1503
  $title = $this->internationalize( $this->get_original_title( '', false ) );
1504
+ if ( !empty( $title ) )
1505
+ $title = $this->apply_page_title_format( $title );
1506
  }
1507
  if (empty( $title ) )
1508
  $title = $this->internationalize( get_option( 'blogname' ) );
1509
  return $this->paged_title( $title );
1510
  } else if ( is_attachment() ) {
1511
  if ( $post === null ) return false;
1512
+ $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
1513
+ if ( !empty( $title ) )
1514
+ return apply_filters( 'aioseop_attachment_title', $this->apply_post_title_format( $title ) );
1515
+ $title = $this->internationalize( $post->post_title );
1516
+ if ( !$title )
1517
+ $title = $this->internationalize( $this->get_original_title( '', false ) );
1518
+ $title = get_the_title( $post->post_parent ) . ' ' . $title . ' – ' . get_option( 'blogname' );
1519
+ apply_filters( 'aioseop_attachment_title', $title );
1520
  } else if ( is_page() || $this->is_static_posts_page() || ( is_home() && !$this->is_static_posts_page() ) ) {
1521
  if ( $post === null ) return false;
1522
  // we're not in the loop :(
1526
  return apply_filters( 'aioseop_home_page_title', $home_title );
1527
  } else {
1528
  $page_for_posts = '';
1529
+ if ( is_home() )
1530
  $page_for_posts = get_option( 'page_for_posts' );
 
1531
  if ( $page_for_posts ) {
1532
  $title = $this->internationalize( get_post_meta( $page_for_posts, "_aioseop_title", true ) );
1533
  if ( !$title ) {
1542
  if ( !$title )
1543
  $title = $this->internationalize( $this->get_original_title( '', false ) );
1544
 
1545
+ $title = $this->apply_page_title_format( $title );
 
 
 
 
 
 
 
 
1546
  $title = $this->paged_title( $title );
1547
  $title = apply_filters( 'aioseop_title_page', $title );
1548
  if ( $this->is_static_posts_page() )
1563
  $title = $this->internationalize( get_post_meta( $post->ID, "title_tag", true ) );
1564
  if ( !$title ) $title = $this->internationalize($this->get_original_title( '', false ) );
1565
  }
1566
+ if ( empty( $title ) ) $title = $post->post_title;
1567
+ if ( !empty( $title ) )
1568
+ $title = $this->apply_post_title_format( $title, $category );
 
 
 
 
 
 
 
 
 
1569
  $title = $this->paged_title( $title );
1570
  return apply_filters( 'aioseop_title_single', $title );
1571
  } else if ( is_search() && isset( $s ) && !empty( $s ) ) {
1577
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1578
  $title = str_replace( '%search%', $search, $title);
1579
  return $title;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1580
  } else if ( is_tag() ) {
1581
  global $utw;
1582
  if ( $utw ) {
1597
  $title = $this->paged_title( $title );
1598
  return $title;
1599
  }
1600
+ } else if ( ( is_tax() || is_category() ) && !is_feed() ) {
1601
+ $category_description = $this->internationalize( category_description() );
1602
+ if( !empty( $aioseop_options['aiosp_cap_cats'] ) ) {
1603
+ $category_name = ucwords( $this->internationalize( single_cat_title( '', false ) ) );
1604
+ } else {
1605
+ $category_name = $this->internationalize( single_cat_title( '', false ) );
1606
+ }
1607
+ $title_format = $aioseop_options['aiosp_category_title_format'];
1608
+ $title = str_replace( '%category_title%', $category_name, $title_format );
1609
+ $title = str_replace( '%category_description%', $category_description, $title );
1610
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
1611
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1612
+ $title = $this->paged_title( $title );
1613
+ return $title;
1614
  } else if ( isset( $STagging ) && $STagging->is_tag_view() ) { // simple tagging support
1615
  $tag = $STagging->search_tag;
1616
  if ( $tag ) {
1646
 
1647
  /*** Used to filter wp_title(), get our title. ***/
1648
  function wp_title() {
1649
+ global $aioseop_options;
1650
  $title = false;
1651
  $post = $this->get_queried_object();
1652
+ if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) )
1653
+ $title = $this->get_aioseop_title( $post );
1654
  if ( $title === false )
1655
  $title = $this->get_original_title();
1656
  return apply_filters( 'aioseop_title', $title );
1740
  // custom field keywords
1741
  $keywords_i = null;
1742
 
1743
+ $id = $post->ID;
1744
+ $keywords_i = stripcslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
1745
+ if ( is_attachment() ) {
1746
+ $id = $post->post_parent;
1747
+ if ( empty( $keywords_i ) )
1748
+ $keywords_i = stripcslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
1749
+ }
1750
  $keywords_i = str_replace( '"', '', $keywords_i );
1751
  if (isset( $keywords_i ) && !empty( $keywords_i ) ) {
1752
  $traverse = explode( ',', $keywords_i );
1891
  $url = menu_page_url( $menu_slug, 0 );
1892
  else
1893
  $url = esc_url( admin_url( 'admin.php?page=' . $menu_slug ) );
1894
+ $wp_admin_bar->add_menu( array( 'id' => AIOSEOP_PLUGIN_DIRNAME, 'title' => __( 'SEO', 'all_in_one_seo_pack' ), 'href' => $url ) );
1895
+ add_action( 'admin_bar_menu', array( $this, 'admin_bar_upgrade_menu' ), 1101 );
1896
  $aioseop_admin_menu = 1;
1897
  }
1898
  }
1899
+
1900
+ function admin_bar_upgrade_menu() {
1901
+ global $wp_admin_bar;
1902
+ $wp_admin_bar->add_menu( array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => __( 'Upgrade To Pro', 'all_in_one_seo_pack' ), 'id' => 'aioseop-pro-upgrade', 'href' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/', 'meta' => Array( 'target' => '_blank' ) ) );
1903
+ }
1904
 
1905
  function menu_order() {
1906
  return 5;
1919
 
1920
  $this->update_options( );
1921
 
1922
+ $this->add_admin_pointers();
1923
+ if ( !empty( $this->pointers ) )
1924
+ foreach( $this->pointers as $k => $p )
1925
+ if ( !empty( $p["pointer_scope"] ) && ( $p["pointer_scope"] == 'global' ) )
1926
+ unset( $this->pointers[$k] );
1927
+
1928
  $donated = false;
1929
  if ( ( isset( $_POST ) ) && ( isset( $_POST['module'] ) ) && ( isset( $_POST['nonce-aioseop'] ) ) && ( $_POST['module'] == 'All_in_One_SEO_Pack' ) && ( wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) ) {
1930
  if ( isset( $_POST["aiosp_donate"] ) )
aioseop_feature_manager.php CHANGED
@@ -35,6 +35,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
35
  $mod[] = 'coming_soon';
36
 
37
  foreach ( $mod as $m ) {
 
38
  $module_name = ucwords( strtr( $m, '_', ' ' ) );
39
  $this->default_options["enable_$m"] = Array( 'name' => $this->module_info[$m]['name'],
40
  'help_text' => $this->module_info[$m]['description'],
35
  $mod[] = 'coming_soon';
36
 
37
  foreach ( $mod as $m ) {
38
+ if ( $m == 'performance' && !is_super_admin() ) continue;
39
  $module_name = ucwords( strtr( $m, '_', ' ' ) );
40
  $this->default_options["enable_$m"] = Array( 'name' => $this->module_info[$m]['name'],
41
  'help_text' => $this->module_info[$m]['description'],
aioseop_functions.php CHANGED
@@ -107,69 +107,14 @@ if ( !function_exists( 'aioseop_option_isset' ) ) {
107
  return ( ( isset( $aioseop_options[$option] ) ) && $aioseop_options[$option] );
108
  }
109
  }
110
- if ( !function_exists( 'aioseop_option_page_icon' ) ) {
111
- function aioseop_option_page_icon() { ?>
112
- <style>
113
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
114
- background: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield-sprite-16.png) no-repeat 6px 6px !important;
115
- }
116
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img {
117
- display: none;
118
- }
119
- #toplevel_page_all-in-one-seo-pack-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-aioseop_class.wp-has-current-submenu .wp-menu-image {
120
- background-position: 6px -26px !important;
121
- }
122
- #icon-aioseop.icon32 {
123
- background: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield32.png) no-repeat left top !important;
124
- }
125
- #aioseop_settings_header #message {
126
- padding: 5px 0px 5px 50px;
127
- background-image: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>update32.png);
128
- background-repeat: no-repeat;
129
- background-position: 10px;
130
- font-size: 14px;
131
- min-height: 32px;
132
- }
133
-
134
- @media
135
- only screen and (-webkit-min-device-pixel-ratio: 1.5),
136
- only screen and ( min--moz-device-pixel-ratio: 1.5),
137
- only screen and ( -o-min-device-pixel-ratio: 3/2),
138
- only screen and ( min-device-pixel-ratio: 1.5),
139
- only screen and ( min-resolution: 1.5dppx) {
140
-
141
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
142
- background-image: url('<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield-sprite-32.png') !important;
143
- -webkit-background-size: 16px 48px !important;
144
- -moz-background-size: 16px 48px !important;
145
- background-size: 16px 48px !important;
146
- }
147
-
148
- #icon-aioseop.icon32 {
149
- background-image: url('<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield64.png') !important;
150
- -webkit-background-size: 32px 32px !important;
151
- -moz-background-size: 32px 32px !important;
152
- background-size: 32px 32px !important;
153
- }
154
-
155
- #aioseop_settings_header #message {
156
- background-image: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>update64.png) !important;
157
- -webkit-background-size: 32px 32px !important;
158
- -moz-background-size: 32px 32px !important;
159
- background-size: 32px 32px !important;
160
- }
161
- }
162
- </style>
163
- <?php
164
- }
165
- }
166
 
167
  if ( !function_exists( 'aioseop_addmycolumns' ) ) {
168
  function aioseop_addmycolumns() {
169
- global $aioseop_options;
170
  $aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];
171
-
172
- if ( !isset( $_GET['post_type'] ) )
 
173
  $post_type = 'post';
174
  else
175
  $post_type = $_GET['post_type'];
@@ -178,9 +123,13 @@ if ( !function_exists( 'aioseop_addmycolumns' ) ) {
178
  if( is_array( $aiosp_posttypecolumns ) && in_array( $post_type, $aiosp_posttypecolumns ) ) {
179
  if ( $post_type == 'page' )
180
  add_filter( 'manage_pages_columns', 'aioseop_mrt_pcolumns' );
 
 
181
  else
182
  add_filter( 'manage_posts_columns', 'aioseop_mrt_pcolumns' );
183
- if( is_post_type_hierarchical( $post_type ) )
 
 
184
  add_action( 'manage_pages_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
185
  else
186
  add_action( 'manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
@@ -400,7 +349,9 @@ if ( !function_exists( 'aioseop_filter_callback' ) ) {
400
 
401
  if ( !function_exists( 'aioseop_add_contactmethods' ) ) {
402
  function aioseop_add_contactmethods( $contactmethods ) {
403
- $contactmethods['googleplus'] = __( 'Google+', 'all_in_one_seo_pack' );
 
 
404
  return $contactmethods;
405
  }
406
  }
107
  return ( ( isset( $aioseop_options[$option] ) ) && $aioseop_options[$option] );
108
  }
109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
111
  if ( !function_exists( 'aioseop_addmycolumns' ) ) {
112
  function aioseop_addmycolumns() {
113
+ global $aioseop_options, $pagenow;
114
  $aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];
115
+ if ( !empty( $pagenow ) && ( $pagenow == 'upload.php' ) )
116
+ $post_type = 'attachment';
117
+ elseif ( !isset( $_GET['post_type'] ) )
118
  $post_type = 'post';
119
  else
120
  $post_type = $_GET['post_type'];
123
  if( is_array( $aiosp_posttypecolumns ) && in_array( $post_type, $aiosp_posttypecolumns ) ) {
124
  if ( $post_type == 'page' )
125
  add_filter( 'manage_pages_columns', 'aioseop_mrt_pcolumns' );
126
+ elseif ( $post_type == 'attachment' )
127
+ add_filter( 'manage_media_columns', 'aioseop_mrt_pcolumns' );
128
  else
129
  add_filter( 'manage_posts_columns', 'aioseop_mrt_pcolumns' );
130
+ if ( $post_type == 'attachment' )
131
+ add_action( 'manage_media_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
132
+ elseif ( is_post_type_hierarchical( $post_type ) )
133
  add_action( 'manage_pages_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
134
  else
135
  add_action( 'manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
349
 
350
  if ( !function_exists( 'aioseop_add_contactmethods' ) ) {
351
  function aioseop_add_contactmethods( $contactmethods ) {
352
+ global $aioseop_options;
353
+ if ( empty( $aioseop_options['aiosp_google_disable_profile'] ) )
354
+ $contactmethods['googleplus'] = __( 'Google+', 'all_in_one_seo_pack' );
355
  return $contactmethods;
356
  }
357
  }
aioseop_module.js CHANGED
@@ -93,20 +93,6 @@ function aioseop_do_condshow( condshow ) {
93
  }
94
  }
95
 
96
- function aioseop_show_pointer( handle, value ) {
97
- if ( typeof( jQuery( value.pointer_target ).pointer) != 'undefined' ) {
98
- jQuery(value.pointer_target).pointer({
99
- content : value.pointer_text,
100
- close : function() {
101
- jQuery.post( ajaxurl, {
102
- pointer: handle,
103
- action: 'dismiss-wp-pointer'
104
- });
105
- }
106
- }).pointer('open');
107
- }
108
- }
109
-
110
  jQuery(document).ready(function(){
111
  if (typeof aioseop_data != 'undefined') {
112
  if ( typeof aioseop_data.condshow != 'undefined' ) {
93
  }
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  jQuery(document).ready(function(){
97
  if (typeof aioseop_data != 'undefined') {
98
  if ( typeof aioseop_data.condshow != 'undefined' ) {
aioseop_module_class.php CHANGED
@@ -781,6 +781,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
781
  $this->setting_options( $k ); // hack -- make sure this runs anyhow, for now -- pdb
782
  add_action( 'edit_post', array( $this, 'save_post_data' ) );
783
  add_action( 'publish_post', array( $this, 'save_post_data' ) );
 
 
784
  add_action( 'save_post', array( $this, 'save_post_data' ) );
785
  add_action( 'edit_page_form', array( $this, 'save_post_data' ) );
786
  if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
@@ -895,7 +897,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
895
  $buf = '';
896
  if ( !empty( $options['count'] ) ) {
897
  $n++;
898
- $attr .= " onKeyDown='countChars(document.post.$name,document.post.length$n)' onKeyUp='countChars(document.post.$name,document.post.length$n)'";
899
  }
900
  if ( isset( $opts['id'] ) ) $attr .= " id=\"{$opts['id']}\" ";
901
  switch ( $options['type'] ) {
@@ -919,7 +921,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
919
  $size = 60;
920
  if ( isset( $options['size'] ) ) $size = $options['size'];
921
  elseif ( isset( $options['rows'] ) && isset( $options['cols'] ) ) $size = $options['rows'] * $options['cols'];
922
- $buf .= "<br /><input readonly type='text' name='length$n' size='3' maxlength='3' style='width:53px;height:23px;margin:0px;padding:0px 0px 0px 10px;' value='" . strlen($value) . "' />"
923
  . sprintf( __(' characters. Most search engines use a maximum of %s chars for the %s.', 'all_in_one_seo_pack'), $size, strtolower( $options['name'] ) );
924
  }
925
  return $buf;
781
  $this->setting_options( $k ); // hack -- make sure this runs anyhow, for now -- pdb
782
  add_action( 'edit_post', array( $this, 'save_post_data' ) );
783
  add_action( 'publish_post', array( $this, 'save_post_data' ) );
784
+ add_action( 'add_attachment', array( $this, 'save_post_data' ) );
785
+ add_action( 'edit_attachment', array( $this, 'save_post_data' ) );
786
  add_action( 'save_post', array( $this, 'save_post_data' ) );
787
  add_action( 'edit_page_form', array( $this, 'save_post_data' ) );
788
  if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
897
  $buf = '';
898
  if ( !empty( $options['count'] ) ) {
899
  $n++;
900
+ $attr .= " onKeyDown='countChars(document.post.$name,document.post.{$prefix}length$n)' onKeyUp='countChars(document.post.$name,document.post.{$prefix}length$n)'";
901
  }
902
  if ( isset( $opts['id'] ) ) $attr .= " id=\"{$opts['id']}\" ";
903
  switch ( $options['type'] ) {
921
  $size = 60;
922
  if ( isset( $options['size'] ) ) $size = $options['size'];
923
  elseif ( isset( $options['rows'] ) && isset( $options['cols'] ) ) $size = $options['rows'] * $options['cols'];
924
+ $buf .= "<br /><input readonly type='text' name='{$prefix}length$n' size='3' maxlength='3' style='width:53px;height:23px;margin:0px;padding:0px 0px 0px 10px;' value='" . strlen($value) . "' />"
925
  . sprintf( __(' characters. Most search engines use a maximum of %s chars for the %s.', 'all_in_one_seo_pack'), $size, strtolower( $options['name'] ) );
926
  }
927
  return $buf;
aioseop_module_manager.php CHANGED
@@ -72,6 +72,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module_Manager' ) ) {
72
  if ( !is_array( $this->modules ) ) return false;
73
  $v = $this->modules[ $mod ];
74
  if ( $v !== null ) return false; // already loaded
 
75
  $mod_enable = false;
76
  $fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
77
  isset($_REQUEST['page']) && $_REQUEST['page'] == trailingslashit( AIOSEOP_PLUGIN_DIRNAME ) . 'aioseop_feature_manager.php' );
72
  if ( !is_array( $this->modules ) ) return false;
73
  $v = $this->modules[ $mod ];
74
  if ( $v !== null ) return false; // already loaded
75
+ if ( $mod == 'performance' && !is_super_admin() ) return false;
76
  $mod_enable = false;
77
  $fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
78
  isset($_REQUEST['page']) && $_REQUEST['page'] == trailingslashit( AIOSEOP_PLUGIN_DIRNAME ) . 'aioseop_feature_manager.php' );
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="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/">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://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
6
- Version: 2.0.1
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
@@ -30,11 +30,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
- * @version 2.0.1
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
- define( 'AIOSEOP_VERSION', '2.0.1' );
38
 
39
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
40
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
3
  Plugin Name: All In One SEO Pack
4
  Plugin URI: http://semperfiwebdesign.com
5
  Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/">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://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
6
+ Version: 2.0.2
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
+ * @version 2.0.2
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
+ define( 'AIOSEOP_VERSION', '2.0.2' );
38
 
39
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
40
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );