All in One SEO Pack - Version 2.2.3

Version Description

Download this release

Release Info

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

Code changes from version 2.2.2 to 2.2.3

aioseop_class.php CHANGED
@@ -194,7 +194,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
194
  "search_noindex" => __( "Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.<br /><a href='http://semperplugins.com/documentation/noindex-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
195
  "paginated_noindex" => __( "Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.<br /><a href='http://semperplugins.com/documentation/noindex-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
196
  "paginated_nofollow" => __( "Check this to ask search engines not to follow links from paginated pages/posts. Useful for avoiding duplicate content.<br /><a href='http://semperplugins.com/documentation/noindex-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
 
 
197
  "generate_descriptions" => __( "Check this and your Meta Descriptions will be auto-generated from your excerpt or content.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
 
198
  "hide_paginated_descriptions"=> __( "Check this and your Meta Descriptions will be removed from page 2 or later of paginated content.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
199
  "dont_truncate_descriptions"=> __( "Check this to prevent your Description from being truncated regardless of its length.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
200
  "schema_markup"=> __( "Check this to support Schema.org markup, i.e., itemprop on supported metadata.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
@@ -466,9 +469,19 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
466
  "paginated_nofollow"=> Array(
467
  'name' => __( 'Use nofollow for paginated pages/posts:', 'all_in_one_seo_pack' ),
468
  'default' => 0),
 
 
 
 
 
 
469
  "generate_descriptions"=> Array(
470
  'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ),
471
  'default' => 1),
 
 
 
 
472
  "hide_paginated_descriptions"=> Array(
473
  'name' => __( 'Remove Descriptions For Paginated Pages:', 'all_in_one_seo_pack' ),
474
  'default' => 0),
@@ -594,12 +607,12 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
594
  'noindex' => Array(
595
  'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
596
  'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
597
- 'options' => Array( 'cpostnoindex', 'cpostnofollow', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', 'paginated_noindex', 'paginated_nofollow' )
598
  ),
599
  'advanced' => Array(
600
  'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
601
  'help_link' => 'http://semperplugins.com/documentation/advanced-settings/',
602
- 'options' => Array( 'generate_descriptions', 'hide_paginated_descriptions', 'dont_truncate_descriptions', 'unprotect_meta', 'ex_pages', 'post_meta_tags', 'page_meta_tags', 'front_meta_tags', 'home_meta_tags' )
603
  )
604
  );
605
 
@@ -700,11 +713,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
700
 
701
  $extra_title_len = 0;
702
  if ( empty( $title_format ) ) {
703
- $title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>';
704
  } else {
705
  if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
706
  $title_format = $this->apply_cf_fields( $title_format );
707
- $replace_title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>';
708
  if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format );
709
  if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format );
710
  if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format );
@@ -714,7 +727,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
714
  $extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
715
  }
716
 
717
- $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( strip_tags( $description ) ) );
718
  $extra_title_len = (int)$extra_title_len;
719
  $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
720
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
@@ -1308,7 +1321,19 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1308
  $description = apply_filters( 'aioseop_description', $description );
1309
 
1310
  if ( isset($description) && ( $this->strlen($description) > $this->minimum_description_length ) && !( $is_front_page && is_paged() ) ) {
1311
- $description = trim( strip_tags( $description ) );
 
 
 
 
 
 
 
 
 
 
 
 
1312
  $description = str_replace( '"', '&quot;', $description );
1313
 
1314
  // replace newlines on mac / windows?
@@ -1320,17 +1345,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1320
  if ( !isset( $meta_string) ) {
1321
  $meta_string = '';
1322
  }
1323
-
1324
- // description format
1325
- $description_format = $aioseop_options['aiosp_description_format'];
1326
- if ( !isset( $description_format ) || empty( $description_format ) ) {
1327
- $description_format = "%description%";
1328
- }
1329
- $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
1330
- if ( strpos( $description, '%blog_title%' ) !== false ) $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
1331
- if ( strpos( $description, '%blog_description%' ) !== false ) $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
1332
- if ( strpos( $description, '%wp_title%' ) !== false ) $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
1333
- if ( strpos( $description, '%post_title%' ) !== false ) $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description );
1334
  if( $aioseop_options['aiosp_can'] && is_attachment() ) {
1335
  $url = $this->aiosp_mrt_get_url( $wp_query );
1336
  if ( $url ) {
@@ -1372,33 +1387,36 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1372
  $page = $this->get_page_number();
1373
 
1374
  $robots_meta = '';
 
 
 
 
1375
  if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
1376
  && ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
1377
- || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) ) )
1378
- $robots_meta = 'noindex,follow';
1379
- elseif ( ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() ) && !empty( $opts ) ) {
1380
  $post_type = get_post_type();
1381
- $aiosp_noindex = htmlspecialchars( stripslashes( $opts['aiosp_noindex'] ) );
1382
- $aiosp_nofollow = htmlspecialchars( stripslashes( $opts['aiosp_nofollow'] ) );
1383
- $aiosp_noodp = htmlspecialchars( stripslashes( $opts['aiosp_noodp'] ) );
1384
- $aiosp_noydir = htmlspecialchars( stripslashes( $opts['aiosp_noydir'] ) );
 
 
1385
  if ( $aiosp_noindex || $aiosp_nofollow || $aiosp_noodp || $aiosp_noydir || !empty( $aioseop_options['aiosp_cpostnoindex'] ) || !empty( $aioseop_options['aiosp_cpostnofollow'] ) || !empty( $aioseop_options['aiosp_paginated_noindex'] ) || !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) {
1386
-
1387
- $noindex = "index";
1388
- $nofollow = "follow";
1389
- $noodp = $noydir = '';
1390
  if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
1391
  ( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
1392
  $noindex = "no" . $noindex;
1393
  if ( ( $aiosp_nofollow == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) && ( ( $page > 1 ) ) ) ||
1394
  ( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
1395
  $nofollow = "no" . $nofollow;
1396
- if ( $aiosp_noodp ) $nofollow .= ',noodp';
1397
- if ( $aiosp_noydir ) $nofollow .= ',noydir';
1398
- $robots_meta = $noindex . ',' . $nofollow;
1399
  }
1400
  }
1401
-
 
 
 
 
1402
  if ( $robots_meta == 'index,follow' ) $robots_meta = '';
1403
 
1404
  $robots_meta = apply_filters( 'aioseop_robots_meta', $robots_meta );
@@ -2069,7 +2087,10 @@ function aiosp_google_analytics() {
2069
  if ( !$description ) {
2070
  $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
2071
  if ( !$description && $aioseop_options["aiosp_generate_descriptions"] ) {
2072
- $description = $this->trim_excerpt_without_filters( $this->internationalize( $post->post_content ) );
 
 
 
2073
  }
2074
  }
2075
 
@@ -2230,10 +2251,9 @@ function aiosp_google_analytics() {
2230
 
2231
  function get_tax_title_format( $tax = '' ) {
2232
  global $aioseop_options;
2233
- if ( is_category() )
 
2234
  $title_format = $aioseop_options['aiosp_category_title_format'];
2235
- if ( empty( $title_format ) )
2236
- $title_format = '%category_title% | %blog_title%';
2237
  return $title_format;
2238
  }
2239
 
@@ -2246,8 +2266,9 @@ function aiosp_google_analytics() {
2246
  if ( strpos( $title, '%category_description%' ) !== false ) $title = str_replace( '%category_description%', $category_description, $title );
2247
  if ( strpos( $title, '%blog_title%' ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
2248
  if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
2249
- $title = $this->paged_title( $title );
2250
- return $title;
 
2251
  }
2252
 
2253
  function get_tax_name( $tax ) {
@@ -2449,6 +2470,10 @@ function aiosp_google_analytics() {
2449
  $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo('name') ), $title_format );
2450
  if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title );
2451
  if ( strpos( $title, '%tag%' ) !== false ) $title = str_replace( '%tag%', $tag, $title );
 
 
 
 
2452
  $title = $this->paged_title( $title );
2453
  return $title;
2454
  }
@@ -2490,7 +2515,8 @@ function aiosp_google_analytics() {
2490
  if ( strpos( $new_title, '%month%' ) !== false ) $new_title = str_replace( '%month%', $month, $new_title );
2491
  if ( strpos( $new_title, '%year%' ) !== false ) $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
2492
  } else if ( is_post_type_archive() ) {
2493
- $title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) );
 
2494
  } else return false;
2495
  $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
2496
  if ( strpos( $new_title, '%blog_description%' ) !== false ) $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
@@ -2570,7 +2596,7 @@ function aiosp_google_analytics() {
2570
  function trim_excerpt_without_filters( $text, $max = 0 ) {
2571
  $text = str_replace( ']]>', ']]&gt;', $text );
2572
  $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
2573
- $text = strip_tags( $text );
2574
  if ( !$max ) $max = $this->maximum_description_length;
2575
  $len = $this->strlen( $text );
2576
  if ( $max < $len ) {
@@ -2595,7 +2621,7 @@ function aiosp_google_analytics() {
2595
  function trim_excerpt_without_filters_full_length( $text ) {
2596
  $text = str_replace( ']]>', ']]&gt;', $text );
2597
  $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
2598
- $text = strip_tags( $text );
2599
  return trim( stripslashes( $text ) );
2600
  }
2601
 
194
  "search_noindex" => __( "Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.<br /><a href='http://semperplugins.com/documentation/noindex-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
195
  "paginated_noindex" => __( "Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.<br /><a href='http://semperplugins.com/documentation/noindex-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
196
  "paginated_nofollow" => __( "Check this to ask search engines not to follow links from paginated pages/posts. Useful for avoiding duplicate content.<br /><a href='http://semperplugins.com/documentation/noindex-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
197
+ 'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for your entire site.', 'all_in_one_seo_pack' ),
198
+ 'noydir' => __( 'Check this box to ask Yahoo! not to use descriptions from the Yahoo! directory for your entire site.', 'all_in_one_seo_pack' ),
199
  "generate_descriptions" => __( "Check this and your Meta Descriptions will be auto-generated from your excerpt or content.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
200
+ "run_shortcodes" => __( "Check this and shortcodes will get executed for descriptions auto-generated from content.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
201
  "hide_paginated_descriptions"=> __( "Check this and your Meta Descriptions will be removed from page 2 or later of paginated content.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
202
  "dont_truncate_descriptions"=> __( "Check this to prevent your Description from being truncated regardless of its length.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
203
  "schema_markup"=> __( "Check this to support Schema.org markup, i.e., itemprop on supported metadata.<br /><a href='http://semperplugins.com/documentation/advanced-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
469
  "paginated_nofollow"=> Array(
470
  'name' => __( 'Use nofollow for paginated pages/posts:', 'all_in_one_seo_pack' ),
471
  'default' => 0),
472
+ "noodp"=> Array(
473
+ 'name' => __( 'Exclude site from the Open Directory Project:', 'all_in_one_seo_pack' ),
474
+ 'default' => 0),
475
+ "noydir"=> Array(
476
+ 'name' => __( 'Exclude site from Yahoo! Directory:', 'all_in_one_seo_pack' ),
477
+ 'default' => 0),
478
  "generate_descriptions"=> Array(
479
  'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ),
480
  'default' => 1),
481
+ "run_shortcodes"=> Array(
482
+ 'name' => __( 'Run Shortcodes In Autogenerated Descriptions:', 'all_in_one_seo_pack' ),
483
+ 'default' => 0,
484
+ 'condshow' => Array( 'aiosp_generate_descriptions' => 'on' ) ),
485
  "hide_paginated_descriptions"=> Array(
486
  'name' => __( 'Remove Descriptions For Paginated Pages:', 'all_in_one_seo_pack' ),
487
  'default' => 0),
607
  'noindex' => Array(
608
  'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
609
  'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
610
+ 'options' => Array( 'cpostnoindex', 'cpostnofollow', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', 'paginated_noindex', 'paginated_nofollow', 'noodp', 'noydir' )
611
  ),
612
  'advanced' => Array(
613
  'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
614
  'help_link' => 'http://semperplugins.com/documentation/advanced-settings/',
615
+ 'options' => Array( 'generate_descriptions', 'run_shortcodes', 'hide_paginated_descriptions', 'dont_truncate_descriptions', 'unprotect_meta', 'ex_pages', 'post_meta_tags', 'page_meta_tags', 'front_meta_tags', 'home_meta_tags' )
616
  )
617
  );
618
 
713
 
714
  $extra_title_len = 0;
715
  if ( empty( $title_format ) ) {
716
+ $title = '<span id="aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title ) ) . '</span>';
717
  } else {
718
  if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
719
  $title_format = $this->apply_cf_fields( $title_format );
720
+ $replace_title = '<span id="aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title ) ) . '</span>';
721
  if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format );
722
  if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format );
723
  if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format );
727
  $extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
728
  }
729
 
730
+ $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( wp_strip_all_tags( $description ) ) );
731
  $extra_title_len = (int)$extra_title_len;
732
  $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
733
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
1321
  $description = apply_filters( 'aioseop_description', $description );
1322
 
1323
  if ( isset($description) && ( $this->strlen($description) > $this->minimum_description_length ) && !( $is_front_page && is_paged() ) ) {
1324
+ // description format
1325
+ $description_format = $aioseop_options['aiosp_description_format'];
1326
+ if ( !isset( $description_format ) || empty( $description_format ) ) {
1327
+ $description_format = "%description%";
1328
+ }
1329
+
1330
+ $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
1331
+ if ( strpos( $description, '%blog_title%' ) !== false ) $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
1332
+ if ( strpos( $description, '%blog_description%' ) !== false ) $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
1333
+ if ( strpos( $description, '%wp_title%' ) !== false ) $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
1334
+ if ( strpos( $description, '%post_title%' ) !== false ) $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description );
1335
+
1336
+ $description = trim( wp_strip_all_tags( $description ) );
1337
  $description = str_replace( '"', '&quot;', $description );
1338
 
1339
  // replace newlines on mac / windows?
1345
  if ( !isset( $meta_string) ) {
1346
  $meta_string = '';
1347
  }
1348
+
 
 
 
 
 
 
 
 
 
 
1349
  if( $aioseop_options['aiosp_can'] && is_attachment() ) {
1350
  $url = $this->aiosp_mrt_get_url( $wp_query );
1351
  if ( $url ) {
1387
  $page = $this->get_page_number();
1388
 
1389
  $robots_meta = '';
1390
+
1391
+ $aiosp_noindex = $aiosp_nofollow = $aiosp_noodp = $aiosp_noydir = '';
1392
+ $noindex = "index";
1393
+ $nofollow = "follow";
1394
  if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
1395
  && ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
1396
+ || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) ) ) {
1397
+ $noindex = 'noindex';
1398
+ } elseif ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() || ( $page > 1 ) ) {
1399
  $post_type = get_post_type();
1400
+ if ( !empty( $opts ) ) {
1401
+ $aiosp_noindex = htmlspecialchars( stripslashes( $opts['aiosp_noindex'] ) );
1402
+ $aiosp_nofollow = htmlspecialchars( stripslashes( $opts['aiosp_nofollow'] ) );
1403
+ $aiosp_noodp = htmlspecialchars( stripslashes( $opts['aiosp_noodp'] ) );
1404
+ $aiosp_noydir = htmlspecialchars( stripslashes( $opts['aiosp_noydir'] ) );
1405
+ }
1406
  if ( $aiosp_noindex || $aiosp_nofollow || $aiosp_noodp || $aiosp_noydir || !empty( $aioseop_options['aiosp_cpostnoindex'] ) || !empty( $aioseop_options['aiosp_cpostnofollow'] ) || !empty( $aioseop_options['aiosp_paginated_noindex'] ) || !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) {
 
 
 
 
1407
  if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
1408
  ( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
1409
  $noindex = "no" . $noindex;
1410
  if ( ( $aiosp_nofollow == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) && ( ( $page > 1 ) ) ) ||
1411
  ( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
1412
  $nofollow = "no" . $nofollow;
 
 
 
1413
  }
1414
  }
1415
+ if ( !empty( $aioseop_options['aiosp_noodp'] ) && $aioseop_options['aiosp_noodp'] ) $aiosp_noodp = true;
1416
+ if ( !empty( $aioseop_options['aiosp_noydir'] ) && $aioseop_options['aiosp_noydir'] ) $aiosp_noydir = true;
1417
+ if ( $aiosp_noodp ) $nofollow .= ',noodp';
1418
+ if ( $aiosp_noydir ) $nofollow .= ',noydir';
1419
+ $robots_meta = $noindex . ',' . $nofollow;
1420
  if ( $robots_meta == 'index,follow' ) $robots_meta = '';
1421
 
1422
  $robots_meta = apply_filters( 'aioseop_robots_meta', $robots_meta );
2087
  if ( !$description ) {
2088
  $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
2089
  if ( !$description && $aioseop_options["aiosp_generate_descriptions"] ) {
2090
+ $content = $post->post_content;
2091
+ if ( !empty( $aioseop_options["aiosp_run_shortcodes"] ) ) $content = do_shortcode( $content );
2092
+ $content = wp_strip_all_tags( $content );
2093
+ $description = $this->trim_excerpt_without_filters( $this->internationalize( $content ) );
2094
  }
2095
  }
2096
 
2251
 
2252
  function get_tax_title_format( $tax = '' ) {
2253
  global $aioseop_options;
2254
+ $title_format = '%category_title% | %blog_title%';
2255
+ if ( !empty( $aioseop_options['aiosp_category_title_format'] ) )
2256
  $title_format = $aioseop_options['aiosp_category_title_format'];
 
 
2257
  return $title_format;
2258
  }
2259
 
2266
  if ( strpos( $title, '%category_description%' ) !== false ) $title = str_replace( '%category_description%', $category_description, $title );
2267
  if ( strpos( $title, '%blog_title%' ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
2268
  if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
2269
+ $title = trim( wp_strip_all_tags( $title ) );
2270
+ $title = str_replace( Array( '"', "\r\n", "\n" ), Array( '&quot;', ' ', ' ' ), $title );
2271
+ return $this->paged_title( $title );
2272
  }
2273
 
2274
  function get_tax_name( $tax ) {
2470
  $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo('name') ), $title_format );
2471
  if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title );
2472
  if ( strpos( $title, '%tag%' ) !== false ) $title = str_replace( '%tag%', $tag, $title );
2473
+ if ( strpos( $title, '%tag_description%' ) !== false ) $title = str_replace( '%tag_description%', tag_description(), $title );
2474
+ if ( strpos( $title, '%taxonomy_description%' ) !== false ) $title = str_replace( '%taxonomy_description%', tag_description(), $title );
2475
+ $title = trim( wp_strip_all_tags( $title ) );
2476
+ $title = str_replace( Array( '"', "\r\n", "\n" ), Array( '&quot;', ' ', ' ' ), $title );
2477
  $title = $this->paged_title( $title );
2478
  return $title;
2479
  }
2515
  if ( strpos( $new_title, '%month%' ) !== false ) $new_title = str_replace( '%month%', $month, $new_title );
2516
  if ( strpos( $new_title, '%year%' ) !== false ) $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
2517
  } else if ( is_post_type_archive() ) {
2518
+ if ( empty( $title ) ) $title = $this->get_original_title( '', false );
2519
+ $new_title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) );
2520
  } else return false;
2521
  $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
2522
  if ( strpos( $new_title, '%blog_description%' ) !== false ) $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
2596
  function trim_excerpt_without_filters( $text, $max = 0 ) {
2597
  $text = str_replace( ']]>', ']]&gt;', $text );
2598
  $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
2599
+ $text = wp_strip_all_tags( $text );
2600
  if ( !$max ) $max = $this->maximum_description_length;
2601
  $len = $this->strlen( $text );
2602
  if ( $max < $len ) {
2621
  function trim_excerpt_without_filters_full_length( $text ) {
2622
  $text = str_replace( ']]>', ']]&gt;', $text );
2623
  $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
2624
+ $text = wp_strip_all_tags( $text );
2625
  return trim( stripslashes( $text ) );
2626
  }
2627
 
aioseop_module_manager.php CHANGED
@@ -83,9 +83,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module_Manager' ) ) {
83
  $v = $this->modules[ $mod ];
84
  if ( $v !== null ) return false; // already loaded
85
  if ( $mod == 'performance' && !is_super_admin() ) return false;
86
- if ( $mod == 'file_editor' && ( ( ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
87
- || ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
88
- || !is_super_admin() ) ) )
 
89
  return false;
90
  $mod_enable = false;
91
  $fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
83
  $v = $this->modules[ $mod ];
84
  if ( $v !== null ) return false; // already loaded
85
  if ( $mod == 'performance' && !is_super_admin() ) return false;
86
+ if ( ( $mod == 'file_editor' || $mod == 'robots' )
87
+ && ( ( ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
88
+ || ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
89
+ || !is_super_admin() ) ) )
90
  return false;
91
  $mod_enable = false;
92
  $fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
aioseop_opengraph.php CHANGED
@@ -91,6 +91,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
91
  "customimg" => __( "This option lets you upload an image to use as the Open Graph image for this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
92
  "imagewidth" => __( "Enter the width for your Open Graph image in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
93
  "imageheight" => __( "Enter the height for your Open Graph image in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
 
 
 
 
94
  "defcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
95
  "setcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
96
  "twitter_site" => __( "Enter the Twitter username associated with your website here.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
@@ -100,6 +104,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
100
  "title" => __( "This is the Open Graph title of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
101
  "desc" => __( "This is the Open Graph description of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
102
  "category" => __( "Select the Open Graph type that best describes the content of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
 
103
  "tag" => __( "This Open Graph meta allows you to add a list of keywords that best describe this content.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
104
  "facebook_publisher" => __( "Link articles to the Facebook page associated with your website.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
105
  "facebook_author" => __( "Allows your authors to be identified by their Facebook pages as content authors on the Opengraph meta for their articles.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
@@ -119,7 +124,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
119
  'type' => 'image' ),
120
  'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
121
  'disable_jetpack' => Array( 'name' => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ),
122
- 'defimg' => Array( 'name' => __( 'Select OG:Image Source', 'all_in_one_seo_pack' ), 'type' => 'select', 'initial_options' => Array( '' => __( 'Default Image' ), 'featured' => __( 'Featured Image' ), 'attach' => __( 'First Attached Image' ), 'content' => __( 'First Image In Content' ), 'custom' => __( 'Image From Custom Field' ), 'auto' => __( 'First Available Image' ) ) ),
123
  'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
124
  'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
125
  'meta_key' => Array( 'name' => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
@@ -133,6 +138,12 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
133
  'type' => 'text', 'default' => '' ),
134
  'imageheight' => Array( 'name' => __( 'Specify Image Height', 'all_in_one_seo_pack' ),
135
  'type' => 'text', 'default' => '' ),
 
 
 
 
 
 
136
  'defcard' => Array( 'name' => __( 'Default Twitter Card', 'all_in_one_seo_pack' ),
137
  'type' => 'select', 'initial_options' => Array( 'summary' => __( 'Summary', 'all_in_one_seo_pack' ), 'summary_large_image' => __( 'Summary Large Image', 'all_in_one_seo_pack' ), 'photo' => __( 'Photo', 'all_in_one_seo_pack' ) ), 'default' => 'summary' ),
138
  'setcard' => Array( 'name' => __( 'Twitter Card Type', 'all_in_one_seo_pack' ),
@@ -154,6 +165,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
154
  'initial_options' => $this->fb_object_types,
155
  'default' => ''
156
  ),
 
 
157
  'tag' => Array( 'name' => __( 'Article Tags', 'all_in_one_seo_pack' ),
158
  'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
159
  'facebook_publisher'=>Array('name' => __( 'Show Facebook Publisher on Articles', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
@@ -176,7 +189,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
176
  'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'disable_jetpack', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', 'defcard', 'twitter_site', 'twitter_creator', 'twitter_domain', 'types', 'facebook_publisher', 'facebook_author' ) ),
177
  'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
178
  'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
179
- 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'category', 'tag', 'setcard' ),
180
  'display' => $display, 'prefix' => 'aioseop_opengraph_'
181
  )
182
  );
@@ -345,7 +358,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
345
  add_filter( 'jetpack_enable_open_graph', '__return_false', 100 );
346
  add_filter( 'jetpack_disable_twitter_cards', '__return_false', 100 );
347
  }
348
- $attributes = apply_filters( $this->prefix . 'attributes', Array( 'xmlns="http://www.w3.org/1999/xhtml"', 'xmlns:og="http://ogp.me/ns#"', 'xmlns:fb="http://www.facebook.com/2008/fbml"' ) );
349
  foreach( $attributes as $attr ) {
350
  if ( strpos( $output, $attr ) === false ) {
351
  $output .= "\n\t$attr ";
@@ -360,7 +373,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
360
  $key = $this->options['aiosp_opengraph_key'];
361
  $dimg = $this->options['aiosp_opengraph_dimg'];
362
  $current_post_type = get_post_type();
363
- $title = $description = $image = '';
364
  $type = 'article';
365
 
366
  $sitename = $this->options['aiosp_opengraph_sitename'];
@@ -395,7 +408,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
395
  if( empty($title) ) $title = get_bloginfo('name');
396
  if( empty($sitename) ) $sitename = get_bloginfo('name');
397
 
398
- if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) )
399
  $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
400
 
401
  if ( empty($description) && $first_page ) $description = get_bloginfo('description');
@@ -408,6 +421,9 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
408
  } elseif ( isset( $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ) ) {
409
  $type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"];
410
  }
 
 
 
411
  if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_tag'] ) ) ) {
412
  $tag = $metabox['aioseop_opengraph_settings_tag'];
413
  }
@@ -417,11 +433,22 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
417
 
418
  if ( !empty( $this->options['aiosp_opengraph_twitter_domain'] ) )
419
  $domain = $this->options['aiosp_opengraph_twitter_domain'];
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
- if ( $type == 'article' && !empty( $post ) && isset( $post->post_author ) && !empty( $this->options['aiosp_opengraph_facebook_author'] ) )
422
- $author = get_the_author_meta( 'facebook', $post->post_author );
423
 
424
  $image = $metabox['aioseop_opengraph_settings_image'];
 
425
  $title = $metabox['aioseop_opengraph_settings_title'];
426
  $description = $metabox['aioseop_opengraph_settings_desc'];
427
 
@@ -476,6 +503,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
476
  break;
477
  case 'auto' : $thumbnail = $this->get_the_image();
478
  break;
 
 
479
  default : $thumbnail = $this->options['aiosp_opengraph_dimg'];
480
  }
481
  }
@@ -492,6 +521,13 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
492
  $height = $metabox['aioseop_opengraph_settings_imageheight'];
493
  }
494
 
 
 
 
 
 
 
 
495
  $card = 'summary';
496
  if ( !empty( $this->options['aiosp_opengraph_defcard'] ) )
497
  $card = $this->options['aiosp_opengraph_defcard'];
@@ -522,12 +558,18 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
522
  'thumbnail' => 'og:image',
523
  'width' => 'og:image:width',
524
  'height' => 'og:image:height',
 
 
 
525
  'sitename' => 'og:site_name',
526
  'key' => 'fb:admins',
527
  'description' => 'og:description',
 
528
  'tag' => 'article:tag',
529
  'publisher' => 'article:publisher',
530
- 'author' => 'article:author'
 
 
531
  ),
532
  'twitter' => Array(
533
  'card' => 'twitter:card',
@@ -535,7 +577,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
535
  'creator' => 'twitter:creator',
536
  'domain' => 'twitter:domain',
537
  'description' => 'twitter:description',
538
- )
 
 
 
539
  );
540
 
541
  // Add links to testing tools
@@ -634,7 +679,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
634
  }
635
 
636
  if ( !empty( $options ) && !empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
637
- $img[$options['aioseop_opengraph_settings_customimg']] = 'customimg';
 
 
 
638
  }
639
  $image = array_flip( $img );
640
  $images = Array();
@@ -643,7 +691,23 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
643
  $images[$v] = '<img height=150 src="' . $v . '">';
644
  return Array( $image, $images );
645
  }
646
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  function get_the_image( $options = null, $p = null ) {
648
  $meta_key = $this->options['aiosp_opengraph_meta_key'];
649
  return parent::get_the_image( Array( 'meta_key' => $meta_key ), $p );
91
  "customimg" => __( "This option lets you upload an image to use as the Open Graph image for this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
92
  "imagewidth" => __( "Enter the width for your Open Graph image in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
93
  "imageheight" => __( "Enter the height for your Open Graph image in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
94
+ "video" => __( "This option lets you specify a link to the Open Graph video used on this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
95
+ "videowidth" => __( "Enter the width for your Open Graph video in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
96
+ "videoheight" => __( "Enter the height for your Open Graph video in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
97
+
98
  "defcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
99
  "setcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
100
  "twitter_site" => __( "Enter the Twitter username associated with your website here.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
104
  "title" => __( "This is the Open Graph title of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
105
  "desc" => __( "This is the Open Graph description of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
106
  "category" => __( "Select the Open Graph type that best describes the content of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
107
+ "section" => __( "This Open Graph meta allows you to add a general section name that best describes this content.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
108
  "tag" => __( "This Open Graph meta allows you to add a list of keywords that best describe this content.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
109
  "facebook_publisher" => __( "Link articles to the Facebook page associated with your website.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
110
  "facebook_author" => __( "Allows your authors to be identified by their Facebook pages as content authors on the Opengraph meta for their articles.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
124
  'type' => 'image' ),
125
  'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
126
  'disable_jetpack' => Array( 'name' => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ),
127
+ 'defimg' => Array( 'name' => __( 'Select OG:Image Source', 'all_in_one_seo_pack' ), 'type' => 'select', 'initial_options' => Array( '' => __( 'Default Image' ), 'featured' => __( 'Featured Image' ), 'attach' => __( 'First Attached Image' ), 'content' => __( 'First Image In Content' ), 'custom' => __( 'Image From Custom Field' ), 'author' => __( 'Post Author Image' ), 'auto' => __( 'First Available Image' ) ) ),
128
  'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
129
  'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
130
  'meta_key' => Array( 'name' => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
138
  'type' => 'text', 'default' => '' ),
139
  'imageheight' => Array( 'name' => __( 'Specify Image Height', 'all_in_one_seo_pack' ),
140
  'type' => 'text', 'default' => '' ),
141
+ 'video' => Array( 'name' => __( 'Custom Video', 'all_in_one_seo_pack' ),
142
+ 'type' => 'text' ),
143
+ 'videowidth' => Array( 'name' => __( 'Specify Video Width', 'all_in_one_seo_pack' ),
144
+ 'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_video' => Array( 'lhs' => "aioseop_opengraph_settings_video", 'op' => '!=', 'rhs' => '' ) ) ),
145
+ 'videoheight' => Array( 'name' => __( 'Specify Video Height', 'all_in_one_seo_pack' ),
146
+ 'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_video' => Array( 'lhs' => "aioseop_opengraph_settings_video", 'op' => '!=', 'rhs' => '' ) ) ),
147
  'defcard' => Array( 'name' => __( 'Default Twitter Card', 'all_in_one_seo_pack' ),
148
  'type' => 'select', 'initial_options' => Array( 'summary' => __( 'Summary', 'all_in_one_seo_pack' ), 'summary_large_image' => __( 'Summary Large Image', 'all_in_one_seo_pack' ), 'photo' => __( 'Photo', 'all_in_one_seo_pack' ) ), 'default' => 'summary' ),
149
  'setcard' => Array( 'name' => __( 'Twitter Card Type', 'all_in_one_seo_pack' ),
165
  'initial_options' => $this->fb_object_types,
166
  'default' => ''
167
  ),
168
+ 'section' => Array( 'name' => __( 'Article Section', 'all_in_one_seo_pack' ),
169
+ 'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
170
  'tag' => Array( 'name' => __( 'Article Tags', 'all_in_one_seo_pack' ),
171
  'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
172
  'facebook_publisher'=>Array('name' => __( 'Show Facebook Publisher on Articles', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
189
  'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'disable_jetpack', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', 'defcard', 'twitter_site', 'twitter_creator', 'twitter_domain', 'types', 'facebook_publisher', 'facebook_author' ) ),
190
  'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
191
  'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
192
+ 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'video', 'videowidth', 'videoheight', 'category', 'section', 'tag', 'setcard' ),
193
  'display' => $display, 'prefix' => 'aioseop_opengraph_'
194
  )
195
  );
358
  add_filter( 'jetpack_enable_open_graph', '__return_false', 100 );
359
  add_filter( 'jetpack_disable_twitter_cards', '__return_false', 100 );
360
  }
361
+ $attributes = apply_filters( $this->prefix . 'attributes', Array( 'itemscope', 'itemtype="http://schema.org/Article"', 'xmlns="http://www.w3.org/1999/xhtml"', 'xmlns:og="http://ogp.me/ns#"', 'xmlns:fb="http://www.facebook.com/2008/fbml"' ) );
362
  foreach( $attributes as $attr ) {
363
  if ( strpos( $output, $attr ) === false ) {
364
  $output .= "\n\t$attr ";
373
  $key = $this->options['aiosp_opengraph_key'];
374
  $dimg = $this->options['aiosp_opengraph_dimg'];
375
  $current_post_type = get_post_type();
376
+ $title = $description = $image = $video = '';
377
  $type = 'article';
378
 
379
  $sitename = $this->options['aiosp_opengraph_sitename'];
408
  if( empty($title) ) $title = get_bloginfo('name');
409
  if( empty($sitename) ) $sitename = get_bloginfo('name');
410
 
411
+ if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) && !empty( $post ) && !empty( $post->post_content ) )
412
  $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
413
 
414
  if ( empty($description) && $first_page ) $description = get_bloginfo('description');
421
  } elseif ( isset( $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ) ) {
422
  $type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"];
423
  }
424
+ if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_section'] ) ) ) {
425
+ $section = $metabox['aioseop_opengraph_settings_section'];
426
+ }
427
  if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_tag'] ) ) ) {
428
  $tag = $metabox['aioseop_opengraph_settings_tag'];
429
  }
433
 
434
  if ( !empty( $this->options['aiosp_opengraph_twitter_domain'] ) )
435
  $domain = $this->options['aiosp_opengraph_twitter_domain'];
436
+
437
+
438
+ if ( $type == 'article' && !empty( $post ) ) {
439
+ if ( isset( $post->post_author ) && !empty( $this->options['aiosp_opengraph_facebook_author'] ) )
440
+ $author = get_the_author_meta( 'facebook', $post->post_author );
441
+
442
+ if ( isset( $post->post_date ) )
443
+ $published_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_date ) );
444
+
445
+ if ( isset( $post->post_modified ) )
446
+ $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified ) );
447
+ }
448
 
 
 
449
 
450
  $image = $metabox['aioseop_opengraph_settings_image'];
451
+ $video = $metabox['aioseop_opengraph_settings_video'];
452
  $title = $metabox['aioseop_opengraph_settings_title'];
453
  $description = $metabox['aioseop_opengraph_settings_desc'];
454
 
503
  break;
504
  case 'auto' : $thumbnail = $this->get_the_image();
505
  break;
506
+ case 'author' : $thumbnail = $this->get_the_image_by_author();
507
+ break;
508
  default : $thumbnail = $this->options['aiosp_opengraph_dimg'];
509
  }
510
  }
521
  $height = $metabox['aioseop_opengraph_settings_imageheight'];
522
  }
523
 
524
+ if ( !empty( $video ) ) {
525
+ if ( !empty( $metabox['aioseop_opengraph_settings_videowidth'] ) )
526
+ $videowidth = $metabox['aioseop_opengraph_settings_videowidth'];
527
+ if ( !empty( $metabox['aioseop_opengraph_settings_videoheight'] ) )
528
+ $videoheight = $metabox['aioseop_opengraph_settings_videoheight'];
529
+ }
530
+
531
  $card = 'summary';
532
  if ( !empty( $this->options['aiosp_opengraph_defcard'] ) )
533
  $card = $this->options['aiosp_opengraph_defcard'];
558
  'thumbnail' => 'og:image',
559
  'width' => 'og:image:width',
560
  'height' => 'og:image:height',
561
+ 'video' => 'og:video',
562
+ 'videowidth' => 'og:video:width',
563
+ 'videoheight' => 'og:video:height',
564
  'sitename' => 'og:site_name',
565
  'key' => 'fb:admins',
566
  'description' => 'og:description',
567
+ 'section' => 'article:section',
568
  'tag' => 'article:tag',
569
  'publisher' => 'article:publisher',
570
+ 'author' => 'article:author',
571
+ 'published_time'=> 'article:published_time',
572
+ 'modified_time' => 'article:modified_time',
573
  ),
574
  'twitter' => Array(
575
  'card' => 'twitter:card',
577
  'creator' => 'twitter:creator',
578
  'domain' => 'twitter:domain',
579
  'description' => 'twitter:description',
580
+ ),
581
+ 'google+' => Array(
582
+ 'thumbnail' => 'image',
583
+ ),
584
  );
585
 
586
  // Add links to testing tools
679
  }
680
 
681
  if ( !empty( $options ) && !empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
682
+ $img[$options['aioseop_opengraph_settings_customimg']] = 'customimg';
683
+ }
684
+ if ( $author_img = $this->get_the_image_by_author( $p ) ) {
685
+ $image["author"] = $author_img;
686
  }
687
  $image = array_flip( $img );
688
  $images = Array();
691
  $images[$v] = '<img height=150 src="' . $v . '">';
692
  return Array( $image, $images );
693
  }
