Plugin Directory

Changeset 924101

Timestamp:
05/31/2014 03:24:05 AM (10 years ago)
Author:
pbaylies
Message:

Released 2.1.6; bugfixes for outbound link tracking and quick edit; support for individual sitemap priorities for taxonomy types and post types; initial support for some more Twitter card types; initial custom field macro support.

Location:
all-in-one-seo-pack/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • all-in-one-seo-pack/trunk/aioseop_class.php

    r895274 r924101  
    174174            "ga_domain"             => __( "Enter your domain name if you have enabled tracking of Subdomains in Google Analytics.<br /><a href='http://semperplugins.com/documentation/google-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
    175175            "ga_multi_domain"       => __( "Check this if you have enabled tracking of Multiple top-level domains in Google Analytics.<br /><a href='http://semperplugins.com/documentation/google-settings/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
     176
    176177            "ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking.", 'all_in_one_seo_pack' ),
    177178            "ga_exclude_users"      => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ),
     
    397398                'default' => 0,
    398399                'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
     400
     401
     402
     403
    399404            "ga_display_advertising"=> Array(
    400405                'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ),
     
    488493                                                                                                    });
    489494                                                                                                    </script>
    490                                                                                                     <div class="preview_snippet"><div id="aioseop_snippet"><h3><a id="aioseop_snippet_title">%s</a></h3><div><div><cite id="aioseop_snippet_link">%s</cite></div><span id="aioseop_snippet_description">%s</span></div></div></div>' ),
     495                                                                                                    <div class="preview_snippet"><div id="aioseop_snippet"><h3><a>%s</a></h3><div><div><cite id="aioseop_snippet_link">%s</cite></div><span id="aioseop_snippet_description">%s</span></div></div></div>' ),
    491496                                                                        'title'              => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ),
    492497                                                                        'description'        => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ),
     
    553558                        'help_link' => 'http://semperplugins.com/documentation/google-settings/',
    554559                        'options' => Array( "google_publisher", "google_disable_profile", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher",                       
    555                                             "google_connect", "google_analytics_id", "ga_use_universal_analytics", "ga_domain", "ga_multi_domain", "ga_display_advertising", "ga_exclude_users", "ga_track_outbound_links" )
     560                                            "google_connect", "google_analytics_id", "ga_use_universal_analytics", "ga_domain", "ga_multi_domain", "ga_display_advertising", "ga_exclude_users", "ga_track_outbound_links" )
    556561                    ),
    557562                'noindex' => Array(
     
    595600                else
    596601                    $wp_query->is_single = true;
     602
    597603                if  ( get_option( 'show_on_front' ) == 'page' ) {
    598604                    if ( is_page() && $post->ID == get_option( 'page_on_front' ) )
     
    607613                $wp_query->queried_object = $post;
    608614               
    609                 $title = $this->wp_title();
    610                 if ( empty( $title ) ) $title = $post->post_title;
     615                if ( !empty( $post ) && !$wp_query->is_home && !$wp_query->is_front_page ) {
     616                    $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
     617                    if ( empty( $title ) ) $title = $post->post_title;
     618                }
     619               
     620                $title_format = '';
     621                if ( empty( $title ) ) {
     622                    $title = $this->wp_title();
     623                    $title_format = '%post_title%';
     624                }
    611625               
    612626                if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) )
     
    614628                if ( !$url ) $url = get_permalink();
    615629
     630
     631
    616632                $description = $this->get_aioseop_description( $post );
    617                 $description = apply_filters( 'aioseop_description', $description );
     633                $description = $this->apply_cf_fields( $description );
     634                $description = apply_filters( 'aioseop_description', $description );               
    618635               
    619636                if ( $this->strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
    620637                if ( $this->strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
    621638               
    622                 $args['value'] = sprintf( $args['value'], esc_attr( strip_tags( $title ) ), esc_url( $url ), esc_attr( strip_tags( $description ) ) );
     639                if ( empty( $title_format ) ) {
     640                    if ( is_page() )
     641                        $title_format = $aioseop_options['aiosp_page_title_format'];
     642                    elseif ( is_single() )
     643                        $title_format = $this->get_post_title_format();                 
     644                }
     645                if ( empty( $title_format ) ) {
     646                    $title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>';
     647                } else {
     648                    $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
     649                    $title_format = $this->apply_cf_fields( $title_format );
     650                    $title_format = str_replace( '%post_title%', '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>', $title_format );
     651                    $title_format = str_replace( '%page_title%', '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>', $title_format );
     652                    $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );                 
     653                    $title = $title_format;
     654                }
     655               
     656                $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( strip_tags( $description ) ) );
    623657                $buf = $this->get_option_row( $args['name'], $args['options'], $args );
    624658               
     
    12581292                $meta_string .= sprintf( "<meta name=\"description\" content=\"%s\" />\n", $description );
    12591293            }
    1260 
     1294            $keywords = $this->apply_cf_fields( $keywords );
    12611295            $keywords = apply_filters( 'aioseop_keywords', $keywords );
    12621296
     
    13151349            foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
    13161350                if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) )
    1317                     $$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ) );
     1351                    $$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ) );
    13181352                else
    13191353                    $$meta = '';
     
    17071741                $allow_linker = "'allowLinker': true";
    17081742            }
    1709             $display_advertising = '';
     1743            $ = '';
    17101744            if (!empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
    1711                 $display_advertising = "ga('require', 'displayfeatures');";
     1745                $extra_options = "ga('require', 'displayfeatures');";
     1746            }
     1747            if ( !empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
     1748                if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
     1749                $extra_options .= "ga('set', 'anonymizeIp', true);";
    17121750            }
    17131751            $js_options = Array();
     
    17281766
    17291767            ga('create', '{$analytics_id}'{$js_options});
    1730             {$display_advertising}
     1768            {$}
    17311769            ga('send', 'pageview');
    17321770            </script>
     
    17601798            echo $aioseop_options['aiosp_google_analytics_id'];
    17611799          ?>']);
     1800
     1801
     1802
     1803
     1804
    17621805<?php if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
    17631806?>        _gaq.push(['_setAllowLinker', true]);
     
    18231866              }
    18241867            }
     1868
     1869
     1870
     1871
     1872
     1873
     1874
    18251875
    18261876            aiosp_addLoadEvent(function () {
     
    18281878                for (var x=0; x < links.length; x++) {
    18291879                    if (typeof links[x] == 'undefined') continue;
    1830                     if (typeof links[x].onclick != 'undefined') continue;
    1831                     links[x].onclick = function () {
     1880                    aiosp_addEvent( links[x], 'onclick', function () {
    18321881                        var mydomain = new RegExp(document.domain, 'i');
    18331882                        href = getAttr(this, 'href');
    1834                         if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
     1883                        if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
    18351884                            recordOutboundLink(this, 'Outbound Links', href);
    18361885                        }
    1837                     }
     1886                    }
    18381887                }
    18391888            });
     
    19882037        if ( empty( $description ) && is_object( $post ) && !is_archive() && empty( $blog_page ) )
    19892038            $description = $this->get_post_description( $post );
     2039
    19902040        return $description;
    19912041    }
     
    19932043    function replace_title( $content, $title ) {
    19942044        $title = trim( strip_tags( $title ) );
    1995         $title_tag_start = "<title>";
    1996         $title_tag_end = "</title>";
    1997         $len_start = $this->strlen( $title_tag_start );
     2045        $title_tag_start = "<title";
     2046        $title_tag_end = "</title";
    19982047        $title = stripslashes( trim( $title ) );
    19992048        $start = $this->strpos( $content, $title_tag_start );
     
    20042053        $this->orig_title = $title;
    20052054       
    2006         return preg_replace( '/<title>(.*?)<\/title>/is', '<title>' . preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . '</title>', $content, 1 );
     2055        return preg_replace( '/<title>' . preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . '</title>', $content, 1 );
    20072056    }
    20082057   
     
    21792228            if ( !$title )
    21802229                $title = $this->internationalize( $this->get_original_title( '', false ) );
    2181             $title = get_the_title( $post->post_parent ) . ' ' . $title . ' ' . get_option( 'blogname' );
     2230            $title = get_the_title( $post->post_parent ) . ' ' . $title . ' ' . get_option( 'blogname' );
    21822231            apply_filters( 'aioseop_attachment_title', $title );
    21832232        } else if ( is_page() || $this->is_static_posts_page() || ( is_home() && !$this->is_static_posts_page() ) ) {
     
    23322381        $title = false;
    23332382        $post = $this->get_queried_object();
    2334         if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) )
     2383        if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) )
    23352384            $title = $this->get_aioseop_title( $post );
     2385
     2386
    23362387        if ( $title === false )
    23372388            $title = $this->get_original_title();
  • all-in-one-seo-pack/trunk/aioseop_functions.php

    r895274 r924101  
    191191            check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
    192192        $post_id = intval( $_POST['post_id'] );
    193         $new_meta = $_POST['new_meta'];
     193        $new_meta = ;
    194194        $target = $_POST['target_meta'];
    195         update_post_meta( $post_id, '_aioseop_' . $target, esc_attr( $new_meta ) );
    196         $result = get_post_meta( $post_id, '_aioseop_' . $target, true );
    197         if( $result != '' ): $label = $result; 
    198         else: $label = ''; $result = '<strong><i>' . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>' ; endif;
    199         $output = $result . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"';
    200         $output .= 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', ' . json_encode( $label ) . ', "' . $target . '");return false;\' title="' . __('Edit') . '">';
     195        $result = '';
     196        if ( in_array( $target, Array( 'title', 'description', 'keywords' ) ) && current_user_can( 'edit_post', $post_id ) ) {
     197            update_post_meta( $post_id, '_aioseop_' . $target, esc_attr( $new_meta ) );
     198            $result = get_post_meta( $post_id, '_aioseop_' . $target, true );
     199        } else {
     200            die();
     201        }
     202        if( $result != '' ):
     203            $label = "<label id='aioseop_label_{$target}_{$post_id}'>" . $result . '</label>'; 
     204        else:
     205            $label = '';
     206            $label = "<label id='aioseop_label_{$target}_{$post_id}'></label><strong><i>" . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>';
     207        endif;
     208        $output = $label . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"';
     209        $output .= 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '");return false;\' title="' . __('Edit') . '">';
    201210        $output .= '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a>';
    202         die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() {
    203               jQuery('div#aioseop_" . $target . "_" . $post_id . "').html('" . addslashes_gpc($output) . "').fadeIn('fast');
     211        die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() {
     212              jQuery('div#aioseop_" . $target . "_" . $post_id . "').html().fadeIn('fast');
    204213        });" );
    205214    }
     
    455464                        id="aioseop_<?php print $target; ?>_<?php echo $id; ?>"
    456465                        style="float:left;">
    457                     <?php $content = htmlspecialchars( stripslashes( get_post_meta( $id, "_aioseop_" . $target, TRUE ) ) );
    458                 if( !empty($content) ): $label = esc_js( $content ); 
    459                 else: $label = ''; $content = '<strong><i>No ' . $target . '</i></strong>' ; endif;
    460                     print $content . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' .
    461                     $id . ', "' . str_replace( Array( '"', '&quot;' ), Array( '\x22', '\x22' ), esc_js( $label ) ) . '", "' . $target . '");return false;\' title="' . __('Edit') . '">';
     466                    <?php $content = strip_tags( stripslashes( get_post_meta( $id, "_aioseop_" . $target,   TRUE ) ) );
     467                if( !empty($content) ):
     468                    $label = "<label id='aioseop_label_{$target}_{$id}'>" . $content . '</label>'; 
     469                else:
     470                    $label = "<label id='aioseop_label_{$target}_{$id}'></label><strong><i>No " . $target . '</i></strong>';
     471                endif;
     472                    print $label . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' .
     473                    $id . ', "' . $target . '");return false;\' title="' . __('Edit') . '">';
    462474                        print "<img class='aioseop_edit_button'
    463475                                            id='aioseop_edit_id'
     
    576588
    577589/***
     590
     591
     592
     593
     594
     595
     596
     597
     598
     599
     600
     601
     602
     603
     604
     605
     606
     607
    578608 * JSON support for PHP < 5.2
    579609 */
  • all-in-one-seo-pack/trunk/aioseop_module_class.php

    r861972 r924101  
    289289        }
    290290       
     291
     292
     293
     294
     295
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
    291312        /**
    292313         * Returns child blogs of parent in a multisite.
  • all-in-one-seo-pack/trunk/aioseop_opengraph.php

    r895274 r924101  
    9191                "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' ),
    9292                "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' ),
     93
     94
    9395                "types"                 => __( "Select which Post Types you want to use All in One SEO Pack to set Open Graph meta values for.<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' ),
    9496                "title"                 => __( "This is the Open Graph title of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
     
    124126                    'imageheight'   => Array(   'name'          => __( 'Specify Image Height', 'all_in_one_seo_pack' ),
    125127                                                'type'          => 'text', 'default' => '' ),
     128
     129
     130
     131
    126132                    'types'         => Array(   'name'          => __( 'Enable Facebook Meta for', 'all_in_one_seo_pack'),
    127133                                                'type'          => 'multicheckbox', 'initial_options' => $this->get_post_type_titles( Array( '_builtin' => false ) ),
     
    150156            $this->locations = array(
    151157                'opengraph' =>  Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
    152                                        'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'disable_jetpack', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', 'types') ),
     158                                       'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'disable_jetpack', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', 'types') ),
    153159                'settings'  =>  Array(  'name'      => __('Social Settings', 'all_in_one_seo_pack'),
    154160                                                          'type'        => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
    155                                                           'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'category' ),
     161                                                          'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'category' ),
    156162                                                          'display' => $display, 'prefix' => 'aioseop_opengraph_'
    157163                                    )
     
    233239                        $settings[$prefix . 'category']['initial_options'] = array_merge( Array( '' => 'Default - ' . $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ), $settings[$prefix . 'category']['initial_options'] );
    234240                    }
     241
     242
     243
    235244                }
    236245                if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] )
     
    371380                $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 );
    372381           
    373             /* Data Validation */
     382            $title = $this->apply_cf_fields( $title );
     383            $description = $this->apply_cf_fields( $description );
     384           
     385            /* Data Validation */           
    374386            $title = strip_tags( esc_attr( $title ) );
    375387            $sitename = strip_tags( esc_attr( $sitename ) );
     
    419431           
    420432            $card = 'summary';
     433
     434
     435
     436
     437
    421438           
    422439            /* OG only: */
  • all-in-one-seo-pack/trunk/aioseop_sitemap.php

    r895274 r924101  
    1414        var $max_posts = 50000;
    1515        var $paginate = false;
    16 
     16        var $prio;
     17        var $prio_sel;
     18        var $freq;
     19        var $freq_sel;
     20        var $extra_sitemaps;
     21       
    1722        function All_in_One_SEO_Pack_Sitemap( ) {
    1823            if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
     
    8691            );
    8792           
    88             $prio = Array( 'no' => 'Do Not Override' );
    89            
     93            $prio = Array();
    9094            for( $i = 0; $i <= 10; $i++ ) {
    9195                $str = sprintf( "%0.1f", $i / 10.0 );
    9296                $prio[ $str ] = $str;
    9397            }
    94            
    95             $freq = Array( 'no' => 'Do Not Override' );
    96            
     98            $arr_no = Array( 'no' => __( 'Do Not Override', 'all_in_one_seo_pack' ) );
     99            $arr_sel = Array( 'sel' => __( 'Select Individual', 'all_in_one_seo_pack' ) );
     100            $this->prio_sel = array_merge( $arr_no, $arr_sel, $prio );
     101            $this->prio = array_merge( $arr_no, $prio );
     102           
     103            $freq = Array();
    97104            foreach ( Array( 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never' ) as $f ) $freq[ $f ] = $f;
     105
     106
    98107           
    99108            foreach( Array( 'prio' => __( 'priority', 'all_in_one_seo_pack' ), 'freq' => __( 'frequency', 'all_in_one_seo_pack' ) ) as $k => $v ) {
     
    106115                                'author'        => __( 'author pages', 'all_in_one_seo_pack' ) ) as $opt => $val ) {
    107116                    $arr = $$s;
    108                     $arr[ $k . '_' . $opt ] = Array( 'name' => $this->ucwords( $val ), 'help_text' => sprintf( __( "Manually set the %s of your %s.", 'all_in_one_seo_pack' ), $v, $val ), 'type' => 'select', 'initial_options' => $$k, 'default' => 'no' );
     117                    if ( ( $opt == 'post' ) || ( $opt == 'taxonomies' ) ) {
     118                        $iopts = $this->{"{$k}_sel"};
     119                    } else {
     120                        $iopts = $this->$k;
     121                    }
     122                   
     123                    $arr[ $k . '_' . $opt ] = Array( 'name' => $this->ucwords( $val ), 'help_text' => sprintf( __( "Manually set the %s of your %s.", 'all_in_one_seo_pack' ), $v, $val ), 'type' => 'select', 'initial_options' => $iopts, 'default' => 'no' );
    109124                    if ( ( $opt == 'archive' ) || ( $opt == 'author' ) ) $arr[ $k . '_' . $opt ][ 'condshow' ] = Array( $this->prefix . $opt => 'on' );
    110125                    $$s = $arr;
     
    169184            // load initial options / set defaults
    170185            $this->update_options( );
    171             if ( !empty( $this->options["{$this->prefix}paginate"] ) ) {
     186            if ( !empty( $this->options["{$this->prefix}paginate"] ) ) {
    172187                $this->paginate = true;
    173188                if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
     
    237252        function add_post_types() {
    238253            $post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
     254
    239255            if ( isset( $post_type_titles['attachment'] ) ) $post_type_titles['attachment'] = __( "Media / Attachments", 'all_in_one_seo_pack' );
    240256            $this->default_options['posttypes' ]['initial_options'] = array_merge( Array( 'all' => __( 'All Post Types', 'all_in_one_seo_pack' ) ), $post_type_titles );
    241             $this->default_options['taxonomies']['initial_options'] = array_merge( Array( 'all' => __( 'All Taxonomies', 'all_in_one_seo_pack' ) ), $this->get_taxonomy_titles(  Array( 'public' => true ) ) );
     257            $this->default_options['taxonomies']['initial_options'] = array_merge( Array( 'all' => __( 'All Taxonomies', 'all_in_one_seo_pack' ) ), $t );
    242258            $this->default_options['posttypes' ]['default'] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
    243259            $this->default_options['taxonomies']['default'] = array_keys( $this->default_options['taxonomies']['initial_options'] );
    244260            $this->default_options['excl_categories']['initial_options'] = $this->get_category_titles();
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
    245281            $this->update_options();
    246282        }
     
    393429                    }
    394430            }
    395             return apply_filters( $this->prefix . 'sitemap_urls', $siteurls );
     431            return apply_filters( $this->prefix . 'child_urls', $siteurls );
     432            return apply_filters( $this->prefix . 'sitemap_urls', $siteurls ); // legacy
    396433        }
    397434
     
    657694                }
    658695        }
    659 
    660         /** Output sitemaps dynamically based on rewrite rules. **/
    661         function do_rewrite_sitemap( $sitemap_type, $page = 0 ) {
    662             $this->add_post_types();
    663             $comment = __( "dynamically", 'all_in_one_seo_pack' );
     696       
     697        function get_sitemap_data( $sitemap_type, $page = 0 ) {
     698            $sitemap_data = Array();
    664699            if ( $this->options["{$this->prefix}indexes"] ) {
    665700                $posttypes = $this->options["{$this->prefix}posttypes"];
     
    668703                if ( empty( $taxonomies ) ) $taxonomies = Array();
    669704                if ( $sitemap_type === 'root' ) {
    670                     $this->output_sitemap_index( array_merge( $this->get_sitemap_index_filenames() ), $comment );
     705                    $ );
    671706                } elseif ( $sitemap_type === 'addl' ) {
    672                     $this->output_sitemap( $this->get_addl_pages(), $comment );
     707                    $);   
    673708                } elseif ( $sitemap_type === 'archive' && $this->option_isset( 'archive' ) ) {
    674                     $this->output_sitemap( $this->get_archive_prio_data(), $comment );                 
     709                    $);                 
    675710                } elseif ( $sitemap_type === 'author' && $this->option_isset( 'author' ) ) {
    676                     $this->output_sitemap( $this->get_author_prio_data(), $comment );                   
     711                    $);                 
    677712                } elseif ( in_array( $sitemap_type, $posttypes ) ) {
    678                     $this->output_sitemap( $this->get_all_post_priority_data( $sitemap_type, 'publish', $page ), $comment );
     713                    $ );
    679714                } elseif ( in_array( $sitemap_type, $taxonomies ) ) {
    680                     $this->output_sitemap( $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args( $page ) ) ), $comment );
    681                 }
    682             } elseif ( $sitemap_type === 'root' ) echo $this->do_simple_sitemap( $comment );
     715                    $sitemap_data = $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args( $page ) ) );
     716                } else {
     717                    if ( is_array( $this->extra_sitemaps ) && in_array( $sitemap_type, $this->extra_sitemaps ) )
     718                        $sitemap_data = apply_filters( $this->prefix . 'custom_' . $sitemap_type, $sitemap_data, $page, $this_options );
     719                }
     720            } elseif ( $sitemap_type === 'root' ) $sitemap_data = $this->get_simple_sitemap();
     721            return apply_filters( $this->prefix . 'data', $sitemap_data, $sitemap_type, $page, $this->options );
     722        }
     723
     724        /** Output sitemaps dynamically based on rewrite rules. **/
     725        function do_rewrite_sitemap( $sitemap_type, $page = 0 ) {
     726            $this->add_post_types();
     727            $comment = __( "dynamically", 'all_in_one_seo_pack' );
     728            $this->output_sitemap( $this->get_sitemap_data( $sitemap_type, $page ), $comment );
    683729        }
    684730
     
    723769        /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/
    724770        function do_sitemaps() {
    725             if ( !empty( $this->options["{$this->prefix}paginate"] ) ) {
     771            if ( !empty( $this->options["{$this->prefix}paginate"] ) ) {
    726772                $this->paginate = true;
    727773                if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
     
    772818        }
    773819       
     820
     821
     822
     823
     824
     825
     826
     827
     828
     829
     830
     831
     832
     833
     834
     835
     836
     837
     838
    774839        /** Get priority settings for sitemap entries. **/
    775         function get_default_priority( $item, $nodefaults = false ) {
     840        function get_default_priority( $item, $nodefaults = false ) {
    776841            $defaults = Array( 'homepage' => '1.0', 'blog' => '0.9', 'sitemap' => '0.8', 'post' => '0.7', 'archive' => '0.5', 'author' => '0.3', 'taxonomies' => '0.3' );
    777842            static $cache = Array();
    778             if ( !empty( $cache[ $item ] ) ) return $cache[ $item ];
    779             if ( !empty( $defaults[ $item ] ) ) {
    780                 $field = $this->prefix . 'prio_' . $item;
    781                 if ( $this->option_isset( 'prio_' . $item ) && $this->options[ $field ] != 'no' ) {
    782                     $cache[ $item ] = $this->options[ $field ];
    783                     return $this->options[ $field ];
    784                 }
    785                 if ( $nodefaults ) return false;
    786                 return $defaults[ $item ];
    787             }
    788             return false;
    789         }
    790        
     843            return $this->get_default_values( $defaults, 'prio_', $cache, $item, $nodefaults, $type );
     844        }
     845
    791846        /** Get frequency settings for sitemap entries. **/
    792847        function get_default_frequency( $item, $nodefaults = false ) {
    793848            $defaults = Array( 'homepage' => 'always', 'blog' => 'daily', 'sitemap' => 'hourly', 'post' => 'weekly', 'archive' => 'monthly', 'author' => 'weekly', 'taxonomies' => 'monthly' );
    794849            static $cache = Array();
    795             if ( !empty( $cache[ $item ] ) ) return $cache[ $item ];
    796             if ( !empty( $defaults[ $item ] ) ) {
    797                 $field = $this->prefix . 'freq_' . $item;
    798                 if ( $this->option_isset( 'freq_' . $item ) && $this->options[ $field ] != 'no' ) {
    799                     $cache[ $item ] = $this->options[ $field ];
    800                     return $this->options[ $field ];
    801                 }
    802                 if ( $nodefaults ) return false;
    803                 return $defaults[ $item ];
    804             }
    805             return false;
    806         }
    807 
     850            return $this->get_default_values( $defaults, 'freq_', $cache, $item, $nodefaults, $type );
     851        }
     852       
    808853        /** Build an index of sitemaps used. **/
    809854        function get_sitemap_index_filenames() {
     
    860905            return $files;
    861906        }
     907
     908
     909
     910
     911
     912
     913
     914
     915
     916
     917
     918
     919
     920
     921
     922
     923
     924
     925
     926
     927
     928
     929
     930
     931
     932
     933
     934
     935
     936
     937
    862938
    863939        /** Build all the indexes. **/
     
    865941            $this->start_memory_usage = memory_get_peak_usage();
    866942            $options = $this->options;
    867             $comment = __( "file '%s' statically", 'all_in_one_seo_pack' );
    868             $this->write_sitemaps(  $options["{$this->prefix}filename"],
    869                                     $this->build_sitemap_index( $this->get_sitemap_index_filenames() ), sprintf( $comment, $options["{$this->prefix}filename"] ) );
    870             $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_addl",
    871                                     $this->build_sitemap( $this->get_addl_pages(), sprintf( $comment, $options["{$this->prefix}filename"] . "_addl" ) ) );
     943           
     944            $this->do_write_sitemap( 'root' );
     945            $this->do_write_sitemap( 'addl' );
     946           
     947            if ( $this->option_isset( 'archive' ) ) $this->do_write_sitemap( 'archive' );
     948            if ( $this->option_isset( 'author' ) ) $this->do_write_sitemap( 'author' );
     949
    872950            if ( ( !isset( $options["{$this->prefix}posttypes"] ) ) || ( !is_array( $options["{$this->prefix}posttypes"] ) ) ) $options["{$this->prefix}posttypes"] = Array();
    873951            if ( ( !isset( $options["{$this->prefix}taxonomies"] ) ) || ( !is_array( $options["{$this->prefix}taxonomies"] ) ) ) $options["{$this->prefix}taxonomies"] = Array();
    874952            $options["{$this->prefix}posttypes"] = array_diff( $options["{$this->prefix}posttypes"], Array( 'all' ) );
    875953            $options["{$this->prefix}taxonomies"] = array_diff( $options["{$this->prefix}taxonomies"], Array( 'all' ) );
    876            
     954
    877955            if ( !empty( $options["{$this->prefix}posttypes"] ) ) {
    878956                $post_counts = $this->get_all_post_counts( Array('post_type' => $options["{$this->prefix}posttypes"], 'post_status' => 'publish') );
     
    881959                    if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) {
    882960                            $count = 1;
    883                             for( $post_count = 0; $post_count < $post_counts[$posttype]; $post_count += $this->max_posts ) {
    884                                 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_{$posttype}_{$count}" );
    885                                 $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_{$posttype}_{$count}",
    886                                                         $this->build_sitemap( $this->get_all_post_priority_data( $posttype, 'publish', ( $count - 1 ) ), $comment ) );
     961                            for( $post_count = 0; $post_count < $post_counts[$posttype]; $post_count += $this->max_posts ) {                               
     962                                $this->do_write_sitemap( $posttype, $count - 1, $options["{$this->prefix}filename"] . "_{$posttype}_{$count}" );
    887963                                $count++;
    888964                            }
    889965                    } else {
    890                         $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$posttype" );
    891                         $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_$posttype",
    892                                                 $this->build_sitemap( $this->get_all_post_priority_data( $posttype ), $comment ) );
    893                     }
    894                 }               
    895             }
    896            
    897             if ( $this->option_isset( 'archive') ) {
    898                 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_archive" );
    899                 $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_archive",
    900                                         $this->build_sitemap( $this->get_archive_prio_data(), $comment ) );
    901             }
    902             if ( $this->option_isset( 'author') ) {
    903                 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_author" );
    904                 $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_author",
    905                                         $this->build_sitemap( $this->get_author_prio_data(), $comment ) );
    906             }
    907             if ( !empty( $options["{$this->prefix}taxonomies"] ) )
    908                 foreach ( $options["{$this->prefix}taxonomies"]  as $taxonomy ) {
    909 
    910                 }
    911 
     966                        $this->do_write_sitemap( $posttype );
     967                    }
     968                }
     969            }
     970           
    912971            if ( !empty( $options["{$this->prefix}taxonomies"] ) )
    913972                foreach( $options["{$this->prefix}taxonomies"] as $taxonomy ) {
     
    917976                            if ( $term_count > $this->max_posts ) {
    918977                                $count = 1;
    919                                 for( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) {                                   
    920                                     $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$taxonomy_$count" );
    921                                     $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_$taxonomy_$count",
    922                                                         $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args( $tc ) ), $comment ) ) );
     978                                for( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) {
     979                                    $this->do_write_sitemap( $taxonomy, $tc, $options["{$this->prefix}filename"] . "_{$taxonomy}_{$count}" );
    923980                                    $count++;
    924981                                }
    925982                            } else {
    926                                 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$taxonomy" );
    927                                 $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_$taxonomy",
    928                                                     $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args() ), $comment ) ) );
     983                                $this->do_write_sitemap( $taxonomy );
    929984                            }
    930985                        } else {
    931                             $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$taxonomy" );
    932                             $this->write_sitemaps(  $options["{$this->prefix}filename"] . "_$taxonomy",
    933                                                 $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args() ), $comment ) ) );                         
     986                            $this->do_write_sitemap( $taxonomy );
    934987                        }
    935988                    }
    936989                }
    937            
    938990            $this->log_stats( 'indexed', $options["{$this->prefix}gzipped"], false );
    939991        }
    940 
    941         /** Build a single, stand-alone sitemap without indexes. **/
    942         function do_simple_sitemap( $comment = '' ) {
     992       
     993        function get_simple_sitemap() {
    943994            $home = Array(
    944995                        'loc' => get_home_url(),
     
    9881039            $prio3 = $this->get_addl_pages_only();
    9891040            $prio = array_merge( $child, $prio, $prio2, $prio3 );
    990             return $this->build_sitemap( $prio, $comment );
     1041            if ( is_array( $this->extra_sitemaps ) )
     1042                foreach( $this->extra_sitemaps as $sitemap_type ) {
     1043                    $sitemap_data = Array();
     1044                    $sitemap_data = apply_filters( $this->prefix . 'custom_' . $sitemap_type, $sitemap_data, $page, $this_options );
     1045                    $prio = array_merge( $prio, $sitemap_data );
     1046                }
     1047            return $prio;
     1048        }
     1049
     1050        /** Build a single, stand-alone sitemap without indexes. **/
     1051        function do_simple_sitemap( $comment = '' ) {
     1052            $sitemap_data = $this->get_simple_sitemap();
     1053            $sitemap_data = apply_filters( $this->prefix . 'data', $sitemap_data, 'root', 0, $this->options );
     1054            return $this->build_sitemap( $sitemap_data, $comment );
    9911055        }
    9921056       
     
    10011065            $current_host = $_SERVER['HTTP_HOST'];
    10021066            if ( empty( $current_host ) ) $current_host = $_SERVER['SERVER_NAME'];
     1067
    10031068            if ( !empty( $current_host ) && ( $current_host != $plugin_url['host'] ) ) {
    10041069                $plugin_url['host'] = $current_host;
     
    11021167            $prio = Array();
    11031168            if (is_array( $terms ) ) {
    1104                 $f = $this->get_default_frequency( 'taxonomies' );
    1105                 $p = $this->get_default_priority( 'taxonomies' );
     1169                $y( 'taxonomies' );
     1170                $y( 'taxonomies' );
    11061171                foreach ($terms as $term) {
    1107                     $url = $this->get_term_link( $term, $term->taxonomy );
    1108                     $prio[] = Array(
    1109                                 'loc' => $url,
    1110                                 'changefreq' => $f,
    1111                                 'priority' => $p
    1112                             );
     1172                    $pr_info = Array();
     1173                    $pr_info['loc'] = $this->get_term_link( $term, $term->taxonomy );
     1174                    if ( ( $this->options[ $this->prefix . 'prio_taxonomies' ] == 'sel' ) && ( isset( $this->options[ $this->prefix . 'prio_taxonomies_' . $term->taxonomy ] ) ) ) {
     1175                            $pr_info['priority'] = $this->options[ $this->prefix . 'prio_taxonomies_' . $term->taxonomy ];
     1176                    } else $pr_info['priority'] = $def_prio;
     1177                    if ( ( $this->options[ $this->prefix . 'freq_taxonomies' ] == 'sel' ) && ( isset( $this->options[ $this->prefix . 'freq_taxonomies_' . $term->taxonomy ] ) ) ) {
     1178                            $pr_info['changefreq'] = $this->options[ $this->prefix . 'freq_taxonomies_' . $term->taxonomy ];
     1179                    } else $pr_info['changefreq'] = $def_freq;
     1180                    $prio[] = $pr_info;
    11131181                }
    11141182            }
     
    13941462                    if ( $freq_override )
    13951463                        $pr_info[ 'changefreq' ] = $freq_override;
     1464
     1465
     1466
     1467
     1468
     1469
    13961470                    $pr_info['loc'] = $url;
    13971471                    $pr_info = apply_filters( $this->prefix . 'prio_item_filter', $pr_info, $post, $args );
     
    16191693                $ex_args['meta_compare'] = '=';
    16201694                $ex_args['fields'] = 'ids';
     1695
    16211696                $q = new WP_Query( $ex_args );
    16221697                if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] );
  • all-in-one-seo-pack/trunk/all_in_one_seo_pack.php

    r895274 r924101  
    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.1.5
     6Version: 2.1.
    77Author: Michael Torbert
    88Author URI: http://michaeltorbert.com
     
    3131/**
    3232 * @package All-in-One-SEO-Pack
    33  * @version 2.1.5
     33 * @version 2.1.
    3434 */
    3535
    3636if ( ! defined( 'AIOSEOP_VERSION' ) )
    37     define( 'AIOSEOP_VERSION', '2.1.5' );
     37    define( 'AIOSEOP_VERSION', '2.1.' );
    3838
    3939if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
  • all-in-one-seo-pack/trunk/quickedit_functions.js

    r785578 r924101  
    1 function aioseop_ajax_edit_meta_form( post_id, post_title, meta ) {
     1function aioseop_ajax_edit_meta_form( post_id, meta ) {
    22    var uform = jQuery('#aioseop_'+meta+'_' + post_id);
     3
    34    var element = uform.html(); var input;
    45    input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:10px;width:65%;float:left" rows=2 cols=16>'  + post_title + '</textarea>';
  • all-in-one-seo-pack/trunk/readme.txt

    r895274 r924101  
    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
     6Tested up to: 3.9
    77Stable tag: trunk
    88
Note: See TracChangeset for help on using the changeset viewer.