Changeset 895274
- Timestamp:
- 04/16/2014 10:40:07 PM (10 years ago)
- 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 51 51 global $aioseop_options; 52 52 $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'] ) 54 55 $this->do_log = true; 55 56 else … … 173 174 "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' ), 174 175 "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' ), 176 177 "ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ), 177 178 "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' ), … … 399 400 'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ), 400 401 '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' => '' ) ) ), 403 403 "ga_exclude_users"=> Array( 404 404 'name' => __( 'Exclude Users From Tracking:', 'all_in_one_seo_pack' ), … … 1338 1338 $googleplus = $aioseop_options['aiosp_google_publisher']; 1339 1339 1340 1341 if ( $is_front_page) {1340 $page = $this->get_page_number(); 1341 if ( ) { 1342 1342 if ( !empty( $aioseop_options['aiosp_google_publisher'] ) ) 1343 1343 $publisher = $aioseop_options['aiosp_google_publisher']; … … 1364 1364 if ( !empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) { 1365 1365 if ( $is_front_page && !in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) { 1366 unset( $author );1366 ; 1367 1367 } else { 1368 1368 if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) { 1369 1369 if ( is_singular() && !is_singular( $aioseop_options['aiosp_google_author_location'] ) ) 1370 unset( $author );1370 ; 1371 1371 } else { 1372 1372 if ( !is_singular( $aioseop_options['aiosp_google_author_location'] ) ) 1373 unset( $author );1373 ; 1374 1374 } 1375 1375 } … … 1395 1395 global $wp_query; 1396 1396 $max_page = $wp_query->max_num_pages; 1397 $page = $this->get_page_number();1398 1397 if ( $page > 1 ) 1399 1398 $prev = get_previous_posts_page_link(); … … 1708 1707 $allow_linker = "'allowLinker': true"; 1709 1708 } 1709 1710 1711 1712 1710 1713 $js_options = Array(); 1711 1714 foreach( Array( 'cookie_domain', 'allow_linker' ) as $opts ) { … … 1725 1728 1726 1729 ga('create', '{$analytics_id}'{$js_options}); 1730 1727 1731 ga('send', 'pageview'); 1728 1732 </script> … … 1899 1903 $link = get_term_link( $term, $taxonomy ); 1900 1904 } 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 ); 1902 1908 } else { 1903 1909 return false; -
all-in-one-seo-pack/tags/2.1.5/aioseop_feature_manager.php
r861970 r895274 24 24 'description' => __( 'Optimize performance related to SEO and check your system status.', 'all_in_one_seo_pack' ), 25 25 'default' => 'on' ), 26 27 26 28 'coming_soon' => Array( 'name' => __( 'Coming Soon...', 'all_in_one_seo_pack' ), 27 29 'description' => __( 'File Editor', 'all_in_one_seo_pack' ), -
all-in-one-seo-pack/tags/2.1.5/aioseop_functions.php
r861972 r895274 610 610 } 611 611 } 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 361 361 background-image: url(images/SocialMeta-Color-Standard.png); 362 362 } 363 364 365 366 367 368 363 369 div.aioseop_feature#aioseop_performance .aioseop_featured_image { 364 370 background-image: url(images/Performance-BW-Standard.png); … … 638 644 vertical-align: text-bottom; 639 645 margin: 15px 0 0 0; 646 647 648 640 649 } 641 650 #aiosp { -
all-in-one-seo-pack/tags/2.1.5/aioseop_opengraph.php
r861972 r895274 79 79 "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' ), 80 80 "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 81 82 "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' ), 82 83 "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' ), 83 84 "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 84 86 "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' ), 85 87 "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' ), … … 104 106 'description' => Array( 'name' => __( 'Home Description', 'all_in_one_seo_pack'), 105 107 'default' => '', 'type' => 'textarea', 'condshow' => Array( 'aiosp_opengraph_setmeta' => Array( 'lhs' => "aiosp_opengraph_setmeta", 'op' => '!=', 'rhs' => 'on' ) ) ), 108 109 106 110 'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ), 107 111 'disable_jetpack' => Array( 'name' => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ), 108 112 '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 109 114 'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ), 110 115 'meta_key' => Array( 'name' => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ), … … 145 150 $this->locations = array( 146 151 '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') ), 148 153 'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'), 149 154 'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings', … … 315 320 $description = $this->options['aiosp_opengraph_description']; 316 321 $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']; 318 326 319 327 /* If Use AIOSEO Title and Desc Selected */ … … 398 406 } 399 407 } 408 409 410 400 411 401 412 $width = $height = ''; -
all-in-one-seo-pack/tags/2.1.5/aioseop_sitemap.php
r861970 r895274 16 16 17 17 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 } 21 23 parent::__construct(); 22 24 $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' ); … … 52 54 'indexes' => Array( 'name' => __( 'Enable Sitemap Indexes', 'all_in_one_seo_pack' ) ), 53 55 'paginate' => Array( 'name' => __( 'Paginate Sitemap Indexes', 'all_in_one_seo_pack' ), 54 'condshow' => Array( " aiosp_sitemap_indexes" => 'on' ) ),56 'condshow' => Array( "indexes" => 'on' ) ), 55 57 'max_posts' => Array( 'name' => __( 'Maximum Posts Per Sitemap', 'all_in_one_seo_pack' ), 56 58 'type' => 'text', 'default' => 50000, 57 'condshow' => Array( " aiosp_sitemap_indexes" => 'on', "aiosp_sitemap_paginate" => 'on' ) ),59 'condshow' => Array( "paginate" => 'on' ) ), 58 60 'posttypes' => Array( 'name' => __( 'Post Types', 'all_in_one_seo_pack'), 59 61 'type' => 'multicheckbox', 'default' => 'all' ), … … 154 156 foreach( $help_text as $k => $v ) 155 157 $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' ) ); 173 160 add_action( $this->prefix . 'settings_update', Array( $this, 'do_sitemaps' ) ); 174 161 add_filter( $this->prefix . 'display_settings', Array( $this, 'update_post_data' ) ); … … 178 165 } 179 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 180 185 /** Custom settings - displays boxes for add pages to sitemap option. **/ 181 186 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 .= ; 184 189 if ( !empty( $args['value'] ) ) { 185 190 $buf .= "<table class='aioseop_table' cellpadding=0 cellspacing=0>\n"; … … 200 205 $buf .= '</div>'; 201 206 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 202 234 } 203 235 … … 279 311 'all_in_one_seo_pack' ), $privacy_link ); 280 312 } 281 if ( $this->option_isset( 'debug' ) ) $options[ 'aiosp_sitemap_debug'] = '<pre>' . $options['aiosp_sitemap_debug'] . '</pre>';313 if ( $this->option_isset( 'debug' ) ) $options[] . '</pre>'; 282 314 return $options; 283 315 } … … 285 317 /** Handle 'all' option for post types / taxonomies, further sanitization of filename, rewrites on for multisite, setting up addl pages option. **/ 286 318 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'] ); 291 323 $opt = $this->prefix . 'filename'; 292 324 if ( isset( $options[$opt] ) && !empty( $options[$opt] ) ) … … 355 387 } 356 388 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'; 359 391 $siteurls[] = $url; 360 392 } … … 369 401 $files = Array(); 370 402 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'; 375 407 376 408 if ( empty( $scan1 ) && empty( $scan2 ) ) return $files; … … 394 426 function do_sitemap_scan() { 395 427 $msg = ''; 396 if ( !empty( $this->options[ 'aiosp_sitemap_rewrite'] ) && ( get_option('permalink_structure') == '' ) ) {428 if ( !empty( $this->options[] ) && ( get_option('permalink_structure') == '' ) ) { 397 429 $msg = '<p>' . __( 'Warning: dynamic sitemap generation must have permalinks enabled.', 'all_in_one_seo_pack' ) . '</p>'; 398 430 } … … 433 465 $this->output_error( $msg ); 434 466 } 435 467 436 468 /** Do the scan, return the results. **/ 437 469 function scan_sitemaps() { … … 474 506 if ( preg_match( "/<!-- " . sprintf( $this->comment_string, '(.*)', '(.*)', '(.*)' ) . " -->/", 475 507 $file, $matches ) ) { 476 if ( !empty( $this->options[ 'aiosp_sitemap_rewrite'] ) ) {508 if ( !empty( $this->options[] ) ) { 477 509 $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' ), 478 510 $f, $matches[2], $matches[3] ) . "</p>\n"; … … 508 540 /** Updates debug log messages. **/ 509 541 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" ); 514 546 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 ); 516 548 } 517 549 $this->update_class_option( $this->options ); … … 523 555 add_filter( 'query_vars', Array( $this, 'query_var_hook' ) ); 524 556 add_action( 'parse_query', Array( $this, 'sitemap_output_hook') ); 525 if ( !get_transient( 'aiosp_sitemap_rules_flushed') )557 if ( !get_transient( ) ) 526 558 add_action( 'wp_loaded', Array($this, 'flush_rules_hook' ) ); 527 559 } … … 531 563 $sitemap_rules_normal = $sitemap_rules_gzipped = Array(); 532 564 $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]' 536 568 ); 537 if ( $this->options[ 'aiosp_sitemap_gzipped'] ) {569 if ( $this->options[] ) { 538 570 $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' 542 574 ); 543 575 } … … 563 595 if ( !isset( $rules[ $rule ] ) || ( $rules[ $rule ] != $sitemap_rules[ $rule ] ) ) { 564 596 $wp_rewrite->flush_rules(); 565 set_transient( 'aiosp_sitemap_rules_flushed', true, 43200 );597 set_transient( , true, 43200 ); 566 598 } 567 599 } … … 570 602 /** Add our query variable for sitemap generation. **/ 571 603 function query_var_hook($vars) { 572 $vars[] = 'aioseop_sitemap_path';604 $vars[] = ; 573 605 if ( $this->paginate ) 574 $vars[] = 'aioseop_sitemap_page';606 $vars[] = ; 575 607 return $vars; 576 608 } … … 600 632 function sitemap_output_hook($query) { 601 633 $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; 606 638 $this->start_memory_usage = memory_get_peak_usage(); 607 $sitemap_type = $query->query_vars[ 'aioseop_sitemap_path'];639 $sitemap_type = $query->query_vars[]; 608 640 $gzipped = false; 609 641 if ( $this->substr( $sitemap_type, -3 ) === '.gz' ) { … … 612 644 } 613 645 $blog_charset = get_option( 'blog_charset' ); 614 if ( $this->options[ 'aiosp_sitemap_gzipped'] && $gzipped ) {646 if ( $this->options[] && $gzipped ) { 615 647 header( "Content-Type: application/x-gzip; charset=$blog_charset", true); 616 648 } else { … … 630 662 $this->add_post_types(); 631 663 $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[]; 634 666 if ( empty( $posttypes ) ) $posttypes = Array(); 635 $taxonomies = $this->options[ 'aiosp_sitemap_taxonomies'];667 $taxonomies = $this->options[]; 636 668 if ( empty( $taxonomies ) ) $taxonomies = Array(); 637 669 if ( $sitemap_type === 'root' ) { … … 646 678 $this->output_sitemap( $this->get_all_post_priority_data( $sitemap_type, 'publish', $page ), $comment ); 647 679 } 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 ); 649 681 } 650 682 } elseif ( $sitemap_type === 'root' ) echo $this->do_simple_sitemap( $comment ); … … 653 685 /** Build a url to the sitemap. **/ 654 686 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'; 657 689 return $url; 658 690 } … … 691 723 /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/ 692 724 function do_sitemaps() { 693 if ( !empty( $this->options[ 'aiosp_sitemap_paginate'] ) ) {725 if ( !empty( $this->options[] ) ) { 694 726 $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[]; 697 729 else 698 730 $this->max_posts = 50000; … … 701 733 $this->max_posts = 50000; 702 734 } 703 if ( !$this->options[ 'aiosp_sitemap_rewrite'] ) {704 if ( $this->options[ 'aiosp_sitemap_indexes'] ) {735 if ( !$this->options[] ) { 736 if ( $this->options[] ) { 705 737 $this->do_indexed_sitemaps(); 706 738 } else { 707 739 $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[] ); 709 741 $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 ); 712 744 } 713 745 } else { 714 delete_transient( 'aiosp_sitemap_rules_flushed');746 delete_transient( ); 715 747 } 716 748 $this->do_notify(); … … 728 760 function write_sitemaps( $filename, $contents ) { 729 761 $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 ); 731 763 } 732 764 … … 778 810 $files = Array(); 779 811 $options = $this->options; 780 $prefix = $options[" aiosp_sitemap_filename"];812 $prefix = $options["filename"]; 781 813 $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' ) ); 787 819 $url_base = trailingslashit( get_home_url() ); 788 820 $files[] = Array( 'loc' => $url_base . $prefix . '_addl' . $suffix ); 789 if ( !empty( $options[ 'aiosp_sitemap_posttypes'] ) ) {821 if ( !empty( $options[] ) ) { 790 822 $prio = $this->get_default_priority( 'post' ); 791 823 $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 ) { 796 826 if ( $post_counts[$sm] == 0 ) continue; 797 827 if ( $this->paginate ) { … … 805 835 $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $prio, 'changefreq' => $freq ); 806 836 } 807 808 837 } 809 838 if ( $this->option_isset( 'archive' ) ) … … 811 840 if ( $this->option_isset( 'author' ) ) 812 841 $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 } 816 858 foreach( $this->get_child_sitemap_urls() as $csm ) 817 859 $files[] = Array( 'loc' => $csm, 'priority' => $this->get_default_priority( 'sitemap' ), 'changefreq' => $this->get_default_frequency( 'sitemap' ) ); … … 824 866 $options = $this->options; 825 867 $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 839 881 if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) { 840 882 $count = 1; 841 883 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}", 844 886 $this->build_sitemap( $this->get_all_post_priority_data( $posttype, 'publish', ( $count - 1 ) ), $comment ) ); 845 887 $count++; 846 888 } 847 889 } 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", 850 892 $this->build_sitemap( $this->get_all_post_priority_data( $posttype ), $comment ) ); 851 893 } … … 854 896 855 897 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", 858 900 $this->build_sitemap( $this->get_archive_prio_data(), $comment ) ); 859 901 } 860 902 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", 863 905 $this->build_sitemap( $this->get_author_prio_data(), $comment ) ); 864 906 } 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 ); 872 939 } 873 940 … … 880 947 ); 881 948 $posts = get_option( 'page_for_posts' ); 949 882 950 if ( $posts ) { 883 951 $posts = $this->get_permalink( $posts ); … … 893 961 $child = $this->get_child_sitemap_urls(); 894 962 $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[] ); 900 968 if ( $this->option_isset( 'archive' ) ) $prio = array_merge( $prio, $this->get_archive_prio_data() ); 901 969 if ( $this->option_isset( 'author' ) ) $prio = array_merge( $prio, $this->get_author_prio_data() ); … … 916 984 if ( is_array( $posts ) ) array_unshift( $prio, $posts ); 917 985 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() ); 919 987 $prio2 = $this->get_term_priority_data( $terms ); 920 988 $prio3 = $this->get_addl_pages_only(); … … 937 1005 $plugin_path = $this->unparse_url( $plugin_url ); 938 1006 } 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; 941 1019 $count = 0; 942 1020 foreach ( $urls as $url ) { … … 946 1024 if ( !empty( $v ) ) { 947 1025 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"; 949 1046 } 950 1047 } … … 953 1050 } 954 1051 echo "\t</url>\r\n"; 955 $count++;956 1052 if ( $count >= $max_items ) break; 957 1053 } … … 1085 1181 return "$scheme$user$pass$host$port$path$query$fragment"; 1086 1182 } 1087 1183 1088 1184 /** Return data for user entered additional pages. **/ 1089 1185 function get_addl_pages_only() { … … 1105 1201 } 1106 1202 } 1203 1107 1204 return $pages; 1108 1205 } … … 1133 1230 if ( !empty( $posts ) ) 1134 1231 $pages[] = $posts; 1232 1135 1233 return $pages; 1136 1234 } … … 1262 1360 function get_prio_from_posts( $posts, $prio_override = false, $freq_override = false, $linkfunc = 'get_permalink' ) { 1263 1361 $prio = Array(); 1362 1264 1363 if ( ( $prio_override ) && ( $freq_override ) ) 1265 1364 $stats = 0; … … 1296 1395 $pr_info[ 'changefreq' ] = $freq_override; 1297 1396 $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; 1299 1400 } 1300 1401 } … … 1303 1404 1304 1405 /** Return excluded categories for taxonomy queries. **/ 1305 function get_tax_args( ) {1406 function get_tax_args() { 1306 1407 $args = Array(); 1307 1408 if ( $this->option_isset( 'excl_categories' ) ) 1308 1409 $args['exclude'] = $this->options[ $this->prefix . 'excl_categories']; 1410 1411 1412 1413 1414 1309 1415 return $args; 1310 1416 } … … 1412 1518 } 1413 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1414 1537 /** Return post counts using wp_count_posts(). **/ 1415 1538 function get_all_post_counts( $args ) { 1416 $post_counts = Array();1539 $post_counts = ; 1417 1540 $status = 'inherit'; 1418 1541 if ( !empty( $args['post_status'] ) ) $status = $args['post_status']; … … 1422 1545 $args['post_type'] = array_shift( $args['post_type'] ); 1423 1546 $count = (Array)wp_count_posts( $args['post_type'] ); 1424 $post_counts [$args['post_type']]= $count[$status];1547 $post_counts = $count[$status]; 1425 1548 } else 1426 1549 foreach( $args['post_type'] as $post_type ) { 1550 1427 1551 $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 ); 1433 1562 return $post_counts; 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1434 1575 } 1435 1576 … … 1469 1610 if ( version_compare( $wp_version, '3.5', '>=' ) ) { 1470 1611 $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' ) 1472 1613 ); 1473 1614 } else { … … 1478 1619 $ex_args['meta_compare'] = '='; 1479 1620 $ex_args['fields'] = 'ids'; 1480 $ex_args['posts_per_page'] = -1;1481 1621 $q = new WP_Query( $ex_args ); 1482 1622 if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] ); 1483 1623 if ( !empty( $q->posts ) ) $args['exclude'] = array_merge( $args['exclude'], $q->posts ); 1484 //} 1624 // } 1625 1485 1626 $posts = get_posts( apply_filters( $this->prefix . 'post_query', $args ) ); 1486 1627 if ( !empty( $exclude_slugs ) ) { … … 1495 1636 } 1496 1637 } 1638 -
all-in-one-seo-pack/tags/2.1.5/all_in_one_seo_pack.php
r861972 r895274 4 4 Plugin URI: http://semperfiwebdesign.com 5 5 Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a> 6 Version: 2.1. 46 Version: 2.1. 7 7 Author: Michael Torbert 8 8 Author URI: http://michaeltorbert.com … … 31 31 /** 32 32 * @package All-in-One-SEO-Pack 33 * @version 2.1. 433 * @version 2.1. 34 34 */ 35 35 36 36 if ( ! defined( 'AIOSEOP_VERSION' ) ) 37 define( 'AIOSEOP_VERSION', '2.1. 4' );37 define( 'AIOSEOP_VERSION', '2.1.' ); 38 38 39 39 if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) { … … 117 117 118 118 $aiosp_activation = false; 119 $aioseop_module_list = Array( 'sitemap', 'opengraph', ' performance' ); // list all available modules here119 $aioseop_module_list = Array( 'sitemap', 'opengraph', 'performance' ); // list all available modules here 120 120 121 121 if ( class_exists( 'All_in_One_SEO_Pack' ) ) { -
all-in-one-seo-pack/tags/2.1.5/readme.txt
r864255 r895274 4 4 Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google 5 5 Requires at least: 3.3 6 Tested up to: 3. 8.16 Tested up to: 3. 7 7 Stable tag: trunk 8 8 -
all-in-one-seo-pack/trunk/aioseop_class.php
r861972 r895274 51 51 global $aioseop_options; 52 52 $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'] ) 54 55 $this->do_log = true; 55 56 else … … 173 174 "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' ), 174 175 "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' ), 176 177 "ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ), 177 178 "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' ), … … 399 400 'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ), 400 401 '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' => '' ) ) ), 403 403 "ga_exclude_users"=> Array( 404 404 'name' => __( 'Exclude Users From Tracking:', 'all_in_one_seo_pack' ), … … 1338 1338 $googleplus = $aioseop_options['aiosp_google_publisher']; 1339 1339 1340 1341 if ( $is_front_page) {1340 $page = $this->get_page_number(); 1341 if ( ) { 1342 1342 if ( !empty( $aioseop_options['aiosp_google_publisher'] ) ) 1343 1343 $publisher = $aioseop_options['aiosp_google_publisher']; … … 1364 1364 if ( !empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) { 1365 1365 if ( $is_front_page && !in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) { 1366 unset( $author );1366 ; 1367 1367 } else { 1368 1368 if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) { 1369 1369 if ( is_singular() && !is_singular( $aioseop_options['aiosp_google_author_location'] ) ) 1370 unset( $author );1370 ; 1371 1371 } else { 1372 1372 if ( !is_singular( $aioseop_options['aiosp_google_author_location'] ) ) 1373 unset( $author );1373 ; 1374 1374 } 1375 1375 } … … 1395 1395 global $wp_query; 1396 1396 $max_page = $wp_query->max_num_pages; 1397 $page = $this->get_page_number();1398 1397 if ( $page > 1 ) 1399 1398 $prev = get_previous_posts_page_link(); … … 1708 1707 $allow_linker = "'allowLinker': true"; 1709 1708 } 1709 1710 1711 1712 1710 1713 $js_options = Array(); 1711 1714 foreach( Array( 'cookie_domain', 'allow_linker' ) as $opts ) { … … 1725 1728 1726 1729 ga('create', '{$analytics_id}'{$js_options}); 1730 1727 1731 ga('send', 'pageview'); 1728 1732 </script> … … 1899 1903 $link = get_term_link( $term, $taxonomy ); 1900 1904 } 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 ); 1902 1908 } else { 1903 1909 return false; -
all-in-one-seo-pack/trunk/aioseop_feature_manager.php
r805127 r895274 24 24 'description' => __( 'Optimize performance related to SEO and check your system status.', 'all_in_one_seo_pack' ), 25 25 'default' => 'on' ), 26 27 26 28 'coming_soon' => Array( 'name' => __( 'Coming Soon...', 'all_in_one_seo_pack' ), 27 29 'description' => __( 'File Editor', 'all_in_one_seo_pack' ), -
all-in-one-seo-pack/trunk/aioseop_functions.php
r861972 r895274 610 610 } 611 611 } 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 361 361 background-image: url(images/SocialMeta-Color-Standard.png); 362 362 } 363 364 365 366 367 368 363 369 div.aioseop_feature#aioseop_performance .aioseop_featured_image { 364 370 background-image: url(images/Performance-BW-Standard.png); … … 638 644 vertical-align: text-bottom; 639 645 margin: 15px 0 0 0; 646 647 648 640 649 } 641 650 #aiosp { -
all-in-one-seo-pack/trunk/aioseop_opengraph.php
r861972 r895274 79 79 "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' ), 80 80 "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 81 82 "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' ), 82 83 "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' ), 83 84 "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 84 86 "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' ), 85 87 "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' ), … … 104 106 'description' => Array( 'name' => __( 'Home Description', 'all_in_one_seo_pack'), 105 107 'default' => '', 'type' => 'textarea', 'condshow' => Array( 'aiosp_opengraph_setmeta' => Array( 'lhs' => "aiosp_opengraph_setmeta", 'op' => '!=', 'rhs' => 'on' ) ) ), 108 109 106 110 'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ), 107 111 'disable_jetpack' => Array( 'name' => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ), 108 112 '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 109 114 'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ), 110 115 'meta_key' => Array( 'name' => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ), … … 145 150 $this->locations = array( 146 151 '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') ), 148 153 'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'), 149 154 'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings', … … 315 320 $description = $this->options['aiosp_opengraph_description']; 316 321 $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']; 318 326 319 327 /* If Use AIOSEO Title and Desc Selected */ … … 398 406 } 399 407 } 408 409 410 400 411 401 412 $width = $height = ''; -
all-in-one-seo-pack/trunk/aioseop_sitemap.php
r844829 r895274 16 16 17 17 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 } 21 23 parent::__construct(); 22 24 $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' ); … … 52 54 'indexes' => Array( 'name' => __( 'Enable Sitemap Indexes', 'all_in_one_seo_pack' ) ), 53 55 'paginate' => Array( 'name' => __( 'Paginate Sitemap Indexes', 'all_in_one_seo_pack' ), 54 'condshow' => Array( " aiosp_sitemap_indexes" => 'on' ) ),56 'condshow' => Array( "indexes" => 'on' ) ), 55 57 'max_posts' => Array( 'name' => __( 'Maximum Posts Per Sitemap', 'all_in_one_seo_pack' ), 56 58 'type' => 'text', 'default' => 50000, 57 'condshow' => Array( " aiosp_sitemap_indexes" => 'on', "aiosp_sitemap_paginate" => 'on' ) ),59 'condshow' => Array( "paginate" => 'on' ) ), 58 60 'posttypes' => Array( 'name' => __( 'Post Types', 'all_in_one_seo_pack'), 59 61 'type' => 'multicheckbox', 'default' => 'all' ), … … 154 156 foreach( $help_text as $k => $v ) 155 157 $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' ) ); 173 160 add_action( $this->prefix . 'settings_update', Array( $this, 'do_sitemaps' ) ); 174 161 add_filter( $this->prefix . 'display_settings', Array( $this, 'update_post_data' ) ); … … 178 165 } 179 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 180 185 /** Custom settings - displays boxes for add pages to sitemap option. **/ 181 186 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 .= ; 184 189 if ( !empty( $args['value'] ) ) { 185 190 $buf .= "<table class='aioseop_table' cellpadding=0 cellspacing=0>\n"; … … 200 205 $buf .= '</div>'; 201 206 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 202 234 } 203 235 … … 279 311 'all_in_one_seo_pack' ), $privacy_link ); 280 312 } 281 if ( $this->option_isset( 'debug' ) ) $options[ 'aiosp_sitemap_debug'] = '<pre>' . $options['aiosp_sitemap_debug'] . '</pre>';313 if ( $this->option_isset( 'debug' ) ) $options[] . '</pre>'; 282 314 return $options; 283 315 } … … 285 317 /** Handle 'all' option for post types / taxonomies, further sanitization of filename, rewrites on for multisite, setting up addl pages option. **/ 286 318 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'] ); 291 323 $opt = $this->prefix . 'filename'; 292 324 if ( isset( $options[$opt] ) && !empty( $options[$opt] ) ) … … 355 387 } 356 388 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'; 359 391 $siteurls[] = $url; 360 392 } … … 369 401 $files = Array(); 370 402 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'; 375 407 376 408 if ( empty( $scan1 ) && empty( $scan2 ) ) return $files; … … 394 426 function do_sitemap_scan() { 395 427 $msg = ''; 396 if ( !empty( $this->options[ 'aiosp_sitemap_rewrite'] ) && ( get_option('permalink_structure') == '' ) ) {428 if ( !empty( $this->options[] ) && ( get_option('permalink_structure') == '' ) ) { 397 429 $msg = '<p>' . __( 'Warning: dynamic sitemap generation must have permalinks enabled.', 'all_in_one_seo_pack' ) . '</p>'; 398 430 } … … 433 465 $this->output_error( $msg ); 434 466 } 435 467 436 468 /** Do the scan, return the results. **/ 437 469 function scan_sitemaps() { … … 474 506 if ( preg_match( "/<!-- " . sprintf( $this->comment_string, '(.*)', '(.*)', '(.*)' ) . " -->/", 475 507 $file, $matches ) ) { 476 if ( !empty( $this->options[ 'aiosp_sitemap_rewrite'] ) ) {508 if ( !empty( $this->options[] ) ) { 477 509 $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' ), 478 510 $f, $matches[2], $matches[3] ) . "</p>\n"; … … 508 540 /** Updates debug log messages. **/ 509 541 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" ); 514 546 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 ); 516 548 } 517 549 $this->update_class_option( $this->options ); … … 523 555 add_filter( 'query_vars', Array( $this, 'query_var_hook' ) ); 524 556 add_action( 'parse_query', Array( $this, 'sitemap_output_hook') ); 525 if ( !get_transient( 'aiosp_sitemap_rules_flushed') )557 if ( !get_transient( ) ) 526 558 add_action( 'wp_loaded', Array($this, 'flush_rules_hook' ) ); 527 559 } … … 531 563 $sitemap_rules_normal = $sitemap_rules_gzipped = Array(); 532 564 $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]' 536 568 ); 537 if ( $this->options[ 'aiosp_sitemap_gzipped'] ) {569 if ( $this->options[] ) { 538 570 $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' 542 574 ); 543 575 } … … 563 595 if ( !isset( $rules[ $rule ] ) || ( $rules[ $rule ] != $sitemap_rules[ $rule ] ) ) { 564 596 $wp_rewrite->flush_rules(); 565 set_transient( 'aiosp_sitemap_rules_flushed', true, 43200 );597 set_transient( , true, 43200 ); 566 598 } 567 599 } … … 570 602 /** Add our query variable for sitemap generation. **/ 571 603 function query_var_hook($vars) { 572 $vars[] = 'aioseop_sitemap_path';604 $vars[] = ; 573 605 if ( $this->paginate ) 574 $vars[] = 'aioseop_sitemap_page';606 $vars[] = ; 575 607 return $vars; 576 608 } … … 600 632 function sitemap_output_hook($query) { 601 633 $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; 606 638 $this->start_memory_usage = memory_get_peak_usage(); 607 $sitemap_type = $query->query_vars[ 'aioseop_sitemap_path'];639 $sitemap_type = $query->query_vars[]; 608 640 $gzipped = false; 609 641 if ( $this->substr( $sitemap_type, -3 ) === '.gz' ) { … … 612 644 } 613 645 $blog_charset = get_option( 'blog_charset' ); 614 if ( $this->options[ 'aiosp_sitemap_gzipped'] && $gzipped ) {646 if ( $this->options[] && $gzipped ) { 615 647 header( "Content-Type: application/x-gzip; charset=$blog_charset", true); 616 648 } else { … … 630 662 $this->add_post_types(); 631 663 $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[]; 634 666 if ( empty( $posttypes ) ) $posttypes = Array(); 635 $taxonomies = $this->options[ 'aiosp_sitemap_taxonomies'];667 $taxonomies = $this->options[]; 636 668 if ( empty( $taxonomies ) ) $taxonomies = Array(); 637 669 if ( $sitemap_type === 'root' ) { … … 646 678 $this->output_sitemap( $this->get_all_post_priority_data( $sitemap_type, 'publish', $page ), $comment ); 647 679 } 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 ); 649 681 } 650 682 } elseif ( $sitemap_type === 'root' ) echo $this->do_simple_sitemap( $comment ); … … 653 685 /** Build a url to the sitemap. **/ 654 686 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'; 657 689 return $url; 658 690 } … … 691 723 /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/ 692 724 function do_sitemaps() { 693 if ( !empty( $this->options[ 'aiosp_sitemap_paginate'] ) ) {725 if ( !empty( $this->options[] ) ) { 694 726 $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[]; 697 729 else 698 730 $this->max_posts = 50000; … … 701 733 $this->max_posts = 50000; 702 734 } 703 if ( !$this->options[ 'aiosp_sitemap_rewrite'] ) {704 if ( $this->options[ 'aiosp_sitemap_indexes'] ) {735 if ( !$this->options[] ) { 736 if ( $this->options[] ) { 705 737 $this->do_indexed_sitemaps(); 706 738 } else { 707 739 $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[] ); 709 741 $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 ); 712 744 } 713 745 } else { 714 delete_transient( 'aiosp_sitemap_rules_flushed');746 delete_transient( ); 715 747 } 716 748 $this->do_notify(); … … 728 760 function write_sitemaps( $filename, $contents ) { 729 761 $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 ); 731 763 } 732 764 … … 778 810 $files = Array(); 779 811 $options = $this->options; 780 $prefix = $options[" aiosp_sitemap_filename"];812 $prefix = $options["filename"]; 781 813 $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' ) ); 787 819 $url_base = trailingslashit( get_home_url() ); 788 820 $files[] = Array( 'loc' => $url_base . $prefix . '_addl' . $suffix ); 789 if ( !empty( $options[ 'aiosp_sitemap_posttypes'] ) ) {821 if ( !empty( $options[] ) ) { 790 822 $prio = $this->get_default_priority( 'post' ); 791 823 $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 ) { 796 826 if ( $post_counts[$sm] == 0 ) continue; 797 827 if ( $this->paginate ) { … … 805 835 $files[] = Array( 'loc' => $url_base . $prefix . '_' . $sm . $suffix, 'priority' => $prio, 'changefreq' => $freq ); 806 836 } 807 808 837 } 809 838 if ( $this->option_isset( 'archive' ) ) … … 811 840 if ( $this->option_isset( 'author' ) ) 812 841 $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 } 816 858 foreach( $this->get_child_sitemap_urls() as $csm ) 817 859 $files[] = Array( 'loc' => $csm, 'priority' => $this->get_default_priority( 'sitemap' ), 'changefreq' => $this->get_default_frequency( 'sitemap' ) ); … … 824 866 $options = $this->options; 825 867 $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 839 881 if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) { 840 882 $count = 1; 841 883 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}", 844 886 $this->build_sitemap( $this->get_all_post_priority_data( $posttype, 'publish', ( $count - 1 ) ), $comment ) ); 845 887 $count++; 846 888 } 847 889 } 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", 850 892 $this->build_sitemap( $this->get_all_post_priority_data( $posttype ), $comment ) ); 851 893 } … … 854 896 855 897 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", 858 900 $this->build_sitemap( $this->get_archive_prio_data(), $comment ) ); 859 901 } 860 902 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", 863 905 $this->build_sitemap( $this->get_author_prio_data(), $comment ) ); 864 906 } 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 ); 872 939 } 873 940 … … 880 947 ); 881 948 $posts = get_option( 'page_for_posts' ); 949 882 950 if ( $posts ) { 883 951 $posts = $this->get_permalink( $posts ); … … 893 961 $child = $this->get_child_sitemap_urls(); 894 962 $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[] ); 900 968 if ( $this->option_isset( 'archive' ) ) $prio = array_merge( $prio, $this->get_archive_prio_data() ); 901 969 if ( $this->option_isset( 'author' ) ) $prio = array_merge( $prio, $this->get_author_prio_data() ); … … 916 984 if ( is_array( $posts ) ) array_unshift( $prio, $posts ); 917 985 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() ); 919 987 $prio2 = $this->get_term_priority_data( $terms ); 920 988 $prio3 = $this->get_addl_pages_only(); … … 937 1005 $plugin_path = $this->unparse_url( $plugin_url ); 938 1006 } 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; 941 1019 $count = 0; 942 1020 foreach ( $urls as $url ) { … … 946 1024 if ( !empty( $v ) ) { 947 1025 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"; 949 1046 } 950 1047 } … … 953 1050 } 954 1051 echo "\t</url>\r\n"; 955 $count++;956 1052 if ( $count >= $max_items ) break; 957 1053 } … … 1085 1181 return "$scheme$user$pass$host$port$path$query$fragment"; 1086 1182 } 1087 1183 1088 1184 /** Return data for user entered additional pages. **/ 1089 1185 function get_addl_pages_only() { … … 1105 1201 } 1106 1202 } 1203 1107 1204 return $pages; 1108 1205 } … … 1133 1230 if ( !empty( $posts ) ) 1134 1231 $pages[] = $posts; 1232 1135 1233 return $pages; 1136 1234 } … … 1262 1360 function get_prio_from_posts( $posts, $prio_override = false, $freq_override = false, $linkfunc = 'get_permalink' ) { 1263 1361 $prio = Array(); 1362 1264 1363 if ( ( $prio_override ) && ( $freq_override ) ) 1265 1364 $stats = 0; … … 1296 1395 $pr_info[ 'changefreq' ] = $freq_override; 1297 1396 $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; 1299 1400 } 1300 1401 } … … 1303 1404 1304 1405 /** Return excluded categories for taxonomy queries. **/ 1305 function get_tax_args( ) {1406 function get_tax_args() { 1306 1407 $args = Array(); 1307 1408 if ( $this->option_isset( 'excl_categories' ) ) 1308 1409 $args['exclude'] = $this->options[ $this->prefix . 'excl_categories']; 1410 1411 1412 1413 1414 1309 1415 return $args; 1310 1416 } … … 1412 1518 } 1413 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1414 1537 /** Return post counts using wp_count_posts(). **/ 1415 1538 function get_all_post_counts( $args ) { 1416 $post_counts = Array();1539 $post_counts = ; 1417 1540 $status = 'inherit'; 1418 1541 if ( !empty( $args['post_status'] ) ) $status = $args['post_status']; … … 1422 1545 $args['post_type'] = array_shift( $args['post_type'] ); 1423 1546 $count = (Array)wp_count_posts( $args['post_type'] ); 1424 $post_counts [$args['post_type']]= $count[$status];1547 $post_counts = $count[$status]; 1425 1548 } else 1426 1549 foreach( $args['post_type'] as $post_type ) { 1550 1427 1551 $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 ); 1433 1562 return $post_counts; 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1434 1575 } 1435 1576 … … 1469 1610 if ( version_compare( $wp_version, '3.5', '>=' ) ) { 1470 1611 $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' ) 1472 1613 ); 1473 1614 } else { … … 1478 1619 $ex_args['meta_compare'] = '='; 1479 1620 $ex_args['fields'] = 'ids'; 1480 $ex_args['posts_per_page'] = -1;1481 1621 $q = new WP_Query( $ex_args ); 1482 1622 if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] ); 1483 1623 if ( !empty( $q->posts ) ) $args['exclude'] = array_merge( $args['exclude'], $q->posts ); 1484 //} 1624 // } 1625 1485 1626 $posts = get_posts( apply_filters( $this->prefix . 'post_query', $args ) ); 1486 1627 if ( !empty( $exclude_slugs ) ) { … … 1495 1636 } 1496 1637 } 1638 -
all-in-one-seo-pack/trunk/all_in_one_seo_pack.php
r861972 r895274 4 4 Plugin URI: http://semperfiwebdesign.com 5 5 Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a> 6 Version: 2.1. 46 Version: 2.1. 7 7 Author: Michael Torbert 8 8 Author URI: http://michaeltorbert.com … … 31 31 /** 32 32 * @package All-in-One-SEO-Pack 33 * @version 2.1. 433 * @version 2.1. 34 34 */ 35 35 36 36 if ( ! defined( 'AIOSEOP_VERSION' ) ) 37 define( 'AIOSEOP_VERSION', '2.1. 4' );37 define( 'AIOSEOP_VERSION', '2.1.' ); 38 38 39 39 if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) { … … 117 117 118 118 $aiosp_activation = false; 119 $aioseop_module_list = Array( 'sitemap', 'opengraph', ' performance' ); // list all available modules here119 $aioseop_module_list = Array( 'sitemap', 'opengraph', 'performance' ); // list all available modules here 120 120 121 121 if ( class_exists( 'All_in_One_SEO_Pack' ) ) { -
all-in-one-seo-pack/trunk/readme.txt
r864255 r895274 4 4 Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google 5 5 Requires at least: 3.3 6 Tested up to: 3. 8.16 Tested up to: 3. 7 7 Stable tag: trunk 8 8
Note: See TracChangeset
for help on using the changeset viewer.