Plugin Directory

Changeset 970845

Timestamp:
08/22/2014 05:39:25 PM (10 years ago)
Author:
pbaylies
Message:

Released 2.2.3, updated tags; improved description format, tax descriptions, title sanitization; global noodp, noydir options; option to run shortcodes for autogenerated descriptions.

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  
    195195            "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' ),
    196196            "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
    197199            "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
    198201            "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' ),
    199202            "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' ),
     
    467470                'name' => __( 'Use nofollow for paginated pages/posts:', 'all_in_one_seo_pack' ),
    468471                'default' => 0),
     472
     473
     474
     475
     476
     477
    469478            "generate_descriptions"=> Array(
    470479                'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ),
    471480                'default' => 1),
     481
     482
     483
     484
    472485            "hide_paginated_descriptions"=> Array(
    473486                'name' => __( 'Remove Descriptions For Paginated Pages:', 'all_in_one_seo_pack' ),
     
    595608                        'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
    596609                        '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' )
    598611                    ),
    599612                'advanced' => Array(
    600613                        'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
    601614                        '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' )
    603616                    )
    604617                );
     
    701714            $extra_title_len = 0;
    702715            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>';
    704717            } else {
    705718                if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
    706719                $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>';
    708721                if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format );
    709722                if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format );
     
    715728            }
    716729           
    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 ) ) );
    718731            $extra_title_len = (int)$extra_title_len;
    719732            $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
     
    13091322           
    13101323            if ( isset($description) && ( $this->strlen($description) > $this->minimum_description_length ) && !( $is_front_page && is_paged() ) ) {
    1311                 $description = trim( strip_tags( $description ) );
    1312                 $description = str_replace( '"', '&quot;', $description );
    1313 
    1314                 // replace newlines on mac / windows?
    1315                 $description = str_replace( "\r\n", ' ', $description );
    1316 
    1317                 // maybe linux uses this alone
    1318                 $description = str_replace( "\n", ' ', $description );
    1319 
    1320                 if ( !isset( $meta_string) ) {
    1321                     $meta_string = '';
    1322                 }
    1323 
    13241324                // description format
    13251325                $description_format = $aioseop_options['aiosp_description_format'];
     
    13271327                    $description_format = "%description%";
    13281328                }
     1329
    13291330                $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
    13301331                if ( strpos( $description, '%blog_title%'       ) !== false ) $description = str_replace( '%blog_title%',       get_bloginfo( 'name' ), $description );
     
    13321333                if ( strpos( $description, '%wp_title%'         ) !== false ) $description = str_replace( '%wp_title%',         $this->get_original_title(), $description );
    13331334                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
    13341349                if( $aioseop_options['aiosp_can'] && is_attachment() ) {
    13351350                    $url = $this->aiosp_mrt_get_url( $wp_query );
     
    13731388
    13741389            $robots_meta = '';
     1390
     1391
     1392
     1393
    13751394            if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
    13761395                && ( ( 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            ) ) {
    13801399                $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                }
    13851406                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 = '';
    13901407                    if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
    13911408                         ( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
     
    13941411                         ( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
    13951412                        $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;
    14021420            if ( $robots_meta == 'index,follow' ) $robots_meta = '';
    14031421           
     
    20702088            $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
    20712089            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 ) );
    20732094            }
    20742095        }
     
    22312252    function get_tax_title_format( $tax = '' ) {
    22322253        global $aioseop_options;
    2233         if ( is_category() )
     2254        $title_format = '%category_title% | %blog_title%';
     2255        if ( !empty( $aioseop_options['aiosp_category_title_format'] ) )
    22342256            $title_format = $aioseop_options['aiosp_category_title_format'];
    2235         if ( empty( $title_format ) )
    2236             $title_format = '%category_title% | %blog_title%';
    22372257        return $title_format;
    22382258    }
     
    22472267        if ( strpos( $title, '%blog_title%'           ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
    22482268        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( '&quot;', ' ', ' ' ), $title );
     2271        return $this->paged_title( $title );
    22512272    }
    22522273   
     
    24502471                if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title );
    24512472                if ( strpos( $title, '%tag%'              ) !== false ) $title = str_replace( '%tag%', $tag, $title );
     2473
     2474
     2475
     2476
    24522477                $title = $this->paged_title( $title );
    24532478                return $title;
     
    24912516                if ( strpos( $new_title, '%year%' ) !== false ) $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
    24922517            } 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 ) );
    24942520            } else return false;
    24952521            $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
     
    25712597        $text = str_replace( ']]>', ']]&gt;', $text );
    25722598                $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
    2573         $text = strip_tags( $text );
     2599        $text = _tags( $text );
    25742600        if ( !$max ) $max = $this->maximum_description_length;
    25752601        $len = $this->strlen( $text );
     
    25962622        $text = str_replace( ']]>', ']]&gt;', $text );
    25972623                $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
    2598         $text = strip_tags( $text );
     2624        $text = _tags( $text );
    25992625        return trim( stripslashes( $text ) );
    26002626    }
  • all-in-one-seo-pack/tags/2.2.3/aioseop_module_manager.php

    r956933 r970845  
    8484            if ( $v !== null ) return false;    // already loaded
    8585            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() ) ) )
    8990                return false;
    9091            $mod_enable = false;
  • all-in-one-seo-pack/tags/2.2.3/aioseop_opengraph.php

    r956933 r970845  
    9292                "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' ),
    9393                "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
    9498                "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' ),
    9599                "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' ),
     
    101105                "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' ),
    102106                "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
    103108                "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' ),
    104109                "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' ),
     
    120125                    'generate_descriptions' => Array( 'name'    => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
    121126                    'disable_jetpack'       => Array( 'name'    => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ),
    122                     'defimg'        => Array(   'name'          => __( 'Select OG:Image Source', 'all_in_one_seo_pack' ), 'type' => 'select', 'initial_options' => Array( '' => __( 'Default Image' ), 'featured' => __( 'Featured Image' ), 'attach' => __( 'First Attached Image' ), 'content' => __( 'First Image In Content' ), 'custom' => __( 'Image From Custom Field' ), 'auto' => __( 'First Available Image' ) ) ),
     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' ) ) ),
    123128                    'fallback'      => Array(   'name'          => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
    124129                    'dimg'          => Array(   'name'          => __( 'Default OG:Image',  'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
     
    134139                    'imageheight'   => Array(   'name'          => __( 'Specify Image Height', 'all_in_one_seo_pack' ),
    135140                                                'type'          => 'text', 'default' => '' ),
     141
     142
     143
     144
     145
     146
    136147                    'defcard'       => Array(   'name'          => __( 'Default Twitter Card', 'all_in_one_seo_pack' ),
    137148                                                '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' ),
     
    155166                                                'default'       => ''
    156167                                        ),
     168
     169
    157170                    'tag'           => Array(   'name'          => __( 'Article Tags', 'all_in_one_seo_pack' ),
    158171                                                'type'          => 'text', 'default' => '',  'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
     
    177190                'settings'  =>  Array(  'name'      => __('Social Settings', 'all_in_one_seo_pack'),
    178191                                                          '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' ),
    180193                                                          'display' => $display, 'prefix' => 'aioseop_opengraph_'
    181194                                    )
     
    346359                add_filter( 'jetpack_disable_twitter_cards', '__return_false', 100 );
    347360            }
    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"' ) );
    349362            foreach( $attributes as $attr ) {
    350363                if ( strpos( $output, $attr ) === false ) {
     
    361374            $dimg = $this->options['aiosp_opengraph_dimg'];
    362375            $current_post_type = get_post_type();
    363             $title = $description = $image = '';
     376            $title = $description = $image = '';
    364377            $type = 'article';
    365378           
     
    396409                if( empty($sitename) ) $sitename = get_bloginfo('name');
    397410               
    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'] ) ) )
    399412                    $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
    400413               
     
    409422                    $type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"];
    410423                }
     424
     425
     426
    411427                if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_tag'] ) ) ) {
    412428                    $tag = $metabox['aioseop_opengraph_settings_tag'];
     
    418434                if ( !empty( $this->options['aiosp_opengraph_twitter_domain'] ) )
    419435                    $domain = $this->options['aiosp_opengraph_twitter_domain'];
     436
     437
     438
     439
     440
     441
     442
     443
    420444
    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
    423449               
    424450                $image = $metabox['aioseop_opengraph_settings_image'];
     451
    425452                $title = $metabox['aioseop_opengraph_settings_title'];
    426453                $description = $metabox['aioseop_opengraph_settings_desc'];
     
    477504                        case 'auto'     :   $thumbnail = $this->get_the_image();
    478505                                            break;
     506
     507
    479508                        default         :   $thumbnail = $this->options['aiosp_opengraph_dimg'];
    480509                    }
     
    491520                if ( !empty( $metabox['aioseop_opengraph_settings_imageheight'] ) )
    492521                    $height = $metabox['aioseop_opengraph_settings_imageheight'];
     522
     523
     524
     525
     526
     527
     528
    493529            }
    494530           
     
    523559                        'width'         => 'og:image:width',
    524560                        'height'        => 'og:image:height',
     561
     562
     563
    525564                        'sitename'      => 'og:site_name',
    526565                        'key'           => 'fb:admins',
    527566                        'description'   => 'og:description',
     567
    528568                        'tag'           => 'article:tag',
    529569                        'publisher'     => 'article:publisher',
    530                         'author'        => 'article:author'
     570                        'author'        => 'article:author',
     571                        'published_time'=> 'article:published_time',
     572                        'modified_time' => 'article:modified_time',
    531573                    ),
    532574                'twitter'   => Array(
     
    536578                        'domain'        => 'twitter:domain',
    537579                        'description'   => 'twitter:description',
    538                     )
     580                    ),
     581                'google+'   => Array(
     582                        'thumbnail'     => 'image',
     583                    ),
    539584            );
    540585           
     
    635680
    636681            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;             
    638686            }
    639687            $image = array_flip( $img );
     
    644692            return Array( $image, $images );
    645693        }
    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       
    647711        function get_the_image( $options = null, $p = null ) {
    648712            $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  
    44Plugin URI: http://semperfiwebdesign.com
    55Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> |  <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
    6 Version: 2.2.2
     6Version: 2.2.
    77Author: Michael Torbert
    88Author URI: http://michaeltorbert.com
     
    3131/**
    3232 * @package All-in-One-SEO-Pack
    33  * @version 2.2.2
     33 * @version 2.2.
    3434 */
    3535
    3636if ( ! defined( 'AIOSEOP_VERSION' ) )
    37     define( 'AIOSEOP_VERSION', '2.2.2' );
     37    define( 'AIOSEOP_VERSION', '2.2.' );
    3838
    3939if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
  • all-in-one-seo-pack/tags/2.2.3/readme.txt

    r924101 r970845  
    44Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
    55Requires at least: 3.3
    6 Tested up to: 3.9.1
     6Tested up to: 3.9.
    77Stable tag: trunk
    88
  • all-in-one-seo-pack/trunk/aioseop_class.php

    r956933 r970845  
    195195            "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' ),
    196196            "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
    197199            "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
    198201            "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' ),
    199202            "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' ),
     
    467470                'name' => __( 'Use nofollow for paginated pages/posts:', 'all_in_one_seo_pack' ),
    468471                'default' => 0),
     472
     473
     474
     475
     476
     477
    469478            "generate_descriptions"=> Array(
    470479                'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ),
    471480                'default' => 1),
     481
     482
     483
     484
    472485            "hide_paginated_descriptions"=> Array(
    473486                'name' => __( 'Remove Descriptions For Paginated Pages:', 'all_in_one_seo_pack' ),
     
    595608                        'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
    596609                        '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' )
    598611                    ),
    599612                'advanced' => Array(
    600613                        'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
    601614                        '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' )
    603616                    )
    604617                );
     
    701714            $extra_title_len = 0;
    702715            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>';
    704717            } else {
    705718                if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
    706719                $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>';
    708721                if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format );
    709722                if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format );
     
    715728            }
    716729           
    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 ) ) );
    718731            $extra_title_len = (int)$extra_title_len;
    719732            $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
     
    13091322           
    13101323            if ( isset($description) && ( $this->strlen($description) > $this->minimum_description_length ) && !( $is_front_page && is_paged() ) ) {
    1311                 $description = trim( strip_tags( $description ) );
    1312                 $description = str_replace( '"', '&quot;', $description );
    1313 
    1314                 // replace newlines on mac / windows?
    1315                 $description = str_replace( "\r\n", ' ', $description );
    1316 
    1317                 // maybe linux uses this alone
    1318                 $description = str_replace( "\n", ' ', $description );
    1319 
    1320                 if ( !isset( $meta_string) ) {
    1321                     $meta_string = '';
    1322                 }
    1323 
    13241324                // description format
    13251325                $description_format = $aioseop_options['aiosp_description_format'];
     
    13271327                    $description_format = "%description%";
    13281328                }
     1329
    13291330                $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
    13301331                if ( strpos( $description, '%blog_title%'       ) !== false ) $description = str_replace( '%blog_title%',       get_bloginfo( 'name' ), $description );
     
    13321333                if ( strpos( $description, '%wp_title%'         ) !== false ) $description = str_replace( '%wp_title%',         $this->get_original_title(), $description );
    13331334                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
    13341349                if( $aioseop_options['aiosp_can'] && is_attachment() ) {
    13351350                    $url = $this->aiosp_mrt_get_url( $wp_query );
     
    13731388
    13741389            $robots_meta = '';
     1390
     1391
     1392
     1393
    13751394            if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
    13761395                && ( ( 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            ) ) {
    13801399                $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                }
    13851406                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 = '';
    13901407                    if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
    13911408                         ( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
     
    13941411                         ( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
    13951412                        $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;
    14021420            if ( $robots_meta == 'index,follow' ) $robots_meta = '';
    14031421           
     
    20702088            $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
    20712089            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 ) );
    20732094            }
    20742095        }
     
    22312252    function get_tax_title_format( $tax = '' ) {
    22322253        global $aioseop_options;
    2233         if ( is_category() )
     2254        $title_format = '%category_title% | %blog_title%';
     2255        if ( !empty( $aioseop_options['aiosp_category_title_format'] ) )
    22342256            $title_format = $aioseop_options['aiosp_category_title_format'];
    2235         if ( empty( $title_format ) )
    2236             $title_format = '%category_title% | %blog_title%';
    22372257        return $title_format;
    22382258    }
     
    22472267        if ( strpos( $title, '%blog_title%'           ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
    22482268        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( '&quot;', ' ', ' ' ), $title );
     2271        return $this->paged_title( $title );
    22512272    }
    22522273   
     
    24502471                if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title );
    24512472                if ( strpos( $title, '%tag%'              ) !== false ) $title = str_replace( '%tag%', $tag, $title );
     2473
     2474
     2475
     2476
    24522477                $title = $this->paged_title( $title );
    24532478                return $title;
     
    24912516                if ( strpos( $new_title, '%year%' ) !== false ) $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
    24922517            } 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 ) );
    24942520            } else return false;
    24952521            $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
     
    25712597        $text = str_replace( ']]>', ']]&gt;', $text );
    25722598                $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
    2573         $text = strip_tags( $text );
     2599        $text = _tags( $text );
    25742600        if ( !$max ) $max = $this->maximum_description_length;
    25752601        $len = $this->strlen( $text );
     
    25962622        $text = str_replace( ']]>', ']]&gt;', $text );
    25972623                $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
    2598         $text = strip_tags( $text );
     2624        $text = _tags( $text );
    25992625        return trim( stripslashes( $text ) );
    26002626    }
  • all-in-one-seo-pack/trunk/aioseop_module_manager.php

    r956933 r970845  
    8484            if ( $v !== null ) return false;    // already loaded
    8585            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() ) ) )
    8990                return false;
    9091            $mod_enable = false;
  • all-in-one-seo-pack/trunk/aioseop_opengraph.php

    r956933 r970845  
    9292                "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' ),
    9393                "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
    9498                "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' ),
    9599                "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' ),
     
    101105                "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' ),
    102106                "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
    103108                "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' ),
    104109                "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' ),
     
    120125                    'generate_descriptions' => Array( 'name'    => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
    121126                    'disable_jetpack'       => Array( 'name'    => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ),
    122                     'defimg'        => Array(   'name'          => __( 'Select OG:Image Source', 'all_in_one_seo_pack' ), 'type' => 'select', 'initial_options' => Array( '' => __( 'Default Image' ), 'featured' => __( 'Featured Image' ), 'attach' => __( 'First Attached Image' ), 'content' => __( 'First Image In Content' ), 'custom' => __( 'Image From Custom Field' ), 'auto' => __( 'First Available Image' ) ) ),
     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' ) ) ),
    123128                    'fallback'      => Array(   'name'          => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
    124129                    'dimg'          => Array(   'name'          => __( 'Default OG:Image',  'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
     
    134139                    'imageheight'   => Array(   'name'          => __( 'Specify Image Height', 'all_in_one_seo_pack' ),
    135140                                                'type'          => 'text', 'default' => '' ),
     141
     142
     143
     144
     145
     146
    136147                    'defcard'       => Array(   'name'          => __( 'Default Twitter Card', 'all_in_one_seo_pack' ),
    137148                                                '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' ),
     
    155166                                                'default'       => ''
    156167                                        ),
     168
     169
    157170                    'tag'           => Array(   'name'          => __( 'Article Tags', 'all_in_one_seo_pack' ),
    158171                                                'type'          => 'text', 'default' => '',  'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
     
    177190                'settings'  =>  Array(  'name'      => __('Social Settings', 'all_in_one_seo_pack'),
    178191                                                          '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' ),
    180193                                                          'display' => $display, 'prefix' => 'aioseop_opengraph_'
    181194                                    )
     
    346359                add_filter( 'jetpack_disable_twitter_cards', '__return_false', 100 );
    347360            }
    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"' ) );
    349362            foreach( $attributes as $attr ) {
    350363                if ( strpos( $output, $attr ) === false ) {
     
    361374            $dimg = $this->options['aiosp_opengraph_dimg'];
    362375            $current_post_type = get_post_type();
    363             $title = $description = $image = '';
     376            $title = $description = $image = '';
    364377            $type = 'article';
    365378           
     
    396409                if( empty($sitename) ) $sitename = get_bloginfo('name');
    397410               
    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'] ) ) )
    399412                    $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
    400413               
     
    409422                    $type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"];
    410423                }
     424
     425
     426
    411427                if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_tag'] ) ) ) {
    412428                    $tag = $metabox['aioseop_opengraph_settings_tag'];
     
    418434                if ( !empty( $this->options['aiosp_opengraph_twitter_domain'] ) )
    419435                    $domain = $this->options['aiosp_opengraph_twitter_domain'];
     436
     437
     438
     439
     440
     441
     442
     443
    420444
    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
    423449               
    424450                $image = $metabox['aioseop_opengraph_settings_image'];
     451
    425452                $title = $metabox['aioseop_opengraph_settings_title'];
    426453                $description = $metabox['aioseop_opengraph_settings_desc'];
     
    477504                        case 'auto'     :   $thumbnail = $this->get_the_image();
    478505                                            break;
     506
     507
    479508                        default         :   $thumbnail = $this->options['aiosp_opengraph_dimg'];
    480509                    }
     
    491520                if ( !empty( $metabox['aioseop_opengraph_settings_imageheight'] ) )
    492521                    $height = $metabox['aioseop_opengraph_settings_imageheight'];
     522
     523
     524
     525
     526
     527
     528
    493529            }
    494530           
     
    523559                        'width'         => 'og:image:width',
    524560                        'height'        => 'og:image:height',
     561
     562
     563
    525564                        'sitename'      => 'og:site_name',
    526565                        'key'           => 'fb:admins',
    527566                        'description'   => 'og:description',
     567
    528568                        'tag'           => 'article:tag',
    529569                        'publisher'     => 'article:publisher',
    530                         'author'        => 'article:author'
     570                        'author'        => 'article:author',
     571                        'published_time'=> 'article:published_time',
     572                        'modified_time' => 'article:modified_time',
    531573                    ),
    532574                'twitter'   => Array(
     
    536578                        'domain'        => 'twitter:domain',
    537579                        'description'   => 'twitter:description',
    538                     )
     580                    ),
     581                'google+'   => Array(
     582                        'thumbnail'     => 'image',
     583                    ),
    539584            );
    540585           
     
    635680
    636681            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;             
    638686            }
    639687            $image = array_flip( $img );
     
    644692            return Array( $image, $images );
    645693        }
    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       
    647711        function get_the_image( $options = null, $p = null ) {
    648712            $meta_key = $this->options['aiosp_opengraph_meta_key'];
  • all-in-one-seo-pack/trunk/all_in_one_seo_pack.php

    r956933 r970845  
    44Plugin URI: http://semperfiwebdesign.com
    55Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> |  <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
    6 Version: 2.2.2
     6Version: 2.2.
    77Author: Michael Torbert
    88Author URI: http://michaeltorbert.com
     
    3131/**
    3232 * @package All-in-One-SEO-Pack
    33  * @version 2.2.2
     33 * @version 2.2.
    3434 */
    3535
    3636if ( ! defined( 'AIOSEOP_VERSION' ) )
    37     define( 'AIOSEOP_VERSION', '2.2.2' );
     37    define( 'AIOSEOP_VERSION', '2.2.' );
    3838
    3939if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
  • all-in-one-seo-pack/trunk/readme.txt

    r924101 r970845  
    44Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
    55Requires at least: 3.3
    6 Tested up to: 3.9.1
     6Tested up to: 3.9.
    77Stable tag: trunk
    88
Note: See TracChangeset for help on using the changeset viewer.