694
+
695
+ function get_the_image_by_author( $options = null, $p = null ) {
696
+ if ( $p === null ) {
697
+ global $post;
698
+ } else {
699
+ $post = $p;
700
+ }
701
+ if ( !empty( $post ) && !empty( $post->post_author ) ) {
702
+ $matches = Array();
703
+ $get_avatar = get_avatar( $post->post_author, 300 );
704
+ if ( preg_match("/src='(.*?)'/i", $get_avatar, $matches) ) {
705
+ return $matches[1];
706
+ }
707
+ }
708
+ return false;
709
+ }
710
+
711
  function get_the_image( $options = null, $p = null ) {
712
  $meta_key = $this->options['aiosp_opengraph_meta_key'];
713
  return parent::get_the_image( Array( 'meta_key' => $meta_key ), $p );
all_in_one_seo_pack-pl_PL.mo CHANGED
Binary file
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/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">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.2.2
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.2.2
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
- define( 'AIOSEOP_VERSION', '2.2.2' );
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/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">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.2.3
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
+ * @version 2.2.3
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
+ define( 'AIOSEOP_VERSION', '2.2.3' );
38
 
39
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
40
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
5
  Requires at least: 3.3
6
- Tested up to: 3.9.1
7
  Stable tag: trunk
8
 
9
  All in One SEO Pack is a WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines such as Google.
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: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
5
  Requires at least: 3.3
6
+ Tested up to: 3.9.2
7
  Stable tag: trunk
8
 
9
  All in One SEO Pack is a WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines such as Google.