Version Description
Download this release
Release Info
Developer | pbaylies |
Plugin | All in One SEO Pack |
Version | 2.1.5.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.6 to 2.1.5.1
- aioseop_class.php +22 -72
- aioseop_functions.php +1 -19
- aioseop_module_class.php +6 -22
- aioseop_module_old.js +240 -0
- aioseop_opengraph.php +3 -20
- aioseop_sitemap.php +96 -171
- all_in_one_seo_pack.php +3 -3
- readme.txt +1 -1
aioseop_class.php
CHANGED
@@ -173,7 +173,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
173 |
"ga_use_universal_analytics" => __( "Use the new Universal Analytics tracking code for Google Analytics; do this for new analytics accounts.", 'all_in_one_seo_pack' ),
|
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 |
"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 |
-
"ga_anonymize_ip" => __( "Support for IP Anonymization in Google Analytics.", 'all_in_one_seo_pack' ),
|
177 |
"ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking.", 'all_in_one_seo_pack' ),
|
178 |
"ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ),
|
179 |
"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' ),
|
@@ -397,10 +396,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
397 |
'name' => __( 'Track Multiple Domains:', 'all_in_one_seo_pack' ),
|
398 |
'default' => 0,
|
399 |
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
400 |
-
"ga_anonymize_ip"=> Array(
|
401 |
-
'name' => __( 'Anonymize IP Addresses:', 'all_in_one_seo_pack' ),
|
402 |
-
'type' => 'checkbox',
|
403 |
-
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
404 |
"ga_display_advertising"=> Array(
|
405 |
'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ),
|
406 |
'type' => 'checkbox',
|
@@ -492,7 +487,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
492 |
});
|
493 |
});
|
494 |
</script>
|
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>' ),
|
496 |
'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ),
|
497 |
'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ),
|
498 |
'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all_in_one_seo_pack' ), 'type' => 'text' ),
|
@@ -557,7 +552,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
557 |
'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
|
558 |
'help_link' => 'http://semperplugins.com/documentation/google-settings/',
|
559 |
'options' => Array( "google_publisher", "google_disable_profile", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher",
|
560 |
-
"google_connect", "google_analytics_id", "ga_use_universal_analytics", "ga_domain", "ga_multi_domain", "
|
561 |
),
|
562 |
'noindex' => Array(
|
563 |
'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
|
@@ -599,7 +594,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
599 |
$wp_query->is_attachment = true;
|
600 |
else
|
601 |
$wp_query->is_single = true;
|
602 |
-
if ( empty( $wp_query->is_front_page ) ) $wp_query->is_front_page = false;
|
603 |
if ( get_option( 'show_on_front' ) == 'page' ) {
|
604 |
if ( is_page() && $post->ID == get_option( 'page_on_front' ) )
|
605 |
$wp_query->is_front_page = true;
|
@@ -612,48 +606,20 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
612 |
$args['options']['save'] = false;
|
613 |
$wp_query->queried_object = $post;
|
614 |
|
615 |
-
|
616 |
-
|
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 |
-
}
|
625 |
|
626 |
if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) )
|
627 |
$url = apply_filters( 'aioseop_canonical_url', $url );
|
628 |
if ( !$url ) $url = get_permalink();
|
629 |
|
630 |
-
$title = $this->apply_cf_fields( $title );
|
631 |
-
|
632 |
$description = $this->get_aioseop_description( $post );
|
633 |
-
$description =
|
634 |
-
$description = apply_filters( 'aioseop_description', $description );
|
635 |
|
636 |
if ( $this->strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
|
637 |
if ( $this->strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
|
638 |
|
639 |
-
|
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 ) ) );
|
657 |
$buf = $this->get_option_row( $args['name'], $args['options'], $args );
|
658 |
|
659 |
wp_reset_postdata();
|
@@ -1291,7 +1257,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1291 |
}
|
1292 |
$meta_string .= sprintf( "<meta name=\"description\" content=\"%s\" />\n", $description );
|
1293 |
}
|
1294 |
-
|
1295 |
$keywords = apply_filters( 'aioseop_keywords', $keywords );
|
1296 |
|
1297 |
if ( isset( $aioseop_options['aiosp_togglekeywords'] ) )
|
@@ -1348,7 +1314,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1348 |
|
1349 |
foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
|
1350 |
if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) )
|
1351 |
-
$$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] )
|
1352 |
else
|
1353 |
$$meta = '';
|
1354 |
}
|
@@ -1670,6 +1636,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1670 |
|
1671 |
function oauth_connect( $count = 0 ) {
|
1672 |
global $aiosp_activation;
|
|
|
1673 |
if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
|
1674 |
$callback_url = NULL;
|
1675 |
$consumer_key = "anonymous";
|
@@ -1740,13 +1707,9 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1740 |
if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
|
1741 |
$allow_linker = "'allowLinker': true";
|
1742 |
}
|
1743 |
-
$
|
1744 |
if (!empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
|
1745 |
-
$
|
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);";
|
1750 |
}
|
1751 |
$js_options = Array();
|
1752 |
foreach( Array( 'cookie_domain', 'allow_linker' ) as $opts ) {
|
@@ -1765,7 +1728,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1765 |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
1766 |
|
1767 |
ga('create', '{$analytics_id}'{$js_options});
|
1768 |
-
{$
|
1769 |
ga('send', 'pageview');
|
1770 |
</script>
|
1771 |
|
@@ -1797,11 +1760,6 @@ function aiosp_google_analytics() {
|
|
1797 |
_gaq.push(['_setAccount', '<?php
|
1798 |
echo $aioseop_options['aiosp_google_analytics_id'];
|
1799 |
?>']);
|
1800 |
-
<?php if ( !empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
|
1801 |
-
?> _gaq.push(['_gat._anonymizeIp']);
|
1802 |
-
<?php
|
1803 |
-
}
|
1804 |
-
?>
|
1805 |
<?php if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
|
1806 |
?> _gaq.push(['_setAllowLinker', true]);
|
1807 |
<?php
|
@@ -1865,25 +1823,19 @@ function aiosp_google_analytics() {
|
|
1865 |
}
|
1866 |
}
|
1867 |
}
|
1868 |
-
|
1869 |
-
function aiosp_addEvent(element, evnt, funct){
|
1870 |
-
if (element.attachEvent)
|
1871 |
-
return element.attachEvent('on'+evnt, funct);
|
1872 |
-
else
|
1873 |
-
return element.addEventListener(evnt, funct, false);
|
1874 |
-
}
|
1875 |
|
1876 |
aiosp_addLoadEvent(function () {
|
1877 |
var links = document.getElementsByTagName('a');
|
1878 |
for (var x=0; x < links.length; x++) {
|
1879 |
if (typeof links[x] == 'undefined') continue;
|
1880 |
-
|
|
|
1881 |
var mydomain = new RegExp(document.domain, 'i');
|
1882 |
href = getAttr(this, 'href');
|
1883 |
-
if
|
1884 |
recordOutboundLink(this, 'Outbound Links', href);
|
1885 |
}
|
1886 |
-
}
|
1887 |
}
|
1888 |
});
|
1889 |
</script>
|
@@ -2036,14 +1988,14 @@ function aiosp_google_analytics() {
|
|
2036 |
$description = $this->get_post_description( $blog_page );
|
2037 |
if ( empty( $description ) && is_object( $post ) && !is_archive() && empty( $blog_page ) )
|
2038 |
$description = $this->get_post_description( $post );
|
2039 |
-
$description = $this->apply_cf_fields( $description );
|
2040 |
return $description;
|
2041 |
}
|
2042 |
|
2043 |
function replace_title( $content, $title ) {
|
2044 |
$title = trim( strip_tags( $title ) );
|
2045 |
-
$title_tag_start = "<title";
|
2046 |
-
$title_tag_end = "</title";
|
|
|
2047 |
$title = stripslashes( trim( $title ) );
|
2048 |
$start = $this->strpos( $content, $title_tag_start );
|
2049 |
$end = $this->strpos( $content, $title_tag_end );
|
@@ -2052,7 +2004,7 @@ function aiosp_google_analytics() {
|
|
2052 |
$this->title_end = $end;
|
2053 |
$this->orig_title = $title;
|
2054 |
|
2055 |
-
return preg_replace( '/<title(
|
2056 |
}
|
2057 |
|
2058 |
function internationalize( $in ) {
|
@@ -2227,7 +2179,7 @@ function aiosp_google_analytics() {
|
|
2227 |
$title = $this->internationalize( $post->post_title );
|
2228 |
if ( !$title )
|
2229 |
$title = $this->internationalize( $this->get_original_title( '', false ) );
|
2230 |
-
$title = get_the_title( $post->post_parent ) . ' ' . $title . '
|
2231 |
apply_filters( 'aioseop_attachment_title', $title );
|
2232 |
} else if ( is_page() || $this->is_static_posts_page() || ( is_home() && !$this->is_static_posts_page() ) ) {
|
2233 |
if ( $post === null ) return false;
|
@@ -2380,10 +2332,8 @@ function aiosp_google_analytics() {
|
|
2380 |
global $aioseop_options;
|
2381 |
$title = false;
|
2382 |
$post = $this->get_queried_object();
|
2383 |
-
if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) )
|
2384 |
$title = $this->get_aioseop_title( $post );
|
2385 |
-
$title = $this->apply_cf_fields( $title );
|
2386 |
-
}
|
2387 |
if ( $title === false )
|
2388 |
$title = $this->get_original_title();
|
2389 |
return apply_filters( 'aioseop_title', $title );
|
173 |
"ga_use_universal_analytics" => __( "Use the new Universal Analytics tracking code for Google Analytics; do this for new analytics accounts.", 'all_in_one_seo_pack' ),
|
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 |
"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 |
"ga_display_advertising"=> __( "Support for Doubleclick Display Advertising tracking.", 'all_in_one_seo_pack' ),
|
177 |
"ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ),
|
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' ),
|
396 |
'name' => __( 'Track Multiple Domains:', 'all_in_one_seo_pack' ),
|
397 |
'default' => 0,
|
398 |
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
|
|
|
|
|
|
|
|
399 |
"ga_display_advertising"=> Array(
|
400 |
'name' => __( '"Display Advertising" Tracking:', 'all_in_one_seo_pack' ),
|
401 |
'type' => 'checkbox',
|
487 |
});
|
488 |
});
|
489 |
</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>' ),
|
491 |
'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ),
|
492 |
'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ),
|
493 |
'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all_in_one_seo_pack' ), 'type' => 'text' ),
|
552 |
'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
|
553 |
'help_link' => 'http://semperplugins.com/documentation/google-settings/',
|
554 |
'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" )
|
556 |
),
|
557 |
'noindex' => Array(
|
558 |
'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
|
594 |
$wp_query->is_attachment = true;
|
595 |
else
|
596 |
$wp_query->is_single = true;
|
|
|
597 |
if ( get_option( 'show_on_front' ) == 'page' ) {
|
598 |
if ( is_page() && $post->ID == get_option( 'page_on_front' ) )
|
599 |
$wp_query->is_front_page = true;
|
606 |
$args['options']['save'] = false;
|
607 |
$wp_query->queried_object = $post;
|
608 |
|
609 |
+
$title = $this->wp_title();
|
610 |
+
if ( empty( $title ) ) $title = $post->post_title;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
611 |
|
612 |
if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) )
|
613 |
$url = apply_filters( 'aioseop_canonical_url', $url );
|
614 |
if ( !$url ) $url = get_permalink();
|
615 |
|
|
|
|
|
616 |
$description = $this->get_aioseop_description( $post );
|
617 |
+
$description = apply_filters( 'aioseop_description', $description );
|
|
|
618 |
|
619 |
if ( $this->strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
|
620 |
if ( $this->strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
|
621 |
|
622 |
+
$args['value'] = sprintf( $args['value'], esc_attr( strip_tags( $title ) ), esc_url( $url ), esc_attr( strip_tags( $description ) ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
$buf = $this->get_option_row( $args['name'], $args['options'], $args );
|
624 |
|
625 |
wp_reset_postdata();
|
1257 |
}
|
1258 |
$meta_string .= sprintf( "<meta name=\"description\" content=\"%s\" />\n", $description );
|
1259 |
}
|
1260 |
+
|
1261 |
$keywords = apply_filters( 'aioseop_keywords', $keywords );
|
1262 |
|
1263 |
if ( isset( $aioseop_options['aiosp_togglekeywords'] ) )
|
1314 |
|
1315 |
foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
|
1316 |
if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) )
|
1317 |
+
$$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ) );
|
1318 |
else
|
1319 |
$$meta = '';
|
1320 |
}
|
1636 |
|
1637 |
function oauth_connect( $count = 0 ) {
|
1638 |
global $aiosp_activation;
|
1639 |
+
$url = '';
|
1640 |
if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
|
1641 |
$callback_url = NULL;
|
1642 |
$consumer_key = "anonymous";
|
1707 |
if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
|
1708 |
$allow_linker = "'allowLinker': true";
|
1709 |
}
|
1710 |
+
$display_advertising = '';
|
1711 |
if (!empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
|
1712 |
+
$display_advertising = "ga('require', 'displayfeatures');";
|
|
|
|
|
|
|
|
|
1713 |
}
|
1714 |
$js_options = Array();
|
1715 |
foreach( Array( 'cookie_domain', 'allow_linker' ) as $opts ) {
|
1728 |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
1729 |
|
1730 |
ga('create', '{$analytics_id}'{$js_options});
|
1731 |
+
{$display_advertising}
|
1732 |
ga('send', 'pageview');
|
1733 |
</script>
|
1734 |
|
1760 |
_gaq.push(['_setAccount', '<?php
|
1761 |
echo $aioseop_options['aiosp_google_analytics_id'];
|
1762 |
?>']);
|
|
|
|
|
|
|
|
|
|
|
1763 |
<?php if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
|
1764 |
?> _gaq.push(['_setAllowLinker', true]);
|
1765 |
<?php
|
1823 |
}
|
1824 |
}
|
1825 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1826 |
|
1827 |
aiosp_addLoadEvent(function () {
|
1828 |
var links = document.getElementsByTagName('a');
|
1829 |
for (var x=0; x < links.length; x++) {
|
1830 |
if (typeof links[x] == 'undefined') continue;
|
1831 |
+
if (typeof links[x].onclick != 'undefined') continue;
|
1832 |
+
links[x].onclick = function () {
|
1833 |
var mydomain = new RegExp(document.domain, 'i');
|
1834 |
href = getAttr(this, 'href');
|
1835 |
+
if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
|
1836 |
recordOutboundLink(this, 'Outbound Links', href);
|
1837 |
}
|
1838 |
+
}
|
1839 |
}
|
1840 |
});
|
1841 |
</script>
|
1988 |
$description = $this->get_post_description( $blog_page );
|
1989 |
if ( empty( $description ) && is_object( $post ) && !is_archive() && empty( $blog_page ) )
|
1990 |
$description = $this->get_post_description( $post );
|
|
|
1991 |
return $description;
|
1992 |
}
|
1993 |
|
1994 |
function replace_title( $content, $title ) {
|
1995 |
$title = trim( strip_tags( $title ) );
|
1996 |
+
$title_tag_start = "<title>";
|
1997 |
+
$title_tag_end = "</title>";
|
1998 |
+
$len_start = $this->strlen( $title_tag_start );
|
1999 |
$title = stripslashes( trim( $title ) );
|
2000 |
$start = $this->strpos( $content, $title_tag_start );
|
2001 |
$end = $this->strpos( $content, $title_tag_end );
|
2004 |
$this->title_end = $end;
|
2005 |
$this->orig_title = $title;
|
2006 |
|
2007 |
+
return preg_replace( '/<title>(.*?)<\/title>/is', '<title>' . preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . '</title>', $content, 1 );
|
2008 |
}
|
2009 |
|
2010 |
function internationalize( $in ) {
|
2179 |
$title = $this->internationalize( $post->post_title );
|
2180 |
if ( !$title )
|
2181 |
$title = $this->internationalize( $this->get_original_title( '', false ) );
|
2182 |
+
$title = get_the_title( $post->post_parent ) . ' ' . $title . ' – ' . get_option( 'blogname' );
|
2183 |
apply_filters( 'aioseop_attachment_title', $title );
|
2184 |
} else if ( is_page() || $this->is_static_posts_page() || ( is_home() && !$this->is_static_posts_page() ) ) {
|
2185 |
if ( $post === null ) return false;
|
2332 |
global $aioseop_options;
|
2333 |
$title = false;
|
2334 |
$post = $this->get_queried_object();
|
2335 |
+
if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) )
|
2336 |
$title = $this->get_aioseop_title( $post );
|
|
|
|
|
2337 |
if ( $title === false )
|
2338 |
$title = $this->get_original_title();
|
2339 |
return apply_filters( 'aioseop_title', $title );
|
aioseop_functions.php
CHANGED
@@ -586,24 +586,6 @@ if ( !function_exists( 'aioseop_add_contactmethods' ) ) {
|
|
586 |
}
|
587 |
}
|
588 |
|
589 |
-
/***
|
590 |
-
* Utility function for inserting elements into associative arrays by key
|
591 |
-
*/
|
592 |
-
if ( !function_exists( 'aioseop_array_insert_after' ) ) {
|
593 |
-
function aioseop_array_insert_after( $arr, $insertKey, $newValues ) {
|
594 |
-
$keys = array_keys($arr);
|
595 |
-
$vals = array_values($arr);
|
596 |
-
$insertAfter = array_search($insertKey, $keys) + 1;
|
597 |
-
$keys2 = array_splice($keys, $insertAfter);
|
598 |
-
$vals2 = array_splice($vals, $insertAfter);
|
599 |
-
foreach( $newValues as $k => $v ) {
|
600 |
-
$keys[] = $k;
|
601 |
-
$vals[] = $v;
|
602 |
-
}
|
603 |
-
return array_merge(array_combine($keys, $vals), array_combine($keys2, $vals2));
|
604 |
-
}
|
605 |
-
}
|
606 |
-
|
607 |
/***
|
608 |
* JSON support for PHP < 5.2
|
609 |
*/
|
@@ -662,4 +644,4 @@ if ( !function_exists( 'parse_ini_string' ) ) {
|
|
662 |
parse_ini_filter::$buf = $string;
|
663 |
return parse_ini_file( "php://filter/read=parse_ini/resource=php://memory", $process_sections );
|
664 |
}
|
665 |
-
}
|
586 |
}
|
587 |
}
|
588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
/***
|
590 |
* JSON support for PHP < 5.2
|
591 |
*/
|
644 |
parse_ini_filter::$buf = $string;
|
645 |
return parse_ini_file( "php://filter/read=parse_ini/resource=php://memory", $process_sections );
|
646 |
}
|
647 |
+
}
|
aioseop_module_class.php
CHANGED
@@ -288,27 +288,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
288 |
return $output;
|
289 |
}
|
290 |
|
291 |
-
/*** adds support for using %cf_(name of field)% for using custom fields / Advanced Custom Fields in titles / descriptions etc. ***/
|
292 |
-
function apply_cf_fields( $format ) {
|
293 |
-
return preg_replace_callback( '/%cf_([^%]*?)%/', Array( $this, 'cf_field_replace' ), $format );
|
294 |
-
}
|
295 |
-
|
296 |
-
function cf_field_replace( $matches ) {
|
297 |
-
$result = '';
|
298 |
-
if ( !empty( $matches ) ) {
|
299 |
-
if ( !empty( $matches[1] ) ) {
|
300 |
-
if ( function_exists( 'get_field' ) ) $result = get_field( $matches[1] );
|
301 |
-
if ( empty( $result ) ) {
|
302 |
-
global $post;
|
303 |
-
if ( !empty( $post ) ) $result = get_post_meta( $post->ID, $matches[1], true );
|
304 |
-
}
|
305 |
-
if ( empty( $result ) ) $result = $matches[0];
|
306 |
-
} else $result = $matches[0];
|
307 |
-
}
|
308 |
-
$result = strip_tags( $result );
|
309 |
-
return $result;
|
310 |
-
}
|
311 |
-
|
312 |
/**
|
313 |
* Returns child blogs of parent in a multisite.
|
314 |
*/
|
@@ -746,7 +725,12 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
746 |
wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
|
747 |
$this->script_data['pointers'] = $this->pointers;
|
748 |
}
|
749 |
-
|
|
|
|
|
|
|
|
|
|
|
750 |
if ( !empty( $this->script_data ) ) {
|
751 |
$data = Array( 'json' => json_encode( $this->script_data ) );
|
752 |
wp_localize_script( 'aioseop-module-script', 'aioseop_data', $data );
|
288 |
return $output;
|
289 |
}
|
290 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
/**
|
292 |
* Returns child blogs of parent in a multisite.
|
293 |
*/
|
725 |
wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
|
726 |
$this->script_data['pointers'] = $this->pointers;
|
727 |
}
|
728 |
+
global $wp_version;
|
729 |
+
if ( version_compare( $wp_version, '3.3', '>=' ) ) {
|
730 |
+
wp_enqueue_script( 'aioseop-module-script', $this->plugin_path['url'] . 'aioseop_module.js' );
|
731 |
+
} else {
|
732 |
+
wp_enqueue_script( 'aioseop-module-script', $this->plugin_path['url'] . 'aioseop_module_old.js' );
|
733 |
+
}
|
734 |
if ( !empty( $this->script_data ) ) {
|
735 |
$data = Array( 'json' => json_encode( $this->script_data ) );
|
736 |
wp_localize_script( 'aioseop-module-script', 'aioseop_data', $data );
|
aioseop_module_old.js
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
if ( typeof aioseop_data != 'undefined' ) {
|
2 |
+
aioseop_data = aioseop_data.json.replace(/"/g, '"');
|
3 |
+
try {
|
4 |
+
aioseop_data = jQuery.parseJSON( aioseop_data );
|
5 |
+
} catch(e) {
|
6 |
+
aioseop_data = {};
|
7 |
+
}
|
8 |
+
}
|
9 |
+
|
10 |
+
function toggleVisibility(id) {
|
11 |
+
var e = document.getElementById(id);
|
12 |
+
if (e.style.display == 'block')
|
13 |
+
e.style.display = 'none';
|
14 |
+
else
|
15 |
+
e.style.display = 'block';
|
16 |
+
}
|
17 |
+
|
18 |
+
function countChars(field,cntfield) {
|
19 |
+
cntfield.value = field.value.length;
|
20 |
+
}
|
21 |
+
|
22 |
+
function aioseop_get_field_value( field ) {
|
23 |
+
cur = jQuery('[name=' + field + ']');
|
24 |
+
if ( cur.length == 0 ) return field;
|
25 |
+
type = cur.attr('type');
|
26 |
+
if ( type == "checkbox" || type == "radio" )
|
27 |
+
cur = jQuery('input[name=' + field + ']:checked');
|
28 |
+
return cur.val();
|
29 |
+
}
|
30 |
+
|
31 |
+
function aioseop_eval_condshow_logic( statement ) {
|
32 |
+
var lhs, rhs;
|
33 |
+
if ( ( typeof statement ) == 'object' ) {
|
34 |
+
lhs = statement['lhs'];
|
35 |
+
rhs = statement['rhs'];
|
36 |
+
if ( lhs !== null && ( ( typeof lhs ) == 'object' ) )
|
37 |
+
lhs = aioseop_eval_condshow_logic( statement['lhs'] );
|
38 |
+
if ( rhs !== null && ( typeof rhs ) == 'object' )
|
39 |
+
rhs = aioseop_eval_condshow_logic( statement['rhs'] );
|
40 |
+
lhs = aioseop_get_field_value( lhs );
|
41 |
+
rhs = aioseop_get_field_value( rhs );
|
42 |
+
switch ( statement['op'] ) {
|
43 |
+
case 'NOT': return ( ! lhs );
|
44 |
+
case 'AND': return ( lhs && rhs );
|
45 |
+
case 'OR' : return ( lhs || rhs );
|
46 |
+
case '==' : return ( lhs == rhs );
|
47 |
+
case '!=' : return ( lhs != rhs );
|
48 |
+
default : return null;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
return statement;
|
52 |
+
}
|
53 |
+
|
54 |
+
function aioseop_do_condshow_match( index, value ) {
|
55 |
+
if ( typeof value != 'undefined' ) {
|
56 |
+
matches = true;
|
57 |
+
jQuery.each(value, function(subopt, setting) {
|
58 |
+
var statement;
|
59 |
+
if ( ( typeof setting ) == 'object' ) {
|
60 |
+
statement = aioseop_eval_condshow_logic( setting );
|
61 |
+
if ( !statement ) {
|
62 |
+
matches = false;
|
63 |
+
}
|
64 |
+
} else {
|
65 |
+
cur = aioseop_get_field_value( subopt );
|
66 |
+
if ( cur != setting ) {
|
67 |
+
matches = false;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
});
|
71 |
+
if ( matches ) {
|
72 |
+
jQuery('#' + index + '_wrapper' ).show();
|
73 |
+
} else {
|
74 |
+
jQuery('#' + index + '_wrapper' ).hide();
|
75 |
+
}
|
76 |
+
return matches;
|
77 |
+
}
|
78 |
+
return false;
|
79 |
+
}
|
80 |
+
|
81 |
+
function aioseop_add_condshow_handlers( index, value ) {
|
82 |
+
if ( typeof value != 'undefined' ) {
|
83 |
+
jQuery.each(value, function(subopt, setting) {
|
84 |
+
jQuery('[name=' + subopt + ']').bind( "change keyup", function() {
|
85 |
+
aioseop_do_condshow_match( index, value );
|
86 |
+
});
|
87 |
+
});
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
function aioseop_do_condshow( condshow ) {
|
92 |
+
if ( typeof aioseop_data.condshow != 'undefined' ) {
|
93 |
+
jQuery.each(aioseop_data.condshow, function(index, value) {
|
94 |
+
aioseop_do_condshow_match( index, value );
|
95 |
+
aioseop_add_condshow_handlers( index, value );
|
96 |
+
});
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
function aioseop_show_pointer( handle, value ) {
|
101 |
+
if ( typeof( jQuery( value.pointer_target ).pointer) != 'undefined' ) {
|
102 |
+
jQuery(value.pointer_target).pointer({
|
103 |
+
content : value.pointer_text,
|
104 |
+
close : function() {
|
105 |
+
jQuery.post( ajaxurl, {
|
106 |
+
pointer: handle,
|
107 |
+
action: 'dismiss-wp-pointer'
|
108 |
+
});
|
109 |
+
}
|
110 |
+
}).pointer('open');
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
jQuery(document).ready(function(){
|
115 |
+
if (typeof aioseop_data != 'undefined') {
|
116 |
+
if ( typeof aioseop_data.condshow != 'undefined' ) {
|
117 |
+
aioseop_do_condshow( aioseop_data.condshow );
|
118 |
+
}
|
119 |
+
}
|
120 |
+
});
|
121 |
+
|
122 |
+
jQuery(document).ready(function() {
|
123 |
+
var image_field;
|
124 |
+
jQuery('.aioseop_upload_image_button').click(function() {
|
125 |
+
window.send_to_editor = aioseopNewSendToEditor;
|
126 |
+
image_field = jQuery(this).next();
|
127 |
+
formfield = image_field.attr('name');
|
128 |
+
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
|
129 |
+
return false;
|
130 |
+
});
|
131 |
+
aioseopStoreSendToEditor = window.send_to_editor;
|
132 |
+
aioseopNewSendToEditor = function(html) {
|
133 |
+
imgurl = jQuery('img',html).attr('src');
|
134 |
+
if ( typeof(imgurl) !== undefined )
|
135 |
+
image_field.val(imgurl);
|
136 |
+
tb_remove();
|
137 |
+
window.send_to_editor = aioseopStoreSendToEditor;
|
138 |
+
};
|
139 |
+
});
|
140 |
+
|
141 |
+
// props to commentluv for this fix
|
142 |
+
// workaround for bug that causes radio inputs to lose settings when meta box is dragged.
|
143 |
+
// http://core.trac.wordpress.org/ticket/16972
|
144 |
+
jQuery(document).ready(function(){
|
145 |
+
// listen for drag drop of metaboxes , bind mousedown to .hndle so it only fires when starting to drag
|
146 |
+
jQuery('.hndle').mousedown(function(){
|
147 |
+
// set live event listener for mouse up on the content .wrap and wait a tick to give the dragged div time to settle before firing the reclick function
|
148 |
+
jQuery('.wrap').mouseup(function(){store_radio(); setTimeout('reclick_radio();',50);});
|
149 |
+
})
|
150 |
+
});
|
151 |
+
/**
|
152 |
+
* stores object of all radio buttons that are checked for entire form
|
153 |
+
*/
|
154 |
+
if(typeof store_radio != 'function') {
|
155 |
+
function store_radio(){
|
156 |
+
var radioshack = {};
|
157 |
+
jQuery('input[type="radio"]').each(function(){
|
158 |
+
if(jQuery(this).is(':checked')){
|
159 |
+
radioshack[jQuery(this).attr('name')] = jQuery(this).val();
|
160 |
+
}
|
161 |
+
jQuery(document).data('radioshack',radioshack);
|
162 |
+
});
|
163 |
+
}
|
164 |
+
}
|
165 |
+
/**
|
166 |
+
* detect mouseup and restore all radio buttons that were checked
|
167 |
+
*/
|
168 |
+
if(typeof reclick_radio != 'function') {
|
169 |
+
function reclick_radio(){
|
170 |
+
// get object of checked radio button names and values
|
171 |
+
var radios = jQuery(document).data('radioshack');
|
172 |
+
//step thru each object element and trigger a click on it's corresponding radio button
|
173 |
+
for(key in radios){
|
174 |
+
jQuery('input[name="'+key+'"]').filter('[value="'+radios[key]+'"]').trigger('click');
|
175 |
+
}
|
176 |
+
// unbind the event listener on .wrap (prevents clicks on inputs from triggering function)
|
177 |
+
jQuery('.wrap').unbind('mouseup');
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
function aioseop_handle_post_url( action, settings, options) {
|
182 |
+
jQuery("div#aiosp_"+settings).fadeOut('fast', function() {
|
183 |
+
var loading = '<label class="aioseop_loading aioseop_'+settings+'_loading"></label> Please wait...';
|
184 |
+
jQuery("div#aiosp_"+settings).fadeIn('fast', function() {
|
185 |
+
var aioseop_sack = new sack(ajaxurl);
|
186 |
+
aioseop_sack.execute = 1;
|
187 |
+
aioseop_sack.method = 'POST';
|
188 |
+
aioseop_sack.setVar( "action", action );
|
189 |
+
aioseop_sack.setVar( "settings", settings );
|
190 |
+
aioseop_sack.setVar( "options", options );
|
191 |
+
aioseop_sack.setVar( "nonce-aioseop", jQuery('input[name="nonce-aioseop"]').val() );
|
192 |
+
aioseop_sack.onError = function() {alert('Ajax error on saving.'); };
|
193 |
+
aioseop_sack.runAJAX();
|
194 |
+
});
|
195 |
+
jQuery("div#aiosp_"+settings).html(loading);
|
196 |
+
})
|
197 |
+
};
|
198 |
+
|
199 |
+
function aioseop_is_overflowed(element) {
|
200 |
+
return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
|
201 |
+
}
|
202 |
+
|
203 |
+
function aioseop_overflow_border( el ) {
|
204 |
+
if ( aioseop_is_overflowed(el) ) {
|
205 |
+
el.className = 'aioseop_option_div aioseop_overflowed';
|
206 |
+
} else {
|
207 |
+
el.className = 'aioseop_option_div';
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
jQuery(document).ready(function() {
|
212 |
+
if ( typeof aioseop_data.pointers != 'undefined' ) {
|
213 |
+
jQuery.each(aioseop_data.pointers, function(index, value) {
|
214 |
+
if ( value != 'undefined' && value.pointer_text != '' ) {
|
215 |
+
aioseop_show_pointer( index, value );
|
216 |
+
}
|
217 |
+
});
|
218 |
+
}
|
219 |
+
var selectors = "div.aioseop_multicheckbox_type div.aioseop_option_div, #aiosp_performance_status div.aioseop_option_div";
|
220 |
+
jQuery(selectors).each(function() {
|
221 |
+
aioseop_overflow_border(this);
|
222 |
+
});
|
223 |
+
var resizeTimer;
|
224 |
+
jQuery(window).resize(function() {
|
225 |
+
clearTimeout(resizeTimer);
|
226 |
+
resizeTimer = setTimeout(jQuery(selectors).each(function() {
|
227 |
+
aioseop_overflow_border(this);
|
228 |
+
}), 250);
|
229 |
+
});
|
230 |
+
jQuery(".aioseop_tab:not(:first)").hide();
|
231 |
+
jQuery(".aioseop_tab:first").show();
|
232 |
+
jQuery("a.aioseop_header_tab").click(function(){
|
233 |
+
var stringref = jQuery(this).attr("href").split('#')[1];
|
234 |
+
jQuery('.aioseop_tab:not(#'+stringref+')').hide('slow');
|
235 |
+
jQuery('.aioseop_tab#' + stringref).show('slow');
|
236 |
+
jQuery('.aioseop_header_tab[href!=#'+stringref+']').removeClass('active');
|
237 |
+
jQuery('.aioseop_header_tab[href=#' + stringref+']').addClass('active');
|
238 |
+
return false;
|
239 |
+
});
|
240 |
+
});
|
aioseop_opengraph.php
CHANGED
@@ -90,8 +90,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
90 |
"customimg" => __( "This option lets you upload an image to use as the Open Graph image for 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' ),
|
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 |
"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 |
-
"defcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
94 |
-
"setcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
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' ),
|
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' ),
|
97 |
"desc" => __( "This is the Open Graph description of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
@@ -125,10 +123,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
125 |
'type' => 'text', 'default' => '' ),
|
126 |
'imageheight' => Array( 'name' => __( 'Specify Image Height', 'all_in_one_seo_pack' ),
|
127 |
'type' => 'text', 'default' => '' ),
|
128 |
-
'defcard' => Array( 'name' => __( 'Default Twitter Card', 'all_in_one_seo_pack' ),
|
129 |
-
'type' => 'select', 'initial_options' => Array( 'summary' => __( 'Summary', 'all_in_one_seo_pack' ), 'summary_large_image' => __( 'Summary Large Image', 'all_in_one_seo_pack' ), 'photo' => __( 'Photo', 'all_in_one_seo_pack' ) ), 'default' => 'summary' ),
|
130 |
-
'setcard' => Array( 'name' => __( 'Twitter Card Type', 'all_in_one_seo_pack' ),
|
131 |
-
'type' => 'select', 'initial_options' => Array( 'summary' => __( 'Summary', 'all_in_one_seo_pack' ), 'summary_large_image' => __( 'Summary Large Image', 'all_in_one_seo_pack' ), 'photo' => __( 'Photo', 'all_in_one_seo_pack' ) ) ),
|
132 |
'types' => Array( 'name' => __( 'Enable Facebook Meta for', 'all_in_one_seo_pack'),
|
133 |
'type' => 'multicheckbox', 'initial_options' => $this->get_post_type_titles( Array( '_builtin' => false ) ),
|
134 |
'default' => Array( 'post' => 'post', 'page' => 'page' ) ),
|
@@ -155,10 +149,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
155 |
|
156 |
$this->locations = array(
|
157 |
'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
|
158 |
-
'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'disable_jetpack', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', '
|
159 |
'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
|
160 |
'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
|
161 |
-
'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'category'
|
162 |
'display' => $display, 'prefix' => 'aioseop_opengraph_'
|
163 |
)
|
164 |
);
|
@@ -238,9 +232,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
238 |
if ( isset( $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ) ) {
|
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'] );
|
240 |
}
|
241 |
-
if ( isset( $this->options["aiosp_opengraph_defcard"] ) ) {
|
242 |
-
$settings[$prefix . 'setcard']['default'] = $this->options["aiosp_opengraph_defcard"];
|
243 |
-
}
|
244 |
}
|
245 |
if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] )
|
246 |
foreach ( $opts as $opt )
|
@@ -379,10 +370,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
379 |
if ( !empty( $description ) )
|
380 |
$description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 );
|
381 |
|
382 |
-
|
383 |
-
$description = $this->apply_cf_fields( $description );
|
384 |
-
|
385 |
-
/* Data Validation */
|
386 |
$title = strip_tags( esc_attr( $title ) );
|
387 |
$sitename = strip_tags( esc_attr( $sitename ) );
|
388 |
$description = strip_tags( esc_attr( $description ) );
|
@@ -430,11 +418,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
430 |
}
|
431 |
|
432 |
$card = 'summary';
|
433 |
-
if ( !empty( $this->options['aiosp_opengraph_defcard'] ) )
|
434 |
-
$card = $this->options['aiosp_opengraph_defcard'];
|
435 |
-
|
436 |
-
if ( !empty( $metabox['aioseop_opengraph_settings_setcard'] ) )
|
437 |
-
$card = $metabox['aioseop_opengraph_settings_setcard'];
|
438 |
|
439 |
/* OG only: */
|
440 |
$meta = Array(
|
90 |
"customimg" => __( "This option lets you upload an image to use as the Open Graph image for 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' ),
|
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 |
"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 |
"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 |
"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' ),
|
95 |
"desc" => __( "This is the Open Graph description of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
123 |
'type' => 'text', 'default' => '' ),
|
124 |
'imageheight' => Array( 'name' => __( 'Specify Image Height', 'all_in_one_seo_pack' ),
|
125 |
'type' => 'text', 'default' => '' ),
|
|
|
|
|
|
|
|
|
126 |
'types' => Array( 'name' => __( 'Enable Facebook Meta for', 'all_in_one_seo_pack'),
|
127 |
'type' => 'multicheckbox', 'initial_options' => $this->get_post_type_titles( Array( '_builtin' => false ) ),
|
128 |
'default' => Array( 'post' => 'post', 'page' => 'page' ) ),
|
149 |
|
150 |
$this->locations = array(
|
151 |
'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') ),
|
153 |
'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
|
154 |
'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
|
155 |
+
'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'category' ),
|
156 |
'display' => $display, 'prefix' => 'aioseop_opengraph_'
|
157 |
)
|
158 |
);
|
232 |
if ( isset( $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ) ) {
|
233 |
$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 |
}
|
|
|
|
|
|
|
235 |
}
|
236 |
if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] )
|
237 |
foreach ( $opts as $opt )
|
370 |
if ( !empty( $description ) )
|
371 |
$description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 );
|
372 |
|
373 |
+
/* Data Validation */
|
|
|
|
|
|
|
374 |
$title = strip_tags( esc_attr( $title ) );
|
375 |
$sitename = strip_tags( esc_attr( $sitename ) );
|
376 |
$description = strip_tags( esc_attr( $description ) );
|
418 |
}
|
419 |
|
420 |
$card = 'summary';
|
|
|
|
|
|
|
|
|
|
|
421 |
|
422 |
/* OG only: */
|
423 |
$meta = Array(
|
aioseop_sitemap.php
CHANGED
@@ -13,12 +13,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
13 |
var $start_memory_usage = 0;
|
14 |
var $max_posts = 50000;
|
15 |
var $paginate = false;
|
16 |
-
|
17 |
-
var $prio_sel;
|
18 |
-
var $freq;
|
19 |
-
var $freq_sel;
|
20 |
-
var $extra_sitemaps;
|
21 |
-
|
22 |
function All_in_One_SEO_Pack_Sitemap( ) {
|
23 |
if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
|
24 |
$this->name = __( 'XML Sitemap', 'all_in_one_seo_pack' ); // Human-readable name of the plugin
|
@@ -90,20 +85,16 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
90 |
)
|
91 |
);
|
92 |
|
93 |
-
$prio = Array();
|
|
|
94 |
for( $i = 0; $i <= 10; $i++ ) {
|
95 |
$str = sprintf( "%0.1f", $i / 10.0 );
|
96 |
$prio[ $str ] = $str;
|
97 |
}
|
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();
|
|
|
104 |
foreach ( Array( 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never' ) as $f ) $freq[ $f ] = $f;
|
105 |
-
$this->freq_sel = array_merge( $arr_no, $arr_sel, $freq );
|
106 |
-
$this->freq = array_merge( $arr_no, $freq );
|
107 |
|
108 |
foreach( Array( 'prio' => __( 'priority', 'all_in_one_seo_pack' ), 'freq' => __( 'frequency', 'all_in_one_seo_pack' ) ) as $k => $v ) {
|
109 |
$s = "{$k}_options";
|
@@ -114,13 +105,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
114 |
'archive' => __( 'archive pages', 'all_in_one_seo_pack' ),
|
115 |
'author' => __( 'author pages', 'all_in_one_seo_pack' ) ) as $opt => $val ) {
|
116 |
$arr = $$s;
|
117 |
-
|
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' );
|
124 |
if ( ( $opt == 'archive' ) || ( $opt == 'author' ) ) $arr[ $k . '_' . $opt ][ 'condshow' ] = Array( $this->prefix . $opt => 'on' );
|
125 |
$$s = $arr;
|
126 |
}
|
@@ -183,7 +168,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
183 |
function load_sitemap_options() {
|
184 |
// load initial options / set defaults
|
185 |
$this->update_options( );
|
186 |
-
if ( !empty( $this->options["{$this->prefix}
|
187 |
$this->paginate = true;
|
188 |
if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
|
189 |
$this->max_posts = $this->options["{$this->prefix}max_posts"];
|
@@ -251,33 +236,12 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
251 |
/** Add post type details for settings once post types have been registered. **/
|
252 |
function add_post_types() {
|
253 |
$post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
|
254 |
-
$taxonomy_titles = $this->get_taxonomy_titles( Array( 'public' => true ) );
|
255 |
if ( isset( $post_type_titles['attachment'] ) ) $post_type_titles['attachment'] = __( "Media / Attachments", 'all_in_one_seo_pack' );
|
256 |
$this->default_options['posttypes' ]['initial_options'] = array_merge( Array( 'all' => __( 'All Post Types', 'all_in_one_seo_pack' ) ), $post_type_titles );
|
257 |
-
$this->default_options['taxonomies']['initial_options'] = array_merge( Array( 'all' => __( 'All Taxonomies', 'all_in_one_seo_pack' ) ), $
|
258 |
$this->default_options['posttypes' ]['default'] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
|
259 |
$this->default_options['taxonomies']['default'] = array_keys( $this->default_options['taxonomies']['initial_options'] );
|
260 |
$this->default_options['excl_categories']['initial_options'] = $this->get_category_titles();
|
261 |
-
$prio_help = __( "Manually set the priority for the ", 'all_in_one_seo_pack' );
|
262 |
-
$freq_help = __( "Manually set the frequency for the ", 'all_in_one_seo_pack' );
|
263 |
-
$post_name = __( " Post Type", 'all_in_one_seo_pack' );
|
264 |
-
$tax_name = __( " Taxonomy", 'all_in_one_seo_pack' );
|
265 |
-
foreach( $post_type_titles as $k => $v ) {
|
266 |
-
$key = 'prio_post_' . $k;
|
267 |
-
$this->default_options = aioseop_array_insert_after( $this->default_options, 'prio_post', Array( $key => Array( 'name' => $v . $post_name, 'help_text' => $prio_help . $v . $post_name, 'type' => 'select', 'initial_options' => $this->prio, 'default' => 'no', 'condshow' => Array( "{$this->prefix}prio_post" => 'sel' ) ) ) );
|
268 |
-
$this->layout['priorities']['options'][] = $key;
|
269 |
-
$key = 'freq_post_' . $k;
|
270 |
-
$this->default_options = aioseop_array_insert_after( $this->default_options, 'freq_post', Array( $key => Array( 'name' => $v . $post_name, 'help_text' => $freq_help . $v . $post_name, 'type' => 'select', 'initial_options' => $this->freq, 'default' => 'no', 'condshow' => Array( "{$this->prefix}freq_post" => 'sel' ) ) ) );
|
271 |
-
$this->layout['frequencies']['options'][] = $key;
|
272 |
-
}
|
273 |
-
foreach( $taxonomy_titles as $k => $v ) {
|
274 |
-
$key = 'prio_taxonomies_' . $k;
|
275 |
-
$this->default_options = aioseop_array_insert_after( $this->default_options, 'prio_taxonomies', Array( $key => Array( 'name' => $v . $tax_name, 'help_text' => $prio_help . $v . $tax_name, 'type' => 'select', 'initial_options' => $this->prio, 'default' => 'no', 'condshow' => Array( "{$this->prefix}prio_taxonomies" => 'sel' ) ) ) );
|
276 |
-
$this->layout['priorities']['options'][] = $key;
|
277 |
-
$key = 'freq_taxonomies_' . $k;
|
278 |
-
$this->default_options = aioseop_array_insert_after( $this->default_options, 'freq_taxonomies', Array( $key => Array( 'name' => $v . $tax_name, 'help_text' => $freq_help . $v . $tax_name, 'type' => 'select', 'initial_options' => $this->freq, 'default' => 'no', 'condshow' => Array( "{$this->prefix}freq_taxonomies" => 'sel' ) ) ) );
|
279 |
-
$this->layout['frequencies']['options'][] = $key;
|
280 |
-
}
|
281 |
$this->update_options();
|
282 |
}
|
283 |
|
@@ -428,8 +392,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
428 |
}
|
429 |
}
|
430 |
}
|
431 |
-
return apply_filters( $this->prefix . '
|
432 |
-
return apply_filters( $this->prefix . 'sitemap_urls', $siteurls ); // legacy
|
433 |
}
|
434 |
|
435 |
/** Scan for sitemaps on filesystem. **/
|
@@ -693,39 +656,30 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
693 |
exit();
|
694 |
}
|
695 |
}
|
696 |
-
|
697 |
-
|
698 |
-
|
|
|
|
|
699 |
if ( $this->options["{$this->prefix}indexes"] ) {
|
700 |
$posttypes = $this->options["{$this->prefix}posttypes"];
|
701 |
if ( empty( $posttypes ) ) $posttypes = Array();
|
702 |
$taxonomies = $this->options["{$this->prefix}taxonomies"];
|
703 |
if ( empty( $taxonomies ) ) $taxonomies = Array();
|
704 |
if ( $sitemap_type === 'root' ) {
|
705 |
-
$
|
706 |
} elseif ( $sitemap_type === 'addl' ) {
|
707 |
-
$
|
708 |
} elseif ( $sitemap_type === 'archive' && $this->option_isset( 'archive' ) ) {
|
709 |
-
$
|
710 |
} elseif ( $sitemap_type === 'author' && $this->option_isset( 'author' ) ) {
|
711 |
-
$
|
712 |
} elseif ( in_array( $sitemap_type, $posttypes ) ) {
|
713 |
-
$
|
714 |
} elseif ( in_array( $sitemap_type, $taxonomies ) ) {
|
715 |
-
$
|
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' )
|
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 );
|
729 |
}
|
730 |
|
731 |
/** Build a url to the sitemap. **/
|
@@ -768,7 +722,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
768 |
|
769 |
/** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/
|
770 |
function do_sitemaps() {
|
771 |
-
if ( !empty( $this->options["{$this->prefix}
|
772 |
$this->paginate = true;
|
773 |
if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
|
774 |
$this->max_posts = $this->options["{$this->prefix}max_posts"];
|
@@ -817,39 +771,40 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
817 |
return $this->save_file( $filename, $contents );
|
818 |
}
|
819 |
|
820 |
-
|
821 |
-
function
|
822 |
-
|
|
|
|
|
823 |
if ( !empty( $defaults[ $item ] ) ) {
|
824 |
-
$field = $this->prefix .
|
825 |
-
if ( $this->option_isset(
|
826 |
-
|
827 |
-
|
828 |
-
} else {
|
829 |
-
$cache[ $item . $type ] = $this->options[ $field ];
|
830 |
-
}
|
831 |
-
return $cache[ $item . $type ];
|
832 |
}
|
833 |
if ( $nodefaults ) return false;
|
834 |
return $defaults[ $item ];
|
835 |
}
|
836 |
return false;
|
837 |
}
|
838 |
-
|
839 |
-
/** Get priority settings for sitemap entries. **/
|
840 |
-
function get_default_priority( $item, $nodefaults = false, $type = '' ) {
|
841 |
-
$defaults = Array( 'homepage' => '1.0', 'blog' => '0.9', 'sitemap' => '0.8', 'post' => '0.7', 'archive' => '0.5', 'author' => '0.3', 'taxonomies' => '0.3' );
|
842 |
-
static $cache = Array();
|
843 |
-
return $this->get_default_values( $defaults, 'prio_', $cache, $item, $nodefaults, $type );
|
844 |
-
}
|
845 |
-
|
846 |
/** Get frequency settings for sitemap entries. **/
|
847 |
function get_default_frequency( $item, $nodefaults = false ) {
|
848 |
$defaults = Array( 'homepage' => 'always', 'blog' => 'daily', 'sitemap' => 'hourly', 'post' => 'weekly', 'archive' => 'monthly', 'author' => 'weekly', 'taxonomies' => 'monthly' );
|
849 |
static $cache = Array();
|
850 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
851 |
}
|
852 |
-
|
853 |
/** Build an index of sitemaps used. **/
|
854 |
function get_sitemap_index_filenames() {
|
855 |
$files = Array();
|
@@ -904,70 +859,56 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
904 |
$files[] = Array( 'loc' => $csm, 'priority' => $this->get_default_priority( 'sitemap' ), 'changefreq' => $this->get_default_frequency( 'sitemap' ) );
|
905 |
return $files;
|
906 |
}
|
907 |
-
|
908 |
-
function do_build_sitemap( $sitemap_type, $page = 0, $filename = '', $comment = '' ) {
|
909 |
-
if ( empty( $filename ) ) {
|
910 |
-
if ( $sitemap_type == 'root' ) {
|
911 |
-
$filename = $this->options["{$this->prefix}filename"];
|
912 |
-
} else {
|
913 |
-
$filename = $this->options["{$this->prefix}filename"] . '_' . $sitemap_type;
|
914 |
-
}
|
915 |
-
}
|
916 |
-
if ( empty( $comment ) )
|
917 |
-
$comment = __( "file '%s' statically", 'all_in_one_seo_pack' );
|
918 |
-
$sitemap_data = $this->get_sitemap_data( $sitemap_type, $page );
|
919 |
-
if ( $sitemap_type == 'root' ) {
|
920 |
-
return $this->build_sitemap_index( $sitemap_data, sprintf( $comment, $filename ) );
|
921 |
-
} else {
|
922 |
-
return $this->build_sitemap( $sitemap_data, sprintf( $comment, $filename ) );
|
923 |
-
}
|
924 |
-
}
|
925 |
-
|
926 |
-
function do_write_sitemap( $sitemap_type, $page = 0, $filename = '', $comment = '' ) {
|
927 |
-
if ( empty( $filename ) ) {
|
928 |
-
if ( $sitemap_type == 'root' ) {
|
929 |
-
$filename = $this->options["{$this->prefix}filename"];
|
930 |
-
} else {
|
931 |
-
$filename = $this->options["{$this->prefix}filename"] . '_' . $sitemap_type;
|
932 |
-
}
|
933 |
-
}
|
934 |
-
if ( empty( $comment ) )
|
935 |
-
$comment = __( "file '%s' statically", 'all_in_one_seo_pack' );
|
936 |
-
$this->write_sitemaps( $filename, $this->do_build_sitemap( $sitemap_type, $page, $filename, $comment ) );
|
937 |
-
}
|
938 |
|
939 |
/** Build all the indexes. **/
|
940 |
function do_indexed_sitemaps() {
|
941 |
$this->start_memory_usage = memory_get_peak_usage();
|
942 |
$options = $this->options;
|
943 |
-
|
944 |
-
$this->
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
if ( $this->option_isset( 'author' ) ) $this->do_write_sitemap( 'author' );
|
949 |
-
|
950 |
if ( ( !isset( $options["{$this->prefix}posttypes"] ) ) || ( !is_array( $options["{$this->prefix}posttypes"] ) ) ) $options["{$this->prefix}posttypes"] = Array();
|
951 |
if ( ( !isset( $options["{$this->prefix}taxonomies"] ) ) || ( !is_array( $options["{$this->prefix}taxonomies"] ) ) ) $options["{$this->prefix}taxonomies"] = Array();
|
952 |
$options["{$this->prefix}posttypes"] = array_diff( $options["{$this->prefix}posttypes"], Array( 'all' ) );
|
953 |
$options["{$this->prefix}taxonomies"] = array_diff( $options["{$this->prefix}taxonomies"], Array( 'all' ) );
|
954 |
-
|
955 |
if ( !empty( $options["{$this->prefix}posttypes"] ) ) {
|
956 |
$post_counts = $this->get_all_post_counts( Array('post_type' => $options["{$this->prefix}posttypes"], 'post_status' => 'publish') );
|
957 |
foreach ( $options["{$this->prefix}posttypes"] as $posttype ) {
|
958 |
if ( $post_counts[$posttype] === 0 ) continue;
|
959 |
if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) {
|
960 |
$count = 1;
|
961 |
-
for( $post_count = 0; $post_count < $post_counts[$posttype]; $post_count += $this->max_posts ) {
|
962 |
-
$
|
|
|
|
|
963 |
$count++;
|
964 |
}
|
965 |
} else {
|
966 |
-
$this->
|
|
|
|
|
967 |
}
|
968 |
-
}
|
969 |
}
|
970 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
971 |
if ( !empty( $options["{$this->prefix}taxonomies"] ) )
|
972 |
foreach( $options["{$this->prefix}taxonomies"] as $taxonomy ) {
|
973 |
$term_count = wp_count_terms( $taxonomy, array('hide_empty' => true) );
|
@@ -975,22 +916,30 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
975 |
if ( $this->paginate ) {
|
976 |
if ( $term_count > $this->max_posts ) {
|
977 |
$count = 1;
|
978 |
-
for( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) {
|
979 |
-
$
|
|
|
|
|
980 |
$count++;
|
981 |
}
|
982 |
} else {
|
983 |
-
$this->
|
|
|
|
|
984 |
}
|
985 |
} else {
|
986 |
-
$this->
|
|
|
|
|
987 |
}
|
988 |
}
|
989 |
}
|
|
|
990 |
$this->log_stats( 'indexed', $options["{$this->prefix}gzipped"], false );
|
991 |
}
|
992 |
-
|
993 |
-
|
|
|
994 |
$home = Array(
|
995 |
'loc' => get_home_url(),
|
996 |
'priority' => $this->get_default_priority( 'homepage' ),
|
@@ -1038,20 +987,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1038 |
$prio2 = $this->get_term_priority_data( $terms );
|
1039 |
$prio3 = $this->get_addl_pages_only();
|
1040 |
$prio = array_merge( $child, $prio, $prio2, $prio3 );
|
1041 |
-
|
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 );
|
1055 |
}
|
1056 |
|
1057 |
/** Output the XML for a sitemap. **/
|
@@ -1064,7 +1000,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1064 |
$plugin_url = parse_url( $plugin_path );
|
1065 |
$current_host = $_SERVER['HTTP_HOST'];
|
1066 |
if ( empty( $current_host ) ) $current_host = $_SERVER['SERVER_NAME'];
|
1067 |
-
|
1068 |
if ( !empty( $current_host ) && ( $current_host != $plugin_url['host'] ) ) {
|
1069 |
$plugin_url['host'] = $current_host;
|
1070 |
$plugin_path = $this->unparse_url( $plugin_url );
|
@@ -1166,18 +1101,15 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1166 |
function get_term_priority_data( $terms ) {
|
1167 |
$prio = Array();
|
1168 |
if (is_array( $terms ) ) {
|
1169 |
-
$
|
1170 |
-
$
|
1171 |
foreach ($terms as $term) {
|
1172 |
-
$
|
1173 |
-
$
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
$pr_info['changefreq'] = $this->options[ $this->prefix . 'freq_taxonomies_' . $term->taxonomy ];
|
1179 |
-
} else $pr_info['changefreq'] = $def_freq;
|
1180 |
-
$prio[] = $pr_info;
|
1181 |
}
|
1182 |
}
|
1183 |
return $prio;
|
@@ -1461,12 +1393,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1461 |
$pr_info[ 'priority' ] = $prio_override;
|
1462 |
if ( $freq_override )
|
1463 |
$pr_info[ 'changefreq' ] = $freq_override;
|
1464 |
-
if ( ( $this->options[ $this->prefix . 'prio_post' ] == 'sel' ) && ( isset( $this->options[ $this->prefix . 'prio_post_' . $post->post_type ] ) ) ) {
|
1465 |
-
$pr_info[ 'priority' ] = $this->options[ $this->prefix . 'prio_post_' . $post->post_type ];
|
1466 |
-
}
|
1467 |
-
if ( ( $this->options[ $this->prefix . 'freq_post' ] == 'sel' ) && ( isset( $this->options[ $this->prefix . 'freq_post_' . $post->post_type ] ) ) ) {
|
1468 |
-
$pr_info[ 'changefreq' ] = $this->options[ $this->prefix . 'freq_post_' . $post->post_type ];
|
1469 |
-
}
|
1470 |
$pr_info['loc'] = $url;
|
1471 |
$pr_info = apply_filters( $this->prefix . 'prio_item_filter', $pr_info, $post, $args );
|
1472 |
if ( !empty( $pr_info ) )
|
@@ -1692,7 +1618,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1692 |
$ex_args['meta_value'] = 'on';
|
1693 |
$ex_args['meta_compare'] = '=';
|
1694 |
$ex_args['fields'] = 'ids';
|
1695 |
-
$ex_args['posts_per_page'] = -1;
|
1696 |
$q = new WP_Query( $ex_args );
|
1697 |
if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] );
|
1698 |
if ( !empty( $q->posts ) ) $args['exclude'] = array_merge( $args['exclude'], $q->posts );
|
13 |
var $start_memory_usage = 0;
|
14 |
var $max_posts = 50000;
|
15 |
var $paginate = false;
|
16 |
+
|
|
|
|
|
|
|
|
|
|
|
17 |
function All_in_One_SEO_Pack_Sitemap( ) {
|
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
|
85 |
)
|
86 |
);
|
87 |
|
88 |
+
$prio = Array( 'no' => 'Do Not Override' );
|
89 |
+
|
90 |
for( $i = 0; $i <= 10; $i++ ) {
|
91 |
$str = sprintf( "%0.1f", $i / 10.0 );
|
92 |
$prio[ $str ] = $str;
|
93 |
}
|
|
|
|
|
|
|
|
|
94 |
|
95 |
+
$freq = Array( 'no' => 'Do Not Override' );
|
96 |
+
|
97 |
foreach ( Array( 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never' ) as $f ) $freq[ $f ] = $f;
|
|
|
|
|
98 |
|
99 |
foreach( Array( 'prio' => __( 'priority', 'all_in_one_seo_pack' ), 'freq' => __( 'frequency', 'all_in_one_seo_pack' ) ) as $k => $v ) {
|
100 |
$s = "{$k}_options";
|
105 |
'archive' => __( 'archive pages', 'all_in_one_seo_pack' ),
|
106 |
'author' => __( 'author pages', 'all_in_one_seo_pack' ) ) as $opt => $val ) {
|
107 |
$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' );
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
if ( ( $opt == 'archive' ) || ( $opt == 'author' ) ) $arr[ $k . '_' . $opt ][ 'condshow' ] = Array( $this->prefix . $opt => 'on' );
|
110 |
$$s = $arr;
|
111 |
}
|
168 |
function load_sitemap_options() {
|
169 |
// load initial options / set defaults
|
170 |
$this->update_options( );
|
171 |
+
if ( !empty( $this->options["{$this->prefix}paginate"] ) ) {
|
172 |
$this->paginate = true;
|
173 |
if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
|
174 |
$this->max_posts = $this->options["{$this->prefix}max_posts"];
|
236 |
/** Add post type details for settings once post types have been registered. **/
|
237 |
function add_post_types() {
|
238 |
$post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
|
|
|
239 |
if ( isset( $post_type_titles['attachment'] ) ) $post_type_titles['attachment'] = __( "Media / Attachments", 'all_in_one_seo_pack' );
|
240 |
$this->default_options['posttypes' ]['initial_options'] = array_merge( Array( 'all' => __( 'All Post Types', 'all_in_one_seo_pack' ) ), $post_type_titles );
|
241 |
+
$this->default_options['taxonomies']['initial_options'] = array_merge( Array( 'all' => __( 'All Taxonomies', 'all_in_one_seo_pack' ) ), $this->get_taxonomy_titles( Array( 'public' => true ) ) );
|
242 |
$this->default_options['posttypes' ]['default'] = array_keys( $this->default_options['posttypes' ]['initial_options'] );
|
243 |
$this->default_options['taxonomies']['default'] = array_keys( $this->default_options['taxonomies']['initial_options'] );
|
244 |
$this->default_options['excl_categories']['initial_options'] = $this->get_category_titles();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
$this->update_options();
|
246 |
}
|
247 |
|
392 |
}
|
393 |
}
|
394 |
}
|
395 |
+
return apply_filters( $this->prefix . 'sitemap_urls', $siteurls );
|
|
|
396 |
}
|
397 |
|
398 |
/** Scan for sitemaps on filesystem. **/
|
656 |
exit();
|
657 |
}
|
658 |
}
|
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' );
|
664 |
if ( $this->options["{$this->prefix}indexes"] ) {
|
665 |
$posttypes = $this->options["{$this->prefix}posttypes"];
|
666 |
if ( empty( $posttypes ) ) $posttypes = Array();
|
667 |
$taxonomies = $this->options["{$this->prefix}taxonomies"];
|
668 |
if ( empty( $taxonomies ) ) $taxonomies = Array();
|
669 |
if ( $sitemap_type === 'root' ) {
|
670 |
+
$this->output_sitemap_index( array_merge( $this->get_sitemap_index_filenames() ), $comment );
|
671 |
} elseif ( $sitemap_type === 'addl' ) {
|
672 |
+
$this->output_sitemap( $this->get_addl_pages(), $comment );
|
673 |
} elseif ( $sitemap_type === 'archive' && $this->option_isset( 'archive' ) ) {
|
674 |
+
$this->output_sitemap( $this->get_archive_prio_data(), $comment );
|
675 |
} elseif ( $sitemap_type === 'author' && $this->option_isset( 'author' ) ) {
|
676 |
+
$this->output_sitemap( $this->get_author_prio_data(), $comment );
|
677 |
} elseif ( in_array( $sitemap_type, $posttypes ) ) {
|
678 |
+
$this->output_sitemap( $this->get_all_post_priority_data( $sitemap_type, 'publish', $page ), $comment );
|
679 |
} 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 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
683 |
}
|
684 |
|
685 |
/** Build a url to the sitemap. **/
|
722 |
|
723 |
/** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/
|
724 |
function do_sitemaps() {
|
725 |
+
if ( !empty( $this->options["{$this->prefix}paginate"] ) ) {
|
726 |
$this->paginate = true;
|
727 |
if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
|
728 |
$this->max_posts = $this->options["{$this->prefix}max_posts"];
|
771 |
return $this->save_file( $filename, $contents );
|
772 |
}
|
773 |
|
774 |
+
/** Get priority settings for sitemap entries. **/
|
775 |
+
function get_default_priority( $item, $nodefaults = false ) {
|
776 |
+
$defaults = Array( 'homepage' => '1.0', 'blog' => '0.9', 'sitemap' => '0.8', 'post' => '0.7', 'archive' => '0.5', 'author' => '0.3', 'taxonomies' => '0.3' );
|
777 |
+
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 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
791 |
/** Get frequency settings for sitemap entries. **/
|
792 |
function get_default_frequency( $item, $nodefaults = false ) {
|
793 |
$defaults = Array( 'homepage' => 'always', 'blog' => 'daily', 'sitemap' => 'hourly', 'post' => 'weekly', 'archive' => 'monthly', 'author' => 'weekly', 'taxonomies' => 'monthly' );
|
794 |
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 |
+
|
808 |
/** Build an index of sitemaps used. **/
|
809 |
function get_sitemap_index_filenames() {
|
810 |
$files = Array();
|
859 |
$files[] = Array( 'loc' => $csm, 'priority' => $this->get_default_priority( 'sitemap' ), 'changefreq' => $this->get_default_frequency( 'sitemap' ) );
|
860 |
return $files;
|
861 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
|
863 |
/** Build all the indexes. **/
|
864 |
function do_indexed_sitemaps() {
|
865 |
$this->start_memory_usage = memory_get_peak_usage();
|
866 |
$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" ) ) );
|
|
|
|
|
872 |
if ( ( !isset( $options["{$this->prefix}posttypes"] ) ) || ( !is_array( $options["{$this->prefix}posttypes"] ) ) ) $options["{$this->prefix}posttypes"] = Array();
|
873 |
if ( ( !isset( $options["{$this->prefix}taxonomies"] ) ) || ( !is_array( $options["{$this->prefix}taxonomies"] ) ) ) $options["{$this->prefix}taxonomies"] = Array();
|
874 |
$options["{$this->prefix}posttypes"] = array_diff( $options["{$this->prefix}posttypes"], Array( 'all' ) );
|
875 |
$options["{$this->prefix}taxonomies"] = array_diff( $options["{$this->prefix}taxonomies"], Array( 'all' ) );
|
876 |
+
|
877 |
if ( !empty( $options["{$this->prefix}posttypes"] ) ) {
|
878 |
$post_counts = $this->get_all_post_counts( Array('post_type' => $options["{$this->prefix}posttypes"], 'post_status' => 'publish') );
|
879 |
foreach ( $options["{$this->prefix}posttypes"] as $posttype ) {
|
880 |
if ( $post_counts[$posttype] === 0 ) continue;
|
881 |
if ( $this->paginate && ( $post_counts[$posttype] > $this->max_posts ) ) {
|
882 |
$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 ) );
|
887 |
$count++;
|
888 |
}
|
889 |
} 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 |
+
|
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) );
|
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 );
|
939 |
}
|
940 |
+
|
941 |
+
/** Build a single, stand-alone sitemap without indexes. **/
|
942 |
+
function do_simple_sitemap( $comment = '' ) {
|
943 |
$home = Array(
|
944 |
'loc' => get_home_url(),
|
945 |
'priority' => $this->get_default_priority( 'homepage' ),
|
987 |
$prio2 = $this->get_term_priority_data( $terms );
|
988 |
$prio3 = $this->get_addl_pages_only();
|
989 |
$prio = array_merge( $child, $prio, $prio2, $prio3 );
|
990 |
+
return $this->build_sitemap( $prio, $comment );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
991 |
}
|
992 |
|
993 |
/** Output the XML for a sitemap. **/
|
1000 |
$plugin_url = parse_url( $plugin_path );
|
1001 |
$current_host = $_SERVER['HTTP_HOST'];
|
1002 |
if ( empty( $current_host ) ) $current_host = $_SERVER['SERVER_NAME'];
|
|
|
1003 |
if ( !empty( $current_host ) && ( $current_host != $plugin_url['host'] ) ) {
|
1004 |
$plugin_url['host'] = $current_host;
|
1005 |
$plugin_path = $this->unparse_url( $plugin_url );
|
1101 |
function get_term_priority_data( $terms ) {
|
1102 |
$prio = Array();
|
1103 |
if (is_array( $terms ) ) {
|
1104 |
+
$f = $this->get_default_frequency( 'taxonomies' );
|
1105 |
+
$p = $this->get_default_priority( 'taxonomies' );
|
1106 |
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 |
+
);
|
|
|
|
|
|
|
1113 |
}
|
1114 |
}
|
1115 |
return $prio;
|
1393 |
$pr_info[ 'priority' ] = $prio_override;
|
1394 |
if ( $freq_override )
|
1395 |
$pr_info[ 'changefreq' ] = $freq_override;
|
|
|
|
|
|
|
|
|
|
|
|
|
1396 |
$pr_info['loc'] = $url;
|
1397 |
$pr_info = apply_filters( $this->prefix . 'prio_item_filter', $pr_info, $post, $args );
|
1398 |
if ( !empty( $pr_info ) )
|
1618 |
$ex_args['meta_value'] = 'on';
|
1619 |
$ex_args['meta_compare'] = '=';
|
1620 |
$ex_args['fields'] = 'ids';
|
|
|
1621 |
$q = new WP_Query( $ex_args );
|
1622 |
if ( !is_array( $args['exclude'] ) ) $args['exclude'] = explode( ',', $args['exclude'] );
|
1623 |
if ( !empty( $q->posts ) ) $args['exclude'] = array_merge( $args['exclude'], $q->posts );
|
all_in_one_seo_pack.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: All In One SEO Pack
|
4 |
Plugin URI: http://semperfiwebdesign.com
|
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.
|
7 |
Author: Michael Torbert
|
8 |
Author URI: http://michaeltorbert.com
|
9 |
*/
|
@@ -30,11 +30,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
30 |
|
31 |
/**
|
32 |
* @package All-in-One-SEO-Pack
|
33 |
-
* @version 2.1.
|
34 |
*/
|
35 |
|
36 |
if ( ! defined( 'AIOSEOP_VERSION' ) )
|
37 |
-
define( 'AIOSEOP_VERSION', '2.1.
|
38 |
|
39 |
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
|
40 |
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
3 |
Plugin Name: All In One SEO Pack
|
4 |
Plugin URI: http://semperfiwebdesign.com
|
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.5.1
|
7 |
Author: Michael Torbert
|
8 |
Author URI: http://michaeltorbert.com
|
9 |
*/
|
30 |
|
31 |
/**
|
32 |
* @package All-in-One-SEO-Pack
|
33 |
+
* @version 2.1.5.1
|
34 |
*/
|
35 |
|
36 |
if ( ! defined( 'AIOSEOP_VERSION' ) )
|
37 |
+
define( 'AIOSEOP_VERSION', '2.1.5.1' );
|
38 |
|
39 |
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
|
40 |
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: hallsofmontezuma
|
|
3 |
Donate link: 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
|
4 |
Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 3.9
|
7 |
Stable tag: trunk
|
8 |
|
9 |
All in One SEO Pack is a WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines such as Google.
|
3 |
Donate link: 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
|
4 |
Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
|
5 |
Requires at least: 3.3
|
6 |
+
Tested up to: 3.9
|
7 |
Stable tag: trunk
|
8 |
|
9 |
All in One SEO Pack is a WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines such as Google.
|