Plugin Directory

Changeset 895274

Timestamp:
04/16/2014 10:40:07 PM (10 years ago)
Author:
pbaylies
Message:

Bugfixes; sitemap pagination for taxonomies; display advertising support for Universal Analytics; fallback to default image and homepage og:image for Social Media; bumped version; tagged

Location:
all-in-one-seo-pack
Files:
11 added
8 edited
44 copied

Legend:

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

    r861972 r895274  
    5151        global $aioseop_options;
    5252        $this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
    53         if ( $aioseop_options['aiosp_do_log'] )
     53   
     54        if ( !empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] )
    5455            $this->do_log = true;
    5556        else
     
    173174            "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' ),
    174175            "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' ),
    175             "ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking with legacy ga.js tracking method (not required for Universal Analytics).", 'all_in_one_seo_pack' ),
     176            "ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking.", 'all_in_one_seo_pack' ),
    176177            "ga_exclude_users"      => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ),
    177178            "ga_track_outbound_links"=> __( "Check this if you want to track outbound links with 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' ),
     
    399400                'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ),
    400401                'type' => 'checkbox',
    401                 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ),
    402                                      'aiosp_ga_use_universal_analytics' => Array( 'lhs' => 'aiosp_ga_use_universal_analytics', 'op' => '!=', 'rhs' => 'on' ) ) ),               
     402                'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),               
    403403            "ga_exclude_users"=> Array(
    404404                'name' => __( 'Exclude Users From Tracking:', 'all_in_one_seo_pack' ),
     
    13381338                $googleplus = $aioseop_options['aiosp_google_publisher'];
    13391339
    1340 
    1341             if ( $is_front_page ) {
     1340            $page = $this->get_page_number();
     1341            if ( ) {
    13421342                if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
    13431343                    $publisher = $aioseop_options['aiosp_google_publisher'];
     
    13641364            if ( !empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) {
    13651365                if ( $is_front_page && !in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) {
    1366                     unset( $author );
     1366                    ;
    13671367                } else {
    13681368                    if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) {
    13691369                        if ( is_singular() && !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
    1370                                 unset( $author );
     1370                                ;
    13711371                    } else {
    13721372                        if ( !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
    1373                             unset( $author );
     1373                            ;
    13741374                    }
    13751375                }
     
    13951395                global $wp_query;
    13961396                $max_page = $wp_query->max_num_pages;
    1397                 $page = $this->get_page_number();
    13981397                if ( $page > 1 )
    13991398                    $prev = get_previous_posts_page_link();
     
    17081707                $allow_linker = "'allowLinker': true";
    17091708            }
     1709
     1710
     1711
     1712
    17101713            $js_options = Array();
    17111714            foreach( Array( 'cookie_domain', 'allow_linker' ) as $opts ) {
     
    17251728
    17261729            ga('create', '{$analytics_id}'{$js_options});
     1730
    17271731            ga('send', 'pageview');
    17281732            </script>
     
    18991903                $link = get_term_link( $term, $taxonomy );
    19001904        } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
    1901             $link = get_post_type_archive_link( $post_type );
     1905                if ( is_array( $post_type ) )
     1906                    $post_type = reset( $post_type );
     1907                $link = get_post_type_archive_link( $post_type );           
    19021908        } else {
    19031909            return false;
  • all-in-one-seo-pack/tags/2.1.5/aioseop_feature_manager.php

    r861970 r895274  
    2424                                        'description'   => __( 'Optimize performance related to SEO and check your system status.', 'all_in_one_seo_pack' ),
    2525                                        'default'   => 'on' ),
     26
     27
    2628                'coming_soon' => Array( 'name'          => __( 'Coming Soon...', 'all_in_one_seo_pack' ),
    2729                                        'description'   => __( 'File Editor', 'all_in_one_seo_pack' ),
  • all-in-one-seo-pack/tags/2.1.5/aioseop_functions.php

    r861972 r895274  
    610610    }
    611611}
     612
     613
     614
     615
     616
     617
     618
     619
     620
     621
     622
     623
     624
     625
     626
     627
     628
     629
     630
     631
     632
     633
     634
     635
  • all-in-one-seo-pack/tags/2.1.5/aioseop_module.css

    r861972 r895274  
    361361    background-image: url(images/SocialMeta-Color-Standard.png);
    362362}
     363
     364
     365
     366
     367
     368
    363369div.aioseop_feature#aioseop_performance .aioseop_featured_image {
    364370    background-image: url(images/Performance-BW-Standard.png);
     
    638644    vertical-align: text-bottom;
    639645    margin: 15px 0 0 0;
     646
     647
     648
    640649}
    641650#aiosp {
  • all-in-one-seo-pack/tags/2.1.5/aioseop_opengraph.php

    r861972 r895274  
    7979                "hometitle"             => __( "The Home Title is the Open Graph title for your home page.<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' ),
    8080                "description"           => __( "The Home Description is the Open Graph description for your home page.<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' ),
     81
    8182                "generate_descriptions" => __( "Check this and your Open Graph descriptions will be auto-generated from your 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' ),
    8283                "disable_jetpack"       => __( "Check this box to disable the Open Graph meta output by the Jetpack plugin.<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' ),
    8384                "defimg"                => __( "This option lets you choose which image will be displayed by default for the Open Graph image. You may override this on individual posts.<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' ),
     85
    8486                "dimg"                  => __( "This option sets a default image that can be used for the Open Graph image. You can upload an image, select an image from your Media Library or paste the URL of an image here.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
    8587                "meta_key"              => __( "Enter the name of a custom field (or multiple field names separated by commas) to use that field to specify the Open Graph image on Pages or Posts.<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' ),
     
    104106                    'description'   => Array(   'name'          => __( 'Home Description',  'all_in_one_seo_pack'),
    105107                                                'default'       => '', 'type' => 'textarea', 'condshow' => Array( 'aiosp_opengraph_setmeta' => Array( 'lhs' => "aiosp_opengraph_setmeta", 'op' => '!=', 'rhs' => 'on' ) ) ),
     108
     109
    106110                    'generate_descriptions' => Array( 'name'    => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
    107111                    'disable_jetpack'       => Array( 'name'    => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ),
    108112                    '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' ) ) ),
     113
    109114                    'dimg'          => Array(   'name'          => __( 'Default OG:Image',  'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
    110115                    'meta_key'      => Array(   'name'          => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
     
    145150            $this->locations = array(
    146151                'opengraph' =>  Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
    147                                        'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'disable_jetpack', 'generate_descriptions', 'defimg', 'dimg', 'meta_key', 'categories', 'types') ),
     152                                       'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', '', 'dimg', 'meta_key', 'categories', 'types') ),
    148153                'settings'  =>  Array(  'name'      => __('Social Settings', 'all_in_one_seo_pack'),
    149154                                                          'type'        => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
     
    315320                    $description = $this->options['aiosp_opengraph_description'];
    316321                $type = $this->options['aiosp_opengraph_categories'];
    317                 $thumbnail = $this->options['aiosp_opengraph_dimg'];
     322                if ( !empty( $this->options['aiosp_opengraph_homeimage'] ) )
     323                    $thumbnail = $this->options['aiosp_opengraph_homeimage'];
     324                else
     325                    $thumbnail = $this->options['aiosp_opengraph_dimg'];
    318326               
    319327                /* If Use AIOSEO Title and Desc Selected */
     
    398406                }
    399407            }
     408
     409
     410
    400411           
    401412            $width = $height = '';
  • all-in-one-seo-pack/tags/2.1.5/aioseop_sitemap.php

    r861970 r895274  
    1616
    1717        function All_in_One_SEO_Pack_Sitemap( ) {
    18             $this->name = __( 'XML Sitemap', 'all_in_one_seo_pack' );   // Human-readable name of the plugin
    19             $this->prefix = 'aiosp_sitemap_';                       // option prefix
    20             $this->file = __FILE__;                                 // the current file
     18            if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
     19                $this->name = __( 'XML Sitemap', 'all_in_one_seo_pack' ); // Human-readable name of the plugin
     20                $this->prefix = 'aiosp_sitemap_';                         // option prefix
     21                $this->file = __FILE__;                                   // the current file
     22            }
    2123            parent::__construct();
    2224            $this->comment_string = __( "Sitemap %s generated by All in One SEO Pack %s by Michael Torbert of Semper Fi Web Design on %s", 'all_in_one_seo_pack' );
     
    5254                    'indexes'   => Array( 'name'      => __( 'Enable Sitemap Indexes', 'all_in_one_seo_pack' ) ),
    5355                    'paginate'  => Array( 'name'      => __( 'Paginate Sitemap Indexes', 'all_in_one_seo_pack' ),
    54                                           'condshow'  => Array( "aiosp_sitemap_indexes" => 'on' ) ),
     56                                          'condshow'  => Array( "indexes" => 'on' ) ),
    5557                    'max_posts' => Array( 'name'      => __( 'Maximum Posts Per Sitemap', 'all_in_one_seo_pack' ),
    5658                                          'type'      => 'text', 'default' => 50000,
    57                                           'condshow'  => Array( "aiosp_sitemap_indexes" => 'on', "aiosp_sitemap_paginate" => 'on' ) ),
     59                                          'condshow'  => Array( "paginate" => 'on' ) ),
    5860                    'posttypes' => Array( 'name'      => __( 'Post Types', 'all_in_one_seo_pack'),
    5961                                          'type'      => 'multicheckbox', 'default' => 'all' ),
     
    154156                foreach( $help_text as $k => $v )
    155157                    $this->default_options[$k]['help_text'] = $v;
    156 
    157             // load initial options / set defaults
    158             $this->update_options( );
    159            
    160             if ( !empty( $this->options['aiosp_sitemap_paginate'] ) ) {
    161                 $this->paginate = true;
    162                 if ( ( $this->options['aiosp_sitemap_max_posts'] ) && ( $this->options['aiosp_sitemap_max_posts'] > 0 ) && ( $this->options['aiosp_sitemap_max_posts'] < 50000 ) )
    163                     $this->max_posts = $this->options['aiosp_sitemap_max_posts'];
    164             }
    165 
    166             if ( is_multisite() ) $this->options['aiosp_sitemap_rewrite'] = 'On';
    167 
    168             if ( $this->options['aiosp_sitemap_rewrite'] ) $this->setup_rewrites();
    169            
    170             if ( $this->option_isset( 'robots' ) )
    171                 add_action( 'do_robots', Array( $this, 'do_robots' ), 100 );
    172            
     158                   
     159            add_action( 'init', Array( $this, 'load_sitemap_options' ) );
    173160            add_action( $this->prefix . 'settings_update',  Array( $this, 'do_sitemaps' ) );
    174161            add_filter( $this->prefix . 'display_settings', Array( $this, 'update_post_data' ) );
     
    178165        }
    179166       
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
    180185        /** Custom settings - displays boxes for add pages to sitemap option. **/
    181186        function display_custom_options( $buf, $args ) {
    182             if ( $args['name'] == 'aiosp_sitemap_addl_pages' ) {
    183                 $buf .= '<div id="aiosp_sitemap_addl_pages">';
     187            if ( $args['name'] == ) {
     188                $buf .= ;
    184189                if ( !empty( $args['value'] ) ) {
    185190                    $buf .= "<table class='aioseop_table' cellpadding=0 cellspacing=0>\n";
     
    200205            $buf .= '</div>';
    201206            return $buf;
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
    202234        }
    203235       
     
    279311                                                                'all_in_one_seo_pack' ), $privacy_link );
    280312            }
    281             if ( $this->option_isset( 'debug' ) ) $options['aiosp_sitemap_debug'] = '<pre>' . $options['aiosp_sitemap_debug'] . '</pre>';
     313            if ( $this->option_isset( 'debug' ) ) $options[] . '</pre>';
    282314            return $options;
    283315        }
     
    285317        /** Handle 'all' option for post types / taxonomies, further sanitization of filename, rewrites on for multisite, setting up addl pages option. **/
    286318        function filter_options( $options ) {
    287             if ( is_array( $options['aiosp_sitemap_posttypes'] ) && in_array( 'all', $options['aiosp_sitemap_posttypes'] ) && is_array( $this->default_options['posttypes' ]['initial_options'] ) )
    288                 $options['aiosp_sitemap_posttypes'] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
    289             if ( is_array( $options['aiosp_sitemap_taxonomies'] ) && in_array( 'all', $options['aiosp_sitemap_taxonomies'] ) && is_array( $this->default_options['taxonomies' ]['initial_options'] ) )
    290                 $options['aiosp_sitemap_taxonomies'] = array_keys( $this->default_options['taxonomies' ]['initial_options'] );
     319            if ( is_array( $options[] ) && is_array( $this->default_options['posttypes' ]['initial_options'] ) )
     320                $options[] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
     321            if ( is_array( $options[] ) && is_array( $this->default_options['taxonomies' ]['initial_options'] ) )
     322                $options[] = array_keys( $this->default_options['taxonomies' ]['initial_options'] );
    291323            $opt = $this->prefix . 'filename';
    292324            if ( isset( $options[$opt] ) && !empty( $options[$opt] ) )
     
    355387                            }
    356388                            if ( !$siteurl ) $siteurl = get_home_url( $blog_id );
    357                             $url = $siteurl . '/' . $sitemap_options["aiosp_sitemap_filename"] . '.xml';
    358                             if ( $sitemap_options['aiosp_sitemap_gzipped'] ) $url .= '.gz';
     389                            $url = $siteurl . '/' . $sitemap_options["filename"] . '.xml';
     390                            if ( $sitemap_options[] ) $url .= '.gz';
    359391                            $siteurls[] = $url;
    360392                        }
     
    369401            $files = Array();
    370402           
    371             if ( !empty( $this->options['aiosp_sitemap_filename'] ) ) {
    372                 $scan1 = get_home_path() . $this->options['aiosp_sitemap_filename'] . '*.xml';
    373                 if ( !empty( $this->options['aiosp_sitemap_gzipped'] ) )
    374                     $scan2 .= get_home_path() . $this->options['aiosp_sitemap_filename'] . '*.xml.gz';
     403            if ( !empty( $this->options[] ) ) {
     404                $scan1 = get_home_path() . $this->options[] . '*.xml';
     405                if ( !empty( $this->options[] ) )
     406                    $scan2 .= get_home_path() . $this->options[] . '*.xml.gz';
    375407               
    376408                if ( empty( $scan1 ) && empty( $scan2 ) ) return $files;
     
    394426        function do_sitemap_scan() {
    395427            $msg = '';
    396             if ( !empty(  $this->options['aiosp_sitemap_rewrite'] ) && ( get_option('permalink_structure') == '' ) ) {
     428            if ( !empty(  $this->options[] ) && ( get_option('permalink_structure') == '' ) ) {
    397429                $msg = '<p>' . __( 'Warning: dynamic sitemap generation must have permalinks enabled.', 'all_in_one_seo_pack' ) . '</p>';
    398430            }
     
    433465                $this->output_error( $msg );
    434466        }
    435        
     467
    436468        /** Do the scan, return the results. **/
    437469        function scan_sitemaps() {
     
    474506                        if ( preg_match( "/<!-- " . sprintf( $this->comment_string, '(.*)', '(.*)', '(.*)' ) .  " -->/",
    475507                                            $file, $matches ) ) {
    476                                 if ( !empty(  $this->options['aiosp_sitemap_rewrite'] ) ) {
     508                                if ( !empty(  $this->options[] ) ) {
    477509                                    $msg .= '<p>' . sprintf( __( "Warning: a static sitemap '%s' generated by All in One SEO Pack %s on %s already exists that may conflict with dynamic sitemap generation.", 'all_in_one_seo_pack' ),
    478510                                     $f, $matches[2], $matches[3] ) . "</p>\n";
     
    508540        /** Updates debug log messages. **/
    509541        function debug_message( $msg ) {
    510             if ( empty( $this->options["aiosp_sitemap_debug"] ) ) $this->options["aiosp_sitemap_debug"] = '';
    511             $this->options["aiosp_sitemap_debug"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["aiosp_sitemap_debug"];
    512             if ( $this->strlen( $this->options["aiosp_sitemap_debug"] ) > 2048 ) {
    513                 $end = $this->strrpos( $this->options["aiosp_sitemap_debug"], "\n" );
     542            if ( empty( $this->options["debug"] = '';
     543            $this->options["debug"];
     544            if ( $this->strlen( $this->options["debug"] ) > 2048 ) {
     545                $end = $this->strrpos( $this->options["debug"], "\n" );
    514546                if ( $end === false ) $end = 2048;
    515                 $this->options["aiosp_sitemap_debug"] = $this->substr( $this->options["aiosp_sitemap_debug"], 0, $end );
     547                $this->options["debug"], 0, $end );
    516548            }
    517549            $this->update_class_option( $this->options );
     
    523555            add_filter( 'query_vars', Array( $this, 'query_var_hook' ) );
    524556            add_action( 'parse_query', Array( $this, 'sitemap_output_hook') );
    525             if ( !get_transient( 'aiosp_sitemap_rules_flushed' ) )
     557            if ( !get_transient( ) )
    526558                add_action( 'wp_loaded', Array($this, 'flush_rules_hook' ) );
    527559        }
     
    531563            $sitemap_rules_normal = $sitemap_rules_gzipped = Array();
    532564            $sitemap_rules_normal = array(
    533                 $this->options["aiosp_sitemap_filename"] . '.xml'           => 'index.php?aioseop_sitemap_path=root',
    534                 $this->options["aiosp_sitemap_filename"] . '_(.+)_(\d+).xml'=> 'index.php?aioseop_sitemap_path=$matches[1]&aioseop_sitemap_page=$matches[2]',
    535                 $this->options["aiosp_sitemap_filename"] . '_(.+).xml'      => 'index.php?aioseop_sitemap_path=$matches[1]'
     565                $this->options[",
     566                $this->options["page=$matches[2]',
     567                $this->options["path=$matches[1]'
    536568            );
    537             if ( $this->options['aiosp_sitemap_gzipped'] ) {
     569            if ( $this->options[] ) {
    538570                $sitemap_rules_gzipped = array(
    539                     $this->options["aiosp_sitemap_filename"] . '.xml.gz'        => 'index.php?aiosp_sitemap_gzipped=1&aioseop_sitemap_path=root.gz',
    540                     $this->options["aiosp_sitemap_filename"] . '_(.+)_(\d+).xml.gz' => 'index.php?aioseop_sitemap_path=$matches[1].gz&aioseop_sitemap_page=$matches[2]',
    541                     $this->options["aiosp_sitemap_filename"] . '_(.+).xml.gz'   => 'index.php?aioseop_sitemap_path=$matches[1].gz'
     571                    $this->options[",
     572                    $this->options["page=$matches[2]',
     573                    $this->options["path=$matches[1].gz'
    542574                );
    543575            }
     
    563595                if ( !isset( $rules[ $rule ] ) || ( $rules[ $rule ] != $sitemap_rules[ $rule ] ) ) {
    564596                    $wp_rewrite->flush_rules();
    565                     set_transient( 'aiosp_sitemap_rules_flushed', true, 43200 );
     597                    set_transient( , true, 43200 );
    566598                }
    567599            }
     
    570602        /** Add our query variable for sitemap generation. **/
    571603        function query_var_hook($vars) {
    572             $vars[] = 'aioseop_sitemap_path';
     604            $vars[] = ;
    573605            if ( $this->paginate )
    574                 $vars[] = 'aioseop_sitemap_page';
     606                $vars[] = ;
    575607            return $vars;
    576608        }
     
    600632        function sitemap_output_hook($query) {
    601633            $page = 0;
    602             if ( ( $this->options['aiosp_sitemap_rewrite'] ) )
    603                 if( !empty( $query->query_vars['aioseop_sitemap_path'] ) ) {
    604                     if( !empty( $query->query_vars['aioseop_sitemap_page'] ) )
    605                         $page = $query->query_vars['aioseop_sitemap_page'] - 1;
     634            if ( ( $this->options[] ) )
     635                if( !empty( $query->query_vars[] ) ) {
     636                    if( !empty( $query->query_vars[] ) )
     637                        $page = $query->query_vars[] - 1;
    606638                    $this->start_memory_usage = memory_get_peak_usage();
    607                     $sitemap_type = $query->query_vars['aioseop_sitemap_path'];
     639                    $sitemap_type = $query->query_vars[];
    608640                    $gzipped = false;
    609641                    if ( $this->substr( $sitemap_type, -3 ) === '.gz' ) {
     
    612644                    }
    613645                    $blog_charset = get_option( 'blog_charset' );
    614                     if ( $this->options['aiosp_sitemap_gzipped'] && $gzipped ) {
     646                    if ( $this->options[] && $gzipped ) {
    615647                        header( "Content-Type: application/x-gzip; charset=$blog_charset", true);
    616648                    } else {
     
    630662            $this->add_post_types();
    631663            $comment = __( "dynamically", 'all_in_one_seo_pack' );
    632             if ( $this->options['aiosp_sitemap_indexes'] ) {
    633                 $posttypes = $this->options['aiosp_sitemap_posttypes'];
     664            if ( $this->options[] ) {
     665                $posttypes = $this->options[];
    634666                if ( empty( $posttypes ) ) $posttypes = Array();
    635                 $taxonomies = $this->options['aiosp_sitemap_taxonomies'];
     667                $taxonomies = $this->options[];
    636668                if ( empty( $taxonomies ) ) $taxonomies = Array();
    637669                if ( $sitemap_type === 'root' ) {
     
    646678                    $this->output_sitemap( $this->get_all_post_priority_data( $sitemap_type, 'publish', $page ), $comment );
    647679                } elseif ( in_array( $sitemap_type, $taxonomies ) ) {
    648                     $this->output_sitemap( $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args() ) ), $comment );
     680                    $this->output_sitemap( $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args() ) ), $comment );
    649681                }
    650682            } elseif ( $sitemap_type === 'root' ) echo $this->do_simple_sitemap( $comment );
     
    653685        /** Build a url to the sitemap. **/
    654686        function get_sitemap_url() {
    655             $url = get_home_url() . '/' . $this->options["aiosp_sitemap_filename"] . '.xml';
    656             if ( $this->options['aiosp_sitemap_gzipped'] ) $url .= '.gz';
     687            $url = get_home_url() . '/' . $this->options["filename"] . '.xml';
     688            if ( $this->options[] ) $url .= '.gz';
    657689            return $url;
    658690        }
     
    691723        /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/
    692724        function do_sitemaps() {
    693             if ( !empty( $this->options['aiosp_sitemap_paginate'] ) ) {
     725            if ( !empty( $this->options[] ) ) {
    694726                $this->paginate = true;
    695                 if ( ( $this->options['aiosp_sitemap_max_posts'] ) && ( $this->options['aiosp_sitemap_max_posts'] > 0 ) && ( $this->options['aiosp_sitemap_max_posts'] < 50000 ) )
    696                     $this->max_posts = $this->options['aiosp_sitemap_max_posts'];
     727                if ( ( $this->options[] < 50000 ) )
     728                    $this->max_posts = $this->options[];
    697729                else
    698730                    $this->max_posts = 50000;               
     
    701733                $this->max_posts = 50000;
    702734            }
    703             if ( !$this->options['aiosp_sitemap_rewrite'] ) {
    704                 if ( $this->options['aiosp_sitemap_indexes'] ) {
     735            if ( !$this->options[] ) {
     736                if ( $this->options[] ) {
    705737                    $this->do_indexed_sitemaps();
    706738                } else {
    707739                    $this->log_start();
    708                     $comment = sprintf( __( "file '%s' statically", 'all_in_one_seo_pack' ), $this->options['aiosp_sitemap_filename'] );
     740                    $comment = sprintf( __( "file '%s' statically", 'all_in_one_seo_pack' ), $this->options[] );
    709741                    $sitemap = $this->do_simple_sitemap( $comment );
    710                     $this->write_sitemaps( $this->options['aiosp_sitemap_filename'], $sitemap );
    711                     $this->log_stats( 'root', $this->options['aiosp_sitemap_gzipped'], false );
     742                    $this->write_sitemaps( $this->options[], $sitemap );
     743                    $this->log_stats( 'root', $this->options[], false );
    712744                }
    713745            } else {
    714                 delete_transient( 'aiosp_sitemap_rules_flushed' );
     746                delete_transient( );
    715747            }
    716748            $this->do_notify();
     
    728760        function write_sitemaps( $filename, $contents ) {
    729761            $this->write_sitemap( $filename . ".xml", $contents );
    730             if ( $this->options['aiosp_sitemap_gzipped'] ) $this->write_sitemap( $filename . ".xml.gz", $contents, true );         
     762            if ( $this->options[] ) $this->write_sitemap( $filename . ".xml.gz", $contents, true );         
    731763        }
    732764       
     
    778810            $files = Array();
    779811            $options = $this->options;
    780             $prefix = $options["aiosp_sitemap_filename"];
     812            $prefix = $options["filename"];
    781813            $suffix = '.xml';
    782             if ( $options['aiosp_sitemap_gzipped'] ) $suffix .= '.gz';
    783             if ( empty( $options['aiosp_sitemap_posttypes'] ) ) $options['aiosp_sitemap_posttypes'] = Array();
    784             if ( empty( $options['aiosp_sitemap_taxonomies'] ) ) $options['aiosp_sitemap_taxonomies'] = Array();
    785             $options['aiosp_sitemap_posttypes'] = array_diff( $options['aiosp_sitemap_posttypes'], Array( 'all' ) );
    786             $options['aiosp_sitemap_taxonomies'] = array_diff( $options['aiosp_sitemap_taxonomies'], Array( 'all' ) );
     814            if ( $options[] ) $suffix .= '.gz';
     815            if ( empty( $options[] = Array();
     816            if ( empty( $options[] = Array();
     817            $options[], Array( 'all' ) );
     818            $options[], Array( 'all' ) );
    787819            $url_base = trailingslashit( get_home_url() );
    788820            $files[] = Array( 'loc' => $url_base . $prefix . '_addl' . $suffix );
    789             if ( !empty( $options['aiosp_sitemap_posttypes'] ) ) {
     821            if ( !empty( $options[] ) ) {
    790822                $prio = $this->get_default_priority( 'post' );
    791823                $freq = $this->get_default_frequency( 'post' );
    792                 if ( $this->paginate ) {
    793                     $post_counts = $this->get_all_post_counts( Array('post_type' => $options['aiosp_sitemap_posttypes'], 'post_status' => 'publish') );
    794                 }
    795                 foreach( $options['aiosp_sitemap_posttypes'] as $sm ) {
     824                $post_counts = $this->get_all_post_counts( Array('post_type' => $options["{$this->prefix}posttypes"], 'post_status' => 'publish') );
     825                foreach( $options["{$this->prefix}posttypes"] as $sm ) {
    796826                    if ( $post_counts[$sm] == 0 ) continue;
    797827                    if ( $this->paginate ) {
     
    805835                        $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $prio, 'changefreq' => $freq );                 
    806836                }
    807                
    808837            }
    809838            if ( $this->option_isset( 'archive' ) )
     
    811840            if ( $this->option_isset( 'author' ) )
    812841                $files[] = Array( 'loc' => $url_base . $prefix . '_author' . $suffix, 'priority' => $this->get_default_priority( 'author' ), 'changefreq' => $this->get_default_frequency( 'author' )  );
    813             if ( !empty( $options['aiosp_sitemap_taxonomies'] ) )
    814                 foreach( $options['aiosp_sitemap_taxonomies'] as $sm )
    815                     $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' )  );
     842               
     843            if ( !empty( $options["{$this->prefix}taxonomies"] ) )
     844                foreach( $options["{$this->prefix}taxonomies"] as $sm ) {
     845                    $term_count = wp_count_terms( $sm, array('hide_empty' => true) );
     846                    if ( !is_wp_error( $term_count ) && ( $term_count > 0 ) ) {
     847                        if ( $this->paginate ) {
     848                            if ( $term_count > $this->max_posts ) {
     849                                $count = 1;
     850                                for( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) {
     851                                    $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . '_' . ( $count++ ) . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' ) );
     852                                }
     853                            } else $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' ) );
     854                        } else
     855                            $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' )  );                       
     856                    }
     857                }
    816858            foreach( $this->get_child_sitemap_urls() as $csm )
    817859                $files[] = Array( 'loc' => $csm, 'priority' => $this->get_default_priority( 'sitemap' ), 'changefreq' => $this->get_default_frequency( 'sitemap' ) );
     
    824866            $options = $this->options;
    825867            $comment = __( "file '%s' statically", 'all_in_one_seo_pack' );
    826             $this->write_sitemaps(  $options['aiosp_sitemap_filename'],
    827                                     $this->build_sitemap_index( $this->get_sitemap_index_filenames() ), sprintf( $comment, $options['aiosp_sitemap_filename'] ) );
    828             $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_addl",
    829                                     $this->build_sitemap( $this->get_addl_pages(), sprintf( $comment, $options['aiosp_sitemap_filename'] . "_addl" ) ) );
    830             if ( ( !isset( $options['aiosp_sitemap_posttypes'] ) ) || ( !is_array( $options['aiosp_sitemap_posttypes'] ) ) ) $options['aiosp_sitemap_posttypes'] = Array();
    831             if ( ( !isset( $options['aiosp_sitemap_taxonomies'] ) ) || ( !is_array( $options['aiosp_sitemap_taxonomies'] ) ) ) $options['aiosp_sitemap_taxonomies'] = Array();
    832             $options['aiosp_sitemap_posttypes'] = array_diff( $options['aiosp_sitemap_posttypes'], Array( 'all' ) );
    833             $options['aiosp_sitemap_taxonomies'] = array_diff( $options['aiosp_sitemap_taxonomies'], Array( 'all' ) );
    834            
    835             if ( !empty( $options['aiosp_sitemap_posttypes'] ) ) {
    836                 if ( $this->paginate )
    837                     $post_counts = $this->get_all_post_counts( Array('post_type' => $options['aiosp_sitemap_posttypes'], 'post_status' => 'publish') );
    838                 foreach ( $options['aiosp_sitemap_posttypes'] as $posttype ) {
     868            $this->write_sitemaps(  $options[],
     869                                    $this->build_sitemap_index( $this->get_sitemap_index_filenames() ), sprintf( $comment, $options[] ) );
     870            $this->write_sitemaps(  $options[] . "_addl",
     871                                    $this->build_sitemap( $this->get_addl_pages(), sprintf( $comment, $options[] . "_addl" ) ) );
     872            if ( ( !isset( $options[] = Array();
     873            if ( ( !isset( $options[] = Array();
     874            $options[], Array( 'all' ) );
     875            $options[], Array( 'all' ) );
     876           
     877            if ( !empty( $options[] ) ) {
     878               
     879               
     880               
    839881                    if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) {
    840882                            $count = 1;
    841883                            for( $post_count = 0; $post_count < $post_counts[$posttype]; $post_count += $this->max_posts ) {
    842                                 $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_{$posttype}_{$count}" );
    843                                 $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_{$posttype}_{$count}",
     884                                $comment = sprintf( $comment, $options[] . "_{$posttype}_{$count}" );
     885                                $this->write_sitemaps(  $options[] . "_{$posttype}_{$count}",
    844886                                                        $this->build_sitemap( $this->get_all_post_priority_data( $posttype, 'publish', ( $count - 1 ) ), $comment ) );
    845887                                $count++;
    846888                            }
    847889                    } else {
    848                         $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_$posttype" );
    849                         $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_$posttype",
     890                        $comment = sprintf( $comment, $options[] . "_$posttype" );
     891                        $this->write_sitemaps(  $options[] . "_$posttype",
    850892                                                $this->build_sitemap( $this->get_all_post_priority_data( $posttype ), $comment ) );
    851893                    }
     
    854896           
    855897            if ( $this->option_isset( 'archive') ) {
    856                 $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_archive" );
    857                 $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_archive",
     898                $comment = sprintf( $comment, $options[] . "_archive" );
     899                $this->write_sitemaps(  $options[] . "_archive",
    858900                                        $this->build_sitemap( $this->get_archive_prio_data(), $comment ) );
    859901            }
    860902            if ( $this->option_isset( 'author') ) {
    861                 $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_author" );
    862                 $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_author",
     903                $comment = sprintf( $comment, $options[] . "_author" );
     904                $this->write_sitemaps(  $options[] . "_author",
    863905                                        $this->build_sitemap( $this->get_author_prio_data(), $comment ) );
    864906            }
    865             if ( !empty( $options['aiosp_sitemap_taxonomies'] ) )
    866                 foreach ( $options['aiosp_sitemap_taxonomies']  as $taxonomy ) {
    867                     $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_$taxonomy" );
    868                     $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_$taxonomy",
    869                                         $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args() ), $comment ) ) );
    870                 }
    871             $this->log_stats( 'indexed', $options['aiosp_sitemap_gzipped'], false );
     907            if ( !empty( $options["{$this->prefix}taxonomies"] ) )
     908                foreach ( $options["{$this->prefix}taxonomies"]  as $taxonomy ) {
     909
     910                }
     911
     912            if ( !empty( $options["{$this->prefix}taxonomies"] ) )
     913                foreach( $options["{$this->prefix}taxonomies"] as $taxonomy ) {
     914                    $term_count = wp_count_terms( $taxonomy, array('hide_empty' => true) );
     915                    if ( !is_wp_error( $term_count ) && ( $term_count > 0 ) ) {
     916                        if ( $this->paginate ) {
     917                            if ( $term_count > $this->max_posts ) {
     918                                $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 ) ) );
     923                                    $count++;
     924                                }
     925                            } 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 ) ) );
     929                            }
     930                        } 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 ) ) );                         
     934                        }
     935                    }
     936                }
     937           
     938            $this->log_stats( 'indexed', $options["{$this->prefix}gzipped"], false );
    872939        }
    873940
     
    880947                    );
    881948            $posts = get_option( 'page_for_posts' );
     949
    882950            if ( $posts ) {
    883951                $posts = $this->get_permalink( $posts );
     
    893961            $child = $this->get_child_sitemap_urls();
    894962            $options = $this->options;
    895             if ( is_array( $options['aiosp_sitemap_posttypes'] ) )
    896                 $options['aiosp_sitemap_posttypes'] = array_diff( $options['aiosp_sitemap_posttypes'], Array( 'all' ) );
    897             if ( is_array( $options['aiosp_sitemap_taxonomies'] ) )
    898                 $options['aiosp_sitemap_taxonomies'] = array_diff( $options['aiosp_sitemap_taxonomies'], Array( 'all' ) );
    899             $prio = $this->get_all_post_priority_data( $options['aiosp_sitemap_posttypes'] );
     963            if ( is_array( $options[] ) )
     964                $options[], Array( 'all' ) );
     965            if ( is_array( $options[] ) )
     966                $options[], Array( 'all' ) );
     967            $prio = $this->get_all_post_priority_data( $options[] );
    900968            if ( $this->option_isset( 'archive' ) ) $prio = array_merge( $prio, $this->get_archive_prio_data() );
    901969            if ( $this->option_isset( 'author' ) ) $prio = array_merge( $prio, $this->get_author_prio_data() );
     
    916984            if ( is_array( $posts ) ) array_unshift( $prio, $posts );
    917985            if ( is_array( $home ) )  array_unshift( $prio, $home );               
    918             $terms = get_terms( $options['aiosp_sitemap_taxonomies'], $this->get_tax_args() );
     986            $terms = get_terms( $options[], $this->get_tax_args() );
    919987            $prio2 = $this->get_term_priority_data( $terms );
    920988            $prio3 = $this->get_addl_pages_only();
     
    9371005                $plugin_path = $this->unparse_url( $plugin_url );
    9381006            }
    939             echo '<?xml-stylesheet type="text/xsl" href="' . $plugin_path . 'sitemap.xsl"?>' . "\r\n";
    940             echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\r\n";
     1007            $xml_header = '<?xml-stylesheet type="text/xsl" href="' . $plugin_path . 'sitemap.xsl"?>' . "\r\n"
     1008                        . '<urlset ';
     1009            $namespaces = apply_filters( $this->prefix . 'xml_namespace', Array( 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9' ) );
     1010            if ( !empty( $namespaces ) ) {
     1011                $ns = Array();
     1012                foreach( $namespaces as $k => $v ) {
     1013                    $ns[] = esc_attr( $k ) . '=' . '"' . esc_url( $v ) . '"';
     1014                }
     1015                $xml_header .= join( "\r\n\t", $ns );
     1016            }
     1017            $xml_header .= '>' . "\r\n";
     1018            echo $xml_header;
    9411019            $count = 0;
    9421020            foreach ( $urls as $url ) {
     
    9461024                        if ( !empty( $v ) ) {
    9471025                            if ( $k == 'loc' ) $v = esc_url( $v );
    948                             echo "\t\t<$k>$v</$k>\r\n";
     1026                                if ( is_array( $v ) ) {
     1027                                    $buf = "\t\t\t<$k>\r\n";
     1028                                    foreach( $v as $ext => $attr ) {
     1029                                        if ( is_array( $attr ) ) {
     1030                                            $buf = '';
     1031                                            echo "\t\t<$k>\r\n";
     1032                                            foreach( $attr as $a => $nested ) {
     1033                                                if ( is_array( $nested ) ) {
     1034                                                    echo "\t\t\t<$a>\r\n";
     1035                                                    foreach( $nested as $next => $nattr ) {
     1036                                                        echo "\t\t\t\t<$next>$nattr</$next>\r\n";
     1037                                                    }
     1038                                                    echo "\t\t\t</$a>\r\n";
     1039                                                } else echo "\t\t\t<$a>$nested</$a>\r\n";
     1040                                            }
     1041                                            echo "\t\t</$k>\r\n";
     1042                                        } else $buf .= "\t\t\t<$ext>$attr</$ext>\r\n";
     1043                                    }
     1044                                    if ( !empty( $buf ) ) echo $buf . "\t\t</$k>\r\n";
     1045                                } else echo "\t\t<$k>$v</$k>\r\n";
    9491046                        }
    9501047                    }
     
    9531050                }
    9541051                echo "\t</url>\r\n";
    955                 $count++;
    9561052                if ( $count >= $max_items ) break;
    9571053            }
     
    10851181            return "$scheme$user$pass$host$port$path$query$fragment";
    10861182        }
    1087 
     1183       
    10881184        /** Return data for user entered additional pages. **/
    10891185        function get_addl_pages_only() {
     
    11051201                }
    11061202            }
     1203
    11071204            return $pages;
    11081205        }
     
    11331230            if ( !empty( $posts ) )
    11341231                $pages[] = $posts;
     1232
    11351233            return $pages;
    11361234        }
     
    12621360        function get_prio_from_posts( $posts, $prio_override = false, $freq_override = false, $linkfunc = 'get_permalink' ) {
    12631361            $prio = Array();
     1362
    12641363            if ( ( $prio_override ) && ( $freq_override ) )
    12651364                $stats = 0;
     
    12961395                        $pr_info[ 'changefreq' ] = $freq_override;
    12971396                    $pr_info['loc'] = $url;
    1298                     $prio[] = $pr_info;
     1397                    $pr_info = apply_filters( $this->prefix . 'prio_item_filter', $pr_info, $post, $args );
     1398                    if ( !empty( $pr_info ) )
     1399                        $prio[] = $pr_info;
    12991400                }
    13001401            }
     
    13031404
    13041405        /** Return excluded categories for taxonomy queries. **/
    1305         function get_tax_args() {
     1406        function get_tax_args() {
    13061407            $args = Array();
    13071408            if ( $this->option_isset( 'excl_categories' ) )
    13081409                $args['exclude'] = $this->options[ $this->prefix . 'excl_categories'];
     1410
     1411
     1412
     1413
     1414
    13091415            return $args;
    13101416        }
     
    14121518        }
    14131519       
     1520
     1521
     1522
     1523
     1524
     1525
     1526
     1527
     1528
     1529
     1530
     1531
     1532
     1533
     1534
     1535
     1536
    14141537        /** Return post counts using wp_count_posts(). **/
    14151538        function get_all_post_counts( $args ) {
    1416             $post_counts = Array();
     1539            $post_counts = ;
    14171540            $status = 'inherit';
    14181541            if ( !empty( $args['post_status'] ) ) $status = $args['post_status'];
     
    14221545                        $args['post_type'] = array_shift( $args['post_type'] );
    14231546                    $count = (Array)wp_count_posts( $args['post_type'] );
    1424                     $post_counts[$args['post_type']] = $count[$status];
     1547                    $post_counts = $count[$status];
    14251548                } else
    14261549                    foreach( $args['post_type'] as $post_type ) {
     1550
    14271551                        $count = (Array)wp_count_posts( $post_type );
    1428                         if ( $post_type == 'attachment' )
    1429                             $post_counts[$post_type] = $count['inherit'];
    1430                         else
    1431                             $post_counts[$post_type] = $count[$status];
    1432                     }
     1552                        if ( empty( $count ) )
     1553                            $post_counts[$post_type] = 0;
     1554                        else {
     1555                            if ( $post_type == 'attachment' )
     1556                                $post_counts[$post_type] = $count['inherit'];
     1557                            else
     1558                                $post_counts[$post_type] = $count[$status];
     1559                        }
     1560                    }
     1561            $post_counts = apply_filters( $this->prefix . 'post_counts', $post_counts, $args );
    14331562            return $post_counts;
     1563
     1564
     1565
     1566
     1567
     1568
     1569
     1570
     1571
     1572
     1573
     1574
    14341575        }
    14351576
     
    14691610            if ( version_compare( $wp_version, '3.5', '>=' ) ) {
    14701611                $args['meta_query'] = Array(
    1471                     Array( 'key' => '_aioseop_sitemap_exclude', 'value' => 'null', 'compare' => 'NOT EXISTS' )
     1612                    Array( 'key' => '_aioseop_sitemap_exclude', 'value' => '', 'compare' => 'NOT EXISTS' )
    14721613                );
    14731614            } else {
     
    14781619                $ex_args['meta_compare'] = '=';
    14791620                $ex_args['fields'] = 'ids';
    1480                 $ex_args['posts_per_page'] = -1;
    14811621                $q = new WP_Query( $ex_args );
    14821622                if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] );
    14831623                if ( !empty( $q->posts ) ) $args['exclude'] = array_merge( $args['exclude'], $q->posts );
    1484             //}
     1624            // }
     1625           
    14851626            $posts = get_posts( apply_filters( $this->prefix . 'post_query', $args ) );
    14861627            if ( !empty( $exclude_slugs ) ) {
     
    14951636    }
    14961637}
     1638
  • all-in-one-seo-pack/tags/2.1.5/all_in_one_seo_pack.php

    r861972 r895274  
    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.4
     6Version: 2.1.
    77Author: Michael Torbert
    88Author URI: http://michaeltorbert.com
     
    3131/**
    3232 * @package All-in-One-SEO-Pack
    33  * @version 2.1.4
     33 * @version 2.1.
    3434 */
    3535
    3636if ( ! defined( 'AIOSEOP_VERSION' ) )
    37     define( 'AIOSEOP_VERSION', '2.1.4' );
     37    define( 'AIOSEOP_VERSION', '2.1.' );
    3838
    3939if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
     
    117117
    118118$aiosp_activation = false;
    119 $aioseop_module_list = Array( 'sitemap', 'opengraph', 'performance' ); // list all available modules here
     119$aioseop_module_list = Array( 'sitemap', 'opengraph', 'performance' ); // list all available modules here
    120120
    121121if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
  • all-in-one-seo-pack/tags/2.1.5/readme.txt

    r864255 r895274  
    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.8.1
     6Tested up to: 3.
    77Stable tag: trunk
    88
  • all-in-one-seo-pack/trunk/aioseop_class.php

    r861972 r895274  
    5151        global $aioseop_options;
    5252        $this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
    53         if ( $aioseop_options['aiosp_do_log'] )
     53   
     54        if ( !empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] )
    5455            $this->do_log = true;
    5556        else
     
    173174            "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' ),
    174175            "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' ),
    175             "ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking with legacy ga.js tracking method (not required for Universal Analytics).", 'all_in_one_seo_pack' ),
     176            "ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking.", 'all_in_one_seo_pack' ),
    176177            "ga_exclude_users"      => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ),
    177178            "ga_track_outbound_links"=> __( "Check this if you want to track outbound links with 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' ),
     
    399400                'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ),
    400401                'type' => 'checkbox',
    401                 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ),
    402                                      'aiosp_ga_use_universal_analytics' => Array( 'lhs' => 'aiosp_ga_use_universal_analytics', 'op' => '!=', 'rhs' => 'on' ) ) ),               
     402                'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),               
    403403            "ga_exclude_users"=> Array(
    404404                'name' => __( 'Exclude Users From Tracking:', 'all_in_one_seo_pack' ),
     
    13381338                $googleplus = $aioseop_options['aiosp_google_publisher'];
    13391339
    1340 
    1341             if ( $is_front_page ) {
     1340            $page = $this->get_page_number();
     1341            if ( ) {
    13421342                if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
    13431343                    $publisher = $aioseop_options['aiosp_google_publisher'];
     
    13641364            if ( !empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) {
    13651365                if ( $is_front_page && !in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) {
    1366                     unset( $author );
     1366                    ;
    13671367                } else {
    13681368                    if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) {
    13691369                        if ( is_singular() && !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
    1370                                 unset( $author );
     1370                                ;
    13711371                    } else {
    13721372                        if ( !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
    1373                             unset( $author );
     1373                            ;
    13741374                    }
    13751375                }
     
    13951395                global $wp_query;
    13961396                $max_page = $wp_query->max_num_pages;
    1397                 $page = $this->get_page_number();
    13981397                if ( $page > 1 )
    13991398                    $prev = get_previous_posts_page_link();
     
    17081707                $allow_linker = "'allowLinker': true";
    17091708            }
     1709
     1710
     1711
     1712
    17101713            $js_options = Array();
    17111714            foreach( Array( 'cookie_domain', 'allow_linker' ) as $opts ) {
     
    17251728
    17261729            ga('create', '{$analytics_id}'{$js_options});
     1730
    17271731            ga('send', 'pageview');
    17281732            </script>
     
    18991903                $link = get_term_link( $term, $taxonomy );
    19001904        } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
    1901             $link = get_post_type_archive_link( $post_type );
     1905                if ( is_array( $post_type ) )
     1906                    $post_type = reset( $post_type );
     1907                $link = get_post_type_archive_link( $post_type );           
    19021908        } else {
    19031909            return false;
  • all-in-one-seo-pack/trunk/aioseop_feature_manager.php

    r805127 r895274  
    2424                                        'description'   => __( 'Optimize performance related to SEO and check your system status.', 'all_in_one_seo_pack' ),
    2525                                        'default'   => 'on' ),
     26
     27
    2628                'coming_soon' => Array( 'name'          => __( 'Coming Soon...', 'all_in_one_seo_pack' ),
    2729                                        'description'   => __( 'File Editor', 'all_in_one_seo_pack' ),
  • all-in-one-seo-pack/trunk/aioseop_functions.php

    r861972 r895274  
    610610    }
    611611}
     612
     613
     614
     615
     616
     617
     618
     619
     620
     621
     622
     623
     624
     625
     626
     627
     628
     629
     630
     631
     632
     633
     634
     635
  • all-in-one-seo-pack/trunk/aioseop_module.css

    r861972 r895274  
    361361    background-image: url(images/SocialMeta-Color-Standard.png);
    362362}
     363
     364
     365
     366
     367
     368
    363369div.aioseop_feature#aioseop_performance .aioseop_featured_image {
    364370    background-image: url(images/Performance-BW-Standard.png);
     
    638644    vertical-align: text-bottom;
    639645    margin: 15px 0 0 0;
     646
     647
     648
    640649}
    641650#aiosp {
  • all-in-one-seo-pack/trunk/aioseop_opengraph.php

    r861972 r895274  
    7979                "hometitle"             => __( "The Home Title is the Open Graph title for your home page.<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' ),
    8080                "description"           => __( "The Home Description is the Open Graph description for your home page.<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' ),
     81
    8182                "generate_descriptions" => __( "Check this and your Open Graph descriptions will be auto-generated from your 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' ),
    8283                "disable_jetpack"       => __( "Check this box to disable the Open Graph meta output by the Jetpack plugin.<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' ),
    8384                "defimg"                => __( "This option lets you choose which image will be displayed by default for the Open Graph image. You may override this on individual posts.<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' ),
     85
    8486                "dimg"                  => __( "This option sets a default image that can be used for the Open Graph image. You can upload an image, select an image from your Media Library or paste the URL of an image here.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
    8587                "meta_key"              => __( "Enter the name of a custom field (or multiple field names separated by commas) to use that field to specify the Open Graph image on Pages or Posts.<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' ),
     
    104106                    'description'   => Array(   'name'          => __( 'Home Description',  'all_in_one_seo_pack'),
    105107                                                'default'       => '', 'type' => 'textarea', 'condshow' => Array( 'aiosp_opengraph_setmeta' => Array( 'lhs' => "aiosp_opengraph_setmeta", 'op' => '!=', 'rhs' => 'on' ) ) ),
     108
     109
    106110                    'generate_descriptions' => Array( 'name'    => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
    107111                    'disable_jetpack'       => Array( 'name'    => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ),
    108112                    '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' ) ) ),
     113
    109114                    'dimg'          => Array(   'name'          => __( 'Default OG:Image',  'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
    110115                    'meta_key'      => Array(   'name'          => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
     
    145150            $this->locations = array(
    146151                'opengraph' =>  Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
    147                                        'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'disable_jetpack', 'generate_descriptions', 'defimg', 'dimg', 'meta_key', 'categories', 'types') ),
     152                                       'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', '', 'dimg', 'meta_key', 'categories', 'types') ),
    148153                'settings'  =>  Array(  'name'      => __('Social Settings', 'all_in_one_seo_pack'),
    149154                                                          'type'        => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
     
    315320                    $description = $this->options['aiosp_opengraph_description'];
    316321                $type = $this->options['aiosp_opengraph_categories'];
    317                 $thumbnail = $this->options['aiosp_opengraph_dimg'];
     322                if ( !empty( $this->options['aiosp_opengraph_homeimage'] ) )
     323                    $thumbnail = $this->options['aiosp_opengraph_homeimage'];
     324                else
     325                    $thumbnail = $this->options['aiosp_opengraph_dimg'];
    318326               
    319327                /* If Use AIOSEO Title and Desc Selected */
     
    398406                }
    399407            }
     408
     409
     410
    400411           
    401412            $width = $height = '';
  • all-in-one-seo-pack/trunk/aioseop_sitemap.php

    r844829 r895274  
    1616
    1717        function All_in_One_SEO_Pack_Sitemap( ) {
    18             $this->name = __( 'XML Sitemap', 'all_in_one_seo_pack' );   // Human-readable name of the plugin
    19             $this->prefix = 'aiosp_sitemap_';                       // option prefix
    20             $this->file = __FILE__;                                 // the current file
     18            if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
     19                $this->name = __( 'XML Sitemap', 'all_in_one_seo_pack' ); // Human-readable name of the plugin
     20                $this->prefix = 'aiosp_sitemap_';                         // option prefix
     21                $this->file = __FILE__;                                   // the current file
     22            }
    2123            parent::__construct();
    2224            $this->comment_string = __( "Sitemap %s generated by All in One SEO Pack %s by Michael Torbert of Semper Fi Web Design on %s", 'all_in_one_seo_pack' );
     
    5254                    'indexes'   => Array( 'name'      => __( 'Enable Sitemap Indexes', 'all_in_one_seo_pack' ) ),
    5355                    'paginate'  => Array( 'name'      => __( 'Paginate Sitemap Indexes', 'all_in_one_seo_pack' ),
    54                                           'condshow'  => Array( "aiosp_sitemap_indexes" => 'on' ) ),
     56                                          'condshow'  => Array( "indexes" => 'on' ) ),
    5557                    'max_posts' => Array( 'name'      => __( 'Maximum Posts Per Sitemap', 'all_in_one_seo_pack' ),
    5658                                          'type'      => 'text', 'default' => 50000,
    57                                           'condshow'  => Array( "aiosp_sitemap_indexes" => 'on', "aiosp_sitemap_paginate" => 'on' ) ),
     59                                          'condshow'  => Array( "paginate" => 'on' ) ),
    5860                    'posttypes' => Array( 'name'      => __( 'Post Types', 'all_in_one_seo_pack'),
    5961                                          'type'      => 'multicheckbox', 'default' => 'all' ),
     
    154156                foreach( $help_text as $k => $v )
    155157                    $this->default_options[$k]['help_text'] = $v;
    156 
    157             // load initial options / set defaults
    158             $this->update_options( );
    159            
    160             if ( !empty( $this->options['aiosp_sitemap_paginate'] ) ) {
    161                 $this->paginate = true;
    162                 if ( ( $this->options['aiosp_sitemap_max_posts'] ) && ( $this->options['aiosp_sitemap_max_posts'] > 0 ) && ( $this->options['aiosp_sitemap_max_posts'] < 50000 ) )
    163                     $this->max_posts = $this->options['aiosp_sitemap_max_posts'];
    164             }
    165 
    166             if ( is_multisite() ) $this->options['aiosp_sitemap_rewrite'] = 'On';
    167 
    168             if ( $this->options['aiosp_sitemap_rewrite'] ) $this->setup_rewrites();
    169            
    170             if ( $this->option_isset( 'robots' ) )
    171                 add_action( 'do_robots', Array( $this, 'do_robots' ), 100 );
    172            
     158                   
     159            add_action( 'init', Array( $this, 'load_sitemap_options' ) );
    173160            add_action( $this->prefix . 'settings_update',  Array( $this, 'do_sitemaps' ) );
    174161            add_filter( $this->prefix . 'display_settings', Array( $this, 'update_post_data' ) );
     
    178165        }
    179166       
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
    180185        /** Custom settings - displays boxes for add pages to sitemap option. **/
    181186        function display_custom_options( $buf, $args ) {
    182             if ( $args['name'] == 'aiosp_sitemap_addl_pages' ) {
    183                 $buf .= '<div id="aiosp_sitemap_addl_pages">';
     187            if ( $args['name'] == ) {
     188                $buf .= ;
    184189                if ( !empty( $args['value'] ) ) {
    185190                    $buf .= "<table class='aioseop_table' cellpadding=0 cellspacing=0>\n";
     
    200205            $buf .= '</div>';
    201206            return $buf;
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
    202234        }
    203235       
     
    279311                                                                'all_in_one_seo_pack' ), $privacy_link );
    280312            }
    281             if ( $this->option_isset( 'debug' ) ) $options['aiosp_sitemap_debug'] = '<pre>' . $options['aiosp_sitemap_debug'] . '</pre>';
     313            if ( $this->option_isset( 'debug' ) ) $options[] . '</pre>';
    282314            return $options;
    283315        }
     
    285317        /** Handle 'all' option for post types / taxonomies, further sanitization of filename, rewrites on for multisite, setting up addl pages option. **/
    286318        function filter_options( $options ) {
    287             if ( is_array( $options['aiosp_sitemap_posttypes'] ) && in_array( 'all', $options['aiosp_sitemap_posttypes'] ) && is_array( $this->default_options['posttypes' ]['initial_options'] ) )
    288                 $options['aiosp_sitemap_posttypes'] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
    289             if ( is_array( $options['aiosp_sitemap_taxonomies'] ) && in_array( 'all', $options['aiosp_sitemap_taxonomies'] ) && is_array( $this->default_options['taxonomies' ]['initial_options'] ) )
    290                 $options['aiosp_sitemap_taxonomies'] = array_keys( $this->default_options['taxonomies' ]['initial_options'] );
     319            if ( is_array( $options[] ) && is_array( $this->default_options['posttypes' ]['initial_options'] ) )
     320                $options[] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
     321            if ( is_array( $options[] ) && is_array( $this->default_options['taxonomies' ]['initial_options'] ) )
     322                $options[] = array_keys( $this->default_options['taxonomies' ]['initial_options'] );
    291323            $opt = $this->prefix . 'filename';
    292324            if ( isset( $options[$opt] ) && !empty( $options[$opt] ) )
     
    355387                            }
    356388                            if ( !$siteurl ) $siteurl = get_home_url( $blog_id );
    357                             $url = $siteurl . '/' . $sitemap_options["aiosp_sitemap_filename"] . '.xml';
    358                             if ( $sitemap_options['aiosp_sitemap_gzipped'] ) $url .= '.gz';
     389                            $url = $siteurl . '/' . $sitemap_options["filename"] . '.xml';
     390                            if ( $sitemap_options[] ) $url .= '.gz';
    359391                            $siteurls[] = $url;
    360392                        }
     
    369401            $files = Array();
    370402           
    371             if ( !empty( $this->options['aiosp_sitemap_filename'] ) ) {
    372                 $scan1 = get_home_path() . $this->options['aiosp_sitemap_filename'] . '*.xml';
    373                 if ( !empty( $this->options['aiosp_sitemap_gzipped'] ) )
    374                     $scan2 .= get_home_path() . $this->options['aiosp_sitemap_filename'] . '*.xml.gz';
     403            if ( !empty( $this->options[] ) ) {
     404                $scan1 = get_home_path() . $this->options[] . '*.xml';
     405                if ( !empty( $this->options[] ) )
     406                    $scan2 .= get_home_path() . $this->options[] . '*.xml.gz';
    375407               
    376408                if ( empty( $scan1 ) && empty( $scan2 ) ) return $files;
     
    394426        function do_sitemap_scan() {
    395427            $msg = '';
    396             if ( !empty(  $this->options['aiosp_sitemap_rewrite'] ) && ( get_option('permalink_structure') == '' ) ) {
     428            if ( !empty(  $this->options[] ) && ( get_option('permalink_structure') == '' ) ) {
    397429                $msg = '<p>' . __( 'Warning: dynamic sitemap generation must have permalinks enabled.', 'all_in_one_seo_pack' ) . '</p>';
    398430            }
     
    433465                $this->output_error( $msg );
    434466        }
    435        
     467
    436468        /** Do the scan, return the results. **/
    437469        function scan_sitemaps() {
     
    474506                        if ( preg_match( "/<!-- " . sprintf( $this->comment_string, '(.*)', '(.*)', '(.*)' ) .  " -->/",
    475507                                            $file, $matches ) ) {
    476                                 if ( !empty(  $this->options['aiosp_sitemap_rewrite'] ) ) {
     508                                if ( !empty(  $this->options[] ) ) {
    477509                                    $msg .= '<p>' . sprintf( __( "Warning: a static sitemap '%s' generated by All in One SEO Pack %s on %s already exists that may conflict with dynamic sitemap generation.", 'all_in_one_seo_pack' ),
    478510                                     $f, $matches[2], $matches[3] ) . "</p>\n";
     
    508540        /** Updates debug log messages. **/
    509541        function debug_message( $msg ) {
    510             if ( empty( $this->options["aiosp_sitemap_debug"] ) ) $this->options["aiosp_sitemap_debug"] = '';
    511             $this->options["aiosp_sitemap_debug"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["aiosp_sitemap_debug"];
    512             if ( $this->strlen( $this->options["aiosp_sitemap_debug"] ) > 2048 ) {
    513                 $end = $this->strrpos( $this->options["aiosp_sitemap_debug"], "\n" );
     542            if ( empty( $this->options["debug"] = '';
     543            $this->options["debug"];
     544            if ( $this->strlen( $this->options["debug"] ) > 2048 ) {
     545                $end = $this->strrpos( $this->options["debug"], "\n" );
    514546                if ( $end === false ) $end = 2048;
    515                 $this->options["aiosp_sitemap_debug"] = $this->substr( $this->options["aiosp_sitemap_debug"], 0, $end );
     547                $this->options["debug"], 0, $end );
    516548            }
    517549            $this->update_class_option( $this->options );
     
    523555            add_filter( 'query_vars', Array( $this, 'query_var_hook' ) );
    524556            add_action( 'parse_query', Array( $this, 'sitemap_output_hook') );
    525             if ( !get_transient( 'aiosp_sitemap_rules_flushed' ) )
     557            if ( !get_transient( ) )
    526558                add_action( 'wp_loaded', Array($this, 'flush_rules_hook' ) );
    527559        }
     
    531563            $sitemap_rules_normal = $sitemap_rules_gzipped = Array();
    532564            $sitemap_rules_normal = array(
    533                 $this->options["aiosp_sitemap_filename"] . '.xml'           => 'index.php?aioseop_sitemap_path=root',
    534                 $this->options["aiosp_sitemap_filename"] . '_(.+)_(\d+).xml'=> 'index.php?aioseop_sitemap_path=$matches[1]&aioseop_sitemap_page=$matches[2]',
    535                 $this->options["aiosp_sitemap_filename"] . '_(.+).xml'      => 'index.php?aioseop_sitemap_path=$matches[1]'
     565                $this->options[",
     566                $this->options["page=$matches[2]',
     567                $this->options["path=$matches[1]'
    536568            );
    537             if ( $this->options['aiosp_sitemap_gzipped'] ) {
     569            if ( $this->options[] ) {
    538570                $sitemap_rules_gzipped = array(
    539                     $this->options["aiosp_sitemap_filename"] . '.xml.gz'        => 'index.php?aiosp_sitemap_gzipped=1&aioseop_sitemap_path=root.gz',
    540                     $this->options["aiosp_sitemap_filename"] . '_(.+)_(\d+).xml.gz' => 'index.php?aioseop_sitemap_path=$matches[1].gz&aioseop_sitemap_page=$matches[2]',
    541                     $this->options["aiosp_sitemap_filename"] . '_(.+).xml.gz'   => 'index.php?aioseop_sitemap_path=$matches[1].gz'
     571                    $this->options[",
     572                    $this->options["page=$matches[2]',
     573                    $this->options["path=$matches[1].gz'
    542574                );
    543575            }
     
    563595                if ( !isset( $rules[ $rule ] ) || ( $rules[ $rule ] != $sitemap_rules[ $rule ] ) ) {
    564596                    $wp_rewrite->flush_rules();
    565                     set_transient( 'aiosp_sitemap_rules_flushed', true, 43200 );
     597                    set_transient( , true, 43200 );
    566598                }
    567599            }
     
    570602        /** Add our query variable for sitemap generation. **/
    571603        function query_var_hook($vars) {
    572             $vars[] = 'aioseop_sitemap_path';
     604            $vars[] = ;
    573605            if ( $this->paginate )
    574                 $vars[] = 'aioseop_sitemap_page';
     606                $vars[] = ;
    575607            return $vars;
    576608        }
     
    600632        function sitemap_output_hook($query) {
    601633            $page = 0;
    602             if ( ( $this->options['aiosp_sitemap_rewrite'] ) )
    603                 if( !empty( $query->query_vars['aioseop_sitemap_path'] ) ) {
    604                     if( !empty( $query->query_vars['aioseop_sitemap_page'] ) )
    605                         $page = $query->query_vars['aioseop_sitemap_page'] - 1;
     634            if ( ( $this->options[] ) )
     635                if( !empty( $query->query_vars[] ) ) {
     636                    if( !empty( $query->query_vars[] ) )
     637                        $page = $query->query_vars[] - 1;
    606638                    $this->start_memory_usage = memory_get_peak_usage();
    607                     $sitemap_type = $query->query_vars['aioseop_sitemap_path'];
     639                    $sitemap_type = $query->query_vars[];
    608640                    $gzipped = false;
    609641                    if ( $this->substr( $sitemap_type, -3 ) === '.gz' ) {
     
    612644                    }
    613645                    $blog_charset = get_option( 'blog_charset' );
    614                     if ( $this->options['aiosp_sitemap_gzipped'] && $gzipped ) {
     646                    if ( $this->options[] && $gzipped ) {
    615647                        header( "Content-Type: application/x-gzip; charset=$blog_charset", true);
    616648                    } else {
     
    630662            $this->add_post_types();
    631663            $comment = __( "dynamically", 'all_in_one_seo_pack' );
    632             if ( $this->options['aiosp_sitemap_indexes'] ) {
    633                 $posttypes = $this->options['aiosp_sitemap_posttypes'];
     664            if ( $this->options[] ) {
     665                $posttypes = $this->options[];
    634666                if ( empty( $posttypes ) ) $posttypes = Array();
    635                 $taxonomies = $this->options['aiosp_sitemap_taxonomies'];
     667                $taxonomies = $this->options[];
    636668                if ( empty( $taxonomies ) ) $taxonomies = Array();
    637669                if ( $sitemap_type === 'root' ) {
     
    646678                    $this->output_sitemap( $this->get_all_post_priority_data( $sitemap_type, 'publish', $page ), $comment );
    647679                } elseif ( in_array( $sitemap_type, $taxonomies ) ) {
    648                     $this->output_sitemap( $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args() ) ), $comment );
     680                    $this->output_sitemap( $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args() ) ), $comment );
    649681                }
    650682            } elseif ( $sitemap_type === 'root' ) echo $this->do_simple_sitemap( $comment );
     
    653685        /** Build a url to the sitemap. **/
    654686        function get_sitemap_url() {
    655             $url = get_home_url() . '/' . $this->options["aiosp_sitemap_filename"] . '.xml';
    656             if ( $this->options['aiosp_sitemap_gzipped'] ) $url .= '.gz';
     687            $url = get_home_url() . '/' . $this->options["filename"] . '.xml';
     688            if ( $this->options[] ) $url .= '.gz';
    657689            return $url;
    658690        }
     
    691723        /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/
    692724        function do_sitemaps() {
    693             if ( !empty( $this->options['aiosp_sitemap_paginate'] ) ) {
     725            if ( !empty( $this->options[] ) ) {
    694726                $this->paginate = true;
    695                 if ( ( $this->options['aiosp_sitemap_max_posts'] ) && ( $this->options['aiosp_sitemap_max_posts'] > 0 ) && ( $this->options['aiosp_sitemap_max_posts'] < 50000 ) )
    696                     $this->max_posts = $this->options['aiosp_sitemap_max_posts'];
     727                if ( ( $this->options[] < 50000 ) )
     728                    $this->max_posts = $this->options[];
    697729                else
    698730                    $this->max_posts = 50000;               
     
    701733                $this->max_posts = 50000;
    702734            }
    703             if ( !$this->options['aiosp_sitemap_rewrite'] ) {
    704                 if ( $this->options['aiosp_sitemap_indexes'] ) {
     735            if ( !$this->options[] ) {
     736                if ( $this->options[] ) {
    705737                    $this->do_indexed_sitemaps();
    706738                } else {
    707739                    $this->log_start();
    708                     $comment = sprintf( __( "file '%s' statically", 'all_in_one_seo_pack' ), $this->options['aiosp_sitemap_filename'] );
     740                    $comment = sprintf( __( "file '%s' statically", 'all_in_one_seo_pack' ), $this->options[] );
    709741                    $sitemap = $this->do_simple_sitemap( $comment );
    710                     $this->write_sitemaps( $this->options['aiosp_sitemap_filename'], $sitemap );
    711                     $this->log_stats( 'root', $this->options['aiosp_sitemap_gzipped'], false );
     742                    $this->write_sitemaps( $this->options[], $sitemap );
     743                    $this->log_stats( 'root', $this->options[], false );
    712744                }
    713745            } else {
    714                 delete_transient( 'aiosp_sitemap_rules_flushed' );
     746                delete_transient( );
    715747            }
    716748            $this->do_notify();
     
    728760        function write_sitemaps( $filename, $contents ) {
    729761            $this->write_sitemap( $filename . ".xml", $contents );
    730             if ( $this->options['aiosp_sitemap_gzipped'] ) $this->write_sitemap( $filename . ".xml.gz", $contents, true );         
     762            if ( $this->options[] ) $this->write_sitemap( $filename . ".xml.gz", $contents, true );         
    731763        }
    732764       
     
    778810            $files = Array();
    779811            $options = $this->options;
    780             $prefix = $options["aiosp_sitemap_filename"];
     812            $prefix = $options["filename"];
    781813            $suffix = '.xml';
    782             if ( $options['aiosp_sitemap_gzipped'] ) $suffix .= '.gz';
    783             if ( empty( $options['aiosp_sitemap_posttypes'] ) ) $options['aiosp_sitemap_posttypes'] = Array();
    784             if ( empty( $options['aiosp_sitemap_taxonomies'] ) ) $options['aiosp_sitemap_taxonomies'] = Array();
    785             $options['aiosp_sitemap_posttypes'] = array_diff( $options['aiosp_sitemap_posttypes'], Array( 'all' ) );
    786             $options['aiosp_sitemap_taxonomies'] = array_diff( $options['aiosp_sitemap_taxonomies'], Array( 'all' ) );
     814            if ( $options[] ) $suffix .= '.gz';
     815            if ( empty( $options[] = Array();
     816            if ( empty( $options[] = Array();
     817            $options[], Array( 'all' ) );
     818            $options[], Array( 'all' ) );
    787819            $url_base = trailingslashit( get_home_url() );
    788820            $files[] = Array( 'loc' => $url_base . $prefix . '_addl' . $suffix );
    789             if ( !empty( $options['aiosp_sitemap_posttypes'] ) ) {
     821            if ( !empty( $options[] ) ) {
    790822                $prio = $this->get_default_priority( 'post' );
    791823                $freq = $this->get_default_frequency( 'post' );
    792                 if ( $this->paginate ) {
    793                     $post_counts = $this->get_all_post_counts( Array('post_type' => $options['aiosp_sitemap_posttypes'], 'post_status' => 'publish') );
    794                 }
    795                 foreach( $options['aiosp_sitemap_posttypes'] as $sm ) {
     824                $post_counts = $this->get_all_post_counts( Array('post_type' => $options["{$this->prefix}posttypes"], 'post_status' => 'publish') );
     825                foreach( $options["{$this->prefix}posttypes"] as $sm ) {
    796826                    if ( $post_counts[$sm] == 0 ) continue;
    797827                    if ( $this->paginate ) {
     
    805835                        $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $prio, 'changefreq' => $freq );                 
    806836                }
    807                
    808837            }
    809838            if ( $this->option_isset( 'archive' ) )
     
    811840            if ( $this->option_isset( 'author' ) )
    812841                $files[] = Array( 'loc' => $url_base . $prefix . '_author' . $suffix, 'priority' => $this->get_default_priority( 'author' ), 'changefreq' => $this->get_default_frequency( 'author' )  );
    813             if ( !empty( $options['aiosp_sitemap_taxonomies'] ) )
    814                 foreach( $options['aiosp_sitemap_taxonomies'] as $sm )
    815                     $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' )  );
     842               
     843            if ( !empty( $options["{$this->prefix}taxonomies"] ) )
     844                foreach( $options["{$this->prefix}taxonomies"] as $sm ) {
     845                    $term_count = wp_count_terms( $sm, array('hide_empty' => true) );
     846                    if ( !is_wp_error( $term_count ) && ( $term_count > 0 ) ) {
     847                        if ( $this->paginate ) {
     848                            if ( $term_count > $this->max_posts ) {
     849                                $count = 1;
     850                                for( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) {
     851                                    $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . '_' . ( $count++ ) . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' ) );
     852                                }
     853                            } else $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' ) );
     854                        } else
     855                            $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $this->get_default_priority( 'taxonomies' ), 'changefreq' => $this->get_default_frequency( 'taxonomies' )  );                       
     856                    }
     857                }
    816858            foreach( $this->get_child_sitemap_urls() as $csm )
    817859                $files[] = Array( 'loc' => $csm, 'priority' => $this->get_default_priority( 'sitemap' ), 'changefreq' => $this->get_default_frequency( 'sitemap' ) );
     
    824866            $options = $this->options;
    825867            $comment = __( "file '%s' statically", 'all_in_one_seo_pack' );
    826             $this->write_sitemaps(  $options['aiosp_sitemap_filename'],
    827                                     $this->build_sitemap_index( $this->get_sitemap_index_filenames() ), sprintf( $comment, $options['aiosp_sitemap_filename'] ) );
    828             $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_addl",
    829                                     $this->build_sitemap( $this->get_addl_pages(), sprintf( $comment, $options['aiosp_sitemap_filename'] . "_addl" ) ) );
    830             if ( ( !isset( $options['aiosp_sitemap_posttypes'] ) ) || ( !is_array( $options['aiosp_sitemap_posttypes'] ) ) ) $options['aiosp_sitemap_posttypes'] = Array();
    831             if ( ( !isset( $options['aiosp_sitemap_taxonomies'] ) ) || ( !is_array( $options['aiosp_sitemap_taxonomies'] ) ) ) $options['aiosp_sitemap_taxonomies'] = Array();
    832             $options['aiosp_sitemap_posttypes'] = array_diff( $options['aiosp_sitemap_posttypes'], Array( 'all' ) );
    833             $options['aiosp_sitemap_taxonomies'] = array_diff( $options['aiosp_sitemap_taxonomies'], Array( 'all' ) );
    834            
    835             if ( !empty( $options['aiosp_sitemap_posttypes'] ) ) {
    836                 if ( $this->paginate )
    837                     $post_counts = $this->get_all_post_counts( Array('post_type' => $options['aiosp_sitemap_posttypes'], 'post_status' => 'publish') );
    838                 foreach ( $options['aiosp_sitemap_posttypes'] as $posttype ) {
     868            $this->write_sitemaps(  $options[],
     869                                    $this->build_sitemap_index( $this->get_sitemap_index_filenames() ), sprintf( $comment, $options[] ) );
     870            $this->write_sitemaps(  $options[] . "_addl",
     871                                    $this->build_sitemap( $this->get_addl_pages(), sprintf( $comment, $options[] . "_addl" ) ) );
     872            if ( ( !isset( $options[] = Array();
     873            if ( ( !isset( $options[] = Array();
     874            $options[], Array( 'all' ) );
     875            $options[], Array( 'all' ) );
     876           
     877            if ( !empty( $options[] ) ) {
     878               
     879               
     880               
    839881                    if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) {
    840882                            $count = 1;
    841883                            for( $post_count = 0; $post_count < $post_counts[$posttype]; $post_count += $this->max_posts ) {
    842                                 $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_{$posttype}_{$count}" );
    843                                 $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_{$posttype}_{$count}",
     884                                $comment = sprintf( $comment, $options[] . "_{$posttype}_{$count}" );
     885                                $this->write_sitemaps(  $options[] . "_{$posttype}_{$count}",
    844886                                                        $this->build_sitemap( $this->get_all_post_priority_data( $posttype, 'publish', ( $count - 1 ) ), $comment ) );
    845887                                $count++;
    846888                            }
    847889                    } else {
    848                         $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_$posttype" );
    849                         $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_$posttype",
     890                        $comment = sprintf( $comment, $options[] . "_$posttype" );
     891                        $this->write_sitemaps(  $options[] . "_$posttype",
    850892                                                $this->build_sitemap( $this->get_all_post_priority_data( $posttype ), $comment ) );
    851893                    }
     
    854896           
    855897            if ( $this->option_isset( 'archive') ) {
    856                 $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_archive" );
    857                 $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_archive",
     898                $comment = sprintf( $comment, $options[] . "_archive" );
     899                $this->write_sitemaps(  $options[] . "_archive",
    858900                                        $this->build_sitemap( $this->get_archive_prio_data(), $comment ) );
    859901            }
    860902            if ( $this->option_isset( 'author') ) {
    861                 $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_author" );
    862                 $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_author",
     903                $comment = sprintf( $comment, $options[] . "_author" );
     904                $this->write_sitemaps(  $options[] . "_author",
    863905                                        $this->build_sitemap( $this->get_author_prio_data(), $comment ) );
    864906            }
    865             if ( !empty( $options['aiosp_sitemap_taxonomies'] ) )
    866                 foreach ( $options['aiosp_sitemap_taxonomies']  as $taxonomy ) {
    867                     $comment = sprintf( $comment, $options['aiosp_sitemap_filename'] . "_$taxonomy" );
    868                     $this->write_sitemaps(  $options['aiosp_sitemap_filename'] . "_$taxonomy",
    869                                         $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args() ), $comment ) ) );
    870                 }
    871             $this->log_stats( 'indexed', $options['aiosp_sitemap_gzipped'], false );
     907            if ( !empty( $options["{$this->prefix}taxonomies"] ) )
     908                foreach ( $options["{$this->prefix}taxonomies"]  as $taxonomy ) {
     909
     910                }
     911
     912            if ( !empty( $options["{$this->prefix}taxonomies"] ) )
     913                foreach( $options["{$this->prefix}taxonomies"] as $taxonomy ) {
     914                    $term_count = wp_count_terms( $taxonomy, array('hide_empty' => true) );
     915                    if ( !is_wp_error( $term_count ) && ( $term_count > 0 ) ) {
     916                        if ( $this->paginate ) {
     917                            if ( $term_count > $this->max_posts ) {
     918                                $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 ) ) );
     923                                    $count++;
     924                                }
     925                            } 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 ) ) );
     929                            }
     930                        } 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 ) ) );                         
     934                        }
     935                    }
     936                }
     937           
     938            $this->log_stats( 'indexed', $options["{$this->prefix}gzipped"], false );
    872939        }
    873940
     
    880947                    );
    881948            $posts = get_option( 'page_for_posts' );
     949
    882950            if ( $posts ) {
    883951                $posts = $this->get_permalink( $posts );
     
    893961            $child = $this->get_child_sitemap_urls();
    894962            $options = $this->options;
    895             if ( is_array( $options['aiosp_sitemap_posttypes'] ) )
    896                 $options['aiosp_sitemap_posttypes'] = array_diff( $options['aiosp_sitemap_posttypes'], Array( 'all' ) );
    897             if ( is_array( $options['aiosp_sitemap_taxonomies'] ) )
    898                 $options['aiosp_sitemap_taxonomies'] = array_diff( $options['aiosp_sitemap_taxonomies'], Array( 'all' ) );
    899             $prio = $this->get_all_post_priority_data( $options['aiosp_sitemap_posttypes'] );
     963            if ( is_array( $options[] ) )
     964                $options[], Array( 'all' ) );
     965            if ( is_array( $options[] ) )
     966                $options[], Array( 'all' ) );
     967            $prio = $this->get_all_post_priority_data( $options[] );
    900968            if ( $this->option_isset( 'archive' ) ) $prio = array_merge( $prio, $this->get_archive_prio_data() );
    901969            if ( $this->option_isset( 'author' ) ) $prio = array_merge( $prio, $this->get_author_prio_data() );
     
    916984            if ( is_array( $posts ) ) array_unshift( $prio, $posts );
    917985            if ( is_array( $home ) )  array_unshift( $prio, $home );               
    918             $terms = get_terms( $options['aiosp_sitemap_taxonomies'], $this->get_tax_args() );
     986            $terms = get_terms( $options[], $this->get_tax_args() );
    919987            $prio2 = $this->get_term_priority_data( $terms );
    920988            $prio3 = $this->get_addl_pages_only();
     
    9371005                $plugin_path = $this->unparse_url( $plugin_url );
    9381006            }
    939             echo '<?xml-stylesheet type="text/xsl" href="' . $plugin_path . 'sitemap.xsl"?>' . "\r\n";
    940             echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\r\n";
     1007            $xml_header = '<?xml-stylesheet type="text/xsl" href="' . $plugin_path . 'sitemap.xsl"?>' . "\r\n"
     1008                        . '<urlset ';
     1009            $namespaces = apply_filters( $this->prefix . 'xml_namespace', Array( 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9' ) );
     1010            if ( !empty( $namespaces ) ) {
     1011                $ns = Array();
     1012                foreach( $namespaces as $k => $v ) {
     1013                    $ns[] = esc_attr( $k ) . '=' . '"' . esc_url( $v ) . '"';
     1014                }
     1015                $xml_header .= join( "\r\n\t", $ns );
     1016            }
     1017            $xml_header .= '>' . "\r\n";
     1018            echo $xml_header;
    9411019            $count = 0;
    9421020            foreach ( $urls as $url ) {
     
    9461024                        if ( !empty( $v ) ) {
    9471025                            if ( $k == 'loc' ) $v = esc_url( $v );
    948                             echo "\t\t<$k>$v</$k>\r\n";
     1026                                if ( is_array( $v ) ) {
     1027                                    $buf = "\t\t\t<$k>\r\n";
     1028                                    foreach( $v as $ext => $attr ) {
     1029                                        if ( is_array( $attr ) ) {
     1030                                            $buf = '';
     1031                                            echo "\t\t<$k>\r\n";
     1032                                            foreach( $attr as $a => $nested ) {
     1033                                                if ( is_array( $nested ) ) {
     1034                                                    echo "\t\t\t<$a>\r\n";
     1035                                                    foreach( $nested as $next => $nattr ) {
     1036                                                        echo "\t\t\t\t<$next>$nattr</$next>\r\n";
     1037                                                    }
     1038                                                    echo "\t\t\t</$a>\r\n";
     1039                                                } else echo "\t\t\t<$a>$nested</$a>\r\n";
     1040                                            }
     1041                                            echo "\t\t</$k>\r\n";
     1042                                        } else $buf .= "\t\t\t<$ext>$attr</$ext>\r\n";
     1043                                    }
     1044                                    if ( !empty( $buf ) ) echo $buf . "\t\t</$k>\r\n";
     1045                                } else echo "\t\t<$k>$v</$k>\r\n";
    9491046                        }
    9501047                    }
     
    9531050                }
    9541051                echo "\t</url>\r\n";
    955                 $count++;
    9561052                if ( $count >= $max_items ) break;
    9571053            }
     
    10851181            return "$scheme$user$pass$host$port$path$query$fragment";
    10861182        }
    1087 
     1183       
    10881184        /** Return data for user entered additional pages. **/
    10891185        function get_addl_pages_only() {
     
    11051201                }
    11061202            }
     1203
    11071204            return $pages;
    11081205        }
     
    11331230            if ( !empty( $posts ) )
    11341231                $pages[] = $posts;
     1232
    11351233            return $pages;
    11361234        }
     
    12621360        function get_prio_from_posts( $posts, $prio_override = false, $freq_override = false, $linkfunc = 'get_permalink' ) {
    12631361            $prio = Array();
     1362
    12641363            if ( ( $prio_override ) && ( $freq_override ) )
    12651364                $stats = 0;
     
    12961395                        $pr_info[ 'changefreq' ] = $freq_override;
    12971396                    $pr_info['loc'] = $url;
    1298                     $prio[] = $pr_info;
     1397                    $pr_info = apply_filters( $this->prefix . 'prio_item_filter', $pr_info, $post, $args );
     1398                    if ( !empty( $pr_info ) )
     1399                        $prio[] = $pr_info;
    12991400                }
    13001401            }
     
    13031404
    13041405        /** Return excluded categories for taxonomy queries. **/
    1305         function get_tax_args() {
     1406        function get_tax_args() {
    13061407            $args = Array();
    13071408            if ( $this->option_isset( 'excl_categories' ) )
    13081409                $args['exclude'] = $this->options[ $this->prefix . 'excl_categories'];
     1410
     1411
     1412
     1413
     1414
    13091415            return $args;
    13101416        }
     
    14121518        }
    14131519       
     1520
     1521
     1522
     1523
     1524
     1525
     1526
     1527
     1528
     1529
     1530
     1531
     1532
     1533
     1534
     1535
     1536
    14141537        /** Return post counts using wp_count_posts(). **/
    14151538        function get_all_post_counts( $args ) {
    1416             $post_counts = Array();
     1539            $post_counts = ;
    14171540            $status = 'inherit';
    14181541            if ( !empty( $args['post_status'] ) ) $status = $args['post_status'];
     
    14221545                        $args['post_type'] = array_shift( $args['post_type'] );
    14231546                    $count = (Array)wp_count_posts( $args['post_type'] );
    1424                     $post_counts[$args['post_type']] = $count[$status];
     1547                    $post_counts = $count[$status];
    14251548                } else
    14261549                    foreach( $args['post_type'] as $post_type ) {
     1550
    14271551                        $count = (Array)wp_count_posts( $post_type );
    1428                         if ( $post_type == 'attachment' )
    1429                             $post_counts[$post_type] = $count['inherit'];
    1430                         else
    1431                             $post_counts[$post_type] = $count[$status];
    1432                     }
     1552                        if ( empty( $count ) )
     1553                            $post_counts[$post_type] = 0;
     1554                        else {
     1555                            if ( $post_type == 'attachment' )
     1556                                $post_counts[$post_type] = $count['inherit'];
     1557                            else
     1558                                $post_counts[$post_type] = $count[$status];
     1559                        }
     1560                    }
     1561            $post_counts = apply_filters( $this->prefix . 'post_counts', $post_counts, $args );
    14331562            return $post_counts;
     1563
     1564
     1565
     1566
     1567
     1568
     1569
     1570
     1571
     1572
     1573
     1574
    14341575        }
    14351576
     
    14691610            if ( version_compare( $wp_version, '3.5', '>=' ) ) {
    14701611                $args['meta_query'] = Array(
    1471                     Array( 'key' => '_aioseop_sitemap_exclude', 'value' => 'null', 'compare' => 'NOT EXISTS' )
     1612                    Array( 'key' => '_aioseop_sitemap_exclude', 'value' => '', 'compare' => 'NOT EXISTS' )
    14721613                );
    14731614            } else {
     
    14781619                $ex_args['meta_compare'] = '=';
    14791620                $ex_args['fields'] = 'ids';
    1480                 $ex_args['posts_per_page'] = -1;
    14811621                $q = new WP_Query( $ex_args );
    14821622                if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] );
    14831623                if ( !empty( $q->posts ) ) $args['exclude'] = array_merge( $args['exclude'], $q->posts );
    1484             //}
     1624            // }
     1625           
    14851626            $posts = get_posts( apply_filters( $this->prefix . 'post_query', $args ) );
    14861627            if ( !empty( $exclude_slugs ) ) {
     
    14951636    }
    14961637}
     1638
  • all-in-one-seo-pack/trunk/all_in_one_seo_pack.php

    r861972 r895274  
    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.4
     6Version: 2.1.
    77Author: Michael Torbert
    88Author URI: http://michaeltorbert.com
     
    3131/**
    3232 * @package All-in-One-SEO-Pack
    33  * @version 2.1.4
     33 * @version 2.1.
    3434 */
    3535
    3636if ( ! defined( 'AIOSEOP_VERSION' ) )
    37     define( 'AIOSEOP_VERSION', '2.1.4' );
     37    define( 'AIOSEOP_VERSION', '2.1.' );
    3838
    3939if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
     
    117117
    118118$aiosp_activation = false;
    119 $aioseop_module_list = Array( 'sitemap', 'opengraph', 'performance' ); // list all available modules here
     119$aioseop_module_list = Array( 'sitemap', 'opengraph', 'performance' ); // list all available modules here
    120120
    121121if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
  • all-in-one-seo-pack/trunk/readme.txt

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