';
+ return sprintf( $display_row_template, $input_attr, $name, $label_text, $id_attr, $this->get_option_html( $args ) );
}
/**
diff --git a/admin/class-aioseop-helper.php b/admin/class-aioseop-helper.php
new file mode 100644
index 000000000..d349dfbf5
--- /dev/null
+++ b/admin/class-aioseop-helper.php
@@ -0,0 +1,1134 @@
+_set_help_text( $module );
+ }
+ }
+
+ /**
+ * Set this Help Text
+ *
+ * Sets the Help Text according to the module/class in use, but if there is
+ * no class name in $module, then this Help Text will add all module help texts.
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @param string $module All_in_One_SEO_Pack module.
+ */
+ private function _set_help_text( $module ) {
+
+ switch ( $module ) {
+ case 'All_in_One_SEO_Pack':
+ $this->help_text = $this->help_text_general();
+ $this->help_text = array_merge( $this->help_text, $this->help_text_post_meta() );
+ break;
+ case 'All_in_One_SEO_Pack_Performance':
+ $this->help_text = $this->help_text_performance();
+ break;
+ case 'All_in_One_SEO_Pack_Sitemap':
+ $this->help_text = $this->help_text_sitemap();
+ break;
+ case 'All_in_One_SEO_Pack_Opengraph':
+ $this->help_text = $this->help_text_opengraph();
+ break;
+ case 'All_in_One_SEO_Pack_Robots':
+ $this->help_text = $this->help_text_robots_generator();
+ break;
+ case 'All_in_One_SEO_Pack_File_Editor':
+ $this->help_text = $this->help_text_file_editor();
+ break;
+ case 'All_in_One_SEO_Pack_Importer_Exporter':
+ $this->help_text = $this->help_text_importer_exporter();
+ break;
+ case 'All_in_One_SEO_Pack_Bad_Robots':
+ $this->help_text = $this->help_text_bad_robots();
+ break;
+ default:
+ $this->help_text = array_merge(
+ $this->help_text,
+ $this->help_text_general(),
+ $this->help_text_performance(),
+ $this->help_text_sitemap(),
+ $this->help_text_opengraph(),
+ $this->help_text_robots_generator(),
+ $this->help_text_file_editor(),
+ $this->help_text_importer_exporter(),
+ $this->help_text_bad_robots(),
+ $this->help_text_post_meta()
+ );
+ break;
+ }
+
+ if ( AIOSEOPPRO ) {
+ $help_text = aioseop_add_pro_help( $this->help_text );
+
+ // TODO - Get Prefix from PRO Version.
+ foreach ( $help_text as $key => $text ) {
+ $this->help_text[ $key ] = $text;
+ }
+ }
+
+ }
+
+ /**
+ * Help Text General Settings
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_general() {
+ /*
+ * Consider changing the construction of the macros.
+ *
+ * The name of the macro should NOT be inside _e() or __() because it does not make sense as it
+ * won't change with the language.
+ *
+ * Moreover, it will confuse WPCS and it will try to replace %c (as in %category%) to %$1c.
+ * Placeholder %s (%something) has been bug fixed.
+ * @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/698
+ */
+ // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
+ // phpcs:disable WordPress.WP.I18n.UnorderedPlaceholdersText
+ $rtn_help_text = array(
+ // General Settings.
+ 'aiosp_can' => __( 'This option will automatically generate Canonical URLs for your entire WordPress installation. This will help to prevent duplicate content penalties by Google', 'all-in-one-seo-pack' ),
+ 'aiosp_no_paged_canonical_links' => __( 'Checking this option will set the Canonical URL for all paginated content to the first page.', 'all-in-one-seo-pack' ),
+ 'aiosp_customize_canonical_links' => __( 'Checking this option will allow you to customize Canonical URLs for specific posts.', 'all-in-one-seo-pack' ),
+ 'aiosp_use_original_title' => __( 'Use wp_title to get the title used by the theme; this is disabled by default. If you use this option, set your title formats appropriately, as your theme might try to do its own title SEO as well.', 'all-in-one-seo-pack' ),
+ 'aiosp_schema_markup' => __( 'Check this to support Schema.org markup, i.e., itemprop on supported metadata.', 'all-in-one-seo-pack' ),
+ 'aiosp_do_log' => __( 'Check this and All in One SEO Pack will create a log of important events (all-in-one-seo-pack.log) in its plugin directory which might help debugging. Make sure this directory is writable.', 'all-in-one-seo-pack' ),
+
+ // Home Page Settings.
+ 'aiosp_home_title' => __( 'As the name implies, this will be the Meta Title of your homepage. This is independent of any other option. If not set, the default Site Title (found in WordPress under Settings, General, Site Title) will be used.', 'all-in-one-seo-pack' ),
+ 'aiosp_home_description' => __( 'This will be the Meta Description for your homepage. This is independent of any other option. The default is no Meta Description at all if this is not set.', 'all-in-one-seo-pack' ),
+ 'aiosp_home_keywords' => __( 'Enter a comma separated list of your most important keywords for your site that will be written as Meta Keywords on your homepage. Do not stuff everything in here.', 'all-in-one-seo-pack' ),
+ 'aiosp_use_static_home_info' => __( 'Checking this option uses the title, description, and keywords set on your static Front Page.', 'all-in-one-seo-pack' ),
+
+ // Title Settings.
+ 'aiosp_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' ),
+ 'aiosp_home_page_title_format' =>
+ __( 'This controls the format of the title tag for your Home Page.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) .
+ '
',
+ 'aiosp_page_title_format' =>
+ __( 'This controls the format of the title tag for Pages.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) .
+ '
',
+ 'aiosp_post_title_format' =>
+ __( 'This controls the format of the title tag for Posts.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%category_title% - The (main) category of the post', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%category% - Alias for %category_title%', 'all-in-one-seo-pack' ) .
+ '
',
+ 'aiosp_category_title_format' =>
+ __( 'This controls the format of the title tag for Category Archives.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%category_title% - The original title of the category', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%category_description% - The description of the category', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
',
+ 'aiosp_archive_title_format' =>
+ __( 'This controls the format of the title tag for Custom Post Archives.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%archive_title - The original archive title given by wordpress', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
',
+ 'aiosp_date_title_format' =>
+ __( 'This controls the format of the title tag for Date Archives.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%day% - The original archive day given by wordpress, e.g. "17"', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%month% - The original archive month given by wordpress, e.g. "August"', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%year% - The original archive year given by wordpress, e.g. "2007"', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
',
+ 'aiosp_author_title_format' =>
+ __( 'This controls the format of the title tag for Author Archives.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%author% - The original archive title given by wordpress, e.g. "Steve" or "John Smith"', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
',
+ 'aiosp_tag_title_format' =>
+ __( 'This controls the format of the title tag for Tag Archives.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%tag% - The name of the tag', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
',
+ 'aiosp_search_title_format' =>
+ __( 'This controls the format of the title tag for the Search page.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%search% - What was searched for', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
',
+ 'aiosp_description_format' =>
+ __( 'This controls the format of Meta Descriptions.The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%description% - This outputs the description you write for each page/post or the autogenerated description, if you have that option enabled. Auto-generated descriptions are generated from the Post Excerpt, or the first 160 characters of the post content if there is no Post Excerpt.', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%wp_title% - The original WordPress title, e.g. post_title for posts', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%post_date% - The date the page/post was published (localized)', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%post_year% - The year the page/post was published (localized)', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%post_month% - The month the page/post was published (localized)', 'all-in-one-seo-pack' ) .
+ '
',
+ 'aiosp_404_title_format' =>
+ __( 'This controls the format of the title tag for the 404 page.', 'all-in-one-seo-pack' ) . ' ' .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all-in-one-seo-pack' ) .
+ '
' .
+ '
' .
+ __( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all-in-one-seo-pack' ) .
+ '
',
+ 'aiosp_paged_format' =>
+ __( 'This string gets appended/prepended to titles of paged index pages (like home or archive pages).', 'all-in-one-seo-pack' ) .
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '
',
+ //phpcs:enable
+
+ // Custom Post Type Settings.
+ 'aiosp_cpostactive' => __( 'Use these checkboxes to select which Content Types you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
+
+ // Display Settings.
+ 'aiosp_posttypecolumns' => __( 'This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.', 'all-in-one-seo-pack' ),
+
+ // Webmaster Verification.
+ 'aiosp_google_verify' => __( 'Enter your verification code here to verify your site with Google Search Console.', 'all-in-one-seo-pack' ),
+ 'aiosp_bing_verify' => __( 'Enter your verification code here to verify your site with Bing Webmaster Tools.', 'all-in-one-seo-pack' ),
+ 'aiosp_pinterest_verify' => __( 'Enter your verification code here to verify your site with Pinterest.', 'all-in-one-seo-pack' ),
+
+ // Google Settings.
+ 'aiosp_google_publisher' => __( 'Enter your Google+ Profile URL here to add the rel=“author” tag to your site for Google authorship. It is recommended that the URL you enter here should be your personal Google+ profile. Use the Advanced Authorship Options below if you want greater control over the use of authorship.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_disable_profile' => __( 'Check this to remove the Google Plus field from the user profile screen.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_sitelinks_search' => __( 'Add markup to display the Google Sitelinks Search Box next to your search results in Google.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_set_site_name' => __( 'Add markup to tell Google the preferred name for your website.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_specify_site_name' => __( 'Enter your site name.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_author_advanced' => __( 'Enable this to display advanced options for controlling Google Plus authorship information on your website.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_author_location' => __( 'This option allows you to control which types of pages you want to display rel=\"author\" on for Google authorship. The options include the Front Page (the homepage of your site), Posts, Pages, and any Custom Post Types. The Everywhere Else option includes 404, search, categories, tags, custom taxonomies, date archives, author archives and any other page template.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_enable_publisher' => __( 'This option allows you to control whether rel=\"publisher\" is displayed on the homepage of your site. Google recommends using this if the site is a business website.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_specify_publisher' => __( 'The Google+ profile you enter here will appear on your homepage only as the rel=\"publisher\" tag. It is recommended that the URL you enter here should be the Google+ profile for your business.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_analytics_id' => __( 'Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_addl_domains' => __( 'Add a list of additional domains to track here. Enter one domain name per line without the http://.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_anonymize_ip' => __( 'This enables support for IP Anonymization in Google Analytics.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_display_advertising' => __( 'This enables support for the Display Advertiser Features in Google Analytics.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_exclude_users' => __( 'Exclude logged-in users from Google Analytics tracking by role.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_track_outbound_links' => __( 'Check this if you want to track outbound links with Google Analytics.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_link_attribution' => __( 'This enables support for the Enhanced Link Attribution in Google Analytics.', 'all-in-one-seo-pack' ),
+ 'aiosp_ga_enhanced_ecommerce' => __( 'This enables support for the Enhanced Ecommerce in Google Analytics.', 'all-in-one-seo-pack' ),
+
+ // Noindex Settings.
+ 'aiosp_cpostnoindex' => __( 'Set the default NOINDEX setting for each Post Type.', 'all-in-one-seo-pack' ),
+ 'aiosp_cpostnofollow' => __( 'Set the default NOFOLLOW setting for each Post Type.', 'all-in-one-seo-pack' ),
+ 'aiosp_category_noindex' => __( 'Check this to ask search engines not to index Category Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'aiosp_archive_date_noindex' => __( 'Check this to ask search engines not to index Date Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'aiosp_archive_author_noindex' => __( 'Check this to ask search engines not to index Author Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'aiosp_tags_noindex' => __( 'Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'aiosp_search_noindex' => __( 'Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'aiosp_404_noindex' => __( 'Check this to ask search engines not to index the 404 page.', 'all-in-one-seo-pack' ),
+ 'aiosp_paginated_noindex' => __( 'Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'aiosp_paginated_nofollow' => __( 'Check this to ask search engines not to follow links from paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'aiosp_tax_noindex' => __( 'Check this to ask search engines not to index custom Taxonomy archive pages. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+
+ // Advanced Settings.
+ 'aiosp_generate_descriptions' => __( 'Check this and your Meta Descriptions for any Post Type will be auto-generated using the Post Excerpt, or the first 160 characters of the post content if there is no Post Excerpt. You can overwrite any auto-generated Meta Description by editing the post or page.', 'all-in-one-seo-pack' ),
+ 'aiosp_skip_excerpt' => __( 'This option will auto generate your meta descriptions from your post content instead of your post excerpt. This is useful if you want to use your content for your autogenerated meta descriptions instead of the excerpt. WooCommerce users should read the documentation regarding this setting.', 'all-in-one-seo-pack' ),
+ 'aiosp_run_shortcodes' => __( 'Check this and shortcodes will get executed for descriptions auto-generated from content.', 'all-in-one-seo-pack' ),
+ 'aiosp_hide_paginated_descriptions' => __( 'Check this and your Meta Descriptions will be removed from page 2 or later of paginated content.', 'all-in-one-seo-pack' ),
+ 'aiosp_dont_truncate_descriptions' => __( 'Check this to prevent your Description from being truncated regardless of its length.', 'all-in-one-seo-pack' ),
+ 'aiosp_unprotect_meta' => __( "Check this to unprotect internal postmeta fields for use with XMLRPC. If you don't know what that is, leave it unchecked.", 'all-in-one-seo-pack' ),
+ 'aiosp_redirect_attachement_parent' => __( 'Redirect attachment pages to post parent.', 'all-in-one-seo-pack' ),
+ 'aiosp_ex_pages' => __( 'Enter a comma separated list of pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: /forum/, /contact/ For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is add forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage here and it will be excluded from All in One SEO Pack.', 'all-in-one-seo-pack' ),
+ 'aiosp_post_meta_tags' => __( 'What you enter here will be copied verbatim to the header of all Posts. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
+ 'aiosp_page_meta_tags' => __( 'What you enter here will be copied verbatim to the header of all Pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
+ 'aiosp_front_meta_tags' => __( 'What you enter here will be copied verbatim to the header of the front page if you have set a static page in Settings, Reading, Front Page Displays. You can enter whatever additional headers you want here, even references to stylesheets. This will fall back to using Additional Page Headers if you have them set and nothing is entered here.', 'all-in-one-seo-pack' ),
+ 'aiosp_home_meta_tags' => __( 'What you enter here will be copied verbatim to the header of the home page if you have Front page displays your latest posts selected in Settings, Reading. It will also be copied verbatim to the header on the Posts page if you have one set in Settings, Reading. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
+
+ // Keyword Settings.
+ 'aiosp_togglekeywords' => __( 'This option allows you to toggle the use of Meta Keywords throughout the whole of the site.', 'all-in-one-seo-pack' ),
+ 'aiosp_use_categories' => __( 'Check this if you want your categories 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' ),
+ 'aiosp_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' ),
+ 'aiosp_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' ),
+
+ // Unknown Location.
+ 'aiosp_license_key' => __( 'This will be the license key received when the product was purchased. This is used for automatic upgrades.', 'all-in-one-seo-pack' ),
+ 'aiosp_taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
+ 'aiosp_google_connect' => __( 'Press the connect button to connect with Google Analytics; or if already connected, press the disconnect button to disable and remove any stored analytics credentials.', 'all-in-one-seo-pack' ),
+
+ );
+
+ // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
+ $post_types = get_post_types( '', 'names' );
+ foreach ( $post_types as $v1_pt ) {
+ if ( ! isset( $rtn_help_text[ 'aiosp_' . $v1_pt . '_title_format' ] ) ) {
+ $help_text_fields = array();
+ array_push(
+ $help_text_fields,
+ __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ),
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ),
+ __( '%post_title% - The original title of the page', 'all-in-one-seo-pack' )
+ );
+ $pt_obj_taxes = get_object_taxonomies( $v1_pt, 'objects' );
+ foreach ( $pt_obj_taxes as $k2_slug => $v2_tax_obj ) {
+ array_push(
+ $help_text_fields,
+ sprintf( __( "%%tax_%1\$s%% - This post's associated %2\$s taxonomy title", 'all-in-one-seo-pack' ), $k2_slug, $v2_tax_obj->label )
+ );
+ }
+ array_push(
+ $help_text_fields,
+ __( '%post_author_login% - This page\'s author\' login', 'all-in-one-seo-pack' ),
+ __( '%post_author_nicename% - This page\'s author\' nicename', 'all-in-one-seo-pack' ),
+ __( '%post_author_firstname% - This page\'s author\' first name (capitalized)', 'all-in-one-seo-pack' ),
+ __( '%post_author_lastname% - This page\'s author\' last name (capitalized)', 'all-in-one-seo-pack' ),
+ __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ),
+ __( '%post_date% - The date the page was published (localized)', 'all-in-one-seo-pack' ),
+ __( '%post_year% - The year the page was published (localized)', 'all-in-one-seo-pack' ),
+ __( '%post_month% - The month the page was published (localized)', 'all-in-one-seo-pack' )
+ );
+
+ $cpt_help_text = '
';
+ if ( in_array( $k1_slug, $tooltips_with_ul, true ) ) {
+ $br = ' ';
+ }
+
+ $rtn_help_text[ $k1_slug ] .= $br . '' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '';
+ }
+
+ return $rtn_help_text;
+ }
+
+ /**
+ * Help Text Performance Module
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_performance() {
+ $rtn_help_text = array(
+ 'aiosp_performance_memory_limit' => __( 'This setting allows you to raise your PHP memory limit to a reasonable value. Note: WordPress core and other WordPress plugins may also change the value of the memory limit.', 'all-in-one-seo-pack' ),
+ 'aiosp_performance_execution_time' => __( 'This setting allows you to raise your PHP execution time to a reasonable value.', 'all-in-one-seo-pack' ),
+ 'aiosp_performance_force_rewrites' => __( 'Use output buffering to ensure that the title gets rewritten. Enable this option if you run into issues with the title tag being set by your theme or another plugin.', 'all-in-one-seo-pack' ),
+ );
+
+ $help_doc_link = array(
+ 'aiosp_performance_memory_limit' => 'https://semperplugins.com/documentation/performance-settings/#raise-memory-limit',
+ 'aiosp_performance_execution_time' => 'https://semperplugins.com/documentation/performance-settings/#raise-execution-time',
+ 'aiosp_performance_force_rewrites' => 'https://semperplugins.com/documentation/performance-settings/#force-rewrites',
+ );
+
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
+ $rtn_help_text[ $k1_slug ] .= '
' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '';
+ }
+
+ return $rtn_help_text;
+ }
+
+ /**
+ * Help Text Sitemap Module
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_sitemap() {
+ $rtn_help_text = array(
+ 'aiosp_sitemap_rss_sitemap' => __( 'Create RSS Sitemap as well.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_daily_cron' => __( 'Notify search engines based on the selected schedule, and also update static sitemap daily if in use. (this uses WP-Cron, so make sure this is working properly on your server as well)', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_indexes' => __( 'Organize sitemap entries into distinct files in your sitemap. Enable this only if your sitemap contains over 50,000 URLs or the file is over 5MB in size.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_max_posts' => __( 'Allows you to specify the maximum number of posts in a sitemap (up to 50,000).', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_posttypes' => __( 'Select which Post Types appear in your sitemap.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_taxonomies' => __( 'Select which taxonomy archives appear in your sitemap', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_archive' => __( 'Include Date Archives in your sitemap.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_author' => __( 'Include Author Archives in your sitemap.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_images' => __( 'Exclude Images in your sitemap.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_gzipped' => __( 'Create a compressed sitemap file in .xml.gz format.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_robots' => __( 'Places a link to your Sitemap.xml into your virtual Robots.txt file.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_rewrite' => __( 'Dynamically creates the XML sitemap instead of using a static file.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_addl_url' => __( 'URL to the page. This field accepts relative URLs or absolute URLs with the protocol specified.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_addl_prio' => __( 'The priority of the page.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_addl_freq' => __( 'The frequency of the page.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_addl_mod' => __( 'Last modified date of the page.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_excl_categories' => __( 'Entries from these categories will be excluded from the sitemap.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_excl_pages' => __( 'Use page slugs or page IDs, seperated by commas, to exclude pages from the sitemap.', 'all-in-one-seo-pack' ),
+ );
+
+ $parent_prio_help = __( 'Manually set the priority of your ', 'all-in-one-seo-pack' );
+ $parent_freq_help = __( 'Manually set the frequency of your ', 'all-in-one-seo-pack' );
+ $prio_help = __( 'Manually set the priority for the ', 'all-in-one-seo-pack' );
+ $freq_help = __( 'Manually set the frequency for the ', 'all-in-one-seo-pack' );
+ $post_name = __( ' Post Type', 'all-in-one-seo-pack' );
+ $tax_name = __( ' Taxonomy', 'all-in-one-seo-pack' );
+
+ $args = array(
+ 'public' => true,
+ );
+
+ $rtn_help_text['aiosp_sitemap_prio_homepage'] = $parent_prio_help . __( 'Homepage.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_prio_post'] = $parent_prio_help . __( 'posts.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_prio_taxonomies'] = $parent_prio_help . __( 'taxonomies.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_prio_archive'] = $parent_prio_help . __( 'archive pages.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_prio_author'] = $parent_prio_help . __( 'author pages.', 'all-in-one-seo-pack' );
+
+ $post_types = get_post_types( $args, 'names' );
+ foreach ( $post_types as $pt ) {
+ $pt_obj = get_post_type_object( $pt );
+ $rtn_help_text[ 'aiosp_sitemap_prio_post_' . $pt ] = $prio_help . $pt_obj->label . $post_name;
+ $rtn_help_text[ 'aiosp_sitemap_freq_post_' . $pt ] = $freq_help . $pt_obj->label . $post_name;
+ }
+
+ $args = array(
+ 'public' => true,
+ );
+
+ $rtn_help_text['aiosp_sitemap_freq_homepage'] = $parent_freq_help . __( 'Homepage.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_freq_post'] = $parent_freq_help . __( 'posts.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_freq_taxonomies'] = $parent_freq_help . __( 'taxonomies.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_freq_archive'] = $parent_freq_help . __( 'archive pages.', 'all-in-one-seo-pack' );
+ $rtn_help_text['aiosp_sitemap_freq_author'] = $parent_freq_help . __( 'author pages.', 'all-in-one-seo-pack' );
+
+ $taxonomies = get_taxonomies( $args, 'object' );
+ foreach ( $taxonomies as $tax ) {
+ $rtn_help_text[ 'aiosp_sitemap_prio_taxonomies_' . $tax->name ] = $prio_help . $tax->label . $tax_name;
+ $rtn_help_text[ 'aiosp_sitemap_freq_taxonomies_' . $tax->name ] = $freq_help . $tax->label . $tax_name;
+ }
+
+ $help_doc_link = array(
+ // XML Sitemap.
+ 'aiosp_sitemap_rss_sitemap' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#create-rss_sitemap',
+ 'aiosp_sitemap_daily_cron' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#schedule-updates',
+ 'aiosp_sitemap_indexes' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#enable-sitemap-indexes',
+ 'aiosp_sitemap_max_posts' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#enable-sitemap-indexes',
+ 'aiosp_sitemap_posttypes' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#post-types-and-taxonomies',
+ 'aiosp_sitemap_taxonomies' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#post-types-and-taxonomies',
+ 'aiosp_sitemap_archive' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#include-archive-pages',
+ 'aiosp_sitemap_author' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#include-archive-pages',
+ 'aiosp_sitemap_images' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#exclude-images',
+ 'aiosp_sitemap_gzipped' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#create-compressed-sitemap',
+ 'aiosp_sitemap_robots' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#link-from-virtual-robots',
+ 'aiosp_sitemap_rewrite' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#dynamically-generate-sitemap',
+
+ // Additional Pages.
+ 'aiosp_sitemap_addl_url' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
+ 'aiosp_sitemap_addl_prio' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
+ 'aiosp_sitemap_addl_freq' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
+ 'aiosp_sitemap_addl_mod' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
+
+ // Exclude Items.
+ 'aiosp_sitemap_excl_categories' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#excluded-items',
+ 'aiosp_sitemap_excl_pages' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#excluded-items',
+
+ // Priorities.
+ 'aiosp_sitemap_prio_homepage' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_prio_post' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_prio_taxonomies' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_prio_archive' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_prio_author' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+
+ // Frequencies.
+ 'aiosp_sitemap_freq_homepage' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_freq_post' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_freq_taxonomies' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_freq_archive' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+ 'aiosp_sitemap_freq_author' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
+
+ );
+
+ /*
+ * Currently has no links, but may be added later.
+ foreach ( $post_types as $pt ) {
+ $help_doc_link[ 'aiosp_sitemap_prio_post_' . $pt ] = '';
+ $help_doc_link[ 'aiosp_sitemap_freq_post_' . $pt ] = '';
+ }
+ */
+
+ /*
+ * Currently has no links, but may be added later.
+ foreach ( $taxonomies as $tax ) {
+ $help_doc_link[ 'aiosp_sitemap_prio_taxonomies_' . $tax->name ] = '';
+ $help_doc_link[ 'aiosp_sitemap_freq_taxonomies_' . $tax->name ] = '';
+ }
+ */
+
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
+ $rtn_help_text[ $k1_slug ] .= '
' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '';
+ }
+
+ return $rtn_help_text;
+ }
+
+ /**
+ * Help Text Opengraph Module
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_opengraph() {
+ $rtn_help_text = array(
+ // Home Page Settings.
+ 'aiosp_opengraph_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' ),
+ 'aiosp_opengraph_sitename' => __( 'The Site Name is the name that is used to identify your website.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_hometitle' => __( 'The Home Title is the Open Graph title for your home page.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_description' => __( 'The Home Description is the Open Graph description for your home page.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_homeimage' => __( 'The Home Image is the Open Graph image for your home page.', 'all-in-one-seo-pack' ),
+
+ // Image Settings.
+ 'aiosp_opengraph_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' ),
+ 'aiosp_opengraph_fallback' => __( 'This option lets you fall back to the default image if no image could be found above.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_dimg' => __( 'This option sets a default image that can be used for the Open Graph image. You can upload an image, select an image from your Media Library or paste the URL of an image here.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_dimgwidth' => __( 'This option lets you set a default width for your images, where unspecified.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_dimgheight' => __( 'This option lets you set a default height for your images, where unspecified.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_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' ),
+
+ // Social Profile Links.
+ 'aiosp_opengraph_profile_links' => __( 'Add URLs for your website\'s social profiles here (Facebook, Twitter, Google+, Instagram, LinkedIn), one per line.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_person_or_org' => __( 'Are the social profile links for your website for a person or an organization?', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_social_name' => __( 'Add the name of the person or organization who owns these profiles.', 'all-in-one-seo-pack' ),
+
+ // Facebook Settings.
+ 'aiosp_opengraph_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' ),
+ 'aiosp_opengraph_appid' => __( 'Enter your Facebook App ID here. Information about how to get your Facebook App ID can be found at https://developers.facebook.com/docs/apps/register', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_gen_tags' => __( 'Automatically generate article tags for Facebook type article when not provided.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_gen_keywords' => __( 'Use keywords in generated article tags.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_gen_categories' => __( 'Use categories in generated article tags.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_gen_post_tags' => __( 'Use post tags in generated article tags.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_types' => __( 'Select which Post Types you want to use All in One SEO Pack to set Open Graph meta values for.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_facebook_publisher' => __( 'Link articles to the Facebook page associated with your website.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_facebook_author' => __( 'Allows your authors to be identified by their Facebook pages as content authors on the Opengraph meta for their articles.', 'all-in-one-seo-pack' ),
+
+ // Twitter Settings.
+ 'aiosp_opengraph_defcard' => __( 'Select the default type of Twitter Card to display.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_twitter_site' => __( 'Enter the Twitter username associated with your website here.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_twitter_creator' => __( 'Allows your authors to be identified by their Twitter usernames as content creators on the Twitter cards for their posts.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_twitter_domain' => __( 'Enter the name of your website here.', 'all-in-one-seo-pack' ),
+
+ // Advanced Settings.
+ 'aiosp_opengraph_title_shortcodes' => __( 'Run shortcodes that appear in social title meta tags.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_description_shortcodes' => __( 'Run shortcodes that appear in social description meta tags.', 'all-in-one-seo-pack' ),
+ 'aiosp_opengraph_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' ),
+
+ // POST META.
+ 'aioseop_opengraph_settings_title' => __( 'This is the Open Graph title of this Page or Post.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_desc' => __( 'This is the Open Graph description of this Page or Post.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_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' ),
+ 'aioseop_opengraph_settings_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' ),
+ 'aioseop_opengraph_settings_imagewidth' => __( 'Enter the width for your Open Graph image in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_imageheight' => __( 'Enter the height for your Open Graph image in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_video' => __( 'This option lets you specify a link to the Open Graph video used on this Page or Post.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_videowidth' => __( 'Enter the width for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_videoheight' => __( 'Enter the height for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_category' => __( 'Select the Open Graph type that best describes the content of this Page or Post.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_facebook_debug' => __( 'Press this button to have Facebook re-fetch and debug this page.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_section' => __( 'This Open Graph meta allows you to add a general section name that best describes this content.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_tag' => __( 'This Open Graph meta allows you to add a list of keywords that best describe this content.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_setcard' => __( 'Select the Twitter Card type to use for this Page or Post, overriding the default setting.', 'all-in-one-seo-pack' ),
+ 'aioseop_opengraph_settings_customimg_twitter' => __( 'This option lets you upload an image to use as the Twitter image for this Page or Post.', 'all-in-one-seo-pack' ),
+ );
+
+ $args = array(
+ 'public' => true,
+ );
+
+ $post_types = get_post_types( $args, 'names' );
+ foreach ( $post_types as $pt ) {
+ $rtn_help_text[ 'aiosp_opengraph_' . $pt . '_fb_object_type' ] = __( 'Choose a default value that best describes the content of your post type.', 'all-in-one-seo-pack' );
+ $rtn_help_text[ 'aiosp_opengraph_' . $pt . '_fb_object_type' ] .= '
' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '';
+ }
+
+ return $rtn_help_text;
+ }
+
+ /**
+ * Help Text Robots Generator Module
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_robots_generator() {
+ $rtn_help_text = array(
+ 'aiosp_robots_type' => __( 'Rule Type', 'all-in-one-seo-pack' ),
+ 'aiosp_robots_agent' => __( 'User Agent', 'all-in-one-seo-pack' ),
+ 'aiosp_robots_path' => __( 'Directory Path', 'all-in-one-seo-pack' ),
+ );
+
+ return $rtn_help_text;
+ }
+
+ /**
+ * Help Text File Editor Module
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_file_editor() {
+ return array(
+ 'aiosp_file_editor_htaccfile' => __( '.htaccess editor', 'all-in-one-seo-pack' ),
+ );
+ }
+
+ /**
+ * Help Text Importer Exporter Module
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_importer_exporter() {
+ $rtn_help_text = array(
+ // Possible HTML link concept IF links become usable inside jQuery UI Tooltips.
+ 'aiosp_importer_exporter_import_submit' => __( 'Choose a valid All in One SEO Pack ini file and click "Import" to import options from a previous state or install of All in One SEO Pack.', 'all-in-one-seo-pack' ),
+ 'aiosp_importer_exporter_export_choices' => __( 'You may choose to export settings from active modules, and content from post data.', 'all-in-one-seo-pack' ),
+ 'aiosp_importer_exporter_export_post_types' => __( 'Select which Post Types you want to export your All in One SEO Pack meta data for.', 'all-in-one-seo-pack' ),
+ );
+
+ $help_doc_link = array(
+ 'aiosp_importer_exporter_import_submit' => 'https://semperplugins.com/documentation/importer-exporter-module/',
+ 'aiosp_importer_exporter_export_choices' => 'https://semperplugins.com/documentation/importer-exporter-module/',
+ 'aiosp_importer_exporter_export_post_types' => 'https://semperplugins.com/documentation/importer-exporter-module/',
+ );
+
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
+ $rtn_help_text[ $k1_slug ] .= '
' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '';
+ }
+
+ return $rtn_help_text;
+ }
+
+ /**
+ * Help Text Bad Robots Module
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @return array
+ */
+ private function help_text_bad_robots() {
+ return array(
+ 'aiosp_bad_robots_block_bots' => __( 'Block requests from user agents that are known to misbehave with 503.', 'all-in-one-seo-pack' ),
+ 'aiosp_bad_robots_block_refer' => __( 'Block Referral Spam using HTTP.', 'all-in-one-seo-pack' ),
+ 'aiosp_bad_robots_track_blocks' => __( 'Log and show recent requests from blocked bots.', 'all-in-one-seo-pack' ),
+ 'aiosp_bad_robots_edit_blocks' => __( 'Check this to edit the list of disallowed user agents for blocking bad bots.', 'all-in-one-seo-pack' ),
+ 'aiosp_bad_robots_blocklist' => __( 'This is the list of disallowed user agents used for blocking bad bots.', 'all-in-one-seo-pack' ),
+ 'aiosp_bad_robots_referlist' => __( 'This is the list of disallowed referers used for blocking bad bots.', 'all-in-one-seo-pack' ),
+ 'aiosp_bad_robots_blocked_log' => __( 'Shows log of most recent requests from blocked bots. Note: this will not track any bots that were already blocked at the web server / .htaccess level.', 'all-in-one-seo-pack' ),
+ );
+ }
+
+ /**
+ * Help Text Post Meta (Core Module)
+ *
+ * @ignore
+ * @since 2.4.2
+ * @access private
+ *
+ * @see self::_help_text_opengraph() Also adds Post Meta info.
+ *
+ * @return array
+ */
+ private function help_text_post_meta() {
+ $rtn_help_text = array(
+ 'aiosp_snippet' => __( 'A preview of what this page might look like in search engine results.', 'all-in-one-seo-pack' ),
+ 'aiosp_title' => __( 'A custom title that shows up in the title tag for this page.', 'all-in-one-seo-pack' ),
+ 'aiosp_description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all-in-one-seo-pack' ),
+ 'aiosp_keywords' => __( 'A comma separated list of your most important keywords for this page that will be written as META keywords.', 'all-in-one-seo-pack' ),
+ 'aiosp_custom_link' => __( 'Override the canonical URLs for this post.', 'all-in-one-seo-pack' ),
+ 'aiosp_noindex' => __( 'Check this box to ask search engines not to index this page.', 'all-in-one-seo-pack' ),
+ 'aiosp_nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all-in-one-seo-pack' ),
+ 'aiosp_sitemap_exclude' => __( 'Don\'t display this page in the sitemap.', 'all-in-one-seo-pack' ),
+ 'aiosp_disable' => __( 'Disable SEO on this page.', 'all-in-one-seo-pack' ),
+ 'aiosp_disable_analytics' => __( 'Disable Google Analytics on this page.', 'all-in-one-seo-pack' ),
+ );
+
+ $help_doc_link = array(
+ 'aiosp_snippet' => 'https://semperplugins.com/documentation/post-settings/#preview-snippet',
+ 'aiosp_title' => 'https://semperplugins.com/documentation/post-settings/#title',
+ 'aiosp_description' => 'https://semperplugins.com/documentation/post-settings/#description',
+ 'aiosp_keywords' => 'https://semperplugins.com/documentation/post-settings/#keywords',
+ 'aiosp_custom_link' => 'https://semperplugins.com/documentation/post-settings/#custom-canonical-url',
+ 'aiosp_noindex' => 'https://semperplugins.com/documentation/post-settings/#robots-meta-noindex',
+ 'aiosp_nofollow' => 'https://semperplugins.com/documentation/post-settings/#robots-meta-nofollow',
+ 'aiosp_sitemap_exclude' => 'https://semperplugins.com/documentation/post-settings/#exclude-from-sitemap',
+ 'aiosp_disable' => 'https://semperplugins.com/documentation/post-settings/#disable-on-this-post',
+ 'aiosp_disable_analytics' => 'https://semperplugins.com/documentation/post-settings/#disable-google-analytics',
+ );
+
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
+ $rtn_help_text[ $k1_slug ] .= '
' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '';
+ }
+
+ return $rtn_help_text;
+ }
+
+ /**
+ * Get Help Text
+ *
+ * Gets an individual help text if it exists, otherwise an error is returned
+ * to notify the AIOSEOP Devs.
+ * NOTE: Returning an empty string causes issues with the UI.
+ *
+ * @since 2.4.2
+ *
+ * @param string $slug Module option slug.
+ * @return string
+ */
+ public function get_help_text( $slug ) {
+ if ( isset( $this->help_text[ $slug ] ) ) {
+ return esc_html( $this->help_text[ $slug ] );
+ }
+ return 'DEV: Missing Help Text: ' . $slug;
+ }
+}
diff --git a/aioseop_class.php b/aioseop_class.php
index e88d63f12..406d673f4 100644
--- a/aioseop_class.php
+++ b/aioseop_class.php
@@ -79,283 +79,6 @@ function __construct() {
$blog_name = esc_attr( get_bloginfo( 'name' ) );
parent::__construct();
- /*
- * Consider changing the construction of the macros.
- *
- * The name of the macro should NOT be inside _e() or __() because it does not make sense as it
- * won't change with the language.
- *
- * Moreover, it will confuse WPCS and it will try to replace %c (as in %category%) to %$1c.
- * Placeholder %s (%something) has been bug fixed.
- * @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/698
- */
- // @codingStandardsIgnoreStart
- $this->help_text = array(
- 'license_key' => __( 'This will be the license key received when the product was purchased. This is used for automatic upgrades.', 'all-in-one-seo-pack' ),
- 'can' => __( 'This option will automatically generate Canonical URLs for your entire WordPress installation. This will help to prevent duplicate content penalties by Google', 'all-in-one-seo-pack' ),
- 'no_paged_canonical_links' => __( 'Checking this option will set the Canonical URL for all paginated content to the first page.', 'all-in-one-seo-pack' ),
- 'customize_canonical_links' => __( 'Checking this option will allow you to customize Canonical URLs for specific posts.', 'all-in-one-seo-pack' ),
- 'use_original_title' => __( 'Use wp_title to get the title used by the theme; this is disabled by default. If you use this option, set your title formats appropriately, as your theme might try to do its own title SEO as well.', 'all-in-one-seo-pack' ),
- 'do_log' => __( 'Check this and All in One SEO Pack will create a log of important events (all-in-one-seo-pack.log) in its plugin directory which might help debugging. Make sure this directory is writable.', 'all-in-one-seo-pack' ),
- 'home_title' => __( 'As the name implies, this will be the Meta Title of your homepage. This is independent of any other option. If not set, the default Site Title (found in WordPress under Settings, General, Site Title) will be used.', 'all-in-one-seo-pack' ),
- 'home_description' => __( 'This will be the Meta Description for your homepage. This is independent of any other option. The default is no Meta Description at all if this is not set.', 'all-in-one-seo-pack' ),
- 'home_keywords' => __( 'Enter a comma separated list of your most important keywords for your site that will be written as Meta Keywords on your homepage. Do not stuff everything in here.', 'all-in-one-seo-pack' ),
- 'use_static_home_info' => __( 'Checking this option uses the title, description, and keywords set on your static Front Page.', 'all-in-one-seo-pack' ),
- 'togglekeywords' => __( 'This option allows you to toggle the use of Meta Keywords throughout the whole of the site.', 'all-in-one-seo-pack' ),
- 'use_categories' => __( 'Check this if you want your categories 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' ),
- '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' ),
- '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' )
- . '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) . '
',
- 'page_title_format' =>
- __( 'This controls the format of the title tag for Pages. The following macros are supported:', 'all-in-one-seo-pack' )
- . '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%page_title% - The original title of the page', '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' )
- . '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . '
' .
- __( '%category_title% - The (main) category of the post', 'all-in-one-seo-pack' ) . '
' .
- __( '%category% - Alias for %category_title%', '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' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%category_title% - The original title of the category', 'all-in-one-seo-pack' ) . '
' .
- __( '%category_description% - The description of the category', 'all-in-one-seo-pack' ) . '
',
- 'archive_title_format' =>
- __( 'This controls the format of the title tag for Custom Post Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%archive_title - The original archive title given by wordpress', 'all-in-one-seo-pack' ) . '
',
- 'date_title_format' =>
- __( 'This controls the format of the title tag for Date Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all-in-one-seo-pack' ) . '
' .
- __( '%day% - The original archive day given by wordpress, e.g. "17"', 'all-in-one-seo-pack' ) . '
' .
- __( '%month% - The original archive month given by wordpress, e.g. "August"', 'all-in-one-seo-pack' ) . '
' .
- __( '%year% - The original archive year given by wordpress, e.g. "2007"', 'all-in-one-seo-pack' ) . '
',
- 'author_title_format' =>
- __( 'This controls the format of the title tag for Author Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%author% - The original archive title given by wordpress, e.g. "Steve" or "John Smith"', 'all-in-one-seo-pack' ) . '
',
- 'tag_title_format' =>
- __( 'This controls the format of the title tag for Tag Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%tag% - The name of the tag', 'all-in-one-seo-pack' ) . '
',
- 'search_title_format' =>
- __( 'This controls the format of the title tag for the Search page. The following macros are supported:', 'all-in-one-seo-pack' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%search% - What was searched for', 'all-in-one-seo-pack' ) . '
',
- 'description_format' => __( 'This controls the format of Meta Descriptions.The following macros are supported:', 'all-in-one-seo-pack' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%description% - This outputs the description you write for each page/post or the autogenerated description, if you have that option enabled. Auto-generated descriptions are generated from the Post Excerpt, or the first 160 characters of the post content if there is no Post Excerpt.', 'all-in-one-seo-pack' ) . '
' .
- __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . '
' .
- __( '%wp_title% - The original WordPress title, e.g. post_title for posts', 'all-in-one-seo-pack' ) . '
' .
- __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '
' .
- __( '%post_date% - The date the page/post was published (localized)', 'all-in-one-seo-pack' ) . '
' .
- __( '%post_year% - The year the page/post was published (localized)', 'all-in-one-seo-pack' ) . '
' .
- __( '%post_month% - The month the page/post was published (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' ) .
- '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all-in-one-seo-pack' ) . '
' .
- __( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all-in-one-seo-pack' ) . '
',
- 'paged_format' => __( 'This string gets appended/prepended to titles of paged index pages (like home or archive pages).', 'all-in-one-seo-pack' )
- . __( 'The following macros are supported:', 'all-in-one-seo-pack' )
- . '
',
- 'cpostactive' => __( 'Use these checkboxes to select which Content Types you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
- 'taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
- 'posttypecolumns' => __( 'This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.', 'all-in-one-seo-pack' ),
- 'google_verify' => __( "Enter your verification code here to verify your site with Google Search Console. Click here for documentation on this setting", 'all-in-one-seo-pack' ),
- 'bing_verify' => __( "Enter your verification code here to verify your site with Bing Webmaster Tools. Click here for documentation on this setting", 'all-in-one-seo-pack' ),
- 'pinterest_verify' => __( "Enter your verification code here to verify your site with Pinterest. Click here for documentation on this setting", 'all-in-one-seo-pack' ),
- 'google_publisher' => __( 'Enter your Google+ Profile URL here to add the rel=“author” tag to your site for Google authorship. It is recommended that the URL you enter here should be your personal Google+ profile. Use the Advanced Authorship Options below if you want greater control over the use of authorship.', 'all-in-one-seo-pack' ),
- 'google_disable_profile' => __( 'Check this to remove the Google Plus field from the user profile screen.', 'all-in-one-seo-pack' ),
- 'google_author_advanced' => __( 'Enable this to display advanced options for controlling Google Plus authorship information on your website.', 'all-in-one-seo-pack' ),
- 'google_author_location' => __( 'This option allows you to control which types of pages you want to display rel=\"author\" on for Google authorship. The options include the Front Page (the homepage of your site), Posts, Pages, and any Custom Post Types. The Everywhere Else option includes 404, search, categories, tags, custom taxonomies, date archives, author archives and any other page template.', 'all-in-one-seo-pack' ),
- 'google_enable_publisher' => __( 'This option allows you to control whether rel=\"publisher\" is displayed on the homepage of your site. Google recommends using this if the site is a business website.', 'all-in-one-seo-pack' ),
- 'google_specify_publisher' => __( 'The Google+ profile you enter here will appear on your homepage only as the rel=\"publisher\" tag. It is recommended that the URL you enter here should be the Google+ profile for your business.', 'all-in-one-seo-pack' ),
- 'google_sitelinks_search' => __( 'Add markup to display the Google Sitelinks Search Box next to your search results in Google.', 'all-in-one-seo-pack' ),
- 'google_set_site_name' => __( 'Add markup to tell Google the preferred name for your website.', 'all-in-one-seo-pack' ),
- 'google_connect' => __( 'Press the connect button to connect with Google Analytics; or if already connected, press the disconnect button to disable and remove any stored analytics credentials.', 'all-in-one-seo-pack' ),
- 'google_analytics_id' => __( 'Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.', 'all-in-one-seo-pack' ),
- 'ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
- 'ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
- 'ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
- 'ga_addl_domains' => __( 'Add a list of additional domains to track here. Enter one domain name per line without the http://.', 'all-in-one-seo-pack' ),
- 'ga_anonymize_ip' => __( 'This enables support for IP Anonymization in Google Analytics.', 'all-in-one-seo-pack' ),
- 'ga_display_advertising' => __( 'This enables support for the Display Advertiser Features in Google Analytics.', 'all-in-one-seo-pack' ),
- 'ga_exclude_users' => __( 'Exclude logged-in users from Google Analytics tracking by role.', 'all-in-one-seo-pack' ),
- 'ga_track_outbound_links' => __( 'Check this if you want to track outbound links with Google Analytics.', 'all-in-one-seo-pack' ),
- 'ga_link_attribution' => __( 'This enables support for the Enhanced Link Attribution in Google Analytics.', 'all-in-one-seo-pack' ),
- 'ga_enhanced_ecommerce' => __( 'This enables support for the Enhanced Ecommerce in Google Analytics.', 'all-in-one-seo-pack' ),
- 'cpostnoindex' => __( 'Set the default NOINDEX setting for each Post Type.', 'all-in-one-seo-pack' ),
- 'cpostnofollow' => __( 'Set the default NOFOLLOW setting for each Post Type.', 'all-in-one-seo-pack' ),
-
- 'category_noindex' => __( 'Check this to ask search engines not to index Category Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- 'archive_date_noindex' => __( 'Check this to ask search engines not to index Date Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- 'archive_author_noindex' => __( 'Check this to ask search engines not to index Author Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- 'tags_noindex' => __( 'Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- 'search_noindex' => __( 'Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- '404_noindex' => __( 'Check this to ask search engines not to index the 404 page.', 'all-in-one-seo-pack' ),
- 'tax_noindex' => __( 'Check this to ask search engines not to index custom Taxonomy archive pages. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- 'paginated_noindex' => __( 'Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- 'paginated_nofollow' => __( 'Check this to ask search engines not to follow links from paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
- 'skip_excerpt' => __( 'This option will auto generate your meta descriptions from your post content instead of your post excerpt. This is useful if you want to use your content for your autogenerated meta descriptions instead of the excerpt. WooCommerce users should read the documentation regarding this setting.', 'all-in-one-seo-pack' ),
- 'generate_descriptions' => __( 'Check this and your Meta Descriptions for any Post Type will be auto-generated using the Post Excerpt, or the first 160 characters of the post content if there is no Post Excerpt. You can overwrite any auto-generated Meta Description by editing the post or page.', 'all-in-one-seo-pack' ),
- 'run_shortcodes' => __( 'Check this and shortcodes will get executed for descriptions auto-generated from content.', 'all-in-one-seo-pack' ),
- 'hide_paginated_descriptions' => __( 'Check this and your Meta Descriptions will be removed from page 2 or later of paginated content.', 'all-in-one-seo-pack' ),
- 'dont_truncate_descriptions' => __( 'Check this to prevent your Description from being truncated regardless of its length.', 'all-in-one-seo-pack' ),
- 'schema_markup' => __( 'Check this to support Schema.org markup, i.e., itemprop on supported metadata.', 'all-in-one-seo-pack' ),
- 'unprotect_meta' => __( "Check this to unprotect internal postmeta fields for use with XMLRPC. If you don't know what that is, leave it unchecked.", 'all-in-one-seo-pack' ),
- 'redirect_attachement_parent' => __( 'Redirect attachment pages to post parent.', 'all-in-one-seo-pack' ),
- 'ex_pages' => __( 'Enter a comma separated list of pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: /forum/, /contact/ For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is add forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage here and it will be excluded from All in One SEO Pack.', 'all-in-one-seo-pack' ),
- 'post_meta_tags' => __( 'What you enter here will be copied verbatim to the header of all Posts. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
- 'page_meta_tags' => __( 'What you enter here will be copied verbatim to the header of all Pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
- 'front_meta_tags' => __( 'What you enter here will be copied verbatim to the header of the front page if you have set a static page in Settings, Reading, Front Page Displays. You can enter whatever additional headers you want here, even references to stylesheets. This will fall back to using Additional Page Headers if you have them set and nothing is entered here.', 'all-in-one-seo-pack' ),
- 'home_meta_tags' => __( 'What you enter here will be copied verbatim to the header of the home page if you have Front page displays your latest posts selected in Settings, Reading. It will also be copied verbatim to the header on the Posts page if you have one set in Settings, Reading. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
- );
- // @codingStandardsIgnoreStop
-
- $this->help_anchors = array(
- 'license_key' => '#license-key',
- 'can' => '#canonical-urls',
- 'no_paged_canonical_links' => '#no-pagination-for-canonical-urls',
- 'customize_canonical_links' => '#enable-custom-canonical-urls',
- 'use_original_title' => '#use-original-title',
- 'schema_markup' => '#use-schema-markup',
- 'do_log' => '#log-important-events',
- 'home_title' => '#home-title',
- 'home_description' => '#home-description',
- 'home_keywords' => '#home-keywords',
- 'use_static_home_info' => '#use-static-front-page-instead',
- 'togglekeywords' => '#use-keywords',
- 'use_categories' => '#use-categories-for-meta-keywords',
- 'use_tags_as_keywords' => '#use-tags-for-meta-keywords',
- 'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
- 'rewrite_titles' => '#rewrite-titles',
- 'home_page_title_format' => '#title-format-fields',
- 'page_title_format' => '#title-format-fields',
- 'post_title_format' => '#title-format-fields',
- 'category_title_format' => '#title-format-fields',
- 'archive_title_format' => '#title-format-fields',
- 'date_title_format' => '#title-format-fields',
- 'author_title_format' => '#title-format-fields',
- 'tag_title_format' => '#title-format-fields',
- 'search_title_format' => '#title-format-fields',
- 'description_format' => '#title-format-fields',
- '404_title_format' => '#title-format-fields',
- 'paged_format' => '#title-format-fields',
- 'cpostactive' => '#seo-on-only-these-post-types',
- 'taxactive' => '#seo-on-only-these-taxonomies',
- 'posttypecolumns' => '#show-column-labels-for-custom-post-types',
- 'google_verify' => '',
- 'bing_verify' => '',
- 'pinterest_verify' => '',
- 'google_publisher' => '#google-plus-default-profile',
- 'google_disable_profile' => '#disable-google-plus-profile',
- 'google_sitelinks_search' => '#display-sitelinks-search-box',
- 'google_set_site_name' => '#set-preferred-site-name',
- 'google_author_advanced' => '#advanced-authorship-options',
- 'google_author_location' => '#display-google-authorship',
- 'google_enable_publisher' => '#display-publisher-meta-on-front-page',
- 'google_specify_publisher' => '#specify-publisher-url',
- 'google_analytics_id' => 'https://semperplugins.com/documentation/setting-up-google-analytics/',
- 'ga_domain' => '#tracking-domain',
- 'ga_multi_domain' => '#track-multiple-domains-additional-domains',
- 'ga_addl_domains' => '#track-multiple-domains-additional-domains',
- 'ga_anonymize_ip' => '#anonymize-ip-addresses',
- 'ga_display_advertising' => '#display-advertiser-tracking',
- 'ga_exclude_users' => '#exclude-users-from-tracking',
- 'ga_track_outbound_links' => '#track-outbound-links',
- 'ga_link_attribution' => '#enhanced-link-attribution',
- 'ga_enhanced_ecommerce' => '#enhanced-ecommerce',
- 'cpostnoindex' => '#noindex',
- 'cpostnofollow' => '#nofollow',
- 'category_noindex' => '#noindex-settings',
- 'archive_date_noindex' => '#noindex-settings',
- 'archive_author_noindex' => '#noindex-settings',
- 'tags_noindex' => '#noindex-settings',
- 'search_noindex' => '#use-noindex-for-the-search-page',
- '404_noindex' => '#use-noindex-for-the-404-page',
- 'tax_noindex' => '#use-noindex-for-the-taxonomy-archives',
- 'paginated_noindex' => '#use-noindex-for-paginated-pages-posts',
- 'paginated_nofollow' => '#use-nofollow-for-paginated-pages-posts',
- 'skip_excerpt' => '#avoid-using-the-excerpt-in-descriptions',
- 'generate_descriptions' => '#autogenerate-descriptions',
- 'run_shortcodes' => '#run-shortcodes-in-autogenerated-descriptions',
- 'hide_paginated_descriptions' => '#remove-descriptions-for-paginated-pages',
- 'dont_truncate_descriptions' => '#never-shorten-long-descriptions',
- 'unprotect_meta' => '#unprotect-post-meta-fields',
- 'redirect_attachement_parent' => '#redirect-attachments-to-post-parent',
- 'ex_pages' => '#exclude-pages',
- 'post_meta_tags' => '#additional-post-headers',
- 'page_meta_tags' => '#additional-page-headers',
- 'front_meta_tags' => '#additional-front-page-headers',
- 'home_meta_tags' => '#additional-blog-page-headers',
- 'snippet' => '#preview-snippet',
- 'title' => '#title',
- 'description' => '#description',
- 'keywords' => '#keywords',
- 'custom_link' => '#custom-canonical-url',
- 'noindex' => '#robots-meta-noindex',
- 'nofollow' => '#robots-meta-nofollow',
- 'sitemap_exclude' => '#exclude-from-sitemap',
- 'disable' => '#disable-on-this-post',
- 'disable_analytics' => '#disable-google-analytics',
- );
-
- $meta_help_text = array(
- 'snippet' => __( 'A preview of what this page might look like in search engine results.', 'all-in-one-seo-pack' ),
- 'title' => __( 'A custom title that shows up in the title tag for this page.', 'all-in-one-seo-pack' ),
- 'description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all-in-one-seo-pack' ),
- 'keywords' => __( 'A comma separated list of your most important keywords for this page that will be written as META keywords.', 'all-in-one-seo-pack' ),
- 'custom_link' => __( 'Override the canonical URLs for this post.', 'all-in-one-seo-pack' ),
- 'noindex' => __( 'Check this box to ask search engines not to index this page.', 'all-in-one-seo-pack' ),
- 'nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all-in-one-seo-pack' ),
- 'sitemap_exclude' => __( "Don't display this page in the sitemap.", 'all-in-one-seo-pack' ),
- 'disable' => __( 'Disable SEO on this page.', 'all-in-one-seo-pack' ),
- 'disable_analytics' => __( 'Disable Google Analytics on this page.', 'all-in-one-seo-pack' ),
- );
-
$this->default_options = array(
'license_key' => array(
'name' => __( 'License Key:', 'all-in-one-seo-pack' ),
@@ -966,12 +689,6 @@ function __construct() {
),
);
- if ( ! empty( $meta_help_text ) ) {
- foreach ( $meta_help_text as $k => $v ) {
- $this->locations['aiosp']['default_options'][ $k ]['help_text'] = $v;
- }
- }
-
$this->layout = array(
'default' => array(
'name' => __( 'General Settings', 'all-in-one-seo-pack' ),
@@ -1095,7 +812,6 @@ function __construct() {
if ( AIOSEOPPRO ) {
// Add Pro options.
$this->default_options = aioseop_add_pro_opt( $this->default_options );
- $this->help_text = aioseop_add_pro_help( $this->help_text );
$this->layout = aioseop_add_pro_layout( $this->layout );
}
@@ -1111,7 +827,6 @@ function __construct() {
$this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
if ( is_admin() ) {
- $this->add_help_text_links();
add_action( 'aioseop_global_settings_header', array( $this, 'display_right_sidebar' ) );
add_action( 'aioseop_global_settings_footer', array( $this, 'display_settings_footer' ) );
add_action( 'output_option', array( $this, 'custom_output_option' ), 10, 2 );
@@ -3196,28 +2911,6 @@ function add_page_hooks() {
'aiosp_cpostactive\[\]' => $p,
),
);
- $this->help_text[ $field ] = __( 'The following macros are supported:', 'all-in-one-seo-pack' )
- . '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%post_title% - The original title of the post.', 'all-in-one-seo-pack' ) . '
' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '
' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '
' .
- __( '%taxonomy_title% - The original title of the taxonomy', 'all-in-one-seo-pack' ) . '
' .
- __( '%taxonomy_description% - The description of the taxonomy', 'all-in-one-seo-pack' ) . '
';
- $this->help_anchors[ $field ] = '#custom-titles';
$this->layout['cpt']['options'][] = $field;
}
}
}
$this->setting_options();
- $this->add_help_text_links();
if ( AIOSEOPPRO ) {
global $aioseop_update_checker;
diff --git a/css/modules/aioseop_module.css b/css/modules/aioseop_module.css
index 3889834e5..d8788722f 100644
--- a/css/modules/aioseop_module.css
+++ b/css/modules/aioseop_module.css
@@ -136,12 +136,13 @@ div.aioseop_tip_icon:before {
font-weight: bold;
line-height: 19px;
display: inline-block;
+ float: left;
text-align: left;
- position: absolute;
font-family: 'Open Sans', sans-serif;
width: 26%;
min-width: 120px;
max-width: 230px;
+ cursor: default;
}
.aioseop_option_div {
diff --git a/js/aioseop-helper.js b/js/aioseop-helper.js
new file mode 100644
index 000000000..070743d10
--- /dev/null
+++ b/js/aioseop-helper.js
@@ -0,0 +1,56 @@
+/**
+ * Use for JavaScript compatability by using anonymous functions; which
+ * are loaded into the footer.
+ *
+ * @summary AIOSEOP Footer JS
+ *
+ * @since 2.4.2
+ */
+(function($) {
+ /**
+ * jQuery UI Tooltips
+ *
+ * Initiates the jQuery UI Tooltips on the admin pages with the class and
+ * title attributes set properly.
+ *
+ * @since 2.4.1.1
+ *
+ * @link http://api.jqueryui.com/tooltip/
+ */
+ function aioseopTooltips() {
+ $( ".aioseop_help_text_link" ).tooltip({
+ open: function( event, ui ) {
+ ui.tooltip.css( "min-width", "170px" );
+ ui.tooltip.css( "max-width", "396px" );
+
+ if ( 'undefined' === typeof( event.originalEvent ) ) {
+ return false;
+ }
+
+ var $id = $( ui.tooltip ).attr( 'id' );
+
+ // Close any lingering tooltips.
+ $( 'div.ui-tooltip' ).not( '#' + $id ).remove();
+
+ // AJAX function to pull in data and add it to the tooltip goes here.
+ },
+ close: function( event, ui ) {
+ ui.tooltip.hover(
+ function() {
+ $( this ).stop( true ).fadeTo( 400, 1 );
+ },
+ function() {
+ $( this ).fadeOut( '400', function() {
+ $( this ).remove();
+ });
+ }
+ );
+ },
+ content: function( callback ) {
+ callback( $( this ).prop( "title" ) );
+ }
+ });
+ }
+
+ aioseopTooltips();
+}(jQuery));
diff --git a/js/aioseop-helper.min.js b/js/aioseop-helper.min.js
new file mode 100644
index 000000000..c182cbbfc
--- /dev/null
+++ b/js/aioseop-helper.min.js
@@ -0,0 +1 @@
+!function(n){n(".aioseop_help_text_link").tooltip({open:function(t,o){if(o.tooltip.css("min-width","170px"),o.tooltip.css("max-width","396px"),void 0===t.originalEvent)return!1;var i=n(o.tooltip).attr("id");n("div.ui-tooltip").not("#"+i).remove()},close:function(t,o){o.tooltip.hover(function(){n(this).stop(!0).fadeTo(400,1)},function(){n(this).fadeOut("400",function(){n(this).remove()})})},content:function(t){t(n(this).prop("title"))}})}(jQuery);
\ No newline at end of file
diff --git a/modules/aioseop_bad_robots.php b/modules/aioseop_bad_robots.php
index 47e4b9908..ba5020159 100644
--- a/modules/aioseop_bad_robots.php
+++ b/modules/aioseop_bad_robots.php
@@ -19,16 +19,6 @@ function __construct() {
$this->file = __FILE__; // The current file.
parent::__construct();
- $help_text = array(
- 'block_bots' => __( 'Block requests from user agents that are known to misbehave with 503.', 'all-in-one-seo-pack' ),
- 'block_refer' => __( 'Block Referral Spam using HTTP.', 'all-in-one-seo-pack' ),
- 'track_blocks' => __( 'Log and show recent requests from blocked bots.', 'all-in-one-seo-pack' ),
- 'edit_blocks' => __( 'Check this to edit the list of disallowed user agents for blocking bad bots.', 'all-in-one-seo-pack' ),
- 'blocklist' => __( 'This is the list of disallowed user agents used for blocking bad bots.', 'all-in-one-seo-pack' ),
- 'referlist' => __( 'This is the list of disallowed referers used for blocking bad bots.', 'all-in-one-seo-pack' ),
- 'blocked_log' => __( 'Shows log of most recent requests from blocked bots. Note: this will not track any bots that were already blocked at the web server / .htaccess level.', 'all-in-one-seo-pack' ),
- );
-
$this->default_options = array(
'block_bots' => array( 'name' => __( 'Block Bad Bots using HTTP', 'all-in-one-seo-pack' ) ),
'block_refer' => array( 'name' => __( 'Block Referral Spam using HTTP', 'all-in-one-seo-pack' ) ),
@@ -67,12 +57,6 @@ function __construct() {
),
);
- if ( ! empty( $help_text ) ) {
- foreach ( $help_text as $k => $v ) {
- $this->default_options[ $k ]['help_text'] = $v;
- }
- }
-
add_filter( $this->prefix . 'display_options', array( $this, 'filter_display_options' ) );
// Load initial options / set defaults,
diff --git a/modules/aioseop_file_editor.php b/modules/aioseop_file_editor.php
index 7454a4b78..955177f75 100644
--- a/modules/aioseop_file_editor.php
+++ b/modules/aioseop_file_editor.php
@@ -25,9 +25,6 @@ function __construct() {
$this->current_tab = $_REQUEST['tab'];
}
- $help_text = array(
- 'htaccfile' => __( '.htaccess editor', 'all-in-one-seo-pack' ),
- );
$this->default_options = array(
'htaccfile' => array(
'name' => __( 'Edit .htaccess', 'all-in-one-seo-pack' ),
@@ -40,11 +37,6 @@ function __construct() {
),
);
- if ( ! empty( $help_text ) ) {
- foreach ( $help_text as $k => $v ) {
- $this->default_options[ $k ]['help_text'] = $v;
- }
- }
$this->tabs = array(
'htaccess' => array( 'name' => __( '.htaccess' ) ),
);
diff --git a/modules/aioseop_importer_exporter.php b/modules/aioseop_importer_exporter.php
index 1aeae9ccc..534218ec6 100644
--- a/modules/aioseop_importer_exporter.php
+++ b/modules/aioseop_importer_exporter.php
@@ -17,20 +17,6 @@ function __construct() {
$this->prefix = 'aiosp_importer_exporter_'; // option prefix
$this->file = __FILE__;
parent::__construct();
- $help_text = array(
- 'import_submit' => __(
- "Select a valid All in One SEO Pack ini file and click 'Import' to import options from a previous state or install of All in One SEO Pack. Click here for documentation on this setting",
- 'all-in-one-seo-pack'
- ),
- 'export_choices' => __(
- "You may choose to export settings from active modules, and content from post data. Click here for documentation on this setting",
- 'all-in-one-seo-pack'
- ),
- 'export_post_types' => __(
- "Select which Post Types you want to export your All in One SEO Pack meta data for. Click here for documentation on this setting",
- 'all-in-one-seo-pack'
- ),
- );
$this->warnings = array();
$this->default_options = array(
'import_submit' => array(
@@ -70,11 +56,6 @@ function __construct() {
) . ' ',
),
);
- if ( ! empty( $help_text ) ) {
- foreach ( $help_text as $k => $v ) {
- $this->default_options[ $k ]['help_text'] = $v;
- }
- }
$this->layout = array(
'default' => array(
'name' => $this->name,
diff --git a/modules/aioseop_opengraph.php b/modules/aioseop_opengraph.php
index d83ac95ee..e1af5968c 100644
--- a/modules/aioseop_opengraph.php
+++ b/modules/aioseop_opengraph.php
@@ -81,103 +81,6 @@ function __construct() {
);
parent::__construct();
- $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' ),
- 'appid' => __( 'Enter your Facebook App ID here. Information about how to get your Facebook App ID can be found at https://developers.facebook.com/docs/apps/register', 'all-in-one-seo-pack' ),
- 'title_shortcodes' => __( 'Run shortcodes that appear in social title meta tags.', 'all-in-one-seo-pack' ),
- 'description_shortcodes' => __( 'Run shortcodes that appear in social description meta tags.', 'all-in-one-seo-pack' ),
- 'sitename' => __( 'The Site Name is the name that is used to identify your website.', 'all-in-one-seo-pack' ),
- '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' ),
- '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' ),
- 'dimg' => __( 'This option sets a default image that can be used for the Open Graph image. You can upload an image, select an image from your Media Library or paste the URL of an image here.', 'all-in-one-seo-pack' ),
- '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' ),
- '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' ),
- 'imageheight' => __( 'Enter the height for your Open Graph image in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
- 'video' => __( 'This option lets you specify a link to the Open Graph video used on this Page or Post.', 'all-in-one-seo-pack' ),
- 'videowidth' => __( 'Enter the width for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
- 'videoheight' => __( 'Enter the height for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
- 'defcard' => __( 'Select the default type of Twitter Card to display.', 'all-in-one-seo-pack' ),
- 'setcard' => __( 'Select the Twitter Card type to use for this Page or Post, overriding the default setting.', 'all-in-one-seo-pack' ),
- 'twitter_site' => __( 'Enter the Twitter username associated with your website here.', 'all-in-one-seo-pack' ),
- 'twitter_creator' => __( 'Allows your authors to be identified by their Twitter usernames as content creators on the Twitter cards for their posts.', 'all-in-one-seo-pack' ),
- 'twitter_domain' => __( 'Enter the name of your website here.', 'all-in-one-seo-pack' ),
- 'customimg_twitter' => __( 'This option lets you upload an image to use as the Twitter image for this Page or Post.', 'all-in-one-seo-pack' ),
- 'gen_tags' => __( 'Automatically generate article tags for Facebook type article when not provided.', 'all-in-one-seo-pack' ),
- 'gen_keywords' => __( 'Use keywords in generated article tags.', 'all-in-one-seo-pack' ),
- 'gen_categories' => __( 'Use categories in generated article tags.', 'all-in-one-seo-pack' ),
- 'gen_post_tags' => __( 'Use post tags in generated article tags.', 'all-in-one-seo-pack' ),
- 'types' => __( 'Select which Post Types you want to use All in One SEO Pack to set Open Graph meta values for.', 'all-in-one-seo-pack' ),
- 'title' => __( 'This is the Open Graph title of this Page or Post.', 'all-in-one-seo-pack' ),
- 'desc' => __( 'This is the Open Graph description of this Page or Post.', 'all-in-one-seo-pack' ),
- 'category' => __( 'Select the Open Graph type that best describes the content of this Page or Post.', 'all-in-one-seo-pack' ),
- 'facebook_debug' => __( 'Press this button to have Facebook re-fetch and debug this page.', 'all-in-one-seo-pack' ),
- 'section' => __( 'This Open Graph meta allows you to add a general section name that best describes this content.', 'all-in-one-seo-pack' ),
- 'tag' => __( 'This Open Graph meta allows you to add a list of keywords that best describe this content.', 'all-in-one-seo-pack' ),
- 'facebook_publisher' => __( 'Link articles to the Facebook page associated with your website.', 'all-in-one-seo-pack' ),
- 'facebook_author' => __( 'Allows your authors to be identified by their Facebook pages as content authors on the Opengraph meta for their articles.', 'all-in-one-seo-pack' ),
- 'person_or_org' => __( 'Are the social profile links for your website for a person or an organization?', 'all-in-one-seo-pack' ),
- 'profile_links' => __( "Add URLs for your website's social profiles here (Facebook, Twitter, Google+, Instagram, LinkedIn), one per line.", 'all-in-one-seo-pack' ),
- 'social_name' => __( 'Add the name of the person or organization who owns these profiles.', 'all-in-one-seo-pack' ),
- );
-
- $this->help_anchors = array(
- 'title_shortcodes' => '#run-shortcodes-in-title',
- 'description_shortcodes' => '#run-shortcodes-in-description',
- 'generate_descriptions' => '#auto-generate-og-descriptions',
- 'setmeta' => '#use-aioseo-title-and-description',
- 'sitename' => '#site-name',
- 'hometitle' => '#home-title-and-description',
- 'description' => '#home-title-and-description',
- 'homeimage' => '#home-image',
- 'defimg' => '#select-og-image-source',
- 'fallback' => '#use-default-if-no-image-found',
- 'dimg' => '#default-og-image',
- 'dimgwidth' => '#default-image-width',
- 'dimgheight' => '#default-image-height',
- 'meta_key' => '#use-custom-field-for-image',
- 'profile_links' => '#social-profile-links',
- 'person_or_org' => '#social-profile-links',
- 'social_name' => '#social-profile-links',
- 'key' => '#facebook-admin-id',
- 'appid' => '#facebook-app-id',
- 'gen_tags' => '#automatically-generate-article-tags',
- 'gen_keywords' => '#use-keywords-in-article-tags',
- 'gen_categories' => '#use-categories-in-article-tags',
- 'gen_post_tags' => '#use-post-tags-in-article-tags',
- 'facebook_publisher' => '#show-facebook-publisher-on-articles',
- 'facebook_author' => '#show-facebook-author-on-articles',
- 'types' => '#enable-facebook-meta-for',
- 'defcard' => '#default-twitter-card',
- 'twitter_site' => '#twitter-site',
- 'twitter_creator' => '#show-twitter-author',
- 'twitter_domain' => '#twitter-domain',
- 'scan_header' => '#scan-social-meta',
- 'title' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#title',
- 'desc' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#description',
- 'image' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#image',
- 'customimg' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-image',
- 'imagewidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height',
- 'imageheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height',
- 'video' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-video',
- 'videowidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height',
- 'videoheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height',
- 'category' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-object-type',
- 'facebook_debug' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-debug',
- 'section' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-section',
- 'tag' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-tags',
- 'setcard' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#twitter-card-type',
- 'customimg_twitter' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-twitter-image',
- );
-
if ( is_admin() ) {
add_action( 'admin_init', array( $this, 'admin_init' ), 5 );
} else {
@@ -945,7 +848,6 @@ function filter_settings( $settings, $location, $current ) {
if ( isset( $settings[ $prefix . $opt ] ) ) {
$settings[ $prefix . $opt ]['type'] = 'hidden';
$settings[ $prefix . $opt ]['label'] = 'none';
- $settings[ $prefix . $opt ]['help_text'] = '';
unset( $settings[ $prefix . $opt ]['count'] );
}
}
@@ -1744,14 +1646,10 @@ function admin_init() {
'default' => 'article',
'condshow' => array( 'aiosp_opengraph_types\[\]' => $slug ),
);
- $this->help_text[ $field ] = __( 'Choose a default value that best describes the content of your post type.', 'all-in-one-seo-pack' );
- $this->help_anchors[ $field ] = '#content-object-types';
$this->locations['opengraph']['options'][] = $field;
$this->layout['facebook']['options'][] = $field;
}
$this->setting_options();
- $this->add_help_text_links();
-
}
function get_all_images( $options = null, $p = null ) {
diff --git a/modules/aioseop_performance.php b/modules/aioseop_performance.php
index 5d69ee5cd..7e15fc229 100644
--- a/modules/aioseop_performance.php
+++ b/modules/aioseop_performance.php
@@ -17,12 +17,6 @@ function __construct( $mod ) {
$this->file = __FILE__; // The current file.
parent::__construct();
- $this->help_text = array(
- 'memory_limit' => __( 'This setting allows you to raise your PHP memory limit to a reasonable value. Note: WordPress core and other WordPress plugins may also change the value of the memory limit.', 'all-in-one-seo-pack' ),
- 'execution_time' => __( 'This setting allows you to raise your PHP execution time to a reasonable value.', 'all-in-one-seo-pack' ),
- 'force_rewrites' => __( 'Use output buffering to ensure that the title gets rewritten. Enable this option if you run into issues with the title tag being set by your theme or another plugin.', 'all-in-one-seo-pack' ),
- );
-
$this->default_options = array(
'memory_limit' => array(
'name' => __( 'Raise memory limit', 'all-in-one-seo-pack' ),
@@ -51,12 +45,6 @@ function __construct( $mod ) {
),
);
- $this->help_anchors = array(
- 'memory_limit' => '#raise-memory-limit',
- 'execution_time' => '#raise-execution-time',
- 'force_rewrites' => '#force-rewrites',
- );
-
global $aiosp, $aioseop_options;
if ( aioseop_option_isset( 'aiosp_rewrite_titles' ) && $aioseop_options['aiosp_rewrite_titles'] ) {
$this->default_options['force_rewrites'] = array(
@@ -91,8 +79,6 @@ function __construct( $mod ) {
$this->default_options = array_merge( $this->default_options, $system_status );
- $this->add_help_text_links();
-
add_filter( $this->prefix . 'display_options', array( $this, 'display_options_filter' ), 10, 2 );
add_filter( $this->prefix . 'update_options', array( $this, 'update_options_filter' ), 10, 2 );
add_action( $this->prefix . 'settings_update', array( $this, 'settings_update_action' ), 10, 2 );
diff --git a/modules/aioseop_robots.php b/modules/aioseop_robots.php
index d4f6427c1..951355b94 100644
--- a/modules/aioseop_robots.php
+++ b/modules/aioseop_robots.php
@@ -21,12 +21,6 @@ function __construct() {
$this->file = __FILE__; // the current file
parent::__construct();
- $help_text = array(
- 'type' => __( 'Rule Type', 'all-in-one-seo-pack' ),
- 'agent' => __( 'User Agent', 'all-in-one-seo-pack' ),
- 'path' => __( 'Directory Path', 'all-in-one-seo-pack' ),
- );
-
$this->default_options = array(
'usage' => array(
'type' => 'html',
@@ -87,12 +81,6 @@ function __construct() {
$this->default_options = array_merge( $this->default_options, $this->rule_fields );
- if ( ! empty( $help_text ) ) {
- foreach ( $help_text as $k => $v ) {
- $this->default_options[ $k ]['help_text'] = $v;
- }
- }
-
$this->layout = array(
'default' => array(
'name' => __( 'Create a Robots.txt File', 'all-in-one-seo-pack' ),
diff --git a/modules/aioseop_sitemap.php b/modules/aioseop_sitemap.php
index 0b66f3c43..0abe47c6b 100644
--- a/modules/aioseop_sitemap.php
+++ b/modules/aioseop_sitemap.php
@@ -168,48 +168,6 @@ public function __construct() {
// TODO This could be move up to the class field default/initial values.
$this->comment_string = 'Sitemap %s generated by All in One SEO Pack %s by Michael Torbert of Semper Fi Web Design on %s';
- $this->help_text = array(
- 'rss_sitemap' => __( 'Create RSS Sitemap as well.', 'all-in-one-seo-pack' ),
- 'daily_cron' => __( 'Notify search engines based on the selected schedule, and also update static sitemap daily if in use. (this uses WP-Cron, so make sure this is working properly on your server as well)', 'all-in-one-seo-pack' ),
- 'indexes' => __( 'Organize sitemap entries into distinct files in your sitemap. Enable this only if your sitemap contains over 50,000 URLs or the file is over 5MB in size.', 'all-in-one-seo-pack' ),
- 'max_posts' => __( 'Allows you to specify the maximum number of posts in a sitemap (up to 50,000).', 'all-in-one-seo-pack' ),
- 'posttypes' => __( 'Select which Post Types appear in your sitemap.', 'all-in-one-seo-pack' ),
- 'taxonomies' => __( 'Select which taxonomy archives appear in your sitemap', 'all-in-one-seo-pack' ),
- 'archive' => __( 'Include Date Archives in your sitemap.', 'all-in-one-seo-pack' ),
- 'author' => __( 'Include Author Archives in your sitemap.', 'all-in-one-seo-pack' ),
- 'images' => __( 'Exclude Images in your sitemap.', 'all-in-one-seo-pack' ),
- 'gzipped' => __( 'Create a compressed sitemap file in .xml.gz format.', 'all-in-one-seo-pack' ),
- 'robots' => __( 'Places a link to your Sitemap.xml into your virtual Robots.txt file.', 'all-in-one-seo-pack' ),
- 'rewrite' => __( 'Dynamically creates the XML sitemap instead of using a static file.', 'all-in-one-seo-pack' ),
- 'addl_url' => __( 'URL to the page. This field accepts relative URLs or absolute URLs with the protocol specified.', 'all-in-one-seo-pack' ),
- 'addl_prio' => __( 'The priority of the page.', 'all-in-one-seo-pack' ),
- 'addl_freq' => __( 'The frequency of the page.', 'all-in-one-seo-pack' ),
- 'addl_mod' => __( 'Last modified date of the page.', 'all-in-one-seo-pack' ),
- 'excl_categories' => __( 'Entries from these categories will be excluded from the sitemap.', 'all-in-one-seo-pack' ),
- 'excl_pages' => __( 'Use page slugs or page IDs, seperated by commas, to exclude pages from the sitemap.', 'all-in-one-seo-pack' ),
- );
-
- $this->help_anchors = array(
- 'rss_sitemap' => '#create-rss_sitemap',
- 'daily_cron' => '#schedule-updates',
- 'indexes' => '#enable-sitemap-indexes',
- 'max_posts' => '#enable-sitemap-indexes',
- 'posttypes' => '#post-types-and-taxonomies',
- 'taxonomies' => '#post-types-and-taxonomies',
- 'archive' => '#include-archive-pages',
- 'author' => '#include-archive-pages',
- 'images' => '#exclude-images',
- 'gzipped' => '#create-compressed-sitemap',
- 'robots' => '#link-from-virtual-robots',
- 'rewrite' => '#dynamically-generate-sitemap',
- 'addl_url' => '#additional-pages',
- 'addl_prio' => '#additional-pages',
- 'addl_freq' => '#additional-pages',
- 'addl_mod' => '#additional-pages',
- 'excl_categories' => '#excluded-items',
- 'excl_pages' => '#excluded-items',
- );
-
$this->default_options = array(
'rss_sitemap' => array( 'name' => __( 'Create RSS Sitemap', 'all-in-one-seo-pack' ) ),
'daily_cron' => array(
@@ -325,8 +283,6 @@ public function __construct() {
$arr[ $k . '_' . $opt ] = array(
'name' => $this->ucwords( $val ),
- /* translators: Help Text string to display information about multiple different settings. */
- 'help_text' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), $v, $val ),
'type' => 'select',
'initial_options' => $iopts,
'default' => 'no',
@@ -428,8 +384,6 @@ public function __construct() {
$this->default_options = array_merge( $status_options, $this->default_options, $addl_options, $excl_options, $prio_options, $freq_options );
- $this->add_help_text_links();
-
add_action(
'after_doing_aioseop_updates',
array(
@@ -695,8 +649,6 @@ public function add_post_types() {
$this->default_options['taxonomies']['default'] = array_keys( $this->default_options['taxonomies']['initial_options'] );
$this->default_options['excl_categories']['initial_options'] = $this->get_category_titles();
- $prio_help = __( 'Manually set the priority for the ', 'all-in-one-seo-pack' );
- $freq_help = __( 'Manually set the frequency for the ', 'all-in-one-seo-pack' );
$post_name = __( ' Post Type', 'all-in-one-seo-pack' );
$tax_name = __( ' Taxonomy', 'all-in-one-seo-pack' );
@@ -708,7 +660,6 @@ public function add_post_types() {
array(
$key => array(
'name' => $v . $post_name,
- 'help_text' => $prio_help . $v . $post_name,
'type' => 'select',
'initial_options' => $this->prio,
'default' => 'no',
@@ -724,7 +675,6 @@ public function add_post_types() {
array(
$key => array(
'name' => $v . $post_name,
- 'help_text' => $freq_help . $v . $post_name,
'type' => 'select',
'initial_options' => $this->freq,
'default' => 'no',
@@ -742,7 +692,6 @@ public function add_post_types() {
array(
$key => array(
'name' => $v . $tax_name,
- 'help_text' => $prio_help . $v . $tax_name,
'type' => 'select',
'initial_options' => $this->prio,
'default' => 'no',
@@ -758,7 +707,6 @@ public function add_post_types() {
array(
$key => array(
'name' => $v . $tax_name,
- 'help_text' => $freq_help . $v . $tax_name,
'type' => 'select',
'initial_options' => $this->freq,
'default' => 'no',
From 69adc4580e05cc70960b59acf7c63b6af336aae4 Mon Sep 17 00:00:00 2001
From: Ashish Ravi
Date: Wed, 6 Mar 2019 16:21:23 +0530
Subject: [PATCH 007/121] Minimum supported version is WP 4.6
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 607aa5ed9..d3697eec7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,7 +18,7 @@ matrix:
- php: 5.2
dist: precise
- env: WP_VERSION=latest
- - env: WP_VERSION=4.5
+ - env: WP_VERSION=4.6
- env: WP_MULTISITE=1
allow_failures:
- env: WP_MULTISITE=1
From af95e7013f5a5a266f4ebd5e1379f3aeea176dec Mon Sep 17 00:00:00 2001
From: contactashish13
Date: Wed, 6 Mar 2019 21:54:00 +0530
Subject: [PATCH 008/121] Integrate Grunt with Travis (#2249)
* added info for testing
* add grunt to travis
* separate task for grunt
* travis failure
* travis failure
* travis failure
* reinstate all jobs
* failure
* reinstate all jobs
* only on PRs
* test with only grunt job
* reinstate all jobs
* PR comments
---
.travis.yml | 15 +++++++++++++--
PULL_REQUEST_TEMPLATE.md | 6 ++++++
bin/init-grunt.sh | 19 +++++++++++++++++++
package.json | 2 +-
4 files changed, 39 insertions(+), 3 deletions(-)
create mode 100644 bin/init-grunt.sh
diff --git a/.travis.yml b/.travis.yml
index d3697eec7..fba9ea590 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,7 @@ language: php
matrix:
fast_finish: true
global:
- - env: PHPUNIT=global
+ - env: PHPUNIT=global GRUNT=no
include:
- php: 7.2
env: PHPUNIT=local
@@ -20,6 +20,10 @@ matrix:
- env: WP_VERSION=latest
- env: WP_VERSION=4.6
- env: WP_MULTISITE=1
+ - language: node_js
+ node_js:
+ - "8.11.3"
+ env: GRUNT=yes
allow_failures:
- env: WP_MULTISITE=1
- php: 5.3
@@ -38,8 +42,15 @@ branches:
install:
- if [[ $PHPUNIT = "local" ]]; then composer install; fi
+ - if [[ $GRUNT = "yes" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then chmod +x bin/init-grunt.sh; . bin/init-grunt.sh; fi
before_script:
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
-script: if [[ $PHPUNIT = "local" ]]; then ./vendor/bin/phpunit; else phpunit; fi
+script:
+ - if [[ $GRUNT = "yes" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then grunt; fi
+ - if [[ $PHPUNIT = "local" ]]; then ./vendor/bin/phpunit; else phpunit; fi
+
+after_failure:
+- cat "logs/phpcs.log"
+- cat "logs/jslogs.log"
diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md
index 71d019c3e..a3c7acf1b 100644
--- a/PULL_REQUEST_TEMPLATE.md
+++ b/PULL_REQUEST_TEMPLATE.md
@@ -19,6 +19,12 @@ _Put an `x` in the boxes that apply. You can also fill these out after creating
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
+## Testing instructions
+-Don't assume the tester knows the entire backstory of the issue, and don't force him/her to decipher the code to try and figure out what -it's doing or how to test it.
+-Do provide step by step instructions on how to test.
+-Do note things to watch out for.
+-Do not what aspects the tester should try and break.
+
## Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
diff --git a/bin/init-grunt.sh b/bin/init-grunt.sh
new file mode 100644
index 000000000..47f7a6bee
--- /dev/null
+++ b/bin/init-grunt.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+npm install
+npm install grunt -g
+npm install grunt-cli -g
+npm install grunt-mkdir grunt-phpcs grunt-phpcbf grunt-phplint grunt-contrib-jshint grunt-contrib-uglify grunt-eslint
+
+composer install --no-interaction --ignore-platform-reqs
+
+COMPOSER_LOCATION=$(composer config home --global)
+export PATH="$COMPOSER_LOCATION/vendor/bin:$PATH"
+composer self-update
+
+composer global require "squizlabs/php_codesniffer"
+
+git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git "$HOME/wordpress-coding-standards"
+phpenv rehash
+phpcs --config-set installed_paths "$HOME/wordpress-coding-standards"
+phpenv rehash
diff --git a/package.json b/package.json
index f446d57f9..57dead130 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"test": "tests"
},
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "test": "grunt"
},
"repository": {
"type": "git",
From dd4fe0cf8688de9363222cb4b75d2b1fd5803bd5 Mon Sep 17 00:00:00 2001
From: EkoJR
Date: Thu, 7 Mar 2019 11:05:43 -0800
Subject: [PATCH 009/121] Fix warnings with unit tests for admin_notices
---
tests/classes/aioseop-notices/test-delay-time.php | 2 +-
tests/classes/aioseop-notices/test-init.php | 2 +-
tests/classes/aioseop-notices/test-user.php | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/classes/aioseop-notices/test-delay-time.php b/tests/classes/aioseop-notices/test-delay-time.php
index e4e91b809..253f39c23 100644
--- a/tests/classes/aioseop-notices/test-delay-time.php
+++ b/tests/classes/aioseop-notices/test-delay-time.php
@@ -91,7 +91,7 @@ protected function mock_notice() {
*
* @since 3.0
*/
- public function test_enqueue_scripts_on_screens() {
+ public function test_enqueue_scripts_on_screens( $screen_id, $url, $dir ) {
$this->markTestSkipped('Skip');
}
diff --git a/tests/classes/aioseop-notices/test-init.php b/tests/classes/aioseop-notices/test-init.php
index 6ccdea021..e9842f186 100644
--- a/tests/classes/aioseop-notices/test-init.php
+++ b/tests/classes/aioseop-notices/test-init.php
@@ -95,7 +95,7 @@ protected function mock_notice() {
*
* @since 3.0
*/
- public function test_enqueue_scripts_on_screens() {
+ public function test_enqueue_scripts_on_screens( $screen_id, $url, $dir ) {
$this->markTestSkipped('Skip');
}
diff --git a/tests/classes/aioseop-notices/test-user.php b/tests/classes/aioseop-notices/test-user.php
index ff4d353ed..8e2aeeeac 100644
--- a/tests/classes/aioseop-notices/test-user.php
+++ b/tests/classes/aioseop-notices/test-user.php
@@ -99,7 +99,7 @@ protected function mock_notice() {
*
* @since 3.0
*/
- public function test_enqueue_scripts_on_screens() {
+ public function test_enqueue_scripts_on_screens( $screen_id, $url, $dir ) {
$this->markTestSkipped('Skip');
}
From 789e0742d516eb78ade5967ed331076f3099dfea Mon Sep 17 00:00:00 2001
From: EkoJR
Date: Thu, 7 Mar 2019 11:17:38 -0800
Subject: [PATCH 010/121] Dev-Fix unit tests params passed
---
tests/classes/aioseop-notices/test-delay-time.php | 2 ++
tests/classes/aioseop-notices/test-init.php | 2 ++
tests/classes/aioseop-notices/test-user.php | 2 ++
3 files changed, 6 insertions(+)
diff --git a/tests/classes/aioseop-notices/test-delay-time.php b/tests/classes/aioseop-notices/test-delay-time.php
index 253f39c23..2729bc435 100644
--- a/tests/classes/aioseop-notices/test-delay-time.php
+++ b/tests/classes/aioseop-notices/test-delay-time.php
@@ -90,6 +90,8 @@ protected function mock_notice() {
* Override and skip.
*
* @since 3.0
+ *
+ * @dataProvider data_screens
*/
public function test_enqueue_scripts_on_screens( $screen_id, $url, $dir ) {
$this->markTestSkipped('Skip');
diff --git a/tests/classes/aioseop-notices/test-init.php b/tests/classes/aioseop-notices/test-init.php
index e9842f186..05bdcafd9 100644
--- a/tests/classes/aioseop-notices/test-init.php
+++ b/tests/classes/aioseop-notices/test-init.php
@@ -94,6 +94,8 @@ protected function mock_notice() {
* Override and skip.
*
* @since 3.0
+ *
+ * @dataProvider data_screens
*/
public function test_enqueue_scripts_on_screens( $screen_id, $url, $dir ) {
$this->markTestSkipped('Skip');
diff --git a/tests/classes/aioseop-notices/test-user.php b/tests/classes/aioseop-notices/test-user.php
index 8e2aeeeac..7197a011b 100644
--- a/tests/classes/aioseop-notices/test-user.php
+++ b/tests/classes/aioseop-notices/test-user.php
@@ -98,6 +98,8 @@ protected function mock_notice() {
* Override and skip.
*
* @since 3.0
+ *
+ * @dataProvider data_screens
*/
public function test_enqueue_scripts_on_screens( $screen_id, $url, $dir ) {
$this->markTestSkipped('Skip');
From cdb1203637f8eca54fbfd1845c7a6c1164211df4 Mon Sep 17 00:00:00 2001
From: EkoJR
Date: Thu, 7 Mar 2019 11:47:11 -0800
Subject: [PATCH 011/121] Dev-Clean JSHint ignore localized variable
---
js/admin-notice.js | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/js/admin-notice.js b/js/admin-notice.js
index 7872591ab..16d0d6b2a 100644
--- a/js/admin-notice.js
+++ b/js/admin-notice.js
@@ -27,7 +27,9 @@
* @param string delayIndex
*/
function aioseop_notice_delay_ajax_action( noticeSlug, delayIndex ) {
- var noticeNonce = aioseop_notice_data.notice_nonce;
+ // JSHint: 'aioseop_notice_data' is not defined. (W117)
+ // WP defines the variable through wp_localize_script().
+ var noticeNonce = aioseop_notice_data.notice_nonce; // jshint ignore:line
var noticeDelayID = "#aioseop-notice-delay-" + noticeSlug + "-" + delayIndex;
$( noticeDelayID ).on( "click", function( event ) {
var elem_href = $( this ).attr( "href" );
@@ -74,7 +76,9 @@
* @param string noticeSlug
*/
function aioseop_notice_delay_wp_default_dismiss_ajax_action( noticeSlug ) {
- var noticeNonce = aioseop_notice_data.notice_nonce;
+ // JSHint: 'aioseop_notice_data' is not defined. (W117)
+ // WP defines the variable through wp_localize_script().
+ var noticeNonce = aioseop_notice_data.notice_nonce; // jshint ignore:line
var noticeContainer = ".aioseop-notice-" + noticeSlug;
$( noticeContainer ).on( "click", "button.notice-dismiss ", function( event ) {
// Prevents any unwanted actions.
@@ -104,7 +108,9 @@
*
* Constructs the actions the user may perform.
*/
- var noticeDelays = aioseop_notice_data.notice_actions;
+ // JSHint: 'aioseop_notice_data' is not defined. (W117)
+ // WP defines the variable through wp_localize_script().
+ var noticeDelays = aioseop_notice_data.notice_actions; // jshint ignore:line
$.each( noticeDelays, function ( k1NoticeSlug, v1DelayArr ) {
$.each( v1DelayArr, function ( k2I, v2DelayIndex ) {
From fd2b5c4243dba7b3feda7422a1759502386610fa Mon Sep 17 00:00:00 2001
From: EkoJR
Date: Thu, 7 Mar 2019 11:48:11 -0800
Subject: [PATCH 012/121] Dev-Clean run grunt
---
admin/display/notice-aioseop.php | 2 +-
admin/display/notice-default.php | 2 +-
tests/base/class-aioseop-notices-testcase.php | 81 +++++++++----------
.../aioseop-notices/test-delay-time.php | 2 +-
tests/classes/aioseop-notices/test-init.php | 2 +-
tests/classes/aioseop-notices/test-user.php | 2 +-
6 files changed, 45 insertions(+), 46 deletions(-)
diff --git a/admin/display/notice-aioseop.php b/admin/display/notice-aioseop.php
index 50c397ddd..7da847902 100644
--- a/admin/display/notice-aioseop.php
+++ b/admin/display/notice-aioseop.php
@@ -28,7 +28,7 @@
$class .= 'aioseop-delay-' . $key;
$class .= ' ' . $action_option['class'];
?>
-
+
';
+ $args['options']['type'] = 'submit';
+ $args['attr'] = " class='button-primary' ";
+ $args['value'] = $args['options']['default'] = __( 'Scan Now', 'all-in-one-seo-pack' );
+ $buf .= __( 'Scan your site for duplicate social meta tags.', 'all-in-one-seo-pack' );
+ $buf .= '
' . $this->get_option_html( $args );
+ $buf .= '
';
+ }
+
+ return $buf;
+ }
+
+ function add_attributes( $output ) {
+ // avoid having duplicate meta tags
+ $type = $this->type;
+ if ( empty( $type ) ) {
+ $type = 'website';
+ }
+ $schema_types = array(
+ 'album' => 'MusicAlbum',
+ 'article' => 'Article',
+ 'bar' => 'BarOrPub',
+ 'blog' => 'Blog',
+ 'book' => 'Book',
+ 'cafe' => 'CafeOrCoffeeShop',
+ 'city' => 'City',
+ 'country' => 'Country',
+ 'episode' => 'Episode',
+ 'food' => 'FoodEvent',
+ 'game' => 'Game',
+ 'hotel' => 'Hotel',
+ 'landmark' => 'LandmarksOrHistoricalBuildings',
+ 'movie' => 'Movie',
+ 'product' => 'Product',
+ 'profile' => 'ProfilePage',
+ 'restaurant' => 'Restaurant',
+ 'school' => 'School',
+ 'sport' => 'SportsEvent',
+ 'website' => 'WebSite',
+ );
+
+ if ( ! empty( $schema_types[ $type ] ) ) {
+ $type = $schema_types[ $type ];
+ } else {
+ $type = 'WebSite';
+ }
+
+ $attributes = apply_filters(
+ $this->prefix . 'attributes', array(
+ 'prefix="og: http://ogp.me/ns#"',
+ )
+ );
+
+ foreach ( $attributes as $attr ) {
+ if ( strpos( $output, $attr ) === false ) {
+ $output .= "\n\t$attr ";
+ }
+ }
+
+ return $output;
+ }
+
+ /**
+ * Add our social meta.
+ *
+ * @since 1.0.0
+ * @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.
+ * @global array $aioseop_options All in one seo plugin options.
+ * @global object $wp_query WP_Query global instance.
+ */
+ function add_meta() {
+ global $post, $aiosp, $aioseop_options, $wp_query;
+ $metabox = $this->get_current_options( array(), 'settings' );
+ $key = $this->options['aiosp_opengraph_key'];
+ $key = $this->options['aiosp_opengraph_key'];
+ $dimg = $this->options['aiosp_opengraph_dimg'];
+ $current_post_type = get_post_type();
+ $title = $description = $image = $video = '';
+ $type = $this->type;
+ $sitename = $this->options['aiosp_opengraph_sitename'];
+
+ // for some reason, options is not populated correctly during unit tests.
+ if ( defined( 'AIOSEOP_UNIT_TESTING' ) ) {
+ $this->options = $aioseop_options['modules'][ $this->prefix . 'options' ];
+ }
+
+ $appid = isset( $this->options['aiosp_opengraph_appid'] ) ? $this->options['aiosp_opengraph_appid'] : '';
+
+ if ( ! empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
+ $first_page = false;
+ if ( $aiosp->get_page_number() < 2 ) {
+ $first_page = true;
+ }
+ } else {
+ $first_page = true;
+ }
+ $url = $aiosp->aiosp_mrt_get_url( $wp_query );
+ $url = apply_filters( 'aioseop_canonical_url', $url );
+
+ // this will collect the extra values that are required outside the below IF block.
+ $extra_params = array();
+
+ $setmeta = $this->options['aiosp_opengraph_setmeta'];
+ $social_links = '';
+ if ( is_front_page() ) {
+ $title = $this->options['aiosp_opengraph_hometitle'];
+ if ( $first_page ) {
+ $description = $this->options['aiosp_opengraph_description'];
+ if ( empty( $description ) ) {
+ $description = get_bloginfo( 'description' );
+ }
+ }
+ if ( ! empty( $this->options['aiosp_opengraph_homeimage'] ) ) {
+ $thumbnail = $this->options['aiosp_opengraph_homeimage'];
+ } else {
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
+ }
+
+ /* If Use AIOSEO Title and Desc Selected */
+ if ( $setmeta ) {
+ $title = $aiosp->wp_title();
+ if ( $first_page ) {
+ $description = $aiosp->get_aioseop_description( $post );
+ }
+ }
+
+ /* Add some defaults */
+ if ( empty( $title ) ) {
+ $title = get_bloginfo( 'name' );
+ }
+ if ( empty( $sitename ) ) {
+ $sitename = get_bloginfo( 'name' );
+ }
+
+ if ( empty( $description ) && $first_page && ! empty( $post ) && ! post_password_required( $post ) ) {
+
+ if ( ! empty( $post->post_content ) || ! empty( $post->post_excerpt ) ) {
+ $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ), 1000 );
+
+ if ( ! empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) {
+ $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
+ }
+ }
+ }
+
+ if ( empty( $description ) && $first_page ) {
+ $description = get_bloginfo( 'description' );
+ }
+ if ( ! empty( $this->options['aiosp_opengraph_profile_links'] ) ) {
+ $social_links = $this->options['aiosp_opengraph_profile_links'];
+ if ( ! empty( $this->options['aiosp_opengraph_social_name'] ) ) {
+ $social_name = $this->options['aiosp_opengraph_social_name'];
+ } else {
+ $social_name = '';
+ }
+ if ( $this->options['aiosp_opengraph_person_or_org'] == 'person' ) {
+ $social_type = 'Person';
+ } else {
+ $social_type = 'Organization';
+ }
+ }
+ } elseif ( is_singular() && $this->option_isset( 'types' )
+ && is_array( $this->options['aiosp_opengraph_types'] )
+ && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] )
+ ) {
+
+ if ( $type == 'article' ) {
+ if ( ! empty( $metabox['aioseop_opengraph_settings_section'] ) ) {
+ $section = $metabox['aioseop_opengraph_settings_section'];
+ }
+ if ( ! empty( $metabox['aioseop_opengraph_settings_tag'] ) ) {
+ $tag = $metabox['aioseop_opengraph_settings_tag'];
+ }
+ if ( ! empty( $this->options['aiosp_opengraph_facebook_publisher'] ) ) {
+ $publisher = $this->options['aiosp_opengraph_facebook_publisher'];
+ }
+ }
+
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
+ $domain = $this->options['aiosp_opengraph_twitter_domain'];
+ }
+
+ if ( $type == 'article' && ! empty( $post ) ) {
+ if ( isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_facebook_author'] ) ) {
+ $author = get_the_author_meta( 'facebook', $post->post_author );
+ }
+
+ if ( isset( $post->post_date_gmt ) ) {
+ $published_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_date_gmt ) );
+ }
+
+ if ( isset( $post->post_modified_gmt ) ) {
+ $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified_gmt ) );
+ }
+ }
+
+ $image = $metabox['aioseop_opengraph_settings_image'];
+ $video = $metabox['aioseop_opengraph_settings_video'];
+ $title = $metabox['aioseop_opengraph_settings_title'];
+ $description = $metabox['aioseop_opengraph_settings_desc'];
+
+ // Let's make a note of manually provided descriptions/titles as they might need special handling.
+ // @issue https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/808
+ // @issue https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/2296
+ $title_from_main_settings = trim( strip_tags( get_post_meta( $post->ID, '_aioseop_title', true ) ) );
+ $desc_from_main_settings = trim( strip_tags( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
+ if ( empty( $title ) && empty( $title_from_main_settings ) ) {
+ $extra_params['auto_generate_title'] = true;
+ }
+ if ( empty( $description ) && empty( $desc_from_main_settings ) ) {
+ $extra_params['auto_generate_desc'] = true;
+ }
+
+ /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
+ global $aiosp;
+ if ( empty( $title ) ) {
+ $title = $aiosp->wp_title();
+ }
+ if ( empty( $description ) ) {
+ $description = trim( strip_tags( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
+ }
+
+ /* Add default title */
+ if ( empty( $title ) ) {
+ $title = get_the_title();
+ }
+
+ // Add default description.
+ if ( empty( $description ) && ! post_password_required( $post ) ) {
+
+ $description = $post->post_excerpt;
+
+ if ( $this->options['aiosp_opengraph_generate_descriptions'] || empty( $description ) ) {
+ if ( ! AIOSEOPPRO || ( AIOSEOPPRO && apply_filters( $this->prefix . 'generate_descriptions_from_content', true, $post ) ) ) {
+ $description = $post->post_content;
+ } else {
+ $description = $post->post_excerpt;
+ }
+ }
+ }
+ if ( empty( $type ) ) {
+ $type = 'article';
+ }
+ } elseif ( AIOSEOPPRO && ( is_category() || is_tag() || is_tax() ) ) {
+ if ( isset( $this->options['aioseop_opengraph_settings_category'] ) ) {
+ $type = $this->options['aioseop_opengraph_settings_category'];
+ }
+ if ( isset( $metabox['aioseop_opengraph_settings_category'] ) ) {
+ $type = $metabox['aioseop_opengraph_settings_category'];
+ }
+ if ( $type == 'article' ) {
+ if ( ! empty( $metabox['aioseop_opengraph_settings_section'] ) ) {
+ $section = $metabox['aioseop_opengraph_settings_section'];
+ }
+ if ( ! empty( $metabox['aioseop_opengraph_settings_tag'] ) ) {
+ $tag = $metabox['aioseop_opengraph_settings_tag'];
+ }
+ if ( ! empty( $this->options['aiosp_opengraph_facebook_publisher'] ) ) {
+ $publisher = $this->options['aiosp_opengraph_facebook_publisher'];
+ }
+ }
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
+ $domain = $this->options['aiosp_opengraph_twitter_domain'];
+ }
+ if ( $type == 'article' && ! empty( $post ) ) {
+ if ( isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_facebook_author'] ) ) {
+ $author = get_the_author_meta( 'facebook', $post->post_author );
+ }
+
+ if ( isset( $post->post_date_gmt ) ) {
+ $published_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_date_gmt ) );
+ }
+ if ( isset( $post->post_modified_gmt ) ) {
+ $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified_gmt ) );
+ }
+ }
+ $image = $metabox['aioseop_opengraph_settings_image'];
+ $video = $metabox['aioseop_opengraph_settings_video'];
+ $title = $metabox['aioseop_opengraph_settings_title'];
+ $description = $metabox['aioseop_opengraph_settings_desc'];
+ /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
+ global $aiosp;
+ if ( empty( $title ) ) {
+ $title = $aiosp->wp_title();
+ }
+ if ( empty( $description ) ) {
+ $term_id = isset( $_GET['tag_ID'] ) ? (int) $_GET['tag_ID'] : 0;
+ $term_id = $term_id ? $term_id : get_queried_object()->term_id;
+ $description = trim( strip_tags( get_term_meta( $term_id, '_aioseop_description', true ) ) );
+ }
+ // Add default title
+ if ( empty( $title ) ) {
+ $title = get_the_title();
+ }
+ // Add default description.
+ if ( empty( $description ) && ! post_password_required( $post ) ) {
+ $description = get_queried_object()->description;
+ }
+ if ( empty( $type ) ) {
+ // https://github.com/semperfiwebdesign/aioseop-pro/issues/321
+ if ( AIOSEOPPRO && ( is_category() || is_tag() || is_tax() ) ) {
+ $og_options = $aioseop_options['modules'][ $this->prefix . 'options' ];
+ $current_post_type = get_post_type();
+ // check if the post type's object type is set.
+ if ( isset( $og_options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
+ $type = $og_options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ];
+ } elseif ( in_array( $current_post_type, array( 'post', 'page' ) ) ) {
+ $type = 'article';
+ }
+ } else {
+ $type = 'website';
+ }
+ }
+ } elseif ( 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;
+ }
+
+ if ( $type === 'article' && ! empty( $post ) && is_singular() ) {
+ if ( ! empty( $this->options['aiosp_opengraph_gen_tags'] ) ) {
+ if ( ! empty( $this->options['aiosp_opengraph_gen_keywords'] ) ) {
+ $keywords = $aiosp->get_main_keywords();
+ $keywords = $this->apply_cf_fields( $keywords );
+ $keywords = apply_filters( 'aioseop_keywords', $keywords );
+ if ( ! empty( $keywords ) && ! empty( $tag ) ) {
+ $tag .= ',' . $keywords;
+ } elseif ( empty( $tag ) ) {
+ $tag = $keywords;
+ }
+ }
+ $tag = $aiosp->keyword_string_to_list( $tag );
+ if ( ! empty( $this->options['aiosp_opengraph_gen_categories'] ) ) {
+ $tag = array_merge( $tag, $aiosp->get_all_categories( $post->ID ) );
+ }
+ if ( ! empty( $this->options['aiosp_opengraph_gen_post_tags'] ) ) {
+ $tag = array_merge( $tag, $aiosp->get_all_tags( $post->ID ) );
+ }
+ }
+ if ( ! empty( $tag ) ) {
+ $tag = $aiosp->clean_keyword_list( $tag );
+ }
+ }
+
+ 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 = $aiosp->trim_excerpt_without_filters( $description, 1000 );
+ }
+
+ $title = $this->apply_cf_fields( $title );
+ $description = $this->apply_cf_fields( $description );
+
+ /* Data Validation */
+ $title = strip_tags( esc_attr( $title ) );
+ $sitename = strip_tags( esc_attr( $sitename ) );
+ $description = strip_tags( esc_attr( $description ) );
+
+ if ( empty( $thumbnail ) && ! empty( $image ) ) {
+ $thumbnail = $image;
+ }
+
+ // Add user supplied default image.
+ if ( empty( $thumbnail ) ) {
+ if ( empty( $this->options['aiosp_opengraph_defimg'] ) ) {
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
+ } else {
+ $img_type = $this->options['aiosp_opengraph_defimg'];
+ if ( ! empty( $post ) ) {
+ // Customize the type of image per post/post_type.
+ $img_type = apply_filters( $this->prefix . 'default_image_type', $img_type, $post, $type );
+ }
+ switch ( $img_type ) {
+ case 'featured':
+ $thumbnail = $this->get_the_image_by_post_thumbnail();
+ break;
+ case 'attach':
+ $thumbnail = $this->get_the_image_by_attachment();
+ break;
+ case 'content':
+ $thumbnail = $this->get_the_image_by_scan();
+ break;
+ case 'custom':
+ $meta_key = $this->options['aiosp_opengraph_meta_key'];
+ if ( ! empty( $meta_key ) && ! empty( $post ) ) {
+ $meta_key = explode( ',', $meta_key );
+ $thumbnail = $this->get_the_image_by_meta_key(
+ array(
+ 'post_id' => $post->ID,
+ 'meta_key' => $meta_key,
+ )
+ );
+ }
+ break;
+ case 'auto':
+ $thumbnail = $this->get_the_image();
+ break;
+ case 'author':
+ $thumbnail = $this->get_the_image_by_author();
+ break;
+ default:
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
+ }
+ }
+ }
+
+ if ( empty( $thumbnail ) && ! empty( $this->options['aiosp_opengraph_fallback'] ) ) {
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
+ if ( ! empty( $post ) ) {
+ // Customize the default image per post/post_type.
+ $thumbnail = apply_filters( $this->prefix . 'default_image', $thumbnail, $post, $type );
+ }
+ }
+
+ if ( ! empty( $thumbnail ) ) {
+ $thumbnail = esc_url( $thumbnail );
+ $thumbnail = set_url_scheme( $thumbnail );
+ }
+
+ $width = $height = '';
+ if ( ! empty( $thumbnail ) ) {
+ if ( ! empty( $metabox['aioseop_opengraph_settings_imagewidth'] ) ) {
+ $width = $metabox['aioseop_opengraph_settings_imagewidth'];
+ }
+ if ( ! empty( $metabox['aioseop_opengraph_settings_imageheight'] ) ) {
+ $height = $metabox['aioseop_opengraph_settings_imageheight'];
+ }
+ if ( empty( $width ) && ! empty( $this->options['aiosp_opengraph_dimgwidth'] ) ) {
+ $width = $this->options['aiosp_opengraph_dimgwidth'];
+ }
+ if ( empty( $height ) && ! empty( $this->options['aiosp_opengraph_dimgheight'] ) ) {
+ $height = $this->options['aiosp_opengraph_dimgheight'];
+ }
+ }
+
+ if ( ! empty( $video ) ) {
+ if ( ! empty( $metabox['aioseop_opengraph_settings_videowidth'] ) ) {
+ $videowidth = $metabox['aioseop_opengraph_settings_videowidth'];
+ }
+ if ( ! empty( $metabox['aioseop_opengraph_settings_videoheight'] ) ) {
+ $videoheight = $metabox['aioseop_opengraph_settings_videoheight'];
+ }
+ }
+
+ $card = 'summary';
+ if ( ! empty( $this->options['aiosp_opengraph_defcard'] ) ) {
+ $card = $this->options['aiosp_opengraph_defcard'];
+ }
+
+ if ( ! empty( $metabox['aioseop_opengraph_settings_setcard'] ) ) {
+ $card = $metabox['aioseop_opengraph_settings_setcard'];
+ }
+
+ // support for changing legacy twitter cardtype-photo to summary large image
+ if ( $card == 'photo' ) {
+ $card = 'summary_large_image';
+ }
+
+ $site = $domain = $creator = '';
+
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_site'] ) ) {
+ $site = $this->options['aiosp_opengraph_twitter_site'];
+ $site = AIOSEOP_Opengraph_Public::prepare_twitter_username( $site );
+ }
+
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
+ $domain = $this->options['aiosp_opengraph_twitter_domain'];
+ }
+
+ if ( ! empty( $post ) && isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_twitter_creator'] ) ) {
+ $creator = get_the_author_meta( 'twitter', $post->post_author );
+ $creator = AIOSEOP_Opengraph_Public::prepare_twitter_username( $creator );
+ }
+
+ if ( ! empty( $thumbnail ) ) {
+ $twitter_thumbnail = $thumbnail; // Default Twitter image if custom isn't set.
+ }
+
+ if ( isset( $metabox['aioseop_opengraph_settings_customimg_twitter'] ) && ! empty( $metabox['aioseop_opengraph_settings_customimg_twitter'] ) ) {
+ // Set Twitter image from custom.
+ $twitter_thumbnail = set_url_scheme( $metabox['aioseop_opengraph_settings_customimg_twitter'] );
+ }
+
+ // Apply last filters.
+ $description = apply_filters( 'aioseop_description', $description );
+
+ $meta = array(
+ 'facebook' => array(
+ 'title' => 'og:title',
+ 'type' => 'og:type',
+ 'url' => 'og:url',
+ 'thumbnail' => 'og:image',
+ 'width' => 'og:image:width',
+ 'height' => 'og:image:height',
+ 'video' => 'og:video',
+ 'videowidth' => 'og:video:width',
+ 'videoheight' => 'og:video:height',
+ 'sitename' => 'og:site_name',
+ 'key' => 'fb:admins',
+ 'appid' => 'fb:app_id',
+ 'description' => 'og:description',
+ 'section' => 'article:section',
+ 'tag' => 'article:tag',
+ 'publisher' => 'article:publisher',
+ 'author' => 'article:author',
+ 'published_time' => 'article:published_time',
+ 'modified_time' => 'article:modified_time',
+ ),
+ 'twitter' => array(
+ 'card' => 'twitter:card',
+ 'site' => 'twitter:site',
+ 'creator' => 'twitter:creator',
+ 'domain' => 'twitter:domain',
+ 'title' => 'twitter:title',
+ 'description' => 'twitter:description',
+ 'twitter_thumbnail' => 'twitter:image',
+ ),
+ );
+
+ // Only show if "use schema.org markup is checked".
+ if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
+ $meta['google+'] = array( 'thumbnail' => 'image' );
+ }
+
+ // https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/1848
+ if ( is_ssl() ) {
+ $meta['facebook'] += array( 'thumbnail_1' => 'og:image:secure_url' );
+ $thumbnail_1 = $thumbnail;
+ }
+
+ $tags = array(
+ 'facebook' => array( 'name' => 'property', 'value' => 'content' ),
+ 'twitter' => array( 'name' => 'name', 'value' => 'content' ),
+ 'google+' => array( 'name' => 'itemprop', 'value' => 'content' ),
+ );
+
+ foreach ( $meta as $t => $data ) {
+ foreach ( $data as $k => $v ) {
+ if ( empty( $$k ) ) {
+ $$k = '';
+ }
+ $filtered_value = $$k;
+
+ /**
+ * Process meta tags for their idiosyncracies.
+ *
+ * @since 3.0
+ *
+ * @param string $filtered_value The value that is proposed to be shown in the tag.
+ * @param string $t The social network.
+ * @param string $k The meta tag without the network name prefixed.
+ * @param string $v The meta tag with the network name prefixed. This is not always $network:$meta_tag.
+ * @param array $extra_params Extra parameters that might be required to process the meta tag.
+ */
+ $filtered_value = apply_filters( $this->prefix . 'meta', $filtered_value, $t, $k, $v, $extra_params );
+ if ( ! empty( $filtered_value ) ) {
+ if ( ! is_array( $filtered_value ) ) {
+ $filtered_value = array( $filtered_value );
+ }
+
+ /**
+ * This is to accomodate multiple fb:admins on separate lines.
+ * @TODO Eventually we'll want to put this in its own function so things like images work too.
+ */
+ if ( 'key' === $k ) {
+ $fbadmins = explode( ',', str_replace( ' ', '', $filtered_value[0] ) ); // Trim spaces then turn comma-separated values into an array.
+ foreach ( $fbadmins as $fbadmin ) {
+ echo '' . "\n";
+ }
+ } else {
+ // For everything else.
+ foreach ( $filtered_value as $f ) {
+ // #1363: use esc_attr( $f ) instead of htmlspecialchars_decode( $f, ENT_QUOTES )
+ echo '' . "\n";
+ }
+ }
+ }
+ }
+ }
+ $social_link_schema = '';
+ if ( ! empty( $social_links ) ) {
+ $home_url = esc_url( get_home_url() );
+ $social_links = explode( "\n", $social_links );
+ foreach ( $social_links as $k => $v ) {
+ $v = trim( $v );
+ if ( empty( $v ) ) {
+ unset( $social_links[ $k ] );
+ } else {
+ $v = esc_url( $v );
+ $social_links[ $k ] = $v;
+ }
+ }
+ $social_links = join( '","', $social_links );
+ $social_link_schema = <<
+{ "@context" : "http://schema.org",
+ "@type" : "{$social_type}",
+ "name" : "{$social_name}",
+ "url" : "{$home_url}",
+ "sameAs" : ["{$social_links}"]
+}
+
+
+END;
+ }
+
+ // Only show if "use schema.org markup is checked".
+ if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
+ echo apply_filters( 'aiosp_opengraph_social_link_schema', $social_link_schema );
+ }
+ }
+
+ /**
+ * Do / adds opengraph properties to meta.
+ * @since 2.3.11
+ *
+ * @global array $aioseop_options AIOSEOP plugin options.
+ */
+ public function do_opengraph() {
+ global $aioseop_options;
+ if ( ! empty( $aioseop_options )
+ && ! empty( $aioseop_options['aiosp_schema_markup'] )
+ ) {
+ add_filter( 'language_attributes', array( &$this, 'add_attributes' ) );
+ }
+ if ( ! defined( 'DOING_AJAX' ) ) {
+ add_action( 'aioseop_modules_wp_head', array( &$this, 'add_meta' ), 5 );
+ // Add social meta to AMP plugin.
+ if ( apply_filters( 'aioseop_enable_amp_social_meta', true ) === true ) {
+ add_action( 'amp_post_template_head', array( &$this, 'add_meta' ), 12 );
+ }
+ }
+ }
+
+ /**
+ * Set up types.
+ *
+ * @since ?
+ * @since 2.3.15 Change to website for homepage and blog post index page, default to object.
+ */
+ function type_setup() {
+ $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();
+ if ( ! empty( $metabox['aioseop_opengraph_settings_category'] ) ) {
+ $this->type = $metabox['aioseop_opengraph_settings_category'];
+ } elseif ( isset( $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
+ $this->type = $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ];
+ }
+ }
+ }
+
+ /**
+ * Inits hooks and others for 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.
+ */
+ function admin_init() {
+ add_filter( $this->prefix . 'display_settings', array( &$this, 'filter_settings' ), 10, 3 );
+ add_filter( $this->prefix . 'override_options', array( &$this, 'override_options' ), 10, 3 );
+ add_filter(
+ $this->get_prefix( 'settings' ) . 'default_options', array(
+ &$this,
+ 'filter_default_options',
+ ), 10, 2
+ );
+ add_filter(
+ $this->get_prefix( 'settings' ) . 'filter_metabox_options', array(
+ &$this,
+ 'filter_metabox_options',
+ ), 10, 3
+ );
+ add_filter(
+ $this->get_prefix( 'settings' ) . 'filter_term_metabox_options', array(
+ &$this,
+ 'filter_metabox_options',
+ ), 10, 3
+ );
+ $post_types = $this->get_post_type_titles();
+ $rempost = array(
+ 'revision' => 1,
+ 'nav_menu_item' => 1,
+ 'custom_css' => 1,
+ 'customize_changeset' => 1,
+ );
+ $post_types = array_diff_key( $post_types, $rempost );
+ $this->default_options['types']['initial_options'] = $post_types;
+ foreach ( $post_types as $slug => $name ) {
+ $field = $slug . '_fb_object_type';
+ $this->default_options[ $field ] = array(
+ 'name' => "$name " . __( 'Object Type', 'all-in-one-seo-pack' ) . " ($slug)",
+ 'type' => 'select',
+ 'style' => '',
+ 'initial_options' => $this->fb_object_types,
+ 'default' => 'article',
+ 'condshow' => array( 'aiosp_opengraph_types\[\]' => $slug ),
+ );
+ $this->locations['opengraph']['options'][] = $field;
+ $this->layout['facebook']['options'][] = $field;
+ }
+ $this->setting_options();
+ }
+
+ function get_all_images( $options = null, $p = null ) {
+ static $img = array();
+ if ( ! is_array( $options ) ) {
+ $options = array();
+ }
+ if ( ! empty( $this->options['aiosp_opengraph_meta_key'] ) ) {
+ $options['meta_key'] = $this->options['aiosp_opengraph_meta_key'];
+ }
+ if ( empty( $img ) ) {
+ $size = apply_filters( 'post_thumbnail_size', 'large' );
+ $default = $this->get_the_image_by_default();
+ if ( ! empty( $default ) ) {
+ $default = set_url_scheme( $default );
+ $img[ $default ] = 0;
+ }
+ $img = array_merge( $img, parent::get_all_images( $options, null ) );
+ }
+
+ if ( ! empty( $options ) && ! empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
+ $img[ $options['aioseop_opengraph_settings_customimg'] ] = 'customimg';
+ }
+
+ if ( ! empty( $options ) && ! empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
+ $img[ $options['aioseop_opengraph_settings_customimg'] ] = 'customimg';
+ $img[ $options['aioseop_opengraph_settings_customimg_twitter'] ] = 'customimg_twitter';
+ }
+
+ if ( $author_img = $this->get_the_image_by_author( $p ) ) {
+ $image['author'] = $author_img;
+ }
+ $image = array_flip( $img );
+ $images = array();
+ if ( ! empty( $image ) ) {
+ foreach ( $image as $k => $v ) {
+ $images[ $v ] = '';
+ }
+ }
+
+ return array( $image, $images );
+ }
+
+ function get_the_image_by_author( $options = null, $p = null ) {
+ if ( $p === null ) {
+ global $post;
+ } else {
+ $post = $p;
+ }
+ if ( ! empty( $post ) && ! empty( $post->post_author ) ) {
+ $matches = array();
+ $get_avatar = get_avatar( $post->post_author, 300 );
+ if ( preg_match( "/src='(.*?)'/i", $get_avatar, $matches ) ) {
+ return $matches[1];
+ }
+ }
+
+ return false;
+ }
+
+ function get_the_image( $options = null, $p = null ) {
+ $meta_key = $this->options['aiosp_opengraph_meta_key'];
+
+ return parent::get_the_image( array( 'meta_key' => $meta_key ), $p );
+ }
+
+ function get_the_image_by_default( $args = array() ) {
+ return $this->options['aiosp_opengraph_dimg'];
+ }
+
+ function settings_update() {
+
+ }
+
+ /**
+ * Admin Enqueue Scripts
+ *
+ * Add hook in \All_in_One_SEO_Pack_Module::enqueue_metabox_scripts - Bails adding hook if not on target valid screen.
+ * Add hook in \All_in_One_SEO_Pack_Module::add_page_hooks - Function itself is hooked based on the screen_id/page.
+ *
+ * @since 2.9.2
+ *
+ * @see 'admin_enqueue_scripts' hook
+ * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
+ *
+ * @param string $hook_suffix
+ */
+ public function admin_enqueue_scripts( $hook_suffix ) {
+ wp_enqueue_script(
+ 'aioseop-opengraph-script',
+ AIOSEOP_PLUGIN_URL . 'js/modules/aioseop_opengraph.js',
+ array(),
+ AIOSEOP_VERSION
+ );
+
+ // Dev note: If certain JS files need to be restricted to select screens, then follow concept
+ // used in `All_in_One_SEO_Pack::admin_enqueue_scripts()` (v2.9.1); which uses the `$hook_suffix`
+ // and a switch-case. This also helps prevent unnessecarily processing localized data when it isn't needed.
+ parent::admin_enqueue_scripts( $hook_suffix );
+ }
+
+ /**
+ * Enqueue our file upload scripts and styles.
+ * @param $hook
+ */
+ function og_admin_enqueue_scripts( $hook ) {
+
+ if ( 'all-in-one-seo_page_aiosp_opengraph' != $hook && 'term.php' != $hook ) {
+ // Only enqueue if we're on the social module settings page.
+ return;
+ }
+
+ wp_enqueue_script( 'media-upload' );
+ wp_enqueue_script( 'thickbox' );
+ wp_enqueue_style( 'thickbox' );
+ wp_enqueue_media();
+ }
+
+ function save_tax_data( $term_id, $tt_id, $taxonomy ) {
+ static $update = false;
+ if ( $update ) {
+ return;
+ }
+ if ( $this->locations !== null ) {
+ foreach ( $this->locations as $k => $v ) {
+ if ( isset( $v['type'] ) && ( $v['type'] === 'metabox' ) ) {
+ $opts = $this->default_options( $k );
+ $options = array();
+ $update = false;
+ foreach ( $opts as $l => $o ) {
+ if ( isset( $_POST[ $l ] ) ) {
+ $options[ $l ] = stripslashes_deep( $_POST[ $l ] );
+ $options[ $l ] = esc_attr( $options[ $l ] );
+ $update = true;
+ }
+ }
+ if ( $update ) {
+ $prefix = $this->get_prefix( $k );
+ $options = apply_filters( $prefix . 'filter_term_metabox_options', $options, $k, $term_id );
+ update_term_meta( $term_id, '_' . $prefix . $k, $options );
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the placeholder filtered and ready for DOM display.
+ * filter:aioseop_opengraph_placeholder
+ * @since 2.4.14
+ *
+ * @param mixed $placeholder Placeholder to be filtered.
+ * @param string $type Type of the value to be filtered.
+ *
+ * @return string
+ */
+ public function filter_placeholder( $placeholder, $type = 'text' ) {
+ return strip_tags( trim( $placeholder ) );
+ }
+
+ /**
+ * Returns filtered default options.
+ * filter:{prefix}default_options
+ * @since 2.4.13
+ *
+ * @param array $options Default options.
+ * @param string $location Location.
+ *
+ * @return array
+ */
+ public function filter_default_options( $options, $location ) {
+ if ( $location === 'settings' ) {
+ $prefix = $this->get_prefix( $location ) . $location . '_';
+ // Add image checker as default
+ $options[ $prefix . 'customimg_checker' ] = 0;
+ }
+ return $options;
+ }
+ }
+}
diff --git a/tests/modules/opengraph/test-opengraph.php b/tests/modules/opengraph/test-opengraph.php
index 7f23c1f4a..9c0b65fee 100644
--- a/tests/modules/opengraph/test-opengraph.php
+++ b/tests/modules/opengraph/test-opengraph.php
@@ -12,6 +12,243 @@
*/
class Test_Opengraph extends AIOSEOP_Test_Base {
+ public function setUp() {
+ $this->init( true );
+ }
+
+ /**
+ * Provides the title and content for the posts to be used for meta tag testing.
+ */
+ public function metaTagContentProvider() {
+ return array(
+ array( 'seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo', 'seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo seo', 203 ),
+ );
+ }
+
+ /**
+ * Checks whether the meta tags are being truncated correctly.
+ *
+ * Function: Adds a post with a long content and title and checks whether the meta tags are being truncated correctly
+ * Expected: The meta tags are being truncated according to the limits imposed.
+ * Actual: Currently works as expected.
+ * Reproduce: Insert a post and check the length of the meta tags content.
+ *
+ * @dataProvider metaTagContentProvider
+ *
+ * @since 3.0
+ */
+ public function test_meta_tag_truncation_all( $title, $content, $og_desc_limit ) {
+ $tag_limits = array(
+ 'og:description' => $og_desc_limit, // limit to 200 but respect full words
+ 'twitter:description' => 200, // hard limit to 200
+ 'twitter:title' => 70, // hard limit to 70
+ );
+
+ $id = $this->factory->post->create( array( 'post_title' => $title, 'post_content' => $content ) );
+
+ wp_set_current_user( 1 );
+
+ $options = get_option( 'aioseop_options' );
+ $options['aiosp_cpostactive'] = array( 'post' );
+ update_option( 'aioseop_options', $options );
+
+ $custom_options = array();
+ $custom_options['aiosp_opengraph_types'] = array( 'post' );
+ $custom_options['aiosp_opengraph_generate_descriptions'] = 'on';
+ $this->_setup_options( 'opengraph', $custom_options );
+
+ $meta = $this->parse_html( get_permalink( $id ), array( 'meta' ) );
+
+ // should have atleast one meta tag.
+ $this->assertGreaterThan( 1, count( $meta ) );
+
+ foreach ( $meta as $m ) {
+ $tag = isset( $m['property'] ) ? $m['property'] : $m['name'];
+ if ( empty( $tag ) ) {
+ continue;
+ }
+ if ( array_key_exists( $tag, $tag_limits ) ) {
+ $this->assertLessThanOrEqual( $tag_limits[ $tag ], strlen( $m['content'] ) );
+ }
+ }
+ }
+
+ /**
+ * Checks whether the meta tags are being truncated correctly ONLY IF they are not being explicitly provided (in the opengraph metabox title).
+ *
+ * Function: Adds a post with a long content and title and with seo title and checks whether ONLY the description meta tags are being truncated correctly
+ * Expected: The meta tags are being truncated according to the limits imposed.
+ * Actual: Currently works as expected.
+ * Reproduce: Insert a post and check the length of the meta tags content.
+ *
+ * @dataProvider metaTagContentProvider
+ *
+ * @since 3.0
+ */
+ public function test_meta_tag_truncation_with_manual_og_title( $title, $content, $og_desc_limit ) {
+ $tag_limits = array(
+ 'og:description' => $og_desc_limit, // limit to 200 but respect full words
+ 'twitter:description' => 200, // hard limit to 200
+ 'twitter:title' => array( 70 ), // no limit
+ );
+
+ wp_set_current_user( 1 );
+
+ $options = get_option( 'aioseop_options' );
+ $options['aiosp_cpostactive'] = array( 'post' );
+ update_option( 'aioseop_options', $options );
+
+ $custom_options = array();
+ $custom_options['aiosp_opengraph_types'] = array( 'post' );
+ $custom_options['aiosp_opengraph_generate_descriptions'] = 'on';
+ $this->_setup_options( 'opengraph', $custom_options );
+
+ $id = $this->factory->post->create( array( 'post_title' => $title, 'post_content' => $content ) );
+
+ $settings = get_post_meta( $id, '_aioseop_opengraph_settings', true );
+ $settings['aioseop_opengraph_settings_title'] = $title;
+ update_post_meta( $id, '_aioseop_opengraph_settings', $settings );
+
+ $meta = $this->parse_html( get_permalink( $id ), array( 'meta' ) );
+
+ // should have atleast one meta tag.
+ $this->assertGreaterThan( 1, count( $meta ) );
+
+ foreach ( $meta as $m ) {
+ $tag = isset( $m['property'] ) ? $m['property'] : $m['name'];
+ if ( empty( $tag ) ) {
+ continue;
+ }
+ if ( array_key_exists( $tag, $tag_limits ) ) {
+ if ( is_array( $tag_limits[ $tag ] ) ) {
+ $this->assertGreaterThan( $tag_limits[ $tag ][0], strlen( $m['content'] ) );
+ } else {
+ $this->assertLessThanOrEqual( $tag_limits[ $tag ], strlen( $m['content'] ) );
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks whether the meta tags are being truncated correctly ONLY IF they are not being explicitly provided (in the main metabox title).
+ *
+ * Function: Adds a post with a long content and title and with seo title and checks whether ONLY the description meta tags are being truncated correctly
+ * Expected: The meta tags are being truncated according to the limits imposed.
+ * Actual: Currently works as expected.
+ * Reproduce: Insert a post and check the length of the meta tags content.
+ *
+ * @dataProvider metaTagContentProvider
+ *
+ * @since 3.0
+ */
+ public function test_meta_tag_truncation_with_manual_main_title( $title, $content, $og_desc_limit ) {
+ $tag_limits = array(
+ 'og:description' => $og_desc_limit, // limit to 200 but respect full words
+ 'twitter:description' => 200, // hard limit to 200
+ 'twitter:title' => array( 70 ), // no limit
+ );
+
+ wp_set_current_user( 1 );
+
+ $options = get_option( 'aioseop_options' );
+ $options['aiosp_cpostactive'] = array( 'post' );
+ update_option( 'aioseop_options', $options );
+
+ $custom_options = array();
+ $custom_options['aiosp_opengraph_types'] = array( 'post' );
+ $custom_options['aiosp_opengraph_generate_descriptions'] = 'on';
+ $this->_setup_options( 'opengraph', $custom_options );
+
+ $id = $this->factory->post->create( array( 'post_title' => $title, 'post_content' => $content ) );
+
+ update_post_meta( $id, '_aioseop_title', $title );
+
+ $meta = $this->parse_html( get_permalink( $id ), array( 'meta' ) );
+
+ // should have atleast one meta tag.
+ $this->assertGreaterThan( 1, count( $meta ) );
+
+ foreach ( $meta as $m ) {
+ $tag = isset( $m['property'] ) ? $m['property'] : $m['name'];
+ if ( empty( $tag ) ) {
+ continue;
+ }
+ if ( array_key_exists( $tag, $tag_limits ) ) {
+ if ( is_array( $tag_limits[ $tag ] ) ) {
+ $this->assertGreaterThan( $tag_limits[ $tag ][0], strlen( $m['content'] ) );
+ } else {
+ $this->assertLessThanOrEqual( $tag_limits[ $tag ], strlen( $m['content'] ) );
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks whether the meta tag filter to disable truncation is running correctly.
+ *
+ * Function: Adds a post with a long content and title and checks whether the meta tags are being truncated correctly except for the meta tag that's not being truncated.
+ * Expected: The meta tags are being truncated according to the limits imposed, except for the meta tag that's not being truncated.
+ * Actual: Currently works as expected.
+ * Reproduce: Insert a post and check the length of the meta tags content.
+ *
+ * @dataProvider metaTagContentProvider
+ *
+ * @since 3.0
+ */
+ public function test_meta_tag_truncation_filter( $title, $content, $og_desc_limit ) {
+ $tag_limits = array(
+ 'og:description' => $og_desc_limit, // limit to 200 but respect full words
+ 'twitter:description' => 200, // hard limit to 200
+ 'twitter:title' => array( 70 ), // no limit
+ );
+
+ $id = $this->factory->post->create( array( 'post_title' => $title, 'post_content' => $content ) );
+
+ wp_set_current_user( 1 );
+
+ $options = get_option( 'aioseop_options' );
+ $options['aiosp_cpostactive'] = array( 'post' );
+ update_option( 'aioseop_options', $options );
+
+ $custom_options = array();
+ $custom_options['aiosp_opengraph_types'] = array( 'post' );
+ $custom_options['aiosp_opengraph_generate_descriptions'] = 'on';
+ $this->_setup_options( 'opengraph', $custom_options );
+
+ add_filter( 'aiosp_opengraph_disable_meta_tag_truncation', array( $this, 'filter_disable_meta_tag_truncation' ), 10, 4 );
+
+ $meta = $this->parse_html( get_permalink( $id ), array( 'meta' ) );
+
+ // should have atleast one meta tag.
+ $this->assertGreaterThan( 1, count( $meta ) );
+
+ foreach ( $meta as $m ) {
+ $tag = isset( $m['property'] ) ? $m['property'] : $m['name'];
+ if ( empty( $tag ) ) {
+ continue;
+ }
+ if ( array_key_exists( $tag, $tag_limits ) ) {
+ if ( is_array( $tag_limits[ $tag ] ) ) {
+ $this->assertGreaterThan( $tag_limits[ $tag ][0], strlen( $m['content'] ) );
+ } else {
+ $this->assertLessThanOrEqual( $tag_limits[ $tag ], strlen( $m['content'] ) );
+ }
+ }
+ }
+ }
+
+ /**
+ * Implements the filter to disable truncation of a particular meta tag.
+ */
+ function filter_disable_meta_tag_truncation( $disable, $network, $meta_tag, $network_meta_tag ) {
+ switch ( $network_meta_tag ) {
+ case 'twitter:title':
+ $disable = true;
+ break;
+ }
+ return $disable;
+ }
+
/**
* Checks the home page's meta tags.
*
From 95edc607b94012b1a6699af460d8b79cdcb1a88b Mon Sep 17 00:00:00 2001
From: Ashish Ravi
Date: Sat, 13 Apr 2019 16:21:40 +0530
Subject: [PATCH 032/121] PHPCS checks for strict comparsion
---
phpcs.xml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/phpcs.xml b/phpcs.xml
index 1eacd9efe..6ad8162f6 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -48,6 +48,13 @@
+
+
+
+
+
+
+
From 2cedcd764b29d213f4dbc67a90b37b4c56189fc3 Mon Sep 17 00:00:00 2001
From: EkoJR
Date: Sat, 13 Apr 2019 14:58:22 -0700
Subject: [PATCH 033/121] Sync with Pro & Add Filter for extended help text
(#2325)
* Add Filter for extended help text
* Remove old help text function for pro
The plugin uses a filter instead for extending the help text.
---
admin/class-aioseop-helper.php | 47 ++++++++++++----------------------
1 file changed, 16 insertions(+), 31 deletions(-)
diff --git a/admin/class-aioseop-helper.php b/admin/class-aioseop-helper.php
index d349dfbf5..7d8503da9 100644
--- a/admin/class-aioseop-helper.php
+++ b/admin/class-aioseop-helper.php
@@ -46,7 +46,7 @@ public function __construct( $module = '' ) {
* no class name in $module, then this Help Text will add all module help texts.
*
* @ignore
- * @since 2.4.2
+ * @since 3.0
* @access private
*
* @param string $module All_in_One_SEO_Pack module.
@@ -79,31 +79,17 @@ private function _set_help_text( $module ) {
case 'All_in_One_SEO_Pack_Bad_Robots':
$this->help_text = $this->help_text_bad_robots();
break;
- default:
- $this->help_text = array_merge(
- $this->help_text,
- $this->help_text_general(),
- $this->help_text_performance(),
- $this->help_text_sitemap(),
- $this->help_text_opengraph(),
- $this->help_text_robots_generator(),
- $this->help_text_file_editor(),
- $this->help_text_importer_exporter(),
- $this->help_text_bad_robots(),
- $this->help_text_post_meta()
- );
- break;
- }
-
- if ( AIOSEOPPRO ) {
- $help_text = aioseop_add_pro_help( $this->help_text );
-
- // TODO - Get Prefix from PRO Version.
- foreach ( $help_text as $key => $text ) {
- $this->help_text[ $key ] = $text;
- }
}
+ /**
+ * Set Help Text
+ *
+ * @since 3.0
+ *
+ * @param array $this->help_text Contains an array of help text for each setting.
+ * @param string $module Shows which class module is using the function.
+ */
+ $this->help_text = apply_filters( 'aioseop_helper_set_help_text', $this->help_text, $module );
}
/**
@@ -492,8 +478,6 @@ private function help_text_general() {
'aiosp_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' ),
// Unknown Location.
- 'aiosp_license_key' => __( 'This will be the license key received when the product was purchased. This is used for automatic upgrades.', 'all-in-one-seo-pack' ),
- 'aiosp_taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
'aiosp_google_connect' => __( 'Press the connect button to connect with Google Analytics; or if already connected, press the disconnect button to disable and remove any stored analytics credentials.', 'all-in-one-seo-pack' ),
);
@@ -637,9 +621,7 @@ private function help_text_general() {
'aiosp_dynamic_postspage_keywords' => 'https://semperplugins.com/documentation/keyword-settings/#dynamically-generate-keywords-for-posts-page',
// Unknown/Pro?
- // 'aiosp_license_key' => '',
- // 'aiosp_taxactive' => '',
- // 'aiosp_google_connect' => '',
+ // 'aiosp_google_connect' => '',
);
foreach ( $help_doc_link as $k1_slug => $v1_url ) {
@@ -905,11 +887,14 @@ private function help_text_opengraph() {
'aioseop_opengraph_settings_customimg_twitter' => __( 'This option lets you upload an image to use as the Twitter image for this Page or Post.', 'all-in-one-seo-pack' ),
);
- $args = array(
+ $args_1 = array(
'public' => true,
);
+ $args_2 = array(
+ 'public' => false,
+ );
- $post_types = get_post_types( $args, 'names' );
+ $post_types = array_merge( get_post_types( $args_1, 'names' ), get_post_types( $args_2, 'names' ) );
foreach ( $post_types as $pt ) {
$rtn_help_text[ 'aiosp_opengraph_' . $pt . '_fb_object_type' ] = __( 'Choose a default value that best describes the content of your post type.', 'all-in-one-seo-pack' );
$rtn_help_text[ 'aiosp_opengraph_' . $pt . '_fb_object_type' ] .= '
' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '';
From 2465fa95256a24c15eac68fb7197c5bc21195d36 Mon Sep 17 00:00:00 2001
From: contactashish13
Date: Wed, 24 Apr 2019 18:36:35 +0530
Subject: [PATCH 034/121] Video XML Sitemap - Remove taxonomy pages from video
sitemap (#2334)
* added info for testing
* Video XML Sitemap - Remove taxonomy pages from video sitemap
https://github.com/semperfiwebdesign/aioseop-pro/issues/246
* PR comments
* code review comments
* Dev-Fix typo & add initial since tag
---
modules/aioseop_sitemap.php | 41 +++++++++++++++++++++++++++++--------
1 file changed, 33 insertions(+), 8 deletions(-)
diff --git a/modules/aioseop_sitemap.php b/modules/aioseop_sitemap.php
index 1ca87778a..c233b8d1f 100644
--- a/modules/aioseop_sitemap.php
+++ b/modules/aioseop_sitemap.php
@@ -1546,7 +1546,7 @@ public function get_sitemap_data( $sitemap_type, $page = 0 ) {
$sitemap_data = $this->get_all_post_priority_data( $sitemap_type, 'publish', $page );
} elseif ( in_array( $sitemap_type, $taxonomies ) ) {
// TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
- $sitemap_data = $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args( $page ) ) );
+ $sitemap_data = $this->get_term_priority_data( get_terms( $this->get_tax_args( $sitemap_type, $page ) ) );
} else {
// TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
if ( is_array( $this->extra_sitemaps ) && in_array( $sitemap_type, $this->extra_sitemaps ) ) {
@@ -1875,7 +1875,7 @@ public function get_sitemap_index_filenames() {
$options[ "{$this->prefix}taxonomies" ] = array();
}
$options[ "{$this->prefix}posttypes" ] = array_diff( $options[ "{$this->prefix}posttypes" ], array( 'all' ) );
- $options[ "{$this->prefix}taxonomies" ] = array_diff( $options[ "{$this->prefix}taxonomies" ], array( 'all' ) );
+ $options[ "{$this->prefix}taxonomies" ] = $this->show_or_hide_taxonomy( array_diff( $options[ "{$this->prefix}taxonomies" ], array( 'all' ) ) );
$files[] = array( 'loc' => aioseop_home_url( '/' . $prefix . '_addl' . $suffix ) );
@@ -2212,7 +2212,7 @@ public function get_simple_sitemap() {
if ( is_array( $home ) ) {
array_unshift( $prio, $home );
}
- $terms = get_terms( $options[ "{$this->prefix}taxonomies" ], $this->get_tax_args() );
+ $terms = get_terms( $this->get_tax_args( $options[ "{$this->prefix}taxonomies" ] ) );
$prio2 = $this->get_term_priority_data( $terms );
$prio3 = $this->get_addl_pages_only();
$prio = array_merge( $child, $prio, $prio2, $prio3 );
@@ -2555,7 +2555,7 @@ public function build_sitemap( $urls, $sitemap_type, $comment = '' ) {
*/
public function get_term_priority_data( $terms ) {
$prio = array();
- if ( is_array( $terms ) ) {
+ if ( is_array( $terms ) && ! empty( $terms ) ) {
$def_prio = $this->get_default_priority( 'taxonomies' );
$def_freq = $this->get_default_frequency( 'taxonomies' );
foreach ( $terms as $term ) {
@@ -3818,11 +3818,15 @@ public function parse_content_for_images( $content, &$images ) {
/**
* Return excluded categories for taxonomy queries.
*
- * @param int $page
+ * @since ?
+ * @since 3.0.0 Added $taxonomy parameter.
+ *
+ * @param array $taxonomy The array of taxonomy slugs.
+ * @param int $page The page number.
*
* @return array
*/
- public function get_tax_args( $page = 0 ) {
+ public function get_tax_args( $taxonomy, $page = 0 ) {
$args = array();
if ( $this->option_isset( 'excl_categories' ) ) {
$args['exclude'] = $this->options[ $this->prefix . 'excl_categories' ];
@@ -3831,6 +3835,7 @@ public function get_tax_args( $page = 0 ) {
$args['number'] = $this->max_posts;
$args['offset'] = $page * $this->max_posts;
}
+ $args['taxonomy'] = $this->show_or_hide_taxonomy( $taxonomy );
$args = apply_filters( $this->prefix . 'tax_args', $args, $page, $this->options );
@@ -4033,6 +4038,26 @@ public function get_permalink( $post ) {
return aioseop_get_permalink( $post );
}
+ /**
+ * Show or hide the taxonomy/taxonomies.
+ *
+ * @since 3.0.0
+ *
+ * @param array $taxonomy The array of taxonomy slugs.
+ *
+ * @return array The array of taxonomy slugs that need to be shown.
+ */
+ private function show_or_hide_taxonomy( $taxonomy ) {
+ /**
+ * Determines whether to show or hide the taxonomy/taxonomies.
+ *
+ * @since 3.0.0
+ *
+ * @param array $taxonomy The array of taxonomy slugs.
+ */
+ return apply_filters( "{$this->prefix}show_taxonomy", $taxonomy );
+ }
+
/**
* Return term counts using wp_count_terms().
*
@@ -4048,13 +4073,13 @@ public function get_all_term_counts( $args ) {
if ( is_array( $args['taxonomy'] ) ) {
$args['taxonomy'] = array_shift( $args['taxonomy'] );
}
- $term_counts = wp_count_terms( $args['taxonomy'], array( 'hide_empty' => true ) );
+ $term_counts = wp_count_terms( $this->show_or_hide_taxonomy( $args['taxonomy'] ), array( 'hide_empty' => true ) );
} else {
foreach ( $args['taxonomy'] as $taxonomy ) {
if ( 'all' === $taxonomy ) {
continue;
}
- $term_counts[ $taxonomy ] = wp_count_terms( $taxonomy, array( 'hide_empty' => true ) );
+ $term_counts[ $taxonomy ] = wp_count_terms( $this->show_or_hide_taxonomy( $taxonomy ), array( 'hide_empty' => true ) );
}
}
}
From 313d2115ee24b2c4ee2532107e263e8593118c8c Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Thu, 25 Apr 2019 15:20:55 -0400
Subject: [PATCH 035/121] Open Upgrade links as new tabs #773 (#2347)
* + Open Upgrade links in new tab #773
* + Grunt fixes #773
* = PR comments #773
* = Fix spacing #773
---
admin/display/general-metaboxes.php | 6 +++---
admin/display/menu.php | 19 +++++++++++++++++++
all_in_one_seo_pack.php | 2 +-
js/aioseop-menu.js | 20 ++++++++++++++++++++
js/aioseop-menu.min.js | 1 +
js/plugins-menu.js | 20 ++++++++++++++++++++
js/plugins-menu.min.js | 1 +
7 files changed, 65 insertions(+), 4 deletions(-)
create mode 100644 js/aioseop-menu.js
create mode 100644 js/aioseop-menu.min.js
create mode 100644 js/plugins-menu.js
create mode 100644 js/plugins-menu.min.js
diff --git a/admin/display/general-metaboxes.php b/admin/display/general-metaboxes.php
index 77d6c272a..a32c21d0f 100644
--- a/admin/display/general-metaboxes.php
+++ b/admin/display/general-metaboxes.php
@@ -51,11 +51,11 @@ static function display_extra_metaboxes( $add, $meta ) {
+ case 'aioseop-donate':
+ ?>
-
+
diff --git a/admin/display/menu.php b/admin/display/menu.php
index 9857d8695..4a3e4a4be 100644
--- a/admin/display/menu.php
+++ b/admin/display/menu.php
@@ -23,6 +23,8 @@ function __construct() {
} else {
return;
}
+
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
}
function remove_menus() {
@@ -44,6 +46,23 @@ function add_pro_submenu() {
$url,
);
}
+
+ /*
+ * Opens Upgrade to Pro links in WP Admin as new tab.
+ *
+ * Enqueued here because All_in_One_SEO_Pack_Module::admin_enqueue_scripts does not work.
+ *
+ * @param string $hook
+ *
+ * @since 3.0
+ */
+ function admin_enqueue_scripts( $hook ) {
+ wp_enqueue_script( 'aioseop_menu_js', AIOSEOP_PLUGIN_URL . 'js/aioseop-menu.js', array( 'jquery' ), AIOSEOP_VERSION, true );
+
+ if ( 'plugins.php' === $hook ) {
+ wp_enqueue_script( 'aioseop_plugins_menu_js', AIOSEOP_PLUGIN_URL . 'js/plugins-menu.js', array( 'jquery' ), AIOSEOP_VERSION, true );
+ }
+ }
}
new AIOSEOPAdminMenus();
diff --git a/all_in_one_seo_pack.php b/all_in_one_seo_pack.php
index 91c362c1b..806a01043 100644
--- a/all_in_one_seo_pack.php
+++ b/all_in_one_seo_pack.php
@@ -305,7 +305,7 @@ function aiosp_plugin_row_meta( $actions, $plugin_file ) {
);
- return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
+ return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
}
}
diff --git a/js/aioseop-menu.js b/js/aioseop-menu.js
new file mode 100644
index 000000000..ccc411861
--- /dev/null
+++ b/js/aioseop-menu.js
@@ -0,0 +1,20 @@
+/**
+ * AIOSEOP menu.
+ *
+ * Contains all functions that affect the AIOSEOP menu in the sidebar.
+ *
+ * @since 3.0
+ * @package all-in-one-seo-pack
+ */
+(function($) {
+
+ /**
+ * Opens Upgrade to Pro link in AIOSEOP menu as new tab.
+ */
+ function upgrade_link_aioseop_menu_new_tab() {
+ $('#toplevel_page_all-in-one-seo-pack-aioseop_class ul li').last().find('a').attr('target','_blank');
+ }
+
+ upgrade_link_aioseop_menu_new_tab();
+
+}(jQuery));
diff --git a/js/aioseop-menu.min.js b/js/aioseop-menu.min.js
new file mode 100644
index 000000000..f671ffcb9
--- /dev/null
+++ b/js/aioseop-menu.min.js
@@ -0,0 +1 @@
+jQuery("#toplevel_page_all-in-one-seo-pack-aioseop_class ul li").last().find("a").attr("target","_blank");
\ No newline at end of file
diff --git a/js/plugins-menu.js b/js/plugins-menu.js
new file mode 100644
index 000000000..752d7bfea
--- /dev/null
+++ b/js/plugins-menu.js
@@ -0,0 +1,20 @@
+/**
+ * Plugins menu.
+ *
+ * Contains all functions that affect the Plugins menu.
+ *
+ * @since 3.0
+ * @package all-in-one-seo-pack
+ */
+(function($) {
+
+ /**
+ * Opens Upgrade to Pro link in Plugins menu as new tab.
+ */
+ function upgrade_link_plugins_menu_new_tab() {
+ $('.proupgrade').find('a').attr('target','_blank');
+ }
+
+ upgrade_link_plugins_menu_new_tab();
+
+}(jQuery));
diff --git a/js/plugins-menu.min.js b/js/plugins-menu.min.js
new file mode 100644
index 000000000..a8cab5f0e
--- /dev/null
+++ b/js/plugins-menu.min.js
@@ -0,0 +1 @@
+jQuery(".proupgrade").find("a").attr("target","_blank");
\ No newline at end of file
From f2b6eca55f491b14ddcc8abe987a0e50c362c026 Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Thu, 25 Apr 2019 17:44:27 -0400
Subject: [PATCH 036/121] = Change absolute URI to relative URI #2282 (#2350)
---
admin/display/menu.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/admin/display/menu.php b/admin/display/menu.php
index 4a3e4a4be..180e051c5 100644
--- a/admin/display/menu.php
+++ b/admin/display/menu.php
@@ -40,7 +40,7 @@ function add_pro_submenu() {
global $submenu;
$url = 'https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_menu';
$upgrade_text = __( 'Upgrade to Pro', 'all-in-one-seo-pack' );
- $submenu['all-in-one-seo-pack/aioseop_class.php'][] = array(
+ $submenu[ AIOSEOP_PLUGIN_DIRNAME . '/aioseop_class.php' ][] = array(
"$upgrade_text",
'manage_options',
$url,
From 6e5f09e83ef394ae71a7c5cd3d63f92784daabdf Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Fri, 26 Apr 2019 12:25:18 -0400
Subject: [PATCH 037/121] Add Pro to sitemap source code (#2358)
* = Add Pro to sitemap source code as appropriate #1972
* changing Semper Plugins back to Semper Fi Web Design
---
modules/aioseop_sitemap.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/aioseop_sitemap.php b/modules/aioseop_sitemap.php
index c233b8d1f..f4b192e2d 100644
--- a/modules/aioseop_sitemap.php
+++ b/modules/aioseop_sitemap.php
@@ -166,7 +166,7 @@ public function __construct() {
}
parent::__construct();
// TODO This could be move up to the class field default/initial values.
- $this->comment_string = 'Sitemap %s generated by All in One SEO Pack %s by Michael Torbert of Semper Fi Web Design on %s';
+ $this->comment_string = 'Sitemap %s generated by ' . AIOSEOP_PLUGIN_NAME . ' %s by Michael Torbert of Semper Fi Web Design on %s';
$this->default_options = array(
'rss_sitemap' => array( 'name' => __( 'Create RSS Sitemap', 'all-in-one-seo-pack' ) ),
From e8274606819d21edd3451358d2bb35e3bbde3da5 Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Fri, 26 Apr 2019 15:38:30 -0400
Subject: [PATCH 038/121] = Remove redundant global $aioseop_plugin_name #2353
(#2354)
---
all_in_one_seo_pack.php | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/all_in_one_seo_pack.php b/all_in_one_seo_pack.php
index 806a01043..7a155928a 100644
--- a/all_in_one_seo_pack.php
+++ b/all_in_one_seo_pack.php
@@ -38,11 +38,12 @@
if ( ! defined( 'AIOSEOPPRO' ) ) {
define( 'AIOSEOPPRO', false );
}
+if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
+ define( 'AIOSEOP_PLUGIN_NAME', 'All in One SEO Pack' );
+}
if ( ! defined( 'AIOSEOP_VERSION' ) ) {
define( 'AIOSEOP_VERSION', '3.0-dev' );
}
-global $aioseop_plugin_name;
-$aioseop_plugin_name = 'All in One SEO Pack';
/*
* DO NOT EDIT BELOW THIS LINE.
@@ -74,10 +75,6 @@ function aiosp_add_cap() {
}
add_action( 'plugins_loaded', 'aiosp_add_cap' );
-if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
- define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
-}
-
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
} elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
From 88b4e59d9375a06f4b62efa760be52e556f03bb8 Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Fri, 26 Apr 2019 15:39:25 -0400
Subject: [PATCH 039/121] Use double quotes for pagination links (#2352)
* = Use double quotes for pagination links #2088
* = Escape double quotes instead of using concatenation #2088
---
aioseop_class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/aioseop_class.php b/aioseop_class.php
index 505beffe3..322b6c0a3 100644
--- a/aioseop_class.php
+++ b/aioseop_class.php
@@ -3737,10 +3737,10 @@ function wp_head() {
$prev = apply_filters( 'aioseop_prev_link', $prev_next['prev'] );
$next = apply_filters( 'aioseop_next_link', $prev_next['next'] );
if ( ! empty( $prev ) ) {
- $meta_string .= "\n";
+ $meta_string .= '\n";
}
if ( ! empty( $next ) ) {
- $meta_string .= "\n";
+ $meta_string .= '\n";
}
if ( $meta_string != null ) {
echo "$meta_string\n";
From fc3883fc76a89cb7bcea72393aa282ac98d8fa34 Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Mon, 29 Apr 2019 10:19:25 -0400
Subject: [PATCH 040/121] + Change social meta home title field to text input
#1336 (#2366)
---
modules/aioseop_opengraph.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/aioseop_opengraph.php b/modules/aioseop_opengraph.php
index 470934f7b..72c132f8a 100644
--- a/modules/aioseop_opengraph.php
+++ b/modules/aioseop_opengraph.php
@@ -334,7 +334,7 @@ public function init() {
'hometitle' => array(
'name' => __( 'Home Title', 'all-in-one-seo-pack' ),
'default' => '',
- 'type' => 'textarea',
+ 'type' => 'text',
'condshow' => array(
'aiosp_opengraph_setmeta' => array(
'lhs' => 'aiosp_opengraph_setmeta',
From 0822de4f952e593e93bd7b245a28437d1fda1845 Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Mon, 29 Apr 2019 10:23:06 -0400
Subject: [PATCH 041/121] + Use AIOSEOP_PLUGIN_NAME in sitemap instead of
string #2357 (#2365)
---
inc/sitemap-xsl.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/inc/sitemap-xsl.php b/inc/sitemap-xsl.php
index a8e7538a9..123ee9d54 100644
--- a/inc/sitemap-xsl.php
+++ b/inc/sitemap-xsl.php
@@ -89,12 +89,12 @@
XML Sitemap
-
Generated by All in One SEO, this is an XML Sitemap, meant to be consumed by search engines like Google or Bing.
+
Generated by , this is an XML Sitemap, meant to be consumed by search engines like Google or Bing.
You can find more information about XML sitemaps at sitemaps.org.
- This sitemap contains URLs
- This sitemap index contains sitemaps
+ This sitemap contains URLs.
+ This sitemap index contains sitemaps.
From 1d22eeef0598eb9ca88b1250a68ff56a2d7ff073 Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Mon, 29 Apr 2019 10:30:37 -0400
Subject: [PATCH 042/121] Add Yandex and Baidu Webmaster Tools verification
(#2362)
* + Add option for Yandex Webmaster Tools verification #875
* + Add option for Baidu Webmaster Tools verification #875
---
admin/class-aioseop-helper.php | 4 ++++
aioseop_class.php | 14 +++++++++++++-
inc/compatability/compat-init.php | 8 ++++++++
3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/admin/class-aioseop-helper.php b/admin/class-aioseop-helper.php
index 7d8503da9..5be2812f6 100644
--- a/admin/class-aioseop-helper.php
+++ b/admin/class-aioseop-helper.php
@@ -421,6 +421,8 @@ private function help_text_general() {
'aiosp_google_verify' => __( 'Enter your verification code here to verify your site with Google Search Console.', 'all-in-one-seo-pack' ),
'aiosp_bing_verify' => __( 'Enter your verification code here to verify your site with Bing Webmaster Tools.', 'all-in-one-seo-pack' ),
'aiosp_pinterest_verify' => __( 'Enter your verification code here to verify your site with Pinterest.', 'all-in-one-seo-pack' ),
+ 'aiosp_yandex_verify' => __( 'Enter your verification code here to verify your site with Yandex Webmaster Tools.', 'all-in-one-seo-pack' ),
+ 'aiosp_baidu_verify' => __( 'Enter your verification code here to verify your site with Baidu Webmaster Tools.', 'all-in-one-seo-pack' ),
// Google Settings.
'aiosp_google_publisher' => __( 'Enter your Google+ Profile URL here to add the rel=“author” tag to your site for Google authorship. It is recommended that the URL you enter here should be your personal Google+ profile. Use the Advanced Authorship Options below if you want greater control over the use of authorship.', 'all-in-one-seo-pack' ),
@@ -563,6 +565,8 @@ private function help_text_general() {
'aiosp_google_verify' => 'https://semperplugins.com/documentation/google-search-console-verification/',
'aiosp_bing_verify' => 'https://semperplugins.com/documentation/bing-webmaster-verification/',
'aiosp_pinterest_verify' => 'https://semperplugins.com/documentation/pinterest-site-verification/',
+ 'aiosp_yandex_verify' => 'https://semperplugins.com/documentation/yandex-webmaster-verification/',
+ 'aiosp_baidu_verify' => 'https://semperplugins.com/documentation/baidu-webmaster-verification/',
// Google Settings.
'aiosp_google_publisher' => 'https://semperplugins.com/documentation/google-settings/#google-plus-default-profile',
diff --git a/aioseop_class.php b/aioseop_class.php
index 322b6c0a3..22c9a8448 100644
--- a/aioseop_class.php
+++ b/aioseop_class.php
@@ -283,6 +283,16 @@ function __construct() {
'default' => '',
'type' => 'text',
),
+ 'yandex_verify' => array(
+ 'name' => __( 'Yandex Webmaster Tools:', 'all-in-one-seo-pack' ),
+ 'default' => '',
+ 'type' => 'text',
+ ),
+ 'baidu_verify' => array(
+ 'name' => __( 'Baidu Webmaster Tools:', 'all-in-one-seo-pack' ),
+ 'default' => '',
+ 'type' => 'text',
+ ),
'google_publisher' => array(
'name' => __( 'Google Plus Default Profile:', 'all-in-one-seo-pack' ),
'default' => '',
@@ -733,7 +743,7 @@ function __construct() {
'webmaster' => array(
'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
'help_link' => 'https://semperplugins.com/sections/webmaster-verification/',
- 'options' => array( 'google_verify', 'bing_verify', 'pinterest_verify' ),
+ 'options' => array( 'google_verify', 'bing_verify', 'pinterest_verify', 'yandex_verify', 'baidu_verify' ),
),
'google' => array(
'name' => __( 'Google Settings', 'all-in-one-seo-pack' ),
@@ -3675,6 +3685,8 @@ function wp_head() {
'google' => 'google-site-verification',
'bing' => 'msvalidate.01',
'pinterest' => 'p:domain_verify',
+ 'yandex' => 'yandex-verification',
+ 'baidu' => 'baidu-site-verification',
) as $k => $v
) {
if ( ! empty( $aioseop_options[ "aiosp_{$k}_verify" ] ) ) {
diff --git a/inc/compatability/compat-init.php b/inc/compatability/compat-init.php
index 2b91de506..d9e675550 100644
--- a/inc/compatability/compat-init.php
+++ b/inc/compatability/compat-init.php
@@ -108,6 +108,14 @@ function filter_jetpack_site_verification_output( $ver_tag ) {
return '';
}
+ if ( isset( $aioseop_options['aiosp_yandex_verify'] ) && ! empty( $aioseop_options['aiosp_yandex_verify'] ) && strpos( $ver_tag, 'yandex-verification' ) ) {
+ return '';
+ }
+
+ if ( isset( $aioseop_options['aiosp_baidu_verify'] ) && ! empty( $aioseop_options['aiosp_baidu_verify'] ) && strpos( $ver_tag, 'baidu-site-verification' ) ) {
+ return '';
+ }
+
return $ver_tag;
}
From 5c17b112322342226f8d33e672e6051253ffe0ad Mon Sep 17 00:00:00 2001
From: wpsmort
Date: Mon, 29 Apr 2019 11:51:00 -0400
Subject: [PATCH 043/121] #1790 Change height for text fields to min-height
(#2367)
---
css/modules/aioseop_module.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/css/modules/aioseop_module.css b/css/modules/aioseop_module.css
index 8e196ac6b..5a5ae9d7e 100644
--- a/css/modules/aioseop_module.css
+++ b/css/modules/aioseop_module.css
@@ -161,7 +161,7 @@ div.aioseop_tip_icon:before {
.aioseop input[type="text"], .aioseop input[type="url"] {
color: #515151;
- height: 35px;
+ min-height: 35px;
padding: 10px 0 10px 10px;
font-size: 14px;
width: 95%;
@@ -1513,4 +1513,4 @@ textarea.robots-text {
div#aiosp_sitemap_status_metabox .toggle-indicator {
display:none;
-}
\ No newline at end of file
+}
From c3aa5c933f10d7c972725ae51db05aa5f432a410 Mon Sep 17 00:00:00 2001
From: Arnaud Broes
Date: Wed, 1 May 2019 17:10:14 -0400
Subject: [PATCH 044/121] Add separate mailing list for Pro users (#2369)
* + Add separate mailing list for Pro users
* = Change if control structure to braces
* = Change if control structure back to alternative syntax
---
admin/display/general-metaboxes.php | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/admin/display/general-metaboxes.php b/admin/display/general-metaboxes.php
index a32c21d0f..3ddc8b653 100644
--- a/admin/display/general-metaboxes.php
+++ b/admin/display/general-metaboxes.php
@@ -111,8 +111,12 @@ static function display_extra_metaboxes( $add, $meta ) {
?>