Changeset 1119068
- Timestamp:
- 03/23/2015 06:18:00 PM (9 years ago)
- Location:
- all-in-one-seo-pack
- Files:
-
- 1 added
- 8 edited
- 47 copied
Legend:
- Unmodified
- Added
- Removed
-
all-in-one-seo-pack/tags/2.2.6/aioseop_class.php
r1119066 r1119068 76 76 "customize_canonical_links"=> __( "Checking this option will allow you to customize Canonical URLs for specific posts.", 'all_in_one_seo_pack'), 77 77 "can_set_protocol" => __( "Set protocol for canonical URLs.", 'all_in_one_seo_pack' ), 78 "use_original_title" => __( "Use wp_title to set the title; disable this option if you run into conflicts with the title being set by your theme or another plugin.", 'all_in_one_seo_pack' ),78 "use_original_title" => __( "Use wp_title to .", 'all_in_one_seo_pack' ), 79 79 "do_log" => __( "Check this and All in One SEO Pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging. Make sure this directory is writable.", 'all_in_one_seo_pack' ), 80 80 "home_title" => __( "As the name implies, this will be the Meta Title of your homepage. This is independent of any other option. If not set, the default Site Title (found in WordPress under Settings, General, Site Title) will be used.", 'all_in_one_seo_pack' ), 81 81 "home_description" => __( "This will be the Meta Description for your homepage. This is independent of any other option. The default is no Meta Description at all if this is not set.", 'all_in_one_seo_pack' ), 82 82 "home_keywords" => __( "Enter a comma separated list of your most important keywords for your site that will be written as Meta Keywords on your homepage. Don\'t stuff everything in here.", 'all_in_one_seo_pack' ), 83 83 84 "togglekeywords" => __( "This option allows you to toggle the use of Meta Keywords throughout the whole of the site.", 'all_in_one_seo_pack' ), 84 85 "use_categories" => __( "Check this if you want your categories for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all_in_one_seo_pack' ), 85 86 "use_tags_as_keywords" => __( "Check this if you want your tags for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all_in_one_seo_pack' ), 86 "dynamic_postspage_keywords"=> __( "Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.", 'all_in_one_seo_pack'),87 "dynamic_postspage_keywords"=> __( "Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.", 'all_in_one_seo_pack'), 87 88 "rewrite_titles" => __( "Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the title bar and in the source code. If enabled, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: Using the default post title format below, Rewrite Titles will write all post titles as 'Post Title | Blog Name'. If you have manually defined a title using All in One SEO Pack, this will become the title of your post in the format string.", 'all_in_one_seo_pack' ), 88 89 "cap_titles" => __( "Check this and Search Page Titles and Tag Page Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack' ), 89 90 "cap_cats" => __( "Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack'), 91 92 93 94 95 96 97 98 99 100 90 101 "page_title_format" => 91 102 __( "This controls the format of the title tag for Pages.<br />The following macros are supported:", 'all_in_one_seo_pack' ) … … 93 104 __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' . 94 105 __( '%page_title% - The original title of the page', 'all_in_one_seo_pack' ) . '</li><li>' . 95 __( '%category_title% - The (main) category of the page', 'all_in_one_seo_pack' ) . '</li><li>' .96 __( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .97 106 __( "%page_author_login% - This page's author' login", 'all_in_one_seo_pack' ) . '</li><li>' . 98 107 __( "%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' . … … 310 319 'name' => __( 'Home Title:', 'all_in_one_seo_pack' ), 311 320 'default' => null, 'type' => 'textarea', 'sanitize' => 'text', 312 'count' => true, 'rows' => 1, 'cols' => 60 ), 321 'count' => true, 'rows' => 1, 'cols' => 60, 322 'condshow' => Array( "aiosp_use_static_home_info" => 0 ) ), 313 323 "home_description"=> Array( 314 324 'name' => __( 'Home Description:', 'all_in_one_seo_pack' ), 315 325 'default' => '', 'type' => 'textarea', 'sanitize' => 'text', 316 'count' => true, 'cols' => 80, 'rows' => 2 ), 326 'count' => true, 'cols' => 80, 'rows' => 2, 327 'condshow' => Array( "aiosp_use_static_home_info" => 0 ) ), 317 328 "togglekeywords" => Array( 318 329 'name' => __( 'Use Keywords:', 'all_in_one_seo_pack' ), … … 325 336 'name' => __( 'Home Keywords (comma separated):', 'all_in_one_seo_pack' ), 326 337 'default' => null, 'type' => 'textarea', 'sanitize' => 'text', 327 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ), 338 'condshow' => Array( "aiosp_togglekeywords" => 0, "aiosp_use_static_home_info" => 0 ) ), 339 "use_static_home_info" => Array( 340 'name' => __( "Use Static Front Page Instead", 'all_in_one_seo_pack' ), 341 'default' => 0, 342 'type' => 'radio', 343 'initial_options' => Array( 1 => __( 'Enabled', 'all_in_one_seo_pack' ), 344 0 => __( 'Disabled', 'all_in_one_seo_pack' ) ) 345 ), 328 346 "can"=> Array( 329 347 'name' => __( 'Canonical URLs:', 'all_in_one_seo_pack' ), … … 372 390 "cap_cats"=> Array( 373 391 'name' => __( 'Capitalize Category Titles:', 'all_in_one_seo_pack' ), 'default' => 1), 392 393 394 395 374 396 "page_title_format"=> Array( 375 397 'name' => __( 'Page Title Format:', 'all_in_one_seo_pack' ), … … 423 445 0 => __( 'Disabled', 'all_in_one_seo_pack' ) ) 424 446 ), 447 448 449 450 451 425 452 "cpostadvanced" => Array( 426 453 'name' => __( 'Enable Advanced Options:', 'all_in_one_seo_pack' ), … … 430 457 'label' => null, 431 458 'condshow' => Array( "aiosp_enablecpost" => 'on' ) 432 ),433 "cpostactive" => Array(434 'name' => __( 'SEO on only these post types:', 'all_in_one_seo_pack' ),435 'type' => 'multicheckbox', 'default' => array('post', 'page'),436 'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )437 459 ), 438 460 "cpostnoindex" => Array( … … 571 593 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ), 572 594 "dynamic_postspage_keywords"=> Array( 573 'name' => __( 'Dynamically Generate Keywords for Posts Page :', 'all_in_one_seo_pack' ),595 'name' => __( 'Dynamically Generate Keywords for Posts Page:', 'all_in_one_seo_pack' ), 574 596 'default' => 1, 575 597 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ), … … 662 684 jQuery(document).ready(function() { 663 685 jQuery("#aiosp_title_wrapper").bind("input", function() { 664 jQuery("#aios eop_snippet_title").text(jQuery("#aiosp_title_wrapper input").val().replace(/<(?:.|\n)*?>/gm, ""));686 jQuery("#aiosp_snippet_title").text(jQuery("#aiosp_title_wrapper input").val().replace(/<(?:.|\n)*?>/gm, "")); 665 687 }); 666 688 jQuery("#aiosp_description_wrapper").bind("input", function() { … … 672 694 'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ), 673 695 'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ), 696 674 697 'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all_in_one_seo_pack' ), 'type' => 'text' ), 675 698 'custom_link' => Array( 'name' => __( 'Custom Canonical URL', 'all_in_one_seo_pack' ), 'type' => 'text', 'size' => 60 ), … … 699 722 'name' => __( 'Home Page Settings', 'all_in_one_seo_pack' ), 700 723 'help_link' => 'http://semperplugins.com/documentation/home-page-settings/', 701 'options' => Array( 'home_title', 'home_description', 'home_keywords' )724 'options' => Array( 'home_title', 'home_description', 'home_keywords' ) 702 725 ), 703 726 'keywords' => Array( … … 709 732 'name' => __( 'Title Settings', 'all_in_one_seo_pack' ), 710 733 'help_link' => 'http://semperplugins.com/documentation/title-settings/', 711 'options' => Array( "rewrite_titles", "force_rewrites", "cap_titles", "cap_cats", " page_title_format", "post_title_format", "category_title_format", "archive_title_format", "date_title_format", "author_title_format",734 'options' => Array( "rewrite_titles", "force_rewrites", "cap_titles", "cap_cats", "page_title_format", "post_title_format", "category_title_format", "archive_title_format", "date_title_format", "author_title_format", 712 735 "tag_title_format", "search_title_format", "description_format", "404_title_format", "paged_format" ) 713 736 ), … … 765 788 return $info; 766 789 global $post, $aioseop_options, $wp_query; 767 $title = $url = $description = $term = '';790 $title = $url = $description = $term = ''; 768 791 $p = $post; $w = $wp_query; 769 792 if ( !is_object( $post ) ) $post = $this->get_queried_object(); … … 776 799 $opts = $this->meta_opts; 777 800 $post_id = $p->ID; 778 if ( ! $post->post_modified_gmt != '')801 if ( ) 779 802 $wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) ); 780 803 if ( $post->post_type == 'page' ) … … 805 828 $title_format = $aioseop_options['aiosp_page_title_format']; 806 829 elseif ( is_single() || is_attachment() ) 807 $title_format = $this->get_post_title_format( );830 $title_format = $this->get_post_title_format(); 808 831 } 809 832 if ( empty( $title_format ) ) { 810 833 $title_format = '%post_title%'; 811 834 } 835 836 837 838 812 839 } else if ( is_object( $term ) ) { 813 840 if ( $_GET['taxonomy'] == 'category' ) { … … 846 873 $keywords = apply_filters( 'aioseop_keywords', $keywords ); 847 874 875 876 848 877 wp_reset_postdata(); 849 878 $wp_query = $w; $post = $p; 850 $info = Array( 'title' => $title, 'description' => $description, 'keywords' => $keywords, 'url' => $url, 'title_format' => $title_format );851 879 return $info; 852 880 } … … 866 894 $extra_title_len = 0; 867 895 if ( empty( $title_format ) ) { 868 $title = '<span id=" aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title) ) . '</span>';896 $title = '<span id=" ) ) . '</span>'; 869 897 } else { 870 898 if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format ); 871 899 $title_format = $this->apply_cf_fields( $title_format ); 872 $replace_title = '<span id=" aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title) ) . '</span>';900 $replace_title = '<span id=" ) ) . '</span>'; 873 901 if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format ); 874 902 if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format ); 875 if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format ); 876 if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format ); 903 if ( $w->is_category || $w->is_tag || $w->is_tax ) { 904 if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format ); 905 if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format ); 906 } else { 907 if ( strpos( $title_format, '%category%' ) !== false ) $title_format = str_replace( '%category%', $category, $title_format ); 908 if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $category, $title_format ); 909 if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $category, $title_format ); 910 } 877 911 if ( strpos( $title_format, '%taxonomy_description%' ) !== false ) $title_format = str_replace( '%taxonomy_description%', $description, $title_format ); 878 912 … … 1035 1069 __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' . 1036 1070 __( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' . 1037 __( '%category_title% - The (main) category of the post', 'all_in_one_seo_pack' ) . '</li><li>' .1038 __( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .1039 1071 __( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' . 1040 1072 __( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' . … … 1324 1356 $wp_post_types = get_post_types( Array( '_builtin' => true ) ); // don't display meta if SEO isn't enabled on custom post types -- pdb 1325 1357 if( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false; 1326 } else if ( !empty( $aioseop_options['aiosp_cpostadvanced'] ) ){1358 } else { 1327 1359 $wp_post_types = $aioseop_options['aiosp_cpostactive']; 1328 1360 if ( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false; … … 1412 1444 if ( isset( $this->is_front_page ) && $this->is_front_page !== null ) return $this->is_front_page; 1413 1445 $post = $this->get_queried_object(); 1414 $this->is_front_page = ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) );1446 $this->is_front_page = ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) ); 1415 1447 return $this->is_front_page; 1416 1448 } … … 1420 1452 if ( $is_posts_page !== null ) return $is_posts_page; 1421 1453 $post = $this->get_queried_object(); 1422 $is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && $post->ID == get_option( 'page_for_posts' ) );1454 $is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && $post->ID == get_option( 'page_for_posts' ) ); 1423 1455 return $is_posts_page; 1424 1456 } … … 1613 1645 $description = $this->internationalize( get_the_author_meta( 'description' ) ); 1614 1646 } else if ( is_front_page() ) { 1615 $description = trim( stripslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ));1647 $description = ); 1616 1648 } else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) { 1617 1649 $description = $this->get_post_description( $post ); … … 1669 1701 $opts = $this->meta_opts; 1670 1702 if ( ( ( is_front_page() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() ) ) { 1671 $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) ); 1672 } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && ($this->is_static_posts_page() || is_archive() || is_post_type_archive() ) ) { 1673 $keywords = stripslashes( $this->internationalize( $opts["aiosp_keywords"] ) ); // and if option = use page set keywords instead of keywords from recent posts 1703 if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) { 1704 $keywords = $this->get_all_keywords(); 1705 } else { 1706 $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) ); 1707 } 1708 } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && $this->is_static_posts_page() ) { 1709 $keywords = stripslashes( $this->internationalize( $opts["aiosp_keywords"] ) ); // and if option = use page set keywords instead of keywords from recent posts 1674 1710 } elseif ( ( $blog_page = $this->get_blog_page( $post ) ) && empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) { 1675 $keywords = stripslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) ); 1711 $keywords = stripslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) ); 1712 } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && ( is_archive() || is_post_type_archive() ) ) { 1713 $keywords = ""; 1676 1714 } else { 1677 1715 $keywords = $this->get_all_keywords(); … … 2278 2316 return false; 2279 2317 } 2318 2319 2320 2321 2322 2323 2324 2325 2280 2326 } elseif ( ( $query->is_single || $query->is_page ) && $haspost ) { 2281 2327 $post = $query->posts[0]; … … 2300 2346 } elseif ( $query->is_year && $haspost ) { 2301 2347 $link = get_year_link( get_query_var( 'year' ) ); 2302 } elseif ( $query->is_home ) {2303 if ( (get_option( 'show_on_front' ) == 'page' ) &&2304 ( $pageid = get_option( 'page_for_posts' ) ) ) {2305 $link = get_permalink( $pageid );2306 } else {2307 if ( function_exists( 'icl_get_home_url' ) ) {2308 $link = icl_get_home_url();2309 } else {2310 $link = trailingslashit( home_url() );2311 }2312 }2313 2348 } elseif ( $query->is_tax && $haspost ) { 2314 2349 $taxonomy = get_query_var( 'taxonomy' ); … … 2360 2395 return $link; 2361 2396 } 2362 2397 2398 function is_singular( $post_types = Array(), $post = null ) { 2399 if ( !empty( $post_types ) && is_object( $post ) ) 2400 return in_array( $post->post_type, (array)$post_types ); 2401 else 2402 return is_singular( $post_types ); 2403 } 2404 2363 2405 function show_page_description() { 2364 2406 global $aioseop_options; … … 2373 2415 function get_post_description( $post ) { 2374 2416 global $aioseop_options; 2375 2417 $description = ''; 2376 2418 if ( !$this->show_page_description() ) 2377 2419 return ''; 2378 2420 2379 2421 $description = trim( stripslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) ); 2422 2423 2424 2380 2425 if ( !$description ) { 2381 2426 if ( empty( $aioseop_options["aiosp_skip_excerpt"] ) ) … … 2415 2460 $post = $GLOBALS["post"]; 2416 2461 $blog_page = $this->get_blog_page(); 2417 if ( $this->is_static_front_page() ) 2462 $description = ''; 2463 if ( $this->is_static_front_page() && empty( $aioseop_options['aiosp_use_static_home_info'] ) ) 2418 2464 $description = trim( stripslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) ); 2419 2465 elseif ( !empty( $blog_page ) ) … … 2447 2493 $in = polyglot_filter( $in ); 2448 2494 2449 if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) 2495 if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) 2450 2496 $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in ); 2497 2498 2499 2500 2501 2451 2502 2452 2503 return apply_filters( 'localization', $in ); … … 2454 2505 2455 2506 /** @return The original title as delivered by WP (well, in most cases) */ 2456 function get_original_title( $sep = ' ', $echo = false, $seplocation = '' ) {2507 function get_original_title( $sep = '', $echo = false, $seplocation = '' ) { 2457 2508 global $aioseop_options; 2458 2509 if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) { … … 2460 2511 if ( $has_filter !== false ) 2461 2512 remove_filter( 'wp_title', Array( $this, 'wp_title' ), $has_filter ); 2513 2514 2515 2516 2517 2462 2518 $title = wp_title( $sep, $echo, $seplocation ); 2463 2519 if ( $has_filter !== false ) … … 2561 2617 if ( strpos( $title, '%blog_title%' ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); 2562 2618 if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); 2563 $title = trim( wp_strip_all_tags( $title ) ); 2564 $title = str_replace( Array( '"', "\r\n", "\n" ), Array( '"', ' ', ' ' ), $title ); 2619 $title = wp_strip_all_tags( $title ); 2565 2620 return $this->paged_title( $title ); 2566 2621 } … … 2591 2646 } 2592 2647 2593 function get_post_title_format( $title_type = 'post' ) {2648 function get_post_title_format( $title_type = 'post' ) { 2594 2649 global $aioseop_options; 2595 2650 if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) return false; … … 2597 2652 if ( isset( $aioseop_options["aiosp_{$title_type}_title_format"] ) ) 2598 2653 $title_format = $aioseop_options["aiosp_{$title_type}_title_format"]; 2599 if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cposta dvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {2654 if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) { 2600 2655 $wp_post_types = $aioseop_options['aiosp_cpostactive']; 2601 2656 if ( !empty( $aioseop_options["aiosp_cposttitles"] ) ) { 2602 2657 if ( ( ( $title_type == 'archive' ) && is_post_type_archive( $wp_post_types ) && $prefix = "aiosp_{$title_type}_" ) || 2603 ( ( $title_type == 'post' ) && is_singular( $wp_post_types ) && $prefix = "aiosp_" ) ) { 2604 $post_type = get_post_type(); 2605 if ( !empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) 2606 $title_format = $aioseop_options["{$prefix}{$post_type}_title_format"]; 2658 ( ( $title_type == 'post' ) && $this->is_singular( $wp_post_types, $p ) && $prefix = "aiosp_" ) ) { 2659 $post_type = get_post_type( $p ); 2660 if ( !empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) { 2661 $title_format = $aioseop_options["{$prefix}{$post_type}_title_format"]; 2662 } 2607 2663 } 2608 2664 } … … 2629 2685 $post = $p; 2630 2686 } 2631 $title_format = $this->get_post_title_format( );2687 $title_format = $this->get_post_title_format(); 2632 2688 if ( !empty( $post ) ) 2633 2689 $authordata = get_userdata( $post->post_author ); … … 2640 2696 } 2641 2697 2642 function apply_page_title_format( $title, $p = null ) {2698 function apply_page_title_format( $title, $p = null ) { 2643 2699 global $aioseop_options; 2644 2700 if ( $p === null ) { … … 2647 2703 $post = $p; 2648 2704 } 2649 $title_format = $aioseop_options['aiosp_page_title_format']; 2705 if ( empty( $title_format ) ) 2706 $title_format = $aioseop_options['aiosp_page_title_format']; 2650 2707 if ( !empty( $post ) ) 2651 2708 $authordata = get_userdata( $post->post_author ); … … 2670 2727 $opts = $this->meta_opts; 2671 2728 if ( is_front_page() ) { 2672 $title = $this->internationalize( $aioseop_options['aiosp_home_title'] ); 2729 if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) { 2730 global $post; 2731 if ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) ) { 2732 $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) ); 2733 if ( !$title ) $title = $this->internationalize( $post->post_title ); 2734 if ( !$title ) $title = $this->internationalize( $this->get_original_title( '', false ) ); 2735 if ( !empty( $aioseop_options['aiosp_home_page_title_format'] ) ) 2736 $title = $this->apply_page_title_format( $title, $post, $aioseop_options['aiosp_home_page_title_format'] ); 2737 $title = $this->paged_title( $title ); 2738 $title = apply_filters( 'aioseop_home_page_title', $title ); 2739 } 2740 } else { 2741 $title = $this->internationalize( $aioseop_options['aiosp_home_title'] ); 2742 if ( !empty( $aioseop_options['aiosp_home_page_title_format'] ) ) 2743 $title = $this->apply_page_title_format( $title, null, $aioseop_options['aiosp_home_page_title_format'] ); 2744 } 2673 2745 if (empty( $title ) ) 2674 2746 $title = $this->internationalize( get_option( 'blogname' ) ) . ' | ' . $this->internationalize( get_bloginfo( 'description' ) ); … … 2685 2757 if ( $post === null ) return false; 2686 2758 if ( ( $this->is_static_front_page() ) && ( $home_title = $this->internationalize( $aioseop_options['aiosp_home_title'] ) ) ) { 2759 2760 2687 2761 //home title filter 2688 2762 return apply_filters( 'aioseop_home_page_title', $home_title ); … … 2723 2797 // we're not in the loop :( 2724 2798 if ( $post === null ) return false; 2725 $categories = get_the_category();2799 $categories = (); 2726 2800 $category = ''; 2727 if ( count( $categories ) > 0 ) { 2728 $category = $categories[0]->cat_name; 2729 } 2801 if ( count( $categories ) > 0 ) 2802 $category = $categories[0]; 2730 2803 $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) ); 2731 2804 if ( !$title ) { … … 2934 3007 function get_all_categories( $id = 0 ) { 2935 3008 $keywords = Array(); 2936 $categories = get_the_category( $id ); 2937 foreach ( $categories as $category ) 2938 $keywords[] = $this->internationalize( $category->cat_name ); 3009 $categories = get_the_category( $id ); 3010 if ( !empty( $categories ) ) 3011 foreach ( $categories as $category ) 3012 $keywords[] = $this->internationalize( $category->cat_name ); 2939 3013 return $keywords; 2940 3014 } … … 2943 3017 $keywords = Array(); 2944 3018 $tags = get_the_tags( $id ); 2945 if ( $tags&& is_array( $tags) )3019 if ( && is_array( $tags) ) 2946 3020 foreach ( $tags as $tag ) 2947 3021 $keywords[] = $this->internationalize( $tag->name ); … … 2975 3049 $opts = $this->meta_opts; 2976 3050 if ( !empty( $opts["aiosp_keywords"] ) ) { 2977 $traverse = $this->keyword_string_to_list( $ opts["aiosp_keywords"]);3051 $traverse = $this->keyword_string_to_list( $ ); 2978 3052 if ( !empty( $traverse ) ) 2979 3053 foreach ( $traverse as $keyword ) $keywords[] = $keyword; -
all-in-one-seo-pack/tags/2.2.6/aioseop_functions.php
r1119066 r1119068 156 156 ?><style> 157 157 .aioseop_edit_button { 158 margin: 0 0 0 5px; 159 opacity: 0.6; 160 width: 12px; 158 margin: 0 0 0 5px; 159 opacity: 0.6; 160 width: 12px; 161 } 162 .aioseop_edit_link { 163 display: inline-block; 164 position: absolute; 161 165 } 162 166 .aioseop_mpc_SEO_admin_options_edit img { … … 168 172 display: block; 169 173 opacity: 1; 174 175 176 177 178 179 180 170 181 } 171 182 .aioseop_mpc_admin_meta_content { … … 173 184 width: 100%; 174 185 margin: 0 0 10px 0; 175 } 186 } 187 td.seotitle.column-seotitle, 188 td.seodesc.column-seodesc, 189 td.seokeywords.column-seokeywords { 190 overflow: visible; 191 } 176 192 </style> 177 193 <?php wp_print_scripts( Array( 'sack' ) ); … … 210 226 if ( !function_exists( 'aioseop_output_notice' ) ) { 211 227 function aioseop_output_notice( $message, $id = '', $class = "updated fade" ) { 228 212 229 if ( !empty( $class ) ) $class = ' class="' . esc_attr( $class ) . '"'; 213 230 if ( !empty( $id ) ) $class .= ' id="' . esc_attr( $id ) . '"'; 214 231 $dismiss = ' '; 215 echo "<div{$class}>" . wp_kses_post( $message ) . "< /div>";232 echo "<div{$class}>" . wp_kses_post( $message ) . "</div>"; 216 233 return true; 217 234 } … … 231 248 $qa['aioseop_ignore_notice'] = $msgid; 232 249 $url = '?' . build_query( $qa ); 233 $message .= ' <a class="alignright" href="' . $url . '">Dismiss</a>';250 $message >'; 234 251 } 235 252 return aioseop_output_notice( $message, $id, $class ); 236 253 } 237 254 } 238 239 255 if ( !function_exists( 'aioseop_ajax_save_meta' ) ) { 240 256 function aioseop_ajax_save_meta() { … … 253 269 } 254 270 if( $result != '' ): 255 $label = "<label id='aioseop_label_{$target}_{$post_id}'> " . $result . '</label>';271 $label = "<label id='aioseop_label_{$target}_{$post_id}'>" . $result . '</label>'; 256 272 else: 257 $label = ''; 258 $label = "<label id='aioseop_label_{$target}_{$post_id}'></label><strong><i>" . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>'; 273 $label = "<label id='aioseop_label_{$target}_{$post_id}'></label><span style='width: 20px;display: inline-block;'></span><strong><i>" . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>'; 259 274 endif; 260 275 $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$post_id}" ); 261 $output = $label . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"';262 $output .= 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __('Edit') . '">';263 $output .= '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a>';276 $output = 277 278 ; 264 279 die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() { var my_label = " . json_encode( $output ) . "; 265 280 jQuery('div#aioseop_" . $target . "_" . $post_id . "').html(my_label).fadeIn('fast'); … … 516 531 <?php $content = strip_tags( stripslashes( get_post_meta( $id, "_aioseop_" . $target, TRUE ) ) ); 517 532 if( !empty($content) ): 518 $label = "<label id='aioseop_label_{$target}_{$id}'> " . $content . '</label>';533 $label = "<label id='aioseop_label_{$target}_{$id}'>" . $content . '</label>'; 519 534 else: 520 $label = "<label id='aioseop_label_{$target}_{$id}'></label><s trong><i>No" . $target . '</i></strong>';535 $label = "<label id='aioseop_label_{$target}_{$id}'></label><s " . $target . '</i></strong>'; 521 536 endif; 522 537 $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$id}" ); 523 print $label . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' .524 $id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __('Edit') . '">' ;525 print"<img class='aioseop_edit_button'538 " href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' . 539 $id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __('Edit') . '">' 540 "<img class='aioseop_edit_button' 526 541 id='aioseop_edit_id' 527 src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a> ";542 src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a>; 528 543 ?> 529 544 </div> -
all-in-one-seo-pack/tags/2.2.6/aioseop_module.css
r1119066 r1119068 840 840 .aioseop_option_docs h3 { 841 841 background:none; 842 843 844 845 846 847 848 849 842 850 } 843 851 .aioseop_error_notice { -
all-in-one-seo-pack/tags/2.2.6/aioseop_module_class.php
r1119066 r1119068 129 129 static $charset = null; 130 130 if ( $charset == null ) $charset = get_bloginfo( 'charset' ); 131 131 $str = (string)$str; 132 132 if ( $mode == 'title' ) { 133 133 if ( function_exists( 'mb_convert_case' ) ) -
all-in-one-seo-pack/tags/2.2.6/aioseop_opengraph.php
r1119066 r1119068 79 79 "setmeta" => __( "Checking this box will use the Home Title and Home Description set in All in One SEO Pack, General Settings as the Open Graph title and description for your home page.", 'all_in_one_seo_pack' ), 80 80 "key" => __( "Your Profile Admin ID is your Facebook profile ID. You can find out your Facebook ID using the lookup tool here: https://graph.facebook.com/yourusername", 'all_in_one_seo_pack' ), 81 82 81 83 "sitename" => __( "The Site Name is the name that is used to identify your website.", 'all_in_one_seo_pack' ), 82 84 "hometitle" => __( "The Home Title is the Open Graph title for your home page.", 'all_in_one_seo_pack' ), … … 145 147 'setmeta' => Array( 'name' => __( 'Use AIOSEO Title and Description', 'all_in_one_seo_pack'), 'type' => 'checkbox' ), 146 148 'key' => Array( 'name' => __( 'Profile Admins ID', 'all_in_one_seo_pack'), 'default' => '', 'type' => 'text' ), 149 150 147 151 'sitename' => Array( 'name' => __( 'Site Name', 'all_in_one_seo_pack' ), 'default' => get_bloginfo('name'), 'type' => 'text' ), 148 152 'hometitle' => Array( 'name' => __( 'Home Title', 'all_in_one_seo_pack'), … … 216 220 $this->locations = array( 217 221 'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 218 'options' => Array('scan_header', 'setmeta', 'key', 'sitename', ' hometitle', 'description', 'homeimage', 'hometag', 'generate_descriptions', 'defimg',222 'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'hometag', 'generate_descriptions', 'defimg', 219 223 'fallback', 'dimg', 'meta_key', 'categories', 'defcard', 'twitter_site', 'twitter_creator', 'twitter_domain', 'gen_tags', 'gen_keywords', 'gen_categories', 220 224 'gen_post_tags', 'types', 'facebook_publisher', 'facebook_author' ) ), … … 463 467 /* If Use AIOSEO Title and Desc Selected */ 464 468 if( $setmeta ) { 465 $title = $aios eop_options['aiosp_home_title'];469 $title = $aios; 466 470 if ( $first_page ) 467 $description = $aios eop_options['aiosp_home_description'];471 $description = $aios; 468 472 } 469 473 … … 472 476 if( empty($sitename) ) $sitename = get_bloginfo('name'); 473 477 474 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) && !empty( $post ) && !empty( $post->post_content ) )478 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) && !empty( $post ) && !empty( $post->post_content ) ) 475 479 $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 ); 476 480 … … 524 528 /* Add some defaults */ 525 529 if ( empty( $title ) ) $title = get_the_title(); 526 if ( empty( $description ) && ( $this->options['aiosp_opengraph_generate_descriptions'] ) )530 if ( empty( $description ) && ( $this->options['aiosp_opengraph_generate_descriptions'] ) ) 527 531 $description = $post->post_content; 528 532 if ( empty( $type ) ) $type = 'article'; … … 550 554 $tag = $aiosp->clean_keyword_list( $tag ); 551 555 } 552 if ( !empty( $description ) ) 553 $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 ); 554 556 557 if ( !empty( $this->options['aiosp_opengraph_title_shortcodes'] ) ) { 558 $title = do_shortcode( $title ); 559 } 560 561 if ( !empty( $description ) ) { 562 $description = $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ); 563 if ( !empty( $this->options['aiosp_opengraph_description_shortcodes'] ) ) { 564 $description = do_shortcode( $description ); 565 } 566 $description = $aiosp->trim_excerpt_without_filters( $description, 1000 ); 567 } 568 555 569 $title = $this->apply_cf_fields( $title ); 556 570 $description = $this->apply_cf_fields( $description ); -
all-in-one-seo-pack/tags/2.2.6/all_in_one_seo_pack.php
r1119066 r1119068 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. 5.16 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. 5.133 * @version 2.2. 34 34 */ 35 36 35 37 36 38 global $aioseop_plugin_name; … … 40 42 41 43 if ( ! defined( 'AIOSEOP_VERSION' ) ) 42 define( 'AIOSEOP_VERSION', '2.2. 5.1' );44 define( 'AIOSEOP_VERSION', '2.2.' ); 43 45 44 46 if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) { -
all-in-one-seo-pack/tags/2.2.6/quickedit_functions.js
r1119066 r1119068 3 3 var post_title = jQuery('#aioseop_label_' + meta + '_' + post_id).text(); 4 4 var element = uform.html(); var input; 5 input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:1 0px;width:65%;float:left" rows=2 cols=16>' + post_title + '</textarea>';5 input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:1>' + post_title + '</textarea>'; 6 6 input += '<label style="float:left">'; 7 7 input += '<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+meta+'_save_' + post_id + '" >'; … … 11 11 input += '</label>'; 12 12 uform.html( input ); 13 13 14 jQuery('#aioseop_'+meta+'_cancel_' + post_id).click(function() { 14 15 uform.html( element ); 16 15 17 }); 16 18 jQuery('#aioseop_'+meta+'_save_' + post_id).click(function() { … … 40 42 }) 41 43 jQuery("div#aioseop_"+m+"_"+p).html(loading); 44 45 42 46 }) 43 47 }; -
all-in-one-seo-pack/tags/2.2.6/readme.txt
r1119066 r1119068 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: 4.1 6 Tested up to: 4.1 7 7 Stable tag: trunk 8 8 -
all-in-one-seo-pack/trunk/aioseop_class.php
r1079109 r1119068 76 76 "customize_canonical_links"=> __( "Checking this option will allow you to customize Canonical URLs for specific posts.", 'all_in_one_seo_pack'), 77 77 "can_set_protocol" => __( "Set protocol for canonical URLs.", 'all_in_one_seo_pack' ), 78 "use_original_title" => __( "Use wp_title to set the title; disable this option if you run into conflicts with the title being set by your theme or another plugin.", 'all_in_one_seo_pack' ),78 "use_original_title" => __( "Use wp_title to .", 'all_in_one_seo_pack' ), 79 79 "do_log" => __( "Check this and All in One SEO Pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging. Make sure this directory is writable.", 'all_in_one_seo_pack' ), 80 80 "home_title" => __( "As the name implies, this will be the Meta Title of your homepage. This is independent of any other option. If not set, the default Site Title (found in WordPress under Settings, General, Site Title) will be used.", 'all_in_one_seo_pack' ), 81 81 "home_description" => __( "This will be the Meta Description for your homepage. This is independent of any other option. The default is no Meta Description at all if this is not set.", 'all_in_one_seo_pack' ), 82 82 "home_keywords" => __( "Enter a comma separated list of your most important keywords for your site that will be written as Meta Keywords on your homepage. Don\'t stuff everything in here.", 'all_in_one_seo_pack' ), 83 83 84 "togglekeywords" => __( "This option allows you to toggle the use of Meta Keywords throughout the whole of the site.", 'all_in_one_seo_pack' ), 84 85 "use_categories" => __( "Check this if you want your categories for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all_in_one_seo_pack' ), 85 86 "use_tags_as_keywords" => __( "Check this if you want your tags for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all_in_one_seo_pack' ), 86 "dynamic_postspage_keywords"=> __( "Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.", 'all_in_one_seo_pack'),87 "dynamic_postspage_keywords"=> __( "Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.", 'all_in_one_seo_pack'), 87 88 "rewrite_titles" => __( "Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the title bar and in the source code. If enabled, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: Using the default post title format below, Rewrite Titles will write all post titles as 'Post Title | Blog Name'. If you have manually defined a title using All in One SEO Pack, this will become the title of your post in the format string.", 'all_in_one_seo_pack' ), 88 89 "cap_titles" => __( "Check this and Search Page Titles and Tag Page Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack' ), 89 90 "cap_cats" => __( "Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack'), 91 92 93 94 95 96 97 98 99 100 90 101 "page_title_format" => 91 102 __( "This controls the format of the title tag for Pages.<br />The following macros are supported:", 'all_in_one_seo_pack' ) … … 93 104 __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' . 94 105 __( '%page_title% - The original title of the page', 'all_in_one_seo_pack' ) . '</li><li>' . 95 __( '%category_title% - The (main) category of the page', 'all_in_one_seo_pack' ) . '</li><li>' .96 __( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .97 106 __( "%page_author_login% - This page's author' login", 'all_in_one_seo_pack' ) . '</li><li>' . 98 107 __( "%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' . … … 310 319 'name' => __( 'Home Title:', 'all_in_one_seo_pack' ), 311 320 'default' => null, 'type' => 'textarea', 'sanitize' => 'text', 312 'count' => true, 'rows' => 1, 'cols' => 60 ), 321 'count' => true, 'rows' => 1, 'cols' => 60, 322 'condshow' => Array( "aiosp_use_static_home_info" => 0 ) ), 313 323 "home_description"=> Array( 314 324 'name' => __( 'Home Description:', 'all_in_one_seo_pack' ), 315 325 'default' => '', 'type' => 'textarea', 'sanitize' => 'text', 316 'count' => true, 'cols' => 80, 'rows' => 2 ), 326 'count' => true, 'cols' => 80, 'rows' => 2, 327 'condshow' => Array( "aiosp_use_static_home_info" => 0 ) ), 317 328 "togglekeywords" => Array( 318 329 'name' => __( 'Use Keywords:', 'all_in_one_seo_pack' ), … … 325 336 'name' => __( 'Home Keywords (comma separated):', 'all_in_one_seo_pack' ), 326 337 'default' => null, 'type' => 'textarea', 'sanitize' => 'text', 327 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ), 338 'condshow' => Array( "aiosp_togglekeywords" => 0, "aiosp_use_static_home_info" => 0 ) ), 339 "use_static_home_info" => Array( 340 'name' => __( "Use Static Front Page Instead", 'all_in_one_seo_pack' ), 341 'default' => 0, 342 'type' => 'radio', 343 'initial_options' => Array( 1 => __( 'Enabled', 'all_in_one_seo_pack' ), 344 0 => __( 'Disabled', 'all_in_one_seo_pack' ) ) 345 ), 328 346 "can"=> Array( 329 347 'name' => __( 'Canonical URLs:', 'all_in_one_seo_pack' ), … … 372 390 "cap_cats"=> Array( 373 391 'name' => __( 'Capitalize Category Titles:', 'all_in_one_seo_pack' ), 'default' => 1), 392 393 394 395 374 396 "page_title_format"=> Array( 375 397 'name' => __( 'Page Title Format:', 'all_in_one_seo_pack' ), … … 423 445 0 => __( 'Disabled', 'all_in_one_seo_pack' ) ) 424 446 ), 447 448 449 450 451 425 452 "cpostadvanced" => Array( 426 453 'name' => __( 'Enable Advanced Options:', 'all_in_one_seo_pack' ), … … 430 457 'label' => null, 431 458 'condshow' => Array( "aiosp_enablecpost" => 'on' ) 432 ),433 "cpostactive" => Array(434 'name' => __( 'SEO on only these post types:', 'all_in_one_seo_pack' ),435 'type' => 'multicheckbox', 'default' => array('post', 'page'),436 'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )437 459 ), 438 460 "cpostnoindex" => Array( … … 571 593 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ), 572 594 "dynamic_postspage_keywords"=> Array( 573 'name' => __( 'Dynamically Generate Keywords for Posts Page :', 'all_in_one_seo_pack' ),595 'name' => __( 'Dynamically Generate Keywords for Posts Page:', 'all_in_one_seo_pack' ), 574 596 'default' => 1, 575 597 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ), … … 662 684 jQuery(document).ready(function() { 663 685 jQuery("#aiosp_title_wrapper").bind("input", function() { 664 jQuery("#aios eop_snippet_title").text(jQuery("#aiosp_title_wrapper input").val().replace(/<(?:.|\n)*?>/gm, ""));686 jQuery("#aiosp_snippet_title").text(jQuery("#aiosp_title_wrapper input").val().replace(/<(?:.|\n)*?>/gm, "")); 665 687 }); 666 688 jQuery("#aiosp_description_wrapper").bind("input", function() { … … 672 694 'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ), 673 695 'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ), 696 674 697 'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all_in_one_seo_pack' ), 'type' => 'text' ), 675 698 'custom_link' => Array( 'name' => __( 'Custom Canonical URL', 'all_in_one_seo_pack' ), 'type' => 'text', 'size' => 60 ), … … 699 722 'name' => __( 'Home Page Settings', 'all_in_one_seo_pack' ), 700 723 'help_link' => 'http://semperplugins.com/documentation/home-page-settings/', 701 'options' => Array( 'home_title', 'home_description', 'home_keywords' )724 'options' => Array( 'home_title', 'home_description', 'home_keywords' ) 702 725 ), 703 726 'keywords' => Array( … … 709 732 'name' => __( 'Title Settings', 'all_in_one_seo_pack' ), 710 733 'help_link' => 'http://semperplugins.com/documentation/title-settings/', 711 'options' => Array( "rewrite_titles", "force_rewrites", "cap_titles", "cap_cats", " page_title_format", "post_title_format", "category_title_format", "archive_title_format", "date_title_format", "author_title_format",734 'options' => Array( "rewrite_titles", "force_rewrites", "cap_titles", "cap_cats", "page_title_format", "post_title_format", "category_title_format", "archive_title_format", "date_title_format", "author_title_format", 712 735 "tag_title_format", "search_title_format", "description_format", "404_title_format", "paged_format" ) 713 736 ), … … 765 788 return $info; 766 789 global $post, $aioseop_options, $wp_query; 767 $title = $url = $description = $term = '';790 $title = $url = $description = $term = ''; 768 791 $p = $post; $w = $wp_query; 769 792 if ( !is_object( $post ) ) $post = $this->get_queried_object(); … … 776 799 $opts = $this->meta_opts; 777 800 $post_id = $p->ID; 778 if ( ! $post->post_modified_gmt != '')801 if ( ) 779 802 $wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) ); 780 803 if ( $post->post_type == 'page' ) … … 805 828 $title_format = $aioseop_options['aiosp_page_title_format']; 806 829 elseif ( is_single() || is_attachment() ) 807 $title_format = $this->get_post_title_format( );830 $title_format = $this->get_post_title_format(); 808 831 } 809 832 if ( empty( $title_format ) ) { 810 833 $title_format = '%post_title%'; 811 834 } 835 836 837 838 812 839 } else if ( is_object( $term ) ) { 813 840 if ( $_GET['taxonomy'] == 'category' ) { … … 846 873 $keywords = apply_filters( 'aioseop_keywords', $keywords ); 847 874 875 876 848 877 wp_reset_postdata(); 849 878 $wp_query = $w; $post = $p; 850 $info = Array( 'title' => $title, 'description' => $description, 'keywords' => $keywords, 'url' => $url, 'title_format' => $title_format );851 879 return $info; 852 880 } … … 866 894 $extra_title_len = 0; 867 895 if ( empty( $title_format ) ) { 868 $title = '<span id=" aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title) ) . '</span>';896 $title = '<span id=" ) ) . '</span>'; 869 897 } else { 870 898 if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format ); 871 899 $title_format = $this->apply_cf_fields( $title_format ); 872 $replace_title = '<span id=" aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title) ) . '</span>';900 $replace_title = '<span id=" ) ) . '</span>'; 873 901 if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format ); 874 902 if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format ); 875 if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format ); 876 if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format ); 903 if ( $w->is_category || $w->is_tag || $w->is_tax ) { 904 if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format ); 905 if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format ); 906 } else { 907 if ( strpos( $title_format, '%category%' ) !== false ) $title_format = str_replace( '%category%', $category, $title_format ); 908 if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $category, $title_format ); 909 if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $category, $title_format ); 910 } 877 911 if ( strpos( $title_format, '%taxonomy_description%' ) !== false ) $title_format = str_replace( '%taxonomy_description%', $description, $title_format ); 878 912 … … 1035 1069 __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' . 1036 1070 __( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' . 1037 __( '%category_title% - The (main) category of the post', 'all_in_one_seo_pack' ) . '</li><li>' .1038 __( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .1039 1071 __( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' . 1040 1072 __( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' . … … 1324 1356 $wp_post_types = get_post_types( Array( '_builtin' => true ) ); // don't display meta if SEO isn't enabled on custom post types -- pdb 1325 1357 if( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false; 1326 } else if ( !empty( $aioseop_options['aiosp_cpostadvanced'] ) ){1358 } else { 1327 1359 $wp_post_types = $aioseop_options['aiosp_cpostactive']; 1328 1360 if ( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false; … … 1412 1444 if ( isset( $this->is_front_page ) && $this->is_front_page !== null ) return $this->is_front_page; 1413 1445 $post = $this->get_queried_object(); 1414 $this->is_front_page = ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) );1446 $this->is_front_page = ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) ); 1415 1447 return $this->is_front_page; 1416 1448 } … … 1420 1452 if ( $is_posts_page !== null ) return $is_posts_page; 1421 1453 $post = $this->get_queried_object(); 1422 $is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && $post->ID == get_option( 'page_for_posts' ) );1454 $is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && $post->ID == get_option( 'page_for_posts' ) ); 1423 1455 return $is_posts_page; 1424 1456 } … … 1613 1645 $description = $this->internationalize( get_the_author_meta( 'description' ) ); 1614 1646 } else if ( is_front_page() ) { 1615 $description = trim( stripslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ));1647 $description = ); 1616 1648 } else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) { 1617 1649 $description = $this->get_post_description( $post ); … … 1669 1701 $opts = $this->meta_opts; 1670 1702 if ( ( ( is_front_page() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() ) ) { 1671 $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) ); 1672 } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && ($this->is_static_posts_page() || is_archive() || is_post_type_archive() ) ) { 1673 $keywords = stripslashes( $this->internationalize( $opts["aiosp_keywords"] ) ); // and if option = use page set keywords instead of keywords from recent posts 1703 if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) { 1704 $keywords = $this->get_all_keywords(); 1705 } else { 1706 $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) ); 1707 } 1708 } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && $this->is_static_posts_page() ) { 1709 $keywords = stripslashes( $this->internationalize( $opts["aiosp_keywords"] ) ); // and if option = use page set keywords instead of keywords from recent posts 1674 1710 } elseif ( ( $blog_page = $this->get_blog_page( $post ) ) && empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) { 1675 $keywords = stripslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) ); 1711 $keywords = stripslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) ); 1712 } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && ( is_archive() || is_post_type_archive() ) ) { 1713 $keywords = ""; 1676 1714 } else { 1677 1715 $keywords = $this->get_all_keywords(); … … 2278 2316 return false; 2279 2317 } 2318 2319 2320 2321 2322 2323 2324 2325 2280 2326 } elseif ( ( $query->is_single || $query->is_page ) && $haspost ) { 2281 2327 $post = $query->posts[0]; … … 2300 2346 } elseif ( $query->is_year && $haspost ) { 2301 2347 $link = get_year_link( get_query_var( 'year' ) ); 2302 } elseif ( $query->is_home ) {2303 if ( (get_option( 'show_on_front' ) == 'page' ) &&2304 ( $pageid = get_option( 'page_for_posts' ) ) ) {2305 $link = get_permalink( $pageid );2306 } else {2307 if ( function_exists( 'icl_get_home_url' ) ) {2308 $link = icl_get_home_url();2309 } else {2310 $link = trailingslashit( home_url() );2311 }2312 }2313 2348 } elseif ( $query->is_tax && $haspost ) { 2314 2349 $taxonomy = get_query_var( 'taxonomy' ); … … 2360 2395 return $link; 2361 2396 } 2362 2397 2398 function is_singular( $post_types = Array(), $post = null ) { 2399 if ( !empty( $post_types ) && is_object( $post ) ) 2400 return in_array( $post->post_type, (array)$post_types ); 2401 else 2402 return is_singular( $post_types ); 2403 } 2404 2363 2405 function show_page_description() { 2364 2406 global $aioseop_options; … … 2373 2415 function get_post_description( $post ) { 2374 2416 global $aioseop_options; 2375 2417 $description = ''; 2376 2418 if ( !$this->show_page_description() ) 2377 2419 return ''; 2378 2420 2379 2421 $description = trim( stripslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) ); 2422 2423 2424 2380 2425 if ( !$description ) { 2381 2426 if ( empty( $aioseop_options["aiosp_skip_excerpt"] ) ) … … 2415 2460 $post = $GLOBALS["post"]; 2416 2461 $blog_page = $this->get_blog_page(); 2417 if ( $this->is_static_front_page() ) 2462 $description = ''; 2463 if ( $this->is_static_front_page() && empty( $aioseop_options['aiosp_use_static_home_info'] ) ) 2418 2464 $description = trim( stripslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) ); 2419 2465 elseif ( !empty( $blog_page ) ) … … 2447 2493 $in = polyglot_filter( $in ); 2448 2494 2449 if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) 2495 if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) 2450 2496 $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in ); 2497 2498 2499 2500 2501 2451 2502 2452 2503 return apply_filters( 'localization', $in ); … … 2454 2505 2455 2506 /** @return The original title as delivered by WP (well, in most cases) */ 2456 function get_original_title( $sep = ' ', $echo = false, $seplocation = '' ) {2507 function get_original_title( $sep = '', $echo = false, $seplocation = '' ) { 2457 2508 global $aioseop_options; 2458 2509 if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) { … … 2460 2511 if ( $has_filter !== false ) 2461 2512 remove_filter( 'wp_title', Array( $this, 'wp_title' ), $has_filter ); 2513 2514 2515 2516 2517 2462 2518 $title = wp_title( $sep, $echo, $seplocation ); 2463 2519 if ( $has_filter !== false ) … … 2561 2617 if ( strpos( $title, '%blog_title%' ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); 2562 2618 if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); 2563 $title = trim( wp_strip_all_tags( $title ) ); 2564 $title = str_replace( Array( '"', "\r\n", "\n" ), Array( '"', ' ', ' ' ), $title ); 2619 $title = wp_strip_all_tags( $title ); 2565 2620 return $this->paged_title( $title ); 2566 2621 } … … 2591 2646 } 2592 2647 2593 function get_post_title_format( $title_type = 'post' ) {2648 function get_post_title_format( $title_type = 'post' ) { 2594 2649 global $aioseop_options; 2595 2650 if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) return false; … … 2597 2652 if ( isset( $aioseop_options["aiosp_{$title_type}_title_format"] ) ) 2598 2653 $title_format = $aioseop_options["aiosp_{$title_type}_title_format"]; 2599 if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cposta dvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {2654 if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) { 2600 2655 $wp_post_types = $aioseop_options['aiosp_cpostactive']; 2601 2656 if ( !empty( $aioseop_options["aiosp_cposttitles"] ) ) { 2602 2657 if ( ( ( $title_type == 'archive' ) && is_post_type_archive( $wp_post_types ) && $prefix = "aiosp_{$title_type}_" ) || 2603 ( ( $title_type == 'post' ) && is_singular( $wp_post_types ) && $prefix = "aiosp_" ) ) { 2604 $post_type = get_post_type(); 2605 if ( !empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) 2606 $title_format = $aioseop_options["{$prefix}{$post_type}_title_format"]; 2658 ( ( $title_type == 'post' ) && $this->is_singular( $wp_post_types, $p ) && $prefix = "aiosp_" ) ) { 2659 $post_type = get_post_type( $p ); 2660 if ( !empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) { 2661 $title_format = $aioseop_options["{$prefix}{$post_type}_title_format"]; 2662 } 2607 2663 } 2608 2664 } … … 2629 2685 $post = $p; 2630 2686 } 2631 $title_format = $this->get_post_title_format( );2687 $title_format = $this->get_post_title_format(); 2632 2688 if ( !empty( $post ) ) 2633 2689 $authordata = get_userdata( $post->post_author ); … … 2640 2696 } 2641 2697 2642 function apply_page_title_format( $title, $p = null ) {2698 function apply_page_title_format( $title, $p = null ) { 2643 2699 global $aioseop_options; 2644 2700 if ( $p === null ) { … … 2647 2703 $post = $p; 2648 2704 } 2649 $title_format = $aioseop_options['aiosp_page_title_format']; 2705 if ( empty( $title_format ) ) 2706 $title_format = $aioseop_options['aiosp_page_title_format']; 2650 2707 if ( !empty( $post ) ) 2651 2708 $authordata = get_userdata( $post->post_author ); … … 2670 2727 $opts = $this->meta_opts; 2671 2728 if ( is_front_page() ) { 2672 $title = $this->internationalize( $aioseop_options['aiosp_home_title'] ); 2729 if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) { 2730 global $post; 2731 if ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) ) { 2732 $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) ); 2733 if ( !$title ) $title = $this->internationalize( $post->post_title ); 2734 if ( !$title ) $title = $this->internationalize( $this->get_original_title( '', false ) ); 2735 if ( !empty( $aioseop_options['aiosp_home_page_title_format'] ) ) 2736 $title = $this->apply_page_title_format( $title, $post, $aioseop_options['aiosp_home_page_title_format'] ); 2737 $title = $this->paged_title( $title ); 2738 $title = apply_filters( 'aioseop_home_page_title', $title ); 2739 } 2740 } else { 2741 $title = $this->internationalize( $aioseop_options['aiosp_home_title'] ); 2742 if ( !empty( $aioseop_options['aiosp_home_page_title_format'] ) ) 2743 $title = $this->apply_page_title_format( $title, null, $aioseop_options['aiosp_home_page_title_format'] ); 2744 } 2673 2745 if (empty( $title ) ) 2674 2746 $title = $this->internationalize( get_option( 'blogname' ) ) . ' | ' . $this->internationalize( get_bloginfo( 'description' ) ); … … 2685 2757 if ( $post === null ) return false; 2686 2758 if ( ( $this->is_static_front_page() ) && ( $home_title = $this->internationalize( $aioseop_options['aiosp_home_title'] ) ) ) { 2759 2760 2687 2761 //home title filter 2688 2762 return apply_filters( 'aioseop_home_page_title', $home_title ); … … 2723 2797 // we're not in the loop :( 2724 2798 if ( $post === null ) return false; 2725 $categories = get_the_category();2799 $categories = (); 2726 2800 $category = ''; 2727 if ( count( $categories ) > 0 ) { 2728 $category = $categories[0]->cat_name; 2729 } 2801 if ( count( $categories ) > 0 ) 2802 $category = $categories[0]; 2730 2803 $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) ); 2731 2804 if ( !$title ) { … … 2934 3007 function get_all_categories( $id = 0 ) { 2935 3008 $keywords = Array(); 2936 $categories = get_the_category( $id ); 2937 foreach ( $categories as $category ) 2938 $keywords[] = $this->internationalize( $category->cat_name ); 3009 $categories = get_the_category( $id ); 3010 if ( !empty( $categories ) ) 3011 foreach ( $categories as $category ) 3012 $keywords[] = $this->internationalize( $category->cat_name ); 2939 3013 return $keywords; 2940 3014 } … … 2943 3017 $keywords = Array(); 2944 3018 $tags = get_the_tags( $id ); 2945 if ( $tags&& is_array( $tags) )3019 if ( && is_array( $tags) ) 2946 3020 foreach ( $tags as $tag ) 2947 3021 $keywords[] = $this->internationalize( $tag->name ); … … 2975 3049 $opts = $this->meta_opts; 2976 3050 if ( !empty( $opts["aiosp_keywords"] ) ) { 2977 $traverse = $this->keyword_string_to_list( $ opts["aiosp_keywords"]);3051 $traverse = $this->keyword_string_to_list( $ ); 2978 3052 if ( !empty( $traverse ) ) 2979 3053 foreach ( $traverse as $keyword ) $keywords[] = $keyword; -
all-in-one-seo-pack/trunk/aioseop_functions.php
r1074299 r1119068 156 156 ?><style> 157 157 .aioseop_edit_button { 158 margin: 0 0 0 5px; 159 opacity: 0.6; 160 width: 12px; 158 margin: 0 0 0 5px; 159 opacity: 0.6; 160 width: 12px; 161 } 162 .aioseop_edit_link { 163 display: inline-block; 164 position: absolute; 161 165 } 162 166 .aioseop_mpc_SEO_admin_options_edit img { … … 168 172 display: block; 169 173 opacity: 1; 174 175 176 177 178 179 180 170 181 } 171 182 .aioseop_mpc_admin_meta_content { … … 173 184 width: 100%; 174 185 margin: 0 0 10px 0; 175 } 186 } 187 td.seotitle.column-seotitle, 188 td.seodesc.column-seodesc, 189 td.seokeywords.column-seokeywords { 190 overflow: visible; 191 } 176 192 </style> 177 193 <?php wp_print_scripts( Array( 'sack' ) ); … … 210 226 if ( !function_exists( 'aioseop_output_notice' ) ) { 211 227 function aioseop_output_notice( $message, $id = '', $class = "updated fade" ) { 228 212 229 if ( !empty( $class ) ) $class = ' class="' . esc_attr( $class ) . '"'; 213 230 if ( !empty( $id ) ) $class .= ' id="' . esc_attr( $id ) . '"'; 214 231 $dismiss = ' '; 215 echo "<div{$class}>" . wp_kses_post( $message ) . "< /div>";232 echo "<div{$class}>" . wp_kses_post( $message ) . "</div>"; 216 233 return true; 217 234 } … … 231 248 $qa['aioseop_ignore_notice'] = $msgid; 232 249 $url = '?' . build_query( $qa ); 233 $message .= ' <a class="alignright" href="' . $url . '">Dismiss</a>';250 $message >'; 234 251 } 235 252 return aioseop_output_notice( $message, $id, $class ); 236 253 } 237 254 } 238 239 255 if ( !function_exists( 'aioseop_ajax_save_meta' ) ) { 240 256 function aioseop_ajax_save_meta() { … … 253 269 } 254 270 if( $result != '' ): 255 $label = "<label id='aioseop_label_{$target}_{$post_id}'> " . $result . '</label>';271 $label = "<label id='aioseop_label_{$target}_{$post_id}'>" . $result . '</label>'; 256 272 else: 257 $label = ''; 258 $label = "<label id='aioseop_label_{$target}_{$post_id}'></label><strong><i>" . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>'; 273 $label = "<label id='aioseop_label_{$target}_{$post_id}'></label><span style='width: 20px;display: inline-block;'></span><strong><i>" . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>'; 259 274 endif; 260 275 $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$post_id}" ); 261 $output = $label . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"';262 $output .= 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __('Edit') . '">';263 $output .= '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a>';276 $output = 277 278 ; 264 279 die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() { var my_label = " . json_encode( $output ) . "; 265 280 jQuery('div#aioseop_" . $target . "_" . $post_id . "').html(my_label).fadeIn('fast'); … … 516 531 <?php $content = strip_tags( stripslashes( get_post_meta( $id, "_aioseop_" . $target, TRUE ) ) ); 517 532 if( !empty($content) ): 518 $label = "<label id='aioseop_label_{$target}_{$id}'> " . $content . '</label>';533 $label = "<label id='aioseop_label_{$target}_{$id}'>" . $content . '</label>'; 519 534 else: 520 $label = "<label id='aioseop_label_{$target}_{$id}'></label><s trong><i>No" . $target . '</i></strong>';535 $label = "<label id='aioseop_label_{$target}_{$id}'></label><s " . $target . '</i></strong>'; 521 536 endif; 522 537 $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$id}" ); 523 print $label . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' .524 $id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __('Edit') . '">' ;525 print"<img class='aioseop_edit_button'538 " href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' . 539 $id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __('Edit') . '">' 540 "<img class='aioseop_edit_button' 526 541 id='aioseop_edit_id' 527 src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a> ";542 src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a>; 528 543 ?> 529 544 </div> -
all-in-one-seo-pack/trunk/aioseop_module.css
r1074299 r1119068 840 840 .aioseop_option_docs h3 { 841 841 background:none; 842 843 844 845 846 847 848 849 842 850 } 843 851 .aioseop_error_notice { -
all-in-one-seo-pack/trunk/aioseop_module_class.php
r1079109 r1119068 129 129 static $charset = null; 130 130 if ( $charset == null ) $charset = get_bloginfo( 'charset' ); 131 131 $str = (string)$str; 132 132 if ( $mode == 'title' ) { 133 133 if ( function_exists( 'mb_convert_case' ) ) -
all-in-one-seo-pack/trunk/aioseop_opengraph.php
r1079109 r1119068 79 79 "setmeta" => __( "Checking this box will use the Home Title and Home Description set in All in One SEO Pack, General Settings as the Open Graph title and description for your home page.", 'all_in_one_seo_pack' ), 80 80 "key" => __( "Your Profile Admin ID is your Facebook profile ID. You can find out your Facebook ID using the lookup tool here: https://graph.facebook.com/yourusername", 'all_in_one_seo_pack' ), 81 82 81 83 "sitename" => __( "The Site Name is the name that is used to identify your website.", 'all_in_one_seo_pack' ), 82 84 "hometitle" => __( "The Home Title is the Open Graph title for your home page.", 'all_in_one_seo_pack' ), … … 145 147 'setmeta' => Array( 'name' => __( 'Use AIOSEO Title and Description', 'all_in_one_seo_pack'), 'type' => 'checkbox' ), 146 148 'key' => Array( 'name' => __( 'Profile Admins ID', 'all_in_one_seo_pack'), 'default' => '', 'type' => 'text' ), 149 150 147 151 'sitename' => Array( 'name' => __( 'Site Name', 'all_in_one_seo_pack' ), 'default' => get_bloginfo('name'), 'type' => 'text' ), 148 152 'hometitle' => Array( 'name' => __( 'Home Title', 'all_in_one_seo_pack'), … … 216 220 $this->locations = array( 217 221 'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 218 'options' => Array('scan_header', 'setmeta', 'key', 'sitename', ' hometitle', 'description', 'homeimage', 'hometag', 'generate_descriptions', 'defimg',222 'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'hometag', 'generate_descriptions', 'defimg', 219 223 'fallback', 'dimg', 'meta_key', 'categories', 'defcard', 'twitter_site', 'twitter_creator', 'twitter_domain', 'gen_tags', 'gen_keywords', 'gen_categories', 220 224 'gen_post_tags', 'types', 'facebook_publisher', 'facebook_author' ) ), … … 463 467 /* If Use AIOSEO Title and Desc Selected */ 464 468 if( $setmeta ) { 465 $title = $aios eop_options['aiosp_home_title'];469 $title = $aios; 466 470 if ( $first_page ) 467 $description = $aios eop_options['aiosp_home_description'];471 $description = $aios; 468 472 } 469 473 … … 472 476 if( empty($sitename) ) $sitename = get_bloginfo('name'); 473 477 474 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) && !empty( $post ) && !empty( $post->post_content ) )478 if ( empty( $description ) && $first_page && ( !empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) && !empty( $post ) && !empty( $post->post_content ) ) 475 479 $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 ); 476 480 … … 524 528 /* Add some defaults */ 525 529 if ( empty( $title ) ) $title = get_the_title(); 526 if ( empty( $description ) && ( $this->options['aiosp_opengraph_generate_descriptions'] ) )530 if ( empty( $description ) && ( $this->options['aiosp_opengraph_generate_descriptions'] ) ) 527 531 $description = $post->post_content; 528 532 if ( empty( $type ) ) $type = 'article'; … … 550 554 $tag = $aiosp->clean_keyword_list( $tag ); 551 555 } 552 if ( !empty( $description ) ) 553 $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 ); 554 556 557 if ( !empty( $this->options['aiosp_opengraph_title_shortcodes'] ) ) { 558 $title = do_shortcode( $title ); 559 } 560 561 if ( !empty( $description ) ) { 562 $description = $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ); 563 if ( !empty( $this->options['aiosp_opengraph_description_shortcodes'] ) ) { 564 $description = do_shortcode( $description ); 565 } 566 $description = $aiosp->trim_excerpt_without_filters( $description, 1000 ); 567 } 568 555 569 $title = $this->apply_cf_fields( $title ); 556 570 $description = $this->apply_cf_fields( $description ); -
all-in-one-seo-pack/trunk/all_in_one_seo_pack.php
r1079109 r1119068 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. 5.16 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. 5.133 * @version 2.2. 34 34 */ 35 36 35 37 36 38 global $aioseop_plugin_name; … … 40 42 41 43 if ( ! defined( 'AIOSEOP_VERSION' ) ) 42 define( 'AIOSEOP_VERSION', '2.2. 5.1' );44 define( 'AIOSEOP_VERSION', '2.2.' ); 43 45 44 46 if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) { -
all-in-one-seo-pack/trunk/quickedit_functions.js
r948965 r1119068 3 3 var post_title = jQuery('#aioseop_label_' + meta + '_' + post_id).text(); 4 4 var element = uform.html(); var input; 5 input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:1 0px;width:65%;float:left" rows=2 cols=16>' + post_title + '</textarea>';5 input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:1>' + post_title + '</textarea>'; 6 6 input += '<label style="float:left">'; 7 7 input += '<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+meta+'_save_' + post_id + '" >'; … … 11 11 input += '</label>'; 12 12 uform.html( input ); 13 13 14 jQuery('#aioseop_'+meta+'_cancel_' + post_id).click(function() { 14 15 uform.html( element ); 16 15 17 }); 16 18 jQuery('#aioseop_'+meta+'_save_' + post_id).click(function() { … … 40 42 }) 41 43 jQuery("div#aioseop_"+m+"_"+p).html(loading); 44 45 42 46 }) 43 47 }; -
all-in-one-seo-pack/trunk/readme.txt
r1079109 r1119068 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: 4.1 6 Tested up to: 4.1 7 7 Stable tag: trunk 8 8
Note: See TracChangeset
for help on using the changeset viewer.