diff --git a/.travis.yml b/.travis.yml index 607aa5ed9..b201f7183 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 @@ -17,9 +17,13 @@ matrix: dist: precise - php: 5.2 dist: precise - - env: WP_VERSION=latest - - env: WP_VERSION=4.5 + - env: WP_VERSION=latest PHPUNIT=local + - env: WP_VERSION=4.6 PHPUNIT=local - 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 cb19c0991..c15e975f2 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -31,7 +31,7 @@ _Put an `x` in the boxes that apply. You can also fill these out after creating - 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. +- Do note what aspects the tester should try and break. ## Further comments diff --git a/admin/aioseop_module_class.php b/admin/aioseop_module_class.php index 3bc98f5a4..8c99972bb 100644 --- a/admin/aioseop_module_class.php +++ b/admin/aioseop_module_class.php @@ -566,7 +566,6 @@ function default_bad_bots() { 'EmailSiphon', 'EmailWolf', 'EroCrawler', - 'Exabot', 'ExtractorPro', 'Fasterfox', 'FeedBooster', @@ -839,7 +838,11 @@ function get_term_labels( $post_objs ) { * @return array */ function get_post_type_titles( $args = array() ) { - return $this->get_object_labels( get_post_types( $args, 'objects' ) ); + $object_labels = $this->get_object_labels( get_post_types( $args, 'objects' ) ); + if ( isset( $object_labels['attachment'] ) ) { + $object_labels['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' ); + } + return $object_labels; } /** @@ -852,12 +855,19 @@ function get_taxonomy_titles( $args = array() ) { } /** - * @param array $args + * Gets the category titles. + * + * @since 3.0 Changed function name from `get_category_titles` to `get_term_titles`. (#240) + * @since 3.0 Changed `get_categories()` to `get_terms()` to fetch all (custom) terms. (#240) * + * @see WP_Term_Query::__constructor() + * @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/ + * + * @param array $args An array for arguments to query by. See WP_Term_Query::__constructor() for more info. * @return array */ - function get_category_titles( $args = array() ) { - return $this->get_term_labels( get_categories( $args ) ); + function get_term_titles( $args = array() ) { + return $this->get_term_labels( get_terms( $args ) ); } /** @@ -1204,8 +1214,8 @@ function load_file( $filename, $use_include_path = false, $context = null, $offs * @return bool */ function save_file( $filename, $contents ) { - $failed_str = sprintf( __( "Failed to write file %s!\n", 'all-in-one-seo-pack' ), $filename ); - $readonly_str = sprintf( __( "File %s isn't writable!\n", 'all-in-one-seo-pack' ), $filename ); + $failed_str = sprintf( __( 'Failed to write file %s!', 'all-in-one-seo-pack' ) . "\n", $filename ); + $readonly_str = sprintf( __( 'File %s isn\'t writable!', 'all-in-one-seo-pack' ) . "\n", $filename ); $wpfs = $this->get_filesystem_object(); if ( is_object( $wpfs ) ) { $file_exists = $wpfs->exists( $filename ); @@ -1235,12 +1245,12 @@ function delete_file( $filename ) { if ( is_object( $wpfs ) ) { if ( $wpfs->exists( $filename ) ) { if ( $wpfs->delete( $filename ) === false ) { - $this->output_error( sprintf( __( "Failed to delete file %s!\n", 'all-in-one-seo-pack' ), $filename ) ); + $this->output_error( sprintf( __( 'Failed to delete file %s!', 'all-in-one-seo-pack' ) . "\n", $filename ) ); } else { return true; } } else { - $this->output_error( sprintf( __( "File %s doesn't exist!\n", 'all-in-one-seo-pack' ), $filename ) ); + $this->output_error( sprintf( __( "File %s doesn't exist!", 'all-in-one-seo-pack' ) . "\n", $filename ) ); } } @@ -1262,15 +1272,15 @@ function rename_file( $filename, $newname ) { $newfile_exists = $wpfs->exists( $newname ); if ( $file_exists && ! $newfile_exists ) { if ( $wpfs->move( $filename, $newname ) === false ) { - $this->output_error( sprintf( __( "Failed to rename file %s!\n", 'all-in-one-seo-pack' ), $filename ) ); + $this->output_error( sprintf( __( 'Failed to rename file %s!', 'all-in-one-seo-pack' ) . "\n", $filename ) ); } else { return true; } } else { if ( ! $file_exists ) { - $this->output_error( sprintf( __( "File %s doesn't exist!\n", 'all-in-one-seo-pack' ), $filename ) ); + $this->output_error( sprintf( __( "File %s doesn't exist!", 'all-in-one-seo-pack' ) . "\n", $filename ) ); } elseif ( $newfile_exists ) { - $this->output_error( sprintf( __( "File %s already exists!\n", 'all-in-one-seo-pack' ), $newname ) ); + $this->output_error( sprintf( __( 'File %s already exists!', 'all-in-one-seo-pack' ) . "\n", $newname ) ); } } } @@ -1658,58 +1668,6 @@ function get_the_image_by_scan( $p = null ) { return false; } - - /** - * @param $default_options - * @param $options - * @param string $help_link - */ - function help_text_helper( &$default_options, $options, $help_link = '' ) { - foreach ( $options as $o ) { - $ht = ''; - if ( ! empty( $this->help_text[ $o ] ) ) { - $ht = $this->help_text[ $o ]; - } elseif ( ! empty( $default_options[ $o ]['help_text'] ) ) { - $ht = $default_options[ $o ]['help_text']; - } - if ( $ht && ! is_array( $ht ) ) { - $ha = ''; - $hl = $help_link; - if ( strpos( $o, 'ga_' ) === 0 ) { // special case -- pdb - $hl = 'https://semperplugins.com/documentation/advanced-google-analytics-settings/'; - } - if ( ! empty( $this->help_anchors[ $o ] ) ) { - $ha = $this->help_anchors[ $o ]; - } - if ( ! empty( $ha ) && ( $pos = strrpos( $hl, '#' ) ) ) { - $hl = substr( $hl, 0, $pos ); - } - if ( ! empty( $ha ) && ( $ha[0] == 'h' ) ) { - $hl = ''; - } - if ( ! empty( $ha ) || ! isset( $this->help_anchors[ $o ] ) ) { - $ht .= "
" . __( 'Click here for documentation on this setting', 'all-in-one-seo-pack' ) . ''; - } - $default_options[ $o ]['help_text'] = $ht; - } - } - } - - function add_help_text_links() { - if ( ! empty( $this->help_text ) ) { - foreach ( $this->layout as $k => $v ) { - $this->help_text_helper( $this->default_options, $v['options'], $v['help_link'] ); - } - if ( ! empty( $this->locations ) ) { - foreach ( $this->locations as $k => $v ) { - if ( ! empty( $v['default_options'] ) && ! empty( $v['options'] ) ) { - $this->help_text_helper( $this->locations[ $k ]['default_options'], $v['options'], $v['help_link'] ); - } - } - } - } - } - /** * Load scripts and styles for metaboxes. * edit-tags exists only for pre 4.5 support... remove when we drop 4.5 support. @@ -1771,9 +1729,12 @@ function enqueue_metabox_scripts() { * 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 + * @since 3.0 Added jQuery UI CSS missing from WP. #1850 * * @see 'admin_enqueue_scripts' hook * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/ + * @uses wp_scripts() Gets the Instance of WP Scripts. + * @link https://developer.wordpress.org/reference/functions/wp_scripts/ * * @param string $hook_suffix */ @@ -1786,6 +1747,18 @@ function admin_enqueue_styles( $hook_suffix ) { if ( function_exists( 'is_rtl' ) && is_rtl() ) { wp_enqueue_style( 'aioseop-module-style-rtl', AIOSEOP_PLUGIN_URL . 'css/modules/aioseop_module-rtl.css', array( 'aioseop-module-style' ), AIOSEOP_VERSION ); } + + // Uses WP Scripts to load the current platform version of jQuery UI CSS. + if ( ! wp_style_is( 'aioseop-jquery-ui', 'registered' ) && ! wp_style_is( 'aioseop-jquery-ui', 'enqueued' ) ) { + $wp_scripts = wp_scripts(); + wp_enqueue_style( + 'aioseop-jquery-ui', + '//ajax.googleapis.com/ajax/libs/jqueryui/' . $wp_scripts->registered['jquery-ui-core']->ver . '/themes/smoothness/jquery-ui.min.css', + false, + AIOSEOP_VERSION, + false + ); + } } /** @@ -1799,6 +1772,7 @@ function admin_enqueue_styles( $hook_suffix ) { * @since ? * @since 2.3.12.3 Add missing wp_enqueue_media. * @since 2.9 Switch to admin_enqueue_scripts; both the hook and function name. + * @since 3.0 Add enqueue footer JS for jQuery UI Compatability. #1850 * * @see 'admin_enqueue_scripts' hook * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/ @@ -1809,6 +1783,7 @@ function admin_enqueue_styles( $hook_suffix ) { public function admin_enqueue_scripts( $hook_suffix ) { wp_enqueue_script( 'sack' ); wp_enqueue_script( 'jquery' ); + wp_enqueue_script( 'jquery-ui-tabs' ); wp_enqueue_script( 'media-upload' ); wp_enqueue_script( 'thickbox' ); wp_enqueue_script( 'common' ); @@ -1830,6 +1805,14 @@ public function admin_enqueue_scripts( $hook_suffix ) { wp_enqueue_media(); } + $helper_dep = array( + 'jquery', + 'jquery-ui-core', + 'jquery-ui-widget', + 'jquery-ui-position', + 'jquery-ui-tooltip', + ); + // AIOSEOP Script enqueue. wp_enqueue_script( 'aioseop-module-script', @@ -1837,6 +1820,13 @@ public function admin_enqueue_scripts( $hook_suffix ) { array(), AIOSEOP_VERSION ); + wp_enqueue_script( + 'aioseop-helper-js', + AIOSEOP_PLUGIN_URL . 'js/aioseop-helper.js', + $helper_dep, + AIOSEOP_VERSION, + true + ); // Localize aiosp_data in JS. if ( ! empty( $this->script_data ) ) { @@ -2351,7 +2341,7 @@ function get_option_html( $args ) { $buf .= '' . "\n"; break; case 'html': @@ -2399,15 +2389,12 @@ function get_option_html( $args ) { return $buf; } - const DISPLAY_HELP_START = ''; - const DISPLAY_HELP_END = ''; - const DISPLAY_LABEL_FORMAT = '%s'; - const DISPLAY_TOP_LABEL = "\n
\n"; - const DISPLAY_ROW_TEMPLATE = '
%s
%s
%s

'; - /** * Format a row for an option on a settings page. * + * @since ? + * @since 3.0 Added Helper Class for jQuery Tooltips. #1850 + * * @param $name * @param $opts * @param $args @@ -2415,7 +2402,10 @@ function get_option_html( $args ) { * @return string */ function get_option_row( $name, $opts, $args ) { - $label_text = $input_attr = $help_text_2 = $id_attr = ''; + $label_text = $input_attr = $id_attr = ''; + + require_once( AIOSEOP_PLUGIN_DIR . 'admin/class-aioseop-helper.php' ); + $info = new AIOSEOP_Helper( get_class( $this ) ); $align = 'right'; if ( $opts['label'] == 'top' ) { @@ -2425,22 +2415,28 @@ function get_option_row( $name, $opts, $args ) { $id_attr .= " id=\"{$opts['id']}_div\" "; } if ( $opts['label'] != 'none' ) { - if ( isset( $opts['help_text'] ) ) { - $help_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_START, __( 'Click for Help!', 'all-in-one-seo-pack' ), $name, $opts['name'] ); - $help_text_2 = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_END, $name, $opts['help_text'] ); + $tmp_help_text = $info->get_help_text( $name ); + if ( isset( $tmp_help_text ) && ! empty( $tmp_help_text ) ) { + $display_help = ''; + $help_text = sprintf( $display_help, $info->get_help_text( $name ), $opts['name'] ); } else { $help_text = $opts['name']; } - $label_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_LABEL_FORMAT, $align, $help_text ); + + // TODO Possible remove text align. + // Currently aligns to the right when everything is being aligned to the left; which is usually a workaround. + $display_label_format = '%s'; + $label_text = sprintf( $display_label_format, $align, $help_text ); } else { $input_attr .= ' aioseop_no_label '; } if ( $opts['label'] == 'top' ) { - $label_text .= All_in_One_SEO_Pack_Module::DISPLAY_TOP_LABEL; + $label_text .= "
"; } $input_attr .= " aioseop_{$opts['type']}_type"; - return sprintf( All_in_One_SEO_Pack_Module::DISPLAY_ROW_TEMPLATE, $input_attr, $name, $label_text, $id_attr, $this->get_option_html( $args ), $help_text_2 ); + $display_row_template = '
%s
%s

'; + return sprintf( $display_row_template, $input_attr, $name, $label_text, $id_attr, $this->get_option_html( $args ) ); } /** @@ -2741,12 +2737,12 @@ function display_settings_page( $location = null ) { 'page_options' => array( 'type' => 'hidden', 'value' => 'aiosp_home_description' ), 'Submit' => array( 'type' => 'submit', - 'class' => 'button-primary', + 'class' => 'aioseop_update_options_button button-primary', 'value' => __( 'Update Options', 'all-in-one-seo-pack' ) . ' »', ), 'Submit_Default' => array( 'type' => 'submit', - 'class' => 'button-secondary', + 'class' => 'aioseop_reset_settings_button button-secondary', 'value' => sprintf( __( 'Reset %s Settings to Defaults', 'all-in-one-seo-pack' ), $name ) . ' »', ), ); diff --git a/admin/class-aioseop-helper.php b/admin/class-aioseop-helper.php new file mode 100644 index 000000000..090e5f750 --- /dev/null +++ b/admin/class-aioseop-helper.php @@ -0,0 +1,1062 @@ +_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 3.0 + * @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; + } + + /** + * 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 ); + } + + /** + * 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_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' ), + /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. */ + 'aiosp_do_log' => sprintf( __( 'Check this and %s 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' ), AIOSEOP_PLUGIN_NAME ), + + // 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_home_page_title_format' => + __( 'This controls the format of the title tag for your Homepage.', 'all-in-one-seo-pack' ) . '
' . + __( 'The following macros are supported:', 'all-in-one-seo-pack' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%page_title%
' . + /* translators: %s is replaced with a content type such as Post, Page, etc. */ + '
' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_login%
' . + /* translators: Example sentence: "The first name of the author of the Post" */ + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'username', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_nicename%
' . + '
' . sprintf( + __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), + /* translators: The "nicename" is the sanitized version of a username. */ + __( 'nicename', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) + ) . '
' . + '
%page_author_firstname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'first name', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_lastname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'last name', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_date%
' . + /* translators: %s is replaced with a time related term such as Date, Year, Month, etc. */ + '
' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_year%
' . + /* translators: %s is replaced with a time related term such as Date, Year, Month, etc. */ + '
' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '
' . + '
%cf_fieldname%
' . + '
' . __( 'The name of a custom field', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%page_title%
' . + '
' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_login%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'username', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_nicename%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'nicename', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_firstname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'first name', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_lastname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'last name', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_date%
' . + /* translators: %s is replaced with a time related term such as Date, Year, Month, etc. */ + '
' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_year%
' . + '
' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_date%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_year%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_month%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'month', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%cf_fieldname%
' . + '
' . __( 'The name of a custom field', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%post_title%
' . + '
' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%category_title%
' . + /* translators: %s is replaced with a content type such as Post, Page, etc. */ + '
' . sprintf( __( 'The (main) Category of the %s', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_login%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'username', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_nicename%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'nicename', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_firstname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'first name', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%page_author_lastname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'last name', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_date%
' . + '
' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_year%
' . + '
' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_date%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_year%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_month%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'month', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%cf_fieldname%
' . + '
' . __( 'The name of a custom field', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%category_title%
' . + '
' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Category', 'all-in-one-seo-pack' ) ) . '
' . + '
%category_description%
' . + /* translators: %s is replaced with a content type such as Post, Page, etc. */ + '
' . sprintf( __( 'The description of the %s', 'all-in-one-seo-pack' ), __( 'Category', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_year%
' . + '
' . __( 'The current year', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%archive_title%
' . + '
' . sprintf( + __( 'The original title of the %s', 'all-in-one-seo-pack' ), + /* translators: "Archive" is used in the context of a WordPress archive page. */ + __( 'Archive', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%date%
' . + '
' . __( 'The original archive title (localized), e.g. "2019" or "2019 August"', 'all-in-one-seo-pack' ) . '
' . + '
%day%
' . + '
' . __( 'The original archive day, e.g. "17"', 'all-in-one-seo-pack' ) . '
' . + '
%month%
' . + '
' . __( 'The original archive month (localized), e.g. "August"', 'all-in-one-seo-pack' ) . '
' . + '
%year%
' . + '
' . __( 'The original archive year, e.g. "2019"', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%author%
' . + '
' . __( 'The original archive title, 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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%tag%
' . + '
' . sprintf( __( 'The name of the %s', 'all-in-one-seo-pack' ), __( '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%search%
' . + '
' . __( 'The search term that was entered', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%description%
' . + '
' . __( 'This outputs the description you write for each page/post or the autogenerated description, if enabled. Auto-generated descriptions are generated from the excerpt or the first 160 characters of the content if there is no excerpt.', 'all-in-one-seo-pack' ) . '
' . + '
%post_title%
' . + '
' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '
' . + '
%wp_title%
' . + '
' . __( 'The original WordPress title', 'all-in-one-seo-pack' ) . '
' . + '
%current_date%
' . + '
' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_year%
' . + '
' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_date%
' . + '
' . sprintf( + __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ), + /* translators: "Post/Page" are the two main content types in WordPress. */ + __( 'Post/Page', 'all-in-one-seo-pack' ) + ) . '
' . + '
%post_year%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ), __( 'Post/Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_month%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'month', 'all-in-one-seo-pack' ), __( 'Post/Page', 'all-in-one-seo-pack' ) ) . '
' . + '
%cf_fieldname%
' . + '
' . __( 'The name of a custom field', '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' ) . + '
' . + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site 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' ) . '
' . + '
%404_title%
' . + '
' . __( 'Additional 404 title input', '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' ) . + '
' . + '
%page%
' . + '
' . __( 'The page number', 'all-in-one-seo-pack' ) . '
' . + '
', + //phpcs:enable + + // Custom Post Type Settings. + /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. */ + 'aiosp_cpostactive' => sprintf( __( 'Use these checkboxes to select which Content Types you want to use %s with.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), + + // 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' ), + '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_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_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' ), + /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. */ + 'aiosp_ex_pages' => sprintf( __( 'Enter a comma separated list of pages here to be excluded by %s. 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 any URL with the word "forum" in it here, such as "http://mysite.com/forum" or "http://mysite.com/forum/someforumpage", and it will be excluded.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), + '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_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' ] ) ) { + $name = ucwords( preg_replace( '/-|\_/', ' ', get_post_type_object( $v1_pt )->labels->singular_name ) ); + + $help_text_macros = + '
%site_title%
' . + '
' . __( 'Your site title', 'all-in-one-seo-pack' ) . '
' . + '
%site_description%
' . + '
' . __( 'Your site description', 'all-in-one-seo-pack' ) . '
' . + '
%post_title%
' . + '
' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), $name ) . '
'; + + $pt_obj_taxes = get_object_taxonomies( $v1_pt, 'objects' ); + foreach ( $pt_obj_taxes as $k2_slug => $v2_tax_obj ) { + if ( $v2_tax_obj->public ) { + $help_text_macros .= sprintf( '
%%tax_%1$s%%
' . __( 'The title of the %2$s taxonomy that is associated to this %3$s', 'all-in-one-seo-pack' ) . '
', $k2_slug, ucwords( $v2_tax_obj->label ), $name ); + } + } + + $help_text_macros .= + '
%page_author_login%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'username', 'all-in-one-seo-pack' ), $name ) . '
' . + '
%page_author_nicename%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'nicename', 'all-in-one-seo-pack' ), $name ) . '
' . + '
%page_author_firstname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'first name', 'all-in-one-seo-pack' ), $name ) . '
' . + '
%page_author_lastname%
' . + '
' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'last name', 'all-in-one-seo-pack' ), $name ) . '
' . + '
%current_date%
' . + '
' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '
' . + '
%current_year%
' . + '
' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '
' . + '
%post_date%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ), $name ) . '
' . + '
%post_year%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ), $name ) . '
' . + '
%post_month%
' . + '
' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'month', 'all-in-one-seo-pack' ), $name ) . '
' . + + $rtn_help_text[ 'aiosp_' . $v1_pt . '_title_format' ] = __( 'The following macros are supported:', 'all-in-one-seo-pack' ) . '
' . $help_text_macros . '
' . '
' . __( 'Click here for documentation on this setting', 'all-in-one-seo-pack' ) . ''; + } + } + // phpcs:enable + + $help_doc_link = array( + // General Settings. + 'aiosp_can' => 'https://semperplugins.com/documentation/general-settings/#canonical-urls', + 'aiosp_no_paged_canonical_links' => 'https://semperplugins.com/documentation/general-settings/#no-pagination-for-canonical-urls', + 'aiosp_use_original_title' => 'https://semperplugins.com/documentation/general-settings/#use-original-title', + 'aiosp_schema_markup' => 'https://semperplugins.com/documentation/general-settings/#use-schema-markup', + 'aiosp_do_log' => 'https://semperplugins.com/documentation/general-settings/#log-important-events', + + // Home Page Settings. + 'aiosp_home_title' => 'https://semperplugins.com/documentation/home-page-settings/#home-title', + 'aiosp_home_description' => 'https://semperplugins.com/documentation/home-page-settings/#home-description', + 'aiosp_home_keywords' => 'https://semperplugins.com/documentation/home-page-settings/#home-keywords', + 'aiosp_use_static_home_info' => 'https://semperplugins.com/documentation/home-page-settings/#use-static-front-page-instead', + + // Title Settings. + 'aiosp_home_page_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_page_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_post_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_category_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_archive_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_date_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_author_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_tag_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_search_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_description_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_404_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + 'aiosp_paged_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields', + + // Custom Post Type Settings. + 'aiosp_cpostactive' => 'https://semperplugins.com/documentation/custom-post-type-settings/#seo-on-only-these-post-types', + + // Display Settings. + 'aiosp_posttypecolumns' => 'https://semperplugins.com/documentation/display-settings/#show-column-labels-for-custom-post-types', + + // Webmaster Verification. + '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_sitelinks_search' => 'https://semperplugins.com/documentation/google-settings/#display-sitelinks-search-box', + 'aiosp_google_analytics_id' => 'https://semperplugins.com/documentation/setting-up-google-analytics/', + 'aiosp_ga_advanced_options' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/', + 'aiosp_ga_domain' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#tracking-domain', + 'aiosp_ga_multi_domain' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#track-multiple-domains-additional-domains', + 'aiosp_ga_addl_domains' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#track-multiple-domains-additional-domains', + 'aiosp_ga_anonymize_ip' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#anonymize-ip-addresses', + 'aiosp_ga_display_advertising' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#display-advertiser-tracking', + 'aiosp_ga_exclude_users' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#exclude-users-from-tracking', + 'aiosp_ga_track_outbound_links' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#track-outbound-links', + 'aiosp_ga_link_attribution' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#enhanced-link-attribution', + 'aiosp_ga_enhanced_ecommerce' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#enhanced-ecommerce', + + // Noindex Settings. + 'aiosp_cpostnoindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex', + 'aiosp_cpostnofollow' => 'https://semperplugins.com/documentation/noindex-settings/#nofollow', + 'aiosp_category_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings', + 'aiosp_archive_date_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings', + 'aiosp_archive_author_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings', + 'aiosp_tags_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings', + 'aiosp_search_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-the-search-page', + 'aiosp_404_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-the-404-page', + 'aiosp_paginated_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-paginated-pages-posts', + 'aiosp_paginated_nofollow' => 'https://semperplugins.com/documentation/noindex-settings/#use-nofollow-for-paginated-pages-posts', + 'aiosp_tax_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-the-taxonomy-archives', + + // Advanced Settings. + 'aiosp_generate_descriptions' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#autogenerate-descriptions', + 'aiosp_skip_excerpt' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#remove-descriptions-for-paginated-pages', + 'aiosp_run_shortcodes' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#never-shorten-long-descriptions', + 'aiosp_hide_paginated_descriptions' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#unprotect-post-meta-fields', + 'aiosp_dont_truncate_descriptions' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#never-shorten-long-descriptions', + 'aiosp_unprotect_meta' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#unprotect-post-meta-fields', + 'aiosp_redirect_attachement_parent' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#redirect-attachments-to-post-parent', + 'aiosp_ex_pages' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#exclude-pages', + 'aiosp_post_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-post-headers', + 'aiosp_page_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-page-headers', + 'aiosp_front_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-front-page-headers', + 'aiosp_home_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-blog-page-headers', + + // Keyword Settings. + 'aiosp_togglekeywords' => 'https://semperplugins.com/documentation/keyword-settings/#use-keywords', + 'aiosp_use_categories' => 'https://semperplugins.com/documentation/keyword-settings/#use-categories-for-meta-keywords', + 'aiosp_use_tags_as_keywords' => 'https://semperplugins.com/documentation/keyword-settings/#use-tags-for-meta-keywords', + 'aiosp_dynamic_postspage_keywords' => 'https://semperplugins.com/documentation/keyword-settings/#dynamically-generate-keywords-for-posts-page', + + // Unknown/Pro? + // 'aiosp_google_connect' => '', + ); + + foreach ( $help_doc_link as $k1_slug => $v1_url ) { + // Any help text that ends with a ul or ol element will cause text to start at the next line. + $tooltips_with_ul = array( + 'aiosp_home_page_title_format', + 'aiosp_page_title_format', + 'aiosp_post_title_format', + 'aiosp_category_title_format', + 'aiosp_archive_title_format', + 'aiosp_date_title_format', + 'aiosp_author_title_format', + 'aiosp_tag_title_format', + 'aiosp_search_title_format', + 'aiosp_description_format', + 'aiosp_404_title_format', + 'aiosp_paged_format', + ); + + $br = '

