diff --git a/admin/aioseop_module_class.php b/admin/aioseop_module_class.php index 7b8d59109..305894641 100644 --- a/admin/aioseop_module_class.php +++ b/admin/aioseop_module_class.php @@ -2220,8 +2220,10 @@ function get_option_html( $args ) { $buf .= ""; break; case 'image': - $buf .= ''. - "" . + $buf .= '' . + "\n"; break; case 'html': @@ -2849,6 +2851,12 @@ function get_current_options( $opts = array(), $location = null, $defaults = nul $get_opts = get_post_meta( $post->ID, '_' . $prefix . $location, true ); } } + + if ( is_home() && ! is_front_page() ) { + // If we're on the non-front page blog page, WP doesn't really know its post meta data so we need to get that manually for social meta. + $get_opts = get_post_meta( get_option( 'page_for_posts' ), '_' . $prefix . $location, true ); + } + $defs = $this->default_options( $location, $defaults ); if ( empty( $get_opts ) ) { $get_opts = $defs; diff --git a/admin/meta_import.php b/admin/meta_import.php index 88435b10f..957f71c1a 100644 --- a/admin/meta_import.php +++ b/admin/meta_import.php @@ -69,7 +69,8 @@ function aiosp_seometa_settings_init() { /** * Intercept POST data from the form submission. * - * Use the intercepted data to convert values in the postmeta table from one platform to another. + * Use the intercepted data to convert values in the postmeta table from one platform to another and display feedback to the user about compatible conversion + * elements and the conversion process. */ function aiosp_seometa_action() { @@ -130,11 +131,6 @@ function aiosp_seometa_action() { } -/** - * This function displays feedback to the user about compatible conversion - * elements and the conversion process via the admin_alert hook. - */ - /** * The admin page output */ diff --git a/aioseop_class.php b/aioseop_class.php index 38e533efb..a3619b4b4 100644 --- a/aioseop_class.php +++ b/aioseop_class.php @@ -91,7 +91,6 @@ function __construct() { 'use_tags_as_keywords' => __( 'Check this if you want your tags for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).', 'all-in-one-seo-pack' ), 'dynamic_postspage_keywords' => __( 'Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) and your archive pages to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all-in-one-seo-pack' ), 'rewrite_titles' => __( "Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the title bar and in the source code. If enabled, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: Using the default post title format below, Rewrite Titles will write all post titles as 'Post Title | Blog Name'. If you have manually defined a title using All in One SEO Pack, this will become the title of your post in the format string.", 'all-in-one-seo-pack' ), - 'cap_titles' => __( 'Check this and Search Page Titles and Tag Page Titles will have the first letter of each word capitalized.', 'all-in-one-seo-pack' ), 'home_page_title_format' => __( 'This controls the format of the title tag for your Home Page.
The following macros are supported:', 'all-in-one-seo-pack' ) . '', + __( "%current_date% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • '. + __( "%post_date% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_year% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_month% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' , 'post_title_format' => __( 'This controls the format of the title tag for Posts.
    The following macros are supported:', 'all-in-one-seo-pack' ) - . '', + __( "%current_date% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_date% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_year% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_month% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' , 'category_title_format' => __( 'This controls the format of the title tag for Category Archives.
    The following macros are supported:', 'all-in-one-seo-pack' ) . '', + __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_date% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_year% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_month% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' , '404_title_format' => __( 'This controls the format of the title tag for the 404 page.
    The following macros are supported:', 'all-in-one-seo-pack' ) . '' . + __( "%current_date% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_date% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_year% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + __( "%post_month% - The current date (localized)", 'all-in-one-seo-pack' ) . '
  • ' . + '' . ''; $this->help_anchors[ $field ] = '#custom-titles'; $this->layout['cpt']['options'][] = $field; @@ -4036,6 +4012,15 @@ function apply_description_format( $description, $post = null ) { if ( strpos( $description, '%current_date%' ) !== false ) { $description = str_replace( '%current_date%', date_i18n( get_option( 'date_format' ) ), $description ); } + if ( strpos( $description, "%post_date%" ) !== false ){ + $description = str_replace( '%post_date%', get_the_date(), $description ); + } + if ( strpos( $description, "%post_year%" ) !== false ){ + $description = str_replace( '%post_year%', get_the_date( 'Y' ), $description ); + } + if ( strpos( $description, "%post_month%" ) !== false ){ + $description = str_replace( '%post_month%', get_the_date( 'F' ), $description ); + } /*this was intended to make attachment descriptions unique if pulling from the parent... let's remove it and see if there are any problems *on the roadmap is to have a better hierarchy for attachment description pulling diff --git a/all_in_one_seo_pack.php b/all_in_one_seo_pack.php index 6c746c85c..67a8dc6a7 100644 --- a/all_in_one_seo_pack.php +++ b/all_in_one_seo_pack.php @@ -3,7 +3,7 @@ Plugin Name: All In One SEO Pack Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/ Description: Out-of-the-box SEO for your WordPress blog. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. More than 30 million downloads since 2007. -Version: 2.3.14.2 +Version: 2.3.15 Author: Michael Torbert Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/ Text Domain: all-in-one-seo-pack @@ -31,14 +31,14 @@ * The original WordPress SEO plugin. * * @package All-in-One-SEO-Pack - * @version 2.3.14.2 + * @version 2.3.15 */ if ( ! defined( 'AIOSEOPPRO' ) ) { define( 'AIOSEOPPRO', false ); } if ( ! defined( 'AIOSEOP_VERSION' ) ) { - define( 'AIOSEOP_VERSION', '2.3.14.2' ); + define( 'AIOSEOP_VERSION', '2.3.15' ); } global $aioseop_plugin_name; $aioseop_plugin_name = 'All in One SEO Pack'; diff --git a/inc/sitemap-xsl.php b/inc/sitemap-xsl.php index 3ca5b8acc..b797ff14f 100644 --- a/inc/sitemap-xsl.php +++ b/inc/sitemap-xsl.php @@ -156,15 +156,17 @@ - - - - - - - - - + + + + + + + + + + + diff --git a/modules/aioseop_opengraph.php b/modules/aioseop_opengraph.php index 8a764d599..f94abe7f1 100644 --- a/modules/aioseop_opengraph.php +++ b/modules/aioseop_opengraph.php @@ -13,7 +13,7 @@ class All_in_One_SEO_Pack_Opengraph extends All_in_One_SEO_Pack_Module { /** * Module constructor. * - * @since 2.4.14 Added display filter. + * @since 2.4.14 Added display filter. */ function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'og_admin_enqueue_scripts' ) ); @@ -81,12 +81,6 @@ function __construct() { ); parent::__construct(); - $categories = Array( - 'blog' => __( 'Blog', 'all-in-one-seo-pack' ), - 'website' => __( 'Website', 'all-in-one-seo-pack' ), - 'article' => __( 'Article', 'all-in-one-seo-pack' ), - ); - $this->help_text = Array( "setmeta" => __( "Checking this box will use the Home Title and Home Description set in All in One SEO Pack, General Settings as the Open Graph title and description for your home page.", 'all-in-one-seo-pack' ), "key" => __( "Enter your Facebook Admin ID here. You can enter multiple IDs separated by a comma. You can look up your Facebook ID using this tool http://findmyfbid.com/", 'all-in-one-seo-pack' ), @@ -97,7 +91,6 @@ function __construct() { "hometitle" => __( "The Home Title is the Open Graph title for your home page.", 'all-in-one-seo-pack' ), "description" => __( "The Home Description is the Open Graph description for your home page.", 'all-in-one-seo-pack' ), "homeimage" => __( "The Home Image is the Open Graph image for your home page.", 'all-in-one-seo-pack' ), - "hometag" => __( "The Home Tag allows you to add a list of keywords that best describe your home page content.", 'all-in-one-seo-pack' ), "generate_descriptions" => __( "This option will auto generate your Open Graph descriptions from your post content instead of your post excerpt. WooCommerce users should read the documentation regarding this setting.", 'all-in-one-seo-pack' ), "defimg" => __( "This option lets you choose which image will be displayed by default for the Open Graph image. You may override this on individual posts.", 'all-in-one-seo-pack' ), "fallback" => __( "This option lets you fall back to the default image if no image could be found above.", 'all-in-one-seo-pack' ), @@ -105,7 +98,6 @@ function __construct() { "dimgwidth" => __( "This option lets you set a default width for your images, where unspecified.", 'all-in-one-seo-pack' ), "dimgheight" => __( "This option lets you set a default height for your images, where unspecified.", 'all-in-one-seo-pack' ), "meta_key" => __( "Enter the name of a custom field (or multiple field names separated by commas) to use that field to specify the Open Graph image on Pages or Posts.", 'all-in-one-seo-pack' ), - "categories" => __( "Set the Open Graph type for your website as either a blog or a website.", 'all-in-one-seo-pack' ), "image" => __( "This option lets you select the Open Graph image that will be used for this Page or Post, overriding the default settings.", 'all-in-one-seo-pack' ), "customimg" => __( "This option lets you upload an image to use as the Open Graph image for this Page or Post.", 'all-in-one-seo-pack' ), "imagewidth" => __( "Enter the width for your Open Graph image in pixels (i.e. 600).", 'all-in-one-seo-pack' ), @@ -146,7 +138,6 @@ function __construct() { 'hometitle' => '#home-title-and-description', 'description' => '#home-title-and-description', 'homeimage' => '#home-image', - 'hometag' => '#home-article-tags', 'defimg' => '#select-og-image-source', 'fallback' => '#use-default-if-no-image-found', 'dimg' => '#default-og-image', @@ -158,7 +149,6 @@ function __construct() { 'social_name' => '#social-profile-links', 'key' => '#facebook-admin-id', 'appid' => '#facebook-app-id', - 'categories' => '#facebook-object-type', 'gen_tags' => '#automatically-generate-article-tags', 'gen_keywords' => '#use-keywords-in-article-tags', 'gen_categories' => '#use-categories-in-article-tags', @@ -167,7 +157,6 @@ function __construct() { 'facebook_author' => '#show-facebook-author-on-articles', 'types' => '#enable-facebook-meta-for', 'defcard' => '#default-twitter-card', - 'setcard' => '#default-twitter-card', 'twitter_site' => '#twitter-site', 'twitter_creator' => '#show-twitter-author', 'twitter_domain' => '#twitter-domain', @@ -211,15 +200,9 @@ function __construct() { /** * Hook called after wordpress has been loaded. - * @since 2.4.14 + * @since 2.4.14 */ public function init() { - // Prepare re-usable variables - $categories = array( - 'blog' => __( 'Blog', 'all-in-one-seo-pack' ), - 'website' => __( 'Website', 'all-in-one-seo-pack' ), - 'article' => __( 'Article', 'all-in-one-seo-pack' ), - ); $count_desc = __( ' characters. Open Graph allows up to a maximum of %s chars for the %s.', 'all-in-one-seo-pack' ); // Create default options $this->default_options = array( @@ -281,14 +264,6 @@ public function init() { 'name' => __( 'Home Image', 'all-in-one-seo-pack' ), 'type' => 'image', ), - 'hometag' => array( - 'name' => __( 'Home Article Tags', 'all-in-one-seo-pack' ), - 'type' => 'text', - 'default' => '', - 'condshow' => array( - 'aiosp_opengraph_categories' => 'article' - ), - ), 'generate_descriptions' => array( 'name' => __( 'Use Content For Autogenerated OG Descriptions', 'all-in-one-seo-pack' ), 'default' => 0, @@ -330,12 +305,6 @@ public function init() { 'type' => 'text', 'default' => '', ), - 'categories' => array( - 'name' => __( 'Facebook Object Type', 'all-in-one-seo-pack' ), - 'type' => 'radio', - 'default' => 'blog', - 'initial_options' => $categories, - ), 'image' => array( 'name' => __( 'Image', 'all-in-one-seo-pack' ), 'type' => 'radio', @@ -541,7 +510,6 @@ public function init() { 'hometitle', 'description', 'homeimage', - 'hometag', 'generate_descriptions', 'defimg', 'fallback', @@ -549,7 +517,6 @@ public function init() { 'dimgwidth', 'dimgheight', 'meta_key', - 'categories', 'defcard', 'profile_links', 'person_or_org', @@ -595,7 +562,7 @@ public function init() { 'home' => Array( 'name' => __( 'Home Page Settings', 'all-in-one-seo-pack' ), 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#use-aioseo-title-and-description', - 'options' => Array( 'setmeta', 'sitename', 'hometitle', 'description', 'homeimage', 'hometag' ), + 'options' => Array( 'setmeta', 'sitename', 'hometitle', 'description', 'homeimage' ), ), 'image' => Array( 'name' => __( 'Image Settings', 'all-in-one-seo-pack' ), @@ -618,7 +585,6 @@ public function init() { 'gen_keywords', 'gen_categories', 'gen_post_tags', - 'categories', 'facebook_publisher', 'facebook_author', ), @@ -706,20 +672,6 @@ function force_fb_refresh_update( $post_ID, $post_after ) { function settings_page_init() { add_filter( 'aiosp_output_option', Array( $this, 'display_custom_options' ), 10, 2 ); - $cat = $this->options["{$this->prefix}categories"]; - if ( ! empty( $cat ) ) { - if ( $cat == 'blog' ) { - $show_on_front = get_option( 'show_on_front' ); - if ( ( $show_on_front == 'page' ) && ( get_option( 'page_on_front' ) ) ) { - $this->output_error( '

    ' . __( "Static front page detected, suggested Facebook Object Type is 'website'.", 'all-in-one-seo-pack' ) . '

    ' ); - } - } elseif ( $cat == 'website' ) { - $show_on_front = get_option( 'show_on_front' ); - if ( ( $show_on_front == 'posts' ) ) { - $this->output_error( '

    ' . __( "Blog on front page detected, suggested Facebook Object Type is 'blog'.", 'all-in-one-seo-pack' ) . '

    ' ); - } - } - } } function filter_options( $options, $location ) { @@ -753,6 +705,7 @@ function filter_options( $options, $location ) { * * @since 2.3.11 * @since 2.4.14 Added filter for description and title placeholders. + * @since 2.3.15 do_shortcode on description. * * @see [plugin]\admin\aioseop_module_class.php > display_options() */ @@ -790,18 +743,19 @@ function filter_settings( $settings, $location, $current ) { // Description options if ( is_object( $post ) ) - // Always show excerpt - $description = empty( $this->options['aiosp_opengraph_generate_descriptions'] ) - ? $aiosp->trim_excerpt_without_filters( - $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ), - 1000 - ) - : $aiosp->trim_excerpt_without_filters( - $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), - 1000 - ); + // Always show excerpt + $description = empty( $this->options['aiosp_opengraph_generate_descriptions'] ) + ? $aiosp->trim_excerpt_without_filters( + $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ), + 1000 + ) + : $aiosp->trim_excerpt_without_filters( + $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), + 1000 + ); // Add filters + $description = do_shortcode( $description ); $description = apply_filters( 'aioseop_description', $description ); // Add placholders $settings["{$prefix}title"]['placeholder'] = apply_filters( 'aioseop_opengraph_placeholder', $title ); @@ -981,6 +935,7 @@ function add_attributes( $output ) { // avoid having duplicate meta tags * @since 2.3.11.5 Support for multiple fb_admins. * @since 2.3.13 Adds filter:aioseop_description on description. * @since 2.4.14 Fixes for aioseop-pro #67. + * @since 2.3.15 Always do_shortcode on descriptions, removed for titles. * * @global object $post Current WP_Post object. * @global object $aiosp All in one seo plugin object. @@ -1056,9 +1011,6 @@ function add_meta() { if ( empty( $description ) && $first_page ) { $description = get_bloginfo( 'description' ); } - if ( $type == 'article' && ( ! empty( $this->options['aiosp_opengraph_hometag'] ) ) ) { - $tag = $this->options['aiosp_opengraph_hometag']; - } if ( ! empty( $this->options['aiosp_opengraph_profile_links'] ) ) { $social_links = $this->options['aiosp_opengraph_profile_links']; if ( ! empty( $this->options['aiosp_opengraph_social_name'] ) ) { @@ -1194,6 +1146,21 @@ function add_meta() { if ( empty( $type ) ) { $type = 'website'; } + } else if ( is_home() && ! is_front_page() ) { + // This is the blog page but not the homepage. + global $aiosp; + $image = $metabox['aioseop_opengraph_settings_image']; + $video = $metabox['aioseop_opengraph_settings_video']; + $title = $metabox['aioseop_opengraph_settings_title']; + $description = $metabox['aioseop_opengraph_settings_desc']; + + if ( empty( $description ) ) { + // If there's not social description, fall back to the SEO description. + $description = trim( strip_tags( get_post_meta( get_option( 'page_for_posts' ), '_aioseop_description', true ) ) ); + } + if ( empty( $title ) ) { + $title = $aiosp->wp_title(); + } } else { return; } @@ -1223,15 +1190,9 @@ function add_meta() { } } - if ( ! empty( $this->options['aiosp_opengraph_title_shortcodes'] ) ) { - $title = do_shortcode( $title ); - } - if ( ! empty( $description ) ) { $description = $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ); - if ( ! empty( $this->options['aiosp_opengraph_description_shortcodes'] ) ) { - $description = do_shortcode( $description ); - } + $description = do_shortcode( $description ); $description = $aiosp->trim_excerpt_without_filters( $description, 1000 ); } @@ -1486,13 +1447,17 @@ public function do_opengraph() { } } + /** + * Set up types. + * + * @since ? + * @since 2.3.15 Change to website for homepage and blog post index page, default to object. + */ function type_setup() { - global $aiosp, $wp_query; - $this->type = ''; - if ( $aiosp->is_static_front_page() ) { - if ( ! empty( $this->options ) && ! empty( $this->options['aiosp_opengraph_categories'] ) ) { - $this->type = $this->options['aiosp_opengraph_categories']; - } + $this->type = 'object'; // Default to type object if we don't have some other rule. + + if ( is_home() || is_front_page() ) { + $this->type = 'website'; // Home page and blog page should be website. } elseif ( is_singular() && $this->option_isset( 'types' ) ) { $metabox = $this->get_current_options( Array(), 'settings' ); $current_post_type = get_post_type(); @@ -1506,7 +1471,7 @@ function type_setup() { /** * Inits hooks and others for admin init. - * action:admin_init. + * action:admin_init. * * @since 2.3.11 * @since 2.4.14 Refactored function name, and new filter added for defaults and missing term metabox. @@ -1700,7 +1665,7 @@ public function filter_default_options( $options, $location ) { * Returns facebook debug script and link. * @since 2.4.14 * - * @return string + * @return string */ private function get_facebook_debug() { ob_start(); diff --git a/public/google-analytics.php b/public/google-analytics.php index 6f1ddb298..75c679e2d 100644 --- a/public/google-analytics.php +++ b/public/google-analytics.php @@ -7,19 +7,8 @@ class aioseop_google_analytics extends All_in_One_SEO_Pack_Module { // TODO Rather than extending the module base class, we should find a better way for the shared functions like moving them to our common functions class. - private $aiosp_ga_use_universal_analytics = true; - function __construct() { - - $this->filter_universal(); - $this->google_analytics(); - - } - - function filter_universal() { - $aiosp_ga_use_universal_analytics = $this->aiosp_ga_use_universal_analytics; - $this->aiosp_ga_use_universal_analytics = apply_filters( 'aiosp_universal_analytics', $aiosp_ga_use_universal_analytics ); } function google_analytics() { @@ -41,113 +30,63 @@ function google_analytics() { ob_start(); $analytics = $this->universal_analytics(); echo $analytics; - if ( empty( $analytics ) ) { - ?> - - - + if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && $aioseop_options['aiosp_ga_track_outbound_links'] ) { ?> + aiosp_ga_use_universal_analytics ) { - $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = ''; - if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) { - $cookie_domain = $this->get_analytics_domain(); - } - if ( ! empty( $cookie_domain ) ) { - $cookie_domain = esc_js( $cookie_domain ); - $cookie_domain = "'cookieDomain': '{$cookie_domain}'"; - } - if ( empty( $cookie_domain ) ) { - $domain = ", 'auto'"; - } - if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) { - $allow_linker = "'allowLinker': true"; - if ( ! empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) { - $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] ); - $addl_domains = preg_split( '/[\s,]+/', $addl_domains ); - if ( ! empty( $addl_domains ) ) { - foreach ( $addl_domains as $d ) { - $d = $this->sanitize_domain( $d ); - if ( ! empty( $d ) ) { - if ( ! empty( $domain_list ) ) { - $domain_list .= ', '; - } - $domain_list .= "'" . $d . "'"; + $analytics = ''; + $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = ''; + if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) { + $cookie_domain = $this->get_analytics_domain(); + } + if ( ! empty( $cookie_domain ) ) { + $cookie_domain = esc_js( $cookie_domain ); + $cookie_domain = "'cookieDomain': '{$cookie_domain}'"; + } + if ( empty( $cookie_domain ) ) { + $domain = ", 'auto'"; + } + if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) { + $allow_linker = "'allowLinker': true"; // This is put into $js_options later. + if ( ! empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) { + $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] ); + $addl_domains = preg_split( '/[\s,]+/', $addl_domains ); + if ( ! empty( $addl_domains ) ) { + foreach ( $addl_domains as $d ) { + $d = $this->sanitize_domain( $d ); + if ( ! empty( $d ) ) { + if ( ! empty( $domain_list ) ) { + $domain_list .= ', '; } + $domain_list .= "'" . $d . "'"; } } } } - $extra_options = ''; - if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) { - $extra_options .= "ga('require', 'displayfeatures');"; - } - if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) { - if ( ! empty( $extra_options ) ) { - $extra_options .= "\n\t\t\t"; - } - $extra_options .= "ga('require', 'ec');"; + } + $extra_options = ''; + if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) { + $extra_options .= "ga('require', 'displayfeatures');"; + } + if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) { + if ( ! empty( $extra_options ) ) { + $extra_options .= "\n\t\t\t"; } - if ( ! empty( $domain_list ) ) { - if ( ! empty( $extra_options ) ) { - $extra_options .= "\n\t\t\t"; - } - $extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );"; + $extra_options .= "ga('require', 'ec');"; + } + if ( ! empty( $domain_list ) ) { + if ( ! empty( $extra_options ) ) { + $extra_options .= "\n\t\t\t"; } - if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) { - if ( ! empty( $extra_options ) ) { - $extra_options .= "\n\t\t\t"; - } - $extra_options .= "ga('require', 'linkid', 'linkid.js');"; + $extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );"; + } + if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) { + if ( ! empty( $extra_options ) ) { + $extra_options .= "\n\t\t\t"; } + $extra_options .= "ga('require', 'linkid', 'linkid.js');"; + } - if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) { - if ( ! empty( $extra_options ) ) { - $extra_options .= "\n\t\t\t"; - } - $extra_options .= "ga('set', 'anonymizeIp', true);"; + if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) { + if ( ! empty( $extra_options ) ) { + $extra_options .= "\n\t\t\t"; } - $js_options = array(); - foreach ( array( 'cookie_domain', 'allow_linker' ) as $opts ) { - if ( ! empty( $$opts ) ) { - $js_options[] = $$opts; - } - } - if ( ! empty( $js_options ) ) { - $js_options = implode( ',', $js_options ); - $js_options = ', { ' . $js_options . ' } '; - } else { - $js_options = ''; + $extra_options .= "ga('set', 'anonymizeIp', true);"; + } + $js_options = array(); + foreach ( array( 'cookie_domain', 'allow_linker' ) as $opts ) { + if ( ! empty( $$opts ) ) { + $js_options[] = $$opts; } - $analytics_id = esc_js( $aioseop_options['aiosp_google_analytics_id'] ); - $analytics = << + } + if ( ! empty( $js_options ) ) { + $js_options = implode( ',', $js_options ); + $js_options = ', { ' . $js_options . ' } '; + } else { + $js_options = ''; + } + $analytics_id = esc_js( $aioseop_options['aiosp_google_analytics_id'] ); + $attributes = apply_filters( 'aioseop_ga_attributes', '' ); + $open_script_line = preg_replace( '/\s+/', ' ', " EOF; - } return $analytics; } diff --git a/readme.txt b/readme.txt index 1d2de2543..141f24467 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtor Tags: seo, all in one seo, google, twitter, page, image seo, social, search engine optimization, sitemap, WordPress SEO, meta, meta description, xml sitemap, google sitemap, sitemaps, robots meta, yahoo, bing, news sitemaps, multisite, canonical, nofollow, noindex, keywords, description, webmaster tools, google webmaster tools, google analytics Requires at least: 4.0 Tested up to: 4.8 -Stable tag: 2.3.14.2 +Stable tag: 2.3.15 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html