Changeset 970845
- Timestamp:
- 08/22/2014 05:39:25 PM (10 years ago)
- Location:
- all-in-one-seo-pack
- Files:
-
- 1 added
- 6 edited
- 59 copied
Legend:
- Unmodified
- Added
- Removed
-
all-in-one-seo-pack/tags/2.2.3/aioseop_class.php
r956933 r970845 195 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 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 198 197 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 198 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' ), 199 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' ), … … 467 470 'name' => __( 'Use nofollow for paginated pages/posts:', 'all_in_one_seo_pack' ), 468 471 'default' => 0), 472 473 474 475 476 477 469 478 "generate_descriptions"=> Array( 470 479 'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ), 471 480 'default' => 1), 481 482 483 484 472 485 "hide_paginated_descriptions"=> Array( 473 486 'name' => __( 'Remove Descriptions For Paginated Pages:', 'all_in_one_seo_pack' ), … … 595 608 'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ), 596 609 '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' )610 'options' => Array( 'cpostnoindex', 'cpostnofollow', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', 'paginated_noindex', 'paginated_nofollow' ) 598 611 ), 599 612 'advanced' => Array( 600 613 'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ), 601 614 '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' )615 '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 616 ) 604 617 ); … … 701 714 $extra_title_len = 0; 702 715 if ( empty( $title_format ) ) { 703 $title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>';716 $title = '<span id="aioseop_snippet_title">' . esc_attr( _tags( $title ) ) . '</span>'; 704 717 } else { 705 718 if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format ); 706 719 $title_format = $this->apply_cf_fields( $title_format ); 707 $replace_title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>';720 $replace_title = '<span id="aioseop_snippet_title">' . esc_attr( _tags( $title ) ) . '</span>'; 708 721 if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format ); 709 722 if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format ); … … 715 728 } 716 729 717 $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( strip_tags( $description ) ) );730 $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( _tags( $description ) ) ); 718 731 $extra_title_len = (int)$extra_title_len; 719 732 $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>"; … … 1309 1322 1310 1323 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( '"', '"', $description );1313 1314 // replace newlines on mac / windows?1315 $description = str_replace( "\r\n", ' ', $description );1316 1317 // maybe linux uses this alone1318 $description = str_replace( "\n", ' ', $description );1319 1320 if ( !isset( $meta_string) ) {1321 $meta_string = '';1322 }1323 1324 1324 // description format 1325 1325 $description_format = $aioseop_options['aiosp_description_format']; … … 1327 1327 $description_format = "%description%"; 1328 1328 } 1329 1329 1330 $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format ); 1330 1331 if ( strpos( $description, '%blog_title%' ) !== false ) $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description ); … … 1332 1333 if ( strpos( $description, '%wp_title%' ) !== false ) $description = str_replace( '%wp_title%', $this->get_original_title(), $description ); 1333 1334 if ( strpos( $description, '%post_title%' ) !== false ) $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description ); 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1334 1349 if( $aioseop_options['aiosp_can'] && is_attachment() ) { 1335 1350 $url = $this->aiosp_mrt_get_url( $wp_query ); … … 1373 1388 1374 1389 $robots_meta = ''; 1390 1391 1392 1393 1375 1394 if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax() 1376 1395 && ( ( 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) ) {1396 || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) ) ) 1397 '; 1398 ) ) { 1380 1399 $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'] ) ); 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 } 1385 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'] ) ) { 1386 1387 $noindex = "index";1388 $nofollow = "follow";1389 $noodp = $noydir = '';1390 1407 if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) || 1391 1408 ( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) ) … … 1394 1411 ( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) ) 1395 1412 $nofollow = "no" . $nofollow; 1396 if ( $aiosp_noodp ) $nofollow .= ',noodp'; 1397 if ( $aiosp_noydir ) $nofollow .= ',noydir'; 1398 $robots_meta = $noindex . ',' . $nofollow; 1399 } 1400 } 1401 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; 1402 1420 if ( $robots_meta == 'index,follow' ) $robots_meta = ''; 1403 1421 … … 2070 2088 $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) ); 2071 2089 if ( !$description && $aioseop_options["aiosp_generate_descriptions"] ) { 2072 $description = $this->trim_excerpt_without_filters( $this->internationalize( $post->post_content ) ); 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 ) ); 2073 2094 } 2074 2095 } … … 2231 2252 function get_tax_title_format( $tax = '' ) { 2232 2253 global $aioseop_options; 2233 if ( is_category() ) 2254 $title_format = '%category_title% | %blog_title%'; 2255 if ( !empty( $aioseop_options['aiosp_category_title_format'] ) ) 2234 2256 $title_format = $aioseop_options['aiosp_category_title_format']; 2235 if ( empty( $title_format ) )2236 $title_format = '%category_title% | %blog_title%';2237 2257 return $title_format; 2238 2258 } … … 2247 2267 if ( strpos( $title, '%blog_title%' ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); 2248 2268 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; 2269 $title = trim( wp_strip_all_tags( $title ) ); 2270 $title = str_replace( Array( '"', "\r\n", "\n" ), Array( '"', ' ', ' ' ), $title ); 2271 return $this->paged_title( $title ); 2251 2272 } 2252 2273 … … 2450 2471 if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title ); 2451 2472 if ( strpos( $title, '%tag%' ) !== false ) $title = str_replace( '%tag%', $tag, $title ); 2473 2474 2475 2476 2452 2477 $title = $this->paged_title( $title ); 2453 2478 return $title; … … 2491 2516 if ( strpos( $new_title, '%year%' ) !== false ) $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title ); 2492 2517 } else if ( is_post_type_archive() ) { 2493 $title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) ); 2518 if ( empty( $title ) ) $title = $this->get_original_title( '', false ); 2519 $new_title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) ); 2494 2520 } else return false; 2495 2521 $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); … … 2571 2597 $text = str_replace( ']]>', ']]>', $text ); 2572 2598 $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text ); 2573 $text = strip_tags( $text );2599 $text = _tags( $text ); 2574 2600 if ( !$max ) $max = $this->maximum_description_length; 2575 2601 $len = $this->strlen( $text ); … … 2596 2622 $text = str_replace( ']]>', ']]>', $text ); 2597 2623 $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text ); 2598 $text = strip_tags( $text );2624 $text = _tags( $text ); 2599 2625 return trim( stripslashes( $text ) ); 2600 2626 } -
all-in-one-seo-pack/tags/2.2.3/aioseop_module_manager.php
r956933 r970845 84 84 if ( $v !== null ) return false; // already loaded 85 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() ) ) ) 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() ) ) ) 89 90 return false; 90 91 $mod_enable = false; -
all-in-one-seo-pack/tags/2.2.3/aioseop_opengraph.php
r956933 r970845 92 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 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 95 96 97 94 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' ), 95 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' ), … … 101 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' ), 102 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 103 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' ), 104 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' ), … … 120 125 'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ), 121 126 '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' ), 'aut o' => __( 'First Available Image' ) ) ),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' ), 'auto' => __( 'First Available Image' ) ) ), 123 128 'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ), 124 129 'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ), … … 134 139 'imageheight' => Array( 'name' => __( 'Specify Image Height', 'all_in_one_seo_pack' ), 135 140 'type' => 'text', 'default' => '' ), 141 142 143 144 145 146 136 147 'defcard' => Array( 'name' => __( 'Default Twitter Card', 'all_in_one_seo_pack' ), 137 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' ), … … 155 166 'default' => '' 156 167 ), 168 169 157 170 'tag' => Array( 'name' => __( 'Article Tags', 'all_in_one_seo_pack' ), 158 171 'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ), … … 177 190 'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'), 178 191 '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' ),192 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', '', 'tag', 'setcard' ), 180 193 'display' => $display, 'prefix' => 'aioseop_opengraph_' 181 194 ) … … 346 359 add_filter( 'jetpack_disable_twitter_cards', '__return_false', 100 ); 347 360 } 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"' ) );361 $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 362 foreach( $attributes as $attr ) { 350 363 if ( strpos( $output, $attr ) === false ) { … … 361 374 $dimg = $this->options['aiosp_opengraph_dimg']; 362 375 $current_post_type = get_post_type(); 363 $title = $description = $image = '';376 $title = $description = $image = ''; 364 377 $type = 'article'; 365 378 … … 396 409 if( empty($sitename) ) $sitename = get_bloginfo('name'); 397 410 398 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) )411 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) ) 399 412 $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 ); 400 413 … … 409 422 $type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"]; 410 423 } 424 425 426 411 427 if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_tag'] ) ) ) { 412 428 $tag = $metabox['aioseop_opengraph_settings_tag']; … … 418 434 if ( !empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) 419 435 $domain = $this->options['aiosp_opengraph_twitter_domain']; 436 437 438 439 440 441 442 443 420 444 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 ); 445 if ( isset( $post->post_modified ) ) 446 $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified ) ); 447 } 448 423 449 424 450 $image = $metabox['aioseop_opengraph_settings_image']; 451 425 452 $title = $metabox['aioseop_opengraph_settings_title']; 426 453 $description = $metabox['aioseop_opengraph_settings_desc']; … … 477 504 case 'auto' : $thumbnail = $this->get_the_image(); 478 505 break; 506 507 479 508 default : $thumbnail = $this->options['aiosp_opengraph_dimg']; 480 509 } … … 491 520 if ( !empty( $metabox['aioseop_opengraph_settings_imageheight'] ) ) 492 521 $height = $metabox['aioseop_opengraph_settings_imageheight']; 522 523 524 525 526 527 528 493 529 } 494 530 … … 523 559 'width' => 'og:image:width', 524 560 'height' => 'og:image:height', 561 562 563 525 564 'sitename' => 'og:site_name', 526 565 'key' => 'fb:admins', 527 566 'description' => 'og:description', 567 528 568 'tag' => 'article:tag', 529 569 'publisher' => 'article:publisher', 530 'author' => 'article:author' 570 'author' => 'article:author', 571 'published_time'=> 'article:published_time', 572 'modified_time' => 'article:modified_time', 531 573 ), 532 574 'twitter' => Array( … … 536 578 'domain' => 'twitter:domain', 537 579 'description' => 'twitter:description', 538 ) 580 ), 581 'google+' => Array( 582 'thumbnail' => 'image', 583 ), 539 584 ); 540 585 … … 635 680 636 681 if ( !empty( $options ) && !empty( $options['aioseop_opengraph_settings_customimg'] ) ) { 637 $img[$options['aioseop_opengraph_settings_customimg']] = '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; 638 686 } 639 687 $image = array_flip( $img ); … … 644 692 return Array( $image, $images ); 645 693 } 646 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 647 711 function get_the_image( $options = null, $p = null ) { 648 712 $meta_key = $this->options['aiosp_opengraph_meta_key']; -
all-in-one-seo-pack/tags/2.2.3/all_in_one_seo_pack.php
r956933 r970845 4 4 Plugin URI: http://semperfiwebdesign.com 5 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¤cy_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. 26 Version: 2.2. 7 7 Author: Michael Torbert 8 8 Author URI: http://michaeltorbert.com … … 31 31 /** 32 32 * @package All-in-One-SEO-Pack 33 * @version 2.2. 233 * @version 2.2. 34 34 */ 35 35 36 36 if ( ! defined( 'AIOSEOP_VERSION' ) ) 37 define( 'AIOSEOP_VERSION', '2.2. 2' );37 define( 'AIOSEOP_VERSION', '2.2.' ); 38 38 39 39 if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) { -
all-in-one-seo-pack/tags/2.2.3/readme.txt
r924101 r970845 4 4 Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google 5 5 Requires at least: 3.3 6 Tested up to: 3.9. 16 Tested up to: 3.9. 7 7 Stable tag: trunk 8 8 -
all-in-one-seo-pack/trunk/aioseop_class.php
r956933 r970845 195 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 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 198 197 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 198 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' ), 199 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' ), … … 467 470 'name' => __( 'Use nofollow for paginated pages/posts:', 'all_in_one_seo_pack' ), 468 471 'default' => 0), 472 473 474 475 476 477 469 478 "generate_descriptions"=> Array( 470 479 'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ), 471 480 'default' => 1), 481 482 483 484 472 485 "hide_paginated_descriptions"=> Array( 473 486 'name' => __( 'Remove Descriptions For Paginated Pages:', 'all_in_one_seo_pack' ), … … 595 608 'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ), 596 609 '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' )610 'options' => Array( 'cpostnoindex', 'cpostnofollow', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', 'paginated_noindex', 'paginated_nofollow' ) 598 611 ), 599 612 'advanced' => Array( 600 613 'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ), 601 614 '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' )615 '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 616 ) 604 617 ); … … 701 714 $extra_title_len = 0; 702 715 if ( empty( $title_format ) ) { 703 $title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>';716 $title = '<span id="aioseop_snippet_title">' . esc_attr( _tags( $title ) ) . '</span>'; 704 717 } else { 705 718 if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format ); 706 719 $title_format = $this->apply_cf_fields( $title_format ); 707 $replace_title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>';720 $replace_title = '<span id="aioseop_snippet_title">' . esc_attr( _tags( $title ) ) . '</span>'; 708 721 if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format ); 709 722 if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format ); … … 715 728 } 716 729 717 $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( strip_tags( $description ) ) );730 $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( _tags( $description ) ) ); 718 731 $extra_title_len = (int)$extra_title_len; 719 732 $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>"; … … 1309 1322 1310 1323 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( '"', '"', $description );1313 1314 // replace newlines on mac / windows?1315 $description = str_replace( "\r\n", ' ', $description );1316 1317 // maybe linux uses this alone1318 $description = str_replace( "\n", ' ', $description );1319 1320 if ( !isset( $meta_string) ) {1321 $meta_string = '';1322 }1323 1324 1324 // description format 1325 1325 $description_format = $aioseop_options['aiosp_description_format']; … … 1327 1327 $description_format = "%description%"; 1328 1328 } 1329 1329 1330 $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format ); 1330 1331 if ( strpos( $description, '%blog_title%' ) !== false ) $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description ); … … 1332 1333 if ( strpos( $description, '%wp_title%' ) !== false ) $description = str_replace( '%wp_title%', $this->get_original_title(), $description ); 1333 1334 if ( strpos( $description, '%post_title%' ) !== false ) $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description ); 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1334 1349 if( $aioseop_options['aiosp_can'] && is_attachment() ) { 1335 1350 $url = $this->aiosp_mrt_get_url( $wp_query ); … … 1373 1388 1374 1389 $robots_meta = ''; 1390 1391 1392 1393 1375 1394 if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax() 1376 1395 && ( ( 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) ) {1396 || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) ) ) 1397 '; 1398 ) ) { 1380 1399 $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'] ) ); 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 } 1385 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'] ) ) { 1386 1387 $noindex = "index";1388 $nofollow = "follow";1389 $noodp = $noydir = '';1390 1407 if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) || 1391 1408 ( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) ) … … 1394 1411 ( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) ) 1395 1412 $nofollow = "no" . $nofollow; 1396 if ( $aiosp_noodp ) $nofollow .= ',noodp'; 1397 if ( $aiosp_noydir ) $nofollow .= ',noydir'; 1398 $robots_meta = $noindex . ',' . $nofollow; 1399 } 1400 } 1401 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; 1402 1420 if ( $robots_meta == 'index,follow' ) $robots_meta = ''; 1403 1421 … … 2070 2088 $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) ); 2071 2089 if ( !$description && $aioseop_options["aiosp_generate_descriptions"] ) { 2072 $description = $this->trim_excerpt_without_filters( $this->internationalize( $post->post_content ) ); 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 ) ); 2073 2094 } 2074 2095 } … … 2231 2252 function get_tax_title_format( $tax = '' ) { 2232 2253 global $aioseop_options; 2233 if ( is_category() ) 2254 $title_format = '%category_title% | %blog_title%'; 2255 if ( !empty( $aioseop_options['aiosp_category_title_format'] ) ) 2234 2256 $title_format = $aioseop_options['aiosp_category_title_format']; 2235 if ( empty( $title_format ) )2236 $title_format = '%category_title% | %blog_title%';2237 2257 return $title_format; 2238 2258 } … … 2247 2267 if ( strpos( $title, '%blog_title%' ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); 2248 2268 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; 2269 $title = trim( wp_strip_all_tags( $title ) ); 2270 $title = str_replace( Array( '"', "\r\n", "\n" ), Array( '"', ' ', ' ' ), $title ); 2271 return $this->paged_title( $title ); 2251 2272 } 2252 2273 … … 2450 2471 if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title ); 2451 2472 if ( strpos( $title, '%tag%' ) !== false ) $title = str_replace( '%tag%', $tag, $title ); 2473 2474 2475 2476 2452 2477 $title = $this->paged_title( $title ); 2453 2478 return $title; … … 2491 2516 if ( strpos( $new_title, '%year%' ) !== false ) $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title ); 2492 2517 } else if ( is_post_type_archive() ) { 2493 $title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) ); 2518 if ( empty( $title ) ) $title = $this->get_original_title( '', false ); 2519 $new_title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) ); 2494 2520 } else return false; 2495 2521 $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); … … 2571 2597 $text = str_replace( ']]>', ']]>', $text ); 2572 2598 $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text ); 2573 $text = strip_tags( $text );2599 $text = _tags( $text ); 2574 2600 if ( !$max ) $max = $this->maximum_description_length; 2575 2601 $len = $this->strlen( $text ); … … 2596 2622 $text = str_replace( ']]>', ']]>', $text ); 2597 2623 $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text ); 2598 $text = strip_tags( $text );2624 $text = _tags( $text ); 2599 2625 return trim( stripslashes( $text ) ); 2600 2626 } -
all-in-one-seo-pack/trunk/aioseop_module_manager.php
r956933 r970845 84 84 if ( $v !== null ) return false; // already loaded 85 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() ) ) ) 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() ) ) ) 89 90 return false; 90 91 $mod_enable = false; -
all-in-one-seo-pack/trunk/aioseop_opengraph.php
r956933 r970845 92 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 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 95 96 97 94 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' ), 95 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' ), … … 101 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' ), 102 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 103 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' ), 104 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' ), … … 120 125 'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ), 121 126 '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' ), 'aut o' => __( 'First Available Image' ) ) ),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' ), 'auto' => __( 'First Available Image' ) ) ), 123 128 'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ), 124 129 'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ), … … 134 139 'imageheight' => Array( 'name' => __( 'Specify Image Height', 'all_in_one_seo_pack' ), 135 140 'type' => 'text', 'default' => '' ), 141 142 143 144 145 146 136 147 'defcard' => Array( 'name' => __( 'Default Twitter Card', 'all_in_one_seo_pack' ), 137 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' ), … … 155 166 'default' => '' 156 167 ), 168 169 157 170 'tag' => Array( 'name' => __( 'Article Tags', 'all_in_one_seo_pack' ), 158 171 'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ), … … 177 190 'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'), 178 191 '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' ),192 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', '', 'tag', 'setcard' ), 180 193 'display' => $display, 'prefix' => 'aioseop_opengraph_' 181 194 ) … … 346 359 add_filter( 'jetpack_disable_twitter_cards', '__return_false', 100 ); 347 360 } 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"' ) );361 $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 362 foreach( $attributes as $attr ) { 350 363 if ( strpos( $output, $attr ) === false ) { … … 361 374 $dimg = $this->options['aiosp_opengraph_dimg']; 362 375 $current_post_type = get_post_type(); 363 $title = $description = $image = '';376 $title = $description = $image = ''; 364 377 $type = 'article'; 365 378 … … 396 409 if( empty($sitename) ) $sitename = get_bloginfo('name'); 397 410 398 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) )411 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) ) 399 412 $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 ); 400 413 … … 409 422 $type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"]; 410 423 } 424 425 426 411 427 if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_tag'] ) ) ) { 412 428 $tag = $metabox['aioseop_opengraph_settings_tag']; … … 418 434 if ( !empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) 419 435 $domain = $this->options['aiosp_opengraph_twitter_domain']; 436 437 438 439 440 441 442 443 420 444 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 ); 445 if ( isset( $post->post_modified ) ) 446 $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified ) ); 447 } 448 423 449 424 450 $image = $metabox['aioseop_opengraph_settings_image']; 451 425 452 $title = $metabox['aioseop_opengraph_settings_title']; 426 453 $description = $metabox['aioseop_opengraph_settings_desc']; … … 477 504 case 'auto' : $thumbnail = $this->get_the_image(); 478 505 break; 506 507 479 508 default : $thumbnail = $this->options['aiosp_opengraph_dimg']; 480 509 } … … 491 520 if ( !empty( $metabox['aioseop_opengraph_settings_imageheight'] ) ) 492 521 $height = $metabox['aioseop_opengraph_settings_imageheight']; 522 523 524 525 526 527 528 493 529 } 494 530 … … 523 559 'width' => 'og:image:width', 524 560 'height' => 'og:image:height', 561 562 563 525 564 'sitename' => 'og:site_name', 526 565 'key' => 'fb:admins', 527 566 'description' => 'og:description', 567 528 568 'tag' => 'article:tag', 529 569 'publisher' => 'article:publisher', 530 'author' => 'article:author' 570 'author' => 'article:author', 571 'published_time'=> 'article:published_time', 572 'modified_time' => 'article:modified_time', 531 573 ), 532 574 'twitter' => Array( … … 536 578 'domain' => 'twitter:domain', 537 579 'description' => 'twitter:description', 538 ) 580 ), 581 'google+' => Array( 582 'thumbnail' => 'image', 583 ), 539 584 ); 540 585 … … 635 680 636 681 if ( !empty( $options ) && !empty( $options['aioseop_opengraph_settings_customimg'] ) ) { 637 $img[$options['aioseop_opengraph_settings_customimg']] = '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; 638 686 } 639 687 $image = array_flip( $img ); … … 644 692 return Array( $image, $images ); 645 693 } 646 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 647 711 function get_the_image( $options = null, $p = null ) { 648 712 $meta_key = $this->options['aiosp_opengraph_meta_key']; -
all-in-one-seo-pack/trunk/all_in_one_seo_pack.php
r956933 r970845 4 4 Plugin URI: http://semperfiwebdesign.com 5 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¤cy_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. 26 Version: 2.2. 7 7 Author: Michael Torbert 8 8 Author URI: http://michaeltorbert.com … … 31 31 /** 32 32 * @package All-in-One-SEO-Pack 33 * @version 2.2. 233 * @version 2.2. 34 34 */ 35 35 36 36 if ( ! defined( 'AIOSEOP_VERSION' ) ) 37 define( 'AIOSEOP_VERSION', '2.2. 2' );37 define( 'AIOSEOP_VERSION', '2.2.' ); 38 38 39 39 if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) { -
all-in-one-seo-pack/trunk/readme.txt
r924101 r970845 4 4 Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google 5 5 Requires at least: 3.3 6 Tested up to: 3.9. 16 Tested up to: 3.9. 7 7 Stable tag: trunk 8 8
Note: See TracChangeset
for help on using the changeset viewer.