Changeset 924101
- Timestamp:
- 05/31/2014 03:24:05 AM (10 years ago)
- Location:
- all-in-one-seo-pack/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
all-in-one-seo-pack/trunk/aioseop_class.php
r895274 r924101 174 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' ), 175 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' ), 176 176 177 "ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking.", 'all_in_one_seo_pack' ), 177 178 "ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ), … … 397 398 'default' => 0, 398 399 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ), 400 401 402 403 399 404 "ga_display_advertising"=> Array( 400 405 'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ), … … 488 493 }); 489 494 </script> 490 <div class="preview_snippet"><div id="aioseop_snippet"><h3><a id="aioseop_snippet_title">%s</a></h3><div><div><cite id="aioseop_snippet_link">%s</cite></div><span id="aioseop_snippet_description">%s</span></div></div></div>' ),495 <div class="preview_snippet"><div id="aioseop_snippet"><h3><a>%s</a></h3><div><div><cite id="aioseop_snippet_link">%s</cite></div><span id="aioseop_snippet_description">%s</span></div></div></div>' ), 491 496 'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ), 492 497 'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ), … … 553 558 'help_link' => 'http://semperplugins.com/documentation/google-settings/', 554 559 'options' => Array( "google_publisher", "google_disable_profile", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher", 555 "google_connect", "google_analytics_id", "ga_use_universal_analytics", "ga_domain", "ga_multi_domain", "ga_ display_advertising", "ga_exclude_users", "ga_track_outbound_links" )560 "google_connect", "google_analytics_id", "ga_use_universal_analytics", "ga_domain", "ga_multi_domain", "ga_display_advertising", "ga_exclude_users", "ga_track_outbound_links" ) 556 561 ), 557 562 'noindex' => Array( … … 595 600 else 596 601 $wp_query->is_single = true; 602 597 603 if ( get_option( 'show_on_front' ) == 'page' ) { 598 604 if ( is_page() && $post->ID == get_option( 'page_on_front' ) ) … … 607 613 $wp_query->queried_object = $post; 608 614 609 $title = $this->wp_title(); 610 if ( empty( $title ) ) $title = $post->post_title; 615 if ( !empty( $post ) && !$wp_query->is_home && !$wp_query->is_front_page ) { 616 $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) ); 617 if ( empty( $title ) ) $title = $post->post_title; 618 } 619 620 $title_format = ''; 621 if ( empty( $title ) ) { 622 $title = $this->wp_title(); 623 $title_format = '%post_title%'; 624 } 611 625 612 626 if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) ) … … 614 628 if ( !$url ) $url = get_permalink(); 615 629 630 631 616 632 $description = $this->get_aioseop_description( $post ); 617 $description = apply_filters( 'aioseop_description', $description ); 633 $description = $this->apply_cf_fields( $description ); 634 $description = apply_filters( 'aioseop_description', $description ); 618 635 619 636 if ( $this->strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...'; 620 637 if ( $this->strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...'; 621 638 622 $args['value'] = sprintf( $args['value'], esc_attr( strip_tags( $title ) ), esc_url( $url ), esc_attr( strip_tags( $description ) ) ); 639 if ( empty( $title_format ) ) { 640 if ( is_page() ) 641 $title_format = $aioseop_options['aiosp_page_title_format']; 642 elseif ( is_single() ) 643 $title_format = $this->get_post_title_format(); 644 } 645 if ( empty( $title_format ) ) { 646 $title = '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>'; 647 } else { 648 $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format ); 649 $title_format = $this->apply_cf_fields( $title_format ); 650 $title_format = str_replace( '%post_title%', '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>', $title_format ); 651 $title_format = str_replace( '%page_title%', '<span id="aioseop_snippet_title">' . esc_attr( strip_tags( $title ) ) . '</span>', $title_format ); 652 $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format ); 653 $title = $title_format; 654 } 655 656 $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( strip_tags( $description ) ) ); 623 657 $buf = $this->get_option_row( $args['name'], $args['options'], $args ); 624 658 … … 1258 1292 $meta_string .= sprintf( "<meta name=\"description\" content=\"%s\" />\n", $description ); 1259 1293 } 1260 1294 $keywords = $this->apply_cf_fields( $keywords ); 1261 1295 $keywords = apply_filters( 'aioseop_keywords', $keywords ); 1262 1296 … … 1315 1349 foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) { 1316 1350 if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) ) 1317 $$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ) );1351 $$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ) ); 1318 1352 else 1319 1353 $$meta = ''; … … 1707 1741 $allow_linker = "'allowLinker': true"; 1708 1742 } 1709 $ display_advertising= '';1743 $ = ''; 1710 1744 if (!empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) { 1711 $display_advertising = "ga('require', 'displayfeatures');"; 1745 $extra_options = "ga('require', 'displayfeatures');"; 1746 } 1747 if ( !empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) { 1748 if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t"; 1749 $extra_options .= "ga('set', 'anonymizeIp', true);"; 1712 1750 } 1713 1751 $js_options = Array(); … … 1728 1766 1729 1767 ga('create', '{$analytics_id}'{$js_options}); 1730 {$ display_advertising}1768 {$} 1731 1769 ga('send', 'pageview'); 1732 1770 </script> … … 1760 1798 echo $aioseop_options['aiosp_google_analytics_id']; 1761 1799 ?>']); 1800 1801 1802 1803 1804 1762 1805 <?php if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) { 1763 1806 ?> _gaq.push(['_setAllowLinker', true]); … … 1823 1866 } 1824 1867 } 1868 1869 1870 1871 1872 1873 1874 1825 1875 1826 1876 aiosp_addLoadEvent(function () { … … 1828 1878 for (var x=0; x < links.length; x++) { 1829 1879 if (typeof links[x] == 'undefined') continue; 1830 if (typeof links[x].onclick != 'undefined') continue; 1831 links[x].onclick = function () { 1880 aiosp_addEvent( links[x], 'onclick', function () { 1832 1881 var mydomain = new RegExp(document.domain, 'i'); 1833 1882 href = getAttr(this, 'href'); 1834 if (href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {1883 if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) { 1835 1884 recordOutboundLink(this, 'Outbound Links', href); 1836 1885 } 1837 } 1886 } 1838 1887 } 1839 1888 }); … … 1988 2037 if ( empty( $description ) && is_object( $post ) && !is_archive() && empty( $blog_page ) ) 1989 2038 $description = $this->get_post_description( $post ); 2039 1990 2040 return $description; 1991 2041 } … … 1993 2043 function replace_title( $content, $title ) { 1994 2044 $title = trim( strip_tags( $title ) ); 1995 $title_tag_start = "<title>"; 1996 $title_tag_end = "</title>"; 1997 $len_start = $this->strlen( $title_tag_start ); 2045 $title_tag_start = "<title"; 2046 $title_tag_end = "</title"; 1998 2047 $title = stripslashes( trim( $title ) ); 1999 2048 $start = $this->strpos( $content, $title_tag_start ); … … 2004 2053 $this->orig_title = $title; 2005 2054 2006 return preg_replace( '/<title >(.*?)<\/title>/is', '<title>' . preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . '</title>', $content, 1 );2055 return preg_replace( '/<title>' . preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . '</title>', $content, 1 ); 2007 2056 } 2008 2057 … … 2179 2228 if ( !$title ) 2180 2229 $title = $this->internationalize( $this->get_original_title( '', false ) ); 2181 $title = get_the_title( $post->post_parent ) . ' ' . $title . ' –' . get_option( 'blogname' );2230 $title = get_the_title( $post->post_parent ) . ' ' . $title . ' ' . get_option( 'blogname' ); 2182 2231 apply_filters( 'aioseop_attachment_title', $title ); 2183 2232 } else if ( is_page() || $this->is_static_posts_page() || ( is_home() && !$this->is_static_posts_page() ) ) { … … 2332 2381 $title = false; 2333 2382 $post = $this->get_queried_object(); 2334 if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) ) 2383 if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) ) 2335 2384 $title = $this->get_aioseop_title( $post ); 2385 2386 2336 2387 if ( $title === false ) 2337 2388 $title = $this->get_original_title(); -
all-in-one-seo-pack/trunk/aioseop_functions.php
r895274 r924101 191 191 check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' ); 192 192 $post_id = intval( $_POST['post_id'] ); 193 $new_meta = $_POST['new_meta'];193 $new_meta = ; 194 194 $target = $_POST['target_meta']; 195 update_post_meta( $post_id, '_aioseop_' . $target, esc_attr( $new_meta ) ); 196 $result = get_post_meta( $post_id, '_aioseop_' . $target, true ); 197 if( $result != '' ): $label = $result; 198 else: $label = ''; $result = '<strong><i>' . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>' ; endif; 199 $output = $result . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"'; 200 $output .= 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', ' . json_encode( $label ) . ', "' . $target . '");return false;\' title="' . __('Edit') . '">'; 195 $result = ''; 196 if ( in_array( $target, Array( 'title', 'description', 'keywords' ) ) && current_user_can( 'edit_post', $post_id ) ) { 197 update_post_meta( $post_id, '_aioseop_' . $target, esc_attr( $new_meta ) ); 198 $result = get_post_meta( $post_id, '_aioseop_' . $target, true ); 199 } else { 200 die(); 201 } 202 if( $result != '' ): 203 $label = "<label id='aioseop_label_{$target}_{$post_id}'>" . $result . '</label>'; 204 else: 205 $label = ''; 206 $label = "<label id='aioseop_label_{$target}_{$post_id}'></label><strong><i>" . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>'; 207 endif; 208 $output = $label . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"'; 209 $output .= 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '");return false;\' title="' . __('Edit') . '">'; 201 210 $output .= '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a>'; 202 die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() { 203 jQuery('div#aioseop_" . $target . "_" . $post_id . "').html( '" . addslashes_gpc($output) . "').fadeIn('fast');211 die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() { 212 jQuery('div#aioseop_" . $target . "_" . $post_id . "').html().fadeIn('fast'); 204 213 });" ); 205 214 } … … 455 464 id="aioseop_<?php print $target; ?>_<?php echo $id; ?>" 456 465 style="float:left;"> 457 <?php $content = htmlspecialchars( stripslashes( get_post_meta( $id, "_aioseop_" . $target, TRUE ) ) ); 458 if( !empty($content) ): $label = esc_js( $content ); 459 else: $label = ''; $content = '<strong><i>No ' . $target . '</i></strong>' ; endif; 460 print $content . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' . 461 $id . ', "' . str_replace( Array( '"', '"' ), Array( '\x22', '\x22' ), esc_js( $label ) ) . '", "' . $target . '");return false;\' title="' . __('Edit') . '">'; 466 <?php $content = strip_tags( stripslashes( get_post_meta( $id, "_aioseop_" . $target, TRUE ) ) ); 467 if( !empty($content) ): 468 $label = "<label id='aioseop_label_{$target}_{$id}'>" . $content . '</label>'; 469 else: 470 $label = "<label id='aioseop_label_{$target}_{$id}'></label><strong><i>No " . $target . '</i></strong>'; 471 endif; 472 print $label . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' . 473 $id . ', "' . $target . '");return false;\' title="' . __('Edit') . '">'; 462 474 print "<img class='aioseop_edit_button' 463 475 id='aioseop_edit_id' … … 576 588 577 589 /*** 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 578 608 * JSON support for PHP < 5.2 579 609 */ -
all-in-one-seo-pack/trunk/aioseop_module_class.php
r861972 r924101 289 289 } 290 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 291 312 /** 292 313 * Returns child blogs of parent in a multisite. -
all-in-one-seo-pack/trunk/aioseop_opengraph.php
r895274 r924101 91 91 "imagewidth" => __( "Enter the width for your Open Graph image in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ), 92 92 "imageheight" => __( "Enter the height for your Open Graph image in pixels (i.e. 600).<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ), 93 94 93 95 "types" => __( "Select which Post Types you want to use All in One SEO Pack to set Open Graph meta values for.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ), 94 96 "title" => __( "This is the Open Graph title of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ), … … 124 126 'imageheight' => Array( 'name' => __( 'Specify Image Height', 'all_in_one_seo_pack' ), 125 127 'type' => 'text', 'default' => '' ), 128 129 130 131 126 132 'types' => Array( 'name' => __( 'Enable Facebook Meta for', 'all_in_one_seo_pack'), 127 133 'type' => 'multicheckbox', 'initial_options' => $this->get_post_type_titles( Array( '_builtin' => false ) ), … … 150 156 $this->locations = array( 151 157 'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 152 'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'disable_jetpack', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', ' types') ),158 'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'disable_jetpack', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', 'types') ), 153 159 'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'), 154 160 'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings', 155 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'category' ),161 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'category' ), 156 162 'display' => $display, 'prefix' => 'aioseop_opengraph_' 157 163 ) … … 233 239 $settings[$prefix . 'category']['initial_options'] = array_merge( Array( '' => 'Default - ' . $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ), $settings[$prefix . 'category']['initial_options'] ); 234 240 } 241 242 243 235 244 } 236 245 if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] ) … … 371 380 $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 ); 372 381 373 /* Data Validation */ 382 $title = $this->apply_cf_fields( $title ); 383 $description = $this->apply_cf_fields( $description ); 384 385 /* Data Validation */ 374 386 $title = strip_tags( esc_attr( $title ) ); 375 387 $sitename = strip_tags( esc_attr( $sitename ) ); … … 419 431 420 432 $card = 'summary'; 433 434 435 436 437 421 438 422 439 /* OG only: */ -
all-in-one-seo-pack/trunk/aioseop_sitemap.php
r895274 r924101 14 14 var $max_posts = 50000; 15 15 var $paginate = false; 16 16 var $prio; 17 var $prio_sel; 18 var $freq; 19 var $freq_sel; 20 var $extra_sitemaps; 21 17 22 function All_in_One_SEO_Pack_Sitemap( ) { 18 23 if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class … … 86 91 ); 87 92 88 $prio = Array( 'no' => 'Do Not Override' ); 89 93 $prio = Array(); 90 94 for( $i = 0; $i <= 10; $i++ ) { 91 95 $str = sprintf( "%0.1f", $i / 10.0 ); 92 96 $prio[ $str ] = $str; 93 97 } 94 95 $freq = Array( 'no' => 'Do Not Override' ); 96 98 $arr_no = Array( 'no' => __( 'Do Not Override', 'all_in_one_seo_pack' ) ); 99 $arr_sel = Array( 'sel' => __( 'Select Individual', 'all_in_one_seo_pack' ) ); 100 $this->prio_sel = array_merge( $arr_no, $arr_sel, $prio ); 101 $this->prio = array_merge( $arr_no, $prio ); 102 103 $freq = Array(); 97 104 foreach ( Array( 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never' ) as $f ) $freq[ $f ] = $f; 105 106 98 107 99 108 foreach( Array( 'prio' => __( 'priority', 'all_in_one_seo_pack' ), 'freq' => __( 'frequency', 'all_in_one_seo_pack' ) ) as $k => $v ) { … … 106 115 'author' => __( 'author pages', 'all_in_one_seo_pack' ) ) as $opt => $val ) { 107 116 $arr = $$s; 108 $arr[ $k . '_' . $opt ] = Array( 'name' => $this->ucwords( $val ), 'help_text' => sprintf( __( "Manually set the %s of your %s.", 'all_in_one_seo_pack' ), $v, $val ), 'type' => 'select', 'initial_options' => $$k, 'default' => 'no' ); 117 if ( ( $opt == 'post' ) || ( $opt == 'taxonomies' ) ) { 118 $iopts = $this->{"{$k}_sel"}; 119 } else { 120 $iopts = $this->$k; 121 } 122 123 $arr[ $k . '_' . $opt ] = Array( 'name' => $this->ucwords( $val ), 'help_text' => sprintf( __( "Manually set the %s of your %s.", 'all_in_one_seo_pack' ), $v, $val ), 'type' => 'select', 'initial_options' => $iopts, 'default' => 'no' ); 109 124 if ( ( $opt == 'archive' ) || ( $opt == 'author' ) ) $arr[ $k . '_' . $opt ][ 'condshow' ] = Array( $this->prefix . $opt => 'on' ); 110 125 $$s = $arr; … … 169 184 // load initial options / set defaults 170 185 $this->update_options( ); 171 if ( !empty( $this->options["{$this->prefix} paginate"] ) ) {186 if ( !empty( $this->options["{$this->prefix}paginate"] ) ) { 172 187 $this->paginate = true; 173 188 if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) ) … … 237 252 function add_post_types() { 238 253 $post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) ); 254 239 255 if ( isset( $post_type_titles['attachment'] ) ) $post_type_titles['attachment'] = __( "Media / Attachments", 'all_in_one_seo_pack' ); 240 256 $this->default_options['posttypes' ]['initial_options'] = array_merge( Array( 'all' => __( 'All Post Types', 'all_in_one_seo_pack' ) ), $post_type_titles ); 241 $this->default_options['taxonomies']['initial_options'] = array_merge( Array( 'all' => __( 'All Taxonomies', 'all_in_one_seo_pack' ) ), $t his->get_taxonomy_titles( Array( 'public' => true ) ));257 $this->default_options['taxonomies']['initial_options'] = array_merge( Array( 'all' => __( 'All Taxonomies', 'all_in_one_seo_pack' ) ), $t ); 242 258 $this->default_options['posttypes' ]['default'] = array_keys( $this->default_options['posttypes' ]['initial_options'] ); 243 259 $this->default_options['taxonomies']['default'] = array_keys( $this->default_options['taxonomies']['initial_options'] ); 244 260 $this->default_options['excl_categories']['initial_options'] = $this->get_category_titles(); 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 245 281 $this->update_options(); 246 282 } … … 393 429 } 394 430 } 395 return apply_filters( $this->prefix . 'sitemap_urls', $siteurls ); 431 return apply_filters( $this->prefix . 'child_urls', $siteurls ); 432 return apply_filters( $this->prefix . 'sitemap_urls', $siteurls ); // legacy 396 433 } 397 434 … … 657 694 } 658 695 } 659 660 /** Output sitemaps dynamically based on rewrite rules. **/ 661 function do_rewrite_sitemap( $sitemap_type, $page = 0 ) { 662 $this->add_post_types(); 663 $comment = __( "dynamically", 'all_in_one_seo_pack' ); 696 697 function get_sitemap_data( $sitemap_type, $page = 0 ) { 698 $sitemap_data = Array(); 664 699 if ( $this->options["{$this->prefix}indexes"] ) { 665 700 $posttypes = $this->options["{$this->prefix}posttypes"]; … … 668 703 if ( empty( $taxonomies ) ) $taxonomies = Array(); 669 704 if ( $sitemap_type === 'root' ) { 670 $ this->output_sitemap_index( array_merge( $this->get_sitemap_index_filenames() ), $comment);705 $ ); 671 706 } elseif ( $sitemap_type === 'addl' ) { 672 $ this->output_sitemap( $this->get_addl_pages(), $comment);707 $); 673 708 } elseif ( $sitemap_type === 'archive' && $this->option_isset( 'archive' ) ) { 674 $ this->output_sitemap( $this->get_archive_prio_data(), $comment);709 $); 675 710 } elseif ( $sitemap_type === 'author' && $this->option_isset( 'author' ) ) { 676 $ this->output_sitemap( $this->get_author_prio_data(), $comment);711 $); 677 712 } elseif ( in_array( $sitemap_type, $posttypes ) ) { 678 $ this->output_sitemap( $this->get_all_post_priority_data( $sitemap_type, 'publish', $page ), $comment);713 $ ); 679 714 } elseif ( in_array( $sitemap_type, $taxonomies ) ) { 680 $this->output_sitemap( $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args( $page ) ) ), $comment ); 681 } 682 } elseif ( $sitemap_type === 'root' ) echo $this->do_simple_sitemap( $comment ); 715 $sitemap_data = $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args( $page ) ) ); 716 } else { 717 if ( is_array( $this->extra_sitemaps ) && in_array( $sitemap_type, $this->extra_sitemaps ) ) 718 $sitemap_data = apply_filters( $this->prefix . 'custom_' . $sitemap_type, $sitemap_data, $page, $this_options ); 719 } 720 } elseif ( $sitemap_type === 'root' ) $sitemap_data = $this->get_simple_sitemap(); 721 return apply_filters( $this->prefix . 'data', $sitemap_data, $sitemap_type, $page, $this->options ); 722 } 723 724 /** Output sitemaps dynamically based on rewrite rules. **/ 725 function do_rewrite_sitemap( $sitemap_type, $page = 0 ) { 726 $this->add_post_types(); 727 $comment = __( "dynamically", 'all_in_one_seo_pack' ); 728 $this->output_sitemap( $this->get_sitemap_data( $sitemap_type, $page ), $comment ); 683 729 } 684 730 … … 723 769 /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/ 724 770 function do_sitemaps() { 725 if ( !empty( $this->options["{$this->prefix} paginate"] ) ) {771 if ( !empty( $this->options["{$this->prefix}paginate"] ) ) { 726 772 $this->paginate = true; 727 773 if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) ) … … 772 818 } 773 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 774 839 /** Get priority settings for sitemap entries. **/ 775 function get_default_priority( $item, $nodefaults = false ) {840 function get_default_priority( $item, $nodefaults = false ) { 776 841 $defaults = Array( 'homepage' => '1.0', 'blog' => '0.9', 'sitemap' => '0.8', 'post' => '0.7', 'archive' => '0.5', 'author' => '0.3', 'taxonomies' => '0.3' ); 777 842 static $cache = Array(); 778 if ( !empty( $cache[ $item ] ) ) return $cache[ $item ]; 779 if ( !empty( $defaults[ $item ] ) ) { 780 $field = $this->prefix . 'prio_' . $item; 781 if ( $this->option_isset( 'prio_' . $item ) && $this->options[ $field ] != 'no' ) { 782 $cache[ $item ] = $this->options[ $field ]; 783 return $this->options[ $field ]; 784 } 785 if ( $nodefaults ) return false; 786 return $defaults[ $item ]; 787 } 788 return false; 789 } 790 843 return $this->get_default_values( $defaults, 'prio_', $cache, $item, $nodefaults, $type ); 844 } 845 791 846 /** Get frequency settings for sitemap entries. **/ 792 847 function get_default_frequency( $item, $nodefaults = false ) { 793 848 $defaults = Array( 'homepage' => 'always', 'blog' => 'daily', 'sitemap' => 'hourly', 'post' => 'weekly', 'archive' => 'monthly', 'author' => 'weekly', 'taxonomies' => 'monthly' ); 794 849 static $cache = Array(); 795 if ( !empty( $cache[ $item ] ) ) return $cache[ $item ]; 796 if ( !empty( $defaults[ $item ] ) ) { 797 $field = $this->prefix . 'freq_' . $item; 798 if ( $this->option_isset( 'freq_' . $item ) && $this->options[ $field ] != 'no' ) { 799 $cache[ $item ] = $this->options[ $field ]; 800 return $this->options[ $field ]; 801 } 802 if ( $nodefaults ) return false; 803 return $defaults[ $item ]; 804 } 805 return false; 806 } 807 850 return $this->get_default_values( $defaults, 'freq_', $cache, $item, $nodefaults, $type ); 851 } 852 808 853 /** Build an index of sitemaps used. **/ 809 854 function get_sitemap_index_filenames() { … … 860 905 return $files; 861 906 } 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 862 938 863 939 /** Build all the indexes. **/ … … 865 941 $this->start_memory_usage = memory_get_peak_usage(); 866 942 $options = $this->options; 867 $comment = __( "file '%s' statically", 'all_in_one_seo_pack' ); 868 $this->write_sitemaps( $options["{$this->prefix}filename"], 869 $this->build_sitemap_index( $this->get_sitemap_index_filenames() ), sprintf( $comment, $options["{$this->prefix}filename"] ) ); 870 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_addl", 871 $this->build_sitemap( $this->get_addl_pages(), sprintf( $comment, $options["{$this->prefix}filename"] . "_addl" ) ) ); 943 944 $this->do_write_sitemap( 'root' ); 945 $this->do_write_sitemap( 'addl' ); 946 947 if ( $this->option_isset( 'archive' ) ) $this->do_write_sitemap( 'archive' ); 948 if ( $this->option_isset( 'author' ) ) $this->do_write_sitemap( 'author' ); 949 872 950 if ( ( !isset( $options["{$this->prefix}posttypes"] ) ) || ( !is_array( $options["{$this->prefix}posttypes"] ) ) ) $options["{$this->prefix}posttypes"] = Array(); 873 951 if ( ( !isset( $options["{$this->prefix}taxonomies"] ) ) || ( !is_array( $options["{$this->prefix}taxonomies"] ) ) ) $options["{$this->prefix}taxonomies"] = Array(); 874 952 $options["{$this->prefix}posttypes"] = array_diff( $options["{$this->prefix}posttypes"], Array( 'all' ) ); 875 953 $options["{$this->prefix}taxonomies"] = array_diff( $options["{$this->prefix}taxonomies"], Array( 'all' ) ); 876 954 877 955 if ( !empty( $options["{$this->prefix}posttypes"] ) ) { 878 956 $post_counts = $this->get_all_post_counts( Array('post_type' => $options["{$this->prefix}posttypes"], 'post_status' => 'publish') ); … … 881 959 if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) { 882 960 $count = 1; 883 for( $post_count = 0; $post_count < $post_counts[$posttype]; $post_count += $this->max_posts ) { 884 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_{$posttype}_{$count}" ); 885 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_{$posttype}_{$count}", 886 $this->build_sitemap( $this->get_all_post_priority_data( $posttype, 'publish', ( $count - 1 ) ), $comment ) ); 961 for( $post_count = 0; $post_count < $post_counts[$posttype]; $post_count += $this->max_posts ) { 962 $this->do_write_sitemap( $posttype, $count - 1, $options["{$this->prefix}filename"] . "_{$posttype}_{$count}" ); 887 963 $count++; 888 964 } 889 965 } else { 890 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$posttype" ); 891 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_$posttype", 892 $this->build_sitemap( $this->get_all_post_priority_data( $posttype ), $comment ) ); 893 } 894 } 895 } 896 897 if ( $this->option_isset( 'archive') ) { 898 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_archive" ); 899 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_archive", 900 $this->build_sitemap( $this->get_archive_prio_data(), $comment ) ); 901 } 902 if ( $this->option_isset( 'author') ) { 903 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_author" ); 904 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_author", 905 $this->build_sitemap( $this->get_author_prio_data(), $comment ) ); 906 } 907 if ( !empty( $options["{$this->prefix}taxonomies"] ) ) 908 foreach ( $options["{$this->prefix}taxonomies"] as $taxonomy ) { 909 910 } 911 966 $this->do_write_sitemap( $posttype ); 967 } 968 } 969 } 970 912 971 if ( !empty( $options["{$this->prefix}taxonomies"] ) ) 913 972 foreach( $options["{$this->prefix}taxonomies"] as $taxonomy ) { … … 917 976 if ( $term_count > $this->max_posts ) { 918 977 $count = 1; 919 for( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) { 920 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$taxonomy_$count" ); 921 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_$taxonomy_$count", 922 $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args( $tc ) ), $comment ) ) ); 978 for( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) { 979 $this->do_write_sitemap( $taxonomy, $tc, $options["{$this->prefix}filename"] . "_{$taxonomy}_{$count}" ); 923 980 $count++; 924 981 } 925 982 } else { 926 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$taxonomy" ); 927 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_$taxonomy", 928 $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args() ), $comment ) ) ); 983 $this->do_write_sitemap( $taxonomy ); 929 984 } 930 985 } else { 931 $comment = sprintf( $comment, $options["{$this->prefix}filename"] . "_$taxonomy" ); 932 $this->write_sitemaps( $options["{$this->prefix}filename"] . "_$taxonomy", 933 $this->build_sitemap( $this->get_term_priority_data( get_terms( $taxonomy, $this->get_tax_args() ), $comment ) ) ); 986 $this->do_write_sitemap( $taxonomy ); 934 987 } 935 988 } 936 989 } 937 938 990 $this->log_stats( 'indexed', $options["{$this->prefix}gzipped"], false ); 939 991 } 940 941 /** Build a single, stand-alone sitemap without indexes. **/ 942 function do_simple_sitemap( $comment = '' ) { 992 993 function get_simple_sitemap() { 943 994 $home = Array( 944 995 'loc' => get_home_url(), … … 988 1039 $prio3 = $this->get_addl_pages_only(); 989 1040 $prio = array_merge( $child, $prio, $prio2, $prio3 ); 990 return $this->build_sitemap( $prio, $comment ); 1041 if ( is_array( $this->extra_sitemaps ) ) 1042 foreach( $this->extra_sitemaps as $sitemap_type ) { 1043 $sitemap_data = Array(); 1044 $sitemap_data = apply_filters( $this->prefix . 'custom_' . $sitemap_type, $sitemap_data, $page, $this_options ); 1045 $prio = array_merge( $prio, $sitemap_data ); 1046 } 1047 return $prio; 1048 } 1049 1050 /** Build a single, stand-alone sitemap without indexes. **/ 1051 function do_simple_sitemap( $comment = '' ) { 1052 $sitemap_data = $this->get_simple_sitemap(); 1053 $sitemap_data = apply_filters( $this->prefix . 'data', $sitemap_data, 'root', 0, $this->options ); 1054 return $this->build_sitemap( $sitemap_data, $comment ); 991 1055 } 992 1056 … … 1001 1065 $current_host = $_SERVER['HTTP_HOST']; 1002 1066 if ( empty( $current_host ) ) $current_host = $_SERVER['SERVER_NAME']; 1067 1003 1068 if ( !empty( $current_host ) && ( $current_host != $plugin_url['host'] ) ) { 1004 1069 $plugin_url['host'] = $current_host; … … 1102 1167 $prio = Array(); 1103 1168 if (is_array( $terms ) ) { 1104 $ f = $this->get_default_frequency( 'taxonomies' );1105 $ p = $this->get_default_priority( 'taxonomies' );1169 $y( 'taxonomies' ); 1170 $y( 'taxonomies' ); 1106 1171 foreach ($terms as $term) { 1107 $url = $this->get_term_link( $term, $term->taxonomy ); 1108 $prio[] = Array( 1109 'loc' => $url, 1110 'changefreq' => $f, 1111 'priority' => $p 1112 ); 1172 $pr_info = Array(); 1173 $pr_info['loc'] = $this->get_term_link( $term, $term->taxonomy ); 1174 if ( ( $this->options[ $this->prefix . 'prio_taxonomies' ] == 'sel' ) && ( isset( $this->options[ $this->prefix . 'prio_taxonomies_' . $term->taxonomy ] ) ) ) { 1175 $pr_info['priority'] = $this->options[ $this->prefix . 'prio_taxonomies_' . $term->taxonomy ]; 1176 } else $pr_info['priority'] = $def_prio; 1177 if ( ( $this->options[ $this->prefix . 'freq_taxonomies' ] == 'sel' ) && ( isset( $this->options[ $this->prefix . 'freq_taxonomies_' . $term->taxonomy ] ) ) ) { 1178 $pr_info['changefreq'] = $this->options[ $this->prefix . 'freq_taxonomies_' . $term->taxonomy ]; 1179 } else $pr_info['changefreq'] = $def_freq; 1180 $prio[] = $pr_info; 1113 1181 } 1114 1182 } … … 1394 1462 if ( $freq_override ) 1395 1463 $pr_info[ 'changefreq' ] = $freq_override; 1464 1465 1466 1467 1468 1469 1396 1470 $pr_info['loc'] = $url; 1397 1471 $pr_info = apply_filters( $this->prefix . 'prio_item_filter', $pr_info, $post, $args ); … … 1619 1693 $ex_args['meta_compare'] = '='; 1620 1694 $ex_args['fields'] = 'ids'; 1695 1621 1696 $q = new WP_Query( $ex_args ); 1622 1697 if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] ); -
all-in-one-seo-pack/trunk/all_in_one_seo_pack.php
r895274 r924101 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. 56 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. 533 * @version 2.1. 34 34 */ 35 35 36 36 if ( ! defined( 'AIOSEOP_VERSION' ) ) 37 define( 'AIOSEOP_VERSION', '2.1. 5' );37 define( 'AIOSEOP_VERSION', '2.1.' ); 38 38 39 39 if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) { -
all-in-one-seo-pack/trunk/quickedit_functions.js
r785578 r924101 1 function aioseop_ajax_edit_meta_form( post_id, post_title,meta ) {1 function aioseop_ajax_edit_meta_form( post_id, meta ) { 2 2 var uform = jQuery('#aioseop_'+meta+'_' + post_id); 3 3 4 var element = uform.html(); var input; 4 5 input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:10px;width:65%;float:left" rows=2 cols=16>' + post_title + '</textarea>'; -
all-in-one-seo-pack/trunk/readme.txt
r895274 r924101 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.9 6 Tested up to: 3.9 7 7 Stable tag: trunk 8 8
Note: See TracChangeset
for help on using the changeset viewer.