'; + 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( + // XML Sitemap. + 'aiosp_sitemap_rss_sitemap' => __( 'Generate an RSS sitemap in addition to the regular XML Sitemap.', '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_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 only accepts 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_terms' => __( 'Exclude any category, tag or custom taxonomy from the XML sitemap. Start typing the name of a category, tag or taxonomy term in the field and a dropdown will populate with the matching terms for you to select from.

This will also exclude any content belonging to the specified term. For example, if you exclude the "Uncategorized" category then all posts in that category will also be excluded from the sitemap.', 'all-in-one-seo-pack' ), + 'aiosp_sitemap_excl_pages' => __( 'Use page slugs or page IDs, separated by commas, to exclude pages from the sitemap.', 'all-in-one-seo-pack' ), + + // Priorities. + 'aiosp_sitemap_prio_homepage' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'priority', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_prio_post' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'priority', 'all-in-one-seo-pack' ), __( 'Posts', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_prio_taxonomies' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'priority', 'all-in-one-seo-pack' ), __( 'Taxonomies', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_prio_archive' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'priority', 'all-in-one-seo-pack' ), __( 'Archive Pages', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_prio_author' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'priority', 'all-in-one-seo-pack' ), __( 'Author Pages', 'all-in-one-seo-pack' ) ), + + // Frequencies. + 'aiosp_sitemap_freq_homepage' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'frequency', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_freq_post' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'frequency', 'all-in-one-seo-pack' ), __( 'Posts', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_freq_taxonomies' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'frequency', 'all-in-one-seo-pack' ), __( 'Taxonomies', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_freq_archive' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'frequency', 'all-in-one-seo-pack' ), __( 'Archive Pages', 'all-in-one-seo-pack' ) ), + 'aiosp_sitemap_freq_author' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'frequency', 'all-in-one-seo-pack' ), __( 'Author Pages', 'all-in-one-seo-pack' ) ), + + ); + + $args = array( + 'public' => true, + ); + + $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 ] = sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'priority', 'all-in-one-seo-pack' ), ucwords( $pt_obj->label ) ); + $rtn_help_text[ 'aiosp_sitemap_freq_post_' . $pt ] = sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'frequency', 'all-in-one-seo-pack' ), ucwords( $pt_obj->label ) ); + $help_doc_link[ 'aiosp_sitemap_prio_post_' . $pt ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies'; + $help_doc_link[ 'aiosp_sitemap_freq_post_' . $pt ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies'; + } + + $taxonomies = get_taxonomies( $args, 'object' ); + foreach ( $taxonomies as $tax ) { + $rtn_help_text[ 'aiosp_sitemap_prio_taxonomies_' . $tax->name ] = sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'priority', 'all-in-one-seo-pack' ), ucwords( $tax->label ) ); + $rtn_help_text[ 'aiosp_sitemap_freq_taxonomies_' . $tax->name ] = sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), __( 'frequency', 'all-in-one-seo-pack' ), ucwords( $tax->label ) ); + $help_doc_link[ 'aiosp_sitemap_prio_taxonomies_' . $tax->name ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies'; + $help_doc_link[ 'aiosp_sitemap_freq_taxonomies_' . $tax->name ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies'; + } + + $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_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_terms' => '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. + /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. */ + 'aiosp_opengraph_setmeta' => sprintf( __( 'Checking this box will use the Home Title and Home Description set in %s, General Settings as the Open Graph title and description for your home page.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), + '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 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_1 = array( + 'public' => true, + ); + $args_2 = array( + 'public' => false, + ); + + $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' ) . ''; + } + + $help_doc_link = array( + // Home Page Settings. + 'aiosp_opengraph_setmeta' => 'https://semperplugins.com/documentation/social-meta-module/#use-aioseo-title-and-description', + 'aiosp_opengraph_sitename' => 'https://semperplugins.com/documentation/social-meta-module/#site-name', + 'aiosp_opengraph_hometitle' => 'https://semperplugins.com/documentation/social-meta-module/#home-title-and-description', + 'aiosp_opengraph_description' => 'https://semperplugins.com/documentation/social-meta-module/#home-title-and-description', + 'aiosp_opengraph_homeimage' => 'https://semperplugins.com/documentation/social-meta-module/#home-image', + + // Image Settings. + 'aiosp_opengraph_defimg' => 'https://semperplugins.com/documentation/social-meta-module/#select-og-image-source', + 'aiosp_opengraph_fallback' => 'https://semperplugins.com/documentation/social-meta-module/#use-default-if-no-image-found', + 'aiosp_opengraph_dimg' => 'https://semperplugins.com/documentation/social-meta-module/#default-og-image', + 'aiosp_opengraph_dimgwidth' => 'https://semperplugins.com/documentation/social-meta-module/#default-image-width', + 'aiosp_opengraph_dimgheight' => 'https://semperplugins.com/documentation/social-meta-module/#default-image-height', + 'aiosp_opengraph_meta_key' => 'https://semperplugins.com/documentation/social-meta-module/#use-custom-field-for-image', + + // Social Profile Links. + 'aiosp_opengraph_profile_links' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links', + 'aiosp_opengraph_person_or_org' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links', + 'aiosp_opengraph_social_name' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links', + + // Facebook Settings. + 'aiosp_opengraph_key' => 'https://semperplugins.com/documentation/social-meta-module/#facebook-admin-id', + 'aiosp_opengraph_appid' => 'https://semperplugins.com/documentation/social-meta-module/#facebook-app-id', + 'aiosp_opengraph_gen_tags' => 'https://semperplugins.com/documentation/social-meta-module/#automatically-generate-article-tags', + 'aiosp_opengraph_gen_keywords' => 'https://semperplugins.com/documentation/social-meta-module/#use-keywords-in-article-tags', + 'aiosp_opengraph_gen_categories' => 'https://semperplugins.com/documentation/social-meta-module/#use-categories-in-article-tags', + 'aiosp_opengraph_gen_post_tags' => 'https://semperplugins.com/documentation/social-meta-module/#use-post-tags-in-article-tags', + 'aiosp_opengraph_types' => 'https://semperplugins.com/documentation/social-meta-module/#enable-facebook-meta-for', + 'aiosp_opengraph_facebook_publisher' => 'https://semperplugins.com/documentation/social-meta-module/#show-facebook-publisher-on-articles', + 'aiosp_opengraph_facebook_author' => 'https://semperplugins.com/documentation/social-meta-module/#show-facebook-author-on-articles', + + // Twitter Settings. + 'aiosp_opengraph_defcard' => 'https://semperplugins.com/documentation/social-meta-module/#default-twitter-card', + 'aiosp_opengraph_twitter_site' => 'https://semperplugins.com/documentation/social-meta-module/#twitter-site', + 'aiosp_opengraph_twitter_creator' => 'https://semperplugins.com/documentation/social-meta-module/#show-twitter-author', + 'aiosp_opengraph_twitter_domain' => 'https://semperplugins.com/documentation/social-meta-module/#twitter-domain', + + // Advanced Settings. + 'aiosp_opengraph_title_shortcodes' => 'https://semperplugins.com/documentation/social-meta-module/#run-shortcodes-in-title', + 'aiosp_opengraph_description_shortcodes' => 'https://semperplugins.com/documentation/social-meta-module/#run-shortcodes-in-description', + 'aiosp_opengraph_generate_descriptions' => 'https://semperplugins.com/documentation/social-meta-module/#auto-generate-og-descriptions', + + // POST META. + 'aioseop_opengraph_settings_title' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#title', + 'aioseop_opengraph_settings_desc' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#description', + 'aioseop_opengraph_settings_image' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#image', + 'aioseop_opengraph_settings_customimg' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-image', + 'aioseop_opengraph_settings_imagewidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height', + 'aioseop_opengraph_settings_imageheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height', + 'aioseop_opengraph_settings_video' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-video', + 'aioseop_opengraph_settings_videowidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height', + 'aioseop_opengraph_settings_videoheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height', + 'aioseop_opengraph_settings_category' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-object-type', + 'aioseop_opengraph_settings_facebook_debug' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-debug', + 'aioseop_opengraph_settings_section' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-section', + 'aioseop_opengraph_settings_tag' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-tags', + 'aioseop_opengraph_settings_setcard' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#twitter-card-type', + 'aioseop_opengraph_settings_customimg_twitter' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-twitter-image', + ); + + 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 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. + /* translators: %1$s and 12$s are placeholders, which means these should not be translated. These will be replaced with the name of the plugin, All in One SEO Pack. */ + 'aiosp_importer_exporter_import_submit' => sprintf( __( 'Choose a valid %1$s .ini file and click "Import" to import options from a previous state or install of %1$s.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), + 'aiosp_importer_exporter_export_choices' => __( 'You may choose to export settings from active modules, and content from post data.', 'all-in-one-seo-pack' ), + /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. */ + 'aiosp_importer_exporter_export_post_types' => sprintf( __( 'Select which Post Types you want to export your %s meta data for.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), + ); + + $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/admin/class-aioseop-notices.php b/admin/class-aioseop-notices.php new file mode 100644 index 000000000..f587f367f --- /dev/null +++ b/admin/class-aioseop-notices.php @@ -0,0 +1,835 @@ +aioseop_screens, + * array('CUSTOM') = specific screen(s). + * } + * } + */ + public $notices = array(); + + /** + * List of notice slugs that are currently active. + * NOTE: Amount is reduced by 1 second in order to display at exactly X amount of time. + * + * @todo Change name to $display_times for consistancy both conceptually and with usermeta structure. + * + * @since 3.0 + * @access public + * + * @var array $active_notices { + * @type string|int $slug => $display_time Contains the current active notices + * that are scheduled to be displayed. + * } + */ + public $active_notices = array(); + + /** + * Dismissed Notices + * + * Stores notices that have been dismissed sitewide. Users are stored in usermeta data 'aioseop_notice_dismissed_{$slug}'. + * + * @since 3.0 + * + * @var array $dismissed { + * @type boolean $notice_slug => $is_dismissed True if dismissed. + * } + */ + public $dismissed = array(); + + /** + * The default dismiss time. An anti-nag setting. + * + * @var int $default_dismiss_delay + */ + private $default_dismiss_delay = 180; + + /** + * List of Screens used in AIOSEOP. + * + * @since 3.0 + * + * @var array $aioseop_screens { + * @type string Screen ID. + * } + */ + private $aioseop_screens = array(); + + /** + * __constructor. + * + * @since 3.0 + */ + public function __construct() { + $this->_requires(); + if ( current_user_can( 'aiosp_manage_seo' ) ) { + + $this->aioseop_screens[] = 'toplevel_page_' . AIOSEOP_PLUGIN_DIRNAME . '/aioseop_class'; + $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_performance'; + $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_sitemap'; + $this->aioseop_screens[] = 'all-in-one-seo_page_aiosp_opengraph'; + $this->aioseop_screens[] = 'all-in-one-seo_page_aiosp_robots_generator'; + $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_robots'; + $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_file_editor'; + $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_importer_exporter'; + $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_bad_robots'; + $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_feature_manager'; + + $this->obj_load_options(); + + add_action( 'admin_init', array( $this, 'init' ) ); + add_action( 'current_screen', array( $this, 'admin_screen' ) ); + } + } + + /** + * _Requires + * + * Internal use only. Additional files required. + * + * @since 3.0 + */ + private function _requires() { + $this->autoload_notice_files(); + } + + /** + * Autoload Notice Files + * + * @since 3.0 + * + * @see DirectoryIterator class + * @link https://php.net/manual/en/class.directoryiterator.php + * @see StackOverflow for getting all filenamess in a directory. + * @link https://stackoverflow.com/a/25988433/1376780 + */ + private function autoload_notice_files() { + foreach ( new DirectoryIterator( AIOSEOP_PLUGIN_DIR . 'admin/display/notices/' ) as $file ) { + if ( $file->isFile() && 'php' === $file->getExtension() ) { + $filename = $file->getFilename(); + + // Qualified file pattern; "*-notice.php". + // Prevents any malicious files that may have spreaded. + if ( array_search( 'notice', explode( '-', str_replace( '.php', '', $filename ) ), true ) ) { + include_once AIOSEOP_PLUGIN_DIR . 'admin/display/notices/' . $filename; + } + } + } + } + + /** + * Early operations required by the plugin. + * + * AJAX requires being added early before screens have been loaded. + * + * @since 3.0 + */ + public function init() { + add_action( 'wp_ajax_aioseop_notice', array( $this, 'ajax_notice_action' ) ); + } + + /** + * Setup/Init Admin Screen + * + * Adds the initial actions to WP based on the Admin Screen being loaded. + * The AIOSEOP and Other Screens have separate methods that are used, and + * additional screens can be made exclusive/unique. + * + * @since 3.0 + * + * @param WP_Screen $current_screen The current screen object being loaded. + */ + public function admin_screen( $current_screen ) { + $this->deregister_scripts(); + if ( isset( $current_screen->id ) && in_array( $current_screen->id, $this->aioseop_screens, true ) ) { + // AIOSEO Notice Content. + add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); + add_action( 'all_admin_notices', array( $this, 'display_notice_aioseop' ) ); + } elseif ( isset( $current_screen->id ) ) { + // Default WP Notice. + add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); + add_action( 'all_admin_notices', array( $this, 'display_notice_default' ) ); + } + } + + /** + * Load AIOSEOP_Notice Options + * + * Gets the options for AIOSEOP_Notice to set its variables to. + * + * @since 3.0 + * @access private + * + * @see self::notices + * @see self::active_notices + */ + private function obj_load_options() { + $notices_options = $this->obj_get_options(); + + $this->notices = $notices_options['notices']; + $this->active_notices = $notices_options['active_notices']; + } + + /** + * Get AIOSEOP_Notice Options + * + * @since 3.0 + * @access private + * + * @return array + */ + private function obj_get_options() { + $defaults = array( + 'notices' => array(), + 'active_notices' => array(), + ); + + $notices_options = get_option( 'aioseop_notices' ); + if ( false === $notices_options ) { + return $defaults; + } + + return wp_parse_args( $notices_options, $defaults ); + } + + /** + * Update Notice Options + * + * @since 3.0 + * @access private + * + * @return boolean True if successful, using update_option() return value. + */ + private function obj_update_options() { + $notices_options = array( + 'notices' => $this->notices, + 'active_notices' => $this->active_notices, + ); + $old_notices_options = $this->obj_get_options(); + $notices_options = wp_parse_args( $notices_options, $old_notices_options ); + + return update_option( 'aioseop_notices', $notices_options, false ); + } + + /** + * Notice Default Values + * + * Returns the default value for a variable to be used in self::notices[]. + * + * @since 3.0 + * + * @see AIOSEOP_Notices::notices Array variable that stores the collection of notices. + * + * @return array Notice variable in self::notices. + */ + public function notice_defaults() { + return array_merge( + $this->notice_defaults_server(), + $this->notice_defaults_file() + ); + } + + /** + * Notice Defaults Server + * + * @since 3.0 + * + * @return array + */ + public function notice_defaults_server() { + return array( + 'slug' => '', + 'time_start' => time(), + 'time_set' => time(), + ); + } + + /** + * Notice Defaults File + * + * @since 3.0 + * + * @return array + */ + public function notice_defaults_file() { + return array( + 'slug' => '', + 'delay_time' => 0, + 'message' => '', + 'action_options' => array(), + 'class' => 'notice-info', + 'target' => 'site', + 'screens' => array(), + ); + } + + /** + * Action Options Default Values + * + * Returns the default value for action_options in self::notices[$slug]['action_options']. + * + * @since 3.0 + * + * @return array Action_Options variable in self::notices[$slug]['action_options']. + */ + public function action_options_defaults() { + return array( + 'time' => 0, + 'text' => __( 'Dismiss', 'all-in-one-seo-pack' ), + 'link' => '#', + 'dismiss' => true, + 'class' => '', + ); + } + + /** + * Add Notice + * + * Takes notice and adds it to object and saves to database. + * + * @since 3.0 + * + * @param array $notice See self::notices for more info. + * @return boolean True on success. + */ + public function add_notice( $notice = array() ) { + if ( empty( $notice['slug'] ) || isset( $this->notices[ $notice['slug'] ] ) ) { + return false; + } + + $this->notices[ $notice['slug'] ] = $this->prepare_notice( $notice ); + + return true; + } + + /** + * Prepare Insert/Undate Notice + * + * @since 3.0 + * + * @param array $notice The notice to prepare with the database. + * @return array + */ + public function prepare_notice( $notice = array() ) { + $notice_default = $this->notice_defaults_server(); + $notice = wp_parse_args( $notice, $notice_default ); + + $new_notice = array(); + foreach ( $notice_default as $key => $value ) { + $new_notice[ $key ] = $notice[ $key ]; + } + + return $new_notice; + } + + /** + * Used strictly for any notices that are deprecated/obsolete. To stop notices, + * use notice_deactivate(). + * + * @since 3.0 + * + * @param string $slug Unique notice slug. + * @return boolean True if successfully removed. + */ + public function remove_notice( $slug ) { + if ( isset( $this->notices[ $slug ] ) ) { + $this->deactivate_notice( $slug ); + unset( $this->notices[ $slug ] ); + $this->obj_update_options(); + return true; + } + + return false; + } + + /** + * Activate Notice + * + * Activates a notice, or Re-activates with a new display time. Used after + * updating a notice that requires a hard reset. + * + * @since 3.0 + * + * @param string $slug Notice slug. + * @return boolean + */ + public function activate_notice( $slug ) { + if ( empty( $slug ) ) { + return false; + } + $notice = $this->get_notice( $slug ); + if ( 'site' === $notice['target'] && isset( $this->active_notices[ $slug ] ) ) { + return true; + } elseif ( 'user' === $notice['target'] && get_user_meta( get_current_user_id(), 'aioseop_notice_display_time_' . $slug, true ) ) { + return true; + } + + if ( ! isset( $this->notices[ $slug ] ) ) { + $this->add_notice( $notice ); + } + + $this->set_notice_delay( $slug, $notice['delay_time'] ); + + $this->obj_update_options(); + + return true; + } + + /** + * Deactivate Notice + * + * Deactivates a notice set as active and completely removes it from the + * list of active notices. Used to prevent conflicting notices that may be + * active at any given point in time. + * + * @since 3.0 + * + * @param string $slug Notice slug. + * @return boolean + */ + public function deactivate_notice( $slug ) { + if ( ! isset( $this->active_notices[ $slug ] ) ) { + return false; + } elseif ( ! isset( $this->notices[ $slug ] ) ) { + return false; + } + + delete_metadata( + 'user', + 0, + 'aioseop_notice_display_time_' . $slug, + '', + true + ); + unset( $this->active_notices[ $slug ] ); + $this->obj_update_options(); + + return true; + } + + /** + * Reset Notice + * + * @since 3.0 + * + * @param string $slug The notice's slug. + * @return bool + */ + public function reset_notice( $slug ) { + if ( empty( $slug ) || ! isset( $this->notices[ $slug ] ) ) { + return false; + } + + $notice = $this->get_notice( $slug ); + + unset( $this->active_notices[ $slug ] ); + unset( $this->dismissed[ $slug ] ); + delete_metadata( + 'user', + 0, + 'aioseop_notice_time_set_' . $slug, + '', + true + ); + delete_metadata( + 'user', + 0, + 'aioseop_notice_display_time_' . $slug, + '', + true + ); + delete_metadata( + 'user', + 0, + 'aioseop_notice_dismissed_' . $slug, + '', + true + ); + + $this->set_notice_delay( $slug, $notice['delay_time'] ); + + $this->obj_update_options(); + + return true; + } + + /** + * Set Notice Delay + * + * @since 3.0 + * + * @param string $slug The notice's slug. + * @param int $delay_time Amount of time to delay. + * @return boolean + */ + public function set_notice_delay( $slug, $delay_time ) { + if ( empty( $slug ) ) { + return false; + } + $time_set = time(); + + // Display at exactly X time, not (X + 1) time. + $display_time = $time_set + $delay_time - 1; + $notice = $this->get_notice( $slug ); + if ( 'user' === $notice['target'] ) { + $current_user_id = get_current_user_id(); + + update_user_meta( $current_user_id, 'aioseop_notice_time_set_' . $slug, $time_set ); + update_user_meta( $current_user_id, 'aioseop_notice_display_time_' . $slug, $display_time ); + } + + $this->notices[ $slug ]['time_set'] = $time_set; + $this->active_notices[ $slug ] = $display_time; + + return true; + } + + /** + * Set Notice Dismiss + * + * @since 3.0 + * + * @param string $slug The notice's slug. + * @param boolean $dismiss Sets to dismiss a notice. + */ + public function set_notice_dismiss( $slug, $dismiss ) { + $notice = $this->get_notice( $slug ); + if ( 'site' === $notice['target'] ) { + $this->dismissed[ $slug ] = $dismiss; + } elseif ( 'user' === $notice['target'] ) { + $current_user_id = get_current_user_id(); + + update_user_meta( $current_user_id, 'aioseop_notice_dismissed_' . $slug, $dismiss ); + } + } + + /** + * Get Notice + * + * @since 3.0 + * + * @param string $slug The notice's slug. + * @return array + */ + public function get_notice( $slug ) { + // Set defaults for notice. + $rtn_notice = $this->notice_defaults(); + + if ( isset( $this->notices[ $slug ] ) ) { + // Get minimized (database) data. + $rtn_notice = array_merge( $rtn_notice, $this->notices[ $slug ] ); + } + + /** + * Admin Notice {$slug} + * + * Applies the notice data values for a given notice slug. + * `aioseop_admin_notice-{$slug}` with the slug being the individual notice. + * + * @since 3.0 + * + * @params array $notice_data See `\AIOSEOP_Notices::$notices` for structural documentation. + */ + $notice_data = apply_filters( 'aioseop_admin_notice-' . $slug, array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores + + if ( ! empty( $notice_data ) ) { + $rtn_notice = array_merge( $rtn_notice, $notice_data ); + + foreach ( $rtn_notice['action_options'] as &$action_option ) { + // Set defaults for `$notice['action_options']`. + $action_option = array_merge( $this->action_options_defaults(), $action_option ); + } + } + + return $rtn_notice; + } + + /*** DISPLAY Methods **************************************************/ + /** + * Deregister Scripts + * + * Initial Admin Screen action to remove aioseop script(s) from all screens; + * which will be registered if executed on screen. + * NOTE: As of 3.0, most of it is default layout, styling, & scripting + * that is loaded on all pages. Which can later be different. + * + * @since 3.0 + * @access private + * + * @see self::admin_screen() + */ + private function deregister_scripts() { + wp_deregister_script( 'aioseop-admin-notice-js' ); + wp_deregister_style( 'aioseop-admin-notice-css' ); + } + + /** + * (Register) Enqueue Scripts + * + * Used to register, enqueue, and localize any JS data. Styles can later be added. + * + * @since 3.0 + */ + public function admin_enqueue_scripts() { + // Register. + wp_register_script( + 'aioseop-admin-notice-js', + AIOSEOP_PLUGIN_URL . 'js/admin-notice.js', + array( 'jquery' ), + AIOSEOP_VERSION, + true + ); + + // Localization. + $notice_actions = array(); + foreach ( $this->active_notices as $notice_slug => $notice_display_time ) { + $notice = $this->get_notice( $notice_slug ); + foreach ( $notice['action_options'] as $action_index => $action_arr ) { + $notice_actions[ $notice_slug ][] = $action_index; + } + } + + $admin_notice_localize = array( + 'notice_nonce' => wp_create_nonce( 'aioseop_ajax_notice' ), + 'notice_actions' => $notice_actions, + ); + wp_localize_script( 'aioseop-admin-notice-js', 'aioseop_notice_data', $admin_notice_localize ); + + // Enqueue. + wp_enqueue_script( 'aioseop-admin-notice-js' ); + + wp_enqueue_style( + 'aioseop-admin-notice-css', + AIOSEOP_PLUGIN_URL . 'css/admin-notice.css', + false, + AIOSEOP_VERSION, + false + ); + } + + /** + * Display Notice as Default + * + * Method for default WP Admin notices. + * NOTE: As of 3.0, display_notice_default() & display_notice_aioseop() + * have the same functionality, but serves as a future development concept. + * + * @since 3.0 + * + * @uses AIOSEOP_PLUGIN_DIR . 'admin/display/notice-default.php' Template for default notices. + * + * @return void + */ + public function display_notice_default() { + $this->display_notice( 'default' ); + } + + /** + * Display Notice as AIOSEOP Screens + * + * Method for Admin notices exclusive to AIOSEOP screens. + * NOTE: As of 3.0, display_notice_default() & display_notice_aioseop() + * have the same functionality, but serves as a future development concept. + * + * @since 3.0 + * + * @uses AIOSEOP_PLUGIN_DIR . 'admin/display/notice-aioseop.php' Template for notices. + * + * @return void + */ + public function display_notice_aioseop() { + $this->display_notice( 'aioseop' ); + } + + /** + * Display Notice + * + * @since 2.8 + * + * @param string $template Slug name for template. + */ + public function display_notice( $template ) { + if ( ! wp_script_is( 'aioseop-admin-notice-js', 'enqueued' ) || ! wp_style_is( 'aioseop-admin-notice-css', 'enqueued' ) ) { + return; + } elseif ( 'default' !== $template && 'aioseop' !== $template ) { + return; + } elseif ( ! current_user_can( 'aiosp_manage_seo' ) ) { + return; + } + + $current_screen = get_current_screen(); + $current_user_id = get_current_user_id(); + foreach ( $this->active_notices as $a_notice_slug => $a_notice_time_display ) { + $notice_show = true; + $notice = $this->get_notice( $a_notice_slug ); + + // Screen Restriction. + if ( ! empty( $notice['screens'] ) ) { + // Checks if on aioseop screen. + if ( in_array( 'aioseop', $notice['screens'], true ) ) { + if ( ! in_array( $current_screen->id, $this->aioseop_screens, true ) ) { + continue; + } + } + + // Checks the other screen restrictions by slug/id. + if ( ! in_array( 'aioseop', $notice['screens'], true ) ) { + if ( ! in_array( $current_screen->id, $notice['screens'], true ) ) { + continue; + } + } + } + + if ( isset( $this->dismissed[ $a_notice_slug ] ) && $this->dismissed[ $a_notice_slug ] ) { + $notice_show = false; + } + + // User Settings. + if ( 'user' === $notice['target'] ) { + $user_dismissed = get_user_meta( $current_user_id, 'aioseop_notice_dismissed_' . $a_notice_slug, true ); + if ( ! $user_dismissed ) { + $user_notice_time_display = get_user_meta( $current_user_id, 'aioseop_notice_display_time_' . $a_notice_slug, true ); + if ( ! empty( $user_notice_time_display ) ) { + $a_notice_time_display = intval( $user_notice_time_display ); + } + } else { + $notice_show = false; + } + } + + // Display/Render. + $important_admin_notices = array( + 'notice-error', + 'notice-warning', + 'notice-do-nag', + ); + if ( defined( 'DISABLE_NAG_NOTICES' ) && true === DISABLE_NAG_NOTICES && ( ! in_array( $notice['class'], $important_admin_notices, true ) ) ) { + // Skip if `DISABLE_NAG_NOTICES` is implemented (as true). + // Important notices, WP's CSS `notice-error` & `notice-warning`, are still rendered. + continue; + } elseif ( time() > $a_notice_time_display && $notice_show ) { + include AIOSEOP_PLUGIN_DIR . 'admin/display/notice-' . $template . '.php'; + } + } + } + + /** + * AJAX Notice Action + * + * Fires when a Action_Option is clicked and sent via AJAX. Also includes + * WP Default Dismiss (rendered as a clickable button on upper-right). + * + * @since 3.0 + * + * @see AIOSEOP_PLUGIN_DIR . 'js/admin-notice.js' + */ + public function ajax_notice_action() { + check_ajax_referer( 'aioseop_ajax_notice' ); + if ( ! current_user_can( 'aiosp_manage_seo' ) ) { + wp_send_json_error( __( "User doesn't have `aiosp_manage_seo` capabilities.", 'all-in-one-seo-pack' ) ); + } + // Notice (Slug) => (Action_Options) Index. + $notice_slug = null; + $action_index = null; + if ( isset( $_POST['notice_slug'] ) ) { + $notice_slug = filter_input( INPUT_POST, 'notice_slug', FILTER_SANITIZE_STRING ); + + // When PHPUnit is unable to use filter_input. + if ( defined( 'AIOSEOP_UNIT_TESTING' ) && null === $notice_slug && ! empty( $_POST['notice_slug'] ) ) { + $notice_slug = $_POST['notice_slug']; + } + } + if ( isset( $_POST['action_index'] ) ) { + $action_index = filter_input( INPUT_POST, 'action_index', FILTER_SANITIZE_STRING ); + + // When PHPUnit is unable to use filter_input. + if ( defined( 'AIOSEOP_UNIT_TESTING' ) && null === $action_index && ( ! empty( $_POST['action_index'] ) || 0 === $_POST['action_index'] ) ) { + $action_index = $_POST['action_index']; + } + } + if ( empty( $notice_slug ) ) { + /* Translators: Displays the hordcoded slug that missing. */ + wp_send_json_error( sprintf( __( 'Missing values from `%s`.', 'all-in-one-seo-pack' ), 'notice_slug' ) ); + } elseif ( empty( $action_index ) && 0 !== $action_index ) { + /* Translators: Displays the hordcoded slug that missing. */ + wp_send_json_error( sprintf( __( 'Missing values from `%s`.', 'all-in-one-seo-pack' ), 'action_index' ) ); + } + + $action_options = $this->action_options_defaults(); + $action_options['time'] = $this->default_dismiss_delay; + $action_options['dismiss'] = false; + + $notice = $this->get_notice( $notice_slug ); + + if ( isset( $notice['action_options'][ $action_index ] ) ) { + $action_options = array_merge( $action_options, $notice['action_options'][ $action_index ] ); + } + + if ( $action_options['time'] ) { + $this->set_notice_delay( $notice_slug, $action_options['time'] ); + } + if ( $action_options['dismiss'] ) { + $this->set_notice_dismiss( $notice_slug, $action_options['dismiss'] ); + } + + $this->obj_update_options(); + wp_send_json_success( __( 'Notice updated successfully.', 'all-in-one-seo-pack' ) ); + } + + } + // CLASS INITIALIZATION. + // Should this be a singleton class instead of a global? + global $aioseop_notices; + $aioseop_notices = new AIOSEOP_Notices(); +} diff --git a/admin/display/credits-content.php b/admin/display/credits-content.php index f54fcbb62..87c181d6a 100644 --- a/admin/display/credits-content.php +++ b/admin/display/credits-content.php @@ -1,6 +1,8 @@
-

+

@@ -29,16 +31,16 @@ -
  • - - Ashish Ravi - -
  • -
  • - - Ben Reames - -
  • +
  • + + Ashish Ravi + +
  • +
  • + + Ben Reames + +
  • @@ -55,24 +57,24 @@
  • - Rebecca Hum + Rebecca Hum +
  • +
  • + + Mayo Moriyama +
  • +
  • + + Dougal Campbell
  • -
  • - - Mayo Moriyama -
  • -
  • - - Dougal Campbell -
  • Alejandro Mostajo
  • -
  • - - Aaron Brodney -
  • +
  • + + Aaron Brodney +
  • Stanislav Samoilenko @@ -81,34 +83,34 @@ Shohei Tanaka
  • -
  • - - Ross McKay -
  • -
  • - - Adam Silverstein -
  • -
  • - - Vinicius Schettino -
  • -
  • - - Srdjan Jocic -
  • -
  • - - Gennady Kovshenin -
  • +
  • + + Ross McKay +
  • +
  • + + Adam Silverstein +
  • +
  • + + Vinicius Schettino +
  • +
  • + + Srdjan Jocic +
  • +
  • + + Gennady Kovshenin +
  • diff --git a/admin/display/dashboard_widget.php b/admin/display/dashboard_widget.php index 859b677b1..ca991666b 100644 --- a/admin/display/dashboard_widget.php +++ b/admin/display/dashboard_widget.php @@ -71,7 +71,7 @@ function display_rss_dashboard_widget() { $rss = fetch_feed( 'https://www.semperplugins.com/feed/' ); if ( is_wp_error( $rss ) ) { - echo '{Temporarily unable to load feed.}'; + echo __( '{Temporarily unable to load feed.}', 'all-in-one-seo-pack' ); return; } diff --git a/admin/display/general-metaboxes.php b/admin/display/general-metaboxes.php index 16dad82da..e610bb4c3 100644 --- a/admin/display/general-metaboxes.php +++ b/admin/display/general-metaboxes.php @@ -43,7 +43,8 @@ static function display_extra_metaboxes( $add, $meta ) {

    @@ -51,11 +52,11 @@ static function display_extra_metaboxes( $add, $meta ) {
    + case 'aioseop-donate': + ?>
    - +

    @@ -80,7 +81,6 @@ static function display_extra_metaboxes( $add, $meta ) { ?>

    percent_translated < 100 ) { if ( ! empty( $aiosp_trans->native_name ) ) { $maybe_native_name = $aiosp_trans->native_name; @@ -88,14 +88,15 @@ static function display_extra_metaboxes( $add, $meta ) { $maybe_native_name = $aiosp_trans->name; } - /* translators: %1$s expands to the number of languages All in One SEO Pack has been translated into. $2%s to the percentage translated of the current language, $3%s to the language name, %4$s and %5$s to anchor tags with link to translation page at translate.wordpress.org */ + /* translators: %1$s, %2$s, etc. are placeholders and shouldn't be translated. %1$s expands to the number of languages All in One SEO Pack has been translated into, %2$s to the name of the plugin, $3%s to the percentage translated of the current language, $4%s to the language name, %5$s and %6$s to anchor tags with link to the translation page at translate.wordpress.org */ printf( __( - 'All in One SEO Pack has been translated into %1$s languages, but currently the %3$s translation is only %2$s percent complete. %4$s Click here %5$s to help get it to 100 percent.', 'all-in-one-seo-pack' + '%1$s has been translated into %2$s languages, but currently the %3$s translation is only %4$s percent complete. %5$sClick here%6$s to help get it to 100 percent.', 'all-in-one-seo-pack' ), + AIOSEOP_PLUGIN_NAME, $aiosp_trans->translated_count, - $aiosp_trans->percent_translated, $maybe_native_name, + $aiosp_trans->percent_translated, "translation_url\" target=\"_BLANK\">", '' ); @@ -111,8 +112,12 @@ static function display_extra_metaboxes( $add, $meta ) { ?>
    + action="https://semperplugins.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&id=b786958a9a" + + action="https://semperplugins.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&id=af0a96d3d9" + + method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">

    @@ -121,7 +126,7 @@ static function display_extra_metaboxes( $add, $meta ) {

    + class="button-primary" aria-label="">

    ?>

    -

    +

    + href="https://semperplugins.com/documentation/"> + +

    -

    +

    -

    +

    ?> ">

    -

    +

    -

    +

    @@ -183,7 +193,7 @@ static function pro_meta_content() { echo ''; - echo 'Click here to file a feature request/bug report.'; + echo sprintf( __( '%1$sClick here%2$s to file a feature request/bug report.', 'all-in-one-seo-pack' ), '', '' ); } diff --git a/admin/display/menu.php b/admin/display/menu.php index 9857d8695..180e051c5 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() { @@ -38,12 +40,29 @@ 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, ); } + + /* + * 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/admin/display/notice-aioseop.php b/admin/display/notice-aioseop.php new file mode 100644 index 000000000..3411fd097 --- /dev/null +++ b/admin/display/notice-aioseop.php @@ -0,0 +1,34 @@ +get_notice[ $a_notice_slug ]; +$notice_class = 'notice-info'; +if ( isset( $notice['class'] ) && ! empty( $notice['class'] ) ) { + $notice_class = $notice['class']; +} + +?> +
    +

    +

    + $action_option ) : ?> + + + +

    +
    diff --git a/admin/display/notice-default.php b/admin/display/notice-default.php new file mode 100644 index 000000000..6814dabe1 --- /dev/null +++ b/admin/display/notice-default.php @@ -0,0 +1,34 @@ +notices[ $a_notice_slug ]; +$notice_class = 'notice-info'; +if ( isset( $notice['class'] ) && ! empty( $notice['class'] ) ) { + $notice_class = $notice['class']; +} + +?> +
    +

    +

    + $action_option ) : ?> + + + +

    +
    diff --git a/admin/display/notices/blog-visibility-notice.php b/admin/display/notices/blog-visibility-notice.php new file mode 100644 index 000000000..1c62958fe --- /dev/null +++ b/admin/display/notices/blog-visibility-notice.php @@ -0,0 +1,49 @@ +' . __( 'Reading Settings', 'all-in-one-seo-pack' ) . ''; + + return array( + 'slug' => 'blog_public_disabled', + 'delay_time' => 0, + /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. "Settings > Reading" refers to the "Reading" submenu in WordPress Core. */ + 'message' => sprintf( __( 'Warning: %s has detected that you are blocking access to search engines. You can change this in Settings > Reading if this was unintended.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), + 'class' => 'notice-error', + 'target' => 'site', + 'screens' => array(), + 'action_options' => array( + array( + 'time' => 0, + 'text' => __( 'Update Reading Settings', 'all-in-one-seo-pack' ), + 'link' => admin_url( 'options-reading.php' ), + 'dismiss' => false, + 'class' => 'button-primary', + ), + array( + 'time' => 604800, + 'text' => __( 'Remind me later', 'all-in-one-seo-pack' ), + 'link' => '', + 'dismiss' => false, + 'class' => 'button-secondary', + ), + ), + ); +} +add_filter( 'aioseop_admin_notice-blog_public_disabled', 'aioseop_notice_blog_visibility' ); diff --git a/admin/display/notices/index.php b/admin/display/notices/index.php new file mode 100644 index 000000000..3c379e183 --- /dev/null +++ b/admin/display/notices/index.php @@ -0,0 +1,4 @@ + 'review_plugin', + 'delay_time' => 1036800, + 'target' => 'user', + 'screens' => array(), + 'class' => 'notice-info', + /* translators: %1$s is a placeholder, which means that it should not be translated. It will be replaced with the name of the plugin, All in One SEO Pack. */ + 'message' => sprintf( __( 'You have been using %1$s for a while now. That is awesome! If you like %1$s, then please leave us a 5-star rating. Huge thanks in advance!', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), + 'action_options' => array( + array( + 'time' => 0, + 'text' => __( 'Add a review', 'all-in-one-seo-pack' ), + 'link' => 'https://wordpress.org/support/plugin/all-in-one-seo-pack/reviews?rate=5#new-post', + 'dismiss' => false, + 'class' => '', + ), + array( + 'text' => __( 'Remind me later', 'all-in-one-seo-pack' ), + 'time' => 432000, + 'dismiss' => false, + 'class' => '', + ), + array( + 'time' => 0, + 'text' => __( 'No, thanks', 'all-in-one-seo-pack' ), + 'dismiss' => true, + 'class' => '', + ), + ), + ); +} +add_filter( 'aioseop_admin_notice-review_plugin', 'aioseop_notice_review_plugin' ); diff --git a/admin/display/notices/sitemap-indexes-notice.php b/admin/display/notices/sitemap-indexes-notice.php new file mode 100644 index 000000000..9ed834cf3 --- /dev/null +++ b/admin/display/notices/sitemap-indexes-notice.php @@ -0,0 +1,44 @@ + 'sitemap_max_warning', + 'delay_time' => 0, + 'message' => __( 'Notice: To avoid problems with your XML Sitemap, we strongly recommend you set the Maximum Posts per Sitemap Page to 1,000.', 'all-in-one-seo-pack' ), + 'class' => 'notice-warning', + 'target' => 'user', + 'screens' => array(), + 'action_options' => array( + array( + 'time' => 0, + 'text' => __( 'Update Sitemap Settings', 'all-in-one-seo-pack' ), + 'link' => esc_url( get_admin_url( null, 'admin.php?page=' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_sitemap.php' ) ), + 'dismiss' => false, + 'class' => 'button-primary', + ), + array( + 'time' => 86400, // 24 hours. + 'text' => __( 'Remind me later', 'all-in-one-seo-pack' ), + 'link' => '', + 'dismiss' => false, + 'class' => 'button-secondary', + ), + + ), + ); +} +add_filter( 'aioseop_admin_notice-sitemap_max_warning', 'aioseop_notice_sitemap_indexes' ); diff --git a/admin/display/notices/wc-detected-notice.php b/admin/display/notices/wc-detected-notice.php new file mode 100644 index 000000000..0dc3080ab --- /dev/null +++ b/admin/display/notices/wc-detected-notice.php @@ -0,0 +1,45 @@ + 'woocommerce_detected', + 'delay_time' => 0, + /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with the name of the premium version of the plugin, All in One SEO Pack Pro. */ + 'message' => sprintf( __( 'We have detected you are running WooCommerce. Upgrade to %s to unlock our advanced e-commerce features, including SEO for Product Categories and more.', 'all-in-one-seo-pack' ), 'All in One SEO Pack Pro' ), + + 'class' => 'notice-info', + 'target' => 'site', + 'screens' => array(), + 'action_options' => array( + array( + 'time' => 0, + 'text' => __( 'Upgrade', 'all-in-one-seo-pack' ), + 'link' => 'https://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=woo', + 'dismiss' => false, + 'class' => 'button-primary', + ), + array( + 'time' => 2592000, // 30 days. + 'text' => __( 'No Thanks', 'all-in-one-seo-pack' ), + 'link' => '', + 'dismiss' => false, + 'class' => 'button-secondary', + ), + ), + ); +} +add_filter( 'aioseop_admin_notice-woocommerce_detected', 'aioseop_notice_pro_promo_woocommerce' ); diff --git a/admin/display/welcome-content.php b/admin/display/welcome-content.php index 19764a5c7..37c8d9203 100644 --- a/admin/display/welcome-content.php +++ b/admin/display/welcome-content.php @@ -2,15 +2,32 @@
    '; + /* translators: %1$s, %2$s and %3$s are placeholders, which means these shouldn't be translated. The first two placeholders are used to add a link to anchor text and the third is replaced with the name of the plugin, All in One SEO Pack. */ + echo '

    ', sprintf( esc_html__( 'The plugin Yoast SEO has been detected. Do you want to %1$simport its settings%2$s into %3$s', 'all-in-one-seo-pack' ), sprintf( '', esc_url( $aiourl ) ), '', AIOSEOP_PLUGIN_NAME ), '

    '; } @@ -147,11 +148,21 @@ class="description">

    + class="description"> + +

    + class="description"> + +

    - - + + @@ -515,6 +527,11 @@ function aiosp_seometa_import() { 'META Description' => 'description', 'META Keywords' => 'keywords', ), + 'Rank Math' => array( + 'Custom Doctitle' => 'rank_math_title', + 'META Description' => 'rank_math_description', + 'Canonical URI' => 'rank_math_canonical_url', + ), 'SEOpressor' => array( 'Custom Doctitle' => '_seopressor_meta_title', 'META Description' => '_seopressor_meta_description', diff --git a/aioseop_class.php b/aioseop_class.php index 54fc98b12..372c17e5b 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_author_login% - This page's author' login", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%page_author_nicename% - This page's author' nicename", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%page_author_firstname% - This page's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%page_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' ) . '
    • ' . - __( '%cf_fieldname% - Custom field name', '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' ) . '
    • ' . - __( "%page_author_login% - This page's author' login", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%page_author_nicename% - This page's author' nicename", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%page_author_firstname% - This page's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%page_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' ) . '
    • ' . - __( '%cf_fieldname% - Custom field name', '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' ) . '
    • ' . - __( "%post_author_login% - This post's author' login", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%post_author_nicename% - This post's author' nicename", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%post_author_lastname% - This post'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 post was published (localized)', 'all-in-one-seo-pack' ) . '
    • ' . - __( '%post_year% - The year the post was published (localized)', 'all-in-one-seo-pack' ) . '
    • ' . - __( '%post_month% - The month the post was published (localized)', 'all-in-one-seo-pack' ) . '
    • ' . - __( '%cf_fieldname% - Custom field name', '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' ) . '
    • ' . - __( '%cf_fieldname% - Custom field name', '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' ) . '
    • ' . - __( '%404_title% - Additional 404 title input', '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' ) - . '
    • ' . __( '%page% - The page number', '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' ), @@ -415,20 +138,6 @@ function __construct() { 'default' => 0, 'condshow' => array( 'aiosp_can' => 'on' ), ), - 'customize_canonical_links' => array( - 'name' => __( 'Enable Custom Canonical URLs:', 'all-in-one-seo-pack' ), - 'default' => 0, - 'condshow' => array( 'aiosp_can' => 'on' ), - ), - 'rewrite_titles' => array( - 'name' => __( 'Rewrite Titles:', 'all-in-one-seo-pack' ), - 'default' => 1, - 'type' => 'radio', - 'initial_options' => array( - 1 => __( 'Enabled', 'all-in-one-seo-pack' ), - 0 => __( 'Disabled', 'all-in-one-seo-pack' ), - ), - ), 'force_rewrites' => array( 'name' => __( 'Force Rewrites:', 'all-in-one-seo-pack' ), 'default' => 1, @@ -452,73 +161,61 @@ function __construct() { 'name' => __( 'Home Page Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', 'default' => '%page_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), ), 'page_title_format' => array( 'name' => __( 'Page Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%page_title% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%page_title% | %site_title%', ), 'post_title_format' => array( 'name' => __( 'Post Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%post_title% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%post_title% | %site_title%', ), 'category_title_format' => array( 'name' => __( 'Category Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%category_title% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%category_title% | %site_title%', ), 'archive_title_format' => array( 'name' => __( 'Archive Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%archive_title% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%archive_title% | %site_title%', ), 'date_title_format' => array( 'name' => __( 'Date Archive Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%date% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%date% | %site_title%', ), 'author_title_format' => array( 'name' => __( 'Author Archive Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%author% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%author% | %site_title%', ), 'tag_title_format' => array( 'name' => __( 'Tag Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%tag% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%tag% | %site_title%', ), 'search_title_format' => array( 'name' => __( 'Search Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%search% | %blog_title%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => '%search% | %site_title%', ), 'description_format' => array( 'name' => __( 'Description Format', 'all-in-one-seo-pack' ), 'type' => 'text', 'default' => '%description%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), ), '404_title_format' => array( 'name' => __( '404 Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', 'default' => __( 'Nothing found for %request_words%', 'all-in-one-seo-pack' ), - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), ), 'paged_format' => array( 'name' => __( 'Paged Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => ' - Part %page%', - 'condshow' => array( 'aiosp_rewrite_titles' => 1 ), + 'default' => sprintf( ' - %s %%page%%', __( 'Part', 'all-in-one-seo-pack' ) ), ), 'cpostactive' => array( 'name' => __( 'SEO on only these Content Types:', 'all-in-one-seo-pack' ), @@ -560,59 +257,19 @@ function __construct() { 'default' => '', 'type' => 'text', ), - 'google_publisher' => array( - 'name' => __( 'Google Plus Default Profile:', 'all-in-one-seo-pack' ), + 'yandex_verify' => array( + 'name' => __( 'Yandex Webmaster Tools:', 'all-in-one-seo-pack' ), 'default' => '', 'type' => 'text', ), - 'google_disable_profile' => array( - 'name' => __( 'Disable Google Plus Profile:', 'all-in-one-seo-pack' ), - 'default' => 0, - 'type' => 'checkbox', + 'baidu_verify' => array( + 'name' => __( 'Baidu Webmaster Tools:', 'all-in-one-seo-pack' ), + 'default' => '', + 'type' => 'text', ), 'google_sitelinks_search' => array( 'name' => __( 'Display Sitelinks Search Box:', 'all-in-one-seo-pack' ), ), - 'google_set_site_name' => array( - 'name' => __( 'Set Preferred Site Name:', 'all-in-one-seo-pack' ), - ), - 'google_specify_site_name' => array( - 'name' => __( 'Specify A Preferred Name:', 'all-in-one-seo-pack' ), - 'type' => 'text', - 'placeholder' => $blog_name, - 'condshow' => array( 'aiosp_google_set_site_name' => 'on' ), - ), - 'google_author_advanced' => array( - 'name' => __( 'Advanced Authorship Options:', 'all-in-one-seo-pack' ), - 'default' => 0, - 'type' => 'radio', - 'initial_options' => array( - 'on' => __( 'Enabled', 'all-in-one-seo-pack' ), - 0 => __( 'Disabled', 'all-in-one-seo-pack' ), - ), - 'label' => null, - ), - 'google_author_location' => array( - 'name' => __( 'Display Google Authorship:', 'all-in-one-seo-pack' ), - 'default' => array( 'all' ), - 'type' => 'multicheckbox', - 'condshow' => array( 'aiosp_google_author_advanced' => 'on' ), - ), - 'google_enable_publisher' => array( - 'name' => __( 'Display Publisher Meta on Front Page:', 'all-in-one-seo-pack' ), - 'default' => 'on', - 'type' => 'radio', - 'initial_options' => array( - 'on' => __( 'Enabled', 'all-in-one-seo-pack' ), - 0 => __( 'Disabled', 'all-in-one-seo-pack' ), - ), - 'condshow' => array( 'aiosp_google_author_advanced' => 'on' ), - ), - 'google_specify_publisher' => array( - 'name' => __( 'Specify Publisher URL:', 'all-in-one-seo-pack' ), - 'type' => 'text', - 'condshow' => array( 'aiosp_google_author_advanced' => 'on', 'aiosp_google_enable_publisher' => 'on' ), - ), // "google_connect"=>array( 'name' => __( 'Connect With Google Analytics', 'all-in-one-seo-pack' ), ), 'google_analytics_id' => array( 'name' => __( 'Google Analytics ID:', 'all-in-one-seo-pack' ), @@ -855,7 +512,7 @@ function __construct() { 'sanitize' => 'default', ), 'home_meta_tags' => array( - 'name' => __( 'Additional Blog Page Headers:', 'all-in-one-seo-pack' ), + 'name' => __( 'Additional Posts Page Headers:', 'all-in-one-seo-pack' ), 'type' => 'textarea', 'default' => '', 'sanitize' => 'default', @@ -909,7 +566,7 @@ function __construct() { 'upgrade' => array( 'type' => 'html', 'label' => 'none', - 'default' => aiosp_common::get_upgrade_hyperlink( 'meta', __( 'Upgrade to All in One SEO Pack Pro Version', 'all-in-one-seo-pack' ), __( 'UPGRADE TO PRO VERSION', 'all-in-one-seo-pack' ), '_blank' ), + 'default' => aiosp_common::get_upgrade_hyperlink( 'meta', sprintf( '%1$s %2$s Pro', __( 'Upgrade to', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ), __( 'UPGRADE TO PRO VERSION', 'all-in-one-seo-pack' ), '_blank' ), ), 'support' => array( 'type' => 'html', @@ -966,12 +623,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' ), @@ -987,7 +638,6 @@ function __construct() { 'name' => __( 'Title Settings', 'all-in-one-seo-pack' ), 'help_link' => 'https://semperplugins.com/documentation/title-settings/', 'options' => array( - 'rewrite_titles', 'force_rewrites', 'home_page_title_format', 'page_title_format', @@ -1016,21 +666,13 @@ 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' ), 'help_link' => 'https://semperplugins.com/documentation/google-settings/', 'options' => array( - 'google_publisher', - 'google_disable_profile', 'google_sitelinks_search', - 'google_set_site_name', - 'google_specify_site_name', - 'google_author_advanced', - 'google_author_location', - 'google_enable_publisher', - 'google_specify_publisher', // "google_connect", 'google_analytics_id', 'ga_advanced_options', @@ -1095,7 +737,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,15 +752,12 @@ 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 ); add_action( 'all_admin_notices', array( $this, 'visibility_warning' ) ); + add_action( 'all_admin_notices', array( $this, 'woo_upgrade_notice' ) ); - if ( ! AIOSEOPPRO ) { - // add_action('all_admin_notices', array( $this, 'woo_upgrade_notice')); - } } if ( AIOSEOPPRO ) { add_action( 'split_shared_term', array( $this, 'split_shared_term' ), 10, 4 ); @@ -1186,9 +824,9 @@ function custom_output_option( $buf, $args ) { } /** - * Get Title Format + * Get Title Format for snippet preview. * - * Get the title formatted according to AIOSEOP %shortcodes%. + * Get the title formatted according to AIOSEOP %shortcodes% specifically for the snippet preview.. * * @since 2.4.9 * @@ -1206,28 +844,42 @@ public function get_title_format( $args ) { $w = $info['w']; $p = $info['p']; - if ( strpos( $title_format, '%blog_title%' ) !== false ) { + /** + * Runs before we start applying the formatting for the snippet preview title. + * + * @since 3.0 + * + */ + do_action( 'aioseop_before_get_title_format' ); + + if ( false !== strpos( $title_format, '%site_title%', 0 ) ) { + $title_format = str_replace( '%site_title%', get_bloginfo( 'name' ), $title_format ); + } + // %blog_title% is deprecated. + if ( false !== strpos( $title_format, '%blog_title%', 0 ) ) { $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format ); } $title_format = $this->apply_cf_fields( $title_format ); $replace_title = '' . esc_attr( wp_strip_all_tags( html_entity_decode( $title ) ) ) . ''; - if ( strpos( $title_format, '%post_title%' ) !== false ) { + if ( false !== strpos( $title_format, '%post_title%', 0 ) ) { $title_format = str_replace( '%post_title%', $replace_title, $title_format ); } - if ( strpos( $title_format, '%page_title%' ) !== false ) { + if ( false !== strpos( $title_format, '%page_title%', 0 ) ) { $title_format = str_replace( '%page_title%', $replace_title, $title_format ); } - if ( strpos( $title_format, '%current_date%' ) !== false ) { + if ( false !== strpos( $title_format, '%current_date%', 0 ) ) { $title_format = str_replace( '%current_date%', aioseop_formatted_date(), $title_format ); } - - if ( strpos( $title_format, "%post_date%" ) !== false ){ + if ( false !== strpos( $title_format, '%current_year%', 0 ) ) { + $title_format = str_replace( '%current_year%', date( 'Y' ), $title_format ); + } + if ( false !== strpos( $title_format, '%post_date%', 0 ) ) { $title_format = str_replace( '%post_date%', aioseop_formatted_date( get_the_time( 'U' ) ), $title_format ); } - if ( strpos( $title_format, '%post_year%' ) !== false ) { + if ( false !== strpos( $title_format, '%post_year%', 0 ) ) { $title_format = str_replace( '%post_year%', get_the_date( 'Y' ), $title_format ); } - if ( strpos( $title_format, '%post_month%' ) !== false ) { + if ( false !== strpos( $title_format, '%post_month%', 0 ) ) { $title_format = str_replace( '%post_month%', get_the_date( 'F' ), $title_format ); } if ( $w->is_category || $w->is_tag || $w->is_tax ) { @@ -1243,28 +895,28 @@ public function get_title_format( $args ) { } } } - if ( strpos( $title_format, '%category_title%' ) !== false ) { + if ( false !== strpos( $title_format, '%category_title%', 0 ) ) { $title_format = str_replace( '%category_title%', $replace_title, $title_format ); } - if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) { + if ( false !== strpos( $title_format, '%taxonomy_title%', 0 ) ) { $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format ); } } else { - if ( strpos( $title_format, '%category%' ) !== false ) { + if ( false !== strpos( $title_format, '%category%', 0 ) ) { $title_format = str_replace( '%category%', $category, $title_format ); } - if ( strpos( $title_format, '%category_title%' ) !== false ) { + if ( false !== strpos( $title_format, '%category_title%', 0 ) ) { $title_format = str_replace( '%category_title%', $category, $title_format ); } - if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) { + if ( false !== strpos( $title_format, '%taxonomy_title%', 0 ) ) { $title_format = str_replace( '%taxonomy_title%', $category, $title_format ); } if ( AIOSEOPPRO ) { - if ( strpos( $title_format, '%tax_' ) && ! empty( $p ) ) { + if ( strpos( $title_format, '%tax_', 0 ) && ! empty( $p ) ) { $taxes = get_object_taxonomies( $p, 'objects' ); if ( ! empty( $taxes ) ) { foreach ( $taxes as $t ) { - if ( strpos( $title_format, "%tax_{$t->name}%" ) ) { + if ( strpos( $title_format, "%tax_{$t->name}%", 0 ) ) { $terms = $this->get_all_terms( $p->ID, $t->name ); $term = ''; if ( count( $terms ) > 0 ) { @@ -1277,12 +929,30 @@ public function get_title_format( $args ) { } } } - if ( strpos( $title_format, '%taxonomy_description%' ) !== false ) { + if ( false !== strpos( $title_format, '%taxonomy_description%', 0 ) ) { $title_format = str_replace( '%taxonomy_description%', $description, $title_format ); } + /** + * Filters document title after applying the formatting. + * + * @since 3.0 + * + * @param string $title_format Document title to be filtered. + * + */ + $title_format = apply_filters( 'aioseop_title_format', $title_format ); + $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format ); + /** + * Runs after applying the formatting for the snippet preview title. + * + * @since 3.0 + * + */ + do_action( 'aioseop_after_format_title' ); + return $title_format; } @@ -1398,7 +1068,7 @@ function get_page_snippet_info() { $show_page = false; } if ( $aioseop_options['aiosp_can'] ) { - if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) ) { + if ( ! empty( $opts['aiosp_custom_link'] ) ) { $url = $opts['aiosp_custom_link']; } if ( empty( $url ) ) { @@ -1485,7 +1155,7 @@ function get_current_options( $opts = array(), $location = null, $defaults = nul 'noindex', 'nofollow', ); - if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) { + if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) { unset( $optlist['custom_link'] ); } foreach ( $optlist as $f ) { @@ -1566,10 +1236,8 @@ function wp_title() { global $aioseop_options; $title = false; $post = $this->get_queried_object(); - if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) ) { - $title = $this->get_aioseop_title( $post ); - $title = $this->apply_cf_fields( $title ); - } + $title = $this->get_aioseop_title( $post ); + $title = $this->apply_cf_fields( $title ); if ( false === $title ) { $title = $this->get_original_title(); @@ -1749,11 +1417,17 @@ function get_aioseop_title( $post, $use_original_title_format = true ) { } elseif ( is_search() && isset( $s ) && ! empty( $s ) ) { $search = esc_attr( stripslashes( $s ) ); $title_format = $aioseop_options['aiosp_search_title_format']; - $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); - if ( strpos( $title, '%blog_description%' ) !== false ) { + $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); + if ( false !== strpos( $title, '%blog_title%', 0 ) ) { + $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); + } + if ( false !== strpos( $title, '%site_description%', 0 ) ) { + $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); + } + if ( false !== strpos( $title, '%blog_description%', 0 ) ) { $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); } - if ( strpos( $title, '%search%' ) !== false ) { + if ( false !== strpos( $title, '%search%', 0 ) ) { $title = str_replace( '%search%', $search, $title ); } $title = $this->paged_title( $title ); @@ -1791,17 +1465,23 @@ function get_aioseop_title( $post, $use_original_title_format = true ) { } if ( $tag ) { $title_format = $aioseop_options['aiosp_tag_title_format']; - $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); - if ( strpos( $title, '%blog_description%' ) !== false ) { + $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); + if ( false !== strpos( $title, '%blog_title%', 0 ) ) { + $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); + } + if ( false !== strpos( $title, '%site_description%', 0 ) ) { + $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); + } + if ( false !== strpos( $title, '%blog_description%', 0 ) ) { $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); } - if ( strpos( $title, '%tag%' ) !== false ) { + if ( false !== strpos( $title, '%tag%', 0 ) ) { $title = str_replace( '%tag%', $tag, $title ); } - if ( strpos( $title, '%tag_description%' ) !== false ) { + if ( false !== strpos( $title, '%tag_description%', 0 ) ) { $title = str_replace( '%tag_description%', $tag_description, $title ); } - if ( strpos( $title, '%taxonomy_description%' ) !== false ) { + if ( false !== strpos( $title, '%taxonomy_description%', 0 ) ) { $title = str_replace( '%taxonomy_description%', $tag_description, $title ); } $title = trim( wp_strip_all_tags( $title ) ); @@ -1816,11 +1496,17 @@ function get_aioseop_title( $post, $use_original_title_format = true ) { $tag = $STagging->search_tag; if ( $tag ) { $title_format = $aioseop_options['aiosp_tag_title_format']; - $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); - if ( strpos( $title, '%blog_description%' ) !== false ) { + $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); + if ( false !== strpos( $title, '%blog_title%', 0 ) ) { + $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); + } + if ( false !== strpos( $title, '%site_description%', 0 ) ) { + $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); + } + if ( false !== strpos( $title, '%blog_description%', 0 ) ) { $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); } - if ( strpos( $title, '%tag%' ) !== false ) { + if ( false !== strpos( $title, '%tag%', 0 ) ) { $title = str_replace( '%tag%', $tag, $title ); } $title = $this->paged_title( $title ); @@ -1850,10 +1536,10 @@ function get_aioseop_title( $post, $use_original_title_format = true ) { } $month = date( 'F', mktime( 0, 0, 0, (int) $monthnum, 1, (int) $year ) ); $new_title = str_replace( '%monthnum%', $monthnum, $new_title ); - if ( strpos( $new_title, '%month%' ) !== false ) { + if ( false !== strpos( $new_title, '%month%', 0 ) ) { $new_title = str_replace( '%month%', $month, $new_title ); } - if ( strpos( $new_title, '%year%' ) !== false ) { + if ( false !== strpos( $new_title, '%year%', 0 ) ) { $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title ); } } elseif ( is_post_type_archive() ) { @@ -1864,8 +1550,14 @@ function get_aioseop_title( $post, $use_original_title_format = true ) { } else { return false; } - $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); - if ( strpos( $new_title, '%blog_description%' ) !== false ) { + $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); + if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) { + $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%site_description%', 0 ) ) { + $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) { $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); } $title = trim( $new_title ); @@ -1874,17 +1566,23 @@ function get_aioseop_title( $post, $use_original_title_format = true ) { return $title; } elseif ( is_404() ) { $title_format = $aioseop_options['aiosp_404_title_format']; - $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); - if ( strpos( $new_title, '%blog_description%' ) !== false ) { + $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); + if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) { + $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%site_description%', 0 ) ) { + $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) { $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); } - if ( strpos( $new_title, '%request_url%' ) !== false ) { + if ( false !== strpos( $new_title, '%request_url%', 0 ) ) { $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title ); } - if ( strpos( $new_title, '%request_words%' ) !== false ) { + if ( false !== strpos( $new_title, '%request_words%', 0 ) ) { $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title ); } - if ( strpos( $new_title, '%404_title%' ) !== false ) { + if ( false !== strpos( $new_title, '%404_title%', 0 ) ) { $new_title = str_replace( '%404_title%', $this->internationalize( $this->get_original_title( '', false ) ), $new_title ); } @@ -1971,14 +1669,20 @@ function get_original_title( $sep = '|', $echo = false, $seplocation = '' ) { $title = $this->internationalize( post_type_archive_title( '', false ) ); } elseif ( is_404() ) { $title_format = $aioseop_options['aiosp_404_title_format']; - $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); - if ( strpos( $new_title, '%blog_description%' ) !== false ) { + $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); + if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) { + $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%site_description%', 0 ) ) { + $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) { $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); } - if ( strpos( $new_title, '%request_url%' ) !== false ) { + if ( false !== strpos( $new_title, '%request_url%', 0 ) ) { $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title ); } - if ( strpos( $new_title, '%request_words%' ) !== false ) { + if ( false !== strpos( $new_title, '%request_words%', 0 ) ) { $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title ); } $title = $new_title; @@ -2031,7 +1735,7 @@ function apply_page_title_format( $title, $p = null, $title_format = '' ) { } /** - * Replace title templates inside % symbol. + * Replace doc title templates inside % symbol on the frontend. * * @param $title * @param $post @@ -2042,30 +1746,45 @@ function apply_page_title_format( $title, $p = null, $title_format = '' ) { * @return string */ function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) { + + /** + * Runs before applying the formatting for the doc title on the frontend. + * + * @since 3.0 + * + */ + do_action( 'aioseop_before_title_placeholder_helper' ); + if ( ! empty( $post ) ) { $authordata = get_userdata( $post->post_author ); } else { $authordata = new WP_User(); } - $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); - if ( strpos( $new_title, '%blog_description%' ) !== false ) { + $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format ); + if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) { + $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%site_description%', 0 ) ) { + $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); + } + if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) { $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title ); } - if ( strpos( $new_title, "%{$type}_title%" ) !== false ) { + if ( false !== strpos( $new_title, "%{$type}_title%", 0 ) ) { $new_title = str_replace( "%{$type}_title%", $title, $new_title ); } if ( $type == 'post' ) { - if ( strpos( $new_title, '%category%' ) !== false ) { + if ( false !== strpos( $new_title, '%category%', 0 ) ) { $new_title = str_replace( '%category%', $category, $new_title ); } - if ( strpos( $new_title, '%category_title%' ) !== false ) { + if ( false !== strpos( $new_title, '%category_title%', 0 ) ) { $new_title = str_replace( '%category_title%', $category, $new_title ); } - if ( strpos( $new_title, '%tax_' ) && ! empty( $post ) ) { + if ( false !== strpos( $new_title, '%tax_', 0 ) && ! empty( $post ) ) { $taxes = get_object_taxonomies( $post, 'objects' ); if ( ! empty( $taxes ) ) { foreach ( $taxes as $t ) { - if ( strpos( $new_title, "%tax_{$t->name}%" ) ) { + if ( false !== strpos( $new_title, "%tax_{$t->name}%", 0 ) ) { $terms = $this->get_all_terms( $post->ID, $t->name ); $term = ''; if ( count( $terms ) > 0 ) { @@ -2077,32 +1796,52 @@ function title_placeholder_helper( $title, $post, $type = 'post', $title_format } } } - if ( strpos( $new_title, "%{$type}_author_login%" ) !== false ) { + if ( false !== strpos( $new_title, "%{$type}_author_login%", 0 ) ) { $new_title = str_replace( "%{$type}_author_login%", $authordata->user_login, $new_title ); } - if ( strpos( $new_title, "%{$type}_author_nicename%" ) !== false ) { + if ( false !== strpos( $new_title, "%{$type}_author_nicename%", 0 ) ) { $new_title = str_replace( "%{$type}_author_nicename%", $authordata->user_nicename, $new_title ); } - if ( strpos( $new_title, "%{$type}_author_firstname%" ) !== false ) { + if ( false !== strpos( $new_title, "%{$type}_author_firstname%", 0 ) ) { $new_title = str_replace( "%{$type}_author_firstname%", $this->ucwords( $authordata->first_name ), $new_title ); } - if ( strpos( $new_title, "%{$type}_author_lastname%" ) !== false ) { + if ( false !== strpos( $new_title, "%{$type}_author_lastname%", 0 ) ) { $new_title = str_replace( "%{$type}_author_lastname%", $this->ucwords( $authordata->last_name ), $new_title ); } - - if ( strpos( $new_title, "%current_date%" ) !== false ){ + if ( false !== strpos( $new_title, '%current_date%', 0 ) ) { $new_title = str_replace( '%current_date%', aioseop_formatted_date(), $new_title ); } - if ( strpos( $new_title, "%post_date%" ) !== false ){ + if ( false !== strpos( $new_title, '%current_year%', 0 ) ) { + $new_title = str_replace( '%current_year%', date( 'Y' ), $new_title ); + } + if ( false !== strpos( $new_title, '%post_date%', 0 ) ) { $new_title = str_replace( '%post_date%', aioseop_formatted_date( get_the_date( 'U' ) ), $new_title ); } - if ( strpos( $new_title, '%post_year%' ) !== false ) { + if ( false !== strpos( $new_title, '%post_year%', 0 ) ) { $new_title = str_replace( '%post_year%', get_the_date( 'Y' ), $new_title ); } - if ( strpos( $new_title, '%post_month%' ) !== false ) { + if ( false !== strpos( $new_title, '%post_month%', 0 ) ) { $new_title = str_replace( '%post_month%', get_the_date( 'F' ), $new_title ); } + /** + * Filters document title after applying the formatting. + * + * @since 3.0 + * + * @param string $new_title Document title to be filtered. + * + */ + $new_title = apply_filters( 'aioseop_title_format', $new_title ); + + /** + * Runs after applying the formatting for the doc title on the frontend. + * + * @since 3.0 + * + */ + do_action( 'aioseop_after_title_placeholder_helper' ); + $title = trim( $new_title ); return $title; @@ -2194,7 +1933,7 @@ function get_post_title_format( $title_type = 'post', $p = null ) { if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) { return false; } - $title_format = "%{$title_type}_title% | %blog_title%"; + $title_format = "%{$title_type}_title% | %site_title%"; if ( isset( $aioseop_options[ "aiosp_{$title_type}_title_format" ] ) ) { $title_format = $aioseop_options[ "aiosp_{$title_type}_title_format" ]; } @@ -2279,6 +2018,7 @@ function get_all_categories( $id = 0 ) { * @return string */ function get_tax_title( $tax = '' ) { + if ( AIOSEOPPRO ) { if ( empty( $this->meta_opts ) ) { $this->meta_opts = $this->get_current_options( array(), 'aiosp' ); @@ -2356,28 +2096,65 @@ function get_tax_desc( $tax ) { * @return string */ function apply_tax_title_format( $category_name, $category_description, $tax = '' ) { + + /** + * Runs before applying the formatting for the taxonomy title. + * + * @since 3.0 + * + */ + do_action( 'aioseop_before_tax_title_format' ); + if ( empty( $tax ) ) { $tax = get_query_var( 'taxonomy' ); } $title_format = $this->get_tax_title_format( $tax ); $title = str_replace( '%taxonomy_title%', $category_name, $title_format ); - if ( strpos( $title, '%taxonomy_description%' ) !== false ) { + if ( false !== strpos( $title, '%taxonomy_description%', 0 ) ) { $title = str_replace( '%taxonomy_description%', $category_description, $title ); } - if ( strpos( $title, '%category_title%' ) !== false ) { + if ( false !== strpos( $title, '%category_title%', 0 ) ) { $title = str_replace( '%category_title%', $category_name, $title ); } - if ( strpos( $title, '%category_description%' ) !== false ) { + if ( false !== strpos( $title, '%category_description%', 0 ) ) { $title = str_replace( '%category_description%', $category_description, $title ); } - if ( strpos( $title, '%blog_title%' ) !== false ) { + if ( false !== strpos( $title, '%site_title%', 0 ) ) { + $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); + } + if ( false !== strpos( $title, '%blog_title%', 0 ) ) { $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title ); } - if ( strpos( $title, '%blog_description%' ) !== false ) { + if ( false !== strpos( $title, '%site_description%', 0 ) ) { + $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); + } + if ( false !== strpos( $title, '%blog_description%', 0 ) ) { $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title ); } + if ( false !== strpos( $title, '%current_year%', 0 ) ) { + $title = str_replace( '%current_year%', date( 'Y' ), $title ); + } + + /** + * Filters document title after applying the formatting. + * + * @since 3.0 + * + * @param string $title Document title to be filtered. + * + */ + $title = apply_filters( 'aioseop_title_format', $title ); + $title = wp_strip_all_tags( $title ); + /** + * Runs after applying the formatting for the taxonomy title. + * + * @since 3.0 + * + */ + do_action( 'aioseop_after_tax_title_format' ); + return $this->paged_title( $title ); } @@ -2389,7 +2166,7 @@ function apply_tax_title_format( $category_name, $category_description, $tax = ' function get_tax_title_format( $tax = '' ) { global $aioseop_options; if ( AIOSEOPPRO ) { - $title_format = '%taxonomy_title% | %blog_title%'; + $title_format = '%taxonomy_title% | %site_title%'; if ( is_category() ) { $title_format = $aioseop_options['aiosp_category_title_format']; } else { @@ -2402,10 +2179,10 @@ function get_tax_title_format( $tax = '' ) { } } if ( empty( $title_format ) ) { - $title_format = '%category_title% | %blog_title%'; + $title_format = '%category_title% | %site_title%'; } } else { - $title_format = '%category_title% | %blog_title%'; + $title_format = '%category_title% | %site_title%'; if ( ! empty( $aioseop_options['aiosp_category_title_format'] ) ) { $title_format = $aioseop_options['aiosp_category_title_format']; } @@ -2424,7 +2201,7 @@ function get_tax_title_format( $tax = '' ) { */ function apply_archive_title_format( $title, $category = '' ) { $title_format = $this->get_archive_title_format(); - $r_title = array( '%blog_title%', '%blog_description%', '%archive_title%' ); + $r_title = array( '%site_title%', '%site_description%', '%archive_title%' ); $d_title = array( $this->internationalize( get_bloginfo( 'name' ) ), $this->internationalize( get_bloginfo( 'description' ) ), @@ -2526,7 +2303,7 @@ function show_page_description() { */ function get_page_number() { global $post; - if ( is_singular() && false === strpos( $post->post_content, '' ) ) { + if ( is_singular() && false === strpos( $post->post_content, '', 0 ) ) { return null; } $page = get_query_var( 'page' ); @@ -2580,7 +2357,6 @@ function get_aioseop_description( $post = null ) { */ function get_post_description( $post ) { global $aioseop_options; - $description = ''; if ( ! $this->show_page_description() ) { return ''; } @@ -2590,15 +2366,21 @@ function get_post_description( $post ) { } if ( ! $description ) { if ( empty( $aioseop_options['aiosp_skip_excerpt'] ) ) { - $description = $this->trim_text_without_filters_full_length( $this->internationalize( $post->post_excerpt ) ); + $description = $post->post_excerpt; } if ( ! $description && isset( $aioseop_options['aiosp_generate_descriptions'] ) && $aioseop_options['aiosp_generate_descriptions'] ) { - $content = $post->post_content; - if ( ! empty( $aioseop_options['aiosp_run_shortcodes'] ) ) { - $content = do_shortcode( $content ); + if ( ! AIOSEOPPRO || ( AIOSEOPPRO && apply_filters( $this->prefix . 'generate_descriptions_from_content', true, $post ) ) ) { + $content = $post->post_content; + if ( ! empty( $aioseop_options['aiosp_run_shortcodes'] ) ) { + $content = aioseop_do_shortcodes( $content ); + } + $description = $content; + } else { + $description = $post->post_excerpt; } - $description = $this->trim_text_without_filters_full_length( $this->internationalize( $content ) ); } + + $description = $this->trim_text_without_filters_full_length( $this->internationalize( $description ) ); } return $description; @@ -3075,6 +2857,10 @@ function aioseop_show_pointer(handle, value) { pointers['aioseop_menu_2640'] = array( 'pointer_target' => "#toplevel_page_all-in-one-seo-pack$pro-aioseop_class", 'pointer_text' => '

    ' . __( 'Review Your Settings', 'all-in-one-seo-pack' ) - . '

    ' . sprintf( __( 'Welcome to version %s. Thank you for running the latest and greatest All in One SEO Pack Pro ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION ) . '

    ', - 'pointer_edge' => 'top', - 'pointer_align' => 'left', - 'pointer_scope' => 'global', - ); - - $this->pointers['aioseop_menu_2361'] = array( - 'pointer_target' => '#aioseop_top_button', - 'pointer_text' => '

    ' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION ) - . '

    ' . __( 'Thank you for running the latest and greatest All in One SEO Pack Pro ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ) . '

    ', + . '

    ' . sprintf( __( 'Welcome to version %1$s. Thank you for running the latest and greatest %2$s ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION, AIOSEOP_PLUGIN_NAME ) . '

    ', 'pointer_edge' => 'top', 'pointer_align' => 'left', 'pointer_scope' => 'global', ); - $this->pointers['aioseop_welcome_230'] = array( - 'pointer_target' => '#aioseop_top_button', - 'pointer_text' => '

    ' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION ) - . '

    ' . __( 'New in 2.4: Improved support for taxonomies, Woocommerce and massive performance improvements under the hood! Please review your settings on each options page!', 'all-in-one-seo-pack' ) . '

    ', - 'pointer_edge' => 'bottom', - 'pointer_align' => 'left', - 'pointer_scope' => 'local', - ); - $this->filter_pointers(); - - $this->pointers['aioseop_menu_2205'] = array( - 'pointer_target' => '#toplevel_page_all-in-one-seo-pack-aioseop_class', - 'pointer_text' => '

    ' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION ) - . '

    ' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ) . '

    ', - 'pointer_edge' => 'top', - 'pointer_align' => 'left', - 'pointer_scope' => 'global', - ); - $this->pointers['aioseop_welcome_220534'] = array( - 'pointer_target' => '#aioseop_top_button', - 'pointer_text' => '

    ' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION ) - . '

    ' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! New since 2.2: Control who accesses your site with the new Robots.txt Editor and File Editor modules! Enable them from the Feature Manager. Remember to review your settings, we have added some new ones!', 'all-in-one-seo-pack' ) . '

    ', - 'pointer_edge' => 'bottom', - 'pointer_align' => 'left', - 'pointer_scope' => 'local', - ); $this->filter_pointers(); - } + */ function add_page_hooks() { @@ -3153,6 +2904,13 @@ function add_page_hooks() { } } + if ( isset( $post_types['attachment'] ) ) { + $post_types['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' ); + } + if ( isset( $all_post_types['attachment'] ) ) { + $all_post_types['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' ); + } + $taxes = get_taxonomies( '', 'objects' ); $tx = array_keys( $taxes ); $remtax = array( 'nav_menu', 'link_category', 'post_format' ); @@ -3166,6 +2924,15 @@ function add_page_hooks() { } } + /** + * Allows users to filter the taxonomies that are shown in the General Settings menu. + * + * @since 3.0.0 + * + * @param array $tax_types All registered taxonomies. + */ + $tax_types = apply_filters( 'aioseop_pre_tax_types_setting', $tax_types ); + $this->default_options['posttypecolumns']['initial_options'] = $post_types; $this->default_options['cpostactive']['initial_options'] = $all_post_types; $this->default_options['cpostnoindex']['initial_options'] = $post_types; @@ -3173,9 +2940,6 @@ function add_page_hooks() { if ( AIOSEOPPRO ) { $this->default_options['taxactive']['initial_options'] = $tax_types; } - $this->default_options['google_author_location']['initial_options'] = $post_types; - $this->default_options['google_author_location']['initial_options'] = array_merge( array( 'front' => __( 'Front Page', 'all-in-one-seo-pack' ) ), $post_types, array( 'all' => __( 'Everywhere Else', 'all-in-one-seo-pack' ) ) ); - $this->default_options['google_author_location']['default'] = array_keys( $this->default_options['google_author_location']['initial_options'] ); foreach ( $all_post_types as $p => $pt ) { $field = $p . '_title_format'; @@ -3184,34 +2948,11 @@ function add_page_hooks() { $this->default_options[ $field ] = array( 'name' => "$name " . __( 'Title Format:', 'all-in-one-seo-pack' ) . "
    ($p)", 'type' => 'text', - 'default' => '%post_title% | %blog_title%', + 'default' => '%post_title% | %site_title%', 'condshow' => array( - 'aiosp_rewrite_titles' => 1, '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' ) . '
    • '; - $taxes = get_object_taxonomies( $p, 'objects' ); - if ( ! empty( $taxes ) ) { - foreach ( $taxes as $n => $t ) { - $this->help_text[ $field ] .= sprintf( __( "%%tax_%1\$s%% - This post's associated %2\$s taxonomy title", 'all-in-one-seo-pack' ), $n, $t->label ) . '
    • '; - } - } - $this->help_text[ $field ] .= - __( "%post_author_login% - This post's author' login", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%post_author_nicename% - This post's author' nicename", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '
    • ' . - __( "%post_author_lastname% - This post'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 post was published (localized)', 'all-in-one-seo-pack' ) . '
    • ' . - __( '%post_year% - The year the post was published (localized)', 'all-in-one-seo-pack' ) . '
    • ' . - __( '%post_month% - The month the post was published (localized)', 'all-in-one-seo-pack' ) . '
    • ' . - '
    ' . - ''; - $this->help_anchors[ $field ] = '#custom-titles'; $this->layout['cpt']['options'][] = $field; } } @@ -3238,24 +2979,16 @@ function add_page_hooks() { $this->default_options[ $field ] = array( 'name' => "$name " . __( 'Taxonomy Title Format:', 'all-in-one-seo-pack' ), 'type' => 'text', - 'default' => '%taxonomy_title% | %blog_title%', + 'default' => '%taxonomy_title% | %site_title%', 'condshow' => array( - 'aiosp_rewrite_titles' => 1, 'aiosp_taxactive\[\]' => $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' ) . '
    • ' . - __( '%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; @@ -3347,10 +3080,14 @@ public function admin_enqueue_scripts( $hook_suffix ) { * @return mixed */ function filter_submit( $submit ) { - $submit['Submit_Default']['value'] = __( 'Reset General Settings to Defaults', 'all-in-one-seo-pack' ) . ' »'; + $submit['Submit_Default'] = array( + 'type' => 'submit', + 'class' => 'aioseop_reset_settings_button button-secondary', + 'value' => __( 'Reset General Settings to Defaults', 'all-in-one-seo-pack' ) . ' »', + ); $submit['Submit_All_Default'] = array( 'type' => 'submit', - 'class' => 'button-secondary', + 'class' => 'aioseop_reset_settings_button button-secondary', 'value' => __( 'Reset ALL Settings to Defaults', 'all-in-one-seo-pack' ) . ' »', ); @@ -3477,7 +3214,7 @@ function filter_settings( $settings, $location, $current ) { } elseif ( ! empty( $current[ "{$prefix}togglekeywords" ] ) ) { unset( $settings[ "{$prefix}keywords" ] ); } - if ( empty( $this->options['aiosp_can'] ) || empty( $this->options['aiosp_customize_canonical_links'] ) ) { + if ( empty( $this->options['aiosp_can'] ) ) { unset( $settings[ "{$prefix}custom_link" ] ); } } @@ -3508,9 +3245,6 @@ function filter_options( $options, $location ) { } if ( $location == null ) { $prefix = $this->prefix; - if ( isset( $options[ "{$prefix}rewrite_titles" ] ) && ( ! empty( $options[ "{$prefix}rewrite_titles" ] ) ) ) { - $options[ "{$prefix}rewrite_titles" ] = 1; - } if ( isset( $options[ "{$prefix}use_original_title" ] ) && ( $options[ "{$prefix}use_original_title" ] === '' ) ) { $options[ "{$prefix}use_original_title" ] = 0; } @@ -3525,19 +3259,17 @@ function template_redirect() { $post = $this->get_queried_object(); if ( ! $this->is_page_included() ) { - return; + return; } - if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) ) { - $force_rewrites = 1; - if ( isset( $aioseop_options['aiosp_force_rewrites'] ) ) { - $force_rewrites = $aioseop_options['aiosp_force_rewrites']; - } - if ( $force_rewrites ) { - ob_start( array( $this, 'output_callback_for_title' ) ); - } else { - add_filter( 'wp_title', array( $this, 'wp_title' ), 20 ); - } + $force_rewrites = 1; + if ( isset( $aioseop_options['aiosp_force_rewrites'] ) ) { + $force_rewrites = $aioseop_options['aiosp_force_rewrites']; + } + if ( $force_rewrites ) { + ob_start( array( $this, 'output_callback_for_title' ) ); + } else { + add_filter( 'wp_title', array( $this, 'wp_title' ), 20 ); } } @@ -3676,8 +3408,8 @@ function replace_title( $content, $title ) { $title = trim( strip_tags( $title ) ); $title_tag_start = 'strpos( $content, $title_tag_start ); - $end = $this->strpos( $content, $title_tag_end ); + $start = $this->strpos( $content, $title_tag_start, 0 ); + $end = $this->strpos( $content, $title_tag_end, 0 ); $this->title_start = $start; $this->title_end = $end; $this->orig_title = $title; @@ -3743,51 +3475,40 @@ function add_hooks() { add_filter( 'aioseop_title', array( &$this, 'filter_title' ) ); } + /** + * Visibility Warning + * + * Checks if 'Search Engine Visibility' is enabled in Settings > Reading. + * + * @todo Change to earlier hook. Before `admin_enqueue` if possible. + * + * @since ? + * @since 3.0 Changed to AIOSEOP_Notices class. + * + * @see `self::constructor()` with 'all_admin_notices' Filter Hook + */ function visibility_warning() { - - $aioseop_visibility_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed', true ); - - if ( '0' == get_option( 'blog_public' ) && empty( $aioseop_visibility_notice_dismissed ) ) { - - printf( - ' -
    -

    - %1$s - %2$s - -

    -
    ', - __( 'Warning: You\'re blocking access to search engines.', 'all-in-one-seo-pack' ), - sprintf( __( 'You can %1$s click here%2$s to go to your reading settings and toggle your blog visibility.', 'all-in-one-seo-pack' ), sprintf( '', esc_url( admin_url( 'options-reading.php' ) ) ), '' ) - ); - - } elseif ( '1' == get_option( 'blog_public' ) && ! empty( $aioseop_visibility_notice_dismissed ) ) { - delete_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed' ); + global $aioseop_notices; + if ( '0' === get_option( 'blog_public' ) ) { + $aioseop_notices->activate_notice( 'blog_public_disabled' ); + } elseif ( '1' === get_option( 'blog_public' ) ) { + $aioseop_notices->deactivate_notice( 'blog_public_disabled' ); } } - function woo_upgrade_notice() { - - $aioseop_woo_upgrade_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed', true ); - - if ( class_exists( 'WooCommerce' ) && empty( $aioseop_woo_upgrade_notice_dismissed ) && current_user_can( 'manage_options' ) ) { - - printf( - ' -
    -

    - %1$s - %2$s - -

    -
    ', - __( 'We\'ve detected you\'re running WooCommerce.', 'all-in-one-seo-pack' ), - sprintf( __( '%1$s Upgrade%2$s to All in One SEO Pack Pro for increased SEO compatibility for your products.', 'all-in-one-seo-pack' ), sprintf( '', esc_url( 'https://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=woo' ) ), '' ) - ); - - } elseif ( ! class_exists( 'WooCommerce' ) && ! empty( $aioseop_woo_upgrade_notice_dismissed ) ) { - delete_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed' ); + /** + * WooCommerce Upgrade Notice + * + * @since ? + * @since 3.0 Changed to AIOSEOP Notices. + */ + public function woo_upgrade_notice() { + global $aioseop_notices; + if ( class_exists( 'WooCommerce' ) && current_user_can( 'manage_options' ) && ! AIOSEOPPRO ) { + $aioseop_notices->activate_notice( 'woocommerce_detected' ); + } else { + global $aioseop_notices; + $aioseop_notices->deactivate_notice( 'woocommerce_detected' ); } } @@ -3901,7 +3622,9 @@ function wp_head() { $aioseop_dup_counter ++; if ( ! defined( 'AIOSEOP_UNIT_TESTING' ) && $aioseop_dup_counter > 1 ) { - echo "\n\n"; + + /* translators: %1$s, %2$s and %3$s are placeholders and should not be translated. %1$s expands to the name of the plugin, All in One SEO Pack, %2$s to the name of a filter function and %3$s is replaced with a number. */ + echo "\n\n"; if ( ! empty( $old_wp_query ) ) { // Change the query back after we've finished. $GLOBALS['wp_query'] = $old_wp_query; @@ -3919,11 +3642,10 @@ function wp_head() { $description = ''; // Logging - rewrite handler check for output buffering. $this->check_rewrite_handler(); - if ( AIOSEOPPRO ) { - echo "\n\n"; - } else { - echo "\n"; - } + echo sprintf( "\n", AIOSEOP_PLUGIN_NAME ); if ( ! empty( $old_wp_query ) ) { // Change the query back after we've finished. @@ -4117,7 +3825,7 @@ function check_rewrite_handler() { $force_rewrites = $aioseop_options['aiosp_force_rewrites']; } - if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) && $force_rewrites ) { + if ( $force_rewrites ) { // Make the title rewrite as short as possible. if ( function_exists( 'ob_list_handlers' ) ) { $active_handlers = ob_list_handlers(); @@ -4133,11 +3841,10 @@ function check_rewrite_handler() { $this->log( 'another plugin interfering?' ); // If we get here there *could* be trouble with another plugin :(. $this->ob_start_detected = true; - if ( $this->option_isset( 'rewrite_titles' ) ) { // Try alternate method -- pdb. - $aioseop_options['aiosp_rewrite_titles'] = 0; - $force_rewrites = 0; - add_filter( 'wp_title', array( $this, 'wp_title' ), 20 ); - } + + // Try alternate method -- pdb. + add_filter( 'wp_title', array( $this, 'wp_title' ), 20 ); + if ( function_exists( 'ob_list_handlers' ) ) { foreach ( ob_list_handlers() as $handler ) { $this->log( "detected output handler $handler" ); @@ -4168,34 +3875,52 @@ function trim_description( $description ) { * @return mixed */ function apply_description_format( $description, $post = null ) { + + /** + * Runs before applying the formatting for the meta description. + * + * @since 3.0 + * + */ + do_action( 'aioseop_before_apply_description_format' ); + global $aioseop_options; $description_format = $aioseop_options['aiosp_description_format']; if ( ! isset( $description_format ) || empty( $description_format ) ) { $description_format = '%description%'; } $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format ); - if ( strpos( $description, '%blog_title%' ) !== false ) { + if ( false !== strpos( $description, '%site_title%', 0 ) ) { + $description = str_replace( '%site_title%', get_bloginfo( 'name' ), $description ); + } + if ( false !== strpos( $description, '%blog_title%', 0 ) ) { $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description ); } - if ( strpos( $description, '%blog_description%' ) !== false ) { + if ( false !== strpos( $description, '%site_description%', 0 ) ) { + $description = str_replace( '%site_description%', get_bloginfo( 'description' ), $description ); + } + if ( false !== strpos( $description, '%blog_description%', 0 ) ) { $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description ); } - if ( strpos( $description, '%wp_title%' ) !== false ) { + if ( false !== strpos( $description, '%wp_title%', 0 ) ) { $description = str_replace( '%wp_title%', $this->get_original_title(), $description ); } - if ( strpos( $description, '%post_title%' ) !== false ) { + if ( false !== strpos( $description, '%post_title%', 0 ) ) { $description = str_replace( '%post_title%', $this->get_aioseop_title( $post, false ), $description ); } - if ( strpos( $description, '%current_date%' ) !== false ) { + if ( false !== strpos( $description, '%current_date%', 0 ) ) { $description = str_replace( '%current_date%', date_i18n( get_option( 'date_format' ) ), $description ); } - if ( strpos( $description, '%post_date%' ) !== false ) { + if ( false !== strpos( $description, '%current_year%', 0 ) ) { + $description = str_replace( '%current_year%', date( 'Y' ), $description ); + } + if ( false !== strpos( $description, '%post_date%', 0 ) ) { $description = str_replace( '%post_date%', get_the_date(), $description ); } - if ( strpos( $description, '%post_year%' ) !== false ) { + if ( false !== strpos( $description, '%post_year%', 0 ) ) { $description = str_replace( '%post_year%', get_the_date( 'Y' ), $description ); } - if ( strpos( $description, '%post_month%' ) !== false ) { + if ( false !== strpos( $description, '%post_month%', 0 ) ) { $description = str_replace( '%post_month%', get_the_date( 'F' ), $description ); } @@ -4205,6 +3930,15 @@ function apply_description_format( $description, $post = null ) { * if ($aioseop_options['aiosp_can']) $description = $this->make_unique_att_desc($description); */ $description = $this->apply_cf_fields( $description ); + + /** + * Runs after applying the formatting for the meta description. + * + * @since 3.0 + * + */ + do_action( 'aioseop_after_apply_description_format' ); + return $description; } @@ -4319,23 +4053,16 @@ function is_password_protected() { } /** + * Sitelinks Search Box + * + * @since ? + * * @return mixed|void */ function sitelinks_search_box() { global $aioseop_options; - $home_url = esc_url( get_home_url() ); - $name_block = $search_block = ''; - if ( ! empty( $aioseop_options['aiosp_google_set_site_name'] ) ) { - if ( ! empty( $aioseop_options['aiosp_google_specify_site_name'] ) ) { - $blog_name = $aioseop_options['aiosp_google_specify_site_name']; - } else { - $blog_name = get_bloginfo( 'name' ); - } - $blog_name = esc_attr( $blog_name ); - $name_block = << { - "@context": "http://schema.org", + "@context": "https://schema.org", "@type": "WebSite", EOF; - if ( ! empty( $name_block ) ) { - $search_box .= $name_block; - } if ( ! empty( $search_block ) ) { $search_box .= $search_block; } @@ -4368,66 +4092,6 @@ function sitelinks_search_box() { return apply_filters( 'aiosp_sitelinks_search_box', $search_box ); } - /** - * @param $post - * - * @return array - */ - function get_google_authorship( $post ) { - global $aioseop_options; - $page = $this->get_page_number(); - // Handle authorship. - $googleplus = $publisher = $author = ''; - - if ( ! empty( $post ) && isset( $post->post_author ) && empty( $aioseop_options['aiosp_google_disable_profile'] ) ) { - $googleplus = get_the_author_meta( 'googleplus', $post->post_author ); - } - - if ( empty( $googleplus ) && ! empty( $aioseop_options['aiosp_google_publisher'] ) ) { - $googleplus = $aioseop_options['aiosp_google_publisher']; - } - - if ( is_front_page() && ( $page < 2 ) ) { - if ( ! empty( $aioseop_options['aiosp_google_publisher'] ) ) { - $publisher = $aioseop_options['aiosp_google_publisher']; - } - - if ( ! empty( $aioseop_options['aiosp_google_author_advanced'] ) ) { - if ( empty( $aioseop_options['aiosp_google_enable_publisher'] ) ) { - $publisher = ''; - } elseif ( ! empty( $aioseop_options['aiosp_google_specify_publisher'] ) ) { - $publisher = $aioseop_options['aiosp_google_specify_publisher']; - } - } - } - if ( is_singular() && ( ! empty( $googleplus ) ) ) { - $author = $googleplus; - } elseif ( ! empty( $aioseop_options['aiosp_google_publisher'] ) ) { - $author = $aioseop_options['aiosp_google_publisher']; - } - - if ( ! empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) { - if ( empty( $aioseop_options['aiosp_google_author_location'] ) ) { - $aioseop_options['aiosp_google_author_location'] = array(); - } - if ( is_front_page() && ! in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) { - $author = ''; - } else { - if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) { - if ( is_singular() && ! is_singular( $aioseop_options['aiosp_google_author_location'] ) ) { - $author = ''; - } - } else { - if ( ! is_singular( $aioseop_options['aiosp_google_author_location'] ) ) { - $author = ''; - } - } - } - } - - return array( 'publisher' => $publisher, 'author' => $author ); - } - /** * @param null $post * @@ -4465,7 +4129,7 @@ function get_prev_next_links( $post = null ) { $more = 1; } $content = $post->post_content; - if ( false !== strpos( $content, '' ) ) { + if ( false !== strpos( $content, '', 0 ) ) { if ( $page > 1 ) { $more = 1; } @@ -4473,7 +4137,7 @@ function get_prev_next_links( $post = null ) { $content = str_replace( "\n", '', $content ); $content = str_replace( "\n", '', $content ); // Ignore nextpage at the beginning of the content. - if ( 0 === strpos( $content, '' ) ) { + if ( 0 === strpos( $content, '', 0 ) ) { $content = substr( $content, 15 ); } $pages = explode( '', $content ); @@ -4500,12 +4164,12 @@ function get_prev_next_links( $post = null ) { if ( ! empty( $prev ) ) { $dom = new DOMDocument(); $dom->loadHTML( $prev ); - $prev = $dom->getElementsByTagName( 'a' )->item(0)->getAttribute( 'href' ); + $prev = $dom->getElementsByTagName( 'a' )->item( 0 )->getAttribute( 'href' ); } if ( ! empty( $next ) ) { $dom = new DOMDocument(); $dom->loadHTML( $next ); - $next = $dom->getElementsByTagName( 'a' )->item(0)->getAttribute( 'href' ); + $next = $dom->getElementsByTagName( 'a' )->item( 0 )->getAttribute( 'href' ); } } @@ -4591,7 +4255,7 @@ function save_post_data( $id ) { 'noindex', 'nofollow', ); - if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) { + if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) { unset( $optlist['custom_link'] ); } foreach ( $optlist as $f ) { @@ -4609,7 +4273,7 @@ function save_post_data( $id ) { 'noindex', 'nofollow', ); - if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) { + if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) { unset( $optlist['custom_link'] ); } foreach ( $optlist as $f ) { @@ -4850,7 +4514,7 @@ function save_category_metaboxes( $id ) { 'noindex', 'nofollow', ); - if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) { + if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) { unset( $optlist['custom_link'] ); } foreach ( $optlist as $f ) { @@ -4964,10 +4628,12 @@ function admin_menu() { } add_menu_page( - $menu_name, $menu_name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), $file, array( - $this, - 'display_settings_page', - ) + $menu_name, + $menu_name, + apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), + $file, + array( $this, 'display_settings_page' ), + aioseop_get_menu_icon() ); add_meta_box( diff --git a/all_in_one_seo_pack.php b/all_in_one_seo_pack.php index e35671eeb..4936af838 100644 --- a/all_in_one_seo_pack.php +++ b/all_in_one_seo_pack.php @@ -3,8 +3,8 @@ /* Plugin Name: All In One SEO Pack Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/ -Description: Out-of-the-box SEO for your WordPress blog. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. More than 50 million downloads since 2007. -Version: 2.12.1 +Description: Out-of-the-box SEO for WordPress. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. More than 50 million downloads since 2007. +Version: 3.0 Author: Michael Torbert Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/ Text Domain: all-in-one-seo-pack @@ -32,17 +32,18 @@ * The original WordPress SEO plugin. * * @package All-in-One-SEO-Pack - * @version 2.12.1 + * @version 3.0 */ 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', '2.12.1' ); + define( 'AIOSEOP_VERSION', '3.0' ); } -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__ ) ) { @@ -266,6 +263,10 @@ function aioseop_activate() { } $aiosp_activation = true; + require_once AIOSEOP_PLUGIN_DIR . 'admin/class-aioseop-notices.php'; + global $aioseop_notices; + $aioseop_notices->reset_notice( 'review_plugin' ); + // These checks might be duplicated in the function being called. if ( ! is_network_admin() || ! isset( $_GET['activate-multi'] ) ) { set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation. @@ -302,7 +303,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' ); } } @@ -390,6 +391,8 @@ function aiosp_action_links( $actions, $plugin_file, $action_links = array(), $p /** * Inits All-in-One-Seo plugin class. * + * @global AIOSEOP_Notices $aioseop_notices + * * @since ?? // When was this added? * @since 2.3.12.3 Loads third party compatibility class. */ @@ -412,6 +415,7 @@ function aioseop_init_class() { require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome.php' ); require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/dashboard_widget.php' ); require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/menu.php' ); + require_once( AIOSEOP_PLUGIN_DIR . 'admin/class-aioseop-notices.php' ); $aioseop_welcome = new aioseop_welcome(); // TODO move this to updates file. @@ -438,6 +442,8 @@ function aioseop_init_class() { add_action( 'init', array( $aiosp, 'add_hooks' ) ); add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 ); + add_action( 'admin_init', 'aioseop_review_plugin_notice' ); + if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) { remove_action( 'init', array( $aiosp, 'add_hooks' ) ); add_action( 'admin_init', 'aioseop_scan_post_header' ); @@ -451,7 +457,60 @@ function aioseop_init_class() { } } +if ( ! function_exists( 'aioseop_review_plugin_notice' ) ) { + /** + * Review Plugin Notice + * + * Activates the review notice. + * Note: This couldn't be used directly in `aioseop_init_class()` since ajax instances was causing + * the database options to reset. + * + * @since 3.0 + */ + function aioseop_review_plugin_notice() { + global $aioseop_notices; + $aioseop_notices->activate_notice( 'review_plugin' ); + } +} +if ( ! function_exists( 'aioseop_admin_enqueue_styles' ) ) { + /** + * Admin Enqueue Styles + * + * Styles used in various parts of WordPress admin, and not just AIOSEOP's screens. + * Note: If styles are specific to a given module, then use that module's admin_enqueue_styles() method, or parent method. + * + * @todo Refactor this into a core file. + * + * @since 3.0 + * + * @see 'admin_enqueue_scripts' hook + * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/ + * + * @param string $hook_suffix + */ + function aioseop_admin_enqueue_styles( $hook_suffix ) { + // Font Icons. + if ( ! wp_style_is( 'aioseop-font-icons', 'registered' ) && ! wp_style_is( 'aioseop-font-icons', 'enqueued' ) ) { + wp_enqueue_style( + 'aioseop-font-icons', + AIOSEOP_PLUGIN_URL . 'css/aioseop-font-icons.css', + array(), + AIOSEOP_VERSION + ); + } + if ( function_exists( 'is_rtl' ) && is_rtl() ) { + if ( ! wp_style_is( 'aioseop-font-icons-rtl', 'registered' ) && ! wp_style_is( 'aioseop-font-icons-rtl', 'enqueued' ) ) { + wp_enqueue_style( + 'aioseop-font-icons-rtl', + AIOSEOP_PLUGIN_URL . 'css/aioseop-font-icons-rtl.css', + array(), + AIOSEOP_VERSION + ); + } + } + } +} if ( ! function_exists( 'aioseop_welcome' ) ) { function aioseop_welcome() { @@ -479,7 +538,8 @@ function aioseop_welcome() { add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' ); add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' ); add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' ); - add_action( 'wp_ajax_aioseo_dismiss_sitemap_max_url_notice', 'aioseop_sitemap_max_url_notice_dismissed' ); + + add_action( 'admin_enqueue_scripts', 'aioseop_admin_enqueue_styles' ); } if ( ! function_exists( 'aioseop_scan_post_header' ) ) { 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/css/admin-notice.css b/css/admin-notice.css new file mode 100644 index 000000000..ccb29113f --- /dev/null +++ b/css/admin-notice.css @@ -0,0 +1,22 @@ +/** + * AIOSEOP_Notices CSS + * + * @package All-in-One-SEO-Pack + * @subpackage AIOSEOP_Notices + * @since 3.0 + */ + +.aioseop-notice-delay { + display: inherit; + /* width: fit-content; */ +} + +.aioseop-notice-delay.aioseop-delay-0.button-primary.button-orange { + background: #d54e21; + border-color: #aa3e1a; + -webkit-box-shadow: 0 1px 0 #aa3e1a; + box-shadow: 0 1px 0 #aa3e1a; + color: #fff; + text-decoration: none; + text-shadow: 0 -1px 1px #d54e21,1px 0 1px #d54e21,0 1px 1px #d54e21,-1px 0 1px #d54e21; +} diff --git a/css/aioseop-font-icons-rtl.css b/css/aioseop-font-icons-rtl.css new file mode 100644 index 000000000..016af6141 --- /dev/null +++ b/css/aioseop-font-icons-rtl.css @@ -0,0 +1,8 @@ +/** + * RTL overrides for Font Icons. + * + * @since 3.0.0 + */ +.aioseop-label-quickedit { + padding: 0 20px 0 0; +} diff --git a/css/aioseop-font-icons.css b/css/aioseop-font-icons.css new file mode 100644 index 000000000..c3a332c6f --- /dev/null +++ b/css/aioseop-font-icons.css @@ -0,0 +1,198 @@ +/** + * GlyphIcons / Custom Icons. + * + * @author Michael Torbert. + * @author Semper Fi Web Design. + * @copyright http://semperplugins.com + * @package All-in-One-SEO-Pack. + */ + +@charset "UTF-8"; + +@font-face { + font-family: 'aioseop-font'; + src: url('font-icons/aioseop.eot'); + src: url('font-icons/aioseop.eot?#iefix') format('embedded-opentype'), + url('font-icons/aioseop.woff') format('woff'), + url('font-icons/aioseop.ttf') format('truetype'), + url('font-icons/aioseop.svg#aioseop') format('svg'); + font-weight: normal; + font-style: normal; +} + +[data-icon]:before { + font-family: 'aioseop-font' !important; + content: attr(data-icon); + font-style: normal !important; + font-weight: normal !important; + font-variant: normal !important; + text-transform: none !important; + speak: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +[class^='aioseop-icon-']:before, +[class*=' aioseop-icon-']:before { + display: inline-block; + font-family: 'aioseop-font'; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + speak: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* SUPPORT METABOX */ + +.aioseop_icon { + display: inline; + margin-right: 10px; + color: #00a2e2; + font-size: 2.5em; + line-height: 1.2; + vertical-align: middle; +} + +.aioseop-icon-file:before { + content: '\69'; +} + +.aioseop-icon-support:before { + content: '\6a'; +} + +.aioseop-icon-cog:before { + content: '\6b'; +} + +.aioseop-icon-youtube:before { + content: '\6c'; +} + +.aioseop-icon-book:before { + content: '\6d'; +} + +.aioseop_help_icon:before { + content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAflBMVEUAAAAAn98AnuIAn+EAneAAnuAAnuAAn+QAn+QAneEAnuAAnuAAn+EAnuAAnuEAneAAn+cAneAAnuAAn98AnOIAnuEAneIAn+MAnuEAnuEAn+EAneIAneEAneEAnuEAn+MAneAAneEAnuMAnOIAn+cAneEBnuEAneAAnuMBnuEoGewkAAAAKXRSTlMAEE9/r7/fADCPzwBv718AIPDAAFCwYEAAoAAAn4CQAOAAPwAAcADQAFP96WQAAAMNSURBVHhelZcNc5swDIatBghpoCGEj9Jij2XLMv3/P7glkoNtZJo+d+0lhBOveSXZUjHgZZOkGf4nS5PNC5wiKPFqvnvFgNddvpVQy0tQZCiSFfCEAtiUGKXcwFcB3kpcpXx791HetypFn2NdH9EnrX67KPdL46g/tl3PeqHvWidM2fxyUM7n3fzgof8R0A9zjN3PGTV/HB+6teg66EeIUQqQIGOiSQMGmeRgUQfGPn/Ktyv0k9UQKrCxWzitAq3V6dvYIDG8f8mAROO6ULF/3ecTaHazcvIgjTw/PxfFeVFErCHd31C3fx2v39cKGy6qLKyA1tGr/v8BLWDyb3OLqiw+XGCiq8DFxIvypMKIHqMXvaeLmmyEkn1xSTCAjWcMS7gruFD+eo/QuEC7AYCy+nJXkC1/r5A4Gq2NrQCvjMnL7OZCLggY3KoAI5jMEvKt2hohBYK3wiveuwx8i3qn/uvVf0O2Hh5MnLwOZMTrXgGt4OCi7RuyXNg1F1oDqEZIQh2K6oUALalSWqgiIwUIM4VVqZZvdlkE7QQFFLRVNS3l5NLZarMkgkx6ebWiNPqzSu9nEkM2KDZhjbykh+19KKri3+LkIxLhVlE/E4CaAjsd4AYo9zJkR9huGF7CtPYSX9FyXG4XFHe2UQIt9fIGa6NNJBErX2r35O0wp7KEbZYSNpVtMYngSpbZYoI1G9YClFzOp+vKS6jviLFJ+fWgDralfZO5peW2xX8LKB9NdTtxsQuc7/wV0OTv/YRyiUuIugCls7FwizffsXHgzcRurjEjYgH8zdVKyODZJUDGAuxZubNnt5BIgMQ7YNyowy2c0XfCqyNX6HzE2Ve8A28+nmDDHaJyD9sNChpkxvCYRxgkEjitAkl40AzPjxm7KdNnSAzLgaNFZhcVATtkBmliGaTJSJ6mBnnkMWgpx+XAMZZoMbGZqXEHm6Q4sxA4F4k7DEkjD1PVGJCmGFDLQ5elO+Iqx7B/q88A0FKI+DSlBLMuE4pMF3h6+DZXDLia6PAtA41u67uUqW51E02uf46zvXx+HY4YAAAAAElFTkSuQmCC); +} + +/* QUICKEDIT - AJAX Edit */ + +.aioseop-icon-qedit { + margin: 0 3px; + line-height: 2; + font-size: 14px; +} + +.aioseop-icon-qedit-accept { + color: #9dd490; +} + +.aioseop-icon-qedit-accept:hover { + color: #97eb84; +} + +.aioseop-icon-qedit-accept:before { + content: '\70'; +} + +.aioseop-icon-qedit-delete { + color: #ed8881; +} + +.aioseop-icon-qedit-delete:hover { + color: #ffad9e; +} + +.aioseop-icon-qedit-delete:before { + content: '\71'; +} + +/* QUICKEDIT */ + +.aioseop_edit_link { + display: inline-block; + position: absolute; +} + +.aioseop-icon-cog-edit { + color: #72777c; +} + +.aioseop-icon-cog-edit:hover { + color: #0073aa; +} + +.aioseop-icon-cog-edit:before { + content: '\6e'; +} + +.aioseop-label-quickedit { + padding-left: 20px; +} + +/* TIP ICON ( Robots ) */ + +div.aioseop_tip_icon { + font-size: 14px; + border: 1px solid #888; + width: 1em; + text-align: center; + padding: 0 4px; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + -webkit-box-shadow: 1px 1px 1px #888; + -moz-box-shadow: 1px 1px 1px #888; + box-shadow: 1px 1px 1px #888; + border-radius: 12px; +} + +div.aioseop_tip_icon:before { + content: '?'; +} + +/* ABOUT METABOX */ + +.aiosp-di .dashicons { + margin: 1px; + line-height: 1; + width: 42px; + height: 36px; + color: #fff; + padding: 3px; + vertical-align: middle; +} + +.aiosp-di .dashicons:before { + -webkit-font-smoothing: antialiased; + font-family: 'dashicons'; + font-weight: 400; + font-size: 1.5em; + line-height: 38px; +} + +.aiosp-di .dashicons.di-facebook { + margin: 0; + color: #3B5998; +} + +.aiosp-di .dashicons.di-facebook:before { + content: '\f304'; + font-size: 2.7em; +} + +.aiosp-di .dashicons.di-twitter { + width: 36px; + background-color: #00aced; + border-radius: 2px; +} + +.aiosp-di .dashicons.di-twitter:before { + content: '\f301'; +} diff --git a/css/aiosp_admin.css b/css/aiosp_admin.css index dc814c3a7..1c0d36875 100644 --- a/css/aiosp_admin.css +++ b/css/aiosp_admin.css @@ -1,39 +1,3 @@ -#toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image { - background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important; -} - -#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image { - background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important; -} - -#toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image img { - display: none; -} - -#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img { - display: none; -} - -#adminmenu #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image:before { - content: ''; -} - -#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image:before { - content: '' !important; -} - -#toplevel_page_all-in-one-seo-pack-pro-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-pro-aioseop_class.wp-has-current-submenu .wp-menu-image { - background-position: 8px -26px !important; -} - -#toplevel_page_all-in-one-seo-pack-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-aioseop_class.wp-has-current-submenu .wp-menu-image { - background-position: 8px -26px !important; -} - -#icon-aioseop.icon32 { - background: url(../images/shield32.png) no-repeat left top !important; -} - #aioseop_settings_header #message { padding: 5px 0px 5px 50px; background-image: url(../images/update32.png); @@ -46,27 +10,6 @@ @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and ( min--moz-device-pixel-ratio: 1.5), only screen and ( -o-min-device-pixel-ratio: 3/2), only screen and ( min-device-pixel-ratio: 1.5), only screen and ( min-resolution: 1.5dppx) { - #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image { - background-image: url('../images/shield-sprite-32.png') !important; - -webkit-background-size: 16px 48px !important; - -moz-background-size: 16px 48px !important; - background-size: 16px 48px !important; - } - - #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image { - background-image: url('../images/shield-sprite-32.png') !important; - -webkit-background-size: 16px 48px !important; - -moz-background-size: 16px 48px !important; - background-size: 16px 48px !important; - } - - #icon-aioseop.icon32 { - background-image: url('../images/shield64.png') !important; - -webkit-background-size: 32px 32px !important; - -moz-background-size: 32px 32px !important; - background-size: 32px 32px !important; - } - #aioseop_settings_header #message { background-image: url(../images/update64.png) !important; -webkit-background-size: 32px 32px !important; @@ -93,42 +36,35 @@ li#wp-admin-bar-aioseop-pro-upgrade a.ab-item { font-size: 110%; } -/* Dashicons in sidebar */ - -.aiosp-di .dashicons { - margin:1px; - line-height: 1; - width: 42px; - height:36px; - color:#fff; - padding:3px; - vertical-align:middle; -} -.aiosp-di .dashicons:before { - -webkit-font-smoothing:antialiased; - font:400 30px/1 dashicons; - line-height: 38px; -} -.aiosp-di .dashicons.di-facebook { - margin:0; +.upgrade_menu_link { + font-weight: 900; + color: #d54e21; + font-size: 105%; } -.aiosp-di .dashicons.di-facebook:before { - content:"\f304"; - font-size:52px; + +label[for=aioseop_edit_profile_header] +{ + font-size: 1.3em; } -.aiosp-di .dashicons.di-twitter:before { - content:"\f301" + +#aioseop_edit_profile_header { + display: none; } -.aiosp-di .dashicons.di-facebook { - color: #3B5998; + +.ui-tooltip.ui-widget.ui-corner-all.ui-widget-content.aioseop-ui-tooltip { + font-family: 'Open Sans', sans-serif; + -webkit-box-shadow: 0px 1px 6px -2px #0073AA; + box-shadow: 0px 1px 6px -2px #0073AA; + border: 0px; + border-radius: 0px; + background: #FEFEFE; } -.aiosp-di .dashicons.di-twitter { - width: 36px; - background-color:#00aced; - border-radius:2px; + +.ui-tooltip.ui-widget.ui-corner-all.ui-widget-content.aioseop-ui-tooltip a { + color: #0073AA; + text-decoration: none; } -.upgrade_menu_link { - font-weight: 900; - color: #d54e21; - font-size: 105%; + +.ui-tooltip.ui-widget.ui-corner-all.ui-widget-content.aioseop-ui-tooltip dt { + font-weight: bold; } diff --git a/css/font-icons/aioseop.eot b/css/font-icons/aioseop.eot new file mode 100644 index 000000000..b9986cac5 Binary files /dev/null and b/css/font-icons/aioseop.eot differ diff --git a/css/font-icons/aioseop.svg b/css/font-icons/aioseop.svg new file mode 100644 index 000000000..f4aee92bb --- /dev/null +++ b/css/font-icons/aioseop.svg @@ -0,0 +1,24 @@ + + + +Generated by Fontastic.me + + + + + + + + + + + + + + + + + + + + diff --git a/css/font-icons/aioseop.ttf b/css/font-icons/aioseop.ttf new file mode 100644 index 000000000..c023614c1 Binary files /dev/null and b/css/font-icons/aioseop.ttf differ diff --git a/css/font-icons/aioseop.woff b/css/font-icons/aioseop.woff new file mode 100644 index 000000000..3a3cc3c30 Binary files /dev/null and b/css/font-icons/aioseop.woff differ diff --git a/css/index.php b/css/index.php new file mode 100644 index 000000000..b41274d0a --- /dev/null +++ b/css/index.php @@ -0,0 +1,5 @@ + .aioseop_right_sidebar.aioseop_options_wrapper { + margin: 30px 0 0 0; +} \ No newline at end of file diff --git a/css/modules/aioseop_module.css b/css/modules/aioseop_module.css index 99add05a7..ce6ce06fa 100644 --- a/css/modules/aioseop_module.css +++ b/css/modules/aioseop_module.css @@ -27,8 +27,8 @@ .aioseop_help_text_link:active { text-align: left; float: left; - max-width: 300px; - min-width: 1px; + max-width: 30px; + min-width: 20px; padding-top: 2px; outline: none; color: #888; @@ -42,9 +42,10 @@ .aioseop_help_text_link:before { content: "\f223"; - font-size: 27px; + font-size: 22px; font-family: dashicons; vertical-align: middle; + margin-right: 4px; } #aioseop-support .aioseop_metabox_text, @@ -54,63 +55,11 @@ text-decoration: none; } -.aioseop_icon { - display: inline-block; - width: 40px; - height: 40px; - background-repeat: no-repeat; - background-size: 100%; - vertical-align: middle; - margin: 10px; -} - -.aioseop_book_icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAKlBMVEUAAAAAn+cAneEAnuABnuEBnuEAnuEAn+QAn+QAneAAnuEAneAAnuAAneFPI9ocAAAADnRSTlMAII/P/wCQMADwANDvnyPbz6kAAAB9SURBVHgB7c+xCQMgEIVhZwiSSRzhkRBImsA5gVUmuBGcJbUDxlhY6T2wvh/sPvBd+HdJWCSj0N8bsEEiIIOAyEBhIDGAcwA4cDBy4MDBTeuqCR5abXCvBHy+6ybQrs2R0jsH/As+srEzC55qggi81AIZ+waQxkBmQK5tD34LnXJVZf9y5gAAAABJRU5ErkJggg==); -} - -.aioseop_cog_icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAeFBMVEUAAAAAn+MAnOIAn+cAneIAneEAn+MAnuEAneIAnuAAnuAAneEAn+cAn+QAn98AnuEAn98AneAAneEAneAAnOIAnuAAnuEAnuAAneEAn+EAnuEAnuAAneEAneAAneAAn+QAnuEAnuABnuEAneAAn+EAnuIAnuMBnuHeY3dlAAAAJ3RSTlMAQFAAYIAAkADP3wAgMACgEACfrwC/X++PbwAAcODwALDAANAATz8hP00ZAAACHklEQVR4Xq3XbWObIBAHcPAJJRjJVmtso4vL2vv+33AzJO2J/LuE9PfGFyR4HHiAgCQxyRMiYEtGTL5BBGzJiVEviIAtFTH6FRGowdBC/QsQqKGhhebeIdTkqe+LwFbkqew2SGyDftDKz12Q2AXYlhgeA46AD/G5oyD9zJO0zIEhvXd91L0mSPcmnZlek0nPhHu4mKu2ov+q2rZzOWE5kBRBFjNRzDRFqD6X8oGiHK5fo+0oSmcv06goknLfQk3RzHkaWwIGlUhrZaIGAto5iQn6uyw+yAFOpSgUTDEHJqqZc5DR2rgqw8lIa7mbRkkMLOOBoWZlWYrynwzGzx1C/3cdlEcvf7sgL5MTq8rGz22QNwjDP+cGBYBDOC6qcnLTNqQCeRbuYdEU4In47YjL84RSwEk+Tq8qT7xvhMc5eXsj78Buga866O4dQrXs4OEk3jaNTWC1Cfc43nSa0MQ0fCFFLWXL9saWFjQMgFOfEUR+zsl1KWeRBaWr3e7c01q3Lmld+FfiSVFQ/2ehp6B8IzaorGvJ8q8Jl/ViIkDv396tfX/bawKm81J+eGtLH91cX+xIUUZ7XYmPHTBmA0U4feMh6zqVwzTe8ubQvmBoUJeDphoIGtT5tVaq0Ttopvyom4M4xqz8YGXhiCLAnIKhg8N2iA30cLzrxmJH/H4cASejrjzcFHXpwrcukwIiRQZv2QICtjQP352/9fYuC+Qv593CTVvcgwkAAAAASUVORK5CYII=); -} - -.aioseop_file_icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAPFBMVEUAAAAAneAAn98AneIAneEAnuAAn+QAnuAAnuAAnuEAn+MAnuEAneAAnuEAn+EAneEAnOIAnuEAnuABnuG5yOaaAAAAE3RSTlMA0BBgn88wv++gQLCvX2+PUJDAyp/15gAAALdJREFUeF7t1z2ygzAMhVFJjm0C5Ff732uaMCSWCVzTJO/paz1zRsVtTM/OUT+Wx5PQchJ1Q2O/CETdVk51IOjWugAeYLvUAEU6rAO4oLhQB2bSvh+NAAKU2AgYQGIEDHgXbjhQCFcYKIQuoUApZBQwQg8CRhhAwArSBlCagNAI0LTqAQCq3fcC+jOA7e8DDuhK/wDwHfgOfAe+A98B2BcC3Aaw+XiCBdp3AtOcNAgs9FoACZ7ufwCe6pfMGb29UwAAAABJRU5ErkJggg==); -} - -.aioseop_help_icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAflBMVEUAAAAAn98AnuIAn+EAneAAnuAAnuAAn+QAn+QAneEAnuAAnuAAn+EAnuAAnuEAneAAn+cAneAAnuAAn98AnOIAnuEAneIAn+MAnuEAnuEAn+EAneIAneEAneEAnuEAn+MAneAAneEAnuMAnOIAn+cAneEBnuEAneAAnuMBnuEoGewkAAAAKXRSTlMAEE9/r7/fADCPzwBv718AIPDAAFCwYEAAoAAAn4CQAOAAPwAAcADQAFP96WQAAAMNSURBVHhelZcNc5swDIatBghpoCGEj9Jij2XLMv3/P7glkoNtZJo+d+0lhBOveSXZUjHgZZOkGf4nS5PNC5wiKPFqvnvFgNddvpVQy0tQZCiSFfCEAtiUGKXcwFcB3kpcpXx791HetypFn2NdH9EnrX67KPdL46g/tl3PeqHvWidM2fxyUM7n3fzgof8R0A9zjN3PGTV/HB+6teg66EeIUQqQIGOiSQMGmeRgUQfGPn/Ktyv0k9UQKrCxWzitAq3V6dvYIDG8f8mAROO6ULF/3ecTaHazcvIgjTw/PxfFeVFErCHd31C3fx2v39cKGy6qLKyA1tGr/v8BLWDyb3OLqiw+XGCiq8DFxIvypMKIHqMXvaeLmmyEkn1xSTCAjWcMS7gruFD+eo/QuEC7AYCy+nJXkC1/r5A4Gq2NrQCvjMnL7OZCLggY3KoAI5jMEvKt2hohBYK3wiveuwx8i3qn/uvVf0O2Hh5MnLwOZMTrXgGt4OCi7RuyXNg1F1oDqEZIQh2K6oUALalSWqgiIwUIM4VVqZZvdlkE7QQFFLRVNS3l5NLZarMkgkx6ebWiNPqzSu9nEkM2KDZhjbykh+19KKri3+LkIxLhVlE/E4CaAjsd4AYo9zJkR9huGF7CtPYSX9FyXG4XFHe2UQIt9fIGa6NNJBErX2r35O0wp7KEbZYSNpVtMYngSpbZYoI1G9YClFzOp+vKS6jviLFJ+fWgDralfZO5peW2xX8LKB9NdTtxsQuc7/wV0OTv/YRyiUuIugCls7FwizffsXHgzcRurjEjYgH8zdVKyODZJUDGAuxZubNnt5BIgMQ7YNyowy2c0XfCqyNX6HzE2Ve8A28+nmDDHaJyD9sNChpkxvCYRxgkEjitAkl40AzPjxm7KdNnSAzLgaNFZhcVATtkBmliGaTJSJ6mBnnkMWgpx+XAMZZoMbGZqXEHm6Q4sxA4F4k7DEkjD1PVGJCmGFDLQ5elO+Iqx7B/q88A0FKI+DSlBLMuE4pMF3h6+DZXDLia6PAtA41u67uUqW51E02uf46zvXx+HY4YAAAAAElFTkSuQmCC); -} - -.aioseop_support_icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAe1BMVEUAAAAAn98AnuIAn+EAneAAnuAAnuABnuEAn98An+QAneEAnuAAn+QAn+EAnuAAnuEAneAAnuEAneIAn+MAn+cAn+cAnuEAnuEAnOIAneEAneEAnOIAnuAAneEAn+MAneAAneEAneIAnuEAnuIAneAAnuAAneABnuEAnuPdwDkgAAAAKXRSTlMAEE9/r7/f/wAwj88Ab+9f0JBgQCAAALBQcAAAAJ8AAIAAoADgwPAAP4Dl7rAAAALsSURBVHgBtdcBc6I6EAfwRCH/KjUSTCW2eHK8kHff/xM+Dg5NlsTTOu830xmc0BhJdtllKXy1znKBgciz9Yq/JbC3mM22AFFsN+8x7H2B7wSixI4/sAK+lkiSa/63CfbXfy9VddAfA32oVHmdYn8MsaNP55jUhpOFmRqTXH/4mP/BSExOnxEnTKT58jDveouZaCIEZltvWna7POPm8GPhgJtzbIIMnvq4UMOTXWZsvjgjoD8IjcCZrkAh1H4SLUIq3EYDQjSEBGH8XdASVPUzUIGS2jsHORbyJpC8gzWDChGaPsL4ItnwxyUiuuPqnBdAkW9X/3SIkPxPMLWIkZJcL7XTNnKJb5J8XMEJ33YaVyCQYJUZ0tjGKIsE8XsXNuNUFpStvFMQGR4Xvhlyoppi51AjUAcZhdPRIVzr8UCzYzEfS91afxOJDle2Hc9IBaBoGMdg/raq/3s49/NPm/6TGQDl5Up3DoCN5G9uAbjOO6AlAMPa8Zd4JI0kP55k41EAWlaT+w0Ae4mytyAenQDUrCcZsCMr8igydADQM0ECrydf4zEA+uZGAygYBv96ivF4RG3GffNgsJiAfr439v9MUN7/CeXFgwGzrz1Eu9hG9eQ2Rg+SaKJE5CB1y6Ps7h1ld/FMR9mEm6vPEoCIBZMAIM/e8xoTQRjO+5y8fT0ZJvlc5PwJ57fymlDWMloBLKoHsb4mlPLCLnNKyxDIwpRGR72UtsEgUhoKrx7bR4Z3c1J9Tyft7ep3Wl9t04l/rFBefrFwh29y/N7L1TlynXy5JpbQHY3qS6Dslfnq4guYa+UXC4xBj4W+CSTvYFMEuOeLLKf9Ytssd5hw6TJv9FKhOeqeK3W7ZcNRP1Nsd7GOpXu83O/iLY8ij5CwmKlUz2TcIy2PIy2PT/eYZLRV5fsMk542XaHK3VrV/a+p7fu1uzWyjiZs9pPgrUOSa6ONJ8FPFlH2xB9uvlUJolTJ5juOm7buLQa2r1uvkSX+A/xd+1xZLxG0AAAAAElFTkSuQmCC); -} - -.aioseop_youtube_icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAARVBMVEUAAAAAn+cAn+EAneAAnuABnuEAn+cAn98AneEAn98AnOIAnuAAnOIAneIAneIAnuEAnuEAneEAnuEBnuEAn+QAneAAneCXjc90AAAAF3RSTlMAIG+vz/8AEJ8AUO8AYACgAHCwADDw0E/SOHoAAAEBSURBVHgB7dbBjsIgGATgH+UvCAso3fL+j7rDYZMerGGZQ5NNv8TrREZLRy47F3O7Wx1m7zezAMjSOa9/5t2jkweEqBNi+ALBJ+mklHOWnINOC/0buKjTokMHRQnlKUYpRl5HBQ32KFXfW783HVDFHgWsrg0EWNEDK4z0+yEAEhuAIsgAFMEFQOECILEBKIIMQBFcABQuABIbgCLIABTBBUBhAzx5BEuWGM/9GT35V7bkwxTPfZw9eaVZ8lKN517rI8NHmr43cPyufXi5Rh1Q+dc7PTAWduI83abTNteHJjvz6KEJYeoU2+/UBVcm+tuNbTCv2nRYq2k/9ylXwL8I+AGj+lzlceKDYQAAAABJRU5ErkJggg==); -} - .aioseop_meta_box_help > label { position: absolute; margin-left: 8px; } -div.aioseop_tip_icon { - font-size: 14px; - border: 1px solid #888; - width: 1em; - text-align: center; - padding: 0 4px; - -webkit-border-radius: 12px; - -moz-border-radius: 12px; - -webkit-box-shadow: 1px 1px 1px #888; - -moz-box-shadow: 1px 1px 1px #888; - box-shadow: 1px 1px 1px #888; - border-radius: 12px; -} - -div.aioseop_tip_icon:before { - content: '?'; -} - .aioseop_help_text_link img { width: 40px; float: left; @@ -120,6 +69,8 @@ div.aioseop_tip_icon:before { .aioseop_meta_box_help:active { float: right; text-align: right; + min-width: 56px; + max-width: 90px; text-decoration: none; height: 15px; padding-top: 1px; @@ -138,15 +89,18 @@ div.aioseop_tip_icon:before { .aioseop_label { color: #5F5F5F; - font-weight: bold; + font-weight: 600; line-height: 19px; display: inline-block; + float: left; text-align: left; - position: absolute; - font-family: 'Open Sans', sans-serif; - width: 26%; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif; + padding: 2px 0; + width: 81%; min-width: 120px; - max-width: 230px; + max-width: 250px; + cursor: default; + font-size: 13.5px; } .aioseop_option_div { @@ -162,8 +116,8 @@ div.aioseop_tip_icon:before { .aioseop input[type="text"], .aioseop input[type="url"] { color: #515151; - height: 35px; - padding: 10px 0 10px 10px; + min-height: 35px; + padding: 10px; font-size: 14px; width: 95%; max-width: 600px; @@ -171,12 +125,40 @@ div.aioseop_tip_icon:before { .aioseop textarea { color: #515151; - padding: 10px 0 0 10px; - margin: 0; + padding: 10px; + margin: 1px; font-size: 14px; line-height: 25px; width: 95%; max-width: 600px; + min-height: 36px; +} + +.aioseop input, textarea { + border-radius: 4px; + border: 1px solid #8d96a0; + margin: 1px; + font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important; +} + +.aioseop input:focus, textarea:focus { + box-shadow: 0 0 0 1px #007cba; +} + +.aioseop textarea::-webkit-scrollbar { + width: 12px; +} + +.aioseop textarea::-webkit-scrollbar-track { + background: #f1f1f1; +} + +.aioseop textarea::-webkit-scrollbar-thumb { + background: #aeaeae; +} + +.aioseop textarea::-webkit-scrollbar-thumb:hover { + background: #888; } .aioseop_help_text_div { @@ -209,6 +191,7 @@ div.aioseop_tip_icon:before { sans-serif; border-bottom: 1px solid #CCC; width: 100%; + margin: 8px 0 0 0; } .aioseop_head_nav_tab { @@ -298,6 +281,7 @@ div.aioseop_tip_icon:before { Times, serif; font-weight: normal; + min-height: 18px; padding: 7px 10px; margin: 0; line-height: 1; @@ -364,16 +348,16 @@ div.aioseop_tip_icon:before { .aioseop_option_label { float: left; margin: 0; - min-width: 150px; - width: 37%; - max-width: 270px; padding-top: 3px; padding-bottom: 3px; - height: 67px !important; /*added for certain language support*/ + width: 37%; + min-width: 150px; + max-width: 360px; + min-height: 30px; } .aioseop_metabox_text h2 { - font-size: 14px; + font-size: 30px; padding: 0; font-weight: bold; line-height: 29px; @@ -402,7 +386,7 @@ div.aioseop_tip_icon:before { .aioseop input[readonly] { background-color: #EEE; - margin: 5px 0 5px 0 !important; + margin: 5px 1px 5px 1px !important; } .aioseop_settings_left { @@ -445,7 +429,7 @@ body.all-in-one-seo_page_all-in-one-seo-pack-pro-aioseop_feature_manager .aioseo .aioseop_right_sidebar { float: right; - margin-top: 35px; + margin-top: 55px; } #aiosp_settings_form .button-primary.hidden { @@ -470,7 +454,7 @@ form#edittag div#aiosp_sitemap_exclude_wrapper { } .All_in_One_SEO_Pack_Feature_Manager > .aioseop_right_sidebar.aioseop_options_wrapper { - margin-top: 10px; + margin-top: 30px; } div#aiosp_feature_manager_metabox .inside { @@ -490,7 +474,7 @@ div.aioseop_feature { -webkit-border-radius: 3px; border-radius: 3px; background: white; - padding: 10px 0 0; + padding: 10px 0; -webkit-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1); @@ -584,8 +568,9 @@ div.aioseop_feature { .aioseop_feature .feature_button { float: right; - margin-bottom: 10px; - margin-right: 10px; + display: inline-block; + position: relative; + margin: 0 10px 10px 0; min-width: 80px; text-align: center; } @@ -799,9 +784,9 @@ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image { .aioseop_input { clear: left; - width: 100%; - padding: 5px; - display: inline; + width: 98%; + padding: 5px 1%; + display: inline-block; } .aioseop_option_input { @@ -839,15 +824,6 @@ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image { padding: 0; } -#aiosp_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_input, -#aiosp_video_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_input { - display: inline-block; - vertical-align: middle; - width: 25%; - min-width: 120px; - height: 70px; -} - #aiosp_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_top_label, #aiosp_video_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_top_label { width: 70%; @@ -888,6 +864,18 @@ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image { margin: 5px 5px 10px; } +/*** Sitemap Exclude Items section ***/ +.selectize-control.aioseop-exclude-terms { + position: static; + width: 95%; + max-width: 600px; +} + +.selectize-input { + padding: 10px 0 10px 10px !important; + border: 1px solid #8d96a0 !important; +} + table.aioseop_table tr:nth-child(odd) { background-color: #EEE; } @@ -976,7 +964,7 @@ table.aioseop_table td, table.aioseop_table th { } #aiosp_settings_form .postbox { - margin: 0 0 20px 0; + margin: 20px 0 0 0; } .aioseop_settings_left .postbox { @@ -1039,7 +1027,6 @@ table.aioseop_table td, table.aioseop_table th { float: left; width: 92%; max-width: 100%; - margin: 0 23px 0 13px; } #aiosp_sitemap_status_metabox .handlediv.button-link { @@ -1088,10 +1075,29 @@ table.aioseop_table td, table.aioseop_table th { .aioseop_input input[type="checkbox"], .aioseop_input input[type="radio"] { + border: 1.25px solid #6c7781; vertical-align: text-bottom; margin-top: 8px; } +.aioseop_input input[type="checkbox"]:before { + margin: -3px 0 0 -5px; + color: white; +} + +.aioseop_input input[type="radio"] { + border-radius: 8px; +} + +.aioseop_input input[type="radio"]:before { + content: none !important; +} + +.aioseop_input input[type="radio"]:checked, +.aioseop_input input[type="checkbox"]:checked { + background: #11a0d2; +} + #aiosp_importer_exporter_import_export_help_wrapper .aioseop_option_div { max-height: initial; } @@ -1185,7 +1191,8 @@ div.aioseop_notice a.aioseop_dismiss_link { } .aioseop_input select { - margin: 7px 0; + border-radius: 4px; + border: 1px solid #8d96a0; } .aioseop_help_text ul { @@ -1201,60 +1208,22 @@ div.aioseop_notice a.aioseop_dismiss_link { width: 98%; } -.aioseop_tabs { - padding-top: 6px; -} - -.aioseop_tabs.hide, -.aioseop_header_tabs.hide { - display: block !important; -} - -.aioseop_header_tabs li { - display: inline; - padding: 0; - margin: 0; -} - -.aioseop_header_tabs { - margin: 0; -} - -.aioseop_header_nav { - margin: 0; -} - -.aioseop_header_tabs li a.aioseop_header_tab.active { - background-color: rgb(255, 255, 255); - border-bottom-color: rgba(255, 255, 255, 0.5); - font-weight: bold; -} - .aioseop_header_tabs li a.aioseop_header_tab { font-size: 14px; line-height: 37px; text-decoration: none; - margin: 5px 5px 0 0; - padding: 10px; cursor: pointer; -webkit-border-top-right-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-right-radius: 3px; border-top-left-radius: 3px; - background-color: #e5e5e5; - border: 1px solid #ccc; + border-bottom: none !important; + padding: 0em 0.5em !important; color: #5F5F5F; -} - -.aioseop_header_tabs li:first-child a.aioseop_header_tab { - border-left: solid 1px #CCC; - margin-left: 5px; + font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important; } .aioseop_tab { - border: solid 1px #CCC; - background-color: rgb(255, 255, 255); - background-color: rgba(255, 255, 255, 0.5); padding: 10px; } @@ -1268,6 +1237,48 @@ div.aioseop_notice a.aioseop_dismiss_link { vertical-align: bottom; } +.aioseop_tabs.ui-widget-content { + background: none !important; +} + +.aioseop_tab.ui-widget-content { + border: 1px solid #aaa !important; +} + +.aioseop_tab.ui-widget-content a.aioseop_help_text_link { + color: #888 !important; +} + +.aioseop_tabs.ui-widget { + font-size: 13px !important; + border: none !important; +} + +.aioseop_tabs .ui-widget-header { + border: none !important; + background: none !important; + border-bottom-right-radius: 0px !important; + border-bottom-left-radius: 0px !important; +} + +.aioseop_tabs ul { + margin-left: .2em !important; +} + +.aioseop_tabs .ui-tabs .ui-tabs-panel { + border-width: inherit !important; +} + +.aioseop_tabs .ui-state-default, +.aioseop_tabs .ui-widget-content .ui-state-default, +.aioseop_tabs .ui-widget-header .ui-state-default { + background-image: none !important; +} + +.aioseop_tabs .ui-state-active a { + font-weight: bold !important; +} + .aiosp_delete { background-image: url('../../images/delete.png'); display: inline-block; @@ -1376,7 +1387,6 @@ div.sfwd_debug_error { } .postbox-container .aioseop_input { - display: block; margin-bottom: 10px; padding: 0; } @@ -1424,19 +1434,30 @@ div.sfwd_debug_error { * */ div#aiosp_snippet_wrapper { - border: 1px solid #888; - clear: both; - padding: 10px 10px 0; - max-width: 97%; - margin-bottom: 15px; + border-radius: 4px; + border: 1px solid #8d96a0; + clear: both; + padding: 10px 10px 0; + max-width: 97%; + margin-bottom: 15px; +} + +#aiosp_snippet_wrapper > .aioseop_input:first-child { + margin-bottom: 0px; } div#aiosp_snippet_wrapper .aioseop_option_label { height: auto !important; } +#aiosp_snippet_wrapper > .aioseop_input:first-child .aioseop_option_label { + padding: 0; + min-height: inherit; +} + div#aiosp_snippet_wrapper .aioseop_input.aioseop_top_label .aioseop_option_input { margin: 0; + width: 99%; } div#aioseop_snippet { @@ -1494,11 +1515,60 @@ div#aioseop_snippet > div > span { } textarea.robots-text { + color: black; background-color: #eee; - width: 100%; height: 100%; + margin: 0 0 0 10px; } div#aiosp_sitemap_status_metabox .toggle-indicator { display:none; } + +.required.email { + border-radius: 4px; + border: 1px solid #8d96a0; + margin: 1px; + font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important; +} + +.ui-sortable-handle span { + font-size: 16px; + font-weight: 600; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif; + color: black; +} + +.aioseop_file_upload { + border: none !important; +} + +.aioseop_upload_image_button { + float: left; + margin: 0 0 5px 0 !important; +} + +.aioseop_delete_files_button { + margin: 0 5px 10px 0 !important; +} + +.aioseop_rename_files_button { + margin: 0 0 10px 0 !important; +} + +.aioseop_update_options_button, +.aioseop_reset_settings_button { + margin: 10px 0 0 0 !important; +} + +#aiosp_robots_default_metabox .aioseop_option_label { + margin-left: 10px; +} + +#aiosp_robots_default_metabox .add-edit-rule { + margin-left: 5px; +} + +#aiosp_file_editor_htaccess_metabox { + margin: 0 !important; +} diff --git a/css/modules/index.php b/css/modules/index.php new file mode 100644 index 000000000..3c379e183 --- /dev/null +++ b/css/modules/index.php @@ -0,0 +1,4 @@ +