All in One SEO Pack - Version 3.0

Version Description

Download this release

Release Info

Developer hallsofmontezuma
Plugin Icon 128x128 All in One SEO Pack
Version 3.0
Comparing to
See all releases

Code changes from version 2.12.1 to 3.0

Files changed (74) hide show
  1. admin/aioseop_module_class.php +76 -80
  2. admin/class-aioseop-helper.php +1062 -0
  3. admin/class-aioseop-notices.php +842 -0
  4. admin/display/credits-content.php +60 -58
  5. admin/display/dashboard_widget.php +1 -1
  6. admin/display/general-metaboxes.php +28 -18
  7. admin/display/menu.php +20 -1
  8. admin/display/notice-aioseop.php +34 -0
  9. admin/display/notice-default.php +34 -0
  10. admin/display/notices/blog-visibility-notice.php +49 -0
  11. admin/display/notices/index.php +4 -0
  12. admin/display/notices/review-plugin-notice.php +48 -0
  13. admin/display/notices/sitemap-indexes-notice.php +44 -0
  14. admin/display/notices/wc-detected-notice.php +45 -0
  15. admin/display/welcome-content.php +33 -5
  16. admin/display/welcome.php +16 -4
  17. admin/meta_import.php +23 -6
  18. aioseop_class.php +391 -725
  19. all_in_one_seo_pack.php +72 -12
  20. css/admin-notice.css +22 -0
  21. css/aioseop-font-icons-rtl.css +8 -0
  22. css/aioseop-font-icons.css +198 -0
  23. css/aiosp_admin.css +26 -90
  24. css/font-icons/aioseop.eot +0 -0
  25. css/font-icons/aioseop.svg +24 -0
  26. css/font-icons/aioseop.ttf +0 -0
  27. css/font-icons/aioseop.woff +0 -0
  28. css/index.php +5 -0
  29. css/modules/aioseop_module-rtl.css +45 -9
  30. css/modules/aioseop_module.css +208 -138
  31. css/modules/index.php +4 -0
  32. css/welcome.css +3 -3
  33. images/index.php +5 -0
  34. images/shield-sprite-16.png +0 -0
  35. images/shield-sprite-32.png +0 -0
  36. images/shield32.png +0 -0
  37. images/shield32fade.png +0 -0
  38. images/shield64.png +0 -0
  39. inc/aioseop_functions.php +171 -55
  40. inc/aioseop_updates_class.php +57 -2
  41. inc/commonstrings.php +88 -39
  42. inc/compatability/abstract/index.php +5 -0
  43. inc/compatability/compat-init.php +8 -0
  44. inc/compatability/index.php +5 -0
  45. inc/extlib/index.php +5 -0
  46. inc/sitemap-xsl.php +5 -5
  47. inc/translations.php +39 -24
  48. js/admin-notice.js +118 -0
  49. js/admin-notice.min.js +1 -0
  50. js/aioseop-helper.js +65 -0
  51. js/aioseop-helper.min.js +1 -0
  52. js/aioseop-menu.js +20 -0
  53. js/aioseop-menu.min.js +1 -0
  54. js/index.php +5 -0
  55. js/modules/aioseop_module.js +4 -25
  56. js/modules/aioseop_module.min.js +1 -1
  57. js/modules/aioseop_sitemap.js +13 -0
  58. js/modules/aioseop_sitemap.min.js +1 -0
  59. js/modules/index.php +5 -0
  60. js/plugins-menu.js +20 -0
  61. js/plugins-menu.min.js +1 -0
  62. js/quickedit_functions.js +2 -4
  63. js/quickedit_functions.min.js +1 -1
  64. modules/aioseop_bad_robots.php +0 -16
  65. modules/aioseop_feature_manager.php +3 -2
  66. modules/aioseop_file_editor.php +0 -8
  67. modules/aioseop_importer_exporter.php +7 -21
  68. modules/aioseop_opengraph.php +1924 -1891
  69. modules/aioseop_performance.php +20 -35
  70. modules/aioseop_robots.php +0 -13
  71. modules/aioseop_sitemap.php +530 -303
  72. modules/images/index.php +5 -0
  73. public/js/vendor/index.php +5 -0
  74. readme.txt +3 -3
admin/aioseop_module_class.php CHANGED
@@ -566,7 +566,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
566
  'EmailSiphon',
567
  'EmailWolf',
568
  'EroCrawler',
569
- 'Exabot',
570
  'ExtractorPro',
571
  'Fasterfox',
572
  'FeedBooster',
@@ -839,7 +838,11 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
839
  * @return array
840
  */
841
  function get_post_type_titles( $args = array() ) {
842
- return $this->get_object_labels( get_post_types( $args, 'objects' ) );
 
 
 
 
843
  }
844
 
845
  /**
@@ -852,12 +855,19 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
852
  }
853
 
854
  /**
855
- * @param array $args
 
 
 
856
  *
 
 
 
 
857
  * @return array
858
  */
859
- function get_category_titles( $args = array() ) {
860
- return $this->get_term_labels( get_categories( $args ) );
861
  }
862
 
863
  /**
@@ -1204,8 +1214,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1204
  * @return bool
1205
  */
1206
  function save_file( $filename, $contents ) {
1207
- $failed_str = sprintf( __( "Failed to write file %s!\n", 'all-in-one-seo-pack' ), $filename );
1208
- $readonly_str = sprintf( __( "File %s isn't writable!\n", 'all-in-one-seo-pack' ), $filename );
1209
  $wpfs = $this->get_filesystem_object();
1210
  if ( is_object( $wpfs ) ) {
1211
  $file_exists = $wpfs->exists( $filename );
@@ -1235,12 +1245,12 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1235
  if ( is_object( $wpfs ) ) {
1236
  if ( $wpfs->exists( $filename ) ) {
1237
  if ( $wpfs->delete( $filename ) === false ) {
1238
- $this->output_error( sprintf( __( "Failed to delete file %s!\n", 'all-in-one-seo-pack' ), $filename ) );
1239
  } else {
1240
  return true;
1241
  }
1242
  } else {
1243
- $this->output_error( sprintf( __( "File %s doesn't exist!\n", 'all-in-one-seo-pack' ), $filename ) );
1244
  }
1245
  }
1246
 
@@ -1262,15 +1272,15 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1262
  $newfile_exists = $wpfs->exists( $newname );
1263
  if ( $file_exists && ! $newfile_exists ) {
1264
  if ( $wpfs->move( $filename, $newname ) === false ) {
1265
- $this->output_error( sprintf( __( "Failed to rename file %s!\n", 'all-in-one-seo-pack' ), $filename ) );
1266
  } else {
1267
  return true;
1268
  }
1269
  } else {
1270
  if ( ! $file_exists ) {
1271
- $this->output_error( sprintf( __( "File %s doesn't exist!\n", 'all-in-one-seo-pack' ), $filename ) );
1272
  } elseif ( $newfile_exists ) {
1273
- $this->output_error( sprintf( __( "File %s already exists!\n", 'all-in-one-seo-pack' ), $newname ) );
1274
  }
1275
  }
1276
  }
@@ -1658,58 +1668,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1658
  return false;
1659
  }
1660
 
1661
-
1662
- /**
1663
- * @param $default_options
1664
- * @param $options
1665
- * @param string $help_link
1666
- */
1667
- function help_text_helper( &$default_options, $options, $help_link = '' ) {
1668
- foreach ( $options as $o ) {
1669
- $ht = '';
1670
- if ( ! empty( $this->help_text[ $o ] ) ) {
1671
- $ht = $this->help_text[ $o ];
1672
- } elseif ( ! empty( $default_options[ $o ]['help_text'] ) ) {
1673
- $ht = $default_options[ $o ]['help_text'];
1674
- }
1675
- if ( $ht && ! is_array( $ht ) ) {
1676
- $ha = '';
1677
- $hl = $help_link;
1678
- if ( strpos( $o, 'ga_' ) === 0 ) { // special case -- pdb
1679
- $hl = 'https://semperplugins.com/documentation/advanced-google-analytics-settings/';
1680
- }
1681
- if ( ! empty( $this->help_anchors[ $o ] ) ) {
1682
- $ha = $this->help_anchors[ $o ];
1683
- }
1684
- if ( ! empty( $ha ) && ( $pos = strrpos( $hl, '#' ) ) ) {
1685
- $hl = substr( $hl, 0, $pos );
1686
- }
1687
- if ( ! empty( $ha ) && ( $ha[0] == 'h' ) ) {
1688
- $hl = '';
1689
- }
1690
- if ( ! empty( $ha ) || ! isset( $this->help_anchors[ $o ] ) ) {
1691
- $ht .= "<br /><a href='" . $hl . $ha . "' target='_blank'>" . __( 'Click here for documentation on this setting', 'all-in-one-seo-pack' ) . '</a>';
1692
- }
1693
- $default_options[ $o ]['help_text'] = $ht;
1694
- }
1695
- }
1696
- }
1697
-
1698
- function add_help_text_links() {
1699
- if ( ! empty( $this->help_text ) ) {
1700
- foreach ( $this->layout as $k => $v ) {
1701
- $this->help_text_helper( $this->default_options, $v['options'], $v['help_link'] );
1702
- }
1703
- if ( ! empty( $this->locations ) ) {
1704
- foreach ( $this->locations as $k => $v ) {
1705
- if ( ! empty( $v['default_options'] ) && ! empty( $v['options'] ) ) {
1706
- $this->help_text_helper( $this->locations[ $k ]['default_options'], $v['options'], $v['help_link'] );
1707
- }
1708
- }
1709
- }
1710
- }
1711
- }
1712
-
1713
  /**
1714
  * Load scripts and styles for metaboxes.
1715
  * edit-tags exists only for pre 4.5 support... remove when we drop 4.5 support.
@@ -1771,9 +1729,12 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1771
  * Add hook in \All_in_One_SEO_Pack_Module::add_page_hooks - Function itself is hooked based on the screen_id/page.
1772
  *
1773
  * @since 2.9
 
1774
  *
1775
  * @see 'admin_enqueue_scripts' hook
1776
  * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
 
 
1777
  *
1778
  * @param string $hook_suffix
1779
  */
@@ -1786,6 +1747,18 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1786
  if ( function_exists( 'is_rtl' ) && is_rtl() ) {
1787
  wp_enqueue_style( 'aioseop-module-style-rtl', AIOSEOP_PLUGIN_URL . 'css/modules/aioseop_module-rtl.css', array( 'aioseop-module-style' ), AIOSEOP_VERSION );
1788
  }
 
 
 
 
 
 
 
 
 
 
 
 
1789
  }
1790
 
1791
  /**
@@ -1799,6 +1772,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1799
  * @since ?
1800
  * @since 2.3.12.3 Add missing wp_enqueue_media.
1801
  * @since 2.9 Switch to admin_enqueue_scripts; both the hook and function name.
 
1802
  *
1803
  * @see 'admin_enqueue_scripts' hook
1804
  * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
@@ -1809,6 +1783,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1809
  public function admin_enqueue_scripts( $hook_suffix ) {
1810
  wp_enqueue_script( 'sack' );
1811
  wp_enqueue_script( 'jquery' );
 
1812
  wp_enqueue_script( 'media-upload' );
1813
  wp_enqueue_script( 'thickbox' );
1814
  wp_enqueue_script( 'common' );
@@ -1830,6 +1805,14 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1830
  wp_enqueue_media();
1831
  }
1832
 
 
 
 
 
 
 
 
 
1833
  // AIOSEOP Script enqueue.
1834
  wp_enqueue_script(
1835
  'aioseop-module-script',
@@ -1837,6 +1820,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1837
  array(),
1838
  AIOSEOP_VERSION
1839
  );
 
 
 
 
 
 
 
1840
 
1841
  // Localize aiosp_data in JS.
1842
  if ( ! empty( $this->script_data ) ) {
@@ -2351,7 +2341,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
2351
  $buf .= '<input class="aioseop_upload_image_checker" type="hidden" name="' . $name . '_checker" value="0">' .
2352
  "<input class='aioseop_upload_image_button button-primary' type='button' value='";
2353
  $buf .= __( 'Upload Image', 'all-in-one-seo-pack' );
2354
- $buf .= "' style='float:left;' />" .
2355
  "<input class='aioseop_upload_image_label' name='" . esc_attr( $name ) . "' type='text' " . esc_html( $attr ) . " value='" . esc_attr( $value ) . "' size=57 style='float:left;clear:left;'>\n";
2356
  break;
2357
  case 'html':
@@ -2399,15 +2389,12 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
2399
  return $buf;
2400
  }
2401
 
2402
- const DISPLAY_HELP_START = '<a class="aioseop_help_text_link" style="cursor:pointer;" title="%s" onclick="toggleVisibility(\'%s_tip\');"><label class="aioseop_label textinput">%s</label></a>';
2403
- const DISPLAY_HELP_END = '<div class="aioseop_help_text_div" style="display:none" id="%s_tip"><label class="aioseop_help_text">%s</label></div>';
2404
- const DISPLAY_LABEL_FORMAT = '<span class="aioseop_option_label" style="text-align:%s;vertical-align:top;">%s</span>';
2405
- const DISPLAY_TOP_LABEL = "</div>\n<div class='aioseop_input aioseop_top_label'>\n";
2406
- const DISPLAY_ROW_TEMPLATE = '<div class="aioseop_wrapper%s" id="%s_wrapper"><div class="aioseop_input">%s<span class="aioseop_option_input"><div class="aioseop_option_div" %s>%s</div>%s</span><p style="clear:left"></p></div></div>';
2407
-
2408
  /**
2409
  * Format a row for an option on a settings page.
2410
  *
 
 
 
2411
  * @param $name
2412
  * @param $opts
2413
  * @param $args
@@ -2415,7 +2402,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
2415
  * @return string
2416
  */
2417
  function get_option_row( $name, $opts, $args ) {
2418
- $label_text = $input_attr = $help_text_2 = $id_attr = '';
 
 
 
2419
 
2420
  $align = 'right';
2421
  if ( $opts['label'] == 'top' ) {
@@ -2425,22 +2415,28 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
2425
  $id_attr .= " id=\"{$opts['id']}_div\" ";
2426
  }
2427
  if ( $opts['label'] != 'none' ) {
2428
- if ( isset( $opts['help_text'] ) ) {
2429
- $help_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_START, __( 'Click for Help!', 'all-in-one-seo-pack' ), $name, $opts['name'] );
2430
- $help_text_2 = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_END, $name, $opts['help_text'] );
 
2431
  } else {
2432
  $help_text = $opts['name'];
2433
  }
2434
- $label_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_LABEL_FORMAT, $align, $help_text );
 
 
 
 
2435
  } else {
2436
  $input_attr .= ' aioseop_no_label ';
2437
  }
2438
  if ( $opts['label'] == 'top' ) {
2439
- $label_text .= All_in_One_SEO_Pack_Module::DISPLAY_TOP_LABEL;
2440
  }
2441
  $input_attr .= " aioseop_{$opts['type']}_type";
2442
 
2443
- 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 );
 
2444
  }
2445
 
2446
  /**
@@ -2741,12 +2737,12 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
2741
  'page_options' => array( 'type' => 'hidden', 'value' => 'aiosp_home_description' ),
2742
  'Submit' => array(
2743
  'type' => 'submit',
2744
- 'class' => 'button-primary',
2745
  'value' => __( 'Update Options', 'all-in-one-seo-pack' ) . ' &raquo;',
2746
  ),
2747
  'Submit_Default' => array(
2748
  'type' => 'submit',
2749
- 'class' => 'button-secondary',
2750
  'value' => sprintf( __( 'Reset %s Settings to Defaults', 'all-in-one-seo-pack' ), $name ) . ' &raquo;',
2751
  ),
2752
  );
566
  'EmailSiphon',
567
  'EmailWolf',
568
  'EroCrawler',
 
569
  'ExtractorPro',
570
  'Fasterfox',
571
  'FeedBooster',
838
  * @return array
839
  */
840
  function get_post_type_titles( $args = array() ) {
841
+ $object_labels = $this->get_object_labels( get_post_types( $args, 'objects' ) );
842
+ if ( isset( $object_labels['attachment'] ) ) {
843
+ $object_labels['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' );
844
+ }
845
+ return $object_labels;
846
  }
847
 
848
  /**
855
  }
856
 
857
  /**
858
+ * Gets the category titles.
859
+ *
860
+ * @since 3.0 Changed function name from `get_category_titles` to `get_term_titles`. (#240)
861
+ * @since 3.0 Changed `get_categories()` to `get_terms()` to fetch all (custom) terms. (#240)
862
  *
863
+ * @see WP_Term_Query::__constructor()
864
+ * @link https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
865
+ *
866
+ * @param array $args An array for arguments to query by. See WP_Term_Query::__constructor() for more info.
867
  * @return array
868
  */
869
+ function get_term_titles( $args = array() ) {
870
+ return $this->get_term_labels( get_terms( $args ) );
871
  }
872
 
873
  /**
1214
  * @return bool
1215
  */
1216
  function save_file( $filename, $contents ) {
1217
+ $failed_str = sprintf( __( 'Failed to write file %s!', 'all-in-one-seo-pack' ) . "\n", $filename );
1218
+ $readonly_str = sprintf( __( 'File %s isn\'t writable!', 'all-in-one-seo-pack' ) . "\n", $filename );
1219
  $wpfs = $this->get_filesystem_object();
1220
  if ( is_object( $wpfs ) ) {
1221
  $file_exists = $wpfs->exists( $filename );
1245
  if ( is_object( $wpfs ) ) {
1246
  if ( $wpfs->exists( $filename ) ) {
1247
  if ( $wpfs->delete( $filename ) === false ) {
1248
+ $this->output_error( sprintf( __( 'Failed to delete file %s!', 'all-in-one-seo-pack' ) . "\n", $filename ) );
1249
  } else {
1250
  return true;
1251
  }
1252
  } else {
1253
+ $this->output_error( sprintf( __( "File %s doesn't exist!", 'all-in-one-seo-pack' ) . "\n", $filename ) );
1254
  }
1255
  }
1256
 
1272
  $newfile_exists = $wpfs->exists( $newname );
1273
  if ( $file_exists && ! $newfile_exists ) {
1274
  if ( $wpfs->move( $filename, $newname ) === false ) {
1275
+ $this->output_error( sprintf( __( 'Failed to rename file %s!', 'all-in-one-seo-pack' ) . "\n", $filename ) );
1276
  } else {
1277
  return true;
1278
  }
1279
  } else {
1280
  if ( ! $file_exists ) {
1281
+ $this->output_error( sprintf( __( "File %s doesn't exist!", 'all-in-one-seo-pack' ) . "\n", $filename ) );
1282
  } elseif ( $newfile_exists ) {
1283
+ $this->output_error( sprintf( __( 'File %s already exists!', 'all-in-one-seo-pack' ) . "\n", $newname ) );
1284
  }
1285
  }
1286
  }
1668
  return false;
1669
  }
1670
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1671
  /**
1672
  * Load scripts and styles for metaboxes.
1673
  * edit-tags exists only for pre 4.5 support... remove when we drop 4.5 support.
1729
  * Add hook in \All_in_One_SEO_Pack_Module::add_page_hooks - Function itself is hooked based on the screen_id/page.
1730
  *
1731
  * @since 2.9
1732
+ * @since 3.0 Added jQuery UI CSS missing from WP. #1850
1733
  *
1734
  * @see 'admin_enqueue_scripts' hook
1735
  * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
1736
+ * @uses wp_scripts() Gets the Instance of WP Scripts.
1737
+ * @link https://developer.wordpress.org/reference/functions/wp_scripts/
1738
  *
1739
  * @param string $hook_suffix
1740
  */
1747
  if ( function_exists( 'is_rtl' ) && is_rtl() ) {
1748
  wp_enqueue_style( 'aioseop-module-style-rtl', AIOSEOP_PLUGIN_URL . 'css/modules/aioseop_module-rtl.css', array( 'aioseop-module-style' ), AIOSEOP_VERSION );
1749
  }
1750
+
1751
+ // Uses WP Scripts to load the current platform version of jQuery UI CSS.
1752
+ if ( ! wp_style_is( 'aioseop-jquery-ui', 'registered' ) && ! wp_style_is( 'aioseop-jquery-ui', 'enqueued' ) ) {
1753
+ $wp_scripts = wp_scripts();
1754
+ wp_enqueue_style(
1755
+ 'aioseop-jquery-ui',
1756
+ '//ajax.googleapis.com/ajax/libs/jqueryui/' . $wp_scripts->registered['jquery-ui-core']->ver . '/themes/smoothness/jquery-ui.min.css',
1757
+ false,
1758
+ AIOSEOP_VERSION,
1759
+ false
1760
+ );
1761
+ }
1762
  }
1763
 
1764
  /**
1772
  * @since ?
1773
  * @since 2.3.12.3 Add missing wp_enqueue_media.
1774
  * @since 2.9 Switch to admin_enqueue_scripts; both the hook and function name.
1775
+ * @since 3.0 Add enqueue footer JS for jQuery UI Compatability. #1850
1776
  *
1777
  * @see 'admin_enqueue_scripts' hook
1778
  * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
1783
  public function admin_enqueue_scripts( $hook_suffix ) {
1784
  wp_enqueue_script( 'sack' );
1785
  wp_enqueue_script( 'jquery' );
1786
+ wp_enqueue_script( 'jquery-ui-tabs' );
1787
  wp_enqueue_script( 'media-upload' );
1788
  wp_enqueue_script( 'thickbox' );
1789
  wp_enqueue_script( 'common' );
1805
  wp_enqueue_media();
1806
  }
1807
 
1808
+ $helper_dep = array(
1809
+ 'jquery',
1810
+ 'jquery-ui-core',
1811
+ 'jquery-ui-widget',
1812
+ 'jquery-ui-position',
1813
+ 'jquery-ui-tooltip',
1814
+ );
1815
+
1816
  // AIOSEOP Script enqueue.
1817
  wp_enqueue_script(
1818
  'aioseop-module-script',
1820
  array(),
1821
  AIOSEOP_VERSION
1822
  );
1823
+ wp_enqueue_script(
1824
+ 'aioseop-helper-js',
1825
+ AIOSEOP_PLUGIN_URL . 'js/aioseop-helper.js',
1826
+ $helper_dep,
1827
+ AIOSEOP_VERSION,
1828
+ true
1829
+ );
1830
 
1831
  // Localize aiosp_data in JS.
1832
  if ( ! empty( $this->script_data ) ) {
2341
  $buf .= '<input class="aioseop_upload_image_checker" type="hidden" name="' . $name . '_checker" value="0">' .
2342
  "<input class='aioseop_upload_image_button button-primary' type='button' value='";
2343
  $buf .= __( 'Upload Image', 'all-in-one-seo-pack' );
2344
+ $buf .= "' />" .
2345
  "<input class='aioseop_upload_image_label' name='" . esc_attr( $name ) . "' type='text' " . esc_html( $attr ) . " value='" . esc_attr( $value ) . "' size=57 style='float:left;clear:left;'>\n";
2346
  break;
2347
  case 'html':
2389
  return $buf;
2390
  }
2391
 
 
 
 
 
 
 
2392
  /**
2393
  * Format a row for an option on a settings page.
2394
  *
2395
+ * @since ?
2396
+ * @since 3.0 Added Helper Class for jQuery Tooltips. #1850
2397
+ *
2398
  * @param $name
2399
  * @param $opts
2400
  * @param $args
2402
  * @return string
2403
  */
2404
  function get_option_row( $name, $opts, $args ) {
2405
+ $label_text = $input_attr = $id_attr = '';
2406
+
2407
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/class-aioseop-helper.php' );
2408
+ $info = new AIOSEOP_Helper( get_class( $this ) );
2409
 
2410
  $align = 'right';
2411
  if ( $opts['label'] == 'top' ) {
2415
  $id_attr .= " id=\"{$opts['id']}_div\" ";
2416
  }
2417
  if ( $opts['label'] != 'none' ) {
2418
+ $tmp_help_text = $info->get_help_text( $name );
2419
+ if ( isset( $tmp_help_text ) && ! empty( $tmp_help_text ) ) {
2420
+ $display_help = '<a class="aioseop_help_text_link" style="cursor: help;" title="%s"></a><label class="aioseop_label textinput">%s</label>';
2421
+ $help_text = sprintf( $display_help, $info->get_help_text( $name ), $opts['name'] );
2422
  } else {
2423
  $help_text = $opts['name'];
2424
  }
2425
+
2426
+ // TODO Possible remove text align.
2427
+ // Currently aligns to the right when everything is being aligned to the left; which is usually a workaround.
2428
+ $display_label_format = '<span class="aioseop_option_label" style="text-align:%s;vertical-align:top;">%s</span>';
2429
+ $label_text = sprintf( $display_label_format, $align, $help_text );
2430
  } else {
2431
  $input_attr .= ' aioseop_no_label ';
2432
  }
2433
  if ( $opts['label'] == 'top' ) {
2434
+ $label_text .= "</div><div class='aioseop_input aioseop_top_label'>";
2435
  }
2436
  $input_attr .= " aioseop_{$opts['type']}_type";
2437
 
2438
+ $display_row_template = '<div class="aioseop_wrapper%s" id="%s_wrapper"><div class="aioseop_input">%s<span class="aioseop_option_input"><div class="aioseop_option_div" %s>%s</div></span><p style="clear:left"></p></div></div>';
2439
+ return sprintf( $display_row_template, $input_attr, $name, $label_text, $id_attr, $this->get_option_html( $args ) );
2440
  }
2441
 
2442
  /**
2737
  'page_options' => array( 'type' => 'hidden', 'value' => 'aiosp_home_description' ),
2738
  'Submit' => array(
2739
  'type' => 'submit',
2740
+ 'class' => 'aioseop_update_options_button button-primary',
2741
  'value' => __( 'Update Options', 'all-in-one-seo-pack' ) . ' &raquo;',
2742
  ),
2743
  'Submit_Default' => array(
2744
  'type' => 'submit',
2745
+ 'class' => 'aioseop_reset_settings_button button-secondary',
2746
  'value' => sprintf( __( 'Reset %s Settings to Defaults', 'all-in-one-seo-pack' ), $name ) . ' &raquo;',
2747
  ),
2748
  );
admin/class-aioseop-helper.php ADDED
@@ -0,0 +1,1062 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AIOSEOP Helper/Info Class
4
+ *
5
+ * Description. (use period)
6
+ *
7
+ * @link URL
8
+ *
9
+ * @package All-in-One-SEO-Pack
10
+ * @since 2.4.2
11
+ */
12
+
13
+ /**
14
+ * All in One SEO Plugin Helper
15
+ *
16
+ * @since 2.4.2
17
+ */
18
+ class AIOSEOP_Helper {
19
+ /**
20
+ * Help Text for jQuery UI Tooltips.
21
+ *
22
+ * @since 2.4.2
23
+ * @var array $help_text {
24
+ * @type string
25
+ * }
26
+ */
27
+ private $help_text = array();
28
+
29
+ /**
30
+ * Constructor
31
+ *
32
+ * @since 2.4.2
33
+ *
34
+ * @param string $module Module/Class name.
35
+ */
36
+ public function __construct( $module = '' ) {
37
+ if ( current_user_can( 'aiosp_manage_seo' ) ) {
38
+ $this->_set_help_text( $module );
39
+ }
40
+ }
41
+
42
+ /**
43
+ * Set this Help Text
44
+ *
45
+ * Sets the Help Text according to the module/class in use, but if there is
46
+ * no class name in $module, then this Help Text will add all module help texts.
47
+ *
48
+ * @ignore
49
+ * @since 3.0
50
+ * @access private
51
+ *
52
+ * @param string $module All_in_One_SEO_Pack module.
53
+ */
54
+ private function _set_help_text( $module ) {
55
+
56
+ switch ( $module ) {
57
+ case 'All_in_One_SEO_Pack':
58
+ $this->help_text = $this->help_text_general();
59
+ $this->help_text = array_merge( $this->help_text, $this->help_text_post_meta() );
60
+ break;
61
+ case 'All_in_One_SEO_Pack_Performance':
62
+ $this->help_text = $this->help_text_performance();
63
+ break;
64
+ case 'All_in_One_SEO_Pack_Sitemap':
65
+ $this->help_text = $this->help_text_sitemap();
66
+ break;
67
+ case 'All_in_One_SEO_Pack_Opengraph':
68
+ $this->help_text = $this->help_text_opengraph();
69
+ break;
70
+ case 'All_in_One_SEO_Pack_Robots':
71
+ $this->help_text = $this->help_text_robots_generator();
72
+ break;
73
+ case 'All_in_One_SEO_Pack_File_Editor':
74
+ $this->help_text = $this->help_text_file_editor();
75
+ break;
76
+ case 'All_in_One_SEO_Pack_Importer_Exporter':
77
+ $this->help_text = $this->help_text_importer_exporter();
78
+ break;
79
+ case 'All_in_One_SEO_Pack_Bad_Robots':
80
+ $this->help_text = $this->help_text_bad_robots();
81
+ break;
82
+ }
83
+
84
+ /**
85
+ * Set Help Text
86
+ *
87
+ * @since 3.0
88
+ *
89
+ * @param array $this->help_text Contains an array of help text for each setting.
90
+ * @param string $module Shows which class module is using the function.
91
+ */
92
+ $this->help_text = apply_filters( 'aioseop_helper_set_help_text', $this->help_text, $module );
93
+ }
94
+
95
+ /**
96
+ * Help Text General Settings
97
+ *
98
+ * @ignore
99
+ * @since 2.4.2
100
+ * @access private
101
+ *
102
+ * @return array
103
+ */
104
+ private function help_text_general() {
105
+ /*
106
+ * Consider changing the construction of the macros.
107
+ *
108
+ * The name of the macro should NOT be inside _e() or __() because it does not make sense as it
109
+ * won't change with the language.
110
+ *
111
+ * Moreover, it will confuse WPCS and it will try to replace %c (as in %category%) to %$1c.
112
+ * Placeholder %s (%something) has been bug fixed.
113
+ * @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/698
114
+ */
115
+ // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
116
+ // phpcs:disable WordPress.WP.I18n.UnorderedPlaceholdersText
117
+ $rtn_help_text = array(
118
+ // General Settings.
119
+ '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' ),
120
+ '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' ),
121
+ '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' ),
122
+ 'aiosp_schema_markup' => __( 'Check this to support Schema.org markup, i.e., itemprop on supported metadata.', 'all-in-one-seo-pack' ),
123
+ /* 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. */
124
+ '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 ),
125
+
126
+ // Home Page Settings.
127
+ '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' ),
128
+ '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' ),
129
+ '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' ),
130
+ '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' ),
131
+
132
+ // Title Settings.
133
+ 'aiosp_home_page_title_format' =>
134
+ __( 'This controls the format of the title tag for your Homepage.', 'all-in-one-seo-pack' ) . '<br />' .
135
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
136
+ '<dl>' .
137
+ '<dt>%site_title%</dt>' .
138
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
139
+ '<dt>%site_description%</dt>' .
140
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
141
+ '<dt>%page_title%</dt>' .
142
+ /* translators: %s is replaced with a content type such as Post, Page, etc. */
143
+ '<dd>' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' ) ) . '</dd>' .
144
+ '<dt>%page_author_login%</dt>' .
145
+ /* translators: Example sentence: "The first name of the author of the Post" */
146
+ '<dd>' . 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' ) ) . '</dd>' .
147
+ '<dt>%page_author_nicename%</dt>' .
148
+ '<dd>' . sprintf(
149
+ __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ),
150
+ /* translators: The "nicename" is the sanitized version of a username. */
151
+ __( 'nicename', 'all-in-one-seo-pack' ), __( 'Homepage', 'all-in-one-seo-pack' )
152
+ ) . '</dd>' .
153
+ '<dt>%page_author_firstname%</dt>' .
154
+ '<dd>' . 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' ) ) . '</dd>' .
155
+ '<dt>%page_author_lastname%</dt>' .
156
+ '<dd>' . 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' ) ) . '</dd>' .
157
+ '<dt>%current_date%</dt>' .
158
+ /* translators: %s is replaced with a time related term such as Date, Year, Month, etc. */
159
+ '<dd>' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '</dd>' .
160
+ '<dt>%current_year%</dt>' .
161
+ /* translators: %s is replaced with a time related term such as Date, Year, Month, etc. */
162
+ '<dd>' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '</dd>' .
163
+ '<dt>%cf_fieldname%</dt>' .
164
+ '<dd>' . __( 'The name of a custom field', 'all-in-one-seo-pack' ) . '</dd>' .
165
+ '</dl>',
166
+ 'aiosp_page_title_format' =>
167
+ __( 'This controls the format of the title tag for Pages.', 'all-in-one-seo-pack' ) . '<br />' .
168
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
169
+ '<dl>' .
170
+ '<dt>%site_title%</dt>' .
171
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
172
+ '<dt>%site_description%</dt>' .
173
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
174
+ '<dt>%page_title%</dt>' .
175
+ '<dd>' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Page', 'all-in-one-seo-pack' ) ) . '</dd>' .
176
+ '<dt>%page_author_login%</dt>' .
177
+ '<dd>' . 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' ) ) . '</dd>' .
178
+ '<dt>%page_author_nicename%</dt>' .
179
+ '<dd>' . 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' ) ) . '</dd>' .
180
+ '<dt>%page_author_firstname%</dt>' .
181
+ '<dd>' . 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' ) ) . '</dd>' .
182
+ '<dt>%page_author_lastname%</dt>' .
183
+ '<dd>' . 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' ) ) . '</dd>' .
184
+ '<dt>%current_date%</dt>' .
185
+ /* translators: %s is replaced with a time related term such as Date, Year, Month, etc. */
186
+ '<dd>' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '</dd>' .
187
+ '<dt>%current_year%</dt>' .
188
+ '<dd>' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '</dd>' .
189
+ '<dt>%post_date%</dt>' .
190
+ '<dd>' . 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' ) ) . '</dd>' .
191
+ '<dt>%post_year%</dt>' .
192
+ '<dd>' . 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' ) ) . '</dd>' .
193
+ '<dt>%post_month%</dt>' .
194
+ '<dd>' . 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' ) ) . '</dd>' .
195
+ '<dt>%cf_fieldname%</dt>' .
196
+ '<dd>' . __( 'The name of a custom field', 'all-in-one-seo-pack' ) . '</dd>' .
197
+ '</dl>',
198
+ 'aiosp_post_title_format' =>
199
+ __( 'This controls the format of the title tag for Posts.', 'all-in-one-seo-pack' ) . '<br />' .
200
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
201
+ '<dl>' .
202
+ '<dt>%site_title%</dt>' .
203
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
204
+ '<dt>%site_description%</dt>' .
205
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
206
+ '<dt>%post_title%</dt>' .
207
+ '<dd>' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '</dd>' .
208
+ '<dt>%category_title%</dt>' .
209
+ /* translators: %s is replaced with a content type such as Post, Page, etc. */
210
+ '<dd>' . sprintf( __( 'The (main) Category of the %s', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '</dd>' .
211
+ '<dt>%page_author_login%</dt>' .
212
+ '<dd>' . 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' ) ) . '</dd>' .
213
+ '<dt>%page_author_nicename%</dt>' .
214
+ '<dd>' . 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' ) ) . '</dd>' .
215
+ '<dt>%page_author_firstname%</dt>' .
216
+ '<dd>' . 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' ) ) . '</dd>' .
217
+ '<dt>%page_author_lastname%</dt>' .
218
+ '<dd>' . 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' ) ) . '</dd>' .
219
+ '<dt>%current_date%</dt>' .
220
+ '<dd>' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '</dd>' .
221
+ '<dt>%current_year%</dt>' .
222
+ '<dd>' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '</dd>' .
223
+ '<dt>%post_date%</dt>' .
224
+ '<dd>' . 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' ) ) . '</dd>' .
225
+ '<dt>%post_year%</dt>' .
226
+ '<dd>' . 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' ) ) . '</dd>' .
227
+ '<dt>%post_month%</dt>' .
228
+ '<dd>' . 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' ) ) . '</dd>' .
229
+ '<dt>%cf_fieldname%</dt>' .
230
+ '<dd>' . __( 'The name of a custom field', 'all-in-one-seo-pack' ) . '</dd>' .
231
+ '</dl>',
232
+ 'aiosp_category_title_format' =>
233
+ __( 'This controls the format of the title tag for Category Archives.', 'all-in-one-seo-pack' ) . '<br />' .
234
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
235
+ '<dl>' .
236
+ '<dt>%site_title%</dt>' .
237
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
238
+ '<dt>%site_description%</dt>' .
239
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
240
+ '<dt>%category_title%</dt>' .
241
+ '<dd>' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Category', 'all-in-one-seo-pack' ) ) . '</dd>' .
242
+ '<dt>%category_description%</dt>' .
243
+ /* translators: %s is replaced with a content type such as Post, Page, etc. */
244
+ '<dd>' . sprintf( __( 'The description of the %s', 'all-in-one-seo-pack' ), __( 'Category', 'all-in-one-seo-pack' ) ) . '</dd>' .
245
+ '<dt>%current_year%</dt>' .
246
+ '<dd>' . __( 'The current year', 'all-in-one-seo-pack' ) . '</dd>' .
247
+ '</dl>',
248
+ 'aiosp_archive_title_format' =>
249
+ __( 'This controls the format of the title tag for Custom Post Archives.', 'all-in-one-seo-pack' ) . '<br />' .
250
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
251
+ '<dl>' .
252
+ '<dt>%site_title%</dt>' .
253
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
254
+ '<dt>%site_description%</dt>' .
255
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
256
+ '<dt>%archive_title%</dt>' .
257
+ '<dd>' . sprintf(
258
+ __( 'The original title of the %s', 'all-in-one-seo-pack' ),
259
+ /* translators: "Archive" is used in the context of a WordPress archive page. */
260
+ __( 'Archive', 'all-in-one-seo-pack' )
261
+ ) . '</dd>' .
262
+ '</dl>',
263
+ 'aiosp_date_title_format' =>
264
+ __( 'This controls the format of the title tag for Date Archives.', 'all-in-one-seo-pack' ) . '<br />' .
265
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
266
+ '<dl>' .
267
+ '<dt>%site_title%</dt>' .
268
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
269
+ '<dt>%site_description%</dt>' .
270
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
271
+ '<dt>%date%</dt>' .
272
+ '<dd>' . __( 'The original archive title (localized), e.g. "2019" or "2019 August"', 'all-in-one-seo-pack' ) . '</dd>' .
273
+ '<dt>%day%</dt>' .
274
+ '<dd>' . __( 'The original archive day, e.g. "17"', 'all-in-one-seo-pack' ) . '</dd>' .
275
+ '<dt>%month%</dt>' .
276
+ '<dd>' . __( 'The original archive month (localized), e.g. "August"', 'all-in-one-seo-pack' ) . '</dd>' .
277
+ '<dt>%year%</dt>' .
278
+ '<dd>' . __( 'The original archive year, e.g. "2019"', 'all-in-one-seo-pack' ) . '</dd>' .
279
+ '</dl>',
280
+ 'aiosp_author_title_format' =>
281
+ __( 'This controls the format of the title tag for Author Archives.', 'all-in-one-seo-pack' ) . '<br />' .
282
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
283
+ '<dl>' .
284
+ '<dt>%site_title%</dt>' .
285
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
286
+ '<dt>%site_description%</dt>' .
287
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
288
+ '<dt>%author%</dt>' .
289
+ '<dd>' . __( 'The original archive title, e.g. "Steve" or "John Smith"', 'all-in-one-seo-pack' ) . '</dd>' .
290
+ '</dl>',
291
+ 'aiosp_tag_title_format' =>
292
+ __( 'This controls the format of the title tag for Tag Archives.', 'all-in-one-seo-pack' ) . '<br />' .
293
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
294
+ '<dl>' .
295
+ '<dt>%site_title%</dt>' .
296
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
297
+ '<dt>%site_description%</dt>' .
298
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
299
+ '<dt>%tag%</dt>' .
300
+ '<dd>' . sprintf( __( 'The name of the %s', 'all-in-one-seo-pack' ), __( 'Tag', 'all-in-one-seo-pack' ) ) . '</dd>' .
301
+ '</dl>',
302
+ 'aiosp_search_title_format' =>
303
+ __( 'This controls the format of the title tag for the Search page.', 'all-in-one-seo-pack' ) . '<br />' .
304
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
305
+ '<dl>' .
306
+ '<dt>%site_title%</dt>' .
307
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
308
+ '<dt>%site_description%</dt>' .
309
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
310
+ '<dt>%search%</dt>' .
311
+ '<dd>' . __( 'The search term that was entered', 'all-in-one-seo-pack' ) . '</dd>' .
312
+ '</dl>',
313
+ 'aiosp_description_format' =>
314
+ __( 'This controls the format of Meta Descriptions. The following macros are supported:', 'all-in-one-seo-pack' ) .
315
+ '<dl>' .
316
+ '<dt>%site_title%</dt>' .
317
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
318
+ '<dt>%site_description%</dt>' .
319
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
320
+ '<dt>%description%</dt>' .
321
+ '<dd>' . __( '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' ) . '</dd>' .
322
+ '<dt>%post_title%</dt>' .
323
+ '<dd>' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), __( 'Post', 'all-in-one-seo-pack' ) ) . '</dd>' .
324
+ '<dt>%wp_title%</dt>' .
325
+ '<dd>' . __( 'The original WordPress title', 'all-in-one-seo-pack' ) . '</dd>' .
326
+ '<dt>%current_date%</dt>' .
327
+ '<dd>' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '</dd>' .
328
+ '<dt>%current_year%</dt>' .
329
+ '<dd>' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '</dd>' .
330
+ '<dt>%post_date%</dt>' .
331
+ '<dd>' . sprintf(
332
+ __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ),
333
+ /* translators: "Post/Page" are the two main content types in WordPress. */
334
+ __( 'Post/Page', 'all-in-one-seo-pack' )
335
+ ) . '</dd>' .
336
+ '<dt>%post_year%</dt>' .
337
+ '<dd>' . 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' ) ) . '</dd>' .
338
+ '<dt>%post_month%</dt>' .
339
+ '<dd>' . 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' ) ) . '</dd>' .
340
+ '<dt>%cf_fieldname%</dt>' .
341
+ '<dd>' . __( 'The name of a custom field', 'all-in-one-seo-pack' ) . '</dd>' .
342
+ '</dl>',
343
+ 'aiosp_404_title_format' =>
344
+ __( 'This controls the format of the title tag for the 404 page.', 'all-in-one-seo-pack' ) . ' <br />' .
345
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
346
+ '<dl>' .
347
+ '<dt>%site_title%</dt>' .
348
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
349
+ '<dt>%site_description%</dt>' .
350
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
351
+ '<dt>%request_url%</dt>' .
352
+ '<dd>' . __( 'The original URL path, like "/url-that-does-not-exist/"', 'all-in-one-seo-pack' ) . '</dd>' .
353
+ '<dt>%request_words%</dt>' .
354
+ '<dd>' . __( 'The URL path in human readable form, like "Url That Does Not Exist"', 'all-in-one-seo-pack' ) . '</dd>' .
355
+ '<dt>%404_title%</dt>' .
356
+ '<dd>' . __( 'Additional 404 title input', 'all-in-one-seo-pack' ) . '</dd>' .
357
+ '</dl>',
358
+ 'aiosp_paged_format' =>
359
+ __( 'This string gets appended/prepended to titles of paged index pages (like home or archive pages).', 'all-in-one-seo-pack' ) .
360
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
361
+ '<dl>' .
362
+ '<dt>%page%</dt>' .
363
+ '<dd>' . __( 'The page number', 'all-in-one-seo-pack' ) . '</dd>' .
364
+ '</dl>',
365
+ //phpcs:enable
366
+
367
+ // Custom Post Type Settings.
368
+ /* 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. */
369
+ '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 ),
370
+
371
+ // Display Settings.
372
+ 'aiosp_posttypecolumns' => __( 'This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.', 'all-in-one-seo-pack' ),
373
+
374
+ // Webmaster Verification.
375
+ 'aiosp_google_verify' => __( 'Enter your verification code here to verify your site with Google Search Console.', 'all-in-one-seo-pack' ),
376
+ 'aiosp_bing_verify' => __( 'Enter your verification code here to verify your site with Bing Webmaster Tools.', 'all-in-one-seo-pack' ),
377
+ 'aiosp_pinterest_verify' => __( 'Enter your verification code here to verify your site with Pinterest.', 'all-in-one-seo-pack' ),
378
+ 'aiosp_yandex_verify' => __( 'Enter your verification code here to verify your site with Yandex Webmaster Tools.', 'all-in-one-seo-pack' ),
379
+ 'aiosp_baidu_verify' => __( 'Enter your verification code here to verify your site with Baidu Webmaster Tools.', 'all-in-one-seo-pack' ),
380
+
381
+ // Google Settings.
382
+ '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' ),
383
+ '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' ),
384
+ 'aiosp_ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
385
+ 'aiosp_ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
386
+ 'aiosp_ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
387
+ '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' ),
388
+ 'aiosp_ga_anonymize_ip' => __( 'This enables support for IP Anonymization in Google Analytics.', 'all-in-one-seo-pack' ),
389
+ 'aiosp_ga_display_advertising' => __( 'This enables support for the Display Advertiser Features in Google Analytics.', 'all-in-one-seo-pack' ),
390
+ 'aiosp_ga_exclude_users' => __( 'Exclude logged-in users from Google Analytics tracking by role.', 'all-in-one-seo-pack' ),
391
+ 'aiosp_ga_track_outbound_links' => __( 'Check this if you want to track outbound links with Google Analytics.', 'all-in-one-seo-pack' ),
392
+ 'aiosp_ga_link_attribution' => __( 'This enables support for the Enhanced Link Attribution in Google Analytics.', 'all-in-one-seo-pack' ),
393
+ 'aiosp_ga_enhanced_ecommerce' => __( 'This enables support for the Enhanced Ecommerce in Google Analytics.', 'all-in-one-seo-pack' ),
394
+
395
+ // Noindex Settings.
396
+ 'aiosp_cpostnoindex' => __( 'Set the default NOINDEX setting for each Post Type.', 'all-in-one-seo-pack' ),
397
+ 'aiosp_cpostnofollow' => __( 'Set the default NOFOLLOW setting for each Post Type.', 'all-in-one-seo-pack' ),
398
+ 'aiosp_category_noindex' => __( 'Check this to ask search engines not to index Category Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
399
+ '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' ),
400
+ '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' ),
401
+ 'aiosp_tags_noindex' => __( 'Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
402
+ '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' ),
403
+ 'aiosp_404_noindex' => __( 'Check this to ask search engines not to index the 404 page.', 'all-in-one-seo-pack' ),
404
+ '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' ),
405
+ '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' ),
406
+ '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' ),
407
+
408
+ // Advanced Settings.
409
+ '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' ),
410
+ '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' ),
411
+ 'aiosp_run_shortcodes' => __( 'Check this and shortcodes will get executed for descriptions auto-generated from content.', 'all-in-one-seo-pack' ),
412
+ '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' ),
413
+ 'aiosp_dont_truncate_descriptions' => __( 'Check this to prevent your Description from being truncated regardless of its length.', 'all-in-one-seo-pack' ),
414
+ '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' ),
415
+ 'aiosp_redirect_attachement_parent' => __( 'Redirect attachment pages to post parent.', 'all-in-one-seo-pack' ),
416
+ /* 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. */
417
+ '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: <em>/forum/, /contact/</em><br />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 ),
418
+ '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' ),
419
+ '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' ),
420
+ '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' ),
421
+ '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' ),
422
+
423
+ // Keyword Settings.
424
+ 'aiosp_togglekeywords' => __( 'This option allows you to toggle the use of Meta Keywords throughout the whole of the site.', 'all-in-one-seo-pack' ),
425
+ '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' ),
426
+ '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' ),
427
+ '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' ),
428
+
429
+ // Unknown Location.
430
+ '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' ),
431
+
432
+ );
433
+
434
+ // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
435
+ $post_types = get_post_types( '', 'names' );
436
+ foreach ( $post_types as $v1_pt ) {
437
+ if ( ! isset( $rtn_help_text[ 'aiosp_' . $v1_pt . '_title_format' ] ) ) {
438
+ $name = ucwords( preg_replace( '/-|\_/', ' ', get_post_type_object( $v1_pt )->labels->singular_name ) );
439
+
440
+ $help_text_macros =
441
+ '<dt>%site_title%</dt>' .
442
+ '<dd>' . __( 'Your site title', 'all-in-one-seo-pack' ) . '</dd>' .
443
+ '<dt>%site_description%</dt>' .
444
+ '<dd>' . __( 'Your site description', 'all-in-one-seo-pack' ) . '</dd>' .
445
+ '<dt>%post_title%</dt>' .
446
+ '<dd>' . sprintf( __( 'The original title of the %s', 'all-in-one-seo-pack' ), $name ) . '</dd>';
447
+
448
+ $pt_obj_taxes = get_object_taxonomies( $v1_pt, 'objects' );
449
+ foreach ( $pt_obj_taxes as $k2_slug => $v2_tax_obj ) {
450
+ if ( $v2_tax_obj->public ) {
451
+ $help_text_macros .= sprintf( '<dt>%%tax_%1$s%%</dt><dd>' . __( 'The title of the %2$s taxonomy that is associated to this %3$s', 'all-in-one-seo-pack' ) . '</dd>', $k2_slug, ucwords( $v2_tax_obj->label ), $name );
452
+ }
453
+ }
454
+
455
+ $help_text_macros .=
456
+ '<dt>%page_author_login%</dt>' .
457
+ '<dd>' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'username', 'all-in-one-seo-pack' ), $name ) . '</dd>' .
458
+ '<dt>%page_author_nicename%</dt>' .
459
+ '<dd>' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'nicename', 'all-in-one-seo-pack' ), $name ) . '</dd>' .
460
+ '<dt>%page_author_firstname%</dt>' .
461
+ '<dd>' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'first name', 'all-in-one-seo-pack' ), $name ) . '</dd>' .
462
+ '<dt>%page_author_lastname%</dt>' .
463
+ '<dd>' . sprintf( __( 'The %1$s of the author of the %2$s', 'all-in-one-seo-pack' ), __( 'last name', 'all-in-one-seo-pack' ), $name ) . '</dd>' .
464
+ '<dt>%current_date%</dt>' .
465
+ '<dd>' . sprintf( __( 'The current %s (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ) ) . '</dd>' .
466
+ '<dt>%current_year%</dt>' .
467
+ '<dd>' . sprintf( __( 'The current %s', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ) ) . '</dd>' .
468
+ '<dt>%post_date%</dt>' .
469
+ '<dd>' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'date', 'all-in-one-seo-pack' ), $name ) . '</dd>' .
470
+ '<dt>%post_year%</dt>' .
471
+ '<dd>' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'year', 'all-in-one-seo-pack' ), $name ) . '</dd>' .
472
+ '<dt>%post_month%</dt>' .
473
+ '<dd>' . sprintf( __( 'The %1$s when the %2$s was published (localized)', 'all-in-one-seo-pack' ), __( 'month', 'all-in-one-seo-pack' ), $name ) . '</dd>' .
474
+
475
+ $rtn_help_text[ 'aiosp_' . $v1_pt . '_title_format' ] = __( 'The following macros are supported:', 'all-in-one-seo-pack' ) . '<dl>' . $help_text_macros . '</dl>' . '<br /><a href="https://semperplugins.com/documentation/custom-post-type-settings/#custom-titles" target="_blank">' . __( 'Click here for documentation on this setting', 'all-in-one-seo-pack' ) . '</a>';
476
+ }
477
+ }
478
+ // phpcs:enable
479
+
480
+ $help_doc_link = array(
481
+ // General Settings.
482
+ 'aiosp_can' => 'https://semperplugins.com/documentation/general-settings/#canonical-urls',
483
+ 'aiosp_no_paged_canonical_links' => 'https://semperplugins.com/documentation/general-settings/#no-pagination-for-canonical-urls',
484
+ 'aiosp_use_original_title' => 'https://semperplugins.com/documentation/general-settings/#use-original-title',
485
+ 'aiosp_schema_markup' => 'https://semperplugins.com/documentation/general-settings/#use-schema-markup',
486
+ 'aiosp_do_log' => 'https://semperplugins.com/documentation/general-settings/#log-important-events',
487
+
488
+ // Home Page Settings.
489
+ 'aiosp_home_title' => 'https://semperplugins.com/documentation/home-page-settings/#home-title',
490
+ 'aiosp_home_description' => 'https://semperplugins.com/documentation/home-page-settings/#home-description',
491
+ 'aiosp_home_keywords' => 'https://semperplugins.com/documentation/home-page-settings/#home-keywords',
492
+ 'aiosp_use_static_home_info' => 'https://semperplugins.com/documentation/home-page-settings/#use-static-front-page-instead',
493
+
494
+ // Title Settings.
495
+ 'aiosp_home_page_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
496
+ 'aiosp_page_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
497
+ 'aiosp_post_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
498
+ 'aiosp_category_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
499
+ 'aiosp_archive_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
500
+ 'aiosp_date_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
501
+ 'aiosp_author_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
502
+ 'aiosp_tag_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
503
+ 'aiosp_search_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
504
+ 'aiosp_description_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
505
+ 'aiosp_404_title_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
506
+ 'aiosp_paged_format' => 'https://semperplugins.com/documentation/title-settings/#title-format-fields',
507
+
508
+ // Custom Post Type Settings.
509
+ 'aiosp_cpostactive' => 'https://semperplugins.com/documentation/custom-post-type-settings/#seo-on-only-these-post-types',
510
+
511
+ // Display Settings.
512
+ 'aiosp_posttypecolumns' => 'https://semperplugins.com/documentation/display-settings/#show-column-labels-for-custom-post-types',
513
+
514
+ // Webmaster Verification.
515
+ 'aiosp_google_verify' => 'https://semperplugins.com/documentation/google-search-console-verification/',
516
+ 'aiosp_bing_verify' => 'https://semperplugins.com/documentation/bing-webmaster-verification/',
517
+ 'aiosp_pinterest_verify' => 'https://semperplugins.com/documentation/pinterest-site-verification/',
518
+ 'aiosp_yandex_verify' => 'https://semperplugins.com/documentation/yandex-webmaster-verification/',
519
+ 'aiosp_baidu_verify' => 'https://semperplugins.com/documentation/baidu-webmaster-verification/',
520
+
521
+ // Google Settings.
522
+ 'aiosp_google_sitelinks_search' => 'https://semperplugins.com/documentation/google-settings/#display-sitelinks-search-box',
523
+ 'aiosp_google_analytics_id' => 'https://semperplugins.com/documentation/setting-up-google-analytics/',
524
+ 'aiosp_ga_advanced_options' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/',
525
+ 'aiosp_ga_domain' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#tracking-domain',
526
+ 'aiosp_ga_multi_domain' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#track-multiple-domains-additional-domains',
527
+ 'aiosp_ga_addl_domains' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#track-multiple-domains-additional-domains',
528
+ 'aiosp_ga_anonymize_ip' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#anonymize-ip-addresses',
529
+ 'aiosp_ga_display_advertising' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#display-advertiser-tracking',
530
+ 'aiosp_ga_exclude_users' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#exclude-users-from-tracking',
531
+ 'aiosp_ga_track_outbound_links' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#track-outbound-links',
532
+ 'aiosp_ga_link_attribution' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#enhanced-link-attribution',
533
+ 'aiosp_ga_enhanced_ecommerce' => 'https://semperplugins.com/documentation/advanced-google-analytics-settings/#enhanced-ecommerce',
534
+
535
+ // Noindex Settings.
536
+ 'aiosp_cpostnoindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex',
537
+ 'aiosp_cpostnofollow' => 'https://semperplugins.com/documentation/noindex-settings/#nofollow',
538
+ 'aiosp_category_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings',
539
+ 'aiosp_archive_date_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings',
540
+ 'aiosp_archive_author_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings',
541
+ 'aiosp_tags_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#noindex-settings',
542
+ 'aiosp_search_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-the-search-page',
543
+ 'aiosp_404_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-the-404-page',
544
+ 'aiosp_paginated_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-paginated-pages-posts',
545
+ 'aiosp_paginated_nofollow' => 'https://semperplugins.com/documentation/noindex-settings/#use-nofollow-for-paginated-pages-posts',
546
+ 'aiosp_tax_noindex' => 'https://semperplugins.com/documentation/noindex-settings/#use-noindex-for-the-taxonomy-archives',
547
+
548
+ // Advanced Settings.
549
+ 'aiosp_generate_descriptions' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#autogenerate-descriptions',
550
+ 'aiosp_skip_excerpt' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#remove-descriptions-for-paginated-pages',
551
+ 'aiosp_run_shortcodes' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#never-shorten-long-descriptions',
552
+ 'aiosp_hide_paginated_descriptions' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#unprotect-post-meta-fields',
553
+ 'aiosp_dont_truncate_descriptions' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#never-shorten-long-descriptions',
554
+ 'aiosp_unprotect_meta' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#unprotect-post-meta-fields',
555
+ 'aiosp_redirect_attachement_parent' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#redirect-attachments-to-post-parent',
556
+ 'aiosp_ex_pages' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#exclude-pages',
557
+ 'aiosp_post_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-post-headers',
558
+ 'aiosp_page_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-page-headers',
559
+ 'aiosp_front_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-front-page-headers',
560
+ 'aiosp_home_meta_tags' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/#additional-blog-page-headers',
561
+
562
+ // Keyword Settings.
563
+ 'aiosp_togglekeywords' => 'https://semperplugins.com/documentation/keyword-settings/#use-keywords',
564
+ 'aiosp_use_categories' => 'https://semperplugins.com/documentation/keyword-settings/#use-categories-for-meta-keywords',
565
+ 'aiosp_use_tags_as_keywords' => 'https://semperplugins.com/documentation/keyword-settings/#use-tags-for-meta-keywords',
566
+ 'aiosp_dynamic_postspage_keywords' => 'https://semperplugins.com/documentation/keyword-settings/#dynamically-generate-keywords-for-posts-page',
567
+
568
+ // Unknown/Pro?
569
+ // 'aiosp_google_connect' => '',
570
+ );
571
+
572
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
573
+ // Any help text that ends with a ul or ol element will cause text to start at the next line.
574
+ $tooltips_with_ul = array(
575
+ 'aiosp_home_page_title_format',
576
+ 'aiosp_page_title_format',
577
+ 'aiosp_post_title_format',
578
+ 'aiosp_category_title_format',
579
+ 'aiosp_archive_title_format',
580
+ 'aiosp_date_title_format',
581
+ 'aiosp_author_title_format',
582
+ 'aiosp_tag_title_format',
583
+ 'aiosp_search_title_format',
584
+ 'aiosp_description_format',
585
+ 'aiosp_404_title_format',
586
+ 'aiosp_paged_format',
587
+ );
588
+
589
+ $br = '<br /><br />';
590
+ if ( in_array( $k1_slug, $tooltips_with_ul, true ) ) {
591
+ $br = '<br />';
592
+ }
593
+
594
+ $rtn_help_text[ $k1_slug ] .= $br . '<a href="' . $v1_url . '" target="_blank">' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '</a>';
595
+ }
596
+
597
+ return $rtn_help_text;
598
+ }
599
+
600
+ /**
601
+ * Help Text Performance Module
602
+ *
603
+ * @ignore
604
+ * @since 2.4.2
605
+ * @access private
606
+ *
607
+ * @return array
608
+ */
609
+ private function help_text_performance() {
610
+ $rtn_help_text = array(
611
+ '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' ),
612
+ 'aiosp_performance_execution_time' => __( 'This setting allows you to raise your PHP execution time to a reasonable value.', 'all-in-one-seo-pack' ),
613
+ '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' ),
614
+ );
615
+
616
+ $help_doc_link = array(
617
+ 'aiosp_performance_memory_limit' => 'https://semperplugins.com/documentation/performance-settings/#raise-memory-limit',
618
+ 'aiosp_performance_execution_time' => 'https://semperplugins.com/documentation/performance-settings/#raise-execution-time',
619
+ 'aiosp_performance_force_rewrites' => 'https://semperplugins.com/documentation/performance-settings/#force-rewrites',
620
+ );
621
+
622
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
623
+ $rtn_help_text[ $k1_slug ] .= '<br /><br /><a href="' . $v1_url . '" target="_blank">' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '</a>';
624
+ }
625
+
626
+ return $rtn_help_text;
627
+ }
628
+
629
+ /**
630
+ * Help Text Sitemap Module
631
+ *
632
+ * @ignore
633
+ * @since 2.4.2
634
+ * @access private
635
+ *
636
+ * @return array
637
+ */
638
+ private function help_text_sitemap() {
639
+ $rtn_help_text = array(
640
+ // XML Sitemap.
641
+ 'aiosp_sitemap_rss_sitemap' => __( 'Generate an RSS sitemap in addition to the regular XML Sitemap.', 'all-in-one-seo-pack' ),
642
+ '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' ),
643
+ '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' ),
644
+ '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' ),
645
+ 'aiosp_sitemap_posttypes' => __( 'Select which Post Types appear in your sitemap.', 'all-in-one-seo-pack' ),
646
+ 'aiosp_sitemap_taxonomies' => __( 'Select which taxonomy archives appear in your sitemap', 'all-in-one-seo-pack' ),
647
+ 'aiosp_sitemap_archive' => __( 'Include Date Archives in your sitemap.', 'all-in-one-seo-pack' ),
648
+ 'aiosp_sitemap_author' => __( 'Include Author Archives in your sitemap.', 'all-in-one-seo-pack' ),
649
+ 'aiosp_sitemap_images' => __( 'Exclude Images in your sitemap.', 'all-in-one-seo-pack' ),
650
+ 'aiosp_sitemap_robots' => __( 'Places a link to your Sitemap.xml into your virtual Robots.txt file.', 'all-in-one-seo-pack' ),
651
+ 'aiosp_sitemap_rewrite' => __( 'Dynamically creates the XML sitemap instead of using a static file.', 'all-in-one-seo-pack' ),
652
+ 'aiosp_sitemap_addl_url' => __( 'URL to the page. This field only accepts absolute URLs with the protocol specified.', 'all-in-one-seo-pack' ),
653
+ 'aiosp_sitemap_addl_prio' => __( 'The priority of the page.', 'all-in-one-seo-pack' ),
654
+ 'aiosp_sitemap_addl_freq' => __( 'The frequency of the page.', 'all-in-one-seo-pack' ),
655
+ 'aiosp_sitemap_addl_mod' => __( 'Last modified date of the page.', 'all-in-one-seo-pack' ),
656
+ '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.<br/><br/>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' ),
657
+ 'aiosp_sitemap_excl_pages' => __( 'Use page slugs or page IDs, separated by commas, to exclude pages from the sitemap.', 'all-in-one-seo-pack' ),
658
+
659
+ // Priorities.
660
+ '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' ) ),
661
+ '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' ) ),
662
+ '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' ) ),
663
+ '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' ) ),
664
+ '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' ) ),
665
+
666
+ // Frequencies.
667
+ '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' ) ),
668
+ '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' ) ),
669
+ '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' ) ),
670
+ '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' ) ),
671
+ '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' ) ),
672
+
673
+ );
674
+
675
+ $args = array(
676
+ 'public' => true,
677
+ );
678
+
679
+ $post_types = get_post_types( $args, 'names' );
680
+ foreach ( $post_types as $pt ) {
681
+ $pt_obj = get_post_type_object( $pt );
682
+ $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 ) );
683
+ $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 ) );
684
+ $help_doc_link[ 'aiosp_sitemap_prio_post_' . $pt ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies';
685
+ $help_doc_link[ 'aiosp_sitemap_freq_post_' . $pt ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies';
686
+ }
687
+
688
+ $taxonomies = get_taxonomies( $args, 'object' );
689
+ foreach ( $taxonomies as $tax ) {
690
+ $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 ) );
691
+ $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 ) );
692
+ $help_doc_link[ 'aiosp_sitemap_prio_taxonomies_' . $tax->name ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies';
693
+ $help_doc_link[ 'aiosp_sitemap_freq_taxonomies_' . $tax->name ] = 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies';
694
+ }
695
+
696
+ $help_doc_link = array(
697
+ // XML Sitemap.
698
+ 'aiosp_sitemap_rss_sitemap' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#create-rss_sitemap',
699
+ 'aiosp_sitemap_daily_cron' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#schedule-updates',
700
+ 'aiosp_sitemap_indexes' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#enable-sitemap-indexes',
701
+ 'aiosp_sitemap_max_posts' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#enable-sitemap-indexes',
702
+ 'aiosp_sitemap_posttypes' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#post-types-and-taxonomies',
703
+ 'aiosp_sitemap_taxonomies' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#post-types-and-taxonomies',
704
+ 'aiosp_sitemap_archive' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#include-archive-pages',
705
+ 'aiosp_sitemap_author' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#include-archive-pages',
706
+ 'aiosp_sitemap_images' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#exclude-images',
707
+ 'aiosp_sitemap_robots' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#link-from-virtual-robots',
708
+ 'aiosp_sitemap_rewrite' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#dynamically-generate-sitemap',
709
+
710
+ // Additional Pages.
711
+ 'aiosp_sitemap_addl_url' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
712
+ 'aiosp_sitemap_addl_prio' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
713
+ 'aiosp_sitemap_addl_freq' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
714
+ 'aiosp_sitemap_addl_mod' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
715
+
716
+ // Exclude Items.
717
+ 'aiosp_sitemap_excl_terms' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#excluded-items',
718
+ 'aiosp_sitemap_excl_pages' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#excluded-items',
719
+
720
+ // Priorities.
721
+ 'aiosp_sitemap_prio_homepage' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
722
+ 'aiosp_sitemap_prio_post' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
723
+ 'aiosp_sitemap_prio_taxonomies' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
724
+ 'aiosp_sitemap_prio_archive' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
725
+ 'aiosp_sitemap_prio_author' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
726
+
727
+ // Frequencies.
728
+ 'aiosp_sitemap_freq_homepage' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
729
+ 'aiosp_sitemap_freq_post' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
730
+ 'aiosp_sitemap_freq_taxonomies' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
731
+ 'aiosp_sitemap_freq_archive' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
732
+ 'aiosp_sitemap_freq_author' => 'https://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
733
+
734
+ );
735
+
736
+ /*
737
+ * Currently has no links, but may be added later.
738
+ foreach ( $post_types as $pt ) {
739
+ $help_doc_link[ 'aiosp_sitemap_prio_post_' . $pt ] = '';
740
+ $help_doc_link[ 'aiosp_sitemap_freq_post_' . $pt ] = '';
741
+ }
742
+ */
743
+
744
+ /*
745
+ * Currently has no links, but may be added later.
746
+ foreach ( $taxonomies as $tax ) {
747
+ $help_doc_link[ 'aiosp_sitemap_prio_taxonomies_' . $tax->name ] = '';
748
+ $help_doc_link[ 'aiosp_sitemap_freq_taxonomies_' . $tax->name ] = '';
749
+ }
750
+ */
751
+
752
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
753
+ $rtn_help_text[ $k1_slug ] .= '<br /><br /><a href="' . $v1_url . '" target="_blank">' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '</a>';
754
+ }
755
+
756
+ return $rtn_help_text;
757
+ }
758
+
759
+ /**
760
+ * Help Text Opengraph Module
761
+ *
762
+ * @ignore
763
+ * @since 2.4.2
764
+ * @access private
765
+ *
766
+ * @return array
767
+ */
768
+ private function help_text_opengraph() {
769
+ $rtn_help_text = array(
770
+ // Home Page Settings.
771
+ /* 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. */
772
+ '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 ),
773
+ 'aiosp_opengraph_sitename' => __( 'The Site Name is the name that is used to identify your website.', 'all-in-one-seo-pack' ),
774
+ 'aiosp_opengraph_hometitle' => __( 'The Home Title is the Open Graph title for your home page.', 'all-in-one-seo-pack' ),
775
+ 'aiosp_opengraph_description' => __( 'The Home Description is the Open Graph description for your home page.', 'all-in-one-seo-pack' ),
776
+ 'aiosp_opengraph_homeimage' => __( 'The Home Image is the Open Graph image for your home page.', 'all-in-one-seo-pack' ),
777
+
778
+ // Image Settings.
779
+ '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' ),
780
+ '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' ),
781
+ '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' ),
782
+ 'aiosp_opengraph_dimgwidth' => __( 'This option lets you set a default width for your images, where unspecified.', 'all-in-one-seo-pack' ),
783
+ 'aiosp_opengraph_dimgheight' => __( 'This option lets you set a default height for your images, where unspecified.', 'all-in-one-seo-pack' ),
784
+ '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' ),
785
+
786
+ // Social Profile Links.
787
+ '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' ),
788
+ 'aiosp_opengraph_person_or_org' => __( 'Are the social profile links for your website for a person or an organization?', 'all-in-one-seo-pack' ),
789
+ 'aiosp_opengraph_social_name' => __( 'Add the name of the person or organization who owns these profiles.', 'all-in-one-seo-pack' ),
790
+
791
+ // Facebook Settings.
792
+ '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' ),
793
+ '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' ),
794
+ 'aiosp_opengraph_gen_tags' => __( 'Automatically generate article tags for Facebook type article when not provided.', 'all-in-one-seo-pack' ),
795
+ 'aiosp_opengraph_gen_keywords' => __( 'Use keywords in generated article tags.', 'all-in-one-seo-pack' ),
796
+ 'aiosp_opengraph_gen_categories' => __( 'Use categories in generated article tags.', 'all-in-one-seo-pack' ),
797
+ 'aiosp_opengraph_gen_post_tags' => __( 'Use post tags in generated article tags.', 'all-in-one-seo-pack' ),
798
+ 'aiosp_opengraph_types' => __( 'Select which Post Types you want to set Open Graph meta values for.', 'all-in-one-seo-pack' ),
799
+ 'aiosp_opengraph_facebook_publisher' => __( 'Link articles to the Facebook page associated with your website.', 'all-in-one-seo-pack' ),
800
+ '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' ),
801
+
802
+ // Twitter Settings.
803
+ 'aiosp_opengraph_defcard' => __( 'Select the default type of Twitter Card to display.', 'all-in-one-seo-pack' ),
804
+ 'aiosp_opengraph_twitter_site' => __( 'Enter the Twitter username associated with your website here.', 'all-in-one-seo-pack' ),
805
+ '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' ),
806
+ 'aiosp_opengraph_twitter_domain' => __( 'Enter the name of your website here.', 'all-in-one-seo-pack' ),
807
+
808
+ // Advanced Settings.
809
+ 'aiosp_opengraph_title_shortcodes' => __( 'Run shortcodes that appear in social title meta tags.', 'all-in-one-seo-pack' ),
810
+ 'aiosp_opengraph_description_shortcodes' => __( 'Run shortcodes that appear in social description meta tags.', 'all-in-one-seo-pack' ),
811
+ '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' ),
812
+
813
+ // POST META.
814
+ 'aioseop_opengraph_settings_title' => __( 'This is the Open Graph title of this Page or Post.', 'all-in-one-seo-pack' ),
815
+ 'aioseop_opengraph_settings_desc' => __( 'This is the Open Graph description of this Page or Post.', 'all-in-one-seo-pack' ),
816
+ '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' ),
817
+ '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' ),
818
+ 'aioseop_opengraph_settings_imagewidth' => __( 'Enter the width for your Open Graph image in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
819
+ 'aioseop_opengraph_settings_imageheight' => __( 'Enter the height for your Open Graph image in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
820
+ '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' ),
821
+ 'aioseop_opengraph_settings_videowidth' => __( 'Enter the width for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
822
+ 'aioseop_opengraph_settings_videoheight' => __( 'Enter the height for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
823
+ 'aioseop_opengraph_settings_category' => __( 'Select the Open Graph type that best describes the content of this Page or Post.', 'all-in-one-seo-pack' ),
824
+ 'aioseop_opengraph_settings_facebook_debug' => __( 'Press this button to have Facebook re-fetch and debug this page.', 'all-in-one-seo-pack' ),
825
+ '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' ),
826
+ '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' ),
827
+ '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' ),
828
+ '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' ),
829
+ );
830
+
831
+ $args_1 = array(
832
+ 'public' => true,
833
+ );
834
+ $args_2 = array(
835
+ 'public' => false,
836
+ );
837
+
838
+ $post_types = array_merge( get_post_types( $args_1, 'names' ), get_post_types( $args_2, 'names' ) );
839
+ foreach ( $post_types as $pt ) {
840
+ $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' );
841
+ $rtn_help_text[ 'aiosp_opengraph_' . $pt . '_fb_object_type' ] .= '<br /><br /><a href="https://semperplugins.com/documentation/social-meta-module/#content-object-types" target="_blank">' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '</a>';
842
+ }
843
+
844
+ $help_doc_link = array(
845
+ // Home Page Settings.
846
+ 'aiosp_opengraph_setmeta' => 'https://semperplugins.com/documentation/social-meta-module/#use-aioseo-title-and-description',
847
+ 'aiosp_opengraph_sitename' => 'https://semperplugins.com/documentation/social-meta-module/#site-name',
848
+ 'aiosp_opengraph_hometitle' => 'https://semperplugins.com/documentation/social-meta-module/#home-title-and-description',
849
+ 'aiosp_opengraph_description' => 'https://semperplugins.com/documentation/social-meta-module/#home-title-and-description',
850
+ 'aiosp_opengraph_homeimage' => 'https://semperplugins.com/documentation/social-meta-module/#home-image',
851
+
852
+ // Image Settings.
853
+ 'aiosp_opengraph_defimg' => 'https://semperplugins.com/documentation/social-meta-module/#select-og-image-source',
854
+ 'aiosp_opengraph_fallback' => 'https://semperplugins.com/documentation/social-meta-module/#use-default-if-no-image-found',
855
+ 'aiosp_opengraph_dimg' => 'https://semperplugins.com/documentation/social-meta-module/#default-og-image',
856
+ 'aiosp_opengraph_dimgwidth' => 'https://semperplugins.com/documentation/social-meta-module/#default-image-width',
857
+ 'aiosp_opengraph_dimgheight' => 'https://semperplugins.com/documentation/social-meta-module/#default-image-height',
858
+ 'aiosp_opengraph_meta_key' => 'https://semperplugins.com/documentation/social-meta-module/#use-custom-field-for-image',
859
+
860
+ // Social Profile Links.
861
+ 'aiosp_opengraph_profile_links' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links',
862
+ 'aiosp_opengraph_person_or_org' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links',
863
+ 'aiosp_opengraph_social_name' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links',
864
+
865
+ // Facebook Settings.
866
+ 'aiosp_opengraph_key' => 'https://semperplugins.com/documentation/social-meta-module/#facebook-admin-id',
867
+ 'aiosp_opengraph_appid' => 'https://semperplugins.com/documentation/social-meta-module/#facebook-app-id',
868
+ 'aiosp_opengraph_gen_tags' => 'https://semperplugins.com/documentation/social-meta-module/#automatically-generate-article-tags',
869
+ 'aiosp_opengraph_gen_keywords' => 'https://semperplugins.com/documentation/social-meta-module/#use-keywords-in-article-tags',
870
+ 'aiosp_opengraph_gen_categories' => 'https://semperplugins.com/documentation/social-meta-module/#use-categories-in-article-tags',
871
+ 'aiosp_opengraph_gen_post_tags' => 'https://semperplugins.com/documentation/social-meta-module/#use-post-tags-in-article-tags',
872
+ 'aiosp_opengraph_types' => 'https://semperplugins.com/documentation/social-meta-module/#enable-facebook-meta-for',
873
+ 'aiosp_opengraph_facebook_publisher' => 'https://semperplugins.com/documentation/social-meta-module/#show-facebook-publisher-on-articles',
874
+ 'aiosp_opengraph_facebook_author' => 'https://semperplugins.com/documentation/social-meta-module/#show-facebook-author-on-articles',
875
+
876
+ // Twitter Settings.
877
+ 'aiosp_opengraph_defcard' => 'https://semperplugins.com/documentation/social-meta-module/#default-twitter-card',
878
+ 'aiosp_opengraph_twitter_site' => 'https://semperplugins.com/documentation/social-meta-module/#twitter-site',
879
+ 'aiosp_opengraph_twitter_creator' => 'https://semperplugins.com/documentation/social-meta-module/#show-twitter-author',
880
+ 'aiosp_opengraph_twitter_domain' => 'https://semperplugins.com/documentation/social-meta-module/#twitter-domain',
881
+
882
+ // Advanced Settings.
883
+ 'aiosp_opengraph_title_shortcodes' => 'https://semperplugins.com/documentation/social-meta-module/#run-shortcodes-in-title',
884
+ 'aiosp_opengraph_description_shortcodes' => 'https://semperplugins.com/documentation/social-meta-module/#run-shortcodes-in-description',
885
+ 'aiosp_opengraph_generate_descriptions' => 'https://semperplugins.com/documentation/social-meta-module/#auto-generate-og-descriptions',
886
+
887
+ // POST META.
888
+ 'aioseop_opengraph_settings_title' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#title',
889
+ 'aioseop_opengraph_settings_desc' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#description',
890
+ 'aioseop_opengraph_settings_image' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#image',
891
+ 'aioseop_opengraph_settings_customimg' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-image',
892
+ 'aioseop_opengraph_settings_imagewidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height',
893
+ 'aioseop_opengraph_settings_imageheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height',
894
+ 'aioseop_opengraph_settings_video' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-video',
895
+ 'aioseop_opengraph_settings_videowidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height',
896
+ 'aioseop_opengraph_settings_videoheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height',
897
+ 'aioseop_opengraph_settings_category' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-object-type',
898
+ 'aioseop_opengraph_settings_facebook_debug' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-debug',
899
+ 'aioseop_opengraph_settings_section' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-section',
900
+ 'aioseop_opengraph_settings_tag' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-tags',
901
+ 'aioseop_opengraph_settings_setcard' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#twitter-card-type',
902
+ 'aioseop_opengraph_settings_customimg_twitter' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-twitter-image',
903
+ );
904
+
905
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
906
+ $rtn_help_text[ $k1_slug ] .= '<br /><br /><a href="' . $v1_url . '" target="_blank">' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '</a>';
907
+ }
908
+
909
+ return $rtn_help_text;
910
+ }
911
+
912
+ /**
913
+ * Help Text Robots Generator Module
914
+ *
915
+ * @ignore
916
+ * @since 2.4.2
917
+ * @access private
918
+ *
919
+ * @return array
920
+ */
921
+ private function help_text_robots_generator() {
922
+ $rtn_help_text = array(
923
+ 'aiosp_robots_type' => __( 'Rule Type', 'all-in-one-seo-pack' ),
924
+ 'aiosp_robots_agent' => __( 'User Agent', 'all-in-one-seo-pack' ),
925
+ 'aiosp_robots_path' => __( 'Directory Path', 'all-in-one-seo-pack' ),
926
+ );
927
+
928
+ return $rtn_help_text;
929
+ }
930
+
931
+ /**
932
+ * Help Text File Editor Module
933
+ *
934
+ * @ignore
935
+ * @since 2.4.2
936
+ * @access private
937
+ *
938
+ * @return array
939
+ */
940
+ private function help_text_file_editor() {
941
+ return array(
942
+ 'aiosp_file_editor_htaccfile' => __( '.htaccess editor', 'all-in-one-seo-pack' ),
943
+ );
944
+ }
945
+
946
+ /**
947
+ * Help Text Importer Exporter Module
948
+ *
949
+ * @ignore
950
+ * @since 2.4.2
951
+ * @access private
952
+ *
953
+ * @return array
954
+ */
955
+ private function help_text_importer_exporter() {
956
+ $rtn_help_text = array(
957
+ // Possible HTML link concept IF links become usable inside jQuery UI Tooltips.
958
+ /* 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. */
959
+ 'aiosp_importer_exporter_import_submit' => sprintf( __( 'Choose a valid %1$s .ini file and click &quot;Import&quot; to import options from a previous state or install of %1$s.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ),
960
+ 'aiosp_importer_exporter_export_choices' => __( 'You may choose to export settings from active modules, and content from post data.', 'all-in-one-seo-pack' ),
961
+ /* 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. */
962
+ '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 ),
963
+ );
964
+
965
+ $help_doc_link = array(
966
+ 'aiosp_importer_exporter_import_submit' => 'https://semperplugins.com/documentation/importer-exporter-module/',
967
+ 'aiosp_importer_exporter_export_choices' => 'https://semperplugins.com/documentation/importer-exporter-module/',
968
+ 'aiosp_importer_exporter_export_post_types' => 'https://semperplugins.com/documentation/importer-exporter-module/',
969
+ );
970
+
971
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
972
+ $rtn_help_text[ $k1_slug ] .= '<br /><br /><a href="' . $v1_url . '" target="_blank">' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '</a>';
973
+ }
974
+
975
+ return $rtn_help_text;
976
+ }
977
+
978
+ /**
979
+ * Help Text Bad Robots Module
980
+ *
981
+ * @ignore
982
+ * @since 2.4.2
983
+ * @access private
984
+ *
985
+ * @return array
986
+ */
987
+ private function help_text_bad_robots() {
988
+ return array(
989
+ 'aiosp_bad_robots_block_bots' => __( 'Block requests from user agents that are known to misbehave with 503.', 'all-in-one-seo-pack' ),
990
+ 'aiosp_bad_robots_block_refer' => __( 'Block Referral Spam using HTTP.', 'all-in-one-seo-pack' ),
991
+ 'aiosp_bad_robots_track_blocks' => __( 'Log and show recent requests from blocked bots.', 'all-in-one-seo-pack' ),
992
+ 'aiosp_bad_robots_edit_blocks' => __( 'Check this to edit the list of disallowed user agents for blocking bad bots.', 'all-in-one-seo-pack' ),
993
+ 'aiosp_bad_robots_blocklist' => __( 'This is the list of disallowed user agents used for blocking bad bots.', 'all-in-one-seo-pack' ),
994
+ 'aiosp_bad_robots_referlist' => __( 'This is the list of disallowed referers used for blocking bad bots.', 'all-in-one-seo-pack' ),
995
+ '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' ),
996
+ );
997
+ }
998
+
999
+ /**
1000
+ * Help Text Post Meta (Core Module)
1001
+ *
1002
+ * @ignore
1003
+ * @since 2.4.2
1004
+ * @access private
1005
+ *
1006
+ * @see self::_help_text_opengraph() Also adds Post Meta info.
1007
+ *
1008
+ * @return array
1009
+ */
1010
+ private function help_text_post_meta() {
1011
+ $rtn_help_text = array(
1012
+ 'aiosp_snippet' => __( 'A preview of what this page might look like in search engine results.', 'all-in-one-seo-pack' ),
1013
+ 'aiosp_title' => __( 'A custom title that shows up in the title tag for this page.', 'all-in-one-seo-pack' ),
1014
+ 'aiosp_description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all-in-one-seo-pack' ),
1015
+ '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' ),
1016
+ 'aiosp_custom_link' => __( 'Override the canonical URLs for this post.', 'all-in-one-seo-pack' ),
1017
+ 'aiosp_noindex' => __( 'Check this box to ask search engines not to index this page.', 'all-in-one-seo-pack' ),
1018
+ 'aiosp_nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all-in-one-seo-pack' ),
1019
+ 'aiosp_sitemap_exclude' => __( 'Don\'t display this page in the sitemap.', 'all-in-one-seo-pack' ),
1020
+ 'aiosp_disable' => __( 'Disable SEO on this page.', 'all-in-one-seo-pack' ),
1021
+ 'aiosp_disable_analytics' => __( 'Disable Google Analytics on this page.', 'all-in-one-seo-pack' ),
1022
+ );
1023
+
1024
+ $help_doc_link = array(
1025
+ 'aiosp_snippet' => 'https://semperplugins.com/documentation/post-settings/#preview-snippet',
1026
+ 'aiosp_title' => 'https://semperplugins.com/documentation/post-settings/#title',
1027
+ 'aiosp_description' => 'https://semperplugins.com/documentation/post-settings/#description',
1028
+ 'aiosp_keywords' => 'https://semperplugins.com/documentation/post-settings/#keywords',
1029
+ 'aiosp_custom_link' => 'https://semperplugins.com/documentation/post-settings/#custom-canonical-url',
1030
+ 'aiosp_noindex' => 'https://semperplugins.com/documentation/post-settings/#robots-meta-noindex',
1031
+ 'aiosp_nofollow' => 'https://semperplugins.com/documentation/post-settings/#robots-meta-nofollow',
1032
+ 'aiosp_sitemap_exclude' => 'https://semperplugins.com/documentation/post-settings/#exclude-from-sitemap',
1033
+ 'aiosp_disable' => 'https://semperplugins.com/documentation/post-settings/#disable-on-this-post',
1034
+ 'aiosp_disable_analytics' => 'https://semperplugins.com/documentation/post-settings/#disable-google-analytics',
1035
+ );
1036
+
1037
+ foreach ( $help_doc_link as $k1_slug => $v1_url ) {
1038
+ $rtn_help_text[ $k1_slug ] .= '<br /><br /><a href="' . $v1_url . '" target="_blank">' . __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' ) . '</a>';
1039
+ }
1040
+
1041
+ return $rtn_help_text;
1042
+ }
1043
+
1044
+ /**
1045
+ * Get Help Text
1046
+ *
1047
+ * Gets an individual help text if it exists, otherwise an error is returned
1048
+ * to notify the AIOSEOP Devs.
1049
+ * NOTE: Returning an empty string causes issues with the UI.
1050
+ *
1051
+ * @since 2.4.2
1052
+ *
1053
+ * @param string $slug Module option slug.
1054
+ * @return string
1055
+ */
1056
+ public function get_help_text( $slug ) {
1057
+ if ( isset( $this->help_text[ $slug ] ) ) {
1058
+ return esc_html( $this->help_text[ $slug ] );
1059
+ }
1060
+ return 'DEV: Missing Help Text: ' . $slug;
1061
+ }
1062
+ }
admin/class-aioseop-notices.php ADDED
@@ -0,0 +1,842 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AIOSEOP Notice API: AIOSEOP Notice Class
4
+ *
5
+ * Handles adding, updating, and removing notices. Then handles activating or
6
+ * deactivating those notices site-wide or user based.
7
+ *
8
+ * @link https://wordpress.org/plugins/all-in-one-seo-pack/
9
+ *
10
+ * @package All_in_One_SEO_Pack
11
+ * @since 3.0
12
+ */
13
+
14
+ if ( ! class_exists( 'AIOSEOP_Notices' ) ) {
15
+ /**
16
+ * AIOSEOP Notice.
17
+ *
18
+ * Admin notices for AIOSEOP.
19
+ *
20
+ * @since 3.0
21
+ */
22
+ class AIOSEOP_Notices {
23
+ /**
24
+ * Collection of notices to display.
25
+ *
26
+ * @since 3.0
27
+ * @access public
28
+ *
29
+ * @var array $notices {
30
+ * @type array $slug {
31
+ * -- Server Variables --
32
+ * @type string $slug Required. Notice unique ID.
33
+ * @type int $time_start The time the notice was added to the object.
34
+ * @type int $time_set Set when AJAX/Action_Option was last used to delay time. Primarily for PHPUnit tests.
35
+ *
36
+ * -- Filter Function Variables --
37
+ * @type int $delay_time Amount of time to begin showing message.
38
+ * @type string $message Content message to display in the container.
39
+ * @type array $action_option {
40
+ * Show options for users to click on. Default: See self::action_option_defaults().
41
+ * @type array {
42
+ * @type int $time Optional. The amount of time to delay. Zero immediately displays Default: 0.
43
+ * @type string $text Optional. Button/Link HTML text to display. Default: ''.
44
+ * @type string $class Optional. Class names to add to the link/button for styling. Default: ''.
45
+ * @type string $link Optional. The elements href source/link. Default: '#'.
46
+ * @type boolean $dismiss Optional. Variable for AJAX to dismiss showing a notice.
47
+ * }
48
+ * }
49
+ * @type string $class The class notice used by WP, or a custom CSS class.
50
+ * Ex. notice-error, notice-warning, notice-success, notice-info.
51
+ * @type string $target Shows based on site-wide or user notice data.
52
+ * @todo string $perms Displays based on user-role/permissions.
53
+ * @type array $screens Which screens to exclusively display the notice on. Default: array().
54
+ * array() = all,
55
+ * array('aioseop') = $this->aioseop_screens,
56
+ * array('CUSTOM') = specific screen(s).
57
+ * }
58
+ * }
59
+ */
60
+ public $notices = array();
61
+
62
+ /**
63
+ * List of notice slugs that are currently active.
64
+ * NOTE: Amount is reduced by 1 second in order to display at exactly X amount of time.
65
+ *
66
+ * @todo Change name to $display_times for consistancy both conceptually and with usermeta structure.
67
+ *
68
+ * @since 3.0
69
+ * @access public
70
+ *
71
+ * @var array $active_notices {
72
+ * @type string|int $slug => $display_time Contains the current active notices
73
+ * that are scheduled to be displayed.
74
+ * }
75
+ */
76
+ public $active_notices = array();
77
+
78
+ /**
79
+ * Dismissed Notices
80
+ *
81
+ * Stores notices that have been dismissed sitewide. Users are stored in usermeta data 'aioseop_notice_dismissed_{$slug}'.
82
+ *
83
+ * @since 3.0
84
+ *
85
+ * @var array $dismissed {
86
+ * @type boolean $notice_slug => $is_dismissed True if dismissed.
87
+ * }
88
+ */
89
+ public $dismissed = array();
90
+
91
+ /**
92
+ * The default dismiss time. An anti-nag setting.
93
+ *
94
+ * @var int $default_dismiss_delay
95
+ */
96
+ private $default_dismiss_delay = 180;
97
+
98
+ /**
99
+ * List of Screens used in AIOSEOP.
100
+ *
101
+ * @since 3.0
102
+ *
103
+ * @var array $aioseop_screens {
104
+ * @type string Screen ID.
105
+ * }
106
+ */
107
+ private $aioseop_screens = array();
108
+
109
+ /**
110
+ * __constructor.
111
+ *
112
+ * @since 3.0
113
+ */
114
+ public function __construct() {
115
+ $this->_requires();
116
+ if ( current_user_can( 'aiosp_manage_seo' ) ) {
117
+
118
+ $this->aioseop_screens[] = 'toplevel_page_' . AIOSEOP_PLUGIN_DIRNAME . '/aioseop_class';
119
+ $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_performance';
120
+ $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_sitemap';
121
+ $this->aioseop_screens[] = 'all-in-one-seo_page_aiosp_opengraph';
122
+ $this->aioseop_screens[] = 'all-in-one-seo_page_aiosp_robots_generator';
123
+ $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_robots';
124
+ $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_file_editor';
125
+ $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_importer_exporter';
126
+ $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_bad_robots';
127
+ $this->aioseop_screens[] = 'all-in-one-seo_page_' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_feature_manager';
128
+
129
+ $this->obj_load_options();
130
+
131
+ add_action( 'admin_init', array( $this, 'init' ) );
132
+ add_action( 'current_screen', array( $this, 'admin_screen' ) );
133
+ }
134
+ }
135
+
136
+ /**
137
+ * _Requires
138
+ *
139
+ * Internal use only. Additional files required.
140
+ *
141
+ * @since 3.0
142
+ */
143
+ private function _requires() {
144
+ $this->autoload_notice_files();
145
+ }
146
+
147
+ /**
148
+ * Autoload Notice Files
149
+ *
150
+ * @since 3.0
151
+ *
152
+ * @see DirectoryIterator class
153
+ * @link https://php.net/manual/en/class.directoryiterator.php
154
+ * @see StackOverflow for getting all filenamess in a directory.
155
+ * @link https://stackoverflow.com/a/25988433/1376780
156
+ */
157
+ private function autoload_notice_files() {
158
+ foreach ( new DirectoryIterator( AIOSEOP_PLUGIN_DIR . 'admin/display/notices/' ) as $file ) {
159
+ if ( $file->isFile() && 'php' === $file->getExtension() ) {
160
+ $filename = $file->getFilename();
161
+
162
+ // Qualified file pattern; "*-notice.php".
163
+ // Prevents any malicious files that may have spreaded.
164
+ if ( array_search( 'notice', explode( '-', str_replace( '.php', '', $filename ) ), true ) ) {
165
+ include_once AIOSEOP_PLUGIN_DIR . 'admin/display/notices/' . $filename;
166
+ }
167
+ }
168
+ }
169
+ }
170
+
171
+ /**
172
+ * Early operations required by the plugin.
173
+ *
174
+ * AJAX requires being added early before screens have been loaded.
175
+ *
176
+ * @since 3.0
177
+ */
178
+ public function init() {
179
+ add_action( 'wp_ajax_aioseop_notice', array( $this, 'ajax_notice_action' ) );
180
+ }
181
+
182
+ /**
183
+ * Setup/Init Admin Screen
184
+ *
185
+ * Adds the initial actions to WP based on the Admin Screen being loaded.
186
+ * The AIOSEOP and Other Screens have separate methods that are used, and
187
+ * additional screens can be made exclusive/unique.
188
+ *
189
+ * @since 3.0
190
+ *
191
+ * @param WP_Screen $current_screen The current screen object being loaded.
192
+ */
193
+ public function admin_screen( $current_screen ) {
194
+ $this->deregister_scripts();
195
+ if ( isset( $current_screen->id ) && in_array( $current_screen->id, $this->aioseop_screens, true ) ) {
196
+ // AIOSEO Notice Content.
197
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
198
+ add_action( 'all_admin_notices', array( $this, 'display_notice_aioseop' ) );
199
+ } elseif ( isset( $current_screen->id ) ) {
200
+ // Default WP Notice.
201
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
202
+ add_action( 'all_admin_notices', array( $this, 'display_notice_default' ) );
203
+ }
204
+ }
205
+
206
+ /**
207
+ * Load AIOSEOP_Notice Options
208
+ *
209
+ * Gets the options for AIOSEOP_Notice to set its variables to.
210
+ *
211
+ * @since 3.0
212
+ * @access private
213
+ *
214
+ * @see self::notices
215
+ * @see self::active_notices
216
+ */
217
+ private function obj_load_options() {
218
+ $notices_options = $this->obj_get_options();
219
+
220
+ $this->notices = $notices_options['notices'];
221
+ $this->active_notices = $notices_options['active_notices'];
222
+ }
223
+
224
+ /**
225
+ * Get AIOSEOP_Notice Options
226
+ *
227
+ * @since 3.0
228
+ * @access private
229
+ *
230
+ * @return array
231
+ */
232
+ private function obj_get_options() {
233
+ $defaults = array(
234
+ 'notices' => array(),
235
+ 'active_notices' => array(),
236
+ );
237
+
238
+ $notices_options = get_option( 'aioseop_notices' );
239
+ if ( false === $notices_options ) {
240
+ return $defaults;
241
+ }
242
+
243
+ return wp_parse_args( $notices_options, $defaults );
244
+ }
245
+
246
+ /**
247
+ * Update Notice Options
248
+ *
249
+ * @since 3.0
250
+ * @access private
251
+ *
252
+ * @return boolean True if successful, using update_option() return value.
253
+ */
254
+ private function obj_update_options() {
255
+ $notices_options = array(
256
+ 'notices' => $this->notices,
257
+ 'active_notices' => $this->active_notices,
258
+ );
259
+ $old_notices_options = $this->obj_get_options();
260
+ $notices_options = wp_parse_args( $notices_options, $old_notices_options );
261
+
262
+ return update_option( 'aioseop_notices', $notices_options, false );
263
+ }
264
+
265
+ /**
266
+ * Notice Default Values
267
+ *
268
+ * Returns the default value for a variable to be used in self::notices[].
269
+ *
270
+ * @since 3.0
271
+ *
272
+ * @see AIOSEOP_Notices::notices Array variable that stores the collection of notices.
273
+ *
274
+ * @return array Notice variable in self::notices.
275
+ */
276
+ public function notice_defaults() {
277
+ return array_merge(
278
+ $this->notice_defaults_server(),
279
+ $this->notice_defaults_file()
280
+ );
281
+ }
282
+
283
+ /**
284
+ * Notice Defaults Server
285
+ *
286
+ * @since 3.0
287
+ *
288
+ * @return array
289
+ */
290
+ public function notice_defaults_server() {
291
+ return array(
292
+ 'slug' => '',
293
+ 'time_start' => time(),
294
+ 'time_set' => time(),
295
+ );
296
+ }
297
+
298
+ /**
299
+ * Notice Defaults File
300
+ *
301
+ * @since 3.0
302
+ *
303
+ * @return array
304
+ */
305
+ public function notice_defaults_file() {
306
+ return array(
307
+ 'slug' => '',
308
+ 'delay_time' => 0,
309
+ 'message' => '',
310
+ 'action_options' => array(),
311
+ 'class' => 'notice-info',
312
+ 'target' => 'site',
313
+ 'screens' => array(),
314
+ );
315
+ }
316
+
317
+ /**
318
+ * Action Options Default Values
319
+ *
320
+ * Returns the default value for action_options in self::notices[$slug]['action_options'].
321
+ *
322
+ * @since 3.0
323
+ *
324
+ * @return array Action_Options variable in self::notices[$slug]['action_options'].
325
+ */
326
+ public function action_options_defaults() {
327
+ return array(
328
+ 'time' => 0,
329
+ 'text' => __( 'Dismiss', 'all-in-one-seo-pack' ),
330
+ 'link' => '#',
331
+ 'dismiss' => true,
332
+ 'class' => '',
333
+ );
334
+ }
335
+
336
+ /**
337
+ * Add Notice
338
+ *
339
+ * Takes notice and adds it to object and saves to database.
340
+ *
341
+ * @since 3.0
342
+ *
343
+ * @param array $notice See self::notices for more info.
344
+ * @return boolean True on success.
345
+ */
346
+ public function add_notice( $notice = array() ) {
347
+ if ( empty( $notice['slug'] ) || isset( $this->notices[ $notice['slug'] ] ) ) {
348
+ return false;
349
+ }
350
+
351
+ $this->notices[ $notice['slug'] ] = $this->prepare_notice( $notice );
352
+
353
+ return true;
354
+ }
355
+
356
+ /**
357
+ * Prepare Insert/Undate Notice
358
+ *
359
+ * @since 3.0
360
+ *
361
+ * @param array $notice The notice to prepare with the database.
362
+ * @return array
363
+ */
364
+ public function prepare_notice( $notice = array() ) {
365
+ $notice_default = $this->notice_defaults_server();
366
+ $notice = wp_parse_args( $notice, $notice_default );
367
+
368
+ $new_notice = array();
369
+ foreach ( $notice_default as $key => $value ) {
370
+ $new_notice[ $key ] = $notice[ $key ];
371
+ }
372
+
373
+ return $new_notice;
374
+ }
375
+
376
+ /**
377
+ * Used strictly for any notices that are deprecated/obsolete. To stop notices,
378
+ * use notice_deactivate().
379
+ *
380
+ * @since 3.0
381
+ *
382
+ * @param string $slug Unique notice slug.
383
+ * @return boolean True if successfully removed.
384
+ */
385
+ public function remove_notice( $slug ) {
386
+ if ( isset( $this->notices[ $slug ] ) ) {
387
+ $this->deactivate_notice( $slug );
388
+ unset( $this->notices[ $slug ] );
389
+ $this->obj_update_options();
390
+ return true;
391
+ }
392
+
393
+ return false;
394
+ }
395
+
396
+ /**
397
+ * Activate Notice
398
+ *
399
+ * Activates a notice, or Re-activates with a new display time. Used after
400
+ * updating a notice that requires a hard reset.
401
+ *
402
+ * @since 3.0
403
+ *
404
+ * @param string $slug Notice slug.
405
+ * @return boolean
406
+ */
407
+ public function activate_notice( $slug ) {
408
+ if ( empty( $slug ) ) {
409
+ return false;
410
+ }
411
+ $notice = $this->get_notice( $slug );
412
+ if ( 'site' === $notice['target'] && isset( $this->active_notices[ $slug ] ) ) {
413
+ return true;
414
+ } elseif ( 'user' === $notice['target'] && get_user_meta( get_current_user_id(), 'aioseop_notice_display_time_' . $slug, true ) ) {
415
+ return true;
416
+ }
417
+
418
+ if ( ! isset( $this->notices[ $slug ] ) ) {
419
+ $this->add_notice( $notice );
420
+ }
421
+
422
+ $this->set_notice_delay( $slug, $notice['delay_time'] );
423
+
424
+ $this->obj_update_options();
425
+
426
+ return true;
427
+ }
428
+
429
+ /**
430
+ * Deactivate Notice
431
+ *
432
+ * Deactivates a notice set as active and completely removes it from the
433
+ * list of active notices. Used to prevent conflicting notices that may be
434
+ * active at any given point in time.
435
+ *
436
+ * @since 3.0
437
+ *
438
+ * @param string $slug Notice slug.
439
+ * @return boolean
440
+ */
441
+ public function deactivate_notice( $slug ) {
442
+ if ( ! isset( $this->active_notices[ $slug ] ) ) {
443
+ return false;
444
+ } elseif ( ! isset( $this->notices[ $slug ] ) ) {
445
+ return false;
446
+ }
447
+
448
+ delete_metadata(
449
+ 'user',
450
+ 0,
451
+ 'aioseop_notice_display_time_' . $slug,
452
+ '',
453
+ true
454
+ );
455
+ unset( $this->active_notices[ $slug ] );
456
+ $this->obj_update_options();
457
+
458
+ return true;
459
+ }
460
+
461
+ /**
462
+ * Reset Notice
463
+ *
464
+ * @since 3.0
465
+ *
466
+ * @param string $slug The notice's slug.
467
+ * @return bool
468
+ */
469
+ public function reset_notice( $slug ) {
470
+ if (
471
+ empty( $slug ) ||
472
+ (
473
+ ! isset( $this->notices[ $slug ] ) &&
474
+ ! get_user_meta( get_current_user_id(), 'aioseop_notice_display_time_' . $slug, true ) &&
475
+ ! get_user_meta( get_current_user_id(), 'aioseop_notice_dismissed_' . $slug, true )
476
+ )
477
+ ) {
478
+ return false;
479
+ }
480
+
481
+ $notice = $this->get_notice( $slug );
482
+
483
+ unset( $this->active_notices[ $slug ] );
484
+ unset( $this->dismissed[ $slug ] );
485
+ delete_metadata(
486
+ 'user',
487
+ 0,
488
+ 'aioseop_notice_time_set_' . $slug,
489
+ '',
490
+ true
491
+ );
492
+ delete_metadata(
493
+ 'user',
494
+ 0,
495
+ 'aioseop_notice_display_time_' . $slug,
496
+ '',
497
+ true
498
+ );
499
+ delete_metadata(
500
+ 'user',
501
+ 0,
502
+ 'aioseop_notice_dismissed_' . $slug,
503
+ '',
504
+ true
505
+ );
506
+
507
+ $this->set_notice_delay( $slug, $notice['delay_time'] );
508
+
509
+ $this->obj_update_options();
510
+
511
+ return true;
512
+ }
513
+
514
+ /**
515
+ * Set Notice Delay
516
+ *
517
+ * @since 3.0
518
+ *
519
+ * @param string $slug The notice's slug.
520
+ * @param int $delay_time Amount of time to delay.
521
+ * @return boolean
522
+ */
523
+ public function set_notice_delay( $slug, $delay_time ) {
524
+ if ( empty( $slug ) ) {
525
+ return false;
526
+ }
527
+ $time_set = time();
528
+
529
+ // Display at exactly X time, not (X + 1) time.
530
+ $display_time = $time_set + $delay_time - 1;
531
+ $notice = $this->get_notice( $slug );
532
+ if ( 'user' === $notice['target'] ) {
533
+ $current_user_id = get_current_user_id();
534
+
535
+ update_user_meta( $current_user_id, 'aioseop_notice_time_set_' . $slug, $time_set );
536
+ update_user_meta( $current_user_id, 'aioseop_notice_display_time_' . $slug, $display_time );
537
+ }
538
+
539
+ $this->notices[ $slug ]['time_set'] = $time_set;
540
+ $this->active_notices[ $slug ] = $display_time;
541
+
542
+ return true;
543
+ }
544
+
545
+ /**
546
+ * Set Notice Dismiss
547
+ *
548
+ * @since 3.0
549
+ *
550
+ * @param string $slug The notice's slug.
551
+ * @param boolean $dismiss Sets to dismiss a notice.
552
+ */
553
+ public function set_notice_dismiss( $slug, $dismiss ) {
554
+ $notice = $this->get_notice( $slug );
555
+ if ( 'site' === $notice['target'] ) {
556
+ $this->dismissed[ $slug ] = $dismiss;
557
+ } elseif ( 'user' === $notice['target'] ) {
558
+ $current_user_id = get_current_user_id();
559
+
560
+ update_user_meta( $current_user_id, 'aioseop_notice_dismissed_' . $slug, $dismiss );
561
+ }
562
+ }
563
+
564
+ /**
565
+ * Get Notice
566
+ *
567
+ * @since 3.0
568
+ *
569
+ * @param string $slug The notice's slug.
570
+ * @return array
571
+ */
572
+ public function get_notice( $slug ) {
573
+ // Set defaults for notice.
574
+ $rtn_notice = $this->notice_defaults();
575
+
576
+ if ( isset( $this->notices[ $slug ] ) ) {
577
+ // Get minimized (database) data.
578
+ $rtn_notice = array_merge( $rtn_notice, $this->notices[ $slug ] );
579
+ }
580
+
581
+ /**
582
+ * Admin Notice {$slug}
583
+ *
584
+ * Applies the notice data values for a given notice slug.
585
+ * `aioseop_admin_notice-{$slug}` with the slug being the individual notice.
586
+ *
587
+ * @since 3.0
588
+ *
589
+ * @params array $notice_data See `\AIOSEOP_Notices::$notices` for structural documentation.
590
+ */
591
+ $notice_data = apply_filters( 'aioseop_admin_notice-' . $slug, array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
592
+
593
+ if ( ! empty( $notice_data ) ) {
594
+ $rtn_notice = array_merge( $rtn_notice, $notice_data );
595
+
596
+ foreach ( $rtn_notice['action_options'] as &$action_option ) {
597
+ // Set defaults for `$notice['action_options']`.
598
+ $action_option = array_merge( $this->action_options_defaults(), $action_option );
599
+ }
600
+ }
601
+
602
+ return $rtn_notice;
603
+ }
604
+
605
+ /*** DISPLAY Methods **************************************************/
606
+ /**
607
+ * Deregister Scripts
608
+ *
609
+ * Initial Admin Screen action to remove aioseop script(s) from all screens;
610
+ * which will be registered if executed on screen.
611
+ * NOTE: As of 3.0, most of it is default layout, styling, & scripting
612
+ * that is loaded on all pages. Which can later be different.
613
+ *
614
+ * @since 3.0
615
+ * @access private
616
+ *
617
+ * @see self::admin_screen()
618
+ */
619
+ private function deregister_scripts() {
620
+ wp_deregister_script( 'aioseop-admin-notice-js' );
621
+ wp_deregister_style( 'aioseop-admin-notice-css' );
622
+ }
623
+
624
+ /**
625
+ * (Register) Enqueue Scripts
626
+ *
627
+ * Used to register, enqueue, and localize any JS data. Styles can later be added.
628
+ *
629
+ * @since 3.0
630
+ */
631
+ public function admin_enqueue_scripts() {
632
+ // Register.
633
+ wp_register_script(
634
+ 'aioseop-admin-notice-js',
635
+ AIOSEOP_PLUGIN_URL . 'js/admin-notice.js',
636
+ array( 'jquery' ),
637
+ AIOSEOP_VERSION,
638
+ true
639
+ );
640
+
641
+ // Localization.
642
+ $notice_actions = array();
643
+ foreach ( $this->active_notices as $notice_slug => $notice_display_time ) {
644
+ $notice = $this->get_notice( $notice_slug );
645
+ foreach ( $notice['action_options'] as $action_index => $action_arr ) {
646
+ $notice_actions[ $notice_slug ][] = $action_index;
647
+ }
648
+ }
649
+
650
+ $admin_notice_localize = array(
651
+ 'notice_nonce' => wp_create_nonce( 'aioseop_ajax_notice' ),
652
+ 'notice_actions' => $notice_actions,
653
+ );
654
+ wp_localize_script( 'aioseop-admin-notice-js', 'aioseop_notice_data', $admin_notice_localize );
655
+
656
+ // Enqueue.
657
+ wp_enqueue_script( 'aioseop-admin-notice-js' );
658
+
659
+ wp_enqueue_style(
660
+ 'aioseop-admin-notice-css',
661
+ AIOSEOP_PLUGIN_URL . 'css/admin-notice.css',
662
+ false,
663
+ AIOSEOP_VERSION,
664
+ false
665
+ );
666
+ }
667
+
668
+ /**
669
+ * Display Notice as Default
670
+ *
671
+ * Method for default WP Admin notices.
672
+ * NOTE: As of 3.0, display_notice_default() & display_notice_aioseop()
673
+ * have the same functionality, but serves as a future development concept.
674
+ *
675
+ * @since 3.0
676
+ *
677
+ * @uses AIOSEOP_PLUGIN_DIR . 'admin/display/notice-default.php' Template for default notices.
678
+ *
679
+ * @return void
680
+ */
681
+ public function display_notice_default() {
682
+ $this->display_notice( 'default' );
683
+ }
684
+
685
+ /**
686
+ * Display Notice as AIOSEOP Screens
687
+ *
688
+ * Method for Admin notices exclusive to AIOSEOP screens.
689
+ * NOTE: As of 3.0, display_notice_default() & display_notice_aioseop()
690
+ * have the same functionality, but serves as a future development concept.
691
+ *
692
+ * @since 3.0
693
+ *
694
+ * @uses AIOSEOP_PLUGIN_DIR . 'admin/display/notice-aioseop.php' Template for notices.
695
+ *
696
+ * @return void
697
+ */
698
+ public function display_notice_aioseop() {
699
+ $this->display_notice( 'aioseop' );
700
+ }
701
+
702
+ /**
703
+ * Display Notice
704
+ *
705
+ * @since 2.8
706
+ *
707
+ * @param string $template Slug name for template.
708
+ */
709
+ public function display_notice( $template ) {
710
+ if ( ! wp_script_is( 'aioseop-admin-notice-js', 'enqueued' ) || ! wp_style_is( 'aioseop-admin-notice-css', 'enqueued' ) ) {
711
+ return;
712
+ } elseif ( 'default' !== $template && 'aioseop' !== $template ) {
713
+ return;
714
+ } elseif ( ! current_user_can( 'aiosp_manage_seo' ) ) {
715
+ return;
716
+ }
717
+
718
+ $current_screen = get_current_screen();
719
+ $current_user_id = get_current_user_id();
720
+ foreach ( $this->active_notices as $a_notice_slug => $a_notice_time_display ) {
721
+ $notice_show = true;
722
+ $notice = $this->get_notice( $a_notice_slug );
723
+
724
+ // Screen Restriction.
725
+ if ( ! empty( $notice['screens'] ) ) {
726
+ // Checks if on aioseop screen.
727
+ if ( in_array( 'aioseop', $notice['screens'], true ) ) {
728
+ if ( ! in_array( $current_screen->id, $this->aioseop_screens, true ) ) {
729
+ continue;
730
+ }
731
+ }
732
+
733
+ // Checks the other screen restrictions by slug/id.
734
+ if ( ! in_array( 'aioseop', $notice['screens'], true ) ) {
735
+ if ( ! in_array( $current_screen->id, $notice['screens'], true ) ) {
736
+ continue;
737
+ }
738
+ }
739
+ }
740
+
741
+ if ( isset( $this->dismissed[ $a_notice_slug ] ) && $this->dismissed[ $a_notice_slug ] ) {
742
+ $notice_show = false;
743
+ }
744
+
745
+ // User Settings.
746
+ if ( 'user' === $notice['target'] ) {
747
+ $user_dismissed = get_user_meta( $current_user_id, 'aioseop_notice_dismissed_' . $a_notice_slug, true );
748
+ if ( ! $user_dismissed ) {
749
+ $user_notice_time_display = get_user_meta( $current_user_id, 'aioseop_notice_display_time_' . $a_notice_slug, true );
750
+ if ( ! empty( $user_notice_time_display ) ) {
751
+ $a_notice_time_display = intval( $user_notice_time_display );
752
+ }
753
+ } else {
754
+ $notice_show = false;
755
+ }
756
+ }
757
+
758
+ // Display/Render.
759
+ $important_admin_notices = array(
760
+ 'notice-error',
761
+ 'notice-warning',
762
+ 'notice-do-nag',
763
+ );
764
+ if ( defined( 'DISABLE_NAG_NOTICES' ) && true === DISABLE_NAG_NOTICES && ( ! in_array( $notice['class'], $important_admin_notices, true ) ) ) {
765
+ // Skip if `DISABLE_NAG_NOTICES` is implemented (as true).
766
+ // Important notices, WP's CSS `notice-error` & `notice-warning`, are still rendered.
767
+ continue;
768
+ } elseif ( time() > $a_notice_time_display && $notice_show ) {
769
+ include AIOSEOP_PLUGIN_DIR . 'admin/display/notice-' . $template . '.php';
770
+ }
771
+ }
772
+ }
773
+
774
+ /**
775
+ * AJAX Notice Action
776
+ *
777
+ * Fires when a Action_Option is clicked and sent via AJAX. Also includes
778
+ * WP Default Dismiss (rendered as a clickable button on upper-right).
779
+ *
780
+ * @since 3.0
781
+ *
782
+ * @see AIOSEOP_PLUGIN_DIR . 'js/admin-notice.js'
783
+ */
784
+ public function ajax_notice_action() {
785
+ check_ajax_referer( 'aioseop_ajax_notice' );
786
+ if ( ! current_user_can( 'aiosp_manage_seo' ) ) {
787
+ wp_send_json_error( __( "User doesn't have `aiosp_manage_seo` capabilities.", 'all-in-one-seo-pack' ) );
788
+ }
789
+ // Notice (Slug) => (Action_Options) Index.
790
+ $notice_slug = null;
791
+ $action_index = null;
792
+ if ( isset( $_POST['notice_slug'] ) ) {
793
+ $notice_slug = filter_input( INPUT_POST, 'notice_slug', FILTER_SANITIZE_STRING );
794
+
795
+ // When PHPUnit is unable to use filter_input.
796
+ if ( defined( 'AIOSEOP_UNIT_TESTING' ) && null === $notice_slug && ! empty( $_POST['notice_slug'] ) ) {
797
+ $notice_slug = $_POST['notice_slug'];
798
+ }
799
+ }
800
+ if ( isset( $_POST['action_index'] ) ) {
801
+ $action_index = filter_input( INPUT_POST, 'action_index', FILTER_SANITIZE_STRING );
802
+
803
+ // When PHPUnit is unable to use filter_input.
804
+ if ( defined( 'AIOSEOP_UNIT_TESTING' ) && null === $action_index && ( ! empty( $_POST['action_index'] ) || 0 === $_POST['action_index'] ) ) {
805
+ $action_index = $_POST['action_index'];
806
+ }
807
+ }
808
+ if ( empty( $notice_slug ) ) {
809
+ /* Translators: Displays the hordcoded slug that missing. */
810
+ wp_send_json_error( sprintf( __( 'Missing values from `%s`.', 'all-in-one-seo-pack' ), 'notice_slug' ) );
811
+ } elseif ( empty( $action_index ) && 0 !== $action_index ) {
812
+ /* Translators: Displays the hordcoded slug that missing. */
813
+ wp_send_json_error( sprintf( __( 'Missing values from `%s`.', 'all-in-one-seo-pack' ), 'action_index' ) );
814
+ }
815
+
816
+ $action_options = $this->action_options_defaults();
817
+ $action_options['time'] = $this->default_dismiss_delay;
818
+ $action_options['dismiss'] = false;
819
+
820
+ $notice = $this->get_notice( $notice_slug );
821
+
822
+ if ( isset( $notice['action_options'][ $action_index ] ) ) {
823
+ $action_options = array_merge( $action_options, $notice['action_options'][ $action_index ] );
824
+ }
825
+
826
+ if ( $action_options['time'] ) {
827
+ $this->set_notice_delay( $notice_slug, $action_options['time'] );
828
+ }
829
+ if ( $action_options['dismiss'] ) {
830
+ $this->set_notice_dismiss( $notice_slug, $action_options['dismiss'] );
831
+ }
832
+
833
+ $this->obj_update_options();
834
+ wp_send_json_success( __( 'Notice updated successfully.', 'all-in-one-seo-pack' ) );
835
+ }
836
+
837
+ }
838
+ // CLASS INITIALIZATION.
839
+ // Should this be a singleton class instead of a global?
840
+ global $aioseop_notices;
841
+ $aioseop_notices = new AIOSEOP_Notices();
842
+ }
admin/display/credits-content.php CHANGED
@@ -1,6 +1,8 @@
1
  <div class="wrap credits-wrap">
2
 
3
- <p class="about-description"><?php _e( 'All in One SEO Pack is created by a worldwide network of friendly folks like these.', 'all-in-one-seo-pack' ); ?></p>
 
 
4
 
5
  <h3 class="wp-people-group"><?php _e( 'Project Leaders', 'all-in-one-seo-pack' ); ?></h3>
6
  <ul class="wp-people-group " id="wp-people-group-project-leaders">
@@ -14,11 +16,11 @@
14
  Steve Mortiboy</a>
15
  <span class="title"><?php _e( 'Project Manager', 'all-in-one-seo-pack' ); ?></span>
16
  </li>
17
- <li class="wp-person" id="wp-person-yuqianliu">
18
- <a class="web" target="_blank" href="https://profiles.wordpress.org/yuqianl"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/8f971bea2b6c483fd1099e558013a7d0?s=60">
19
- Yuqian Liu</a>
20
- <span class="title"><?php _e( 'Project Manager', 'all-in-one-seo-pack' ); ?></span>
21
- </li>
22
  </ul>
23
 
24
  <h3 class="wp-people-group"><?php printf( __( 'Core Team', 'all-in-one-seo-pack' ) ); ?></h3>
@@ -29,16 +31,16 @@
29
  <span class="title"><?php _e( 'Team Lead', 'all-in-one-seo-pack' ); ?></span>
30
  </li>
31
 
32
- <li class="wp-person" id="rozroz">
33
- <a class="web" target="_blank" href="https://github.com/contactashish13"><img alt="" class="gravatar" src="https://avatars2.githubusercontent.com/u/12953439?s=60">
34
- Ashish Ravi</a>
35
- <span class="title"><?php _e( 'Development Team', 'all-in-one-seo-pack' ); ?></span>
36
- </li>
37
- <li class="wp-person" id="EkoJR">
38
- <a class="web" target="_blank" href="https://profiles.wordpress.org/EkoJR/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/bb4c78fe944b58bd5f127d836500c30a?s=200&d=mm&r=g">
39
- Ben Reames</a>
40
- <span class="title"><?php _e( 'Development Team', 'all-in-one-seo-pack' ); ?></span>
41
- </li>
42
 
43
  </ul>
44
 
@@ -55,24 +57,24 @@
55
  </li>
56
  <li class="wp-person" id="wp-person-mayukojpn">
57
  <a class="web" target="_blank" href="https://github.com/rebeccahum"><img alt="" class="gravatar" src="https://2.gravatar.com/avatar/b57b5efcabe3e01833849390ad7d3129?s=60">
58
- Rebecca Hum</a>
59
- </li>
60
- <li class="wp-person" id="wp-person-mayukojpn">
61
- <a class="web" target="_blank" href="https://profiles.wordpress.org/mayukojpn/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/79294868a241e80ea4fda34c618b8a11?s=60">
62
- Mayo Moriyama</a>
63
- </li>
64
- <li class="wp-person" id="wp-person-dougalcampbell">
65
- <a class="web" target="_blank" href="https://profiles.wordpress.org/dougal/"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/81717a172b6918071fbea1a52483294b?s=60">
66
- Dougal Campbell</a>
67
- </li>
68
  <li class="wp-person" id="wp-person-alejandromostajo">
69
  <a class="web" target="_blank" href="https://github.com/amostajo"><img alt="" class="gravatar" src="https://avatars1.githubusercontent.com/u/1645908?s=60">
70
  Alejandro Mostajo</a>
71
  </li>
72
- <li class="wp-person" id="wp-person-aaronbrodney">
73
- <a class="web" target="_blank" href="https://github.com/theycalledmetaz"><img alt="" class="gravatar" src="https://avatars3.githubusercontent.com/u/8225725?v=3&s=60">
74
- Aaron Brodney</a>
75
- </li>
76
  <li class="wp-person" id="rozroz">
77
  <a class="web" target="_blank" href="https://profiles.wordpress.org/yummy-wp/"><img alt="" class="gravatar" src="https://avatars0.githubusercontent.com/u/22232968?v=3&s=460">
78
  Stanislav Samoilenko</a>
@@ -81,34 +83,34 @@
81
  <a class="web" target="_blank" href="https://profiles.wordpress.org/shoheitanaka"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/677e512c803c40c0180d4514f876a21f?s=200&d=mm&r=g">
82
  Shohei Tanaka</a>
83
  </li>
84
- <li class="wp-person" id="webaware">
85
- <a class="web" target="_blank" href="https://profiles.wordpress.org/webaware/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/aee800bc3644d9ebfa33c1ed9df5d958?s=200&d=mm&r=g">
86
- Ross McKay</a>
87
- </li>
88
- <li class="wp-person" id="adamsilverstein">
89
- <a class="web" target="_blank" href="https://profiles.wordpress.org/adamsilverstein/"><img alt=""
90
- class="gravatar"
91
- src="https://secure.gravatar.com/avatar/fddbd6c3e1c3d971aa732b9346aeb433?s=200&d=mm&r=g">
92
- Adam Silverstein</a>
93
- </li>
94
- <li class="wp-person" id="vschettino">
95
- <a class="web" target="_blank" href="https://github.com/vschettino/"><img alt=""
96
- class="gravatar"
97
- src="https://avatars2.githubusercontent.com/u/7289698?s=460&v=4">
98
- Vinicius Schettino</a>
99
- </li>
100
- <li class="wp-person" id="vschettino">
101
- <a class="web" target="_blank" href="https://github.com/srdjan-jcc"><img alt=""
102
- class="gravatar"
103
- src="https://avatars2.githubusercontent.com/u/3109112?s=460&v=4">
104
- Srdjan Jocic</a>
105
- </li>
106
- <li class="wp-person" id="vschettino">
107
- <a class="web" target="_blank" href="https://profiles.wordpress.org/soulseekah/"><img alt=""
108
- class="gravatar"
109
- src="https://avatars0.githubusercontent.com/u/685880?s=460&v=4">
110
- Gennady Kovshenin</a>
111
- </li>
112
  </ul>
113
 
114
  <h3 class="wp-people-group dashicons-before dashicons-translation"><?php printf( _e( 'Translation contributors and translation editors', 'all-in-one-seo-pack' ), '1.2' ); ?></h3>
1
  <div class="wrap credits-wrap">
2
 
3
+ <p class="about-description"><?php
4
+ /* 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. */
5
+ printf( __( '%s is created by a worldwide network of friendly folks like these.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ); ?></p>
6
 
7
  <h3 class="wp-people-group"><?php _e( 'Project Leaders', 'all-in-one-seo-pack' ); ?></h3>
8
  <ul class="wp-people-group " id="wp-people-group-project-leaders">
16
  Steve Mortiboy</a>
17
  <span class="title"><?php _e( 'Project Manager', 'all-in-one-seo-pack' ); ?></span>
18
  </li>
19
+ <li class="wp-person" id="wp-person-yuqianliu">
20
+ <a class="web" target="_blank" href="https://profiles.wordpress.org/yuqianl"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/8f971bea2b6c483fd1099e558013a7d0?s=60">
21
+ Yuqian Liu</a>
22
+ <span class="title"><?php _e( 'Project Manager', 'all-in-one-seo-pack' ); ?></span>
23
+ </li>
24
  </ul>
25
 
26
  <h3 class="wp-people-group"><?php printf( __( 'Core Team', 'all-in-one-seo-pack' ) ); ?></h3>
31
  <span class="title"><?php _e( 'Team Lead', 'all-in-one-seo-pack' ); ?></span>
32
  </li>
33
 
34
+ <li class="wp-person" id="rozroz">
35
+ <a class="web" target="_blank" href="https://github.com/contactashish13"><img alt="" class="gravatar" src="https://avatars2.githubusercontent.com/u/12953439?s=60">
36
+ Ashish Ravi</a>
37
+ <span class="title"><?php _e( 'Development Team', 'all-in-one-seo-pack' ); ?></span>
38
+ </li>
39
+ <li class="wp-person" id="EkoJR">
40
+ <a class="web" target="_blank" href="https://profiles.wordpress.org/EkoJR/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/bb4c78fe944b58bd5f127d836500c30a?s=200&d=mm&r=g">
41
+ Ben Reames</a>
42
+ <span class="title"><?php _e( 'Development Team', 'all-in-one-seo-pack' ); ?></span>
43
+ </li>
44
 
45
  </ul>
46
 
57
  </li>
58
  <li class="wp-person" id="wp-person-mayukojpn">
59
  <a class="web" target="_blank" href="https://github.com/rebeccahum"><img alt="" class="gravatar" src="https://2.gravatar.com/avatar/b57b5efcabe3e01833849390ad7d3129?s=60">
60
+ Rebecca Hum</a>
61
+ </li>
62
+ <li class="wp-person" id="wp-person-mayukojpn">
63
+ <a class="web" target="_blank" href="https://profiles.wordpress.org/mayukojpn/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/79294868a241e80ea4fda34c618b8a11?s=60">
64
+ Mayo Moriyama</a>
65
+ </li>
66
+ <li class="wp-person" id="wp-person-dougalcampbell">
67
+ <a class="web" target="_blank" href="https://profiles.wordpress.org/dougal/"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/81717a172b6918071fbea1a52483294b?s=60">
68
+ Dougal Campbell</a>
69
+ </li>
70
  <li class="wp-person" id="wp-person-alejandromostajo">
71
  <a class="web" target="_blank" href="https://github.com/amostajo"><img alt="" class="gravatar" src="https://avatars1.githubusercontent.com/u/1645908?s=60">
72
  Alejandro Mostajo</a>
73
  </li>
74
+ <li class="wp-person" id="wp-person-aaronbrodney">
75
+ <a class="web" target="_blank" href="https://github.com/theycalledmetaz"><img alt="" class="gravatar" src="https://avatars3.githubusercontent.com/u/8225725?v=3&s=60">
76
+ Aaron Brodney</a>
77
+ </li>
78
  <li class="wp-person" id="rozroz">
79
  <a class="web" target="_blank" href="https://profiles.wordpress.org/yummy-wp/"><img alt="" class="gravatar" src="https://avatars0.githubusercontent.com/u/22232968?v=3&s=460">
80
  Stanislav Samoilenko</a>
83
  <a class="web" target="_blank" href="https://profiles.wordpress.org/shoheitanaka"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/677e512c803c40c0180d4514f876a21f?s=200&d=mm&r=g">
84
  Shohei Tanaka</a>
85
  </li>
86
+ <li class="wp-person" id="webaware">
87
+ <a class="web" target="_blank" href="https://profiles.wordpress.org/webaware/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/aee800bc3644d9ebfa33c1ed9df5d958?s=200&d=mm&r=g">
88
+ Ross McKay</a>
89
+ </li>
90
+ <li class="wp-person" id="webaware">
91
+ <a class="web" target="_blank" href="https://github.com/jWright-Freelance/"><img alt="" class="gravatar" src="https://avatars1.githubusercontent.com/u/11382307?s=200&v=4">
92
+ John Wright</a>
93
+ </li>
94
+ <li class="wp-person" id="webaware">
95
+ <a class="web" target="_blank" href="https://wordpress.org/support/users/onetarek/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/dc4d0f0561009cc18c8d1cdfc760b2f1?s=200&d=retro&r=g">
96
+ Md Jahidul Islam</a>
97
+ </li>
98
+ <li class="wp-person" id="adamsilverstein">
99
+ <a class="web" target="_blank" href="https://profiles.wordpress.org/adamsilverstein/"><img alt=""class="gravatar" src="https://secure.gravatar.com/avatar/fddbd6c3e1c3d971aa732b9346aeb433?s=200&d=mm&r=g">
100
+ Adam Silverstein</a>
101
+ </li>
102
+ <li class="wp-person" id="vschettino">
103
+ <a class="web" target="_blank" href="https://github.com/vschettino/"><img alt="" class="gravatar" src="https://avatars2.githubusercontent.com/u/7289698?s=460&v=4">
104
+ Vinicius Schettino</a>
105
+ </li>
106
+ <li class="wp-person" id="vschettino">
107
+ <a class="web" target="_blank" href="https://github.com/srdjan-jcc"><img alt="" class="gravatar" src="https://avatars2.githubusercontent.com/u/3109112?s=460&v=4">
108
+ Srdjan Jocic</a>
109
+ </li>
110
+ <li class="wp-person" id="vschettino">
111
+ <a class="web" target="_blank" href="https://profiles.wordpress.org/soulseekah/"><img alt="" class="gravatar" src="https://avatars0.githubusercontent.com/u/685880?s=460&v=4">
112
+ Gennady Kovshenin</a>
113
+ </li>
114
  </ul>
115
 
116
  <h3 class="wp-people-group dashicons-before dashicons-translation"><?php printf( _e( 'Translation contributors and translation editors', 'all-in-one-seo-pack' ), '1.2' ); ?></h3>
admin/display/dashboard_widget.php CHANGED
@@ -71,7 +71,7 @@ if ( ! class_exists( 'aioseop_dashboard_widget' ) ) {
71
 
72
  $rss = fetch_feed( 'https://www.semperplugins.com/feed/' );
73
  if ( is_wp_error( $rss ) ) {
74
- echo '{Temporarily unable to load feed.}';
75
 
76
  return;
77
  }
71
 
72
  $rss = fetch_feed( 'https://www.semperplugins.com/feed/' );
73
  if ( is_wp_error( $rss ) ) {
74
+ echo __( '{Temporarily unable to load feed.}', 'all-in-one-seo-pack' );
75
 
76
  return;
77
  }
admin/display/general-metaboxes.php CHANGED
@@ -43,7 +43,8 @@ class aiosp_metaboxes {
43
  <strong>
44
  <?php
45
  echo aiosp_common::get_upgrade_hyperlink( 'side', __( 'Pro Version', 'all-in-one-seo-pack' ), __( 'CLICK HERE', 'all-in-one-seo-pack' ), '_blank' );
46
- echo __( ' to upgrade to Pro Version and get:', 'all-in-one-seo-pack' );
 
47
  ?>
48
  </strong>
49
  </p>
@@ -51,11 +52,11 @@ class aiosp_metaboxes {
51
  </div>
52
  <?php
53
  // Is this fall through deliberate?
54
- case 'aioseop-donate':
55
- ?>
56
  <div>
57
 
58
- <?php if ( ! AIOSEOPPRO ) { ?>
59
  <div class="aioseop_metabox_text">
60
  <p>
61
  <?php self::pro_meta_content(); ?>
@@ -80,7 +81,6 @@ class aiosp_metaboxes {
80
  ?>
81
  <div class="aioseop_translations"><strong>
82
  <?php
83
-
84
  if ( $aiosp_trans->percent_translated < 100 ) {
85
  if ( ! empty( $aiosp_trans->native_name ) ) {
86
  $maybe_native_name = $aiosp_trans->native_name;
@@ -88,14 +88,15 @@ class aiosp_metaboxes {
88
  $maybe_native_name = $aiosp_trans->name;
89
  }
90
 
91
- /* 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 */
92
  printf(
93
  __(
94
- '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'
95
  ),
 
96
  $aiosp_trans->translated_count,
97
- $aiosp_trans->percent_translated,
98
  $maybe_native_name,
 
99
  "<a href=\"$aiosp_trans->translation_url\" target=\"_BLANK\">",
100
  '</a>'
101
  );
@@ -111,8 +112,12 @@ class aiosp_metaboxes {
111
  ?>
112
  <div class="aioseop_metabox_text">
113
  <form
114
- action="https://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9"
115
- method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
 
 
 
 
116
  target="_blank">
117
  <h2><?php _e( 'Join our mailing list for tips, tricks, and WordPress secrets.', 'all-in-one-seo-pack' ); ?></h2>
118
  <p>
@@ -121,7 +126,7 @@ class aiosp_metaboxes {
121
  <p><input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL"
122
  placeholder="<?php _e( 'Email Address', 'all-in-one-seo-pack' ); ?>">
123
  <input type="submit" value="<?php _e( 'Subscribe', 'all-in-one-seo-pack' ); ?>" name="subscribe" id="mc-embedded-subscribe"
124
- class="btn"></p>
125
  </form>
126
  </div>
127
  <?php
@@ -130,16 +135,21 @@ class aiosp_metaboxes {
130
  ?>
131
  <div class="aioseop_metabox_text">
132
  <p>
133
- <div class="aioseop_icon aioseop_file_icon"></div>
134
  <a target="_blank"
135
- href="https://semperplugins.com/documentation/"><?php _e( 'Read the All in One SEO Pack user guide', 'all-in-one-seo-pack' ); ?></a></p>
 
 
 
 
 
136
  <p>
137
- <div class="aioseop_icon aioseop_support_icon"></div>
138
  <a target="_blank"
139
  title="<?php _e( 'All in One SEO Pro Plugin Support Forum', 'all-in-one-seo-pack' ); ?>"
140
  href="https://semperplugins.com/support/"><?php _e( 'Access our Premium Support Forums', 'all-in-one-seo-pack' ); ?></a></p>
141
  <p>
142
- <div class="aioseop_icon aioseop_cog_icon"></div>
143
  <a target="_blank" title="<?php _e( 'All in One SEO Pro Plugin Changelog', 'all-in-one-seo-pack' ); ?>"
144
  href="
145
  <?php
@@ -151,11 +161,11 @@ class aiosp_metaboxes {
151
  ?>
152
  "><?php _e( 'View the Changelog', 'all-in-one-seo-pack' ); ?></a></p>
153
  <p>
154
- <div class="aioseop_icon aioseop_youtube_icon"></div>
155
  <a target="_blank"
156
  href="https://semperplugins.com/doc-type/video/"><?php _e( 'Watch video tutorials', 'all-in-one-seo-pack' ); ?></a></p>
157
  <p>
158
- <div class="aioseop_icon aioseop_book_icon"></div>
159
  <a target="_blank"
160
  href="https://semperplugins.com/documentation/quick-start-guide/"><?php _e( 'Getting started? Read the Beginners Guide', 'all-in-one-seo-pack' ); ?></a></p>
161
  </div>
@@ -183,7 +193,7 @@ class aiosp_metaboxes {
183
 
184
  echo '</ul>';
185
 
186
- echo '<a href="https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/new" />Click here</a> to file a feature request/bug report.';
187
 
188
  }
189
 
43
  <strong>
44
  <?php
45
  echo aiosp_common::get_upgrade_hyperlink( 'side', __( 'Pro Version', 'all-in-one-seo-pack' ), __( 'CLICK HERE', 'all-in-one-seo-pack' ), '_blank' );
46
+ /* translators: after this string comes a list of exclusive features that are not included in the free version of the plugin */
47
+ echo ' ' . __( 'to upgrade to Pro Version and get:', 'all-in-one-seo-pack' );
48
  ?>
49
  </strong>
50
  </p>
52
  </div>
53
  <?php
54
  // Is this fall through deliberate?
55
+ case 'aioseop-donate':
56
+ ?>
57
  <div>
58
 
59
+ <?php if ( ! AIOSEOPPRO ) { ?>
60
  <div class="aioseop_metabox_text">
61
  <p>
62
  <?php self::pro_meta_content(); ?>
81
  ?>
82
  <div class="aioseop_translations"><strong>
83
  <?php
 
84
  if ( $aiosp_trans->percent_translated < 100 ) {
85
  if ( ! empty( $aiosp_trans->native_name ) ) {
86
  $maybe_native_name = $aiosp_trans->native_name;
88
  $maybe_native_name = $aiosp_trans->name;
89
  }
90
 
91
+ /* 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 */
92
  printf(
93
  __(
94
+ '%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'
95
  ),
96
+ AIOSEOP_PLUGIN_NAME,
97
  $aiosp_trans->translated_count,
 
98
  $maybe_native_name,
99
+ $aiosp_trans->percent_translated,
100
  "<a href=\"$aiosp_trans->translation_url\" target=\"_BLANK\">",
101
  '</a>'
102
  );
112
  ?>
113
  <div class="aioseop_metabox_text">
114
  <form
115
+ <?php if ( AIOSEOPPRO ) : ?>
116
+ action="https://semperplugins.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=b786958a9a"
117
+ <?php else : ?>
118
+ action="https://semperplugins.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9"
119
+ <?php endif; ?>
120
+ method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
121
  target="_blank">
122
  <h2><?php _e( 'Join our mailing list for tips, tricks, and WordPress secrets.', 'all-in-one-seo-pack' ); ?></h2>
123
  <p>
126
  <p><input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL"
127
  placeholder="<?php _e( 'Email Address', 'all-in-one-seo-pack' ); ?>">
128
  <input type="submit" value="<?php _e( 'Subscribe', 'all-in-one-seo-pack' ); ?>" name="subscribe" id="mc-embedded-subscribe"
129
+ class="button-primary" aria-label="<?php _e( 'Subscribe', 'all-in-one-seo-pack' ); ?>"></p>
130
  </form>
131
  </div>
132
  <?php
135
  ?>
136
  <div class="aioseop_metabox_text">
137
  <p>
138
+ <div class="aioseop_icon aioseop-icon-file"></div>
139
  <a target="_blank"
140
+ href="https://semperplugins.com/documentation/">
141
+ <?php
142
+ /* 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. */
143
+ printf( __( 'Read the %s user guide', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME );
144
+ ?>
145
+ </a></p>
146
  <p>
147
+ <div class="aioseop_icon aioseop-icon-support"></div>
148
  <a target="_blank"
149
  title="<?php _e( 'All in One SEO Pro Plugin Support Forum', 'all-in-one-seo-pack' ); ?>"
150
  href="https://semperplugins.com/support/"><?php _e( 'Access our Premium Support Forums', 'all-in-one-seo-pack' ); ?></a></p>
151
  <p>
152
+ <div class="aioseop_icon aioseop-icon-cog"></div>
153
  <a target="_blank" title="<?php _e( 'All in One SEO Pro Plugin Changelog', 'all-in-one-seo-pack' ); ?>"
154
  href="
155
  <?php
161
  ?>
162
  "><?php _e( 'View the Changelog', 'all-in-one-seo-pack' ); ?></a></p>
163
  <p>
164
+ <div class="aioseop_icon aioseop-icon-youtube"></div>
165
  <a target="_blank"
166
  href="https://semperplugins.com/doc-type/video/"><?php _e( 'Watch video tutorials', 'all-in-one-seo-pack' ); ?></a></p>
167
  <p>
168
+ <div class="aioseop_icon aioseop-icon-book"></div>
169
  <a target="_blank"
170
  href="https://semperplugins.com/documentation/quick-start-guide/"><?php _e( 'Getting started? Read the Beginners Guide', 'all-in-one-seo-pack' ); ?></a></p>
171
  </div>
193
 
194
  echo '</ul>';
195
 
196
+ echo sprintf( __( '%1$sClick here%2$s to file a feature request/bug report.', 'all-in-one-seo-pack' ), '<a href="https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/new" />', '</a>' );
197
 
198
  }
199
 
admin/display/menu.php CHANGED
@@ -23,6 +23,8 @@ class AIOSEOPAdminMenus {
23
  } else {
24
  return;
25
  }
 
 
26
  }
27
 
28
  function remove_menus() {
@@ -38,12 +40,29 @@ class AIOSEOPAdminMenus {
38
  global $submenu;
39
  $url = 'https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_menu';
40
  $upgrade_text = __( 'Upgrade to Pro', 'all-in-one-seo-pack' );
41
- $submenu['all-in-one-seo-pack/aioseop_class.php'][] = array(
42
  "<span class='upgrade_menu_link'>$upgrade_text</span>",
43
  'manage_options',
44
  $url,
45
  );
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
 
49
  new AIOSEOPAdminMenus();
23
  } else {
24
  return;
25
  }
26
+
27
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
28
  }
29
 
30
  function remove_menus() {
40
  global $submenu;
41
  $url = 'https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_menu';
42
  $upgrade_text = __( 'Upgrade to Pro', 'all-in-one-seo-pack' );
43
+ $submenu[ AIOSEOP_PLUGIN_DIRNAME . '/aioseop_class.php' ][] = array(
44
  "<span class='upgrade_menu_link'>$upgrade_text</span>",
45
  'manage_options',
46
  $url,
47
  );
48
  }
49
+
50
+ /*
51
+ * Opens Upgrade to Pro links in WP Admin as new tab.
52
+ *
53
+ * Enqueued here because All_in_One_SEO_Pack_Module::admin_enqueue_scripts does not work.
54
+ *
55
+ * @param string $hook
56
+ *
57
+ * @since 3.0
58
+ */
59
+ function admin_enqueue_scripts( $hook ) {
60
+ wp_enqueue_script( 'aioseop_menu_js', AIOSEOP_PLUGIN_URL . 'js/aioseop-menu.js', array( 'jquery' ), AIOSEOP_VERSION, true );
61
+
62
+ if ( 'plugins.php' === $hook ) {
63
+ wp_enqueue_script( 'aioseop_plugins_menu_js', AIOSEOP_PLUGIN_URL . 'js/plugins-menu.js', array( 'jquery' ), AIOSEOP_VERSION, true );
64
+ }
65
+ }
66
  }
67
 
68
  new AIOSEOPAdminMenus();
admin/display/notice-aioseop.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AIOSEOP Screen Notice Template.
4
+ *
5
+ * @since 3.0
6
+ *
7
+ * @see AIOSEOP_Notice::display_notice_aioseop();
8
+ * @uses $notice in AIOSEOP_Notice::notices
9
+ * @package All-in-One-SEO-Pack
10
+ * @subpackage AIOSEOP_Notices
11
+ */
12
+
13
+ // $notice = $this->get_notice[ $a_notice_slug ];
14
+ $notice_class = 'notice-info';
15
+ if ( isset( $notice['class'] ) && ! empty( $notice['class'] ) ) {
16
+ $notice_class = $notice['class'];
17
+ }
18
+
19
+ ?>
20
+ <div class="notice <?php echo esc_attr( $notice_class ); ?> is-dismissible aioseop-notice-container aioseop-notice-<?php echo esc_attr( $notice['slug'] ); ?>">
21
+ <p><?php echo esc_html( $notice['message'] ); ?></p>
22
+ <p>
23
+ <?php foreach ( $notice['action_options'] as $key => $action_option ) : ?>
24
+ <?php
25
+ $link = $action_option['link'];
26
+ $id = 'aioseop-notice-delay-' . $notice['slug'] . '-' . $key;
27
+ $class = '';
28
+ $class .= 'aioseop-delay-' . $key;
29
+ $class .= ' ' . $action_option['class'];
30
+ ?>
31
+ <a href="<?php echo esc_url( $link ); ?>" id="<?php echo esc_attr( $id ); ?>" class="aioseop-notice-delay <?php echo esc_attr( $class ); ?>" target="_blank" rel="noopener"><?php echo esc_textarea( $action_option['text'] ); ?></a>
32
+ <?php endforeach; ?>
33
+ </p>
34
+ </div>
admin/display/notice-default.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Default Notice Template.
4
+ *
5
+ * @since 3.0
6
+ *
7
+ * @see AIOSEOP_Notice::display_notice_default();
8
+ * @uses $notice in AIOSEOP_Notice::notices
9
+ * @package All-in-One-SEO-Pack
10
+ * @subpackage AIOSEOP_Notices
11
+ */
12
+
13
+ // $notice = $this->notices[ $a_notice_slug ];
14
+ $notice_class = 'notice-info';
15
+ if ( isset( $notice['class'] ) && ! empty( $notice['class'] ) ) {
16
+ $notice_class = $notice['class'];
17
+ }
18
+
19
+ ?>
20
+ <div class="notice <?php echo esc_attr( $notice_class ); ?> is-dismissible aioseop-notice-container aioseop-notice-<?php echo esc_attr( $notice['slug'] ); ?>">
21
+ <p><?php echo esc_html( $notice['message'] ); ?></p>
22
+ <p>
23
+ <?php foreach ( $notice['action_options'] as $key => $action_option ) : ?>
24
+ <?php
25
+ $link = $action_option['link'];
26
+ $id = 'aioseop-notice-delay-' . $notice['slug'] . '-' . $key;
27
+ $class = '';
28
+ $class .= 'aioseop-delay-' . $key;
29
+ $class .= ' ' . $action_option['class'];
30
+ ?>
31
+ <a href="<?php echo esc_url( $link ); ?>" id="<?php echo esc_attr( $id ); ?>" class="aioseop-notice-delay <?php echo esc_attr( $class ); ?>" target="_blank" rel="noopener"><?php echo esc_textarea( $action_option['text'] ); ?></a>
32
+ <?php endforeach; ?>
33
+ </p>
34
+ </div>
admin/display/notices/blog-visibility-notice.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Blog Visibility Notice
4
+ *
5
+ * @since 3.0
6
+ * @package All-in-One-SEO-Pack
7
+ * @subpackage AIOSEOP_Notices
8
+ */
9
+
10
+
11
+ /**
12
+ * Notice - Blog Visibility
13
+ *
14
+ * Displays when blog disables search engines from indexing.
15
+ *
16
+ * @since 3.0
17
+ *
18
+ * @return array Notice configuration.
19
+ */
20
+ function aioseop_notice_blog_visibility() {
21
+ $text_link = '<a href="' . admin_url( 'options-reading.php' ) . '">' . __( 'Reading Settings', 'all-in-one-seo-pack' ) . '</a>';
22
+
23
+ return array(
24
+ 'slug' => 'blog_public_disabled',
25
+ 'delay_time' => 0,
26
+ /* 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. */
27
+ '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 ),
28
+ 'class' => 'notice-error',
29
+ 'target' => 'site',
30
+ 'screens' => array(),
31
+ 'action_options' => array(
32
+ array(
33
+ 'time' => 0,
34
+ 'text' => __( 'Update Reading Settings', 'all-in-one-seo-pack' ),
35
+ 'link' => admin_url( 'options-reading.php' ),
36
+ 'dismiss' => false,
37
+ 'class' => 'button-primary',
38
+ ),
39
+ array(
40
+ 'time' => 604800,
41
+ 'text' => __( 'Remind me later', 'all-in-one-seo-pack' ),
42
+ 'link' => '',
43
+ 'dismiss' => false,
44
+ 'class' => 'button-secondary',
45
+ ),
46
+ ),
47
+ );
48
+ }
49
+ add_filter( 'aioseop_admin_notice-blog_public_disabled', 'aioseop_notice_blog_visibility' );
admin/display/notices/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden.
4
+ */
admin/display/notices/review-plugin-notice.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Review Plugin Notice
4
+ *
5
+ * @since 3.0
6
+ * @package All-in-One-SEO-Pack
7
+ * @subpackage AIOSEOP_Notices
8
+ */
9
+ /**
10
+ * Notice - Review Plugin
11
+ *
12
+ * @since 3.0
13
+ *
14
+ * @return array Notice configuration.
15
+ */
16
+ function aioseop_notice_review_plugin() {
17
+ return array(
18
+ 'slug' => 'review_plugin',
19
+ 'delay_time' => 1036800,
20
+ 'target' => 'user',
21
+ 'screens' => array(),
22
+ 'class' => 'notice-info',
23
+ /* 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. */
24
+ '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 ),
25
+ 'action_options' => array(
26
+ array(
27
+ 'time' => 0,
28
+ 'text' => __( 'Add a review', 'all-in-one-seo-pack' ),
29
+ 'link' => 'https://wordpress.org/support/plugin/all-in-one-seo-pack/reviews?rate=5#new-post',
30
+ 'dismiss' => false,
31
+ 'class' => '',
32
+ ),
33
+ array(
34
+ 'text' => __( 'Remind me later', 'all-in-one-seo-pack' ),
35
+ 'time' => 432000,
36
+ 'dismiss' => false,
37
+ 'class' => '',
38
+ ),
39
+ array(
40
+ 'time' => 0,
41
+ 'text' => __( 'No, thanks', 'all-in-one-seo-pack' ),
42
+ 'dismiss' => true,
43
+ 'class' => '',
44
+ ),
45
+ ),
46
+ );
47
+ }
48
+ add_filter( 'aioseop_admin_notice-review_plugin', 'aioseop_notice_review_plugin' );
admin/display/notices/sitemap-indexes-notice.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sitemap Index Notice
4
+ *
5
+ * @since 3.0
6
+ * @package All-in-One-SEO-Pack
7
+ * @subpackage AIOSEOP_Notices
8
+ */
9
+
10
+ /**
11
+ * Notice - Sitemap Indexes
12
+ *
13
+ * @since 3.0
14
+ *
15
+ * @return array
16
+ */
17
+ function aioseop_notice_sitemap_indexes() {
18
+ return array(
19
+ 'slug' => 'sitemap_max_warning',
20
+ 'delay_time' => 0,
21
+ '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' ),
22
+ 'class' => 'notice-warning',
23
+ 'target' => 'user',
24
+ 'screens' => array(),
25
+ 'action_options' => array(
26
+ array(
27
+ 'time' => 0,
28
+ 'text' => __( 'Update Sitemap Settings', 'all-in-one-seo-pack' ),
29
+ 'link' => esc_url( get_admin_url( null, 'admin.php?page=' . AIOSEOP_PLUGIN_DIRNAME . '/modules/aioseop_sitemap.php' ) ),
30
+ 'dismiss' => false,
31
+ 'class' => 'button-primary',
32
+ ),
33
+ array(
34
+ 'time' => 86400, // 24 hours.
35
+ 'text' => __( 'Remind me later', 'all-in-one-seo-pack' ),
36
+ 'link' => '',
37
+ 'dismiss' => false,
38
+ 'class' => 'button-secondary',
39
+ ),
40
+
41
+ ),
42
+ );
43
+ }
44
+ add_filter( 'aioseop_admin_notice-sitemap_max_warning', 'aioseop_notice_sitemap_indexes' );
admin/display/notices/wc-detected-notice.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Detected Notice
4
+ *
5
+ * @since 3.0
6
+ * @package All-in-One-SEO-Pack
7
+ * @subpackage AIOSEOP_Notices
8
+ */
9
+
10
+ /**
11
+ * Notice - Pro Promotion for WooCommerce
12
+ *
13
+ * @since 3.0
14
+ *
15
+ * @return array
16
+ */
17
+ function aioseop_notice_pro_promo_woocommerce() {
18
+ return array(
19
+ 'slug' => 'woocommerce_detected',
20
+ 'delay_time' => 0,
21
+ /* 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. */
22
+ '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' ),
23
+
24
+ 'class' => 'notice-info',
25
+ 'target' => 'site',
26
+ 'screens' => array(),
27
+ 'action_options' => array(
28
+ array(
29
+ 'time' => 0,
30
+ 'text' => __( 'Upgrade', 'all-in-one-seo-pack' ),
31
+ 'link' => 'https://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=woo',
32
+ 'dismiss' => false,
33
+ 'class' => 'button-primary button-orange',
34
+ ),
35
+ array(
36
+ 'time' => 2592000, // 30 days.
37
+ 'text' => __( 'No Thanks', 'all-in-one-seo-pack' ),
38
+ 'link' => '',
39
+ 'dismiss' => false,
40
+ 'class' => 'button-secondary',
41
+ ),
42
+ ),
43
+ );
44
+ }
45
+ add_filter( 'aioseop_admin_notice-woocommerce_detected', 'aioseop_notice_pro_promo_woocommerce' );
admin/display/welcome-content.php CHANGED
@@ -1,16 +1,39 @@
1
  <div class="welcome-panel">
2
  <div class="welcome-panel-content">
3
  <div class="welcome-panel-column-container">
 
 
 
4
  <div class="welcome-panel-column">
5
- <h3><?php echo esc_html( __( 'Support All in One SEO Pack', 'all-in-one-seo-pack' ) ); ?></h3>
6
- <p class="message welcome-icon welcome-edit-page"><?php echo esc_html( __( 'There are many ways you can help support All in One SEO Pack.', 'all-in-one-seo-pack' ) ); ?></p>
7
- <p class="message aioseop-message welcome-icon welcome-edit-page"><?php echo esc_html( __( 'Upgrade to All in One SEO Pack Pro to access priority support and premium features.', 'all-in-one-seo-pack' ) ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  <p class="call-to-action"><a
9
  href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome"
10
  target="_blank"
11
  class="button button-primary button-orange"><?php echo __( 'Upgrade', 'all-in-one-seo-pack' ); ?></a>
12
  </p>
13
- <p class="message aioseop-message welcome-icon welcome-edit-page"><?php echo esc_html( __( 'Help translate All in One SEO Pack into your language.', 'all-in-one-seo-pack' ) ); ?></p>
 
 
 
 
 
14
  <p class="call-to-action"><a
15
  href="https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack"
16
  class="button button-primary"
@@ -22,7 +45,12 @@
22
  <ul>
23
  <li><a href="https://semperplugins.com/documentation/quick-start-guide/"
24
  target="_blank"
25
- class="welcome-icon welcome-add-page"><?php echo __( 'Beginners Guide for All in One SEO Pack', 'all-in-one-seo-pack' ); ?></a>
 
 
 
 
 
26
 
27
  </li>
28
  <li><a href="https://semperplugins.com/documentation/beginners-guide-to-xml-sitemaps/"
1
  <div class="welcome-panel">
2
  <div class="welcome-panel-content">
3
  <div class="welcome-panel-column-container">
4
+ <div>
5
+ <h3><a href="https://semperplugins.com/all-in-one-seo-pack-3-0/" target="_blank"><?php echo esc_html( sprintf( __( "Check out what's new in our %s release post!", 'all_in_one_seo_pack' ), 'Version 3' ) ); ?></a></h3>
6
+ </div>
7
  <div class="welcome-panel-column">
8
+ <h3>
9
+ <?php
10
+ /* 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. */
11
+ echo esc_html( sprintf( __( 'Support %s', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ) );
12
+ ?>
13
+ </h3>
14
+ <p class="message welcome-icon welcome-edit-page">
15
+ <?php
16
+ /* 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. */
17
+ echo esc_html( sprintf( __( 'There are many ways you can help support %s.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ) );
18
+ ?>
19
+ </p>
20
+ <p class="message aioseop-message welcome-icon welcome-edit-page">
21
+ <?php
22
+ /* 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. */
23
+ echo esc_html( sprintf( __( 'Upgrade to %s to access priority support and premium features.', 'all-in-one-seo-pack' ), 'All in One SEO Pack Pro' ) );
24
+ ?>
25
+ </p>
26
  <p class="call-to-action"><a
27
  href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome"
28
  target="_blank"
29
  class="button button-primary button-orange"><?php echo __( 'Upgrade', 'all-in-one-seo-pack' ); ?></a>
30
  </p>
31
+ <p class="message aioseop-message welcome-icon welcome-edit-page">
32
+ <?php
33
+ /* 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. */
34
+ echo esc_html( sprintf( __( 'Help translate %s into your language.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ) );
35
+ ?>
36
+ </p>
37
  <p class="call-to-action"><a
38
  href="https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack"
39
  class="button button-primary"
45
  <ul>
46
  <li><a href="https://semperplugins.com/documentation/quick-start-guide/"
47
  target="_blank"
48
+ class="welcome-icon welcome-add-page">
49
+ <?php
50
+ /* 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. */
51
+ echo sprintf( __( 'Beginners Guide for %s', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME );
52
+ ?>
53
+ </a>
54
 
55
  </li>
56
  <li><a href="https://semperplugins.com/documentation/beginners-guide-to-xml-sitemaps/"
admin/display/welcome.php CHANGED
@@ -51,9 +51,11 @@ if ( ! class_exists( 'aioseop_welcome' ) ) {
51
  * Adds (hidden) menu.
52
  */
53
  function add_menus() {
 
 
54
  add_dashboard_page(
55
- __( 'Welcome to All in One SEO Pack', 'all-in-one-seo-pack' ),
56
- __( 'Welcome to All in One SEO Pack', 'all-in-one-seo-pack' ),
57
  'manage_options',
58
  'aioseop-about',
59
  array( $this, 'about_screen' )
@@ -113,9 +115,19 @@ if ( ! class_exists( 'aioseop_welcome' ) ) {
113
  ?>
114
 
115
  <div class="wrap about-wrap">
116
- <h1><?php printf( esc_html__( 'Welcome to All in One SEO Pack %s', 'all-in-one-seo-pack' ), $version ); ?></h1>
 
 
 
 
 
117
  <div
118
- class="about-text"><?php printf( esc_html__( 'All in One SEO Pack %s contains new features, bug fixes, increased security, and tons of under the hood performance improvements.', 'all-in-one-seo-pack' ), $version ); ?></div>
 
 
 
 
 
119
 
120
  <h2 class="nav-tab-wrapper">
121
  <a class="nav-tab nav-tab-active" id="aioseop-about"
51
  * Adds (hidden) menu.
52
  */
53
  function add_menus() {
54
+ /* 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. */
55
+ $welcome_text = sprintf( __( 'Welcome to %s', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME );
56
  add_dashboard_page(
57
+ $welcome_text,
58
+ $welcome_text,
59
  'manage_options',
60
  'aioseop-about',
61
  array( $this, 'about_screen' )
115
  ?>
116
 
117
  <div class="wrap about-wrap">
118
+ <h1>
119
+ <?php
120
+ /* translators: %1$s and %2$s are placeholders, which means that these should not be translated. These will be replaced with the name of the plugin, All in One SEO Pack, and the current version number. */
121
+ printf( esc_html__( 'Welcome to %1$s %2$s', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME, $version );
122
+ ?>
123
+ </h1>
124
  <div
125
+ class="about-text">
126
+ <?php
127
+ /* translators: %1$s and %2$s are placeholders, which means that these should not be translated. These will be replaced with the name of the plugin, All in One SEO Pack, and the current version number. */
128
+ printf( esc_html__( '%1$s %2$s contains new features, bug fixes, increased security, and tons of under the hood performance improvements.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME, $version );
129
+ ?>
130
+ </div>
131
 
132
  <h2 class="nav-tab-wrapper">
133
  <a class="nav-tab nav-tab-active" id="aioseop-about"
admin/meta_import.php CHANGED
@@ -25,7 +25,8 @@ if ( class_exists( 'WPSEO_Import_Hooks' ) ) {
25
 
26
  if ( empty( $aioseop_yst_detected_notice_dismissed ) ) {
27
 
28
- echo '<div class="notice notice-warning row-title is-dismissible yst_notice"><p>', sprintf( esc_html__( 'The plugin Yoast SEO has been detected. Do you want to %1$simport its settings%2$s into All in One SEO Pack?', 'all-in-one-seo-pack' ), sprintf( '<a href="%s">', esc_url( $aiourl ) ), '</a>' ), '</p></div>';
 
29
 
30
  }
31
 
@@ -147,11 +148,21 @@ function aiosp_seometa_admin() {
147
  </p>
148
 
149
  <p><span
150
- class="description"><?php printf( __( 'Click "Analyze" for a list of SEO data that can be imported into All in One SEO Pack, along with the number of records that will be imported.', 'all-in-one-seo-pack' ) ); ?></span>
 
 
 
 
 
151
  </p>
152
 
153
  <p><span
154
- class="description"><strong><?php printf( __( 'Please Note: ' ) ); ?></strong><?php printf( __( 'Some plugins and themes do not share similar data, or they store data in a non-standard way. If we cannot import this data, it will remain unchanged in your database. Any compatible SEO data will be displayed for you to review. If a post or page already has SEO data in All in One SEO Pack, we will not import data from another plugin/theme.', 'all-in-one-seo-pack' ) ); ?></span>
 
 
 
 
 
155
  </p>
156
 
157
  <p><span
@@ -191,9 +202,10 @@ function aiosp_seometa_admin() {
191
 
192
  ?>
193
 
194
- <input type="submit" class="button-highlighted" name="analyze"
195
- value="<?php _e( 'Analyze', 'genesis' ); ?>"/>
196
- <input type="submit" class="button-primary" value="<?php _e( 'Convert', 'genesis' ); ?>"/>
 
197
 
198
  </form>
199
 
@@ -515,6 +527,11 @@ function aiosp_seometa_import() {
515
  'META Description' => 'description',
516
  'META Keywords' => 'keywords',
517
  ),
 
 
 
 
 
518
  'SEOpressor' => array(
519
  'Custom Doctitle' => '_seopressor_meta_title',
520
  'META Description' => '_seopressor_meta_description',
25
 
26
  if ( empty( $aioseop_yst_detected_notice_dismissed ) ) {
27
 
28
+ /* 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. */
29
+ echo '<div class="notice notice-warning row-title is-dismissible yst_notice"><p>', 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( '<a href="%s">', esc_url( $aiourl ) ), '</a>', AIOSEOP_PLUGIN_NAME ), '</p></div>';
30
 
31
  }
32
 
148
  </p>
149
 
150
  <p><span
151
+ class="description">
152
+ <?php
153
+ /* 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. */
154
+ printf( sprintf( __( 'Click "Analyze" for a list of SEO data that can be imported into %s, along with the number of records that will be imported.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ) );
155
+ ?>
156
+ </span>
157
  </p>
158
 
159
  <p><span
160
+ class="description"><strong><?php printf( __( 'Please Note: ' ) ); ?></strong>
161
+ <?php
162
+ /* 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. */
163
+ printf( sprintf( __( 'Some plugins and themes do not share similar data, or they store data in a non-standard way. If we cannot import this data, it will remain unchanged in your database. Any compatible SEO data will be displayed for you to review. If a post or page already has SEO data in %s, we will not import data from another plugin/theme.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ) );
164
+ ?>
165
+ </span>
166
  </p>
167
 
168
  <p><span
202
 
203
  ?>
204
 
205
+ <input type="submit" class="button-secondary" name="analyze"
206
+ value="<?php _e( 'Analyze', 'all-in-one-seo-pack' ); ?>" aria-label="Analyze"/>
207
+ <input type="submit" class="button-primary"
208
+ value="<?php _e( 'Convert', 'all-in-one-seo-pack' ); ?>" aria-label="Convert"/>
209
 
210
  </form>
211
 
527
  'META Description' => 'description',
528
  'META Keywords' => 'keywords',
529
  ),
530
+ 'Rank Math' => array(
531
+ 'Custom Doctitle' => 'rank_math_title',
532
+ 'META Description' => 'rank_math_description',
533
+ 'Canonical URI' => 'rank_math_canonical_url',
534
+ ),
535
  'SEOpressor' => array(
536
  'Custom Doctitle' => '_seopressor_meta_title',
537
  'META Description' => '_seopressor_meta_description',
aioseop_class.php CHANGED
@@ -79,283 +79,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
79
  $blog_name = esc_attr( get_bloginfo( 'name' ) );
80
  parent::__construct();
81
 
82
- /*
83
- * Consider changing the construction of the macros.
84
- *
85
- * The name of the macro should NOT be inside _e() or __() because it does not make sense as it
86
- * won't change with the language.
87
- *
88
- * Moreover, it will confuse WPCS and it will try to replace %c (as in %category%) to %$1c.
89
- * Placeholder %s (%something) has been bug fixed.
90
- * @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/698
91
- */
92
- // @codingStandardsIgnoreStart
93
- $this->help_text = array(
94
- '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' ),
95
- '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' ),
96
- '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' ),
97
- 'customize_canonical_links' => __( 'Checking this option will allow you to customize Canonical URLs for specific posts.', 'all-in-one-seo-pack' ),
98
- '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' ),
99
- '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' ),
100
- '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' ),
101
- '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' ),
102
- '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' ),
103
- 'use_static_home_info' => __( 'Checking this option uses the title, description, and keywords set on your static Front Page.', 'all-in-one-seo-pack' ),
104
- 'togglekeywords' => __( 'This option allows you to toggle the use of Meta Keywords throughout the whole of the site.', 'all-in-one-seo-pack' ),
105
- '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' ),
106
- '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' ),
107
- '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' ),
108
- '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' ),
109
- 'home_page_title_format' =>
110
- __( 'This controls the format of the title tag for your Home Page.<br />The following macros are supported:', 'all-in-one-seo-pack' )
111
- . '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
112
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
113
- __( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) . '</li><li>' .
114
- __( "%page_author_login% - This page's author' login", 'all-in-one-seo-pack' ) . '</li><li>' .
115
- __( "%page_author_nicename% - This page's author' nicename", 'all-in-one-seo-pack' ) . '</li><li>' .
116
- __( "%page_author_firstname% - This page's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '</li><li>' .
117
- __( "%page_author_lastname% - This page's author' last name (capitalized)", 'all-in-one-seo-pack' ) . '</li><li>' .
118
- __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
119
- __( '%cf_fieldname% - Custom field name', 'all-in-one-seo-pack' ) . '</li></ul>',
120
- 'page_title_format' =>
121
- __( 'This controls the format of the title tag for Pages.<br />The following macros are supported:', 'all-in-one-seo-pack' )
122
- . '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
123
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
124
- __( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) . '</li><li>' .
125
- __( "%page_author_login% - This page's author' login", 'all-in-one-seo-pack' ) . '</li><li>' .
126
- __( "%page_author_nicename% - This page's author' nicename", 'all-in-one-seo-pack' ) . '</li><li>' .
127
- __( "%page_author_firstname% - This page's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '</li><li>' .
128
- __( "%page_author_lastname% - This page's author' last name (capitalized)", 'all-in-one-seo-pack' ) . '</li><li>' .
129
- __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
130
- __( '%post_date% - The date the page was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
131
- __( '%post_year% - The year the page was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
132
- __( '%post_month% - The month the page was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
133
- __( '%cf_fieldname% - Custom field name', 'all-in-one-seo-pack' ) . '</li></ul>',
134
- 'post_title_format' =>
135
- __( 'This controls the format of the title tag for Posts.<br />The following macros are supported:', 'all-in-one-seo-pack' )
136
- . '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
137
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
138
- __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . '</li><li>' .
139
- __( '%category_title% - The (main) category of the post', 'all-in-one-seo-pack' ) . '</li><li>' .
140
- __( '%category% - Alias for %category_title%', 'all-in-one-seo-pack' ) . '</li><li>' .
141
- __( "%post_author_login% - This post's author' login", 'all-in-one-seo-pack' ) . '</li><li>' .
142
- __( "%post_author_nicename% - This post's author' nicename", 'all-in-one-seo-pack' ) . '</li><li>' .
143
- __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '</li><li>' .
144
- __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all-in-one-seo-pack' ) . '</li><li>' .
145
- __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
146
- __( '%post_date% - The date the post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
147
- __( '%post_year% - The year the post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
148
- __( '%post_month% - The month the post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
149
- __( '%cf_fieldname% - Custom field name', 'all-in-one-seo-pack' ) . '</li></ul>',
150
- 'category_title_format' =>
151
- __( 'This controls the format of the title tag for Category Archives.<br />The following macros are supported:', 'all-in-one-seo-pack' ) .
152
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
153
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
154
- __( '%category_title% - The original title of the category', 'all-in-one-seo-pack' ) . '</li><li>' .
155
- __( '%category_description% - The description of the category', 'all-in-one-seo-pack' ) . '</li></ul>',
156
- 'archive_title_format' =>
157
- __( 'This controls the format of the title tag for Custom Post Archives.<br />The following macros are supported:', 'all-in-one-seo-pack' ) .
158
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
159
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
160
- __( '%archive_title - The original archive title given by wordpress', 'all-in-one-seo-pack' ) . '</li></ul>',
161
- 'date_title_format' =>
162
- __( 'This controls the format of the title tag for Date Archives.<br />The following macros are supported:', 'all-in-one-seo-pack' ) .
163
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
164
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
165
- __( '%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all-in-one-seo-pack' ) . '</li><li>' .
166
- __( '%day% - The original archive day given by wordpress, e.g. "17"', 'all-in-one-seo-pack' ) . '</li><li>' .
167
- __( '%month% - The original archive month given by wordpress, e.g. "August"', 'all-in-one-seo-pack' ) . '</li><li>' .
168
- __( '%year% - The original archive year given by wordpress, e.g. "2007"', 'all-in-one-seo-pack' ) . '</li></ul>',
169
- 'author_title_format' =>
170
- __( 'This controls the format of the title tag for Author Archives.<br />The following macros are supported:', 'all-in-one-seo-pack' ) .
171
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
172
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
173
- __( '%author% - The original archive title given by wordpress, e.g. "Steve" or "John Smith"', 'all-in-one-seo-pack' ) . '</li></ul>',
174
- 'tag_title_format' =>
175
- __( 'This controls the format of the title tag for Tag Archives.<br />The following macros are supported:', 'all-in-one-seo-pack' ) .
176
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
177
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
178
- __( '%tag% - The name of the tag', 'all-in-one-seo-pack' ) . '</li></ul>',
179
- 'search_title_format' =>
180
- __( 'This controls the format of the title tag for the Search page.<br />The following macros are supported:', 'all-in-one-seo-pack' ) .
181
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
182
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
183
- __( '%search% - What was searched for', 'all-in-one-seo-pack' ) . '</li></ul>',
184
- 'description_format' => __( 'This controls the format of Meta Descriptions.The following macros are supported:', 'all-in-one-seo-pack' ) .
185
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
186
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
187
- __( '%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' ) . '</li><li>' .
188
- __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . '</li><li>' .
189
- __( '%wp_title% - The original WordPress title, e.g. post_title for posts', 'all-in-one-seo-pack' ) . '</li><li>' .
190
- __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
191
- __( '%post_date% - The date the page/post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
192
- __( '%post_year% - The year the page/post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
193
- __( '%post_month% - The month the page/post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
194
- __( '%cf_fieldname% - Custom field name', 'all-in-one-seo-pack' ) . '</li></ul>',
195
- '404_title_format' => __( 'This controls the format of the title tag for the 404 page.<br />The following macros are supported:', 'all-in-one-seo-pack' ) .
196
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
197
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
198
- __( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all-in-one-seo-pack' ) . '</li><li>' .
199
- __( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all-in-one-seo-pack' ) . '</li><li>' .
200
- __( '%404_title% - Additional 404 title input', 'all-in-one-seo-pack' ) . '</li></ul>',
201
- 'paged_format' => __( 'This string gets appended/prepended to titles of paged index pages (like home or archive pages).', 'all-in-one-seo-pack' )
202
- . __( 'The following macros are supported:', 'all-in-one-seo-pack' )
203
- . '<ul><li>' . __( '%page% - The page number', 'all-in-one-seo-pack' ) . '</li></ul>',
204
- 'cpostactive' => __( 'Use these checkboxes to select which Content Types you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
205
- 'taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
206
- 'posttypecolumns' => __( 'This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.', 'all-in-one-seo-pack' ),
207
- 'google_verify' => __( "Enter your verification code here to verify your site with Google Search Console.<br /><a href='https://semperplugins.com/documentation/google-search-console-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
208
- 'bing_verify' => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.<br /><a href='https://semperplugins.com/documentation/bing-webmaster-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
209
- 'pinterest_verify' => __( "Enter your verification code here to verify your site with Pinterest.<br /><a href='https://semperplugins.com/documentation/pinterest-site-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
210
- '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' ),
211
- 'google_disable_profile' => __( 'Check this to remove the Google Plus field from the user profile screen.', 'all-in-one-seo-pack' ),
212
- 'google_author_advanced' => __( 'Enable this to display advanced options for controlling Google Plus authorship information on your website.', 'all-in-one-seo-pack' ),
213
- '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' ),
214
- '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' ),
215
- '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' ),
216
- 'google_sitelinks_search' => __( 'Add markup to display the Google Sitelinks Search Box next to your search results in Google.', 'all-in-one-seo-pack' ),
217
- 'google_set_site_name' => __( 'Add markup to tell Google the preferred name for your website.', 'all-in-one-seo-pack' ),
218
- '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' ),
219
- 'google_analytics_id' => __( 'Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.', 'all-in-one-seo-pack' ),
220
- 'ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
221
- 'ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
222
- 'ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
223
- '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' ),
224
- 'ga_anonymize_ip' => __( 'This enables support for IP Anonymization in Google Analytics.', 'all-in-one-seo-pack' ),
225
- 'ga_display_advertising' => __( 'This enables support for the Display Advertiser Features in Google Analytics.', 'all-in-one-seo-pack' ),
226
- 'ga_exclude_users' => __( 'Exclude logged-in users from Google Analytics tracking by role.', 'all-in-one-seo-pack' ),
227
- 'ga_track_outbound_links' => __( 'Check this if you want to track outbound links with Google Analytics.', 'all-in-one-seo-pack' ),
228
- 'ga_link_attribution' => __( 'This enables support for the Enhanced Link Attribution in Google Analytics.', 'all-in-one-seo-pack' ),
229
- 'ga_enhanced_ecommerce' => __( 'This enables support for the Enhanced Ecommerce in Google Analytics.', 'all-in-one-seo-pack' ),
230
- 'cpostnoindex' => __( 'Set the default NOINDEX setting for each Post Type.', 'all-in-one-seo-pack' ),
231
- 'cpostnofollow' => __( 'Set the default NOFOLLOW setting for each Post Type.', 'all-in-one-seo-pack' ),
232
-
233
- 'category_noindex' => __( 'Check this to ask search engines not to index Category Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
234
- 'archive_date_noindex' => __( 'Check this to ask search engines not to index Date Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
235
- 'archive_author_noindex' => __( 'Check this to ask search engines not to index Author Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
236
- 'tags_noindex' => __( 'Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
237
- 'search_noindex' => __( 'Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
238
- '404_noindex' => __( 'Check this to ask search engines not to index the 404 page.', 'all-in-one-seo-pack' ),
239
- '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' ),
240
- 'paginated_noindex' => __( 'Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
241
- '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' ),
242
- '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' ),
243
- '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' ),
244
- 'run_shortcodes' => __( 'Check this and shortcodes will get executed for descriptions auto-generated from content.', 'all-in-one-seo-pack' ),
245
- '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' ),
246
- 'dont_truncate_descriptions' => __( 'Check this to prevent your Description from being truncated regardless of its length.', 'all-in-one-seo-pack' ),
247
- 'schema_markup' => __( 'Check this to support Schema.org markup, i.e., itemprop on supported metadata.', 'all-in-one-seo-pack' ),
248
- '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' ),
249
- 'redirect_attachement_parent' => __( 'Redirect attachment pages to post parent.', 'all-in-one-seo-pack' ),
250
- '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: <em>/forum/, /contact/</em> 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' ),
251
- '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' ),
252
- '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' ),
253
- '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' ),
254
- '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' ),
255
- );
256
- // @codingStandardsIgnoreStop
257
-
258
- $this->help_anchors = array(
259
- 'license_key' => '#license-key',
260
- 'can' => '#canonical-urls',
261
- 'no_paged_canonical_links' => '#no-pagination-for-canonical-urls',
262
- 'customize_canonical_links' => '#enable-custom-canonical-urls',
263
- 'use_original_title' => '#use-original-title',
264
- 'schema_markup' => '#use-schema-markup',
265
- 'do_log' => '#log-important-events',
266
- 'home_title' => '#home-title',
267
- 'home_description' => '#home-description',
268
- 'home_keywords' => '#home-keywords',
269
- 'use_static_home_info' => '#use-static-front-page-instead',
270
- 'togglekeywords' => '#use-keywords',
271
- 'use_categories' => '#use-categories-for-meta-keywords',
272
- 'use_tags_as_keywords' => '#use-tags-for-meta-keywords',
273
- 'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
274
- 'rewrite_titles' => '#rewrite-titles',
275
- 'home_page_title_format' => '#title-format-fields',
276
- 'page_title_format' => '#title-format-fields',
277
- 'post_title_format' => '#title-format-fields',
278
- 'category_title_format' => '#title-format-fields',
279
- 'archive_title_format' => '#title-format-fields',
280
- 'date_title_format' => '#title-format-fields',
281
- 'author_title_format' => '#title-format-fields',
282
- 'tag_title_format' => '#title-format-fields',
283
- 'search_title_format' => '#title-format-fields',
284
- 'description_format' => '#title-format-fields',
285
- '404_title_format' => '#title-format-fields',
286
- 'paged_format' => '#title-format-fields',
287
- 'cpostactive' => '#seo-on-only-these-post-types',
288
- 'taxactive' => '#seo-on-only-these-taxonomies',
289
- 'posttypecolumns' => '#show-column-labels-for-custom-post-types',
290
- 'google_verify' => '',
291
- 'bing_verify' => '',
292
- 'pinterest_verify' => '',
293
- 'google_publisher' => '#google-plus-default-profile',
294
- 'google_disable_profile' => '#disable-google-plus-profile',
295
- 'google_sitelinks_search' => '#display-sitelinks-search-box',
296
- 'google_set_site_name' => '#set-preferred-site-name',
297
- 'google_author_advanced' => '#advanced-authorship-options',
298
- 'google_author_location' => '#display-google-authorship',
299
- 'google_enable_publisher' => '#display-publisher-meta-on-front-page',
300
- 'google_specify_publisher' => '#specify-publisher-url',
301
- 'google_analytics_id' => 'https://semperplugins.com/documentation/setting-up-google-analytics/',
302
- 'ga_domain' => '#tracking-domain',
303
- 'ga_multi_domain' => '#track-multiple-domains-additional-domains',
304
- 'ga_addl_domains' => '#track-multiple-domains-additional-domains',
305
- 'ga_anonymize_ip' => '#anonymize-ip-addresses',
306
- 'ga_display_advertising' => '#display-advertiser-tracking',
307
- 'ga_exclude_users' => '#exclude-users-from-tracking',
308
- 'ga_track_outbound_links' => '#track-outbound-links',
309
- 'ga_link_attribution' => '#enhanced-link-attribution',
310
- 'ga_enhanced_ecommerce' => '#enhanced-ecommerce',
311
- 'cpostnoindex' => '#noindex',
312
- 'cpostnofollow' => '#nofollow',
313
- 'category_noindex' => '#noindex-settings',
314
- 'archive_date_noindex' => '#noindex-settings',
315
- 'archive_author_noindex' => '#noindex-settings',
316
- 'tags_noindex' => '#noindex-settings',
317
- 'search_noindex' => '#use-noindex-for-the-search-page',
318
- '404_noindex' => '#use-noindex-for-the-404-page',
319
- 'tax_noindex' => '#use-noindex-for-the-taxonomy-archives',
320
- 'paginated_noindex' => '#use-noindex-for-paginated-pages-posts',
321
- 'paginated_nofollow' => '#use-nofollow-for-paginated-pages-posts',
322
- 'skip_excerpt' => '#avoid-using-the-excerpt-in-descriptions',
323
- 'generate_descriptions' => '#autogenerate-descriptions',
324
- 'run_shortcodes' => '#run-shortcodes-in-autogenerated-descriptions',
325
- 'hide_paginated_descriptions' => '#remove-descriptions-for-paginated-pages',
326
- 'dont_truncate_descriptions' => '#never-shorten-long-descriptions',
327
- 'unprotect_meta' => '#unprotect-post-meta-fields',
328
- 'redirect_attachement_parent' => '#redirect-attachments-to-post-parent',
329
- 'ex_pages' => '#exclude-pages',
330
- 'post_meta_tags' => '#additional-post-headers',
331
- 'page_meta_tags' => '#additional-page-headers',
332
- 'front_meta_tags' => '#additional-front-page-headers',
333
- 'home_meta_tags' => '#additional-blog-page-headers',
334
- 'snippet' => '#preview-snippet',
335
- 'title' => '#title',
336
- 'description' => '#description',
337
- 'keywords' => '#keywords',
338
- 'custom_link' => '#custom-canonical-url',
339
- 'noindex' => '#robots-meta-noindex',
340
- 'nofollow' => '#robots-meta-nofollow',
341
- 'sitemap_exclude' => '#exclude-from-sitemap',
342
- 'disable' => '#disable-on-this-post',
343
- 'disable_analytics' => '#disable-google-analytics',
344
- );
345
-
346
- $meta_help_text = array(
347
- 'snippet' => __( 'A preview of what this page might look like in search engine results.', 'all-in-one-seo-pack' ),
348
- 'title' => __( 'A custom title that shows up in the title tag for this page.', 'all-in-one-seo-pack' ),
349
- 'description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all-in-one-seo-pack' ),
350
- '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' ),
351
- 'custom_link' => __( 'Override the canonical URLs for this post.', 'all-in-one-seo-pack' ),
352
- 'noindex' => __( 'Check this box to ask search engines not to index this page.', 'all-in-one-seo-pack' ),
353
- 'nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all-in-one-seo-pack' ),
354
- 'sitemap_exclude' => __( "Don't display this page in the sitemap.", 'all-in-one-seo-pack' ),
355
- 'disable' => __( 'Disable SEO on this page.', 'all-in-one-seo-pack' ),
356
- 'disable_analytics' => __( 'Disable Google Analytics on this page.', 'all-in-one-seo-pack' ),
357
- );
358
-
359
  $this->default_options = array(
360
  'license_key' => array(
361
  'name' => __( 'License Key:', 'all-in-one-seo-pack' ),
@@ -415,20 +138,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
415
  'default' => 0,
416
  'condshow' => array( 'aiosp_can' => 'on' ),
417
  ),
418
- 'customize_canonical_links' => array(
419
- 'name' => __( 'Enable Custom Canonical URLs:', 'all-in-one-seo-pack' ),
420
- 'default' => 0,
421
- 'condshow' => array( 'aiosp_can' => 'on' ),
422
- ),
423
- 'rewrite_titles' => array(
424
- 'name' => __( 'Rewrite Titles:', 'all-in-one-seo-pack' ),
425
- 'default' => 1,
426
- 'type' => 'radio',
427
- 'initial_options' => array(
428
- 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
429
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
430
- ),
431
- ),
432
  'force_rewrites' => array(
433
  'name' => __( 'Force Rewrites:', 'all-in-one-seo-pack' ),
434
  'default' => 1,
@@ -452,73 +161,61 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
452
  'name' => __( 'Home Page Title Format:', 'all-in-one-seo-pack' ),
453
  'type' => 'text',
454
  'default' => '%page_title%',
455
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
456
  ),
457
  'page_title_format' => array(
458
  'name' => __( 'Page Title Format:', 'all-in-one-seo-pack' ),
459
  'type' => 'text',
460
- 'default' => '%page_title% | %blog_title%',
461
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
462
  ),
463
  'post_title_format' => array(
464
  'name' => __( 'Post Title Format:', 'all-in-one-seo-pack' ),
465
  'type' => 'text',
466
- 'default' => '%post_title% | %blog_title%',
467
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
468
  ),
469
  'category_title_format' => array(
470
  'name' => __( 'Category Title Format:', 'all-in-one-seo-pack' ),
471
  'type' => 'text',
472
- 'default' => '%category_title% | %blog_title%',
473
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
474
  ),
475
  'archive_title_format' => array(
476
  'name' => __( 'Archive Title Format:', 'all-in-one-seo-pack' ),
477
  'type' => 'text',
478
- 'default' => '%archive_title% | %blog_title%',
479
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
480
  ),
481
  'date_title_format' => array(
482
  'name' => __( 'Date Archive Title Format:', 'all-in-one-seo-pack' ),
483
  'type' => 'text',
484
- 'default' => '%date% | %blog_title%',
485
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
486
  ),
487
  'author_title_format' => array(
488
  'name' => __( 'Author Archive Title Format:', 'all-in-one-seo-pack' ),
489
  'type' => 'text',
490
- 'default' => '%author% | %blog_title%',
491
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
492
  ),
493
  'tag_title_format' => array(
494
  'name' => __( 'Tag Title Format:', 'all-in-one-seo-pack' ),
495
  'type' => 'text',
496
- 'default' => '%tag% | %blog_title%',
497
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
498
  ),
499
  'search_title_format' => array(
500
  'name' => __( 'Search Title Format:', 'all-in-one-seo-pack' ),
501
  'type' => 'text',
502
- 'default' => '%search% | %blog_title%',
503
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
504
  ),
505
  'description_format' => array(
506
  'name' => __( 'Description Format', 'all-in-one-seo-pack' ),
507
  'type' => 'text',
508
  'default' => '%description%',
509
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
510
  ),
511
  '404_title_format' => array(
512
  'name' => __( '404 Title Format:', 'all-in-one-seo-pack' ),
513
  'type' => 'text',
514
  'default' => __( 'Nothing found for %request_words%', 'all-in-one-seo-pack' ),
515
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
516
  ),
517
  'paged_format' => array(
518
  'name' => __( 'Paged Format:', 'all-in-one-seo-pack' ),
519
  'type' => 'text',
520
- 'default' => ' - Part %page%',
521
- 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
522
  ),
523
  'cpostactive' => array(
524
  'name' => __( 'SEO on only these Content Types:', 'all-in-one-seo-pack' ),
@@ -560,59 +257,19 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
560
  'default' => '',
561
  'type' => 'text',
562
  ),
563
- 'google_publisher' => array(
564
- 'name' => __( 'Google Plus Default Profile:', 'all-in-one-seo-pack' ),
565
  'default' => '',
566
  'type' => 'text',
567
  ),
568
- 'google_disable_profile' => array(
569
- 'name' => __( 'Disable Google Plus Profile:', 'all-in-one-seo-pack' ),
570
- 'default' => 0,
571
- 'type' => 'checkbox',
572
  ),
573
  'google_sitelinks_search' => array(
574
  'name' => __( 'Display Sitelinks Search Box:', 'all-in-one-seo-pack' ),
575
  ),
576
- 'google_set_site_name' => array(
577
- 'name' => __( 'Set Preferred Site Name:', 'all-in-one-seo-pack' ),
578
- ),
579
- 'google_specify_site_name' => array(
580
- 'name' => __( 'Specify A Preferred Name:', 'all-in-one-seo-pack' ),
581
- 'type' => 'text',
582
- 'placeholder' => $blog_name,
583
- 'condshow' => array( 'aiosp_google_set_site_name' => 'on' ),
584
- ),
585
- 'google_author_advanced' => array(
586
- 'name' => __( 'Advanced Authorship Options:', 'all-in-one-seo-pack' ),
587
- 'default' => 0,
588
- 'type' => 'radio',
589
- 'initial_options' => array(
590
- 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
591
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
592
- ),
593
- 'label' => null,
594
- ),
595
- 'google_author_location' => array(
596
- 'name' => __( 'Display Google Authorship:', 'all-in-one-seo-pack' ),
597
- 'default' => array( 'all' ),
598
- 'type' => 'multicheckbox',
599
- 'condshow' => array( 'aiosp_google_author_advanced' => 'on' ),
600
- ),
601
- 'google_enable_publisher' => array(
602
- 'name' => __( 'Display Publisher Meta on Front Page:', 'all-in-one-seo-pack' ),
603
- 'default' => 'on',
604
- 'type' => 'radio',
605
- 'initial_options' => array(
606
- 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
607
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
608
- ),
609
- 'condshow' => array( 'aiosp_google_author_advanced' => 'on' ),
610
- ),
611
- 'google_specify_publisher' => array(
612
- 'name' => __( 'Specify Publisher URL:', 'all-in-one-seo-pack' ),
613
- 'type' => 'text',
614
- 'condshow' => array( 'aiosp_google_author_advanced' => 'on', 'aiosp_google_enable_publisher' => 'on' ),
615
- ),
616
  // "google_connect"=>array( 'name' => __( 'Connect With Google Analytics', 'all-in-one-seo-pack' ), ),
617
  'google_analytics_id' => array(
618
  'name' => __( 'Google Analytics ID:', 'all-in-one-seo-pack' ),
@@ -855,7 +512,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
855
  'sanitize' => 'default',
856
  ),
857
  'home_meta_tags' => array(
858
- 'name' => __( 'Additional Blog Page Headers:', 'all-in-one-seo-pack' ),
859
  'type' => 'textarea',
860
  'default' => '',
861
  'sanitize' => 'default',
@@ -909,7 +566,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
909
  'upgrade' => array(
910
  'type' => 'html',
911
  'label' => 'none',
912
- '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' ),
913
  ),
914
  'support' => array(
915
  'type' => 'html',
@@ -966,12 +623,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
966
  ),
967
  );
968
 
969
- if ( ! empty( $meta_help_text ) ) {
970
- foreach ( $meta_help_text as $k => $v ) {
971
- $this->locations['aiosp']['default_options'][ $k ]['help_text'] = $v;
972
- }
973
- }
974
-
975
  $this->layout = array(
976
  'default' => array(
977
  'name' => __( 'General Settings', 'all-in-one-seo-pack' ),
@@ -987,7 +638,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
987
  'name' => __( 'Title Settings', 'all-in-one-seo-pack' ),
988
  'help_link' => 'https://semperplugins.com/documentation/title-settings/',
989
  'options' => array(
990
- 'rewrite_titles',
991
  'force_rewrites',
992
  'home_page_title_format',
993
  'page_title_format',
@@ -1016,21 +666,13 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1016
  'webmaster' => array(
1017
  'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
1018
  'help_link' => 'https://semperplugins.com/sections/webmaster-verification/',
1019
- 'options' => array( 'google_verify', 'bing_verify', 'pinterest_verify' ),
1020
  ),
1021
  'google' => array(
1022
  'name' => __( 'Google Settings', 'all-in-one-seo-pack' ),
1023
  'help_link' => 'https://semperplugins.com/documentation/google-settings/',
1024
  'options' => array(
1025
- 'google_publisher',
1026
- 'google_disable_profile',
1027
  'google_sitelinks_search',
1028
- 'google_set_site_name',
1029
- 'google_specify_site_name',
1030
- 'google_author_advanced',
1031
- 'google_author_location',
1032
- 'google_enable_publisher',
1033
- 'google_specify_publisher',
1034
  // "google_connect",
1035
  'google_analytics_id',
1036
  'ga_advanced_options',
@@ -1095,7 +737,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1095
  if ( AIOSEOPPRO ) {
1096
  // Add Pro options.
1097
  $this->default_options = aioseop_add_pro_opt( $this->default_options );
1098
- $this->help_text = aioseop_add_pro_help( $this->help_text );
1099
  $this->layout = aioseop_add_pro_layout( $this->layout );
1100
  }
1101
 
@@ -1111,15 +752,12 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1111
  $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
1112
 
1113
  if ( is_admin() ) {
1114
- $this->add_help_text_links();
1115
  add_action( 'aioseop_global_settings_header', array( $this, 'display_right_sidebar' ) );
1116
  add_action( 'aioseop_global_settings_footer', array( $this, 'display_settings_footer' ) );
1117
  add_action( 'output_option', array( $this, 'custom_output_option' ), 10, 2 );
1118
  add_action( 'all_admin_notices', array( $this, 'visibility_warning' ) );
 
1119
 
1120
- if ( ! AIOSEOPPRO ) {
1121
- // add_action('all_admin_notices', array( $this, 'woo_upgrade_notice'));
1122
- }
1123
  }
1124
  if ( AIOSEOPPRO ) {
1125
  add_action( 'split_shared_term', array( $this, 'split_shared_term' ), 10, 4 );
@@ -1186,9 +824,9 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1186
  }
1187
 
1188
  /**
1189
- * Get Title Format
1190
  *
1191
- * Get the title formatted according to AIOSEOP %shortcodes%.
1192
  *
1193
  * @since 2.4.9
1194
  *
@@ -1206,28 +844,42 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1206
  $w = $info['w'];
1207
  $p = $info['p'];
1208
 
1209
- if ( strpos( $title_format, '%blog_title%' ) !== false ) {
 
 
 
 
 
 
 
 
 
 
 
 
1210
  $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
1211
  }
1212
  $title_format = $this->apply_cf_fields( $title_format );
1213
  $replace_title = '<span id="' . $args['name'] . '_title">' . esc_attr( wp_strip_all_tags( html_entity_decode( $title ) ) ) . '</span>';
1214
- if ( strpos( $title_format, '%post_title%' ) !== false ) {
1215
  $title_format = str_replace( '%post_title%', $replace_title, $title_format );
1216
  }
1217
- if ( strpos( $title_format, '%page_title%' ) !== false ) {
1218
  $title_format = str_replace( '%page_title%', $replace_title, $title_format );
1219
  }
1220
- if ( strpos( $title_format, '%current_date%' ) !== false ) {
1221
  $title_format = str_replace( '%current_date%', aioseop_formatted_date(), $title_format );
1222
  }
1223
-
1224
- if ( strpos( $title_format, "%post_date%" ) !== false ){
 
 
1225
  $title_format = str_replace( '%post_date%', aioseop_formatted_date( get_the_time( 'U' ) ), $title_format );
1226
  }
1227
- if ( strpos( $title_format, '%post_year%' ) !== false ) {
1228
  $title_format = str_replace( '%post_year%', get_the_date( 'Y' ), $title_format );
1229
  }
1230
- if ( strpos( $title_format, '%post_month%' ) !== false ) {
1231
  $title_format = str_replace( '%post_month%', get_the_date( 'F' ), $title_format );
1232
  }
1233
  if ( $w->is_category || $w->is_tag || $w->is_tax ) {
@@ -1243,28 +895,28 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1243
  }
1244
  }
1245
  }
1246
- if ( strpos( $title_format, '%category_title%' ) !== false ) {
1247
  $title_format = str_replace( '%category_title%', $replace_title, $title_format );
1248
  }
1249
- if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) {
1250
  $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format );
1251
  }
1252
  } else {
1253
- if ( strpos( $title_format, '%category%' ) !== false ) {
1254
  $title_format = str_replace( '%category%', $category, $title_format );
1255
  }
1256
- if ( strpos( $title_format, '%category_title%' ) !== false ) {
1257
  $title_format = str_replace( '%category_title%', $category, $title_format );
1258
  }
1259
- if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) {
1260
  $title_format = str_replace( '%taxonomy_title%', $category, $title_format );
1261
  }
1262
  if ( AIOSEOPPRO ) {
1263
- if ( strpos( $title_format, '%tax_' ) && ! empty( $p ) ) {
1264
  $taxes = get_object_taxonomies( $p, 'objects' );
1265
  if ( ! empty( $taxes ) ) {
1266
  foreach ( $taxes as $t ) {
1267
- if ( strpos( $title_format, "%tax_{$t->name}%" ) ) {
1268
  $terms = $this->get_all_terms( $p->ID, $t->name );
1269
  $term = '';
1270
  if ( count( $terms ) > 0 ) {
@@ -1277,12 +929,30 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1277
  }
1278
  }
1279
  }
1280
- if ( strpos( $title_format, '%taxonomy_description%' ) !== false ) {
1281
  $title_format = str_replace( '%taxonomy_description%', $description, $title_format );
1282
  }
1283
 
 
 
 
 
 
 
 
 
 
 
1284
  $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
1285
 
 
 
 
 
 
 
 
 
1286
  return $title_format;
1287
  }
1288
 
@@ -1398,7 +1068,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1398
  $show_page = false;
1399
  }
1400
  if ( $aioseop_options['aiosp_can'] ) {
1401
- if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) ) {
1402
  $url = $opts['aiosp_custom_link'];
1403
  }
1404
  if ( empty( $url ) ) {
@@ -1485,7 +1155,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1485
  'noindex',
1486
  'nofollow',
1487
  );
1488
- if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
1489
  unset( $optlist['custom_link'] );
1490
  }
1491
  foreach ( $optlist as $f ) {
@@ -1566,10 +1236,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1566
  global $aioseop_options;
1567
  $title = false;
1568
  $post = $this->get_queried_object();
1569
- if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) ) {
1570
- $title = $this->get_aioseop_title( $post );
1571
- $title = $this->apply_cf_fields( $title );
1572
- }
1573
 
1574
  if ( false === $title ) {
1575
  $title = $this->get_original_title();
@@ -1749,11 +1417,17 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1749
  } elseif ( is_search() && isset( $s ) && ! empty( $s ) ) {
1750
  $search = esc_attr( stripslashes( $s ) );
1751
  $title_format = $aioseop_options['aiosp_search_title_format'];
1752
- $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1753
- if ( strpos( $title, '%blog_description%' ) !== false ) {
 
 
 
 
 
 
1754
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1755
  }
1756
- if ( strpos( $title, '%search%' ) !== false ) {
1757
  $title = str_replace( '%search%', $search, $title );
1758
  }
1759
  $title = $this->paged_title( $title );
@@ -1791,17 +1465,23 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1791
  }
1792
  if ( $tag ) {
1793
  $title_format = $aioseop_options['aiosp_tag_title_format'];
1794
- $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1795
- if ( strpos( $title, '%blog_description%' ) !== false ) {
 
 
 
 
 
 
1796
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1797
  }
1798
- if ( strpos( $title, '%tag%' ) !== false ) {
1799
  $title = str_replace( '%tag%', $tag, $title );
1800
  }
1801
- if ( strpos( $title, '%tag_description%' ) !== false ) {
1802
  $title = str_replace( '%tag_description%', $tag_description, $title );
1803
  }
1804
- if ( strpos( $title, '%taxonomy_description%' ) !== false ) {
1805
  $title = str_replace( '%taxonomy_description%', $tag_description, $title );
1806
  }
1807
  $title = trim( wp_strip_all_tags( $title ) );
@@ -1816,11 +1496,17 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1816
  $tag = $STagging->search_tag;
1817
  if ( $tag ) {
1818
  $title_format = $aioseop_options['aiosp_tag_title_format'];
1819
- $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1820
- if ( strpos( $title, '%blog_description%' ) !== false ) {
 
 
 
 
 
 
1821
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1822
  }
1823
- if ( strpos( $title, '%tag%' ) !== false ) {
1824
  $title = str_replace( '%tag%', $tag, $title );
1825
  }
1826
  $title = $this->paged_title( $title );
@@ -1850,10 +1536,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1850
  }
1851
  $month = date( 'F', mktime( 0, 0, 0, (int) $monthnum, 1, (int) $year ) );
1852
  $new_title = str_replace( '%monthnum%', $monthnum, $new_title );
1853
- if ( strpos( $new_title, '%month%' ) !== false ) {
1854
  $new_title = str_replace( '%month%', $month, $new_title );
1855
  }
1856
- if ( strpos( $new_title, '%year%' ) !== false ) {
1857
  $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
1858
  }
1859
  } elseif ( is_post_type_archive() ) {
@@ -1864,8 +1550,14 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1864
  } else {
1865
  return false;
1866
  }
1867
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
1868
- if ( strpos( $new_title, '%blog_description%' ) !== false ) {
 
 
 
 
 
 
1869
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1870
  }
1871
  $title = trim( $new_title );
@@ -1874,17 +1566,23 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1874
  return $title;
1875
  } elseif ( is_404() ) {
1876
  $title_format = $aioseop_options['aiosp_404_title_format'];
1877
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1878
- if ( strpos( $new_title, '%blog_description%' ) !== false ) {
 
 
 
 
 
 
1879
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1880
  }
1881
- if ( strpos( $new_title, '%request_url%' ) !== false ) {
1882
  $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
1883
  }
1884
- if ( strpos( $new_title, '%request_words%' ) !== false ) {
1885
  $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
1886
  }
1887
- if ( strpos( $new_title, '%404_title%' ) !== false ) {
1888
  $new_title = str_replace( '%404_title%', $this->internationalize( $this->get_original_title( '', false ) ), $new_title );
1889
  }
1890
 
@@ -1971,14 +1669,20 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1971
  $title = $this->internationalize( post_type_archive_title( '', false ) );
1972
  } elseif ( is_404() ) {
1973
  $title_format = $aioseop_options['aiosp_404_title_format'];
1974
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1975
- if ( strpos( $new_title, '%blog_description%' ) !== false ) {
 
 
 
 
 
 
1976
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1977
  }
1978
- if ( strpos( $new_title, '%request_url%' ) !== false ) {
1979
  $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
1980
  }
1981
- if ( strpos( $new_title, '%request_words%' ) !== false ) {
1982
  $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
1983
  }
1984
  $title = $new_title;
@@ -2031,7 +1735,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2031
  }
2032
 
2033
  /**
2034
- * Replace title templates inside % symbol.
2035
  *
2036
  * @param $title
2037
  * @param $post
@@ -2042,30 +1746,45 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2042
  * @return string
2043
  */
2044
  function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
 
 
 
 
 
 
 
 
 
2045
  if ( ! empty( $post ) ) {
2046
  $authordata = get_userdata( $post->post_author );
2047
  } else {
2048
  $authordata = new WP_User();
2049
  }
2050
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
2051
- if ( strpos( $new_title, '%blog_description%' ) !== false ) {
 
 
 
 
 
 
2052
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
2053
  }
2054
- if ( strpos( $new_title, "%{$type}_title%" ) !== false ) {
2055
  $new_title = str_replace( "%{$type}_title%", $title, $new_title );
2056
  }
2057
  if ( $type == 'post' ) {
2058
- if ( strpos( $new_title, '%category%' ) !== false ) {
2059
  $new_title = str_replace( '%category%', $category, $new_title );
2060
  }
2061
- if ( strpos( $new_title, '%category_title%' ) !== false ) {
2062
  $new_title = str_replace( '%category_title%', $category, $new_title );
2063
  }
2064
- if ( strpos( $new_title, '%tax_' ) && ! empty( $post ) ) {
2065
  $taxes = get_object_taxonomies( $post, 'objects' );
2066
  if ( ! empty( $taxes ) ) {
2067
  foreach ( $taxes as $t ) {
2068
- if ( strpos( $new_title, "%tax_{$t->name}%" ) ) {
2069
  $terms = $this->get_all_terms( $post->ID, $t->name );
2070
  $term = '';
2071
  if ( count( $terms ) > 0 ) {
@@ -2077,32 +1796,52 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2077
  }
2078
  }
2079
  }
2080
- if ( strpos( $new_title, "%{$type}_author_login%" ) !== false ) {
2081
  $new_title = str_replace( "%{$type}_author_login%", $authordata->user_login, $new_title );
2082
  }
2083
- if ( strpos( $new_title, "%{$type}_author_nicename%" ) !== false ) {
2084
  $new_title = str_replace( "%{$type}_author_nicename%", $authordata->user_nicename, $new_title );
2085
  }
2086
- if ( strpos( $new_title, "%{$type}_author_firstname%" ) !== false ) {
2087
  $new_title = str_replace( "%{$type}_author_firstname%", $this->ucwords( $authordata->first_name ), $new_title );
2088
  }
2089
- if ( strpos( $new_title, "%{$type}_author_lastname%" ) !== false ) {
2090
  $new_title = str_replace( "%{$type}_author_lastname%", $this->ucwords( $authordata->last_name ), $new_title );
2091
  }
2092
-
2093
- if ( strpos( $new_title, "%current_date%" ) !== false ){
2094
  $new_title = str_replace( '%current_date%', aioseop_formatted_date(), $new_title );
2095
  }
2096
- if ( strpos( $new_title, "%post_date%" ) !== false ){
 
 
 
2097
  $new_title = str_replace( '%post_date%', aioseop_formatted_date( get_the_date( 'U' ) ), $new_title );
2098
  }
2099
- if ( strpos( $new_title, '%post_year%' ) !== false ) {
2100
  $new_title = str_replace( '%post_year%', get_the_date( 'Y' ), $new_title );
2101
  }
2102
- if ( strpos( $new_title, '%post_month%' ) !== false ) {
2103
  $new_title = str_replace( '%post_month%', get_the_date( 'F' ), $new_title );
2104
  }
2105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2106
  $title = trim( $new_title );
2107
 
2108
  return $title;
@@ -2194,7 +1933,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2194
  if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) {
2195
  return false;
2196
  }
2197
- $title_format = "%{$title_type}_title% | %blog_title%";
2198
  if ( isset( $aioseop_options[ "aiosp_{$title_type}_title_format" ] ) ) {
2199
  $title_format = $aioseop_options[ "aiosp_{$title_type}_title_format" ];
2200
  }
@@ -2279,6 +2018,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2279
  * @return string
2280
  */
2281
  function get_tax_title( $tax = '' ) {
 
2282
  if ( AIOSEOPPRO ) {
2283
  if ( empty( $this->meta_opts ) ) {
2284
  $this->meta_opts = $this->get_current_options( array(), 'aiosp' );
@@ -2356,28 +2096,65 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2356
  * @return string
2357
  */
2358
  function apply_tax_title_format( $category_name, $category_description, $tax = '' ) {
 
 
 
 
 
 
 
 
 
2359
  if ( empty( $tax ) ) {
2360
  $tax = get_query_var( 'taxonomy' );
2361
  }
2362
  $title_format = $this->get_tax_title_format( $tax );
2363
  $title = str_replace( '%taxonomy_title%', $category_name, $title_format );
2364
- if ( strpos( $title, '%taxonomy_description%' ) !== false ) {
2365
  $title = str_replace( '%taxonomy_description%', $category_description, $title );
2366
  }
2367
- if ( strpos( $title, '%category_title%' ) !== false ) {
2368
  $title = str_replace( '%category_title%', $category_name, $title );
2369
  }
2370
- if ( strpos( $title, '%category_description%' ) !== false ) {
2371
  $title = str_replace( '%category_description%', $category_description, $title );
2372
  }
2373
- if ( strpos( $title, '%blog_title%' ) !== false ) {
 
 
 
2374
  $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
2375
  }
2376
- if ( strpos( $title, '%blog_description%' ) !== false ) {
 
 
 
2377
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
2378
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2379
  $title = wp_strip_all_tags( $title );
2380
 
 
 
 
 
 
 
 
 
2381
  return $this->paged_title( $title );
2382
  }
2383
 
@@ -2389,7 +2166,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2389
  function get_tax_title_format( $tax = '' ) {
2390
  global $aioseop_options;
2391
  if ( AIOSEOPPRO ) {
2392
- $title_format = '%taxonomy_title% | %blog_title%';
2393
  if ( is_category() ) {
2394
  $title_format = $aioseop_options['aiosp_category_title_format'];
2395
  } else {
@@ -2402,10 +2179,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2402
  }
2403
  }
2404
  if ( empty( $title_format ) ) {
2405
- $title_format = '%category_title% | %blog_title%';
2406
  }
2407
  } else {
2408
- $title_format = '%category_title% | %blog_title%';
2409
  if ( ! empty( $aioseop_options['aiosp_category_title_format'] ) ) {
2410
  $title_format = $aioseop_options['aiosp_category_title_format'];
2411
  }
@@ -2424,7 +2201,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2424
  */
2425
  function apply_archive_title_format( $title, $category = '' ) {
2426
  $title_format = $this->get_archive_title_format();
2427
- $r_title = array( '%blog_title%', '%blog_description%', '%archive_title%' );
2428
  $d_title = array(
2429
  $this->internationalize( get_bloginfo( 'name' ) ),
2430
  $this->internationalize( get_bloginfo( 'description' ) ),
@@ -2526,7 +2303,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2526
  */
2527
  function get_page_number() {
2528
  global $post;
2529
- if ( is_singular() && false === strpos( $post->post_content, '<!--nextpage-->' ) ) {
2530
  return null;
2531
  }
2532
  $page = get_query_var( 'page' );
@@ -2580,7 +2357,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2580
  */
2581
  function get_post_description( $post ) {
2582
  global $aioseop_options;
2583
- $description = '';
2584
  if ( ! $this->show_page_description() ) {
2585
  return '';
2586
  }
@@ -2590,15 +2366,21 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2590
  }
2591
  if ( ! $description ) {
2592
  if ( empty( $aioseop_options['aiosp_skip_excerpt'] ) ) {
2593
- $description = $this->trim_text_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
2594
  }
2595
  if ( ! $description && isset( $aioseop_options['aiosp_generate_descriptions'] ) && $aioseop_options['aiosp_generate_descriptions'] ) {
2596
- $content = $post->post_content;
2597
- if ( ! empty( $aioseop_options['aiosp_run_shortcodes'] ) ) {
2598
- $content = do_shortcode( $content );
 
 
 
 
 
2599
  }
2600
- $description = $this->trim_text_without_filters_full_length( $this->internationalize( $content ) );
2601
  }
 
 
2602
  }
2603
 
2604
  return $description;
@@ -3075,6 +2857,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3075
  <?php
3076
  }
3077
 
 
 
 
 
3078
  function add_admin_pointers() {
3079
 
3080
  $pro = '';
@@ -3085,49 +2871,14 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3085
  $this->pointers['aioseop_menu_2640'] = array(
3086
  'pointer_target' => "#toplevel_page_all-in-one-seo-pack$pro-aioseop_class",
3087
  'pointer_text' => '<h3>' . __( 'Review Your Settings', 'all-in-one-seo-pack' )
3088
- . '</h3><p>' . 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 ) . '</p>',
3089
- 'pointer_edge' => 'top',
3090
- 'pointer_align' => 'left',
3091
- 'pointer_scope' => 'global',
3092
- );
3093
-
3094
- $this->pointers['aioseop_menu_2361'] = array(
3095
- 'pointer_target' => '#aioseop_top_button',
3096
- 'pointer_text' => '<h3>' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
3097
- . '</h3><p>' . __( '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' ) . '</p>',
3098
  'pointer_edge' => 'top',
3099
  'pointer_align' => 'left',
3100
  'pointer_scope' => 'global',
3101
  );
3102
- $this->pointers['aioseop_welcome_230'] = array(
3103
- 'pointer_target' => '#aioseop_top_button',
3104
- 'pointer_text' => '<h3>' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
3105
- . '</h3><p>' . __( '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' ) . '</p>',
3106
- 'pointer_edge' => 'bottom',
3107
- 'pointer_align' => 'left',
3108
- 'pointer_scope' => 'local',
3109
- );
3110
- $this->filter_pointers();
3111
-
3112
- $this->pointers['aioseop_menu_2205'] = array(
3113
- 'pointer_target' => '#toplevel_page_all-in-one-seo-pack-aioseop_class',
3114
- 'pointer_text' => '<h3>' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
3115
- . '</h3><p>' . __( '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' ) . '</p>',
3116
- 'pointer_edge' => 'top',
3117
- 'pointer_align' => 'left',
3118
- 'pointer_scope' => 'global',
3119
- );
3120
- $this->pointers['aioseop_welcome_220534'] = array(
3121
- 'pointer_target' => '#aioseop_top_button',
3122
- 'pointer_text' => '<h3>' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
3123
- . '</h3><p>' . __( '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' ) . '</p>',
3124
- 'pointer_edge' => 'bottom',
3125
- 'pointer_align' => 'left',
3126
- 'pointer_scope' => 'local',
3127
- );
3128
  $this->filter_pointers();
3129
-
3130
  }
 
3131
 
3132
  function add_page_hooks() {
3133
 
@@ -3153,6 +2904,13 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3153
  }
3154
  }
3155
 
 
 
 
 
 
 
 
3156
  $taxes = get_taxonomies( '', 'objects' );
3157
  $tx = array_keys( $taxes );
3158
  $remtax = array( 'nav_menu', 'link_category', 'post_format' );
@@ -3166,6 +2924,15 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3166
  }
3167
  }
3168
 
 
 
 
 
 
 
 
 
 
3169
  $this->default_options['posttypecolumns']['initial_options'] = $post_types;
3170
  $this->default_options['cpostactive']['initial_options'] = $all_post_types;
3171
  $this->default_options['cpostnoindex']['initial_options'] = $post_types;
@@ -3173,9 +2940,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3173
  if ( AIOSEOPPRO ) {
3174
  $this->default_options['taxactive']['initial_options'] = $tax_types;
3175
  }
3176
- $this->default_options['google_author_location']['initial_options'] = $post_types;
3177
- $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' ) ) );
3178
- $this->default_options['google_author_location']['default'] = array_keys( $this->default_options['google_author_location']['initial_options'] );
3179
 
3180
  foreach ( $all_post_types as $p => $pt ) {
3181
  $field = $p . '_title_format';
@@ -3184,34 +2948,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3184
  $this->default_options[ $field ] = array(
3185
  'name' => "$name " . __( 'Title Format:', 'all-in-one-seo-pack' ) . "<br />($p)",
3186
  'type' => 'text',
3187
- 'default' => '%post_title% | %blog_title%',
3188
  'condshow' => array(
3189
- 'aiosp_rewrite_titles' => 1,
3190
  'aiosp_cpostactive\[\]' => $p,
3191
  ),
3192
  );
3193
- $this->help_text[ $field ] = __( 'The following macros are supported:', 'all-in-one-seo-pack' )
3194
- . '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
3195
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
3196
- __( '%post_title% - The original title of the post.', 'all-in-one-seo-pack' ) . '</li><li>';
3197
- $taxes = get_object_taxonomies( $p, 'objects' );
3198
- if ( ! empty( $taxes ) ) {
3199
- foreach ( $taxes as $n => $t ) {
3200
- $this->help_text[ $field ] .= sprintf( __( "%%tax_%1\$s%% - This post's associated %2\$s taxonomy title", 'all-in-one-seo-pack' ), $n, $t->label ) . '</li><li>';
3201
- }
3202
- }
3203
- $this->help_text[ $field ] .=
3204
- __( "%post_author_login% - This post's author' login", 'all-in-one-seo-pack' ) . '</li><li>' .
3205
- __( "%post_author_nicename% - This post's author' nicename", 'all-in-one-seo-pack' ) . '</li><li>' .
3206
- __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all-in-one-seo-pack' ) . '</li><li>' .
3207
- __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all-in-one-seo-pack' ) . '</li>' .
3208
- __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
3209
- __( '%post_date% - The date the post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
3210
- __( '%post_year% - The year the post was published (localized)', 'all-in-one-seo-pack' ) . '</li><li>' .
3211
- __( '%post_month% - The month the post was published (localized)', 'all-in-one-seo-pack' ) . '</li>' .
3212
- '</ul>' .
3213
- '</ul>';
3214
- $this->help_anchors[ $field ] = '#custom-titles';
3215
  $this->layout['cpt']['options'][] = $field;
3216
  }
3217
  }
@@ -3238,24 +2979,16 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3238
  $this->default_options[ $field ] = array(
3239
  'name' => "$name " . __( 'Taxonomy Title Format:', 'all-in-one-seo-pack' ),
3240
  'type' => 'text',
3241
- 'default' => '%taxonomy_title% | %blog_title%',
3242
  'condshow' => array(
3243
- 'aiosp_rewrite_titles' => 1,
3244
  'aiosp_taxactive\[\]' => $p,
3245
  ),
3246
  );
3247
- $this->help_text[ $field ] = __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
3248
- '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
3249
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
3250
- __( '%taxonomy_title% - The original title of the taxonomy', 'all-in-one-seo-pack' ) . '</li><li>' .
3251
- __( '%taxonomy_description% - The description of the taxonomy', 'all-in-one-seo-pack' ) . '</li></ul>';
3252
- $this->help_anchors[ $field ] = '#custom-titles';
3253
  $this->layout['cpt']['options'][] = $field;
3254
  }
3255
  }
3256
  }
3257
  $this->setting_options();
3258
- $this->add_help_text_links();
3259
 
3260
  if ( AIOSEOPPRO ) {
3261
  global $aioseop_update_checker;
@@ -3347,10 +3080,14 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3347
  * @return mixed
3348
  */
3349
  function filter_submit( $submit ) {
3350
- $submit['Submit_Default']['value'] = __( 'Reset General Settings to Defaults', 'all-in-one-seo-pack' ) . ' &raquo;';
 
 
 
 
3351
  $submit['Submit_All_Default'] = array(
3352
  'type' => 'submit',
3353
- 'class' => 'button-secondary',
3354
  'value' => __( 'Reset ALL Settings to Defaults', 'all-in-one-seo-pack' ) . ' &raquo;',
3355
  );
3356
 
@@ -3477,7 +3214,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3477
  } elseif ( ! empty( $current[ "{$prefix}togglekeywords" ] ) ) {
3478
  unset( $settings[ "{$prefix}keywords" ] );
3479
  }
3480
- if ( empty( $this->options['aiosp_can'] ) || empty( $this->options['aiosp_customize_canonical_links'] ) ) {
3481
  unset( $settings[ "{$prefix}custom_link" ] );
3482
  }
3483
  }
@@ -3508,9 +3245,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3508
  }
3509
  if ( $location == null ) {
3510
  $prefix = $this->prefix;
3511
- if ( isset( $options[ "{$prefix}rewrite_titles" ] ) && ( ! empty( $options[ "{$prefix}rewrite_titles" ] ) ) ) {
3512
- $options[ "{$prefix}rewrite_titles" ] = 1;
3513
- }
3514
  if ( isset( $options[ "{$prefix}use_original_title" ] ) && ( $options[ "{$prefix}use_original_title" ] === '' ) ) {
3515
  $options[ "{$prefix}use_original_title" ] = 0;
3516
  }
@@ -3525,19 +3259,17 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3525
  $post = $this->get_queried_object();
3526
 
3527
  if ( ! $this->is_page_included() ) {
3528
- return;
3529
  }
3530
 
3531
- if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) ) {
3532
- $force_rewrites = 1;
3533
- if ( isset( $aioseop_options['aiosp_force_rewrites'] ) ) {
3534
- $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
3535
- }
3536
- if ( $force_rewrites ) {
3537
- ob_start( array( $this, 'output_callback_for_title' ) );
3538
- } else {
3539
- add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
3540
- }
3541
  }
3542
  }
3543
 
@@ -3676,8 +3408,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3676
  $title = trim( strip_tags( $title ) );
3677
  $title_tag_start = '<title';
3678
  $title_tag_end = '</title';
3679
- $start = $this->strpos( $content, $title_tag_start );
3680
- $end = $this->strpos( $content, $title_tag_end );
3681
  $this->title_start = $start;
3682
  $this->title_end = $end;
3683
  $this->orig_title = $title;
@@ -3743,51 +3475,40 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3743
  add_filter( 'aioseop_title', array( &$this, 'filter_title' ) );
3744
  }
3745
 
 
 
 
 
 
 
 
 
 
 
 
 
3746
  function visibility_warning() {
3747
-
3748
- $aioseop_visibility_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed', true );
3749
-
3750
- if ( '0' == get_option( 'blog_public' ) && empty( $aioseop_visibility_notice_dismissed ) ) {
3751
-
3752
- printf(
3753
- '
3754
- <div id="message" class="error notice is-dismissible aioseop-notice visibility-notice">
3755
- <p>
3756
- <strong>%1$s</strong>
3757
- %2$s
3758
-
3759
- </p>
3760
- </div>',
3761
- __( 'Warning: You\'re blocking access to search engines.', 'all-in-one-seo-pack' ),
3762
- 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( '<a href="%s">', esc_url( admin_url( 'options-reading.php' ) ) ), '</a>' )
3763
- );
3764
-
3765
- } elseif ( '1' == get_option( 'blog_public' ) && ! empty( $aioseop_visibility_notice_dismissed ) ) {
3766
- delete_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed' );
3767
  }
3768
  }
3769
 
3770
- function woo_upgrade_notice() {
3771
-
3772
- $aioseop_woo_upgrade_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed', true );
3773
-
3774
- if ( class_exists( 'WooCommerce' ) && empty( $aioseop_woo_upgrade_notice_dismissed ) && current_user_can( 'manage_options' ) ) {
3775
-
3776
- printf(
3777
- '
3778
- <div id="message" class="notice-info notice is-dismissible aioseop-notice woo-upgrade-notice">
3779
- <p>
3780
- <strong>%1$s</strong>
3781
- %2$s
3782
-
3783
- </p>
3784
- </div>',
3785
- __( 'We\'ve detected you\'re running WooCommerce.', 'all-in-one-seo-pack' ),
3786
- 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( '<a target="_blank" href="%s">', esc_url( 'https://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=woo' ) ), '</a>' )
3787
- );
3788
-
3789
- } elseif ( ! class_exists( 'WooCommerce' ) && ! empty( $aioseop_woo_upgrade_notice_dismissed ) ) {
3790
- delete_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed' );
3791
  }
3792
  }
3793
 
@@ -3901,7 +3622,9 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3901
  $aioseop_dup_counter ++;
3902
 
3903
  if ( ! defined( 'AIOSEOP_UNIT_TESTING' ) && $aioseop_dup_counter > 1 ) {
3904
- echo "\n<!-- " . sprintf( __( 'Debug Warning: All in One SEO Pack meta data was included again from %1$s filter. Called %2$s times!', 'all-in-one-seo-pack' ), current_filter(), $aioseop_dup_counter ) . " -->\n";
 
 
3905
  if ( ! empty( $old_wp_query ) ) {
3906
  // Change the query back after we've finished.
3907
  $GLOBALS['wp_query'] = $old_wp_query;
@@ -3919,11 +3642,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3919
  $description = '';
3920
  // Logging - rewrite handler check for output buffering.
3921
  $this->check_rewrite_handler();
3922
- if ( AIOSEOPPRO ) {
3923
- echo "\n<!-- All in One SEO Pack Pro $this->version by Michael Torbert of Semper Fi Web Design";
3924
- } else {
3925
- echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
3926
- }
3927
  if ( $this->ob_start_detected ) {
3928
  echo 'ob_start_detected ';
3929
  }
@@ -3995,6 +3717,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3995
  'google' => 'google-site-verification',
3996
  'bing' => 'msvalidate.01',
3997
  'pinterest' => 'p:domain_verify',
 
 
3998
  ) as $k => $v
3999
  ) {
4000
  if ( ! empty( $aioseop_options[ "aiosp_{$k}_verify" ] ) ) {
@@ -4003,9 +3727,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4003
  }
4004
 
4005
  // Sitelinks search. Only show if "use schema.org markup is checked".
4006
- if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) && (
4007
- ! empty( $aioseop_options['aiosp_google_sitelinks_search'] ) || ! empty( $aioseop_options['aiosp_google_set_site_name'] ) )
4008
- ) {
4009
  $meta_string .= $this->sitelinks_search_box() . "\n";
4010
  }
4011
  }
@@ -4029,16 +3751,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4029
  }
4030
  $meta_string .= $post_meta;
4031
  }
4032
- // Handle authorship.
4033
- $authorship = $this->get_google_authorship( $post );
4034
- $publisher = apply_filters( 'aioseop_google_publisher', $authorship['publisher'] );
4035
- if ( ! empty( $publisher ) ) {
4036
- $meta_string = '<link rel="publisher" href="' . esc_url( $publisher ) . '" />' . "\n" . $meta_string;
4037
- }
4038
- $author = apply_filters( 'aioseop_google_author', $authorship['author'] );
4039
- if ( ! empty( $author ) ) {
4040
- $meta_string = '<link rel="author" href="' . esc_url( $author ) . '" />' . "\n" . $meta_string;
4041
- }
4042
 
4043
  if ( is_front_page() && ! empty( $front_meta ) ) {
4044
  if ( isset( $meta_string ) ) {
@@ -4057,10 +3769,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4057
  $prev = apply_filters( 'aioseop_prev_link', $prev_next['prev'] );
4058
  $next = apply_filters( 'aioseop_next_link', $prev_next['next'] );
4059
  if ( ! empty( $prev ) ) {
4060
- $meta_string .= "<link rel='prev' href='" . esc_url( $prev ) . "' />\n";
4061
  }
4062
  if ( ! empty( $next ) ) {
4063
- $meta_string .= "<link rel='next' href='" . esc_url( $next ) . "' />\n";
4064
  }
4065
  if ( $meta_string != null ) {
4066
  echo "$meta_string\n";
@@ -4074,7 +3786,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4074
 
4075
  if ( isset( $aioseop_options['aiosp_can'] ) && $aioseop_options['aiosp_can'] ) {
4076
  $url = '';
4077
- if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) && ! is_home() ) {
4078
  $url = $opts['aiosp_custom_link'];
4079
  if ( apply_filters( 'aioseop_canonical_url_pagination', $show_page ) ) {
4080
  $url = $this->get_paged( $url );
@@ -4092,11 +3804,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4092
  }
4093
  }
4094
  do_action( 'aioseop_modules_wp_head' );
4095
- if ( AIOSEOPPRO ) {
4096
- echo "<!-- /all in one seo pack pro -->\n";
4097
- } else {
4098
- echo "<!-- /all in one seo pack -->\n";
4099
- }
4100
 
4101
  if ( ! empty( $old_wp_query ) ) {
4102
  // Change the query back after we've finished.
@@ -4117,7 +3825,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4117
  $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
4118
  }
4119
 
4120
- if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) && $force_rewrites ) {
4121
  // Make the title rewrite as short as possible.
4122
  if ( function_exists( 'ob_list_handlers' ) ) {
4123
  $active_handlers = ob_list_handlers();
@@ -4133,11 +3841,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4133
  $this->log( 'another plugin interfering?' );
4134
  // If we get here there *could* be trouble with another plugin :(.
4135
  $this->ob_start_detected = true;
4136
- if ( $this->option_isset( 'rewrite_titles' ) ) { // Try alternate method -- pdb.
4137
- $aioseop_options['aiosp_rewrite_titles'] = 0;
4138
- $force_rewrites = 0;
4139
- add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
4140
- }
4141
  if ( function_exists( 'ob_list_handlers' ) ) {
4142
  foreach ( ob_list_handlers() as $handler ) {
4143
  $this->log( "detected output handler $handler" );
@@ -4168,34 +3875,52 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4168
  * @return mixed
4169
  */
4170
  function apply_description_format( $description, $post = null ) {
 
 
 
 
 
 
 
 
 
4171
  global $aioseop_options;
4172
  $description_format = $aioseop_options['aiosp_description_format'];
4173
  if ( ! isset( $description_format ) || empty( $description_format ) ) {
4174
  $description_format = '%description%';
4175
  }
4176
  $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
4177
- if ( strpos( $description, '%blog_title%' ) !== false ) {
 
 
 
4178
  $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
4179
  }
4180
- if ( strpos( $description, '%blog_description%' ) !== false ) {
 
 
 
4181
  $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
4182
  }
4183
- if ( strpos( $description, '%wp_title%' ) !== false ) {
4184
  $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
4185
  }
4186
- if ( strpos( $description, '%post_title%' ) !== false ) {
4187
  $description = str_replace( '%post_title%', $this->get_aioseop_title( $post, false ), $description );
4188
  }
4189
- if ( strpos( $description, '%current_date%' ) !== false ) {
4190
  $description = str_replace( '%current_date%', date_i18n( get_option( 'date_format' ) ), $description );
4191
  }
4192
- if ( strpos( $description, '%post_date%' ) !== false ) {
 
 
 
4193
  $description = str_replace( '%post_date%', get_the_date(), $description );
4194
  }
4195
- if ( strpos( $description, '%post_year%' ) !== false ) {
4196
  $description = str_replace( '%post_year%', get_the_date( 'Y' ), $description );
4197
  }
4198
- if ( strpos( $description, '%post_month%' ) !== false ) {
4199
  $description = str_replace( '%post_month%', get_the_date( 'F' ), $description );
4200
  }
4201
 
@@ -4205,6 +3930,15 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4205
  * if ($aioseop_options['aiosp_can']) $description = $this->make_unique_att_desc($description);
4206
  */
4207
  $description = $this->apply_cf_fields( $description );
 
 
 
 
 
 
 
 
 
4208
  return $description;
4209
  }
4210
 
@@ -4319,23 +4053,16 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
4319
  }
4320
 
4321
  /**
 
 
 
 
4322
  * @return mixed|void
4323
  */
4324
  function sitelinks_search_box() {
4325
  global $aioseop_options;
4326
- $home_url = esc_url( get_home_url() );
4327
- $name_block = $search_block = '';
4328
- if ( ! empty( $aioseop_options['aiosp_google_set_site_name'] ) ) {
4329
- if ( ! empty( $aioseop_options['aiosp_google_specify_site_name'] ) ) {
4330
- $blog_name = $aioseop_options['aiosp_google_specify_site_name'];
4331
- } else {
4332
- $blog_name = get_bloginfo( 'name' );
4333
- }
4334
- $blog_name = esc_attr( $blog_name );
4335
- $name_block = <<<EOF
4336
- "name": "{$blog_name}",
4337
- EOF;
4338
- }
4339
 
4340
  if ( ! empty( $aioseop_options['aiosp_google_sitelinks_search'] ) ) {
4341
  $search_block = <<<EOF
@@ -4350,12 +4077,9 @@ EOF;
4350
  $search_box = <<<EOF
4351
  <script type="application/ld+json">
4352
  {
4353
- "@context": "http://schema.org",
4354
  "@type": "WebSite",
4355
  EOF;
4356
- if ( ! empty( $name_block ) ) {
4357
- $search_box .= $name_block;
4358
- }
4359
  if ( ! empty( $search_block ) ) {
4360
  $search_box .= $search_block;
4361
  }
@@ -4368,66 +4092,6 @@ EOF;
4368
  return apply_filters( 'aiosp_sitelinks_search_box', $search_box );
4369
  }
4370
 
4371
- /**
4372
- * @param $post
4373
- *
4374
- * @return array
4375
- */
4376
- function get_google_authorship( $post ) {
4377
- global $aioseop_options;
4378
- $page = $this->get_page_number();
4379
- // Handle authorship.
4380
- $googleplus = $publisher = $author = '';
4381
-
4382
- if ( ! empty( $post ) && isset( $post->post_author ) && empty( $aioseop_options['aiosp_google_disable_profile'] ) ) {
4383
- $googleplus = get_the_author_meta( 'googleplus', $post->post_author );
4384
- }
4385
-
4386
- if ( empty( $googleplus ) && ! empty( $aioseop_options['aiosp_google_publisher'] ) ) {
4387
- $googleplus = $aioseop_options['aiosp_google_publisher'];
4388
- }
4389
-
4390
- if ( is_front_page() && ( $page < 2 ) ) {
4391
- if ( ! empty( $aioseop_options['aiosp_google_publisher'] ) ) {
4392
- $publisher = $aioseop_options['aiosp_google_publisher'];
4393
- }
4394
-
4395
- if ( ! empty( $aioseop_options['aiosp_google_author_advanced'] ) ) {
4396
- if ( empty( $aioseop_options['aiosp_google_enable_publisher'] ) ) {
4397
- $publisher = '';
4398
- } elseif ( ! empty( $aioseop_options['aiosp_google_specify_publisher'] ) ) {
4399
- $publisher = $aioseop_options['aiosp_google_specify_publisher'];
4400
- }
4401
- }
4402
- }
4403
- if ( is_singular() && ( ! empty( $googleplus ) ) ) {
4404
- $author = $googleplus;
4405
- } elseif ( ! empty( $aioseop_options['aiosp_google_publisher'] ) ) {
4406
- $author = $aioseop_options['aiosp_google_publisher'];
4407
- }
4408
-
4409
- if ( ! empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) {
4410
- if ( empty( $aioseop_options['aiosp_google_author_location'] ) ) {
4411
- $aioseop_options['aiosp_google_author_location'] = array();
4412
- }
4413
- if ( is_front_page() && ! in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) {
4414
- $author = '';
4415
- } else {
4416
- if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) {
4417
- if ( is_singular() && ! is_singular( $aioseop_options['aiosp_google_author_location'] ) ) {
4418
- $author = '';
4419
- }
4420
- } else {
4421
- if ( ! is_singular( $aioseop_options['aiosp_google_author_location'] ) ) {
4422
- $author = '';
4423
- }
4424
- }
4425
- }
4426
- }
4427
-
4428
- return array( 'publisher' => $publisher, 'author' => $author );
4429
- }
4430
-
4431
  /**
4432
  * @param null $post
4433
  *
@@ -4465,7 +4129,7 @@ EOF;
4465
  $more = 1;
4466
  }
4467
  $content = $post->post_content;
4468
- if ( false !== strpos( $content, '<!--nextpage-->' ) ) {
4469
  if ( $page > 1 ) {
4470
  $more = 1;
4471
  }
@@ -4473,7 +4137,7 @@ EOF;
4473
  $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
4474
  $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
4475
  // Ignore nextpage at the beginning of the content.
4476
- if ( 0 === strpos( $content, '<!--nextpage-->' ) ) {
4477
  $content = substr( $content, 15 );
4478
  }
4479
  $pages = explode( '<!--nextpage-->', $content );
@@ -4500,12 +4164,12 @@ EOF;
4500
  if ( ! empty( $prev ) ) {
4501
  $dom = new DOMDocument();
4502
  $dom->loadHTML( $prev );
4503
- $prev = $dom->getElementsByTagName( 'a' )->item(0)->getAttribute( 'href' );
4504
  }
4505
  if ( ! empty( $next ) ) {
4506
  $dom = new DOMDocument();
4507
  $dom->loadHTML( $next );
4508
- $next = $dom->getElementsByTagName( 'a' )->item(0)->getAttribute( 'href' );
4509
  }
4510
  }
4511
 
@@ -4591,7 +4255,7 @@ EOF;
4591
  'noindex',
4592
  'nofollow',
4593
  );
4594
- if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
4595
  unset( $optlist['custom_link'] );
4596
  }
4597
  foreach ( $optlist as $f ) {
@@ -4609,7 +4273,7 @@ EOF;
4609
  'noindex',
4610
  'nofollow',
4611
  );
4612
- if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
4613
  unset( $optlist['custom_link'] );
4614
  }
4615
  foreach ( $optlist as $f ) {
@@ -4850,7 +4514,7 @@ EOF;
4850
  'noindex',
4851
  'nofollow',
4852
  );
4853
- if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
4854
  unset( $optlist['custom_link'] );
4855
  }
4856
  foreach ( $optlist as $f ) {
@@ -4964,10 +4628,12 @@ EOF;
4964
  }
4965
 
4966
  add_menu_page(
4967
- $menu_name, $menu_name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), $file, array(
4968
- $this,
4969
- 'display_settings_page',
4970
- )
 
 
4971
  );
4972
 
4973
  add_meta_box(
79
  $blog_name = esc_attr( get_bloginfo( 'name' ) );
80
  parent::__construct();
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  $this->default_options = array(
83
  'license_key' => array(
84
  'name' => __( 'License Key:', 'all-in-one-seo-pack' ),
138
  'default' => 0,
139
  'condshow' => array( 'aiosp_can' => 'on' ),
140
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  'force_rewrites' => array(
142
  'name' => __( 'Force Rewrites:', 'all-in-one-seo-pack' ),
143
  'default' => 1,
161
  'name' => __( 'Home Page Title Format:', 'all-in-one-seo-pack' ),
162
  'type' => 'text',
163
  'default' => '%page_title%',
 
164
  ),
165
  'page_title_format' => array(
166
  'name' => __( 'Page Title Format:', 'all-in-one-seo-pack' ),
167
  'type' => 'text',
168
+ 'default' => '%page_title% | %site_title%',
 
169
  ),
170
  'post_title_format' => array(
171
  'name' => __( 'Post Title Format:', 'all-in-one-seo-pack' ),
172
  'type' => 'text',
173
+ 'default' => '%post_title% | %site_title%',
 
174
  ),
175
  'category_title_format' => array(
176
  'name' => __( 'Category Title Format:', 'all-in-one-seo-pack' ),
177
  'type' => 'text',
178
+ 'default' => '%category_title% | %site_title%',
 
179
  ),
180
  'archive_title_format' => array(
181
  'name' => __( 'Archive Title Format:', 'all-in-one-seo-pack' ),
182
  'type' => 'text',
183
+ 'default' => '%archive_title% | %site_title%',
 
184
  ),
185
  'date_title_format' => array(
186
  'name' => __( 'Date Archive Title Format:', 'all-in-one-seo-pack' ),
187
  'type' => 'text',
188
+ 'default' => '%date% | %site_title%',
 
189
  ),
190
  'author_title_format' => array(
191
  'name' => __( 'Author Archive Title Format:', 'all-in-one-seo-pack' ),
192
  'type' => 'text',
193
+ 'default' => '%author% | %site_title%',
 
194
  ),
195
  'tag_title_format' => array(
196
  'name' => __( 'Tag Title Format:', 'all-in-one-seo-pack' ),
197
  'type' => 'text',
198
+ 'default' => '%tag% | %site_title%',
 
199
  ),
200
  'search_title_format' => array(
201
  'name' => __( 'Search Title Format:', 'all-in-one-seo-pack' ),
202
  'type' => 'text',
203
+ 'default' => '%search% | %site_title%',
 
204
  ),
205
  'description_format' => array(
206
  'name' => __( 'Description Format', 'all-in-one-seo-pack' ),
207
  'type' => 'text',
208
  'default' => '%description%',
 
209
  ),
210
  '404_title_format' => array(
211
  'name' => __( '404 Title Format:', 'all-in-one-seo-pack' ),
212
  'type' => 'text',
213
  'default' => __( 'Nothing found for %request_words%', 'all-in-one-seo-pack' ),
 
214
  ),
215
  'paged_format' => array(
216
  'name' => __( 'Paged Format:', 'all-in-one-seo-pack' ),
217
  'type' => 'text',
218
+ 'default' => sprintf( ' - %s %%page%%', __( 'Part', 'all-in-one-seo-pack' ) ),
 
219
  ),
220
  'cpostactive' => array(
221
  'name' => __( 'SEO on only these Content Types:', 'all-in-one-seo-pack' ),
257
  'default' => '',
258
  'type' => 'text',
259
  ),
260
+ 'yandex_verify' => array(
261
+ 'name' => __( 'Yandex Webmaster Tools:', 'all-in-one-seo-pack' ),
262
  'default' => '',
263
  'type' => 'text',
264
  ),
265
+ 'baidu_verify' => array(
266
+ 'name' => __( 'Baidu Webmaster Tools:', 'all-in-one-seo-pack' ),
267
+ 'default' => '',
268
+ 'type' => 'text',
269
  ),
270
  'google_sitelinks_search' => array(
271
  'name' => __( 'Display Sitelinks Search Box:', 'all-in-one-seo-pack' ),
272
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  // "google_connect"=>array( 'name' => __( 'Connect With Google Analytics', 'all-in-one-seo-pack' ), ),
274
  'google_analytics_id' => array(
275
  'name' => __( 'Google Analytics ID:', 'all-in-one-seo-pack' ),
512
  'sanitize' => 'default',
513
  ),
514
  'home_meta_tags' => array(
515
+ 'name' => __( 'Additional Posts Page Headers:', 'all-in-one-seo-pack' ),
516
  'type' => 'textarea',
517
  'default' => '',
518
  'sanitize' => 'default',
566
  'upgrade' => array(
567
  'type' => 'html',
568
  'label' => 'none',
569
+ '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' ),
570
  ),
571
  'support' => array(
572
  'type' => 'html',
623
  ),
624
  );
625
 
 
 
 
 
 
 
626
  $this->layout = array(
627
  'default' => array(
628
  'name' => __( 'General Settings', 'all-in-one-seo-pack' ),
638
  'name' => __( 'Title Settings', 'all-in-one-seo-pack' ),
639
  'help_link' => 'https://semperplugins.com/documentation/title-settings/',
640
  'options' => array(
 
641
  'force_rewrites',
642
  'home_page_title_format',
643
  'page_title_format',
666
  'webmaster' => array(
667
  'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
668
  'help_link' => 'https://semperplugins.com/sections/webmaster-verification/',
669
+ 'options' => array( 'google_verify', 'bing_verify', 'pinterest_verify', 'yandex_verify', 'baidu_verify' ),
670
  ),
671
  'google' => array(
672
  'name' => __( 'Google Settings', 'all-in-one-seo-pack' ),
673
  'help_link' => 'https://semperplugins.com/documentation/google-settings/',
674
  'options' => array(
 
 
675
  'google_sitelinks_search',
 
 
 
 
 
 
676
  // "google_connect",
677
  'google_analytics_id',
678
  'ga_advanced_options',
737
  if ( AIOSEOPPRO ) {
738
  // Add Pro options.
739
  $this->default_options = aioseop_add_pro_opt( $this->default_options );
 
740
  $this->layout = aioseop_add_pro_layout( $this->layout );
741
  }
742
 
752
  $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
753
 
754
  if ( is_admin() ) {
 
755
  add_action( 'aioseop_global_settings_header', array( $this, 'display_right_sidebar' ) );
756
  add_action( 'aioseop_global_settings_footer', array( $this, 'display_settings_footer' ) );
757
  add_action( 'output_option', array( $this, 'custom_output_option' ), 10, 2 );
758
  add_action( 'all_admin_notices', array( $this, 'visibility_warning' ) );
759
+ add_action( 'all_admin_notices', array( $this, 'woo_upgrade_notice' ) );
760
 
 
 
 
761
  }
762
  if ( AIOSEOPPRO ) {
763
  add_action( 'split_shared_term', array( $this, 'split_shared_term' ), 10, 4 );
824
  }
825
 
826
  /**
827
+ * Get Title Format for snippet preview.
828
  *
829
+ * Get the title formatted according to AIOSEOP %shortcodes% specifically for the snippet preview..
830
  *
831
  * @since 2.4.9
832
  *
844
  $w = $info['w'];
845
  $p = $info['p'];
846
 
847
+ /**
848
+ * Runs before we start applying the formatting for the snippet preview title.
849
+ *
850
+ * @since 3.0
851
+ *
852
+ */
853
+ do_action( 'aioseop_before_get_title_format' );
854
+
855
+ if ( false !== strpos( $title_format, '%site_title%', 0 ) ) {
856
+ $title_format = str_replace( '%site_title%', get_bloginfo( 'name' ), $title_format );
857
+ }
858
+ // %blog_title% is deprecated.
859
+ if ( false !== strpos( $title_format, '%blog_title%', 0 ) ) {
860
  $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
861
  }
862
  $title_format = $this->apply_cf_fields( $title_format );
863
  $replace_title = '<span id="' . $args['name'] . '_title">' . esc_attr( wp_strip_all_tags( html_entity_decode( $title ) ) ) . '</span>';
864
+ if ( false !== strpos( $title_format, '%post_title%', 0 ) ) {
865
  $title_format = str_replace( '%post_title%', $replace_title, $title_format );
866
  }
867
+ if ( false !== strpos( $title_format, '%page_title%', 0 ) ) {
868
  $title_format = str_replace( '%page_title%', $replace_title, $title_format );
869
  }
870
+ if ( false !== strpos( $title_format, '%current_date%', 0 ) ) {
871
  $title_format = str_replace( '%current_date%', aioseop_formatted_date(), $title_format );
872
  }
873
+ if ( false !== strpos( $title_format, '%current_year%', 0 ) ) {
874
+ $title_format = str_replace( '%current_year%', date( 'Y' ), $title_format );
875
+ }
876
+ if ( false !== strpos( $title_format, '%post_date%', 0 ) ) {
877
  $title_format = str_replace( '%post_date%', aioseop_formatted_date( get_the_time( 'U' ) ), $title_format );
878
  }
879
+ if ( false !== strpos( $title_format, '%post_year%', 0 ) ) {
880
  $title_format = str_replace( '%post_year%', get_the_date( 'Y' ), $title_format );
881
  }
882
+ if ( false !== strpos( $title_format, '%post_month%', 0 ) ) {
883
  $title_format = str_replace( '%post_month%', get_the_date( 'F' ), $title_format );
884
  }
885
  if ( $w->is_category || $w->is_tag || $w->is_tax ) {
895
  }
896
  }
897
  }
898
+ if ( false !== strpos( $title_format, '%category_title%', 0 ) ) {
899
  $title_format = str_replace( '%category_title%', $replace_title, $title_format );
900
  }
901
+ if ( false !== strpos( $title_format, '%taxonomy_title%', 0 ) ) {
902
  $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format );
903
  }
904
  } else {
905
+ if ( false !== strpos( $title_format, '%category%', 0 ) ) {
906
  $title_format = str_replace( '%category%', $category, $title_format );
907
  }
908
+ if ( false !== strpos( $title_format, '%category_title%', 0 ) ) {
909
  $title_format = str_replace( '%category_title%', $category, $title_format );
910
  }
911
+ if ( false !== strpos( $title_format, '%taxonomy_title%', 0 ) ) {
912
  $title_format = str_replace( '%taxonomy_title%', $category, $title_format );
913
  }
914
  if ( AIOSEOPPRO ) {
915
+ if ( strpos( $title_format, '%tax_', 0 ) && ! empty( $p ) ) {
916
  $taxes = get_object_taxonomies( $p, 'objects' );
917
  if ( ! empty( $taxes ) ) {
918
  foreach ( $taxes as $t ) {
919
+ if ( strpos( $title_format, "%tax_{$t->name}%", 0 ) ) {
920
  $terms = $this->get_all_terms( $p->ID, $t->name );
921
  $term = '';
922
  if ( count( $terms ) > 0 ) {
929
  }
930
  }
931
  }
932
+ if ( false !== strpos( $title_format, '%taxonomy_description%', 0 ) ) {
933
  $title_format = str_replace( '%taxonomy_description%', $description, $title_format );
934
  }
935
 
936
+ /**
937
+ * Filters document title after applying the formatting.
938
+ *
939
+ * @since 3.0
940
+ *
941
+ * @param string $title_format Document title to be filtered.
942
+ *
943
+ */
944
+ $title_format = apply_filters( 'aioseop_title_format', $title_format );
945
+
946
  $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
947
 
948
+ /**
949
+ * Runs after applying the formatting for the snippet preview title.
950
+ *
951
+ * @since 3.0
952
+ *
953
+ */
954
+ do_action( 'aioseop_after_format_title' );
955
+
956
  return $title_format;
957
  }
958
 
1068
  $show_page = false;
1069
  }
1070
  if ( $aioseop_options['aiosp_can'] ) {
1071
+ if ( ! empty( $opts['aiosp_custom_link'] ) ) {
1072
  $url = $opts['aiosp_custom_link'];
1073
  }
1074
  if ( empty( $url ) ) {
1155
  'noindex',
1156
  'nofollow',
1157
  );
1158
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) {
1159
  unset( $optlist['custom_link'] );
1160
  }
1161
  foreach ( $optlist as $f ) {
1236
  global $aioseop_options;
1237
  $title = false;
1238
  $post = $this->get_queried_object();
1239
+ $title = $this->get_aioseop_title( $post );
1240
+ $title = $this->apply_cf_fields( $title );
 
 
1241
 
1242
  if ( false === $title ) {
1243
  $title = $this->get_original_title();
1417
  } elseif ( is_search() && isset( $s ) && ! empty( $s ) ) {
1418
  $search = esc_attr( stripslashes( $s ) );
1419
  $title_format = $aioseop_options['aiosp_search_title_format'];
1420
+ $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1421
+ if ( false !== strpos( $title, '%blog_title%', 0 ) ) {
1422
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
1423
+ }
1424
+ if ( false !== strpos( $title, '%site_description%', 0 ) ) {
1425
+ $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1426
+ }
1427
+ if ( false !== strpos( $title, '%blog_description%', 0 ) ) {
1428
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1429
  }
1430
+ if ( false !== strpos( $title, '%search%', 0 ) ) {
1431
  $title = str_replace( '%search%', $search, $title );
1432
  }
1433
  $title = $this->paged_title( $title );
1465
  }
1466
  if ( $tag ) {
1467
  $title_format = $aioseop_options['aiosp_tag_title_format'];
1468
+ $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1469
+ if ( false !== strpos( $title, '%blog_title%', 0 ) ) {
1470
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
1471
+ }
1472
+ if ( false !== strpos( $title, '%site_description%', 0 ) ) {
1473
+ $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1474
+ }
1475
+ if ( false !== strpos( $title, '%blog_description%', 0 ) ) {
1476
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1477
  }
1478
+ if ( false !== strpos( $title, '%tag%', 0 ) ) {
1479
  $title = str_replace( '%tag%', $tag, $title );
1480
  }
1481
+ if ( false !== strpos( $title, '%tag_description%', 0 ) ) {
1482
  $title = str_replace( '%tag_description%', $tag_description, $title );
1483
  }
1484
+ if ( false !== strpos( $title, '%taxonomy_description%', 0 ) ) {
1485
  $title = str_replace( '%taxonomy_description%', $tag_description, $title );
1486
  }
1487
  $title = trim( wp_strip_all_tags( $title ) );
1496
  $tag = $STagging->search_tag;
1497
  if ( $tag ) {
1498
  $title_format = $aioseop_options['aiosp_tag_title_format'];
1499
+ $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1500
+ if ( false !== strpos( $title, '%blog_title%', 0 ) ) {
1501
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
1502
+ }
1503
+ if ( false !== strpos( $title, '%site_description%', 0 ) ) {
1504
+ $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1505
+ }
1506
+ if ( false !== strpos( $title, '%blog_description%', 0 ) ) {
1507
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1508
  }
1509
+ if ( false !== strpos( $title, '%tag%', 0 ) ) {
1510
  $title = str_replace( '%tag%', $tag, $title );
1511
  }
1512
  $title = $this->paged_title( $title );
1536
  }
1537
  $month = date( 'F', mktime( 0, 0, 0, (int) $monthnum, 1, (int) $year ) );
1538
  $new_title = str_replace( '%monthnum%', $monthnum, $new_title );
1539
+ if ( false !== strpos( $new_title, '%month%', 0 ) ) {
1540
  $new_title = str_replace( '%month%', $month, $new_title );
1541
  }
1542
+ if ( false !== strpos( $new_title, '%year%', 0 ) ) {
1543
  $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
1544
  }
1545
  } elseif ( is_post_type_archive() ) {
1550
  } else {
1551
  return false;
1552
  }
1553
+ $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
1554
+ if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) {
1555
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
1556
+ }
1557
+ if ( false !== strpos( $new_title, '%site_description%', 0 ) ) {
1558
+ $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1559
+ }
1560
+ if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) {
1561
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1562
  }
1563
  $title = trim( $new_title );
1566
  return $title;
1567
  } elseif ( is_404() ) {
1568
  $title_format = $aioseop_options['aiosp_404_title_format'];
1569
+ $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1570
+ if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) {
1571
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
1572
+ }
1573
+ if ( false !== strpos( $new_title, '%site_description%', 0 ) ) {
1574
+ $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1575
+ }
1576
+ if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) {
1577
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1578
  }
1579
+ if ( false !== strpos( $new_title, '%request_url%', 0 ) ) {
1580
  $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
1581
  }
1582
+ if ( false !== strpos( $new_title, '%request_words%', 0 ) ) {
1583
  $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
1584
  }
1585
+ if ( false !== strpos( $new_title, '%404_title%', 0 ) ) {
1586
  $new_title = str_replace( '%404_title%', $this->internationalize( $this->get_original_title( '', false ) ), $new_title );
1587
  }
1588
 
1669
  $title = $this->internationalize( post_type_archive_title( '', false ) );
1670
  } elseif ( is_404() ) {
1671
  $title_format = $aioseop_options['aiosp_404_title_format'];
1672
+ $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1673
+ if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) {
1674
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
1675
+ }
1676
+ if ( false !== strpos( $new_title, '%site_description%', 0 ) ) {
1677
+ $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1678
+ }
1679
+ if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) {
1680
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1681
  }
1682
+ if ( false !== strpos( $new_title, '%request_url%', 0 ) ) {
1683
  $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
1684
  }
1685
+ if ( false !== strpos( $new_title, '%request_words%', 0 ) ) {
1686
  $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
1687
  }
1688
  $title = $new_title;
1735
  }
1736
 
1737
  /**
1738
+ * Replace doc title templates inside % symbol on the frontend.
1739
  *
1740
  * @param $title
1741
  * @param $post
1746
  * @return string
1747
  */
1748
  function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
1749
+
1750
+ /**
1751
+ * Runs before applying the formatting for the doc title on the frontend.
1752
+ *
1753
+ * @since 3.0
1754
+ *
1755
+ */
1756
+ do_action( 'aioseop_before_title_placeholder_helper' );
1757
+
1758
  if ( ! empty( $post ) ) {
1759
  $authordata = get_userdata( $post->post_author );
1760
  } else {
1761
  $authordata = new WP_User();
1762
  }
1763
+ $new_title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1764
+ if ( false !== strpos( $new_title, '%blog_title%', 0 ) ) {
1765
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
1766
+ }
1767
+ if ( false !== strpos( $new_title, '%site_description%', 0 ) ) {
1768
+ $new_title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1769
+ }
1770
+ if ( false !== strpos( $new_title, '%blog_description%', 0 ) ) {
1771
  $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1772
  }
1773
+ if ( false !== strpos( $new_title, "%{$type}_title%", 0 ) ) {
1774
  $new_title = str_replace( "%{$type}_title%", $title, $new_title );
1775
  }
1776
  if ( $type == 'post' ) {
1777
+ if ( false !== strpos( $new_title, '%category%', 0 ) ) {
1778
  $new_title = str_replace( '%category%', $category, $new_title );
1779
  }
1780
+ if ( false !== strpos( $new_title, '%category_title%', 0 ) ) {
1781
  $new_title = str_replace( '%category_title%', $category, $new_title );
1782
  }
1783
+ if ( false !== strpos( $new_title, '%tax_', 0 ) && ! empty( $post ) ) {
1784
  $taxes = get_object_taxonomies( $post, 'objects' );
1785
  if ( ! empty( $taxes ) ) {
1786
  foreach ( $taxes as $t ) {
1787
+ if ( false !== strpos( $new_title, "%tax_{$t->name}%", 0 ) ) {
1788
  $terms = $this->get_all_terms( $post->ID, $t->name );
1789
  $term = '';
1790
  if ( count( $terms ) > 0 ) {
1796
  }
1797
  }
1798
  }
1799
+ if ( false !== strpos( $new_title, "%{$type}_author_login%", 0 ) ) {
1800
  $new_title = str_replace( "%{$type}_author_login%", $authordata->user_login, $new_title );
1801
  }
1802
+ if ( false !== strpos( $new_title, "%{$type}_author_nicename%", 0 ) ) {
1803
  $new_title = str_replace( "%{$type}_author_nicename%", $authordata->user_nicename, $new_title );
1804
  }
1805
+ if ( false !== strpos( $new_title, "%{$type}_author_firstname%", 0 ) ) {
1806
  $new_title = str_replace( "%{$type}_author_firstname%", $this->ucwords( $authordata->first_name ), $new_title );
1807
  }
1808
+ if ( false !== strpos( $new_title, "%{$type}_author_lastname%", 0 ) ) {
1809
  $new_title = str_replace( "%{$type}_author_lastname%", $this->ucwords( $authordata->last_name ), $new_title );
1810
  }
1811
+ if ( false !== strpos( $new_title, '%current_date%', 0 ) ) {
 
1812
  $new_title = str_replace( '%current_date%', aioseop_formatted_date(), $new_title );
1813
  }
1814
+ if ( false !== strpos( $new_title, '%current_year%', 0 ) ) {
1815
+ $new_title = str_replace( '%current_year%', date( 'Y' ), $new_title );
1816
+ }
1817
+ if ( false !== strpos( $new_title, '%post_date%', 0 ) ) {
1818
  $new_title = str_replace( '%post_date%', aioseop_formatted_date( get_the_date( 'U' ) ), $new_title );
1819
  }
1820
+ if ( false !== strpos( $new_title, '%post_year%', 0 ) ) {
1821
  $new_title = str_replace( '%post_year%', get_the_date( 'Y' ), $new_title );
1822
  }
1823
+ if ( false !== strpos( $new_title, '%post_month%', 0 ) ) {
1824
  $new_title = str_replace( '%post_month%', get_the_date( 'F' ), $new_title );
1825
  }
1826
 
1827
+ /**
1828
+ * Filters document title after applying the formatting.
1829
+ *
1830
+ * @since 3.0
1831
+ *
1832
+ * @param string $new_title Document title to be filtered.
1833
+ *
1834
+ */
1835
+ $new_title = apply_filters( 'aioseop_title_format', $new_title );
1836
+
1837
+ /**
1838
+ * Runs after applying the formatting for the doc title on the frontend.
1839
+ *
1840
+ * @since 3.0
1841
+ *
1842
+ */
1843
+ do_action( 'aioseop_after_title_placeholder_helper' );
1844
+
1845
  $title = trim( $new_title );
1846
 
1847
  return $title;
1933
  if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) {
1934
  return false;
1935
  }
1936
+ $title_format = "%{$title_type}_title% | %site_title%";
1937
  if ( isset( $aioseop_options[ "aiosp_{$title_type}_title_format" ] ) ) {
1938
  $title_format = $aioseop_options[ "aiosp_{$title_type}_title_format" ];
1939
  }
2018
  * @return string
2019
  */
2020
  function get_tax_title( $tax = '' ) {
2021
+
2022
  if ( AIOSEOPPRO ) {
2023
  if ( empty( $this->meta_opts ) ) {
2024
  $this->meta_opts = $this->get_current_options( array(), 'aiosp' );
2096
  * @return string
2097
  */
2098
  function apply_tax_title_format( $category_name, $category_description, $tax = '' ) {
2099
+
2100
+ /**
2101
+ * Runs before applying the formatting for the taxonomy title.
2102
+ *
2103
+ * @since 3.0
2104
+ *
2105
+ */
2106
+ do_action( 'aioseop_before_tax_title_format' );
2107
+
2108
  if ( empty( $tax ) ) {
2109
  $tax = get_query_var( 'taxonomy' );
2110
  }
2111
  $title_format = $this->get_tax_title_format( $tax );
2112
  $title = str_replace( '%taxonomy_title%', $category_name, $title_format );
2113
+ if ( false !== strpos( $title, '%taxonomy_description%', 0 ) ) {
2114
  $title = str_replace( '%taxonomy_description%', $category_description, $title );
2115
  }
2116
+ if ( false !== strpos( $title, '%category_title%', 0 ) ) {
2117
  $title = str_replace( '%category_title%', $category_name, $title );
2118
  }
2119
+ if ( false !== strpos( $title, '%category_description%', 0 ) ) {
2120
  $title = str_replace( '%category_description%', $category_description, $title );
2121
  }
2122
+ if ( false !== strpos( $title, '%site_title%', 0 ) ) {
2123
+ $title = str_replace( '%site_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
2124
+ }
2125
+ if ( false !== strpos( $title, '%blog_title%', 0 ) ) {
2126
  $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
2127
  }
2128
+ if ( false !== strpos( $title, '%site_description%', 0 ) ) {
2129
+ $title = str_replace( '%site_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
2130
+ }
2131
+ if ( false !== strpos( $title, '%blog_description%', 0 ) ) {
2132
  $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
2133
  }
2134
+ if ( false !== strpos( $title, '%current_year%', 0 ) ) {
2135
+ $title = str_replace( '%current_year%', date( 'Y' ), $title );
2136
+ }
2137
+
2138
+ /**
2139
+ * Filters document title after applying the formatting.
2140
+ *
2141
+ * @since 3.0
2142
+ *
2143
+ * @param string $title Document title to be filtered.
2144
+ *
2145
+ */
2146
+ $title = apply_filters( 'aioseop_title_format', $title );
2147
+
2148
  $title = wp_strip_all_tags( $title );
2149
 
2150
+ /**
2151
+ * Runs after applying the formatting for the taxonomy title.
2152
+ *
2153
+ * @since 3.0
2154
+ *
2155
+ */
2156
+ do_action( 'aioseop_after_tax_title_format' );
2157
+
2158
  return $this->paged_title( $title );
2159
  }
2160
 
2166
  function get_tax_title_format( $tax = '' ) {
2167
  global $aioseop_options;
2168
  if ( AIOSEOPPRO ) {
2169
+ $title_format = '%taxonomy_title% | %site_title%';
2170
  if ( is_category() ) {
2171
  $title_format = $aioseop_options['aiosp_category_title_format'];
2172
  } else {
2179
  }
2180
  }
2181
  if ( empty( $title_format ) ) {
2182
+ $title_format = '%category_title% | %site_title%';
2183
  }
2184
  } else {
2185
+ $title_format = '%category_title% | %site_title%';
2186
  if ( ! empty( $aioseop_options['aiosp_category_title_format'] ) ) {
2187
  $title_format = $aioseop_options['aiosp_category_title_format'];
2188
  }
2201
  */
2202
  function apply_archive_title_format( $title, $category = '' ) {
2203
  $title_format = $this->get_archive_title_format();
2204
+ $r_title = array( '%site_title%', '%site_description%', '%archive_title%' );
2205
  $d_title = array(
2206
  $this->internationalize( get_bloginfo( 'name' ) ),
2207
  $this->internationalize( get_bloginfo( 'description' ) ),
2303
  */
2304
  function get_page_number() {
2305
  global $post;
2306
+ if ( is_singular() && false === strpos( $post->post_content, '<!--nextpage-->', 0 ) ) {
2307
  return null;
2308
  }
2309
  $page = get_query_var( 'page' );
2357
  */
2358
  function get_post_description( $post ) {
2359
  global $aioseop_options;
 
2360
  if ( ! $this->show_page_description() ) {
2361
  return '';
2362
  }
2366
  }
2367
  if ( ! $description ) {
2368
  if ( empty( $aioseop_options['aiosp_skip_excerpt'] ) ) {
2369
+ $description = $post->post_excerpt;
2370
  }
2371
  if ( ! $description && isset( $aioseop_options['aiosp_generate_descriptions'] ) && $aioseop_options['aiosp_generate_descriptions'] ) {
2372
+ if ( ! AIOSEOPPRO || ( AIOSEOPPRO && apply_filters( $this->prefix . 'generate_descriptions_from_content', true, $post ) ) ) {
2373
+ $content = $post->post_content;
2374
+ if ( ! empty( $aioseop_options['aiosp_run_shortcodes'] ) ) {
2375
+ $content = aioseop_do_shortcodes( $content );
2376
+ }
2377
+ $description = $content;
2378
+ } else {
2379
+ $description = $post->post_excerpt;
2380
  }
 
2381
  }
2382
+
2383
+ $description = $this->trim_text_without_filters_full_length( $this->internationalize( $description ) );
2384
  }
2385
 
2386
  return $description;
2857
  <?php
2858
  }
2859
 
2860
+ /*
2861
+ * Admin Pointer function.
2862
+ * Not in use at the moment. Below is an example of we can implement them.
2863
+ *
2864
  function add_admin_pointers() {
2865
 
2866
  $pro = '';
2871
  $this->pointers['aioseop_menu_2640'] = array(
2872
  'pointer_target' => "#toplevel_page_all-in-one-seo-pack$pro-aioseop_class",
2873
  'pointer_text' => '<h3>' . __( 'Review Your Settings', 'all-in-one-seo-pack' )
2874
+ . '</h3><p>' . 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 ) . '</p>',
 
 
 
 
 
 
 
 
 
2875
  'pointer_edge' => 'top',
2876
  'pointer_align' => 'left',
2877
  'pointer_scope' => 'global',
2878
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2879
  $this->filter_pointers();
 
2880
  }
2881
+ */
2882
 
2883
  function add_page_hooks() {
2884
 
2904
  }
2905
  }
2906
 
2907
+ if ( isset( $post_types['attachment'] ) ) {
2908
+ $post_types['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' );
2909
+ }
2910
+ if ( isset( $all_post_types['attachment'] ) ) {
2911
+ $all_post_types['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' );
2912
+ }
2913
+
2914
  $taxes = get_taxonomies( '', 'objects' );
2915
  $tx = array_keys( $taxes );
2916
  $remtax = array( 'nav_menu', 'link_category', 'post_format' );
2924
  }
2925
  }
2926
 
2927
+ /**
2928
+ * Allows users to filter the taxonomies that are shown in the General Settings menu.
2929
+ *
2930
+ * @since 3.0.0
2931
+ *
2932
+ * @param array $tax_types All registered taxonomies.
2933
+ */
2934
+ $tax_types = apply_filters( 'aioseop_pre_tax_types_setting', $tax_types );
2935
+
2936
  $this->default_options['posttypecolumns']['initial_options'] = $post_types;
2937
  $this->default_options['cpostactive']['initial_options'] = $all_post_types;
2938
  $this->default_options['cpostnoindex']['initial_options'] = $post_types;
2940
  if ( AIOSEOPPRO ) {
2941
  $this->default_options['taxactive']['initial_options'] = $tax_types;
2942
  }
 
 
 
2943
 
2944
  foreach ( $all_post_types as $p => $pt ) {
2945
  $field = $p . '_title_format';
2948
  $this->default_options[ $field ] = array(
2949
  'name' => "$name " . __( 'Title Format:', 'all-in-one-seo-pack' ) . "<br />($p)",
2950
  'type' => 'text',
2951
+ 'default' => '%post_title% | %site_title%',
2952
  'condshow' => array(
 
2953
  'aiosp_cpostactive\[\]' => $p,
2954
  ),
2955
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2956
  $this->layout['cpt']['options'][] = $field;
2957
  }
2958
  }
2979
  $this->default_options[ $field ] = array(
2980
  'name' => "$name " . __( 'Taxonomy Title Format:', 'all-in-one-seo-pack' ),
2981
  'type' => 'text',
2982
+ 'default' => '%taxonomy_title% | %site_title%',
2983
  'condshow' => array(
 
2984
  'aiosp_taxactive\[\]' => $p,
2985
  ),
2986
  );
 
 
 
 
 
 
2987
  $this->layout['cpt']['options'][] = $field;
2988
  }
2989
  }
2990
  }
2991
  $this->setting_options();
 
2992
 
2993
  if ( AIOSEOPPRO ) {
2994
  global $aioseop_update_checker;
3080
  * @return mixed
3081
  */
3082
  function filter_submit( $submit ) {
3083
+ $submit['Submit_Default'] = array(
3084
+ 'type' => 'submit',
3085
+ 'class' => 'aioseop_reset_settings_button button-secondary',
3086
+ 'value' => __( 'Reset General Settings to Defaults', 'all-in-one-seo-pack' ) . ' &raquo;',
3087
+ );
3088
  $submit['Submit_All_Default'] = array(
3089
  'type' => 'submit',
3090
+ 'class' => 'aioseop_reset_settings_button button-secondary',
3091
  'value' => __( 'Reset ALL Settings to Defaults', 'all-in-one-seo-pack' ) . ' &raquo;',
3092
  );
3093
 
3214
  } elseif ( ! empty( $current[ "{$prefix}togglekeywords" ] ) ) {
3215
  unset( $settings[ "{$prefix}keywords" ] );
3216
  }
3217
+ if ( empty( $this->options['aiosp_can'] ) ) {
3218
  unset( $settings[ "{$prefix}custom_link" ] );
3219
  }
3220
  }
3245
  }
3246
  if ( $location == null ) {
3247
  $prefix = $this->prefix;
 
 
 
3248
  if ( isset( $options[ "{$prefix}use_original_title" ] ) && ( $options[ "{$prefix}use_original_title" ] === '' ) ) {
3249
  $options[ "{$prefix}use_original_title" ] = 0;
3250
  }
3259
  $post = $this->get_queried_object();
3260
 
3261
  if ( ! $this->is_page_included() ) {
3262
+ return;
3263
  }
3264
 
3265
+ $force_rewrites = 1;
3266
+ if ( isset( $aioseop_options['aiosp_force_rewrites'] ) ) {
3267
+ $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
3268
+ }
3269
+ if ( $force_rewrites ) {
3270
+ ob_start( array( $this, 'output_callback_for_title' ) );
3271
+ } else {
3272
+ add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
 
 
3273
  }
3274
  }
3275
 
3408
  $title = trim( strip_tags( $title ) );
3409
  $title_tag_start = '<title';
3410
  $title_tag_end = '</title';
3411
+ $start = $this->strpos( $content, $title_tag_start, 0 );
3412
+ $end = $this->strpos( $content, $title_tag_end, 0 );
3413
  $this->title_start = $start;
3414
  $this->title_end = $end;
3415
  $this->orig_title = $title;
3475
  add_filter( 'aioseop_title', array( &$this, 'filter_title' ) );
3476
  }
3477
 
3478
+ /**
3479
+ * Visibility Warning
3480
+ *
3481
+ * Checks if 'Search Engine Visibility' is enabled in Settings > Reading.
3482
+ *
3483
+ * @todo Change to earlier hook. Before `admin_enqueue` if possible.
3484
+ *
3485
+ * @since ?
3486
+ * @since 3.0 Changed to AIOSEOP_Notices class.
3487
+ *
3488
+ * @see `self::constructor()` with 'all_admin_notices' Filter Hook
3489
+ */
3490
  function visibility_warning() {
3491
+ global $aioseop_notices;
3492
+ if ( '0' === get_option( 'blog_public' ) ) {
3493
+ $aioseop_notices->activate_notice( 'blog_public_disabled' );
3494
+ } elseif ( '1' === get_option( 'blog_public' ) ) {
3495
+ $aioseop_notices->deactivate_notice( 'blog_public_disabled' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3496
  }
3497
  }
3498
 
3499
+ /**
3500
+ * WooCommerce Upgrade Notice
3501
+ *
3502
+ * @since ?
3503
+ * @since 3.0 Changed to AIOSEOP Notices.
3504
+ */
3505
+ public function woo_upgrade_notice() {
3506
+ global $aioseop_notices;
3507
+ if ( class_exists( 'WooCommerce' ) && current_user_can( 'manage_options' ) && ! AIOSEOPPRO ) {
3508
+ $aioseop_notices->activate_notice( 'woocommerce_detected' );
3509
+ } else {
3510
+ global $aioseop_notices;
3511
+ $aioseop_notices->deactivate_notice( 'woocommerce_detected' );
 
 
 
 
 
 
 
 
3512
  }
3513
  }
3514
 
3622
  $aioseop_dup_counter ++;
3623
 
3624
  if ( ! defined( 'AIOSEOP_UNIT_TESTING' ) && $aioseop_dup_counter > 1 ) {
3625
+
3626
+ /* 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. */
3627
+ echo "\n<!-- " . sprintf( __( 'Debug Warning: %1$s meta data was included again from %2$s filter. Called %3$s times!', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME, current_filter(), $aioseop_dup_counter ) . " -->\n";
3628
  if ( ! empty( $old_wp_query ) ) {
3629
  // Change the query back after we've finished.
3630
  $GLOBALS['wp_query'] = $old_wp_query;
3642
  $description = '';
3643
  // Logging - rewrite handler check for output buffering.
3644
  $this->check_rewrite_handler();
3645
+
3646
+ /* translators: The complete string is: "All in One SEO Pack by Michael Torbert of Semper Fi Web Design". The placeholders shouldn't be altered; only the words "by" and "of" should be translated. */
3647
+ printf( "\n<!-- " . __( '%1$s by %2$s of %3$s', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME . ' ' . $this->version, 'Michael Torbert', 'Semper Fi Web Design' );
3648
+
 
3649
  if ( $this->ob_start_detected ) {
3650
  echo 'ob_start_detected ';
3651
  }
3717
  'google' => 'google-site-verification',
3718
  'bing' => 'msvalidate.01',
3719
  'pinterest' => 'p:domain_verify',
3720
+ 'yandex' => 'yandex-verification',
3721
+ 'baidu' => 'baidu-site-verification',
3722
  ) as $k => $v
3723
  ) {
3724
  if ( ! empty( $aioseop_options[ "aiosp_{$k}_verify" ] ) ) {
3727
  }
3728
 
3729
  // Sitelinks search. Only show if "use schema.org markup is checked".
3730
+ if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) && ! empty( $aioseop_options['aiosp_google_sitelinks_search'] ) ) {
 
 
3731
  $meta_string .= $this->sitelinks_search_box() . "\n";
3732
  }
3733
  }
3751
  }
3752
  $meta_string .= $post_meta;
3753
  }
 
 
 
 
 
 
 
 
 
 
3754
 
3755
  if ( is_front_page() && ! empty( $front_meta ) ) {
3756
  if ( isset( $meta_string ) ) {
3769
  $prev = apply_filters( 'aioseop_prev_link', $prev_next['prev'] );
3770
  $next = apply_filters( 'aioseop_next_link', $prev_next['next'] );
3771
  if ( ! empty( $prev ) ) {
3772
+ $meta_string .= '<link rel="prev" href="' . esc_url( $prev ) . "\" />\n";
3773
  }
3774
  if ( ! empty( $next ) ) {
3775
+ $meta_string .= '<link rel="next" href="' . esc_url( $next ) . "\" />\n";
3776
  }
3777
  if ( $meta_string != null ) {
3778
  echo "$meta_string\n";
3786
 
3787
  if ( isset( $aioseop_options['aiosp_can'] ) && $aioseop_options['aiosp_can'] ) {
3788
  $url = '';
3789
+ if ( ! empty( $opts['aiosp_custom_link'] ) && ! is_home() ) {
3790
  $url = $opts['aiosp_custom_link'];
3791
  if ( apply_filters( 'aioseop_canonical_url_pagination', $show_page ) ) {
3792
  $url = $this->get_paged( $url );
3804
  }
3805
  }
3806
  do_action( 'aioseop_modules_wp_head' );
3807
+ echo sprintf( "<!-- %s -->\n", AIOSEOP_PLUGIN_NAME );
 
 
 
 
3808
 
3809
  if ( ! empty( $old_wp_query ) ) {
3810
  // Change the query back after we've finished.
3825
  $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
3826
  }
3827
 
3828
+ if ( $force_rewrites ) {
3829
  // Make the title rewrite as short as possible.
3830
  if ( function_exists( 'ob_list_handlers' ) ) {
3831
  $active_handlers = ob_list_handlers();
3841
  $this->log( 'another plugin interfering?' );
3842
  // If we get here there *could* be trouble with another plugin :(.
3843
  $this->ob_start_detected = true;
3844
+
3845
+ // Try alternate method -- pdb.
3846
+ add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
3847
+
 
3848
  if ( function_exists( 'ob_list_handlers' ) ) {
3849
  foreach ( ob_list_handlers() as $handler ) {
3850
  $this->log( "detected output handler $handler" );
3875
  * @return mixed
3876
  */
3877
  function apply_description_format( $description, $post = null ) {
3878
+
3879
+ /**
3880
+ * Runs before applying the formatting for the meta description.
3881
+ *
3882
+ * @since 3.0
3883
+ *
3884
+ */
3885
+ do_action( 'aioseop_before_apply_description_format' );
3886
+
3887
  global $aioseop_options;
3888
  $description_format = $aioseop_options['aiosp_description_format'];
3889
  if ( ! isset( $description_format ) || empty( $description_format ) ) {
3890
  $description_format = '%description%';
3891
  }
3892
  $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
3893
+ if ( false !== strpos( $description, '%site_title%', 0 ) ) {
3894
+ $description = str_replace( '%site_title%', get_bloginfo( 'name' ), $description );
3895
+ }
3896
+ if ( false !== strpos( $description, '%blog_title%', 0 ) ) {
3897
  $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
3898
  }
3899
+ if ( false !== strpos( $description, '%site_description%', 0 ) ) {
3900
+ $description = str_replace( '%site_description%', get_bloginfo( 'description' ), $description );
3901
+ }
3902
+ if ( false !== strpos( $description, '%blog_description%', 0 ) ) {
3903
  $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
3904
  }
3905
+ if ( false !== strpos( $description, '%wp_title%', 0 ) ) {
3906
  $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
3907
  }
3908
+ if ( false !== strpos( $description, '%post_title%', 0 ) ) {
3909
  $description = str_replace( '%post_title%', $this->get_aioseop_title( $post, false ), $description );
3910
  }
3911
+ if ( false !== strpos( $description, '%current_date%', 0 ) ) {
3912
  $description = str_replace( '%current_date%', date_i18n( get_option( 'date_format' ) ), $description );
3913
  }
3914
+ if ( false !== strpos( $description, '%current_year%', 0 ) ) {
3915
+ $description = str_replace( '%current_year%', date( 'Y' ), $description );
3916
+ }
3917
+ if ( false !== strpos( $description, '%post_date%', 0 ) ) {
3918
  $description = str_replace( '%post_date%', get_the_date(), $description );
3919
  }
3920
+ if ( false !== strpos( $description, '%post_year%', 0 ) ) {
3921
  $description = str_replace( '%post_year%', get_the_date( 'Y' ), $description );
3922
  }
3923
+ if ( false !== strpos( $description, '%post_month%', 0 ) ) {
3924
  $description = str_replace( '%post_month%', get_the_date( 'F' ), $description );
3925
  }
3926
 
3930
  * if ($aioseop_options['aiosp_can']) $description = $this->make_unique_att_desc($description);
3931
  */
3932
  $description = $this->apply_cf_fields( $description );
3933
+
3934
+ /**
3935
+ * Runs after applying the formatting for the meta description.
3936
+ *
3937
+ * @since 3.0
3938
+ *
3939
+ */
3940
+ do_action( 'aioseop_after_apply_description_format' );
3941
+
3942
  return $description;
3943
  }
3944
 
4053
  }
4054
 
4055
  /**
4056
+ * Sitelinks Search Box
4057
+ *
4058
+ * @since ?
4059
+ *
4060
  * @return mixed|void
4061
  */
4062
  function sitelinks_search_box() {
4063
  global $aioseop_options;
4064
+ $home_url = esc_url( get_home_url() );
4065
+ $search_block = '';
 
 
 
 
 
 
 
 
 
 
 
4066
 
4067
  if ( ! empty( $aioseop_options['aiosp_google_sitelinks_search'] ) ) {
4068
  $search_block = <<<EOF
4077
  $search_box = <<<EOF
4078
  <script type="application/ld+json">
4079
  {
4080
+ "@context": "https://schema.org",
4081
  "@type": "WebSite",
4082
  EOF;
 
 
 
4083
  if ( ! empty( $search_block ) ) {
4084
  $search_box .= $search_block;
4085
  }
4092
  return apply_filters( 'aiosp_sitelinks_search_box', $search_box );
4093
  }
4094
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4095
  /**
4096
  * @param null $post
4097
  *
4129
  $more = 1;
4130
  }
4131
  $content = $post->post_content;
4132
+ if ( false !== strpos( $content, '<!--nextpage-->', 0 ) ) {
4133
  if ( $page > 1 ) {
4134
  $more = 1;
4135
  }
4137
  $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
4138
  $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
4139
  // Ignore nextpage at the beginning of the content.
4140
+ if ( 0 === strpos( $content, '<!--nextpage-->', 0 ) ) {
4141
  $content = substr( $content, 15 );
4142
  }
4143
  $pages = explode( '<!--nextpage-->', $content );
4164
  if ( ! empty( $prev ) ) {
4165
  $dom = new DOMDocument();
4166
  $dom->loadHTML( $prev );
4167
+ $prev = $dom->getElementsByTagName( 'a' )->item( 0 )->getAttribute( 'href' );
4168
  }
4169
  if ( ! empty( $next ) ) {
4170
  $dom = new DOMDocument();
4171
  $dom->loadHTML( $next );
4172
+ $next = $dom->getElementsByTagName( 'a' )->item( 0 )->getAttribute( 'href' );
4173
  }
4174
  }
4175
 
4255
  'noindex',
4256
  'nofollow',
4257
  );
4258
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) {
4259
  unset( $optlist['custom_link'] );
4260
  }
4261
  foreach ( $optlist as $f ) {
4273
  'noindex',
4274
  'nofollow',
4275
  );
4276
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) {
4277
  unset( $optlist['custom_link'] );
4278
  }
4279
  foreach ( $optlist as $f ) {
4514
  'noindex',
4515
  'nofollow',
4516
  );
4517
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) ) {
4518
  unset( $optlist['custom_link'] );
4519
  }
4520
  foreach ( $optlist as $f ) {
4628
  }
4629
 
4630
  add_menu_page(
4631
+ $menu_name,
4632
+ $menu_name,
4633
+ apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ),
4634
+ $file,
4635
+ array( $this, 'display_settings_page' ),
4636
+ aioseop_get_menu_icon()
4637
  );
4638
 
4639
  add_meta_box(
all_in_one_seo_pack.php CHANGED
@@ -3,8 +3,8 @@
3
  /*
4
  Plugin Name: All In One SEO Pack
5
  Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
6
- 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.
7
- Version: 2.12.1
8
  Author: Michael Torbert
9
  Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
10
  Text Domain: all-in-one-seo-pack
@@ -32,17 +32,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
32
  * The original WordPress SEO plugin.
33
  *
34
  * @package All-in-One-SEO-Pack
35
- * @version 2.12.1
36
  */
37
 
38
  if ( ! defined( 'AIOSEOPPRO' ) ) {
39
  define( 'AIOSEOPPRO', false );
40
  }
 
 
 
41
  if ( ! defined( 'AIOSEOP_VERSION' ) ) {
42
- define( 'AIOSEOP_VERSION', '2.12.1' );
43
  }
44
- global $aioseop_plugin_name;
45
- $aioseop_plugin_name = 'All in One SEO Pack';
46
 
47
  /*
48
  * DO NOT EDIT BELOW THIS LINE.
@@ -74,10 +75,6 @@ if ( ! function_exists( 'aiosp_add_cap' ) ) {
74
  }
75
  add_action( 'plugins_loaded', 'aiosp_add_cap' );
76
 
77
- if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
78
- define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
79
- }
80
-
81
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
82
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
83
  } elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
@@ -266,6 +263,10 @@ if ( ! function_exists( 'aioseop_activate' ) ) {
266
  }
267
  $aiosp_activation = true;
268
 
 
 
 
 
269
  // These checks might be duplicated in the function being called.
270
  if ( ! is_network_admin() || ! isset( $_GET['activate-multi'] ) ) {
271
  set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
@@ -302,7 +303,7 @@ if ( ! function_exists( 'aiosp_plugin_row_meta' ) ) {
302
 
303
  );
304
 
305
- return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
306
  }
307
  }
308
 
@@ -390,6 +391,8 @@ if ( ! function_exists( 'aioseop_init_class' ) ) {
390
  /**
391
  * Inits All-in-One-Seo plugin class.
392
  *
 
 
393
  * @since ?? // When was this added?
394
  * @since 2.3.12.3 Loads third party compatibility class.
395
  */
@@ -412,6 +415,7 @@ if ( ! function_exists( 'aioseop_init_class' ) ) {
412
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome.php' );
413
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/dashboard_widget.php' );
414
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/menu.php' );
 
415
 
416
  $aioseop_welcome = new aioseop_welcome(); // TODO move this to updates file.
417
 
@@ -438,6 +442,8 @@ if ( ! function_exists( 'aioseop_init_class' ) ) {
438
  add_action( 'init', array( $aiosp, 'add_hooks' ) );
439
  add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 );
440
 
 
 
441
  if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) {
442
  remove_action( 'init', array( $aiosp, 'add_hooks' ) );
443
  add_action( 'admin_init', 'aioseop_scan_post_header' );
@@ -451,7 +457,60 @@ if ( ! function_exists( 'aioseop_init_class' ) ) {
451
  }
452
  }
453
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
 
456
  if ( ! function_exists( 'aioseop_welcome' ) ) {
457
  function aioseop_welcome() {
@@ -479,7 +538,8 @@ if ( is_admin() || defined( 'AIOSEOP_UNIT_TESTING' ) ) {
479
  add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' );
480
  add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' );
481
  add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' );
482
- add_action( 'wp_ajax_aioseo_dismiss_sitemap_max_url_notice', 'aioseop_sitemap_max_url_notice_dismissed' );
 
483
  }
484
 
485
  if ( ! function_exists( 'aioseop_scan_post_header' ) ) {
3
  /*
4
  Plugin Name: All In One SEO Pack
5
  Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
6
+ 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.
7
+ Version: 3.0
8
  Author: Michael Torbert
9
  Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
10
  Text Domain: all-in-one-seo-pack
32
  * The original WordPress SEO plugin.
33
  *
34
  * @package All-in-One-SEO-Pack
35
+ * @version 3.0
36
  */
37
 
38
  if ( ! defined( 'AIOSEOPPRO' ) ) {
39
  define( 'AIOSEOPPRO', false );
40
  }
41
+ if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
42
+ define( 'AIOSEOP_PLUGIN_NAME', 'All in One SEO Pack' );
43
+ }
44
  if ( ! defined( 'AIOSEOP_VERSION' ) ) {
45
+ define( 'AIOSEOP_VERSION', '3.0' );
46
  }
 
 
47
 
48
  /*
49
  * DO NOT EDIT BELOW THIS LINE.
75
  }
76
  add_action( 'plugins_loaded', 'aiosp_add_cap' );
77
 
 
 
 
 
78
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
79
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
80
  } elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
263
  }
264
  $aiosp_activation = true;
265
 
266
+ require_once AIOSEOP_PLUGIN_DIR . 'admin/class-aioseop-notices.php';
267
+ global $aioseop_notices;
268
+ $aioseop_notices->reset_notice( 'review_plugin' );
269
+
270
  // These checks might be duplicated in the function being called.
271
  if ( ! is_network_admin() || ! isset( $_GET['activate-multi'] ) ) {
272
  set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
303
 
304
  );
305
 
306
+ return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
307
  }
308
  }
309
 
391
  /**
392
  * Inits All-in-One-Seo plugin class.
393
  *
394
+ * @global AIOSEOP_Notices $aioseop_notices
395
+ *
396
  * @since ?? // When was this added?
397
  * @since 2.3.12.3 Loads third party compatibility class.
398
  */
415
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome.php' );
416
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/dashboard_widget.php' );
417
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/menu.php' );
418
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/class-aioseop-notices.php' );
419
 
420
  $aioseop_welcome = new aioseop_welcome(); // TODO move this to updates file.
421
 
442
  add_action( 'init', array( $aiosp, 'add_hooks' ) );
443
  add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 );
444
 
445
+ add_action( 'admin_init', 'aioseop_review_plugin_notice' );
446
+
447
  if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) {
448
  remove_action( 'init', array( $aiosp, 'add_hooks' ) );
449
  add_action( 'admin_init', 'aioseop_scan_post_header' );
457
  }
458
  }
459
 
460
+ if ( ! function_exists( 'aioseop_review_plugin_notice' ) ) {
461
+ /**
462
+ * Review Plugin Notice
463
+ *
464
+ * Activates the review notice.
465
+ * Note: This couldn't be used directly in `aioseop_init_class()` since ajax instances was causing
466
+ * the database options to reset.
467
+ *
468
+ * @since 3.0
469
+ */
470
+ function aioseop_review_plugin_notice() {
471
+ global $aioseop_notices;
472
+ $aioseop_notices->activate_notice( 'review_plugin' );
473
+ }
474
+ }
475
 
476
+ if ( ! function_exists( 'aioseop_admin_enqueue_styles' ) ) {
477
+ /**
478
+ * Admin Enqueue Styles
479
+ *
480
+ * Styles used in various parts of WordPress admin, and not just AIOSEOP's screens.
481
+ * Note: If styles are specific to a given module, then use that module's admin_enqueue_styles() method, or parent method.
482
+ *
483
+ * @todo Refactor this into a core file.
484
+ *
485
+ * @since 3.0
486
+ *
487
+ * @see 'admin_enqueue_scripts' hook
488
+ * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
489
+ *
490
+ * @param string $hook_suffix
491
+ */
492
+ function aioseop_admin_enqueue_styles( $hook_suffix ) {
493
+ // Font Icons.
494
+ if ( ! wp_style_is( 'aioseop-font-icons', 'registered' ) && ! wp_style_is( 'aioseop-font-icons', 'enqueued' ) ) {
495
+ wp_enqueue_style(
496
+ 'aioseop-font-icons',
497
+ AIOSEOP_PLUGIN_URL . 'css/aioseop-font-icons.css',
498
+ array(),
499
+ AIOSEOP_VERSION
500
+ );
501
+ }
502
+ if ( function_exists( 'is_rtl' ) && is_rtl() ) {
503
+ if ( ! wp_style_is( 'aioseop-font-icons-rtl', 'registered' ) && ! wp_style_is( 'aioseop-font-icons-rtl', 'enqueued' ) ) {
504
+ wp_enqueue_style(
505
+ 'aioseop-font-icons-rtl',
506
+ AIOSEOP_PLUGIN_URL . 'css/aioseop-font-icons-rtl.css',
507
+ array(),
508
+ AIOSEOP_VERSION
509
+ );
510
+ }
511
+ }
512
+ }
513
+ }
514
 
515
  if ( ! function_exists( 'aioseop_welcome' ) ) {
516
  function aioseop_welcome() {
538
  add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' );
539
  add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' );
540
  add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' );
541
+
542
+ add_action( 'admin_enqueue_scripts', 'aioseop_admin_enqueue_styles' );
543
  }
544
 
545
  if ( ! function_exists( 'aioseop_scan_post_header' ) ) {
css/admin-notice.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * AIOSEOP_Notices CSS
3
+ *
4
+ * @package All-in-One-SEO-Pack
5
+ * @subpackage AIOSEOP_Notices
6
+ * @since 3.0
7
+ */
8
+
9
+ .aioseop-notice-delay {
10
+ display: inherit;
11
+ /* width: fit-content; */
12
+ }
13
+
14
+ .aioseop-notice-delay.aioseop-delay-0.button-primary.button-orange {
15
+ background: #d54e21;
16
+ border-color: #aa3e1a;
17
+ -webkit-box-shadow: 0 1px 0 #aa3e1a;
18
+ box-shadow: 0 1px 0 #aa3e1a;
19
+ color: #fff;
20
+ text-decoration: none;
21
+ text-shadow: 0 -1px 1px #d54e21,1px 0 1px #d54e21,0 1px 1px #d54e21,-1px 0 1px #d54e21;
22
+ }
css/aioseop-font-icons-rtl.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * RTL overrides for Font Icons.
3
+ *
4
+ * @since 3.0.0
5
+ */
6
+ .aioseop-label-quickedit {
7
+ padding: 0 20px 0 0;
8
+ }
css/aioseop-font-icons.css ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * GlyphIcons / Custom Icons.
3
+ *
4
+ * @author Michael Torbert.
5
+ * @author Semper Fi Web Design.
6
+ * @copyright http://semperplugins.com
7
+ * @package All-in-One-SEO-Pack.
8
+ */
9
+
10
+ @charset "UTF-8";
11
+
12
+ @font-face {
13
+ font-family: 'aioseop-font';
14
+ src: url('font-icons/aioseop.eot');
15
+ src: url('font-icons/aioseop.eot?#iefix') format('embedded-opentype'),
16
+ url('font-icons/aioseop.woff') format('woff'),
17
+ url('font-icons/aioseop.ttf') format('truetype'),
18
+ url('font-icons/aioseop.svg#aioseop') format('svg');
19
+ font-weight: normal;
20
+ font-style: normal;
21
+ }
22
+
23
+ [data-icon]:before {
24
+ font-family: 'aioseop-font' !important;
25
+ content: attr(data-icon);
26
+ font-style: normal !important;
27
+ font-weight: normal !important;
28
+ font-variant: normal !important;
29
+ text-transform: none !important;
30
+ speak: none;
31
+ line-height: 1;
32
+ -webkit-font-smoothing: antialiased;
33
+ -moz-osx-font-smoothing: grayscale;
34
+ }
35
+
36
+ [class^='aioseop-icon-']:before,
37
+ [class*=' aioseop-icon-']:before {
38
+ display: inline-block;
39
+ font-family: 'aioseop-font';
40
+ font-style: normal;
41
+ font-weight: normal;
42
+ font-variant: normal;
43
+ text-transform: none;
44
+ speak: none;
45
+ line-height: 1;
46
+ -webkit-font-smoothing: antialiased;
47
+ -moz-osx-font-smoothing: grayscale;
48
+ }
49
+
50
+ /* SUPPORT METABOX */
51
+
52
+ .aioseop_icon {
53
+ display: inline;
54
+ margin-right: 10px;
55
+ color: #00a2e2;
56
+ font-size: 2.5em;
57
+ line-height: 1.2;
58
+ vertical-align: middle;
59
+ }
60
+
61
+ .aioseop-icon-file:before {
62
+ content: '\69';
63
+ }
64
+
65
+ .aioseop-icon-support:before {
66
+ content: '\6a';
67
+ }
68
+
69
+ .aioseop-icon-cog:before {
70
+ content: '\6b';
71
+ }
72
+
73
+ .aioseop-icon-youtube:before {
74
+ content: '\6c';
75
+ }
76
+
77
+ .aioseop-icon-book:before {
78
+ content: '\6d';
79
+ }
80
+
81
+ .aioseop_help_icon:before {
82
+ 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);
83
+ }
84
+
85
+ /* QUICKEDIT - AJAX Edit */
86
+
87
+ .aioseop-icon-qedit {
88
+ margin: 0 3px;
89
+ line-height: 2;
90
+ font-size: 14px;
91
+ }
92
+
93
+ .aioseop-icon-qedit-accept {
94
+ color: #9dd490;
95
+ }
96
+
97
+ .aioseop-icon-qedit-accept:hover {
98
+ color: #97eb84;
99
+ }
100
+
101
+ .aioseop-icon-qedit-accept:before {
102
+ content: '\70';
103
+ }
104
+
105
+ .aioseop-icon-qedit-delete {
106
+ color: #ed8881;
107
+ }
108
+
109
+ .aioseop-icon-qedit-delete:hover {
110
+ color: #ffad9e;
111
+ }
112
+
113
+ .aioseop-icon-qedit-delete:before {
114
+ content: '\71';
115
+ }
116
+
117
+ /* QUICKEDIT */
118
+
119
+ .aioseop_edit_link {
120
+ display: inline-block;
121
+ position: absolute;
122
+ }
123
+
124
+ .aioseop-icon-cog-edit {
125
+ color: #72777c;
126
+ }
127
+
128
+ .aioseop-icon-cog-edit:hover {
129
+ color: #0073aa;
130
+ }
131
+
132
+ .aioseop-icon-cog-edit:before {
133
+ content: '\6e';
134
+ }
135
+
136
+ .aioseop-label-quickedit {
137
+ padding-left: 20px;
138
+ }
139
+
140
+ /* TIP ICON ( Robots ) */
141
+
142
+ div.aioseop_tip_icon {
143
+ font-size: 14px;
144
+ border: 1px solid #888;
145
+ width: 1em;
146
+ text-align: center;
147
+ padding: 0 4px;
148
+ -webkit-border-radius: 12px;
149
+ -moz-border-radius: 12px;
150
+ -webkit-box-shadow: 1px 1px 1px #888;
151
+ -moz-box-shadow: 1px 1px 1px #888;
152
+ box-shadow: 1px 1px 1px #888;
153
+ border-radius: 12px;
154
+ }
155
+
156
+ div.aioseop_tip_icon:before {
157
+ content: '?';
158
+ }
159
+
160
+ /* ABOUT METABOX */
161
+
162
+ .aiosp-di .dashicons {
163
+ margin: 1px;
164
+ line-height: 1;
165
+ width: 42px;
166
+ height: 36px;
167
+ color: #fff;
168
+ padding: 3px;
169
+ vertical-align: middle;
170
+ }
171
+
172
+ .aiosp-di .dashicons:before {
173
+ -webkit-font-smoothing: antialiased;
174
+ font-family: 'dashicons';
175
+ font-weight: 400;
176
+ font-size: 1.5em;
177
+ line-height: 38px;
178
+ }
179
+
180
+ .aiosp-di .dashicons.di-facebook {
181
+ margin: 0;
182
+ color: #3B5998;
183
+ }
184
+
185
+ .aiosp-di .dashicons.di-facebook:before {
186
+ content: '\f304';
187
+ font-size: 2.7em;
188
+ }
189
+
190
+ .aiosp-di .dashicons.di-twitter {
191
+ width: 36px;
192
+ background-color: #00aced;
193
+ border-radius: 2px;
194
+ }
195
+
196
+ .aiosp-di .dashicons.di-twitter:before {
197
+ content: '\f301';
198
+ }
css/aiosp_admin.css CHANGED
@@ -1,39 +1,3 @@
1
- #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
2
- background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
3
- }
4
-
5
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
6
- background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
7
- }
8
-
9
- #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image img {
10
- display: none;
11
- }
12
-
13
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img {
14
- display: none;
15
- }
16
-
17
- #adminmenu #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image:before {
18
- content: '';
19
- }
20
-
21
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image:before {
22
- content: '' !important;
23
- }
24
-
25
- #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 {
26
- background-position: 8px -26px !important;
27
- }
28
-
29
- #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 {
30
- background-position: 8px -26px !important;
31
- }
32
-
33
- #icon-aioseop.icon32 {
34
- background: url(../images/shield32.png) no-repeat left top !important;
35
- }
36
-
37
  #aioseop_settings_header #message {
38
  padding: 5px 0px 5px 50px;
39
  background-image: url(../images/update32.png);
@@ -46,27 +10,6 @@
46
 
47
  @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) {
48
 
49
- #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
50
- background-image: url('../images/shield-sprite-32.png') !important;
51
- -webkit-background-size: 16px 48px !important;
52
- -moz-background-size: 16px 48px !important;
53
- background-size: 16px 48px !important;
54
- }
55
-
56
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
57
- background-image: url('../images/shield-sprite-32.png') !important;
58
- -webkit-background-size: 16px 48px !important;
59
- -moz-background-size: 16px 48px !important;
60
- background-size: 16px 48px !important;
61
- }
62
-
63
- #icon-aioseop.icon32 {
64
- background-image: url('../images/shield64.png') !important;
65
- -webkit-background-size: 32px 32px !important;
66
- -moz-background-size: 32px 32px !important;
67
- background-size: 32px 32px !important;
68
- }
69
-
70
  #aioseop_settings_header #message {
71
  background-image: url(../images/update64.png) !important;
72
  -webkit-background-size: 32px 32px !important;
@@ -93,42 +36,35 @@ li#wp-admin-bar-aioseop-pro-upgrade a.ab-item {
93
  font-size: 110%;
94
  }
95
 
96
- /* Dashicons in sidebar */
97
-
98
- .aiosp-di .dashicons {
99
- margin:1px;
100
- line-height: 1;
101
- width: 42px;
102
- height:36px;
103
- color:#fff;
104
- padding:3px;
105
- vertical-align:middle;
106
- }
107
- .aiosp-di .dashicons:before {
108
- -webkit-font-smoothing:antialiased;
109
- font:400 30px/1 dashicons;
110
- line-height: 38px;
111
- }
112
- .aiosp-di .dashicons.di-facebook {
113
- margin:0;
114
  }
115
- .aiosp-di .dashicons.di-facebook:before {
116
- content:"\f304";
117
- font-size:52px;
 
118
  }
119
- .aiosp-di .dashicons.di-twitter:before {
120
- content:"\f301"
 
121
  }
122
- .aiosp-di .dashicons.di-facebook {
123
- color: #3B5998;
 
 
 
 
 
 
124
  }
125
- .aiosp-di .dashicons.di-twitter {
126
- width: 36px;
127
- background-color:#00aced;
128
- border-radius:2px;
129
  }
130
- .upgrade_menu_link {
131
- font-weight: 900;
132
- color: #d54e21;
133
- font-size: 105%;
134
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #aioseop_settings_header #message {
2
  padding: 5px 0px 5px 50px;
3
  background-image: url(../images/update32.png);
10
 
11
  @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) {
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  #aioseop_settings_header #message {
14
  background-image: url(../images/update64.png) !important;
15
  -webkit-background-size: 32px 32px !important;
36
  font-size: 110%;
37
  }
38
 
39
+ .upgrade_menu_link {
40
+ font-weight: 900;
41
+ color: #d54e21;
42
+ font-size: 105%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
+
45
+ label[for=aioseop_edit_profile_header]
46
+ {
47
+ font-size: 1.3em;
48
  }
49
+
50
+ #aioseop_edit_profile_header {
51
+ display: none;
52
  }
53
+
54
+ .ui-tooltip.ui-widget.ui-corner-all.ui-widget-content.aioseop-ui-tooltip {
55
+ font-family: 'Open Sans', sans-serif;
56
+ -webkit-box-shadow: 0px 1px 6px -2px #0073AA;
57
+ box-shadow: 0px 1px 6px -2px #0073AA;
58
+ border: 0px;
59
+ border-radius: 0px;
60
+ background: #FEFEFE;
61
  }
62
+
63
+ .ui-tooltip.ui-widget.ui-corner-all.ui-widget-content.aioseop-ui-tooltip a {
64
+ color: #0073AA;
65
+ text-decoration: none;
66
  }
67
+
68
+ .ui-tooltip.ui-widget.ui-corner-all.ui-widget-content.aioseop-ui-tooltip dt {
69
+ font-weight: bold;
 
70
  }
css/font-icons/aioseop.eot ADDED
Binary file
css/font-icons/aioseop.svg ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by Fontastic.me</metadata>
5
+ <defs>
6
+ <font id="aioseop" horiz-adv-x="512">
7
+ <font-face font-family="aioseop" units-per-em="512" ascent="480" descent="-32"/>
8
+ <missing-glyph horiz-adv-x="512" />
9
+
10
+ <glyph glyph-name="cog" unicode="&#107;" d="M217 2c-14 2-17 5-17 14 0 3-1 8-2 12-6 24-29 47-57 59-21 8-40 8-67 1-10-3-18-5-18-4-1 0-12 20-25 43l-23 42 11 13c15 18 21 27 27 37 6 13 9 24 9 36 0 24-8 41-32 71-7 7-13 15-14 16-1 1 1 6 16 31 27 48 31 54 41 53 2-1 9-2 14-4 10-3 12-3 26-3 14 0 17 0 26 3 37 11 65 41 67 70 2 15 4 17 27 19 20 1 66 0 74-2 9-2 10-4 11-13 2-17 8-31 21-44 10-11 19-18 33-24 15-7 24-9 41-9 13 0 15 0 26 3 19 6 22 5 32-11 5-7 38-65 39-67 0-1-5-7-11-14-6-7-13-16-15-19-16-21-23-46-20-67 3-22 12-38 35-61l12-13-17-30c-19-34-28-48-32-51-5-3-12-3-22 0-12 5-25 6-37 4-31-4-59-21-74-44-6-10-9-18-11-31-1-12-2-13-9-15-6-2-75-2-85-1z m65 156c25 7 47 25 59 50 18 35 17 73-2 102-27 42-79 56-126 36-24-11-43-32-52-61-4-10-4-11-4-26 0-13 0-17 3-24 10-39 42-70 77-78 9-2 36-2 45 1z"/>
11
+ <glyph glyph-name="file" unicode="&#105;" d="M150 230c-13 0-21 1-22 2-2 1-2 21 0 23 3 3 253 4 256 0 2-1 2-21 1-23-1-1-5-2-17-2-19-1-187-1-218 0z m-12-130c-4 0-8 1-9 2-1 1-1 19 0 21 1 1 6 1 21 2 24 1 207 1 224 0l11 0 1-12c0-10 0-12-2-12-2-1-233-2-246-1z m0 64c-4 0-8 1-9 1-1 2-1 19 0 21 1 1 6 2 20 3 22 1 209 1 226 0l10-1 1-11c0-10 0-12-2-13-2-1-233-1-246 0z m-86 92l0 256 280 0 7-5c27-18 102-93 118-119l4-5 0-383-409 0z m358-70l0 134-121 0 0 141-187 0 0-410 308 0z m0 166c0 2-89 91-90 91 0 0-1-21-1-46l0-46 45 0c30 0 46 0 46 1z"/>
12
+ <glyph glyph-name="help" unicode="&#104;" d="M240 2c-35 2-63 9-94 24-30 14-49 28-75 54-34 36-56 77-66 127-4 21-4 73-1 94 20 103 96 182 199 205 19 4 48 6 71 4 79-5 150-47 196-114 48-73 54-174 15-253-15-30-31-50-60-78-38-35-93-59-143-63-8 0-16-1-19-1-3 0-14 0-23 1z m35 93c5 3 10 7 13 11 4 6 4 8 4 22 0 15 0 16-4 23-9 12-26 17-43 14-5-1-12-4-15-6-16-11-18-44-4-58 8-7 16-10 30-10 9 0 13 1 19 4z m9 120c1 19 1 19 33 45 39 31 48 46 48 78 0 23-6 38-21 53-10 10-26 19-43 23-14 4-53 4-71 0-25-5-65-21-65-25 0-4 23-47 25-47 1 0 8 3 16 6 28 11 53 16 72 12 7-1 10-3 15-8 6-6 7-6 7-18 0-17-4-22-37-48-31-25-38-37-40-69l-1-17 31 0 30 1z"/>
13
+ <glyph glyph-name="shield" unicode="&#120;" d="M252 1c-7 3-28 13-36 18-38 23-71 53-99 91-50 67-82 155-93 253-1 14-6 71-6 75 0 1 2 2 32 18 34 17 47 22 64 29 63 24 122 32 184 24 40-5 85-18 129-38 17-7 66-30 66-31 1 0-1-23-4-60-4-37-9-70-17-103-29-112-88-201-165-250-17-10-48-27-51-27 0 0-2 1-4 1z m9 23c8 3 29 15 45 25 46 31 88 84 118 149 17 35 30 75 37 112 5 28 6 42 7 73 0 48-1 50-31 65-32 16-62 26-97 34-26 5-47 7-76 8-68 1-130-12-187-40-21-11-26-14-29-21-3-7-4-10-4-30-1-32 2-60 8-93 16-77 52-154 93-202 26-30 79-71 103-80 6-2 8-2 13 0z m-7 16c-5 0-30 14-45 25-55 37-101 104-129 186-8 25-13 46-20 84-6 33-8 45-8 58 0 14 2 19 6 26 6 7 13 12 33 21 48 22 88 33 132 38 9 1 18 2 33 2 23 0 34-1 55-5 32-5 69-17 104-32 5-3 10-5 11-5 5-2 13-7 18-11 9-9 13-20 14-35 1-12 0-21-7-58-16-86-48-164-88-215-17-22-59-56-87-72-11-5-18-8-22-7z"/>
14
+ <glyph glyph-name="shield-default-bk1" unicode="&#97;" d="M253 88c-4 2-17 8-22 12-24 14-45 33-62 56-31 42-52 97-58 159-1 8-4 44-4 46 0 1 1 2 20 12 21 10 29 14 40 18 40 15 76 20 115 15 25-3 53-11 81-24 11-4 41-19 41-19 1 0 0-14-2-38-3-23-6-44-11-64-18-70-55-126-103-157-11-6-30-17-32-17 0 0-2 1-3 1z m6 14c5 2 18 10 28 16 29 20 55 53 74 93 11 22 19 47 23 71 3 17 4 26 4 45 1 30 0 31-19 41-20 10-38 16-61 21-16 3-29 5-47 5-43 1-81-7-117-25-13-7-16-9-19-13-2-4-2-6-2-19-1-20 1-37 5-58 10-48 32-97 58-127 17-19 50-44 65-49 4-2 5-2 8-1z m-4 10c-3 0-19 9-29 16-34 23-63 65-80 117-5 15-8 28-13 52-4 21-5 28-5 36 0 9 1 12 4 16 4 5 8 8 20 14 30 13 56 21 83 24 6 0 11 1 21 1 14 0 21-1 35-3 19-4 42-11 64-21 4-1 7-2 7-3 3 0 9-4 12-7 5-5 8-12 9-21 0-8-1-13-5-36-10-55-30-103-55-135-11-14-37-35-55-45-6-4-11-5-13-5z"/>
15
+ <glyph glyph-name="shield-update" unicode="&#122;" d="M241 120c-54 31-89 88-106 172-3 16-5 32-5 40-1 12 0 13 4 18 5 6 26 16 46 23 42 16 87 18 130 7 17-5 47-16 58-23 14-8 16-21 10-55-12-68-37-123-70-154-16-15-42-33-50-34-4-1-8 0-17 6z m3-26c-16 8-22 12-37 24-45 35-80 100-92 172-2 13-7 61-7 69 0 3 4 5 27 16 41 20 65 28 99 31 32 3 67-2 103-14 14-5 63-27 66-29 1-2-3-52-7-74-17-94-62-161-131-197l-9-4z m22 11c45 23 80 64 103 122 13 34 19 64 19 100 1 32 1 32-21 43-49 24-113 31-170 18-29-6-62-20-70-29-4-4-4-5-4-32 0-23 1-31 5-47 10-51 34-101 61-131 12-14 41-36 54-43 6-3 12-6 12-6 1 0 6 3 11 5z m-163-20c-21 11-37 28-58 58-12 19-29 51-35 69-9 27-10 85-3 126 6 35 18 64 36 88 16 21 16 22 8 34-7 10-6 12 8 16 17 6 62 15 71 15 7 0 8-1 9-4 1-5-2-43-5-65-4-29-7-36-11-29-3 5-10 11-13 11-8 0-31-35-39-60-6-21-7-29-7-67 0-42 0-45 14-76 4-11 8-23 9-27 1-11 2-14 7-14 2 0 8-4 13-7 10-7 27-24 24-24 0 0-4 2-8 5-8 5-15 6-15 3 0-2 3-7 7-13 10-13 15-24 15-33 0-15-8-17-27-6z m268-11c-3 2-3 16 0 43 3 25 7 48 9 53 1 2 2 2 9-2 4-2 9-4 11-4 12 0 28 25 40 60 19 58 4 131-38 185-4 6-8 10-7 11 0 0 6-4 12-10 14-13 19-16 21-15 2 1-10 19-22 34-5 6-11 13-13 16l-4 4 5 7c5 8 14 14 19 14 4 0 16-9 32-25 33-34 54-74 62-121 3-17 3-63 0-82-4-27-9-41-33-95-5-11-10-24-10-28-1-6-1-8 3-14 2-3 4-7 3-8-2-3-14-7-41-14-21-5-51-11-55-11-1 0-2 0-3 2z"/>
16
+ <glyph glyph-name="support" unicode="&#106;" d="M201 4c-25 3-63 20-95 44-22 16-37 31-55 53-35 46-49 90-49 153-1 87 33 153 107 211 41 31 117 50 175 44 95-11 166-63 207-150 14-30 18-51 18-97 0-87-18-135-73-190-32-32-69-53-109-62-32-8-90-10-126-6z m104 34c32 3 34 10 13 62l-12 29-99 0-12-29c-13-32-18-51-15-53 3-3 19-8 38-11 18-3 48-2 87 2z m-11 133c29 13 46 36 52 68 5 31-6 68-27 86-16 14-31 19-61 19-33 0-46-5-67-25-20-21-25-34-25-65 0-21 0-24 7-38 17-36 49-55 89-53 14 1 21 3 32 8z m-198 20l37 15 0 48c0 45-1 48-5 51-14 7-63 25-71 25-9 1-9 0-12-8-5-15-10-49-10-70 0-21 7-58 13-69 2-4 5-7 7-7 2 0 21 6 41 15z m369-11c1 2 5 17 8 33 5 23 6 33 5 45-3 27-8 58-12 66-3 8-4 8-10 7-8-1-43-14-64-23l-13-5 0-93 12-6c29-15 60-28 66-28 3 0 7 1 8 4z m-146 231c7 18 13 37 14 42 2 9 1 10-5 12-32 13-136 11-148-3-3-4 3-24 18-62l10-23 49 1 48 0z"/>
17
+ <glyph glyph-name="youtube" unicode="&#108;" d="M176 72c-59 1-98 4-118 8-9 2-24 10-30 16-11 11-20 31-23 55-4 32-5 74-4 129 1 58 4 84 12 104 5 11 14 23 23 29 12 8 22 11 49 13 37 3 57 3 141 4 111 0 175-1 213-5 15-2 20-3 29-8 14-6 21-14 28-27 7-15 10-26 13-52 2-19 3-46 3-87 0-58-2-88-7-114-5-24-17-41-33-51-13-7-25-9-91-12-28-2-150-3-205-2z m49 123c53 27 117 60 117 61 0 1 2 0-63 34-61 32-75 40-76 39-1-1-1-145 0-145 0 0 10 5 22 11z"/>
18
+ <glyph glyph-name="delete" unicode="&#113;" d="M241 78c-36 3-69 16-97 38-9 8-24 23-31 33-19 25-30 51-35 82-1 7-1 11-1 26 0 18 1 23 4 38 13 62 59 113 119 133 32 10 66 12 99 4 65-16 115-68 131-133 7-28 7-60-1-87-6-24-17-46-32-66-6-8-19-21-26-27-27-22-58-36-93-40-8-1-29-2-37-1z m144 179l0 26-258 0 0-52 258 0z m-141-256c-51 2-103 21-143 52-24 18-46 42-61 67-22 34-34 69-39 110-1 12-1 41 0 53 5 48 22 90 50 128 14 19 34 38 53 53 33 24 72 41 113 47 6 1 10 1 39 1 29 0 32 0 39-1 27-4 49-11 74-24 27-13 47-27 68-48 21-21 37-45 50-71 29-60 33-129 12-191-4-14-7-20-13-33-20-41-50-75-88-101-40-26-84-40-132-43-6 0-12 0-12 0 0 0-5 0-10 1z m33 37c21 2 42 8 62 16 13 5 31 15 43 23 20 14 40 35 54 54 14 21 26 47 32 72 5 19 7 34 7 54 0 16-1 26-3 40-11 56-42 106-88 139-30 21-64 34-102 39-9 2-32 2-43 1-45-3-86-20-121-48-14-11-31-30-42-45-30-44-44-97-38-150 8-74 53-139 120-172 25-13 50-20 81-23 6-1 31 0 38 0z"/>
19
+ <glyph glyph-name="cog-edit" unicode="&#110;" d="M0 84l0 80 168 168c104 105 171 159 175 165 24 14 35 15 55 15 15 0 32-5 50-15 13-8 44-40 50-53 11-19 14-33 14-51 0-16-5-32-14-48-3-12-55-68-167-181l-162-164-169 0z m180 19c0 57-30 76-76 76l-53 0 0-61 0-41c10 2 15 0 20-5 6-6 8-10 6-21l41 0 62 0z m283 241c5 5 8 24 2 45-6 25-15 39-24 49-13 12-26 19-50 26-22 5-38 4-49-2-5-4-14-10-18-17 7-12 29-36 56-64 20-20 40-42 63-55 9 2 14 11 20 18z"/>
20
+ <glyph glyph-name="default-user" unicode="&#111;" d="M0 256l0 256 512 0 0-512-65 0-1 14c-3 34-11 62-26 92-20 39-49 68-88 87l-18 9 9 7c21 15 38 41 45 66 3 14 3 41 0 55-14 56-68 94-124 88-47-6-87-41-98-86-4-15-5-42-1-56 6-27 25-54 47-69 7-4 7-4 3-6-39-16-70-41-94-77-20-30-32-65-36-104l-2-20-63 0z"/>
21
+ <glyph glyph-name="accept" unicode="&#112;" d="M250 435c-14 0-25-2-39-5-53-14-99-53-121-104-17-40-19-85-5-126 21-63 74-109 139-120 6-1 14-2 22-3 10-1 31 1 44 3 57 11 107 51 130 104 26 60 18 128-21 180-35 46-91 73-149 71z m115-71l12-12c7-7 14-14 16-16l4-5-81-81c-45-45-82-82-82-82 0 0-18 19-41 41l-41 41 17 16c8 9 16 16 16 16 0 0 12-11 25-24l24-24 66 65z m-97 148c-59 2-118-15-165-50-56-42-92-103-102-172-2-14-2-54 0-68 3-22 8-41 16-59 36-93 123-156 223-163 62-3 125 17 175 56 11 8 33 30 41 41 53 66 69 152 45 233-25 83-92 149-175 172-19 6-39 9-58 10z m-24-37c8 0 16 0 24 0 92-5 171-67 198-156 6-21 9-39 9-63 0-24-2-40-9-62-7-25-18-47-34-69-38-51-96-83-160-88-23-1-45 0-69 6-77 19-138 78-159 155-16 55-8 115 19 164 10 18 20 32 35 47 39 40 91 63 146 66z"/>
22
+ <glyph glyph-name="book" unicode="&#109;" d="M131 51c-5 1-8 1-8 2-1 1-5 2-11 3-9 0-9 1-10 4 0 2-1 3-3 3-1 0-2 1-3 3 0 2-1 3-3 3-1 1-3 2-3 4-1 1-2 2-3 3-2 0-3 1-3 9-1 9-1 9-4 9l-3 1 0 159c0 153 0 160 2 160 4 0 5 2 5 11 0 8 0 9 2 9 1 0 3 1 3 3 1 1 3 3 4 4 2 0 3 2 3 3 0 2 1 2 2 2 2 0 3 2 4 3 2 4 3 4 12 4 8 0 8 0 8 3l0 3 262 0 0-307-131 0-131 0-1-3c0-2-1-3-4-3-2-1-3-1-3-3 0-1-1-3-3-3-2-1-3-3-3-4-1-2-1-3-3-3l-3 0 0-40 3 0c2 0 2 0 2-2 0-1 2-3 4-4 2 0 3-2 4-3 0-2 1-3 3-3 2 0 3-1 3-3l1-3 288 0 0 166 1 167 23 0 0-358-147 1c-82 0-152 0-156 0z m24 64l0 12 227 0 0-25-227 0z"/>
23
+ <glyph glyph-name="shield-default" unicode="&#121;" d="M253 77c-4 1-18 8-24 12-25 15-48 35-66 61-34 44-56 104-63 170-1 9-4 47-4 50 0 1 1 1 22 12 23 11 31 15 42 19 43 17 82 22 124 17 27-4 57-13 87-26 11-5 44-20 44-21 0 0-1-15-3-40-2-25-6-47-11-69-19-75-59-135-111-168-11-7-32-18-34-18 0 0-2 0-3 1z m6 15c6 2 20 10 30 17 31 21 60 56 80 100 11 23 20 50 24 75 4 18 5 28 5 49 0 32 0 33-21 44-21 11-41 17-65 22-17 4-31 5-50 6-46 0-88-8-126-27-14-7-18-10-20-14-2-5-2-7-3-20 0-22 2-40 6-63 11-51 35-103 62-136 18-20 53-47 70-53 4-1 5-1 8 0z m-4 20c-3 0-19 9-29 16-34 23-63 65-80 117-5 15-8 28-13 52-4 21-5 28-5 36 0 9 1 12 4 16 4 5 8 8 20 14 30 13 56 21 83 24 6 0 11 1 21 1 14 0 21-1 35-3 19-4 42-11 64-21 4-1 7-2 7-3 3 0 9-4 12-7 5-5 8-12 9-21 0-8-1-13-5-36-10-55-30-103-55-135-11-14-37-35-55-45-6-4-11-5-13-5z"/>
24
+ </font></defs></svg>
css/font-icons/aioseop.ttf ADDED
Binary file
css/font-icons/aioseop.woff ADDED
Binary file
css/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
css/modules/aioseop_module-rtl.css CHANGED
@@ -35,7 +35,6 @@
35
  float: left;
36
  padding-left: 0;
37
  margin-right: 0;
38
- margin-left: 64px
39
  }
40
 
41
  .aioseop_label {
@@ -46,14 +45,6 @@
46
  direction: rtl
47
  }
48
 
49
- .aioseop input[type="text"] {
50
- padding: 2px 10px 2px 0
51
- }
52
-
53
- .aioseop textarea {
54
- padding: 10px 10px 0 0
55
- }
56
-
57
  .aioseop_help_text_div {
58
  text-align: right;
59
  margin: 8px 0 10px 0
@@ -318,3 +309,48 @@ form#aiosp_settings_form,
318
  #aioseop-about .aioseop_metabox_text ul {
319
  padding-right: 15px;
320
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  float: left;
36
  padding-left: 0;
37
  margin-right: 0;
 
38
  }
39
 
40
  .aioseop_label {
45
  direction: rtl
46
  }
47
 
 
 
 
 
 
 
 
 
48
  .aioseop_help_text_div {
49
  text-align: right;
50
  margin: 8px 0 10px 0
309
  #aioseop-about .aioseop_metabox_text ul {
310
  padding-right: 15px;
311
  }
312
+
313
+ .aioseop input[readonly] {
314
+ text-align: center;
315
+ }
316
+
317
+ .aioseop_input input[type="checkbox"]:before {
318
+ margin: -4px -4px 0 0;
319
+ }
320
+
321
+ .aioseop_header_tabs li:first-child a.aioseop_header_tab {
322
+ border: none;
323
+ }
324
+
325
+ .aioseop_feature h3 {
326
+ text-align: left;
327
+ }
328
+
329
+ .aioseop_feature .flag:before {
330
+ border-width: 13.5px 4px 15px 10px;
331
+ }
332
+
333
+ #aioseop_coming_soon, #aioseop_coming_soon2 b {
334
+ text-align: center;
335
+ }
336
+
337
+ .aioseop_feature p.aioseop_desc {
338
+ text-align: right;
339
+ }
340
+
341
+ #aioseop_coming_soon .flag.pro {
342
+ height: 17.5px;
343
+ font-size: 13.5px;
344
+ }
345
+
346
+ #aiosp_robots_default_metabox table.aioseop_table {
347
+ margin: 5px 10px 10px 0;
348
+ }
349
+
350
+ textarea.robots-text {
351
+ margin: 0 10px 0 10px;
352
+ }
353
+
354
+ .All_in_One_SEO_Pack_Feature_Manager > .aioseop_right_sidebar.aioseop_options_wrapper {
355
+ margin: 30px 0 0 0;
356
+ }
css/modules/aioseop_module.css CHANGED
@@ -27,8 +27,8 @@
27
  .aioseop_help_text_link:active {
28
  text-align: left;
29
  float: left;
30
- max-width: 300px;
31
- min-width: 1px;
32
  padding-top: 2px;
33
  outline: none;
34
  color: #888;
@@ -42,9 +42,10 @@
42
 
43
  .aioseop_help_text_link:before {
44
  content: "\f223";
45
- font-size: 27px;
46
  font-family: dashicons;
47
  vertical-align: middle;
 
48
  }
49
 
50
  #aioseop-support .aioseop_metabox_text,
@@ -54,63 +55,11 @@
54
  text-decoration: none;
55
  }
56
 
57
- .aioseop_icon {
58
- display: inline-block;
59
- width: 40px;
60
- height: 40px;
61
- background-repeat: no-repeat;
62
- background-size: 100%;
63
- vertical-align: middle;
64
- margin: 10px;
65
- }
66
-
67
- .aioseop_book_icon {
68
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAKlBMVEUAAAAAn+cAneEAnuABnuEBnuEAnuEAn+QAn+QAneAAnuEAneAAnuAAneFPI9ocAAAADnRSTlMAII/P/wCQMADwANDvnyPbz6kAAAB9SURBVHgB7c+xCQMgEIVhZwiSSRzhkRBImsA5gVUmuBGcJbUDxlhY6T2wvh/sPvBd+HdJWCSj0N8bsEEiIIOAyEBhIDGAcwA4cDBy4MDBTeuqCR5abXCvBHy+6ybQrs2R0jsH/As+srEzC55qggi81AIZ+waQxkBmQK5tD34LnXJVZf9y5gAAAABJRU5ErkJggg==);
69
- }
70
-
71
- .aioseop_cog_icon {
72
- 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=);
73
- }
74
-
75
- .aioseop_file_icon {
76
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAPFBMVEUAAAAAneAAn98AneIAneEAnuAAn+QAnuAAnuAAnuEAn+MAnuEAneAAnuEAn+EAneEAnOIAnuEAnuABnuG5yOaaAAAAE3RSTlMA0BBgn88wv++gQLCvX2+PUJDAyp/15gAAALdJREFUeF7t1z2ygzAMhVFJjm0C5Ff732uaMCSWCVzTJO/paz1zRsVtTM/OUT+Wx5PQchJ1Q2O/CETdVk51IOjWugAeYLvUAEU6rAO4oLhQB2bSvh+NAAKU2AgYQGIEDHgXbjhQCFcYKIQuoUApZBQwQg8CRhhAwArSBlCagNAI0LTqAQCq3fcC+jOA7e8DDuhK/wDwHfgOfAe+A98B2BcC3Aaw+XiCBdp3AtOcNAgs9FoACZ7ufwCe6pfMGb29UwAAAABJRU5ErkJggg==);
77
- }
78
-
79
- .aioseop_help_icon {
80
- 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);
81
- }
82
-
83
- .aioseop_support_icon {
84
- 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);
85
- }
86
-
87
- .aioseop_youtube_icon {
88
- 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==);
89
- }
90
-
91
  .aioseop_meta_box_help > label {
92
  position: absolute;
93
  margin-left: 8px;
94
  }
95
 
96
- div.aioseop_tip_icon {
97
- font-size: 14px;
98
- border: 1px solid #888;
99
- width: 1em;
100
- text-align: center;
101
- padding: 0 4px;
102
- -webkit-border-radius: 12px;
103
- -moz-border-radius: 12px;
104
- -webkit-box-shadow: 1px 1px 1px #888;
105
- -moz-box-shadow: 1px 1px 1px #888;
106
- box-shadow: 1px 1px 1px #888;
107
- border-radius: 12px;
108
- }
109
-
110
- div.aioseop_tip_icon:before {
111
- content: '?';
112
- }
113
-
114
  .aioseop_help_text_link img {
115
  width: 40px;
116
  float: left;
@@ -120,6 +69,8 @@ div.aioseop_tip_icon:before {
120
  .aioseop_meta_box_help:active {
121
  float: right;
122
  text-align: right;
 
 
123
  text-decoration: none;
124
  height: 15px;
125
  padding-top: 1px;
@@ -138,15 +89,18 @@ div.aioseop_tip_icon:before {
138
 
139
  .aioseop_label {
140
  color: #5F5F5F;
141
- font-weight: bold;
142
  line-height: 19px;
143
  display: inline-block;
 
144
  text-align: left;
145
- position: absolute;
146
- font-family: 'Open Sans', sans-serif;
147
- width: 26%;
148
  min-width: 120px;
149
- max-width: 230px;
 
 
150
  }
151
 
152
  .aioseop_option_div {
@@ -162,8 +116,8 @@ div.aioseop_tip_icon:before {
162
 
163
  .aioseop input[type="text"], .aioseop input[type="url"] {
164
  color: #515151;
165
- height: 35px;
166
- padding: 10px 0 10px 10px;
167
  font-size: 14px;
168
  width: 95%;
169
  max-width: 600px;
@@ -171,12 +125,40 @@ div.aioseop_tip_icon:before {
171
 
172
  .aioseop textarea {
173
  color: #515151;
174
- padding: 10px 0 0 10px;
175
- margin: 0;
176
  font-size: 14px;
177
  line-height: 25px;
178
  width: 95%;
179
  max-width: 600px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
 
182
  .aioseop_help_text_div {
@@ -209,6 +191,7 @@ div.aioseop_tip_icon:before {
209
  sans-serif;
210
  border-bottom: 1px solid #CCC;
211
  width: 100%;
 
212
  }
213
 
214
  .aioseop_head_nav_tab {
@@ -298,6 +281,7 @@ div.aioseop_tip_icon:before {
298
  Times,
299
  serif;
300
  font-weight: normal;
 
301
  padding: 7px 10px;
302
  margin: 0;
303
  line-height: 1;
@@ -364,16 +348,16 @@ div.aioseop_tip_icon:before {
364
  .aioseop_option_label {
365
  float: left;
366
  margin: 0;
367
- min-width: 150px;
368
- width: 37%;
369
- max-width: 270px;
370
  padding-top: 3px;
371
  padding-bottom: 3px;
372
- height: 67px !important; /*added for certain language support*/
 
 
 
373
  }
374
 
375
  .aioseop_metabox_text h2 {
376
- font-size: 14px;
377
  padding: 0;
378
  font-weight: bold;
379
  line-height: 29px;
@@ -402,7 +386,7 @@ div.aioseop_tip_icon:before {
402
 
403
  .aioseop input[readonly] {
404
  background-color: #EEE;
405
- margin: 5px 0 5px 0 !important;
406
  }
407
 
408
  .aioseop_settings_left {
@@ -445,7 +429,7 @@ body.all-in-one-seo_page_all-in-one-seo-pack-pro-aioseop_feature_manager .aioseo
445
 
446
  .aioseop_right_sidebar {
447
  float: right;
448
- margin-top: 35px;
449
  }
450
 
451
  #aiosp_settings_form .button-primary.hidden {
@@ -470,7 +454,7 @@ form#edittag div#aiosp_sitemap_exclude_wrapper {
470
  }
471
 
472
  .All_in_One_SEO_Pack_Feature_Manager > .aioseop_right_sidebar.aioseop_options_wrapper {
473
- margin-top: 10px;
474
  }
475
 
476
  div#aiosp_feature_manager_metabox .inside {
@@ -490,7 +474,7 @@ div.aioseop_feature {
490
  -webkit-border-radius: 3px;
491
  border-radius: 3px;
492
  background: white;
493
- padding: 10px 0 0;
494
  -webkit-box-shadow: inset 0 1px 0 #fff,
495
  inset 0 0 20px rgba(0, 0, 0, 0.05),
496
  0 1px 2px rgba(0, 0, 0, 0.1);
@@ -584,8 +568,9 @@ div.aioseop_feature {
584
 
585
  .aioseop_feature .feature_button {
586
  float: right;
587
- margin-bottom: 10px;
588
- margin-right: 10px;
 
589
  min-width: 80px;
590
  text-align: center;
591
  }
@@ -799,9 +784,9 @@ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
799
 
800
  .aioseop_input {
801
  clear: left;
802
- width: 100%;
803
- padding: 5px;
804
- display: inline;
805
  }
806
 
807
  .aioseop_option_input {
@@ -839,15 +824,6 @@ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
839
  padding: 0;
840
  }
841
 
842
- #aiosp_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_input,
843
- #aiosp_video_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_input {
844
- display: inline-block;
845
- vertical-align: middle;
846
- width: 25%;
847
- min-width: 120px;
848
- height: 70px;
849
- }
850
-
851
  #aiosp_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_top_label,
852
  #aiosp_video_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_top_label {
853
  width: 70%;
@@ -888,6 +864,18 @@ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
888
  margin: 5px 5px 10px;
889
  }
890
 
 
 
 
 
 
 
 
 
 
 
 
 
891
  table.aioseop_table tr:nth-child(odd) {
892
  background-color: #EEE;
893
  }
@@ -976,7 +964,7 @@ table.aioseop_table td, table.aioseop_table th {
976
  }
977
 
978
  #aiosp_settings_form .postbox {
979
- margin: 0 0 20px 0;
980
  }
981
 
982
  .aioseop_settings_left .postbox {
@@ -1039,7 +1027,6 @@ table.aioseop_table td, table.aioseop_table th {
1039
  float: left;
1040
  width: 92%;
1041
  max-width: 100%;
1042
- margin: 0 23px 0 13px;
1043
  }
1044
 
1045
  #aiosp_sitemap_status_metabox .handlediv.button-link {
@@ -1088,10 +1075,29 @@ table.aioseop_table td, table.aioseop_table th {
1088
 
1089
  .aioseop_input input[type="checkbox"],
1090
  .aioseop_input input[type="radio"] {
 
1091
  vertical-align: text-bottom;
1092
  margin-top: 8px;
1093
  }
1094
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1095
  #aiosp_importer_exporter_import_export_help_wrapper .aioseop_option_div {
1096
  max-height: initial;
1097
  }
@@ -1185,7 +1191,8 @@ div.aioseop_notice a.aioseop_dismiss_link {
1185
  }
1186
 
1187
  .aioseop_input select {
1188
- margin: 7px 0;
 
1189
  }
1190
 
1191
  .aioseop_help_text ul {
@@ -1201,60 +1208,22 @@ div.aioseop_notice a.aioseop_dismiss_link {
1201
  width: 98%;
1202
  }
1203
 
1204
- .aioseop_tabs {
1205
- padding-top: 6px;
1206
- }
1207
-
1208
- .aioseop_tabs.hide,
1209
- .aioseop_header_tabs.hide {
1210
- display: block !important;
1211
- }
1212
-
1213
- .aioseop_header_tabs li {
1214
- display: inline;
1215
- padding: 0;
1216
- margin: 0;
1217
- }
1218
-
1219
- .aioseop_header_tabs {
1220
- margin: 0;
1221
- }
1222
-
1223
- .aioseop_header_nav {
1224
- margin: 0;
1225
- }
1226
-
1227
- .aioseop_header_tabs li a.aioseop_header_tab.active {
1228
- background-color: rgb(255, 255, 255);
1229
- border-bottom-color: rgba(255, 255, 255, 0.5);
1230
- font-weight: bold;
1231
- }
1232
-
1233
  .aioseop_header_tabs li a.aioseop_header_tab {
1234
  font-size: 14px;
1235
  line-height: 37px;
1236
  text-decoration: none;
1237
- margin: 5px 5px 0 0;
1238
- padding: 10px;
1239
  cursor: pointer;
1240
  -webkit-border-top-right-radius: 3px;
1241
  -webkit-border-top-left-radius: 3px;
1242
  border-top-right-radius: 3px;
1243
  border-top-left-radius: 3px;
1244
- background-color: #e5e5e5;
1245
- border: 1px solid #ccc;
1246
  color: #5F5F5F;
1247
- }
1248
-
1249
- .aioseop_header_tabs li:first-child a.aioseop_header_tab {
1250
- border-left: solid 1px #CCC;
1251
- margin-left: 5px;
1252
  }
1253
 
1254
  .aioseop_tab {
1255
- border: solid 1px #CCC;
1256
- background-color: rgb(255, 255, 255);
1257
- background-color: rgba(255, 255, 255, 0.5);
1258
  padding: 10px;
1259
  }
1260
 
@@ -1268,6 +1237,48 @@ div.aioseop_notice a.aioseop_dismiss_link {
1268
  vertical-align: bottom;
1269
  }
1270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1271
  .aiosp_delete {
1272
  background-image: url('../../images/delete.png');
1273
  display: inline-block;
@@ -1376,7 +1387,6 @@ div.sfwd_debug_error {
1376
  }
1377
 
1378
  .postbox-container .aioseop_input {
1379
- display: block;
1380
  margin-bottom: 10px;
1381
  padding: 0;
1382
  }
@@ -1424,19 +1434,30 @@ div.sfwd_debug_error {
1424
  *
1425
  */
1426
  div#aiosp_snippet_wrapper {
1427
- border: 1px solid #888;
1428
- clear: both;
1429
- padding: 10px 10px 0;
1430
- max-width: 97%;
1431
- margin-bottom: 15px;
 
 
 
 
 
1432
  }
1433
 
1434
  div#aiosp_snippet_wrapper .aioseop_option_label {
1435
  height: auto !important;
1436
  }
1437
 
 
 
 
 
 
1438
  div#aiosp_snippet_wrapper .aioseop_input.aioseop_top_label .aioseop_option_input {
1439
  margin: 0;
 
1440
  }
1441
 
1442
  div#aioseop_snippet {
@@ -1494,11 +1515,60 @@ div#aioseop_snippet > div > span {
1494
  }
1495
 
1496
  textarea.robots-text {
 
1497
  background-color: #eee;
1498
- width: 100%;
1499
  height: 100%;
 
1500
  }
1501
 
1502
  div#aiosp_sitemap_status_metabox .toggle-indicator {
1503
  display:none;
1504
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  .aioseop_help_text_link:active {
28
  text-align: left;
29
  float: left;
30
+ max-width: 30px;
31
+ min-width: 20px;
32
  padding-top: 2px;
33
  outline: none;
34
  color: #888;
42
 
43
  .aioseop_help_text_link:before {
44
  content: "\f223";
45
+ font-size: 22px;
46
  font-family: dashicons;
47
  vertical-align: middle;
48
+ margin-right: 4px;
49
  }
50
 
51
  #aioseop-support .aioseop_metabox_text,
55
  text-decoration: none;
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  .aioseop_meta_box_help > label {
59
  position: absolute;
60
  margin-left: 8px;
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  .aioseop_help_text_link img {
64
  width: 40px;
65
  float: left;
69
  .aioseop_meta_box_help:active {
70
  float: right;
71
  text-align: right;
72
+ min-width: 56px;
73
+ max-width: 90px;
74
  text-decoration: none;
75
  height: 15px;
76
  padding-top: 1px;
89
 
90
  .aioseop_label {
91
  color: #5F5F5F;
92
+ font-weight: 600;
93
  line-height: 19px;
94
  display: inline-block;
95
+ float: left;
96
  text-align: left;
97
+ font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
98
+ padding: 2px 0;
99
+ width: 81%;
100
  min-width: 120px;
101
+ max-width: 250px;
102
+ cursor: default;
103
+ font-size: 13.5px;
104
  }
105
 
106
  .aioseop_option_div {
116
 
117
  .aioseop input[type="text"], .aioseop input[type="url"] {
118
  color: #515151;
119
+ min-height: 35px;
120
+ padding: 10px;
121
  font-size: 14px;
122
  width: 95%;
123
  max-width: 600px;
125
 
126
  .aioseop textarea {
127
  color: #515151;
128
+ padding: 10px;
129
+ margin: 1px;
130
  font-size: 14px;
131
  line-height: 25px;
132
  width: 95%;
133
  max-width: 600px;
134
+ min-height: 36px;
135
+ }
136
+
137
+ .aioseop input, textarea {
138
+ border-radius: 4px;
139
+ border: 1px solid #8d96a0;
140
+ margin: 1px;
141
+ font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important;
142
+ }
143
+
144
+ .aioseop input:focus, textarea:focus {
145
+ box-shadow: 0 0 0 1px #007cba;
146
+ }
147
+
148
+ .aioseop textarea::-webkit-scrollbar {
149
+ width: 12px;
150
+ }
151
+
152
+ .aioseop textarea::-webkit-scrollbar-track {
153
+ background: #f1f1f1;
154
+ }
155
+
156
+ .aioseop textarea::-webkit-scrollbar-thumb {
157
+ background: #aeaeae;
158
+ }
159
+
160
+ .aioseop textarea::-webkit-scrollbar-thumb:hover {
161
+ background: #888;
162
  }
163
 
164
  .aioseop_help_text_div {
191
  sans-serif;
192
  border-bottom: 1px solid #CCC;
193
  width: 100%;
194
+ margin: 8px 0 0 0;
195
  }
196
 
197
  .aioseop_head_nav_tab {
281
  Times,
282
  serif;
283
  font-weight: normal;
284
+ min-height: 18px;
285
  padding: 7px 10px;
286
  margin: 0;
287
  line-height: 1;
348
  .aioseop_option_label {
349
  float: left;
350
  margin: 0;
 
 
 
351
  padding-top: 3px;
352
  padding-bottom: 3px;
353
+ width: 37%;
354
+ min-width: 150px;
355
+ max-width: 360px;
356
+ min-height: 30px;
357
  }
358
 
359
  .aioseop_metabox_text h2 {
360
+ font-size: 30px;
361
  padding: 0;
362
  font-weight: bold;
363
  line-height: 29px;
386
 
387
  .aioseop input[readonly] {
388
  background-color: #EEE;
389
+ margin: 5px 1px 5px 1px !important;
390
  }
391
 
392
  .aioseop_settings_left {
429
 
430
  .aioseop_right_sidebar {
431
  float: right;
432
+ margin-top: 55px;
433
  }
434
 
435
  #aiosp_settings_form .button-primary.hidden {
454
  }
455
 
456
  .All_in_One_SEO_Pack_Feature_Manager > .aioseop_right_sidebar.aioseop_options_wrapper {
457
+ margin-top: 30px;
458
  }
459
 
460
  div#aiosp_feature_manager_metabox .inside {
474
  -webkit-border-radius: 3px;
475
  border-radius: 3px;
476
  background: white;
477
+ padding: 10px 0;
478
  -webkit-box-shadow: inset 0 1px 0 #fff,
479
  inset 0 0 20px rgba(0, 0, 0, 0.05),
480
  0 1px 2px rgba(0, 0, 0, 0.1);
568
 
569
  .aioseop_feature .feature_button {
570
  float: right;
571
+ display: inline-block;
572
+ position: relative;
573
+ margin: 0 10px 10px 0;
574
  min-width: 80px;
575
  text-align: center;
576
  }
784
 
785
  .aioseop_input {
786
  clear: left;
787
+ width: 98%;
788
+ padding: 5px 1%;
789
+ display: inline-block;
790
  }
791
 
792
  .aioseop_option_input {
824
  padding: 0;
825
  }
826
 
 
 
 
 
 
 
 
 
 
827
  #aiosp_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_top_label,
828
  #aiosp_video_sitemap_addl_pages_metabox .aioseop_wrapper .aioseop_top_label {
829
  width: 70%;
864
  margin: 5px 5px 10px;
865
  }
866
 
867
+ /*** Sitemap Exclude Items section ***/
868
+ .selectize-control.aioseop-exclude-terms {
869
+ position: static;
870
+ width: 95%;
871
+ max-width: 600px;
872
+ }
873
+
874
+ .selectize-input {
875
+ padding: 10px 0 10px 10px !important;
876
+ border: 1px solid #8d96a0 !important;
877
+ }
878
+
879
  table.aioseop_table tr:nth-child(odd) {
880
  background-color: #EEE;
881
  }
964
  }
965
 
966
  #aiosp_settings_form .postbox {
967
+ margin: 20px 0 0 0;
968
  }
969
 
970
  .aioseop_settings_left .postbox {
1027
  float: left;
1028
  width: 92%;
1029
  max-width: 100%;
 
1030
  }
1031
 
1032
  #aiosp_sitemap_status_metabox .handlediv.button-link {
1075
 
1076
  .aioseop_input input[type="checkbox"],
1077
  .aioseop_input input[type="radio"] {
1078
+ border: 1.25px solid #6c7781;
1079
  vertical-align: text-bottom;
1080
  margin-top: 8px;
1081
  }
1082
 
1083
+ .aioseop_input input[type="checkbox"]:before {
1084
+ margin: -3px 0 0 -5px;
1085
+ color: white;
1086
+ }
1087
+
1088
+ .aioseop_input input[type="radio"] {
1089
+ border-radius: 8px;
1090
+ }
1091
+
1092
+ .aioseop_input input[type="radio"]:before {
1093
+ content: none !important;
1094
+ }
1095
+
1096
+ .aioseop_input input[type="radio"]:checked,
1097
+ .aioseop_input input[type="checkbox"]:checked {
1098
+ background: #11a0d2;
1099
+ }
1100
+
1101
  #aiosp_importer_exporter_import_export_help_wrapper .aioseop_option_div {
1102
  max-height: initial;
1103
  }
1191
  }
1192
 
1193
  .aioseop_input select {
1194
+ border-radius: 4px;
1195
+ border: 1px solid #8d96a0;
1196
  }
1197
 
1198
  .aioseop_help_text ul {
1208
  width: 98%;
1209
  }
1210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1211
  .aioseop_header_tabs li a.aioseop_header_tab {
1212
  font-size: 14px;
1213
  line-height: 37px;
1214
  text-decoration: none;
 
 
1215
  cursor: pointer;
1216
  -webkit-border-top-right-radius: 3px;
1217
  -webkit-border-top-left-radius: 3px;
1218
  border-top-right-radius: 3px;
1219
  border-top-left-radius: 3px;
1220
+ border-bottom: none !important;
1221
+ padding: 0em 0.5em !important;
1222
  color: #5F5F5F;
1223
+ font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important;
 
 
 
 
1224
  }
1225
 
1226
  .aioseop_tab {
 
 
 
1227
  padding: 10px;
1228
  }
1229
 
1237
  vertical-align: bottom;
1238
  }
1239
 
1240
+ .aioseop_tabs.ui-widget-content {
1241
+ background: none !important;
1242
+ }
1243
+
1244
+ .aioseop_tab.ui-widget-content {
1245
+ border: 1px solid #aaa !important;
1246
+ }
1247
+
1248
+ .aioseop_tab.ui-widget-content a.aioseop_help_text_link {
1249
+ color: #888 !important;
1250
+ }
1251
+
1252
+ .aioseop_tabs.ui-widget {
1253
+ font-size: 13px !important;
1254
+ border: none !important;
1255
+ }
1256
+
1257
+ .aioseop_tabs .ui-widget-header {
1258
+ border: none !important;
1259
+ background: none !important;
1260
+ border-bottom-right-radius: 0px !important;
1261
+ border-bottom-left-radius: 0px !important;
1262
+ }
1263
+
1264
+ .aioseop_tabs ul {
1265
+ margin-left: .2em !important;
1266
+ }
1267
+
1268
+ .aioseop_tabs .ui-tabs .ui-tabs-panel {
1269
+ border-width: inherit !important;
1270
+ }
1271
+
1272
+ .aioseop_tabs .ui-state-default,
1273
+ .aioseop_tabs .ui-widget-content .ui-state-default,
1274
+ .aioseop_tabs .ui-widget-header .ui-state-default {
1275
+ background-image: none !important;
1276
+ }
1277
+
1278
+ .aioseop_tabs .ui-state-active a {
1279
+ font-weight: bold !important;
1280
+ }
1281
+
1282
  .aiosp_delete {
1283
  background-image: url('../../images/delete.png');
1284
  display: inline-block;
1387
  }
1388
 
1389
  .postbox-container .aioseop_input {
 
1390
  margin-bottom: 10px;
1391
  padding: 0;
1392
  }
1434
  *
1435
  */
1436
  div#aiosp_snippet_wrapper {
1437
+ border-radius: 4px;
1438
+ border: 1px solid #8d96a0;
1439
+ clear: both;
1440
+ padding: 10px 10px 0;
1441
+ max-width: 97%;
1442
+ margin-bottom: 15px;
1443
+ }
1444
+
1445
+ #aiosp_snippet_wrapper > .aioseop_input:first-child {
1446
+ margin-bottom: 0px;
1447
  }
1448
 
1449
  div#aiosp_snippet_wrapper .aioseop_option_label {
1450
  height: auto !important;
1451
  }
1452
 
1453
+ #aiosp_snippet_wrapper > .aioseop_input:first-child .aioseop_option_label {
1454
+ padding: 0;
1455
+ min-height: inherit;
1456
+ }
1457
+
1458
  div#aiosp_snippet_wrapper .aioseop_input.aioseop_top_label .aioseop_option_input {
1459
  margin: 0;
1460
+ width: 99%;
1461
  }
1462
 
1463
  div#aioseop_snippet {
1515
  }
1516
 
1517
  textarea.robots-text {
1518
+ color: black;
1519
  background-color: #eee;
 
1520
  height: 100%;
1521
+ margin: 0 0 0 10px;
1522
  }
1523
 
1524
  div#aiosp_sitemap_status_metabox .toggle-indicator {
1525
  display:none;
1526
  }
1527
+
1528
+ .required.email {
1529
+ border-radius: 4px;
1530
+ border: 1px solid #8d96a0;
1531
+ margin: 1px;
1532
+ font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important;
1533
+ }
1534
+
1535
+ .ui-sortable-handle span {
1536
+ font-size: 16px;
1537
+ font-weight: 600;
1538
+ font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
1539
+ color: black;
1540
+ }
1541
+
1542
+ .aioseop_file_upload {
1543
+ border: none !important;
1544
+ }
1545
+
1546
+ .aioseop_upload_image_button {
1547
+ float: left;
1548
+ margin: 0 0 5px 0 !important;
1549
+ }
1550
+
1551
+ .aioseop_delete_files_button {
1552
+ margin: 0 5px 10px 0 !important;
1553
+ }
1554
+
1555
+ .aioseop_rename_files_button {
1556
+ margin: 0 0 10px 0 !important;
1557
+ }
1558
+
1559
+ .aioseop_update_options_button,
1560
+ .aioseop_reset_settings_button {
1561
+ margin: 10px 0 0 0 !important;
1562
+ }
1563
+
1564
+ #aiosp_robots_default_metabox .aioseop_option_label {
1565
+ margin-left: 10px;
1566
+ }
1567
+
1568
+ #aiosp_robots_default_metabox .add-edit-rule {
1569
+ margin-left: 5px;
1570
+ }
1571
+
1572
+ #aiosp_file_editor_htaccess_metabox {
1573
+ margin: 0 !important;
1574
+ }
css/modules/index.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden.
4
+ */
css/welcome.css CHANGED
@@ -93,9 +93,9 @@ section:first-child {
93
 
94
  .welcome-panel-column p.call-to-action .button-orange {
95
  background: #d54e21;
96
- border-color: #d54e21;
97
- -webkit-box-shadow: 0 1px 0 #d54e21;
98
- box-shadow: 0 1px 0 #d54e21;
99
  color: #fff;
100
  text-decoration: none;
101
  text-shadow: 0 -1px 1px #d54e21,1px 0 1px #d54e21,0 1px 1px #d54e21,-1px 0 1px #d54e21;
93
 
94
  .welcome-panel-column p.call-to-action .button-orange {
95
  background: #d54e21;
96
+ border-color: #aa3e1a;
97
+ -webkit-box-shadow: 0 1px 0 #aa3e1a;
98
+ box-shadow: 0 1px 0 #aa3e1a;
99
  color: #fff;
100
  text-decoration: none;
101
  text-shadow: 0 -1px 1px #d54e21,1px 0 1px #d54e21,0 1px 1px #d54e21,-1px 0 1px #d54e21;
images/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
images/shield-sprite-16.png DELETED
Binary file
images/shield-sprite-32.png DELETED
Binary file
images/shield32.png DELETED
Binary file
images/shield32fade.png DELETED
Binary file
images/shield64.png DELETED
Binary file
inc/aioseop_functions.php CHANGED
@@ -74,8 +74,8 @@ if ( ! function_exists( 'aioseop_update_settings_check' ) ) {
74
  unset( $aioseop_options['aiosp_archive_title_format'] );
75
  $update_options = true;
76
  }
77
- if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && ( $aioseop_options['aiosp_archive_title_format'] === '%date% | %blog_title%' ) ) {
78
- $aioseop_options['aiosp_archive_title_format'] = '%archive_title% | %blog_title%';
79
  $update_options = true;
80
  }
81
  if ( $update_options ) {
@@ -203,22 +203,6 @@ if ( ! function_exists( 'aioseop_admin_head' ) ) {
203
  wp_enqueue_script( 'aioseop_welcome_js', AIOSEOP_PLUGIN_URL . 'js/quickedit_functions.js', array( 'jquery' ), AIOSEOP_VERSION );
204
  ?>
205
  <style>
206
- .aioseop_edit_button {
207
- margin: 0 0 0 5px;
208
- opacity: 0.6;
209
- width: 12px;
210
- }
211
-
212
- .aioseop_edit_link {
213
- display: inline-block;
214
- position: absolute;
215
- }
216
-
217
- .aioseop_mpc_SEO_admin_options_edit img {
218
- margin: 3px 2px;
219
- opacity: 0.7;
220
- }
221
-
222
  .aioseop_mpc_admin_meta_options {
223
  float: left;
224
  display: block;
@@ -374,18 +358,22 @@ if ( ! function_exists( 'aioseop_ajax_save_meta' ) ) {
374
  die();
375
  }
376
  if ( $result != '' ) :
377
- $label = "<label id='aioseop_label_{$target}_{$post_id}'><span style='width: 20px;display: inline-block;'></span>" . $result . '</label>';
378
  else :
379
- $label = "<label id='aioseop_label_{$target}_{$post_id}'></label><span style='width: 20px;display: inline-block;'></span><strong><i>" . __( 'No', 'all-in-one-seo-pack' ) . ' ' . $target . '</i></strong>';
380
  endif;
381
  $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$post_id}" );
382
- $output = '<a id="' . $target . 'editlink' . $post_id . '" class="aioseop_edit_link" href="javascript:void(0);"'
383
- . 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __( 'Edit' ) . '">'
384
- . '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a> ' . $label;
 
 
 
385
  die(
386
- "jQuery('div#aioseop_" . $target . '_' . $post_id . "').fadeOut('fast', function() { var my_label = " . json_encode( $output ) . ";
387
- jQuery('div#aioseop_" . $target . '_' . $post_id . "').html(my_label).fadeIn('fast');
388
- });"
 
389
  );
390
  }
391
  }
@@ -555,7 +543,6 @@ if ( ! function_exists( 'aioseop_ajax_scan_header' ) ) {
555
  $metatags = array(
556
  'facebook' => array( 'name' => 'property', 'value' => 'content' ),
557
  'twitter' => array( 'name' => 'name', 'value' => 'value' ),
558
- 'google+' => array( 'name' => 'itemprop', 'value' => 'content' ),
559
  );
560
  $metadata = array(
561
  'facebook' => array(
@@ -567,11 +554,6 @@ if ( ! function_exists( 'aioseop_ajax_scan_header' ) ) {
567
  'key' => 'fb:admins',
568
  'description' => 'og:description',
569
  ),
570
- 'google+' => array(
571
- 'thumbnail' => 'image',
572
- 'title' => 'name',
573
- 'description' => 'description',
574
- ),
575
  'twitter' => array(
576
  'card' => 'twitter:card',
577
  'url' => 'twitter:url',
@@ -601,8 +583,9 @@ if ( ! function_exists( 'aioseop_ajax_scan_header' ) ) {
601
  } else {
602
  $meta = "<table cellspacing=0 cellpadding=0 width=80% class='aioseop_table'><tr class='aioseop_table_header'><th>Meta For Site</th><th>Kind of Meta</th><th>Element Name</th><th>Element Value</th></tr>" . $meta . '</table>';
603
  $meta .= "<p><div class='aioseop_meta_info'><h3 style='padding:5px;margin-bottom:0px;'>" . __( 'What Does This Mean?', 'all-in-one-seo-pack' ) . "</h3><div style='padding:5px;padding-top:0px;'>"
604
- . '<p>' . __( 'All in One SEO Pack has detected that a plugin(s) or theme is also outputting social meta tags on your site. You can view this social meta in the source code of your site (check your browser help for instructions on how to view source code).', 'all-in-one-seo-pack' )
605
- . '</p><p>' . __( 'You may prefer to use the social meta tags that are being output by the other plugin(s) or theme. If so, then you should deactivate this Social Meta feature in All in One SEO Pack Feature Manager.', 'all-in-one-seo-pack' )
 
606
  . '</p><p>' . __( 'You should avoid duplicate social meta tags. You can use these free tools from Facebook and Twitter to validate your social meta and check for errors:', 'all-in-one-seo-pack' ) . '</p>';
607
 
608
  foreach (
@@ -756,16 +739,17 @@ if ( ! function_exists( 'aioseop_mrt_pccolumn' ) ) {
756
  <?php
757
  $content = strip_tags( stripslashes( get_post_meta( $id, '_aioseop_' . $target, true ) ) );
758
  if ( ! empty( $content ) ) :
759
- $label = "<label id='aioseop_label_{$target}_{$id}'><span style='width: 20px;display: inline-block;'></span>" . $content . '</label>';
760
  else :
761
- $label = "<label id='aioseop_label_{$target}_{$id}'></label><span style='width: 20px;display: inline-block;'></span><strong><i>" . __( 'No', 'all-in-one-seo-pack' ) . ' ' . $target . '</i></strong>';
762
  endif;
763
  $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$id}" );
764
- echo '<a id="' . $target . 'editlink' . $id . '" class="aioseop_edit_link" href="javascript:void(0);" onclick=\'aioseop_ajax_edit_meta_form(' .
765
- $id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __( 'Edit' ) . '">'
766
- . "<img class='aioseop_edit_button'
767
- id='aioseop_edit_id'
768
- src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a> " . $label;
 
769
  ?>
770
  </div>
771
  </div>
@@ -855,12 +839,15 @@ if ( ! function_exists( 'aioseop_add_contactmethods' ) ) {
855
  */
856
  function aioseop_add_contactmethods( $contactmethods ) {
857
  global $aioseop_options, $aioseop_modules;
858
- if ( empty( $aioseop_options['aiosp_google_disable_profile'] ) ) {
859
- $contactmethods['googleplus'] = __( 'Google+', 'all-in-one-seo-pack' );
860
- }
861
  if ( ! empty( $aioseop_modules ) && is_object( $aioseop_modules ) ) {
862
  $m = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Opengraph' );
863
  if ( ( $m !== false ) && is_object( $m ) ) {
 
 
 
 
 
864
  if ( $m->option_isset( 'twitter_creator' ) ) {
865
  $contactmethods['twitter'] = __( 'Twitter', 'all-in-one-seo-pack' );
866
  }
@@ -869,7 +856,6 @@ if ( ! function_exists( 'aioseop_add_contactmethods' ) ) {
869
  }
870
  }
871
  }
872
-
873
  return $contactmethods;
874
  }
875
  }
@@ -1007,6 +993,9 @@ if ( ! function_exists( 'parse_ini_string' ) ) {
1007
  }
1008
  }
1009
 
 
 
 
1010
  function aioseop_update_user_visibilitynotice() {
1011
 
1012
  update_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed', true );
@@ -1017,16 +1006,6 @@ function aioseop_update_yst_detected_notice() {
1017
  update_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed', true );
1018
  }
1019
 
1020
- function aioseop_woo_upgrade_notice_dismissed() {
1021
-
1022
- update_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed', true );
1023
- }
1024
-
1025
- function aioseop_sitemap_max_url_notice_dismissed() {
1026
-
1027
- update_user_meta( get_current_user_id(), 'aioseop_sitemap_max_url_notice_dismissed', true );
1028
- }
1029
-
1030
  /**
1031
  * Returns home_url() value compatible for any use.
1032
  * Thought for compatibility purposes.
@@ -1086,3 +1065,140 @@ if ( ! function_exists( 'aioseop_formatted_date' ) ) {
1086
  return apply_filters( 'aioseop_format_date', $formatted_date, $date, $format );
1087
  }
1088
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  unset( $aioseop_options['aiosp_archive_title_format'] );
75
  $update_options = true;
76
  }
77
+ if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && ( $aioseop_options['aiosp_archive_title_format'] === '%date% | %site_title%' ) ) {
78
+ $aioseop_options['aiosp_archive_title_format'] = '%archive_title% | %site_title%';
79
  $update_options = true;
80
  }
81
  if ( $update_options ) {
203
  wp_enqueue_script( 'aioseop_welcome_js', AIOSEOP_PLUGIN_URL . 'js/quickedit_functions.js', array( 'jquery' ), AIOSEOP_VERSION );
204
  ?>
205
  <style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  .aioseop_mpc_admin_meta_options {
207
  float: left;
208
  display: block;
358
  die();
359
  }
360
  if ( $result != '' ) :
361
+ $label = "<label id='aioseop_label_{$target}_{$post_id}' class='aioseop-label-quickedit' for='{$target}editlink{$post_id}'>" . $result . '</label>';
362
  else :
363
+ $label = "<label id='aioseop_label_{$target}_{$post_id}' class='aioseop-label-quickedit' for='{$target}editlink{$post_id}'></label><strong><i>" . __( 'No', 'all-in-one-seo-pack' ) . ' ' . $target . '</i></strong>';
364
  endif;
365
  $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$post_id}" );
366
+ $output = '<a id="' . $target . 'editlink' . $post_id . '" '
367
+ . 'class="aioseop_edit_link aioseop-icon-cog-edit" '
368
+ . 'href="javascript:void(0);" '
369
+ . 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '", "' . $nonce . '");return false;\' '
370
+ . 'title="' . __( 'Edit' ) . '"></a>';
371
+ $output .= $label;
372
  die(
373
+ "jQuery('div#aioseop_" . $target . '_' . $post_id . "').fadeOut('fast', function() {
374
+ var my_label = " . json_encode( $output ) . ";
375
+ jQuery('div#aioseop_" . $target . '_' . $post_id . "').html(my_label).fadeIn('fast');
376
+ });"
377
  );
378
  }
379
  }
543
  $metatags = array(
544
  'facebook' => array( 'name' => 'property', 'value' => 'content' ),
545
  'twitter' => array( 'name' => 'name', 'value' => 'value' ),
 
546
  );
547
  $metadata = array(
548
  'facebook' => array(
554
  'key' => 'fb:admins',
555
  'description' => 'og:description',
556
  ),
 
 
 
 
 
557
  'twitter' => array(
558
  'card' => 'twitter:card',
559
  'url' => 'twitter:url',
583
  } else {
584
  $meta = "<table cellspacing=0 cellpadding=0 width=80% class='aioseop_table'><tr class='aioseop_table_header'><th>Meta For Site</th><th>Kind of Meta</th><th>Element Name</th><th>Element Value</th></tr>" . $meta . '</table>';
585
  $meta .= "<p><div class='aioseop_meta_info'><h3 style='padding:5px;margin-bottom:0px;'>" . __( 'What Does This Mean?', 'all-in-one-seo-pack' ) . "</h3><div style='padding:5px;padding-top:0px;'>"
586
+ /* 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. */
587
+ . '<p>' . sprintf( __( '%s has detected that a plugin(s) or theme is also outputting social meta tags on your site. You can view this social meta in the source code of your site (check your browser help for instructions on how to view source code).', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME )
588
+ . '</p><p>' . __( 'You may prefer to use the social meta tags that are being output by the other plugin(s) or theme. If so, then you should deactivate this Social Meta feature in the Feature Manager.', 'all-in-one-seo-pack' )
589
  . '</p><p>' . __( 'You should avoid duplicate social meta tags. You can use these free tools from Facebook and Twitter to validate your social meta and check for errors:', 'all-in-one-seo-pack' ) . '</p>';
590
 
591
  foreach (
739
  <?php
740
  $content = strip_tags( stripslashes( get_post_meta( $id, '_aioseop_' . $target, true ) ) );
741
  if ( ! empty( $content ) ) :
742
+ $label = "<label id='aioseop_label_{$target}_{$id}' class='aioseop-label-quickedit'>" . $content . '</label>';
743
  else :
744
+ $label = "<label id='aioseop_label_{$target}_{$id}' class='aioseop-label-quickedit'></label><strong><i>" . __( 'No', 'all-in-one-seo-pack' ) . ' ' . $target . '</i></strong>';
745
  endif;
746
  $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$id}" );
747
+ echo '<a id="' . $target . 'editlink' . $id . '" '
748
+ . 'class="aioseop_edit_link aioseop-icon-cog-edit" '
749
+ . 'href="javascript:void(0);" '
750
+ . 'onclick=\'aioseop_ajax_edit_meta_form(' . $id . ', "' . $target . '", "' . $nonce . '");return false;\' '
751
+ . 'title="' . __( 'Edit' ) . '"></a>';
752
+ echo $label;
753
  ?>
754
  </div>
755
  </div>
839
  */
840
  function aioseop_add_contactmethods( $contactmethods ) {
841
  global $aioseop_options, $aioseop_modules;
842
+
 
 
843
  if ( ! empty( $aioseop_modules ) && is_object( $aioseop_modules ) ) {
844
  $m = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Opengraph' );
845
  if ( ( $m !== false ) && is_object( $m ) ) {
846
+
847
+ if ( $m->option_isset( 'twitter_creator' ) || $m->option_isset( 'facebook_author' ) ) {
848
+ $contactmethods['aioseop_edit_profile_header'] = AIOSEOP_PLUGIN_NAME;
849
+ }
850
+
851
  if ( $m->option_isset( 'twitter_creator' ) ) {
852
  $contactmethods['twitter'] = __( 'Twitter', 'all-in-one-seo-pack' );
853
  }
856
  }
857
  }
858
  }
 
859
  return $contactmethods;
860
  }
861
  }
993
  }
994
  }
995
 
996
+ /**
997
+ * @deprecated 2.4.2
998
+ */
999
  function aioseop_update_user_visibilitynotice() {
1000
 
1001
  update_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed', true );
1006
  update_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed', true );
1007
  }
1008
 
 
 
 
 
 
 
 
 
 
 
1009
  /**
1010
  * Returns home_url() value compatible for any use.
1011
  * Thought for compatibility purposes.
1065
  return apply_filters( 'aioseop_format_date', $formatted_date, $date, $format );
1066
  }
1067
  }
1068
+
1069
+ /**
1070
+ * SVG menu icon function.
1071
+ *
1072
+ * Returns a base64 data URI for the SVG icon in the menu.
1073
+ *
1074
+ * @since 3.0
1075
+ *
1076
+ * @return string
1077
+ */
1078
+ if ( ! function_exists( 'aioseop_get_menu_icon' ) ) {
1079
+
1080
+ function aioseop_get_menu_icon() {
1081
+ $svg = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
1082
+ width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
1083
+ <g>
1084
+ <g>
1085
+ <path fill="#a0a5aa" d="M6.6356587,16.0348835c-0.0206718,0-0.0413432,0-0.0620155,0
1086
+ c-0.067409-0.5687227-0.188632-1.1286116-0.2770367-1.6938677c-0.0116553-0.0745268-0.0655184-0.0857201-0.1188116-0.1016665
1087
+ c-0.3916383-0.1171865-0.7678571-0.2725677-1.1279092-0.4651537c-0.0950913-0.0508642-0.1637669-0.0440636-0.2516775,0.0184937
1088
+ c-0.4121995,0.2933187-0.8315198,0.5766335-1.2435973,0.8701181c-0.0922408,0.0656958-0.1460404,0.0679903-0.2289517-0.0181942
1089
+ c-0.6222079-0.6467686-1.2487767-1.2893686-1.878032-1.9292908c-0.0701602-0.0713491-0.0678169-0.1162405-0.0118753-0.1922131
1090
+ c0.3030721-0.4115992,0.5985562-0.8287926,0.9025542-1.2396946c0.0631523-0.0853596,0.0758619-0.1488447,0.0193999-0.2455435
1091
+ c-0.2010608-0.344347-0.3531485-0.711894-0.4586703-1.095892C1.8667084,9.8243389,1.8056024,9.7895813,1.6982909,9.7728567
1092
+ C1.1987077,9.6949921,0.7006906,9.6068258,0.2005107,9.5332375C0.086966,9.516531,0.0595014,9.4774542,0.0604039,9.3681087
1093
+ c0.0040068-0.485467-0.001498-0.9710121-0.0035627-1.4565291c0.0033759-0.4542298,0.0067518-0.9084601,0.0101276-1.36269
1094
+ c0.5357779-0.0816574,1.0710917-0.1666121,1.6077318-0.2421441c0.1052274-0.014811,0.1534867-0.0610075,0.1793816-0.156611
1095
+ C1.9584855,5.7646813,2.1191192,5.401351,2.3082211,5.0513253c0.0522738-0.0967579,0.0481837-0.162436-0.0161171-0.250216
1096
+ C1.9869013,4.3844619,1.6903805,3.9614599,1.3860248,3.5441806c-0.0582591-0.0798743-0.0660335-0.1283553,0.0108961-0.205359
1097
+ c0.2363812-0.2366092,0.4708829-0.4750328,0.6985862-0.7207708c0.3790767-0.4091005,0.7861221-0.7921721,1.175601-1.1918454
1098
+ c0.073673-0.0756011,0.1193006-0.0768266,0.2023387-0.0167576C3.8918667,1.7121295,4.316906,2.0056617,4.7353082,2.308367
1099
+ C4.8231764,2.3719378,4.8931837,2.3785665,4.9881315,2.32724c0.3547778-0.1917841,0.7246637-0.3497989,1.111764-0.4646662
1100
+ c0.0834813-0.0247719,0.1245975-0.064445,0.1387806-0.1575147c0.0761976-0.5000092,0.16292-0.9984057,0.2415481-1.4980611
1101
+ c0.0154085-0.0979107,0.0362725-0.1528581,0.1583104-0.1525809C7.5273662,0.0564359,8.4162264,0.0512272,9.305047,0.0441977
1102
+ c0.1012211-0.0008005,0.1417351,0.0252949,0.1585598,0.1328662C9.53936,0.6614148,9.6292553,1.1435384,9.7077475,1.6274875
1103
+ c0.0177774,0.1096017,0.058032,0.1689863,0.1729288,0.1986653c0.3962202,0.102347,0.7708454,0.2639885,1.1316824,0.4550474
1104
+ c0.0918427,0.04863,0.1530666,0.0429895,0.2356024-0.017288c0.4170818-0.3046039,0.8413315-0.5994209,1.2571535-0.9056976
1105
+ c0.0917759-0.0675981,0.1401968-0.0588857,0.2166672,0.0191574c0.6248131,0.6376669,1.2525311,1.272517,1.883935,1.9036541
1106
+ c0.0746508,0.07462,0.0591631,0.1200178,0.0068951,0.1928642c-0.3040953,0.4238276-0.6021757,0.8519745-0.9068089,1.2754121
1107
+ c-0.055665,0.0773745-0.062233,0.1379747-0.0156651,0.2230096c0.1986971,0.3628144,0.3654804,0.740099,0.4793482,1.1387706
1108
+ c0.0208931,0.0731559,0.0545502,0.1125269,0.1340227,0.124958c0.5150261,0.080555,1.0287666,0.1695499,1.5444088,0.2457719
1109
+ c0.1157055,0.0171032,0.1522121,0.0537534,0.1517,0.1727324c-0.0038252,0.8888292-0.0027952,1.7777138,0.0044317,2.6665182
1110
+ c0.0009861,0.1212635-0.0400152,0.1560354-0.1516571,0.1713991c-0.506238,0.0696716-1.01122,0.1484213-1.5170298,0.2212944
1111
+ c-0.0849352,0.0122366-0.1369514,0.0427141-0.1609879,0.1339951c-0.1068697,0.4058342-0.2684164,0.7910061-0.4649954,1.1610003
1112
+ c-0.0476036,0.0895996-0.0424118,0.1538601,0.0197964,0.2369499c0.3095427,0.4134502,0.6102238,0.8335266,0.9184151,1.2480059
1113
+ c0.0534544,0.0718899,0.0545559,0.1134748-0.0114231,0.1797924c-0.2578106,0.2591314-0.5192184,0.5143776-0.769351,0.7817802
1114
+ c-0.3668623,0.392189-0.7637119,0.7561789-1.1404953,1.1393509c-0.0824919,0.08389-0.1328821,0.0722904-0.217783,0.011488
1115
+ c-0.4072781-0.2916708-0.8208151-0.5745983-1.2280502-0.8663273c-0.0825233-0.0591173-0.144722-0.067111-0.236228-0.0173359
1116
+ c-0.3357944,0.1826582-0.6816397,0.3475332-1.0514994,0.4474249c-0.1470699,0.0397205-0.2045288,0.1080666-0.2260523,0.2567778
1117
+ c-0.0761395,0.5260658-0.1672792,1.0499601-0.2527313,1.5746784c-0.4212217,0.0021896-0.8424425,0.0043812-1.2636642,0.0065708
1118
+ c-0.4936438-0.0006676-0.9872875-0.0013523-1.4809322-0.0019608C6.7227592,16.005888,6.6766686,16.0087776,6.6356587,16.0348835z
1119
+ M5.5945344,8.0587454c0-0.2738581,0.0047617-0.5478387-0.0023174-0.8215132
1120
+ C5.5893402,7.1260171,5.6286783,7.0980015,5.7342682,7.101109c0.2426443,0.0071421,0.485899-0.004355,0.7283907,0.0050206
1121
+ C6.582684,7.1107702,6.6087341,7.0694351,6.6071982,6.9564962C6.6010141,6.5018721,6.6034818,6.047111,6.6051793,5.5924091
1122
+ C6.6059542,5.3847222,6.7331271,5.2457314,6.9168048,5.244235c0.1906495-0.0015526,0.3085308,0.127861,0.3090096,0.3434582
1123
+ C7.2268128,6.0372324,7.2299843,6.486825,7.2238765,6.9362822C7.2222071,7.059145,7.2495227,7.1088743,7.3848124,7.1063519
1124
+ c0.439054-0.0081887,0.8784418-0.0078368,1.3175068,0.0000539C8.8253679,7.1086168,8.8466787,7.0647745,8.845252,6.9549446
1125
+ C8.8396749,6.5261455,8.8435812,6.0972285,8.8424616,5.6683593c-0.0001907-0.072803,0.0000401-0.1455956,0.0266342-0.213613
1126
+ c0.0515699-0.1318998,0.146349-0.2095218,0.2923908-0.2100406C9.3081264,5.244184,9.4056911,5.3223853,9.4531078,5.4547076
1127
+ c0.0219107,0.0611463,0.022418,0.1320171,0.0227108,0.1985226c0.0019064,0.4340315,0.004344,0.8681149-0.0010605,1.3020859
1128
+ C9.4733648,7.0671229,9.4999199,7.1107302,9.6208115,7.106133c0.2476625-0.0094175,0.496212,0.0041265,0.7438431-0.0057049
1129
+ c0.1215019-0.0048237,0.1450939,0.038619,0.1435795,0.1499443c-0.0059738,0.439126,0.0016041,0.8784308-0.0038633,1.3175702
1130
+ c-0.0045824,0.3680878-0.0652542,0.7269754-0.226469,1.062129c-0.3337469,0.6938353-0.8668461,1.1507959-1.613966,1.3531427
1131
+ c-0.0617809,0.0167313-0.1411858,0.0100212-0.1393509,0.1228523c0.0067186,0.4132614,0.0039825,0.8267059,0.0015554,1.2400627
1132
+ c-0.0004635,0.0790262,0.0286264,0.0947142,0.102293,0.0837212c0.888093-0.1325045,1.6820068-0.4789791,2.3410072-1.0896969
1133
+ c1.1879272-1.1008902,1.6558428-2.4656649,1.4010391-4.0640707c-0.1778069-1.1154013-0.7301302-2.025878-1.6186838-2.7184963
1134
+ c-1.047287-0.8163497-2.2356091-1.1035333-3.5431743-0.8636246C6.1200128,3.893697,5.2326531,4.4406323,4.5548649,5.3104329
1135
+ c-0.8100188,1.0394912-1.079107,2.221858-0.8649251,3.5168509c0.1360686,0.8227005,0.491719,1.543438,1.0476153,2.1613245
1136
+ c0.7106156,0.7898598,1.5925984,1.2679882,2.6462483,1.4320927c0.1402783,0.0218477,0.1544113-0.0172405,0.1528563-0.1345453
1137
+ c-0.0050645-0.3823004-0.0053444-0.7647629,0.0003886-1.1470451c0.0015402-0.1027012-0.0355787-0.1348372-0.131959-0.1631641
1138
+ c-0.8400359-0.2468815-1.4050922-0.7891521-1.6920962-1.6152534C5.5662184,8.9382191,5.5952759,8.4963045,5.5945344,8.0587454z"/>
1139
+ </g>
1140
+ </g>
1141
+ </svg>';
1142
+ return 'data:image/svg+xml;base64,' . base64_encode( $svg );
1143
+ }
1144
+ }
1145
+
1146
+ /**
1147
+ * Runs shortcodes in autogenerated titles & descriptions.
1148
+ *
1149
+ * @since 3.0.0
1150
+ *
1151
+ * @param string $content Content of the post
1152
+ *
1153
+ * @return string $content Content after shortcodes have been run.
1154
+ */
1155
+ function aioseop_do_shortcodes( $content ) {
1156
+ $conflicting_shortcodes = array(
1157
+ 'WooCommerce Login' => '[woocommerce_my_account]',
1158
+ );
1159
+
1160
+ $rtn_conflict_shortcodes = array();
1161
+ foreach ( $conflicting_shortcodes as $shortcode ) {
1162
+ // Second check is needed for shortcodes in Gutenberg Classic blocks.
1163
+ if ( stripos( $content, $shortcode, 0 ) || 0 === stripos( $content, $shortcode, 0 ) ) {
1164
+ global $shortcode_tags;
1165
+ $shortcode_tag = str_replace( array('[', ']'), '', $shortcode );
1166
+ if ( array_key_exists( $shortcode_tag, $shortcode_tags ) ) {
1167
+ $rtn_conflict_shortcodes[ $shortcode_tag ] = $shortcode_tags[ $shortcode_tag ];
1168
+ }
1169
+ }
1170
+ }
1171
+
1172
+ if ( ! empty( $rtn_conflict_shortcodes ) ) {
1173
+ return aioseop_do_shortcode_helper( $content, $rtn_conflict_shortcodes );
1174
+ }
1175
+
1176
+ return do_shortcode( $content );
1177
+ }
1178
+
1179
+ /**
1180
+ * Ignores shortcodes that are known to conflict.
1181
+ * Acts as a helper function for aioseop_do_shortcodes().
1182
+ *
1183
+ * @since 3.0.0
1184
+ *
1185
+ * @param string $content Content of the post
1186
+ * @param array $conflicting_shortcodes List of conflicting shortcodes
1187
+ *
1188
+ * @return string $content Content after shortcodes have been run whilst ignoring conflicting shortcodes.
1189
+ */
1190
+ function aioseop_do_shortcode_helper( $content, $conflicting_shortcodes ) {
1191
+
1192
+ foreach ( $conflicting_shortcodes as $shortcode_tag => $shortcode_callback ) {
1193
+ remove_shortcode( $shortcode_tag );
1194
+ }
1195
+
1196
+ $content = do_shortcode( $content );
1197
+
1198
+ // Adds shortcodes back since remove_shortcode() disables them site-wide.
1199
+ foreach ( $conflicting_shortcodes as $shortcode_tag => $shortcode_callback ) {
1200
+ add_shortcode( $shortcode_tag, $shortcode_callback );
1201
+ }
1202
+
1203
+ return $content;
1204
+ }
inc/aioseop_updates_class.php CHANGED
@@ -76,7 +76,7 @@ class AIOSEOP_Updates {
76
  if ( get_transient( '_aioseop_activation_redirect' ) ) {
77
  delete_transient( '_aioseop_activation_redirect' );
78
  $aioseop_welcome = new aioseop_welcome();
79
- $aioseop_welcome->init( TRUE );
80
  }
81
 
82
  }
@@ -121,6 +121,12 @@ class AIOSEOP_Updates {
121
  $this->bad_bots_remove_semrush_201810();
122
  }
123
 
 
 
 
 
 
 
124
  }
125
 
126
  /**
@@ -204,7 +210,7 @@ class AIOSEOP_Updates {
204
  * Removes semrush from bad bot blocker.
205
  *
206
  * @since 2.9
207
- * @global @aiosp, @aioseop_options
208
  */
209
  function bad_bots_remove_semrush_201810() {
210
  global $aiosp, $aioseop_options;
@@ -224,6 +230,55 @@ class AIOSEOP_Updates {
224
  }
225
  }
226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  /**
228
  * Updates features.
229
  *
76
  if ( get_transient( '_aioseop_activation_redirect' ) ) {
77
  delete_transient( '_aioseop_activation_redirect' );
78
  $aioseop_welcome = new aioseop_welcome();
79
+ $aioseop_welcome->init( true );
80
  }
81
 
82
  }
121
  $this->bad_bots_remove_semrush_201810();
122
  }
123
 
124
+ if (
125
+ version_compare( $old_version, '3.0', '<' )
126
+ ) {
127
+ $this->bad_bots_remove_exabot_201902();
128
+ $this->sitemap_excl_terms_201905();
129
+ }
130
  }
131
 
132
  /**
210
  * Removes semrush from bad bot blocker.
211
  *
212
  * @since 2.9
213
+ * @global $aiosp, $aioseop_options
214
  */
215
  function bad_bots_remove_semrush_201810() {
216
  global $aiosp, $aioseop_options;
230
  }
231
  }
232
 
233
+ /**
234
+ * Removes Exabot from bad bot blocker to allow Alexabot. (#2105)
235
+ *
236
+ * @since 3.0
237
+ * @global $aiosp, $aioseop_options
238
+ */
239
+ function bad_bots_remove_exabot_201902() {
240
+ global $aiosp, $aioseop_options;
241
+
242
+ if ( isset( $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] ) ) {
243
+ $list = $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'];
244
+ $list = str_replace(
245
+ array(
246
+ "Exabot\r\n",
247
+ "Exabot\n",
248
+ ), '', $list
249
+ );
250
+ $aioseop_options['modules']['aiosp_bad_robots_options']['aiosp_bad_robots_blocklist'] = $list;
251
+ update_option( 'aioseop_options', $aioseop_options );
252
+ $aiosp->update_class_option( $aioseop_options );
253
+ }
254
+ }
255
+
256
+ /**
257
+ * Converts excl_categories to excl_terms
258
+ *
259
+ * @since 3.0
260
+ * @global $aiosp, $aioseop_options
261
+ */
262
+ public function sitemap_excl_terms_201905() {
263
+ global $aiosp, $aioseop_options;
264
+ $aioseop_options = aioseop_get_options();
265
+ if ( ! isset( $aioseop_options['modules'] ) && ! isset( $aioseop_options['modules']['aiosp_sitemap_options'] ) ) {
266
+ return;
267
+ }
268
+
269
+ $options = $aioseop_options['modules']['aiosp_sitemap_options'];
270
+
271
+ if ( ! empty( $options['aiosp_sitemap_excl_categories'] ) ) {
272
+ $options['aiosp_sitemap_excl_terms']['category']['taxonomy'] = 'category';
273
+ $options['aiosp_sitemap_excl_terms']['category']['terms'] = $options['aiosp_sitemap_excl_categories'];
274
+ unset( $options['aiosp_sitemap_excl_categories'] );
275
+
276
+ $aioseop_options['modules']['aiosp_sitemap_options'] = $options;
277
+
278
+ $aiosp->update_class_option( $aioseop_options );
279
+ }
280
+ }
281
+
282
  /**
283
  * Updates features.
284
  *
inc/commonstrings.php CHANGED
@@ -12,64 +12,113 @@ class AIOSP_Common_Strings {
12
  /**
13
  * AIOSP_Common_Strings constructor.
14
  *
15
- * We'll just put all the strings in the contruct for lack of a better.
16
  */
17
 
18
  private function __construct() {
19
 
20
- // Video sitemap strings.
21
- __( 'Video Sitemap', 'all-in-one-seo-pack' );
22
- __( 'Show Only Posts With Videos', 'all-in-one-seo-pack' );
23
- __( 'Restrict Access to Video Sitemap', 'all-in-one-seo-pack' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  __( 'If checked, only posts that have videos in them will be displayed on the sitemap.', 'all-in-one-seo-pack' );
25
- __( 'Enable this option to only allow access to your sitemap by site administrators and major search engines.', 'all-in-one-seo-pack' );
26
- __( 'You do not have access to this page; try logging in as an administrator.', 'all-in-one-seo-pack' );
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- // Update checker strings (incomplete... need to separate out html).
29
- __( 'Purchase one now', 'all-in-one-seo-pack' );
30
- __( 'License Key is not set yet or invalid. ', 'all-in-one-seo-pack' );
31
- /* translators: Please mind the space at the beginning of the string. */
32
- __( ' Need a license key?', 'all-in-one-seo-pack' );
33
- __( 'Notice: ', 'all-in-one-seo-pack' );
34
- __( 'Manage Licenses', 'all-in-one-seo-pack' );
35
 
36
- // These are Pro option strings.
37
  __( 'Show SEO News', 'all-in-one-seo-pack' );
38
  __( 'Display Menu In Admin Bar:', 'all-in-one-seo-pack' );
39
  __( 'Display Menu At The Top:', 'all-in-one-seo-pack' );
40
- __( 'This displays an SEO News widget on the dashboard.', 'all-in-one-seo-pack' );
41
- __( 'Check this to add All in One SEO Pack to the Admin Bar for easy access to your SEO settings.', 'all-in-one-seo-pack' );
42
- __( 'Check this to move the All in One SEO Pack menu item to the top of your WordPress Dashboard menu.', 'all-in-one-seo-pack' );
43
- __( '%s is almost ready.', 'all-in-one-seo-pack' );
44
- __( 'You must <a href="%s">enter a valid License Key</a> for it to work.', 'all-in-one-seo-pack' );
45
- __( "There is a new version of %1\$s available. Go to <a href='%2\$s'>the plugins page</a> for details.", 'all-in-one-seo-pack' );
46
- sprintf( __( 'Your license has expired. Please %1$s click here %2$s to purchase a new one.', 'all-in-one-seo-pack' ), '<a href="https://semperplugins.com/all-in-one-seo-pack-pro-version/" target="_blank">', '</a>' );
47
  __( 'Track Outbound Forms:', 'all-in-one-seo-pack' );
48
  __( 'Track Events:', 'all-in-one-seo-pack' );
49
- __( 'Track URL Changes:', 'all-in-one-seo-pack' );
50
  __( 'Track Page Visibility:', 'all-in-one-seo-pack' );
51
  __( 'Track Media Query:', 'all-in-one-seo-pack' );
52
  __( 'Track Elements Visibility:', 'all-in-one-seo-pack' );
53
  __( 'Track Page Scrolling:', 'all-in-one-seo-pack' );
54
  __( 'Track Facebook and Twitter:', 'all-in-one-seo-pack' );
55
  __( 'Ensure URL Consistency:', 'all-in-one-seo-pack' );
56
- __( 'Check this if you want to track outbound forms with Google Analytics.', 'all-in-one-seo-pack' );
57
- __( 'Check this if you want to track events with Google Analytics.', 'all-in-one-seo-pack' );
58
- __( 'Check this if you want to track URL changes for single pages with Google Analytics.', 'all-in-one-seo-pack' );
59
- __( 'Check this if you want to track how long pages are in visible state with Google Analytics.', 'all-in-one-seo-pack' );
60
 
61
- /*
62
- Translators: 'This option allows users to track media queries, allowing them to find out if users are viewing a responsive layout or not and which layout changes
63
- have been applied if the browser window has been resized by the user, see https://github.com/googleanalytics/autotrack/blob/master/docs/plugins/media-query-tracker.md.
64
- */
65
- __( 'Check this if you want to track media query matching and queries with Google Analytics.', 'all-in-one-seo-pack' );
 
 
 
 
 
 
 
 
 
66
 
67
- /*
68
- Translators: The term 'viewport' refers to the area of the page that is visible to the user, see https://www.w3schools.com/css/css_rwd_viewport.asp.
69
- */
70
- __( 'Check this if you want to track when elements are visible within the viewport with Google Analytics.', 'all-in-one-seo-pack' );
71
- __( 'Check this if you want to ensure consistency in URL paths reported to Google Analytics.', 'all-in-one-seo-pack' );
72
- __( 'Check this if you want to track how far down a user scrolls a page with Google Analytics.', 'all-in-one-seo-pack' );
73
- __( 'Check this if you want to track interactions with the official Facebook and Twitter widgets with Google Analytics.', 'all-in-one-seo-pack' );
 
 
74
  }
75
  }
12
  /**
13
  * AIOSP_Common_Strings constructor.
14
  *
15
+ * We'll just put all the strings in the contruct for lack of a better place.
16
  */
17
 
18
  private function __construct() {
19
 
20
+ // From aioseop-helper-filters.php.
21
+ __( 'This will be the license key received when the product was purchased. This is used for automatic upgrades.', 'all-in-one-seo-pack' );
22
+ /* 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. */
23
+ __( 'Use these checkboxes to select which Taxonomies you want to use %s with.', 'all-in-one-seo-pack' );
24
+ __( 'This displays an SEO News widget on the dashboard.', 'all-in-one-seo-pack' );
25
+ /* 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. */
26
+ __( 'Check this to add %s to the Admin Bar for easy access to your SEO settings.', 'all-in-one-seo-pack' );
27
+ /* 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. */
28
+ __( 'Check this to move the %s menu item to the top of your WordPress Dashboard menu.', 'all-in-one-seo-pack' );
29
+ __( 'Check this if you want to track outbound forms with Google Analytics.', 'all-in-one-seo-pack' );
30
+ __( 'Check this if you want to track events with Google Analytics.', 'all-in-one-seo-pack' );
31
+ __( 'Check this if you want to track url changes for single pages with Google Analytics.', 'all-in-one-seo-pack' );
32
+ __( 'Check this if you want to track how long pages are in visible state with Google Analytics.', 'all-in-one-seo-pack' );
33
+ /* translators: 'This option allows users to track media queries, allowing them to find out if users are viewing a responsive layout or not and which layout changes have been applied if the browser window has been resized by the user, see https://github.com/googleanalytics/autotrack/blob/master/docs/plugins/media-query-tracker.md. */
34
+ __( 'Check this if you want to track media query matching and queries with Google Analytics.', 'all-in-one-seo-pack' );
35
+ /* translators: The term "viewport" refers to the area of the page that is visible to the user, see https://www.w3schools.com/css/css_rwd_viewport.asp. */
36
+ __( 'Check this if you want to track when elements are visible within the viewport with Google Analytics.', 'all-in-one-seo-pack' );
37
+ __( 'Check this if you want to track how far down a user scrolls a page with Google Analytics.', 'all-in-one-seo-pack' );
38
+ __( 'Check this if you want to track interactions with the official Facebook and Twitter widgets with Google Analytics.', 'all-in-one-seo-pack' );
39
+ __( 'Check this if you want to ensure consistency in URL paths reported to Google Analytics.', 'all-in-one-seo-pack' );
40
+ __( 'Your site title', 'all-in-one-seo-pack' );
41
+ __( 'Your site description', 'all-in-one-seo-pack' );
42
+
43
+ /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with a noun. */
44
+ __( 'The original title of the %s', 'all-in-one-seo-pack' );
45
+ /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with a noun. */
46
+ __( 'The description of the %s', 'all-in-one-seo-pack' );
47
+ __( 'Taxonomy', 'all-in-one-seo-pack' );
48
+ __( 'The following macros are supported:', 'all-in-one-seo-pack' );
49
+ __( 'Click here for documentation on this setting', 'all-in-one-seo-pack' );
50
+ __( 'Click here for documentation on this setting.', 'all-in-one-seo-pack' );
51
+ __( 'Create RSS Sitemap as well.', 'all-in-one-seo-pack' );
52
+ __( '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' );
53
+ __( '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' );
54
+ __( 'Allows you to specify the maximum number of posts in a sitemap (up to 50,000).', 'all-in-one-seo-pack' );
55
+ __( 'Select which Post Types appear in your sitemap.', 'all-in-one-seo-pack' );
56
+ __( 'Select which taxonomy archives appear in your sitemap', 'all-in-one-seo-pack' );
57
+ __( 'Include Date Archives in your sitemap.', 'all-in-one-seo-pack' );
58
+ __( 'Include Author Archives in your sitemap.', 'all-in-one-seo-pack' );
59
+ __( 'Exclude Images in your sitemap.', 'all-in-one-seo-pack' );
60
+ __( 'Create a compressed sitemap file in .xml.gz format.', 'all-in-one-seo-pack' );
61
+ __( 'Places a link to your Sitemap.xml into your virtual Robots.txt file.', 'all-in-one-seo-pack' );
62
+ __( 'Dynamically creates the XML sitemap instead of using a static file.', 'all-in-one-seo-pack' );
63
  __( 'If checked, only posts that have videos in them will be displayed on the sitemap.', 'all-in-one-seo-pack' );
64
+ __( 'Enable this option to look for videos in custom fields as well.', 'all-in-one-seo-pack' );
65
+ __( 'URL to the page. This field accepts relative URLs or absolute URLs with the protocol specified.', 'all-in-one-seo-pack' );
66
+ __( 'The priority of the page.', 'all-in-one-seo-pack' );
67
+ __( 'The frequency of the page.', 'all-in-one-seo-pack' );
68
+ __( 'Last modified date of the page.', 'all-in-one-seo-pack' );
69
+ __( 'Entries from these taxonomy terms will be excluded from the sitemap.', 'all-in-one-seo-pack' );
70
+ __( 'Use page slugs or page IDs, separated by commas, to exclude pages from the sitemap.', 'all-in-one-seo-pack' );
71
+ /* translators: %1$s and %2$s are placeholders, which means that it should not be translated. They will be replaced with nouns in the application. */
72
+ __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' );
73
+ __( 'priority', 'all-in-one-seo-pack' );
74
+ __( 'Homepage', 'all-in-one-seo-pack' );
75
+ __( 'Post', 'all-in-one-seo-pack' );
76
+ __( 'Taxonomies', 'all-in-one-seo-pack' );
77
+ __( 'Archive Pages', 'all-in-one-seo-pack' );
78
+ __( 'Author Pages', 'all-in-one-seo-pack' );
79
 
80
+ // From aioseop_taxonomy_functions.php.
81
+ __( 'SEO Title', 'all-in-one-seo-pack' );
82
+ __( 'SEO Description', 'all-in-one-seo-pack' );
83
+ __( 'SEO Keywords', 'all-in-one-seo-pack' );
 
 
 
84
 
85
+ // From functions_general.php.
86
  __( 'Show SEO News', 'all-in-one-seo-pack' );
87
  __( 'Display Menu In Admin Bar:', 'all-in-one-seo-pack' );
88
  __( 'Display Menu At The Top:', 'all-in-one-seo-pack' );
 
 
 
 
 
 
 
89
  __( 'Track Outbound Forms:', 'all-in-one-seo-pack' );
90
  __( 'Track Events:', 'all-in-one-seo-pack' );
91
+ __( 'Track Url Changes:', 'all-in-one-seo-pack' );
92
  __( 'Track Page Visibility:', 'all-in-one-seo-pack' );
93
  __( 'Track Media Query:', 'all-in-one-seo-pack' );
94
  __( 'Track Elements Visibility:', 'all-in-one-seo-pack' );
95
  __( 'Track Page Scrolling:', 'all-in-one-seo-pack' );
96
  __( 'Track Facebook and Twitter:', 'all-in-one-seo-pack' );
97
  __( 'Ensure URL Consistency:', 'all-in-one-seo-pack' );
 
 
 
 
98
 
99
+ // From sfwd_update_checker.php.
100
+ __( '%s is almost ready.', 'all-in-one-seo-pack' );
101
+ /* translators: leave all the code inside the brackets < and > unchanged.*/
102
+ __( 'You must <a href="%s">enter a valid License Key</a> for it to work.', 'all-in-one-seo-pack' );
103
+ __( 'Need a license key?', 'all-in-one-seo-pack' );
104
+ __( 'Purchase one now', 'all-in-one-seo-pack' );
105
+ /* translators: leave all the code inside the brackets < and > unchanged.*/
106
+ __( "There is a new version of %1\$s available. Go to <a href='%2\$s'>the plugins page</a> for details.", 'all-in-one-seo-pack' );
107
+ /* translators: %1$s and %2$s are placeholders, which means that it should not be translated. They will be replaced with nouns in the application. */
108
+ __( 'Your license has expired. Please %1$s click here %2$s to purchase a new one.', 'all-in-one-seo-pack' );
109
+ __( 'Manage Licenses', 'all-in-one-seo-pack' );
110
+ __( 'License Key is not set yet or invalid. ', 'all-in-one-seo-pack' );
111
+ /* transalators: Following this alert is the text of the notice. For example... "Notice: you have not entered a valid license key". */
112
+ __( 'Notice: ', 'all-in-one-seo-pack' );
113
 
114
+ // From video_sitemap.php.
115
+ __( 'Video Sitemap', 'all-in-one-seo-pack' );
116
+ __( 'Show Only Posts With Videos', 'all-in-one-seo-pack' );
117
+ __( 'Include Custom Fields', 'all-in-one-seo-pack' );
118
+ __( 'Video sitemap scan completed successfully!', 'all-in-one-seo-pack' );
119
+ /* translators: This expression means "a small period/brief period of time". */
120
+ __( 'a short while', 'all-in-one-seo-pack' );
121
+ /* translators: %s is a placeholder, which means that it should not be translated. It will be replaced with a period of time, such as "5 minutes" or "a short while". */
122
+ __( 'Video sitemap scan in progress. Please check again in %s.', 'all-in-one-seo-pack' );
123
  }
124
  }
inc/compatability/abstract/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
inc/compatability/compat-init.php CHANGED
@@ -108,6 +108,14 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Compatibility' ) ) {
108
  return '';
109
  }
110
 
 
 
 
 
 
 
 
 
111
  return $ver_tag;
112
 
113
  }
108
  return '';
109
  }
110
 
111
+ if ( isset( $aioseop_options['aiosp_yandex_verify'] ) && ! empty( $aioseop_options['aiosp_yandex_verify'] ) && strpos( $ver_tag, 'yandex-verification' ) ) {
112
+ return '';
113
+ }
114
+
115
+ if ( isset( $aioseop_options['aiosp_baidu_verify'] ) && ! empty( $aioseop_options['aiosp_baidu_verify'] ) && strpos( $ver_tag, 'baidu-site-verification' ) ) {
116
+ return '';
117
+ }
118
+
119
  return $ver_tag;
120
 
121
  }
inc/compatability/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
inc/extlib/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
inc/sitemap-xsl.php CHANGED
@@ -89,12 +89,12 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
89
  <div id="content">
90
  <div id="content-head">
91
  <h1>XML Sitemap</h1>
92
- <p>Generated by <a href="https://semperplugins.com">All in One </a> <a href="https://semperplugins.com/all-in-one-seo-pack-pro-version/">SEO</a>, this is an XML Sitemap, meant to be consumed by search engines like Google or Bing.<br/>
93
- You can find more information about XML sitemaps at <a href="http://sitemaps.org">sitemaps.org</a>.</p>
94
  <p><xsl:choose>
95
  <xsl:when test="$fileType='Sitemap'">
96
- This sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"></xsl:value-of> URLs</xsl:when>
97
- <xsl:otherwise>This sitemap index contains <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"></xsl:value-of> sitemaps</xsl:otherwise>
98
  </xsl:choose></p>
99
  </div>
100
  <xsl:choose>
@@ -111,7 +111,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
111
  <thead>
112
  <tr>
113
  <th width="50%">URL</th>
114
- <th>LastChange</th>
115
  </tr>
116
  </thead>
117
  <tbody>
89
  <div id="content">
90
  <div id="content-head">
91
  <h1>XML Sitemap</h1>
92
+ <p><?php echo __( 'Generated by', 'all-in-one-seo-pack' ); ?> <a href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_sitemap" target="_blank"><?php echo AIOSEOP_PLUGIN_NAME; ?></a>, <?php echo __( 'this is an XML Sitemap, meant to be consumed by search engines like Google or Bing.', 'all-in-one-seo-pack' ); ?><br/>
93
+ <?php echo __( 'You can find more information about XML sitemaps at <a href="http://sitemaps.org">sitemaps.org</a>', 'all-in-one-seo-pack' ); ?>.</p>
94
  <p><xsl:choose>
95
  <xsl:when test="$fileType='Sitemap'">
96
+ <?php echo __( 'This sitemap contains', 'all-in-one-seo-pack' ); ?> <xsl:value-of select="count(sitemap:urlset/sitemap:url)"></xsl:value-of> <?php echo __( 'URLs', 'all-in-one-seo-pack' ); ?>.</xsl:when>
97
+ <xsl:otherwise><?php echo __( 'This sitemap index contains', 'all-in-one-seo-pack' ); ?> <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"></xsl:value-of> <?php echo __( 'sitemaps', 'all-in-one-seo-pack' ); ?>.</xsl:otherwise>
98
  </xsl:choose></p>
99
  </div>
100
  <xsl:choose>
111
  <thead>
112
  <tr>
113
  <th width="50%">URL</th>
114
+ <th>Last Change</th>
115
  </tr>
116
  </thead>
117
  <tbody>
inc/translations.php CHANGED
@@ -23,15 +23,10 @@ if ( ! class_exists( 'AIOSEOP_Translations' ) ) :
23
  * @var string $wplocale Information for a particular locale (in loop)
24
  */
25
  public $wplocale = '';
26
-
27
  public $translated_count = 0;
28
-
29
  public $translation_url = 'https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack';
30
-
31
  public $slug = '';
32
-
33
  public $percent_translated = '';
34
-
35
  public $native_name = '';
36
 
37
  /**
@@ -66,7 +61,6 @@ if ( ! class_exists( 'AIOSEOP_Translations' ) ) :
66
  if ( is_wp_error( $response ) ) {
67
  return false;
68
  }
69
-
70
  return $response['body'];
71
  }
72
 
@@ -75,38 +69,60 @@ if ( ! class_exists( 'AIOSEOP_Translations' ) ) :
75
  *
76
  * @since 2.3.5
77
  *
78
- * @param $locales
 
 
 
 
 
79
  */
80
  private function set_current_locale_data( $locales ) {
81
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  // Some locales are missing the locale code (wp_locale) so we need to check for that.
83
  foreach ( $locales as $locale ) {
84
 
85
- $wplocale = '';
86
 
 
87
  if ( isset( $locale->wp_locale ) ) {
88
  $wplocale = $locale->wp_locale;
89
  }
90
 
91
- if ( $wplocale === $this->current_locale ) {
92
-
93
- $name = '';
94
- $percent_translated = '';
95
 
96
- if ( isset( $locale->name ) ) {
97
- $name = $locale->name;
98
- }
99
 
100
- if ( isset( $locale->percent_translated ) ) {
101
- $percent_translated = $locale->percent_translated;
102
- }
103
 
104
- $this->name = $name;
105
- $this->wplocale = $wplocale;
106
- $this->percent_translated = $percent_translated;
107
- $this->slug = $locale->locale;
108
 
 
 
109
  }
 
 
 
 
 
110
  }
111
 
112
  }
@@ -142,7 +158,7 @@ if ( ! class_exists( 'AIOSEOP_Translations' ) ) :
142
 
143
  if ( null !== $this->wplocale ) {
144
 
145
- $url = "https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack/dev/$this->slug/default";
146
 
147
  $this->translation_url = $url;
148
  }
@@ -188,7 +204,6 @@ if ( ! class_exists( 'AIOSEOP_Translations' ) ) :
188
  $this->set_current_locale_data( $locales );
189
 
190
  $this->translated_count = $this->count_translated_languages( $locales );
191
-
192
  $this->set_translation_url();
193
 
194
  $this->set_native_language();
23
  * @var string $wplocale Information for a particular locale (in loop)
24
  */
25
  public $wplocale = '';
 
26
  public $translated_count = 0;
 
27
  public $translation_url = 'https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack';
 
28
  public $slug = '';
 
29
  public $percent_translated = '';
 
30
  public $native_name = '';
31
 
32
  /**
61
  if ( is_wp_error( $response ) ) {
62
  return false;
63
  }
 
64
  return $response['body'];
65
  }
66
 
69
  *
70
  * @since 2.3.5
71
  *
72
+ * @param array $locales All locale info for AIOSEOP from translate.wordpress.org.
73
+ * @var object $locale Individual locale info for AIOSEOP from translate.wordpress.org.
74
+ * @var string $wp_locale Locale name from translate.wordpress.org (does not include formal designation).
75
+ * @var string $formal Indication of whether currently active locale is formal.
76
+ * @var string $slug Indication of whether locale from translate.wordpress.org is formal.
77
+ * @var string $current_locale Currently active locale.
78
  */
79
  private function set_current_locale_data( $locales ) {
80
 
81
+ $current_locale = $this->current_locale;
82
+
83
+ if ( strpos( $current_locale, '_formal' ) ) {
84
+ $this->formal = 'formal';
85
+ $formal = 'formal';
86
+ $short_locale = $this->short_locale = str_replace( '_formal', '', $current_locale );
87
+ } else {
88
+ $short_locale = $current_locale;
89
+ $this->formal = 'default';
90
+ $formal = 'default';
91
+ }
92
+
93
  // Some locales are missing the locale code (wp_locale) so we need to check for that.
94
  foreach ( $locales as $locale ) {
95
 
96
+ $slug = $locale->slug;
97
 
98
+ $wplocale = '';
99
  if ( isset( $locale->wp_locale ) ) {
100
  $wplocale = $locale->wp_locale;
101
  }
102
 
103
+ if ( $short_locale !== $wplocale ) {
104
+ continue;
105
+ }
 
106
 
107
+ if ( $formal !== $slug ) {
108
+ continue;
109
+ }
110
 
111
+ $name = '';
112
+ $percent_translated = '';
 
113
 
114
+ if ( isset( $locale->name ) ) {
115
+ $name = $locale->name;
116
+ }
 
117
 
118
+ if ( isset( $locale->percent_translated ) ) {
119
+ $percent_translated = $locale->percent_translated;
120
  }
121
+
122
+ $this->name = $name;
123
+ $this->wplocale = $wplocale;
124
+ $this->percent_translated = $percent_translated;
125
+ $this->slug = $locale->locale;
126
  }
127
 
128
  }
158
 
159
  if ( null !== $this->wplocale ) {
160
 
161
+ $url = "https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack/dev/$this->slug/$this->formal/?filters%5Bstatus%5D=untranslated&sort%5Bby%5D=priority&sort%5Bhow%5D=desc";
162
 
163
  $this->translation_url = $url;
164
  }
204
  $this->set_current_locale_data( $locales );
205
 
206
  $this->translated_count = $this->count_translated_languages( $locales );
 
207
  $this->set_translation_url();
208
 
209
  $this->set_native_language();
js/admin-notice.js ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Admin Notices for AIOSEOP.
3
+ *
4
+ * @summary Handles the AJAX Actions with AIOSEOP_Notices
5
+ *
6
+ * @since 2.4.2
7
+ * @package all-in-one-seo-pack
8
+ */
9
+ // phpcs:disable PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket
10
+ // phpcs:disable PEAR.Functions.FunctionCallSignature.MultipleArguments
11
+ // phpcs:disable PEAR.Functions.FunctionCallSignature.CloseBracketLine
12
+ /* global aioseop_notice_data */
13
+ (function($) {
14
+
15
+ /**
16
+ * Notice Delay - AJAX Action
17
+ *
18
+ * @summary Sets up the Delay Button listeners
19
+ *
20
+ * @since 2.4.2
21
+ * @access public
22
+ *
23
+ * @global string $aioseop_notice_data.notice_nonce
24
+ * @listens aioseop-notice-delay-{notice_slug}-{delay_index}:click
25
+ *
26
+ * @param string noticeSlug
27
+ * @param string delayIndex
28
+ */
29
+ function aioseop_notice_delay_ajax_action( noticeSlug, delayIndex ) {
30
+ var noticeNonce = aioseop_notice_data.notice_nonce;
31
+ var noticeDelayID = "#aioseop-notice-delay-" + noticeSlug + "-" + delayIndex;
32
+ $( noticeDelayID ).on( "click", function( event ) {
33
+ var elem_href = $( this ).attr( "href" );
34
+ if ( "#" === elem_href || "" === elem_href ) {
35
+ // Stops automatic actions.
36
+ event.stopPropagation();
37
+ event.preventDefault();
38
+ }
39
+
40
+ var formData = new FormData();
41
+ formData.append( "notice_slug", noticeSlug );
42
+ formData.append( "action_index", delayIndex );
43
+
44
+ formData.append( "action", "aioseop_notice" );
45
+ formData.append( "_ajax_nonce", noticeNonce );
46
+ $.ajax({
47
+ url: ajaxurl,
48
+ type: "POST",
49
+ data: formData,
50
+ cache: false,
51
+ dataType: "json",
52
+ processData: false,
53
+ contentType: false,
54
+
55
+ success: function( data, textStatus, jqXHR ){
56
+ var noticeContainer = ".aioseop-notice-" + noticeSlug;
57
+ $( noticeContainer ).remove();
58
+ }
59
+ });
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Notice Delay - WP Default AJAX Action
65
+ *
66
+ * @summary
67
+ *
68
+ * @since 2.4.2
69
+ * @access public
70
+ *
71
+ * @global string $aioseop_notice_data.notice_nonce
72
+ * @listens aioseop-notice-delay-{notice_slug}-{delay_index}:click
73
+ *
74
+ * @param string noticeSlug
75
+ */
76
+ function aioseop_notice_delay_wp_default_dismiss_ajax_action( noticeSlug ) {
77
+ var noticeNonce = aioseop_notice_data.notice_nonce;
78
+ var noticeContainer = ".aioseop-notice-" + noticeSlug;
79
+ $( noticeContainer ).on( "click", "button.notice-dismiss ", function( event ) {
80
+ // Prevents any unwanted actions.
81
+ event.stopPropagation();
82
+ event.preventDefault();
83
+
84
+ var formData = new FormData();
85
+ formData.append( "notice_slug", noticeSlug );
86
+ formData.append( "action_index", "default" );
87
+
88
+ formData.append( "action", "aioseop_notice" );
89
+ formData.append( "_ajax_nonce", noticeNonce );
90
+ $.ajax({
91
+ url: ajaxurl,
92
+ type: "POST",
93
+ data: formData,
94
+ cache: false,
95
+ dataType: "json",
96
+ processData: false,
97
+ contentType: false
98
+ });
99
+ });
100
+ }
101
+
102
+ /**
103
+ * INITIALIZE NOTICE JS
104
+ *
105
+ * Constructs the actions the user may perform.
106
+ */
107
+ var noticeDelays = aioseop_notice_data.notice_actions;
108
+
109
+ $.each( noticeDelays, function ( k1NoticeSlug, v1DelayArr ) {
110
+ $.each( v1DelayArr, function ( k2I, v2DelayIndex ) {
111
+ aioseop_notice_delay_ajax_action( k1NoticeSlug, v2DelayIndex );
112
+ });
113
+
114
+ // Default WP action for Dismiss Button on Upper-Right.
115
+ aioseop_notice_delay_wp_default_dismiss_ajax_action( k1NoticeSlug );
116
+ });
117
+ }(jQuery));
118
+ // phpcs:enable
js/admin-notice.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(i){var a=aioseop_notice_data.notice_actions;i.each(a,function(n,a){var o,t;i.each(a,function(a,e){var o,t,c;o=n,t=e,c=aioseop_notice_data.notice_nonce,i("#aioseop-notice-delay-"+o+"-"+t).on("click",function(a){var e=i(this).attr("href");"#"!==e&&""!==e||(a.stopPropagation(),a.preventDefault());var n=new FormData;n.append("notice_slug",o),n.append("action_index",t),n.append("action","aioseop_notice"),n.append("_ajax_nonce",c),i.ajax({url:ajaxurl,type:"POST",data:n,cache:!1,dataType:"json",processData:!1,contentType:!1,success:function(a,e,n){i(".aioseop-notice-"+o).remove()}})})}),o=n,t=aioseop_notice_data.notice_nonce,i(".aioseop-notice-"+o).on("click","button.notice-dismiss ",function(a){a.stopPropagation(),a.preventDefault();var e=new FormData;e.append("notice_slug",o),e.append("action_index","default"),e.append("action","aioseop_notice"),e.append("_ajax_nonce",t),i.ajax({url:ajaxurl,type:"POST",data:e,cache:!1,dataType:"json",processData:!1,contentType:!1})})})}(jQuery);
js/aioseop-helper.js ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Use for JavaScript compatability by using anonymous functions; which
3
+ * are loaded into the footer.
4
+ *
5
+ * @summary AIOSEOP Footer JS
6
+ *
7
+ * @since 2.4.2
8
+ */
9
+ (function($) {
10
+ /**
11
+ * jQuery UI Tooltips
12
+ *
13
+ * Initiates the jQuery UI Tooltips on the admin pages with the class and
14
+ * title attributes set properly.
15
+ *
16
+ * @see StackOverflow - Specify jQuery UI Tooltip CSS styles
17
+ * @link https://stackoverflow.com/questions/14445785/specify-jquery-ui-tooltip-css-styles
18
+ *
19
+ * @since 2.4.1.1
20
+ *
21
+ * @link http://api.jqueryui.com/tooltip/
22
+ */
23
+ function aioseopTooltips() {
24
+ $( ".aioseop_help_text_link" ).tooltip({
25
+ // Documentation recommends using classes, as tooltipClass is marked as deprecated.
26
+ // However, tooltipClass is the only working method. So, both methods are included.
27
+ classes: {
28
+ "ui-tooltip": "ui-corner-all ui-widget-content aioseop-ui-tooltip"
29
+ },
30
+ tooltipClass: "aioseop-ui-tooltip",
31
+ open: function( event, ui ) {
32
+ ui.tooltip.css( "min-width", "170px" );
33
+ ui.tooltip.css( "max-width", "396px" );
34
+
35
+ if ( 'undefined' === typeof( event.originalEvent ) ) {
36
+ return false;
37
+ }
38
+
39
+ var $id = $( ui.tooltip ).attr( 'id' );
40
+
41
+ // Close any lingering tooltips.
42
+ $( 'div.ui-tooltip' ).not( '#' + $id ).remove();
43
+
44
+ // AJAX function to pull in data and add it to the tooltip goes here.
45
+ },
46
+ close: function( event, ui ) {
47
+ ui.tooltip.hover(
48
+ function() {
49
+ $( this ).stop( true ).fadeTo( 400, 1 );
50
+ },
51
+ function() {
52
+ $( this ).fadeOut( '400', function() {
53
+ $( this ).remove();
54
+ });
55
+ }
56
+ );
57
+ },
58
+ content: function( callback ) {
59
+ callback( $( this ).prop( "title" ) );
60
+ }
61
+ });
62
+ }
63
+
64
+ aioseopTooltips();
65
+ }(jQuery));
js/aioseop-helper.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(n){n(".aioseop_help_text_link").tooltip({classes:{"ui-tooltip":"ui-corner-all ui-widget-content aioseop-ui-tooltip"},tooltipClass:"aioseop-ui-tooltip",open:function(t,o){if(o.tooltip.css("min-width","170px"),o.tooltip.css("max-width","396px"),void 0===t.originalEvent)return!1;var i=n(o.tooltip).attr("id");n("div.ui-tooltip").not("#"+i).remove()},close:function(t,o){o.tooltip.hover(function(){n(this).stop(!0).fadeTo(400,1)},function(){n(this).fadeOut("400",function(){n(this).remove()})})},content:function(t){t(n(this).prop("title"))}})}(jQuery);
js/aioseop-menu.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * AIOSEOP menu.
3
+ *
4
+ * Contains all functions that affect the AIOSEOP menu in the sidebar.
5
+ *
6
+ * @since 3.0
7
+ * @package all-in-one-seo-pack
8
+ */
9
+ (function($) {
10
+
11
+ /**
12
+ * Opens Upgrade to Pro link in AIOSEOP menu as new tab.
13
+ */
14
+ function upgrade_link_aioseop_menu_new_tab() {
15
+ $('#toplevel_page_all-in-one-seo-pack-aioseop_class ul li').last().find('a').attr('target','_blank');
16
+ }
17
+
18
+ upgrade_link_aioseop_menu_new_tab();
19
+
20
+ }(jQuery));
js/aioseop-menu.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery("#toplevel_page_all-in-one-seo-pack-aioseop_class ul li").last().find("a").attr("target","_blank");
js/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
js/modules/aioseop_module.js CHANGED
@@ -540,31 +540,10 @@ jQuery( document ).ready(
540
  }
541
  );
542
 
543
- /**
544
- * @since 1.0.0
545
- */
546
- jQuery( ".aioseop_tab:not(:first)" ).hide();
547
-
548
- /**
549
- * @since 1.0.0
550
- */
551
- jQuery( ".aioseop_tab:first" ).show();
552
-
553
- /**
554
- * @since 1.0.0
555
- * @return boolean.
556
- */
557
- jQuery( "a.aioseop_header_tab" ).click(
558
- function() {
559
- var stringref = jQuery( this ).attr( "href" ).split( '#' )[1];
560
- jQuery( '.aioseop_tab:not(#' + stringref + ')' ).hide( 'slow' );
561
- jQuery( '.aioseop_tab#' + stringref ).show( 'slow' );
562
- jQuery( '.aioseop_header_tab[href!="#' + stringref + '"]' ).removeClass( 'active' );
563
- jQuery( '.aioseop_header_tab[href="#' + stringref + '"]' ).addClass( 'active' );
564
- return false;
565
- }
566
- );
567
-
568
 
569
  jQuery( "div#aiosp_robots_default_metabox" )
570
  .delegate(
540
  }
541
  );
542
 
543
+ jQuery('.aioseop_tabs').tabs({
544
+ hide: true,
545
+ show: true
546
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
 
548
  jQuery( "div#aiosp_robots_default_metabox" )
549
  .delegate(
js/modules/aioseop_module.min.js CHANGED
@@ -1 +1 @@
1
- function toggleVisibility(e){var a=document.getElementById(e);"block"===a.style.display?a.style.display="none":a.style.display="block"}function aioseop_get_field_value(e){if(0===e.length)return e;var a=jQuery("[name="+e+"]");if(0===a.length)return e;var o=a.attr("type");return"checkbox"!==o&&"radio"!==o||(a=jQuery("input[name="+e+"]:checked")),a.val()}function aioseop_get_field_values(e){var a=[],o=jQuery("[name="+e+"]");if(0===o.length)return e;var t=o.attr("type");return"checkbox"!==t&&"radio"!==t||jQuery("input[name="+e+"]:checked").each(function(){a.push(jQuery(this).val())}),a.length<=0&&a.push(o.val()),a}function aioseop_eval_condshow_logic(e){var a,o;if("object"==typeof e)switch(a=e.lhs,o=e.rhs,null!==a&&"object"==typeof a&&(a=aioseop_eval_condshow_logic(a)),null!==o&&"object"==typeof o&&(o=aioseop_eval_condshow_logic(o)),a=aioseop_get_field_value(a),o=aioseop_get_field_value(o),e.op){case"NOT":return!a;case"AND":return a&&o;case"OR":return a||o;case"==":return a===o;case"!=":return a!==o;default:return null}return e}function aioseop_do_condshow_match(e,a){if(void 0===a)return!1;var t=!0;return jQuery.each(a,function(e,a){if("object"==typeof a)aioseop_eval_condshow_logic(a)||(t=!1);else{var o=[];e.match(/\\\[\\\]/)?(o=aioseop_get_field_values(e),jQuery.inArray(a,o,0)<0&&(t=!1)):(o=aioseop_get_field_value(e))!=a&&(t=!1)}}),t?jQuery("#"+e+"_wrapper").show():jQuery("#"+e+"_wrapper").hide(),t}function aioseop_add_condshow_handlers(o,t){void 0!==t&&jQuery.each(t,function(e,a){jQuery("[name="+e+"]").bind("change keyup",function(){aioseop_do_condshow_match(o,t)})})}function aioseop_do_condshow(e){void 0!==aiosp_data.condshow&&jQuery.each(aiosp_data.condshow,function(e,a){aioseop_do_condshow_match(e,a),aioseop_add_condshow_handlers(e,a)})}function aiosp_store_radio(){var e={};jQuery('input[type="radio"]').each(function(){jQuery(this).is(":checked")&&(e[jQuery(this).attr("name")]=jQuery(this).val()),jQuery(document).data("radioshack",e)})}function aiosp_reclick_radio(){var e=jQuery(document).data("radioshack");for(var a in e)jQuery('input[name="'+a+'"]').filter('[value="'+e[a]+'"]').trigger("click");jQuery(".wrap").unbind("mouseup")}function aioseop_handle_ajax_call(e,a,o,t){var i=new sack(ajaxurl);i.execute=1,i.method="POST",i.setVar("action",e),i.setVar("settings",a),i.setVar("options",o),void 0!==t&&(i.onCompletion=t),i.setVar("nonce-aioseop",jQuery('input[name="nonce-aioseop"]').val()),i.setVar("nonce-aioseop-edit",jQuery('input[name="nonce-aioseop-edit"]').val()),i.onError=function(){alert("Ajax error on saving.")},i.runAJAX()}function aioseop_handle_post_url(a,o,t,i,s){jQuery("div#aiosp_"+o).fadeOut("fast",function(){var e='<label class="aioseop_loading aioseop_'+o+'_loading"></label> Please wait...';jQuery("div#aiosp_"+o).fadeIn("fast",function(){s?jQuery.ajax({url:ajaxurl,method:"POST",dataType:"json",data:{action:a,options:t,settings:o,"nonce-aioseop":jQuery('input[name="nonce-aioseop"]').val(),"nonce-aioseop-edit":jQuery('input[name="nonce-aioseop-edit"]').val()},success:function(e){i&&i(e)}}):aioseop_handle_ajax_call(a,o,t,i)}),jQuery("div#aiosp_"+o).html(e)})}function aioseop_is_overflowed(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function aioseop_overflow_border(e){aioseop_is_overflowed(e)?e.className="aioseop_option_div aioseop_overflowed":e.className="aioseop_option_div"}function aiospinitAll(){aiospinitSocialMetaInPosts(jQuery),aiospinitCalendar()}function aiospinitCalendar(){0<jQuery(".aiseop-date").length&&"text"===jQuery(".aiseop-date").eq(0).prop("type").toLowerCase()&&jQuery(".aiseop-date").datepicker({dateFormat:"yy-mm-dd"})}function aiospinitSocialMetaInPosts(a){a('input[name="aioseop_opengraph_settings_customimg_checker"] ~ .aioseop_upload_image_button').on("click",function(e){a('input[name="aioseop_opengraph_settings_image"]').attr("checked",!1)})}"undefined"!=typeof aiosp_data&&(jQuery.each(aiosp_data,function(e,a){0===e?void 0===a.condshow&&(aiosp_data[e].condshow=[]):void 0!==a.condshow&&(aiosp_data[0].condshow=jQuery.merge(aiosp_data[0].condshow,a.condshow))}),aiosp_data=aiosp_data[0]),jQuery(document).ready(function(){"undefined"!=typeof aiosp_data&&void 0!==aiosp_data.condshow&&aioseop_do_condshow(aiosp_data.condshow),jQuery(".aioseop_upload_image_label").on("change",function(){this.checker=jQuery(this).parent().find(".aioseop_upload_image_checker"),0<this.checker.length&&this.checker.val(1)}),jQuery(document).ready(function(e){jQuery(".aioseop_upload_image_button").each(function(){jQuery(this).aioseopImageUploader({success:function(e,a){0<jQuery(a).prev().length&&jQuery(a).prev().val(1)}})})}),jQuery(document).ready(function(){jQuery("#poststuff .aioseop_radio_type input[type='radio']").on("click",function(){var e=jQuery(this).attr("previousValue"),a=jQuery(this).attr("name");void 0!==e?"checked"===e?(jQuery(this).prop("checked",!1),jQuery(this).attr("previousValue",!1)):(jQuery("input[name="+a+"]:radio").attr("previousValue",!1),jQuery(this).attr("previousValue","checked")):jQuery(this).prop("checked")?(jQuery(this).prop("checked",!0),jQuery(this).attr("previousValue","checked")):(jQuery(this).prop("checked",!1),jQuery(this).attr("previousValue",!1))})}),void 0!==aiosp_data.pointers&&jQuery.each(aiosp_data.pointers,function(e,a){"undefined"!==a&&""!==a.pointer_text&&aioseop_show_pointer(e,a)}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-modules-aioseop_feature_manager #aiosp_settings_form .aioseop_settings_left").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),!1}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-modules-aioseop_feature_manager #aiosp_settings_form").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_save_settings","ajax_settings_message",jQuery("form#aiosp_settings_form").serialize(),function(){jQuery(".wp-has-current-submenu").fadeIn("fast",function(){aioseop_handle_ajax_call("aioseop_ajax_get_menu_links","ajax_settings_message",jQuery.param({target:".wp-has-current-submenu > ul"}))})}),!1}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager #aiosp_settings_form .aioseop_settings_left").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),!1}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager #aiosp_settings_form").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_save_settings","ajax_settings_message",jQuery("form#aiosp_settings_form").serialize(),function(){jQuery(".wp-has-current-submenu").fadeIn("fast",function(){aioseop_handle_ajax_call("aioseop_ajax_get_menu_links","ajax_settings_message",jQuery.param({target:".wp-has-current-submenu > ul"}))})}),!1});jQuery("div#aiosp_sitemap_addl_pages_metabox").delegate("input[name='Submit']","click",function(){return aioseop_handle_post_url("aioseop_ajax_save_url","sitemap_addl_pages",jQuery("div#aiosp_sitemap_addl_pages_metabox input, div#aiosp_sitemap_addl_pages_metabox select").serialize()),!1}),jQuery("div#aiosp_video_sitemap_addl_pages_metabox").delegate("input[name='Submit']","click",function(){return aioseop_handle_post_url("aioseop_ajax_save_url","video_sitemap_addl_pages",jQuery("div#aiosp_video_sitemap_addl_pages_metabox input, div#aiosp_video_sitemap_addl_pages_metabox select").serialize()),!1}),jQuery("div#aiosp_sitemap_addl_pages_metabox").delegate("a.aiosp_delete_url","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_delete_url","sitemap_addl_pages",jQuery(this).attr("title")),!1}),jQuery("div#aiosp_video_sitemap_addl_pages_metabox").delegate("a.aiosp_delete_url","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_delete_url","video_sitemap_addl_pages",jQuery(this).attr("title")),!1}),jQuery("div#aiosp_opengraph_scan_header").delegate("input[name='aiosp_opengraph_scan_header']","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_scan_header","opengraph_scan_header",jQuery("div#aiosp_opengraph_scan_header").serialize()),!1}),jQuery('input[name="aiosp_sitemap_posttypes[]"][value="all"], input[name="aiosp_video_sitemap_posttypes[]"][value="all"], input[name="aiosp_sitemap_taxonomies[]"][value="all"], input[name="aiosp_video_sitemap_taxonomies[]"][value="all"]').click(function(){jQuery(this).parents("div:eq(0)").find(":checkbox").prop("checked",this.checked)}),jQuery('input[name="aiosp_sitemap_posttypes[]"][value!="all"], input[name="aiosp_video_sitemap_posttypes[]"][value!="all"], input[name="aiosp_sitemap_taxonomies[]"][value!="all"], input[name="aiosp_video_sitemap_taxonomies[]"][value!="all"]').click(function(){this.checked||jQuery(this).parents("div:eq(0)").find('input[value="all"]:checkbox').prop("checked",this.checked)}),jQuery(".aioseop_tab:not(:first)").hide(),jQuery(".aioseop_tab:first").show(),jQuery("a.aioseop_header_tab").click(function(){var e=jQuery(this).attr("href").split("#")[1];return jQuery(".aioseop_tab:not(#"+e+")").hide("slow"),jQuery(".aioseop_tab#"+e).show("slow"),jQuery('.aioseop_header_tab[href!="#'+e+'"]').removeClass("active"),jQuery('.aioseop_header_tab[href="#'+e+'"]').addClass("active"),!1}),jQuery("div#aiosp_robots_default_metabox").delegate("a.aiosp_robots_delete_rule","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_delete_rule","robots_rules",jQuery(this).attr("data-id"),function(){window.location.reload()}),!1}),jQuery("div#aiosp_robots_default_metabox").delegate("a.aiosp_robots_edit_rule","click",function(e){return e.preventDefault(),jQuery('input[name="aiosp_robots_agent"]').val(jQuery(this).attr("data-agent")),jQuery('select[name="aiosp_robots_type"]').val(jQuery(this).attr("data-type")),jQuery('input[name="aiosp_robots_path"]').val(jQuery(this).attr("data-path")),jQuery("input.add-edit-rule").val(jQuery(".aioseop_table").attr("data-edit-label")),jQuery("input.edit-rule-id").val(jQuery(this).attr("data-id")),!1}),jQuery("a.aiosp_robots_physical").on("click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_robots_physical","robots_physical_import_delete",jQuery(this).attr("data-action"),function(e){e.data&&e.data.message&&alert(e.data.message),window.location.reload()},!0),!1}),aiospinitAll()}),jQuery.fn.aioseopImageUploader=function(e){var a=this;a.options=jQuery.extend({success:void 0},e),a.target=jQuery(a).next(),a.uploader=wp.media({title:"Choose Image",button:{text:"Choose Image"},multiple:!1}),a.onSelect=function(){var e=a.uploader.state().get("selection").first().toJSON().url;0<=a.target.length&&jQuery(a.target).val(e),void 0!==a.options.success&&a.options.success(e,a)},a.onClick=function(e){e.preventDefault(),a.uploader.open()},a.uploader.on("select",a.onSelect),jQuery(a).click(a.onClick)};
1
+ function toggleVisibility(e){var a=document.getElementById(e);"block"===a.style.display?a.style.display="none":a.style.display="block"}function aioseop_get_field_value(e){if(0===e.length)return e;var a=jQuery("[name="+e+"]");if(0===a.length)return e;var o=a.attr("type");return"checkbox"!==o&&"radio"!==o||(a=jQuery("input[name="+e+"]:checked")),a.val()}function aioseop_get_field_values(e){var a=[],o=jQuery("[name="+e+"]");if(0===o.length)return e;var t=o.attr("type");return"checkbox"!==t&&"radio"!==t||jQuery("input[name="+e+"]:checked").each(function(){a.push(jQuery(this).val())}),a.length<=0&&a.push(o.val()),a}function aioseop_eval_condshow_logic(e){var a,o;if("object"==typeof e)switch(a=e.lhs,o=e.rhs,null!==a&&"object"==typeof a&&(a=aioseop_eval_condshow_logic(a)),null!==o&&"object"==typeof o&&(o=aioseop_eval_condshow_logic(o)),a=aioseop_get_field_value(a),o=aioseop_get_field_value(o),e.op){case"NOT":return!a;case"AND":return a&&o;case"OR":return a||o;case"==":return a===o;case"!=":return a!==o;default:return null}return e}function aioseop_do_condshow_match(e,a){if(void 0===a)return!1;var t=!0;return jQuery.each(a,function(e,a){if("object"==typeof a)aioseop_eval_condshow_logic(a)||(t=!1);else{var o=[];e.match(/\\\[\\\]/)?(o=aioseop_get_field_values(e),jQuery.inArray(a,o,0)<0&&(t=!1)):(o=aioseop_get_field_value(e))!=a&&(t=!1)}}),t?jQuery("#"+e+"_wrapper").show():jQuery("#"+e+"_wrapper").hide(),t}function aioseop_add_condshow_handlers(o,t){void 0!==t&&jQuery.each(t,function(e,a){jQuery("[name="+e+"]").bind("change keyup",function(){aioseop_do_condshow_match(o,t)})})}function aioseop_do_condshow(e){void 0!==aiosp_data.condshow&&jQuery.each(aiosp_data.condshow,function(e,a){aioseop_do_condshow_match(e,a),aioseop_add_condshow_handlers(e,a)})}function aiosp_store_radio(){var e={};jQuery('input[type="radio"]').each(function(){jQuery(this).is(":checked")&&(e[jQuery(this).attr("name")]=jQuery(this).val()),jQuery(document).data("radioshack",e)})}function aiosp_reclick_radio(){var e=jQuery(document).data("radioshack");for(var a in e)jQuery('input[name="'+a+'"]').filter('[value="'+e[a]+'"]').trigger("click");jQuery(".wrap").unbind("mouseup")}function aioseop_handle_ajax_call(e,a,o,t){var i=new sack(ajaxurl);i.execute=1,i.method="POST",i.setVar("action",e),i.setVar("settings",a),i.setVar("options",o),void 0!==t&&(i.onCompletion=t),i.setVar("nonce-aioseop",jQuery('input[name="nonce-aioseop"]').val()),i.setVar("nonce-aioseop-edit",jQuery('input[name="nonce-aioseop-edit"]').val()),i.onError=function(){alert("Ajax error on saving.")},i.runAJAX()}function aioseop_handle_post_url(a,o,t,i,s){jQuery("div#aiosp_"+o).fadeOut("fast",function(){var e='<label class="aioseop_loading aioseop_'+o+'_loading"></label> Please wait...';jQuery("div#aiosp_"+o).fadeIn("fast",function(){s?jQuery.ajax({url:ajaxurl,method:"POST",dataType:"json",data:{action:a,options:t,settings:o,"nonce-aioseop":jQuery('input[name="nonce-aioseop"]').val(),"nonce-aioseop-edit":jQuery('input[name="nonce-aioseop-edit"]').val()},success:function(e){i&&i(e)}}):aioseop_handle_ajax_call(a,o,t,i)}),jQuery("div#aiosp_"+o).html(e)})}function aioseop_is_overflowed(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function aioseop_overflow_border(e){aioseop_is_overflowed(e)?e.className="aioseop_option_div aioseop_overflowed":e.className="aioseop_option_div"}function aiospinitAll(){aiospinitSocialMetaInPosts(jQuery),aiospinitCalendar()}function aiospinitCalendar(){0<jQuery(".aiseop-date").length&&"text"===jQuery(".aiseop-date").eq(0).prop("type").toLowerCase()&&jQuery(".aiseop-date").datepicker({dateFormat:"yy-mm-dd"})}function aiospinitSocialMetaInPosts(a){a('input[name="aioseop_opengraph_settings_customimg_checker"] ~ .aioseop_upload_image_button').on("click",function(e){a('input[name="aioseop_opengraph_settings_image"]').attr("checked",!1)})}"undefined"!=typeof aiosp_data&&(jQuery.each(aiosp_data,function(e,a){0===e?void 0===a.condshow&&(aiosp_data[e].condshow=[]):void 0!==a.condshow&&(aiosp_data[0].condshow=jQuery.merge(aiosp_data[0].condshow,a.condshow))}),aiosp_data=aiosp_data[0]),jQuery(document).ready(function(){"undefined"!=typeof aiosp_data&&void 0!==aiosp_data.condshow&&aioseop_do_condshow(aiosp_data.condshow),jQuery(".aioseop_upload_image_label").on("change",function(){this.checker=jQuery(this).parent().find(".aioseop_upload_image_checker"),0<this.checker.length&&this.checker.val(1)}),jQuery(document).ready(function(e){jQuery(".aioseop_upload_image_button").each(function(){jQuery(this).aioseopImageUploader({success:function(e,a){0<jQuery(a).prev().length&&jQuery(a).prev().val(1)}})})}),jQuery(document).ready(function(){jQuery("#poststuff .aioseop_radio_type input[type='radio']").on("click",function(){var e=jQuery(this).attr("previousValue"),a=jQuery(this).attr("name");void 0!==e?"checked"===e?(jQuery(this).prop("checked",!1),jQuery(this).attr("previousValue",!1)):(jQuery("input[name="+a+"]:radio").attr("previousValue",!1),jQuery(this).attr("previousValue","checked")):jQuery(this).prop("checked")?(jQuery(this).prop("checked",!0),jQuery(this).attr("previousValue","checked")):(jQuery(this).prop("checked",!1),jQuery(this).attr("previousValue",!1))})}),void 0!==aiosp_data.pointers&&jQuery.each(aiosp_data.pointers,function(e,a){"undefined"!==a&&""!==a.pointer_text&&aioseop_show_pointer(e,a)}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-modules-aioseop_feature_manager #aiosp_settings_form .aioseop_settings_left").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),!1}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-modules-aioseop_feature_manager #aiosp_settings_form").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_save_settings","ajax_settings_message",jQuery("form#aiosp_settings_form").serialize(),function(){jQuery(".wp-has-current-submenu").fadeIn("fast",function(){aioseop_handle_ajax_call("aioseop_ajax_get_menu_links","ajax_settings_message",jQuery.param({target:".wp-has-current-submenu > ul"}))})}),!1}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager #aiosp_settings_form .aioseop_settings_left").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),!1}),jQuery(".all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager #aiosp_settings_form").delegate("input[name='Submit']","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_save_settings","ajax_settings_message",jQuery("form#aiosp_settings_form").serialize(),function(){jQuery(".wp-has-current-submenu").fadeIn("fast",function(){aioseop_handle_ajax_call("aioseop_ajax_get_menu_links","ajax_settings_message",jQuery.param({target:".wp-has-current-submenu > ul"}))})}),!1});jQuery("div#aiosp_sitemap_addl_pages_metabox").delegate("input[name='Submit']","click",function(){return aioseop_handle_post_url("aioseop_ajax_save_url","sitemap_addl_pages",jQuery("div#aiosp_sitemap_addl_pages_metabox input, div#aiosp_sitemap_addl_pages_metabox select").serialize()),!1}),jQuery("div#aiosp_video_sitemap_addl_pages_metabox").delegate("input[name='Submit']","click",function(){return aioseop_handle_post_url("aioseop_ajax_save_url","video_sitemap_addl_pages",jQuery("div#aiosp_video_sitemap_addl_pages_metabox input, div#aiosp_video_sitemap_addl_pages_metabox select").serialize()),!1}),jQuery("div#aiosp_sitemap_addl_pages_metabox").delegate("a.aiosp_delete_url","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_delete_url","sitemap_addl_pages",jQuery(this).attr("title")),!1}),jQuery("div#aiosp_video_sitemap_addl_pages_metabox").delegate("a.aiosp_delete_url","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_delete_url","video_sitemap_addl_pages",jQuery(this).attr("title")),!1}),jQuery("div#aiosp_opengraph_scan_header").delegate("input[name='aiosp_opengraph_scan_header']","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_scan_header","opengraph_scan_header",jQuery("div#aiosp_opengraph_scan_header").serialize()),!1}),jQuery('input[name="aiosp_sitemap_posttypes[]"][value="all"], input[name="aiosp_video_sitemap_posttypes[]"][value="all"], input[name="aiosp_sitemap_taxonomies[]"][value="all"], input[name="aiosp_video_sitemap_taxonomies[]"][value="all"]').click(function(){jQuery(this).parents("div:eq(0)").find(":checkbox").prop("checked",this.checked)}),jQuery('input[name="aiosp_sitemap_posttypes[]"][value!="all"], input[name="aiosp_video_sitemap_posttypes[]"][value!="all"], input[name="aiosp_sitemap_taxonomies[]"][value!="all"], input[name="aiosp_video_sitemap_taxonomies[]"][value!="all"]').click(function(){this.checked||jQuery(this).parents("div:eq(0)").find('input[value="all"]:checkbox').prop("checked",this.checked)}),jQuery(".aioseop_tabs").tabs({hide:!0,show:!0}),jQuery("div#aiosp_robots_default_metabox").delegate("a.aiosp_robots_delete_rule","click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_delete_rule","robots_rules",jQuery(this).attr("data-id"),function(){window.location.reload()}),!1}),jQuery("div#aiosp_robots_default_metabox").delegate("a.aiosp_robots_edit_rule","click",function(e){return e.preventDefault(),jQuery('input[name="aiosp_robots_agent"]').val(jQuery(this).attr("data-agent")),jQuery('select[name="aiosp_robots_type"]').val(jQuery(this).attr("data-type")),jQuery('input[name="aiosp_robots_path"]').val(jQuery(this).attr("data-path")),jQuery("input.add-edit-rule").val(jQuery(".aioseop_table").attr("data-edit-label")),jQuery("input.edit-rule-id").val(jQuery(this).attr("data-id")),!1}),jQuery("a.aiosp_robots_physical").on("click",function(e){return e.preventDefault(),aioseop_handle_post_url("aioseop_ajax_robots_physical","robots_physical_import_delete",jQuery(this).attr("data-action"),function(e){e.data&&e.data.message&&alert(e.data.message),window.location.reload()},!0),!1}),aiospinitAll()}),jQuery.fn.aioseopImageUploader=function(e){var a=this;a.options=jQuery.extend({success:void 0},e),a.target=jQuery(a).next(),a.uploader=wp.media({title:"Choose Image",button:{text:"Choose Image"},multiple:!1}),a.onSelect=function(){var e=a.uploader.state().get("selection").first().toJSON().url;0<=a.target.length&&jQuery(a.target).val(e),void 0!==a.options.success&&a.options.success(e,a)},a.onClick=function(e){e.preventDefault(),a.uploader.open()},a.uploader.on("select",a.onSelect),jQuery(a).click(a.onClick)};
js/modules/aioseop_sitemap.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Script for Sitemap Settings page
3
+ *
4
+ * @summary Binds input elements for AIOSEOP Sitemap Settings screens.
5
+ *
6
+ * @link https://github.com/selectize/selectize.js
7
+ *
8
+ * @author Michael Torbert.
9
+ * @author Semper Fi Web Design.
10
+ * @copyright https://semperplugins.com
11
+ * @version 3.0
12
+ */
13
+ jQuery('.aioseop-exclude-terms').selectize();
js/modules/aioseop_sitemap.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(".aioseop-exclude-terms").selectize();
js/modules/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
js/plugins-menu.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Plugins menu.
3
+ *
4
+ * Contains all functions that affect the Plugins menu.
5
+ *
6
+ * @since 3.0
7
+ * @package all-in-one-seo-pack
8
+ */
9
+ (function($) {
10
+
11
+ /**
12
+ * Opens Upgrade to Pro link in Plugins menu as new tab.
13
+ */
14
+ function upgrade_link_plugins_menu_new_tab() {
15
+ $('.proupgrade').find('a').attr('target','_blank');
16
+ }
17
+
18
+ upgrade_link_plugins_menu_new_tab();
19
+
20
+ }(jQuery));
js/plugins-menu.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(".proupgrade").find("a").attr("target","_blank");
js/quickedit_functions.js CHANGED
@@ -49,10 +49,8 @@ function aioseop_ajax_edit_meta_form( post_id, meta, nonce ) {
49
  var element = uform.html(); var input;
50
  input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:13px;width:100%;float:left;position:relative;z-index:1;" rows=4 cols=32>' + post_title + '</textarea>';
51
  input += '<label style="float:left">';
52
- input += '<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+meta+'_save_' + post_id + '" >';
53
- input += '<img src="' + aioseopadmin.imgUrl+'accept.png" border="0" alt="" title="'+meta+'" /></a>';
54
- input += '<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+meta+'_cancel_' + post_id + '" >';
55
- input += '<img src="' + aioseopadmin.imgUrl+'delete.png" border="0" alt="" title="'+meta+'" /></a>';
56
  input += '</label>';
57
  uform.html( input );
58
  uform.attr( "class", "aioseop_mpc_admin_meta_options aio_editing" );
49
  var element = uform.html(); var input;
50
  input = '<textarea id="aioseop_new_'+meta+'_' + post_id + '" style="font-size:13px;width:100%;float:left;position:relative;z-index:1;" rows=4 cols=32>' + post_title + '</textarea>';
51
  input += '<label style="float:left">';
52
+ input += '<a class="aioseop-icon-qedit aioseop-icon-qedit-accept" href="javascript:void(0);" id="aioseop_' + meta + '_save_' + post_id + '" title="Accept" >';
53
+ input += '<a class="aioseop-icon-qedit aioseop-icon-qedit-delete" href="javascript:void(0);" id="aioseop_' + meta + '_cancel_' + post_id + '" title="Decline" >';
 
 
54
  input += '</label>';
55
  uform.html( input );
56
  uform.attr( "class", "aioseop_mpc_admin_meta_options aio_editing" );
js/quickedit_functions.min.js CHANGED
@@ -1 +1 @@
1
- function aioseop_ajax_edit_meta_form(e,i,t){var a,o=jQuery("#aioseop_"+i+"_"+e),s=jQuery("#aioseop_label_"+i+"_"+e).text(),_=o.html();a='<textarea id="aioseop_new_'+i+"_"+e+'" style="font-size:13px;width:100%;float:left;position:relative;z-index:1;" rows=4 cols=32>'+s+"</textarea>",a+='<label style="float:left">',a+='<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+i+"_save_"+e+'" >',a+='<img src="'+aioseopadmin.imgUrl+'accept.png" border="0" alt="" title="'+i+'" /></a>',a+='<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+i+"_cancel_"+e+'" >',a+='<img src="'+aioseopadmin.imgUrl+'delete.png" border="0" alt="" title="'+i+'" /></a>',a+="</label>",o.html(a),o.attr("class","aioseop_mpc_admin_meta_options aio_editing"),jQuery("#aioseop_"+i+"_cancel_"+e).click(function(){o.html(_),o.attr("class","aioseop_mpc_admin_meta_options")}),jQuery("#aioseop_"+i+"_save_"+e).click(function(){var a=jQuery("#aioseop_new_"+i+"_"+e).val();handle_post_meta(e,a,i,t)})}function handle_post_meta(e,i,t,o){jQuery("div#aioseop_"+t+"_"+e).fadeOut("fast",function(){var a='<label class="aioseop_'+t+'_loading">';a+='<img style="width:20px;margin-right:5px;float:left" align="absmiddle" ',a+='src="'+aioseopadmin.imgUrl+'activity.gif" border="0" alt="" title="'+t+'" /></a>',a+='</label><div style="float:left">Please wait…</div>',jQuery("div#aioseop_"+t+"_"+e).fadeIn("fast",function(){var a=new sack(aioseopadmin.requestUrl);a.execute=1,a.method="POST",a.setVar("action","aioseop_ajax_save_meta"),a.setVar("post_id",e),a.setVar("new_meta",i),a.setVar("target_meta",t),a.setVar("_inline_edit",jQuery("input#_inline_edit").val()),a.setVar("_nonce",o),a.onError=function(){alert("Ajax error on saving title")},a.runAJAX()}),jQuery("div#aioseop_"+t+"_"+e).html(a),jQuery("div#aioseop_"+t+"_"+e).attr("class","aioseop_mpc_admin_meta_options")})}jQuery(document).on("click",".visibility-notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_visibility_notice"}})}),jQuery(document).on("click",".yst_notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_yst_notice"}})}),jQuery(document).on("click",".woo-upgrade-notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_woo_upgrade_notice"}})}),jQuery(document).on("click",".sitemap_max_urls_notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_sitemap_max_url_notice"}})});
1
+ function aioseop_ajax_edit_meta_form(e,i,t){var a,o=jQuery("#aioseop_"+i+"_"+e),s=jQuery("#aioseop_label_"+i+"_"+e).text(),_=o.html();a='<textarea id="aioseop_new_'+i+"_"+e+'" style="font-size:13px;width:100%;float:left;position:relative;z-index:1;" rows=4 cols=32>'+s+"</textarea>",a+='<label style="float:left">',a+='<a class="aioseop-icon-qedit aioseop-icon-qedit-accept" href="javascript:void(0);" id="aioseop_'+i+"_save_"+e+'" title="Accept" >',a+='<a class="aioseop-icon-qedit aioseop-icon-qedit-delete" href="javascript:void(0);" id="aioseop_'+i+"_cancel_"+e+'" title="Decline" >',a+="</label>",o.html(a),o.attr("class","aioseop_mpc_admin_meta_options aio_editing"),jQuery("#aioseop_"+i+"_cancel_"+e).click(function(){o.html(_),o.attr("class","aioseop_mpc_admin_meta_options")}),jQuery("#aioseop_"+i+"_save_"+e).click(function(){var a=jQuery("#aioseop_new_"+i+"_"+e).val();handle_post_meta(e,a,i,t)})}function handle_post_meta(e,i,t,o){jQuery("div#aioseop_"+t+"_"+e).fadeOut("fast",function(){var a='<label class="aioseop_'+t+'_loading">';a+='<img style="width:20px;margin-right:5px;float:left" align="absmiddle" ',a+='src="'+aioseopadmin.imgUrl+'activity.gif" border="0" alt="" title="'+t+'" /></a>',a+='</label><div style="float:left">Please wait…</div>',jQuery("div#aioseop_"+t+"_"+e).fadeIn("fast",function(){var a=new sack(aioseopadmin.requestUrl);a.execute=1,a.method="POST",a.setVar("action","aioseop_ajax_save_meta"),a.setVar("post_id",e),a.setVar("new_meta",i),a.setVar("target_meta",t),a.setVar("_inline_edit",jQuery("input#_inline_edit").val()),a.setVar("_nonce",o),a.onError=function(){alert("Ajax error on saving title")},a.runAJAX()}),jQuery("div#aioseop_"+t+"_"+e).html(a),jQuery("div#aioseop_"+t+"_"+e).attr("class","aioseop_mpc_admin_meta_options")})}jQuery(document).on("click",".visibility-notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_visibility_notice"}})}),jQuery(document).on("click",".yst_notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_yst_notice"}})}),jQuery(document).on("click",".woo-upgrade-notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_woo_upgrade_notice"}})}),jQuery(document).on("click",".sitemap_max_urls_notice",function(){jQuery.ajax({url:ajaxurl,data:{action:"aioseo_dismiss_sitemap_max_url_notice"}})});
modules/aioseop_bad_robots.php CHANGED
@@ -19,16 +19,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Bad_Robots' ) ) {
19
  $this->file = __FILE__; // The current file.
20
  parent::__construct();
21
 
22
- $help_text = array(
23
- 'block_bots' => __( 'Block requests from user agents that are known to misbehave with 503.', 'all-in-one-seo-pack' ),
24
- 'block_refer' => __( 'Block Referral Spam using HTTP.', 'all-in-one-seo-pack' ),
25
- 'track_blocks' => __( 'Log and show recent requests from blocked bots.', 'all-in-one-seo-pack' ),
26
- 'edit_blocks' => __( 'Check this to edit the list of disallowed user agents for blocking bad bots.', 'all-in-one-seo-pack' ),
27
- 'blocklist' => __( 'This is the list of disallowed user agents used for blocking bad bots.', 'all-in-one-seo-pack' ),
28
- 'referlist' => __( 'This is the list of disallowed referers used for blocking bad bots.', 'all-in-one-seo-pack' ),
29
- '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' ),
30
- );
31
-
32
  $this->default_options = array(
33
  'block_bots' => array( 'name' => __( 'Block Bad Bots using HTTP', 'all-in-one-seo-pack' ) ),
34
  'block_refer' => array( 'name' => __( 'Block Referral Spam using HTTP', 'all-in-one-seo-pack' ) ),
@@ -67,12 +57,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Bad_Robots' ) ) {
67
  ),
68
  );
69
 
70
- if ( ! empty( $help_text ) ) {
71
- foreach ( $help_text as $k => $v ) {
72
- $this->default_options[ $k ]['help_text'] = $v;
73
- }
74
- }
75
-
76
  add_filter( $this->prefix . 'display_options', array( $this, 'filter_display_options' ) );
77
 
78
  // Load initial options / set defaults,
19
  $this->file = __FILE__; // The current file.
20
  parent::__construct();
21
 
 
 
 
 
 
 
 
 
 
 
22
  $this->default_options = array(
23
  'block_bots' => array( 'name' => __( 'Block Bad Bots using HTTP', 'all-in-one-seo-pack' ) ),
24
  'block_refer' => array( 'name' => __( 'Block Referral Spam using HTTP', 'all-in-one-seo-pack' ) ),
57
  ),
58
  );
59
 
 
 
 
 
 
 
60
  add_filter( $this->prefix . 'display_options', array( $this, 'filter_display_options' ) );
61
 
62
  // Load initial options / set defaults,
modules/aioseop_feature_manager.php CHANGED
@@ -38,7 +38,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
38
  'name' => __( 'Social Meta', 'all-in-one-seo-pack' ),
39
  /* translators: Social Meta refers to Open Graph (OG:) meta tags, which can be used to control the appearance
40
  of a site's posts/pages when shared on social media networks like Facebook and Twitter. */
41
- 'description' => __( 'Add Social Meta data to your site to deliver closer integration between your website/blog and social media.', 'all-in-one-seo-pack' ),
42
  ),
43
  'robots' => array(
44
  /* translators: the Robots.txt module allows users to provide instructions to web robots, e.g. search engine crawlers. */
@@ -54,7 +54,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
54
  /* translators: the Importer & Exporter module allows users to import/export their All in One SEO Pack
55
  settings for backup purposes or when migrating their site. */
56
  'name' => __( 'Importer & Exporter', 'all-in-one-seo-pack' ),
57
- 'description' => __( 'Exports and imports your All in One SEO Pack plugin settings.', 'all-in-one-seo-pack' ),
 
58
  ),
59
  'bad_robots' => array(
60
  /* translators: the Bad Bot Blocker module allows users to block requests from user agents that are known to misbehave. */
38
  'name' => __( 'Social Meta', 'all-in-one-seo-pack' ),
39
  /* translators: Social Meta refers to Open Graph (OG:) meta tags, which can be used to control the appearance
40
  of a site's posts/pages when shared on social media networks like Facebook and Twitter. */
41
+ 'description' => __( 'Add Social Meta data to your site to deliver closer integration between your website and social media.', 'all-in-one-seo-pack' ),
42
  ),
43
  'robots' => array(
44
  /* translators: the Robots.txt module allows users to provide instructions to web robots, e.g. search engine crawlers. */
54
  /* translators: the Importer & Exporter module allows users to import/export their All in One SEO Pack
55
  settings for backup purposes or when migrating their site. */
56
  'name' => __( 'Importer & Exporter', 'all-in-one-seo-pack' ),
57
+ /* 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. */
58
+ 'description' => sprintf( __( 'Exports and imports your %s plugin settings.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ),
59
  ),
60
  'bad_robots' => array(
61
  /* translators: the Bad Bot Blocker module allows users to block requests from user agents that are known to misbehave. */
modules/aioseop_file_editor.php CHANGED
@@ -25,9 +25,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_File_Editor' ) ) {
25
  $this->current_tab = $_REQUEST['tab'];
26
  }
27
 
28
- $help_text = array(
29
- 'htaccfile' => __( '.htaccess editor', 'all-in-one-seo-pack' ),
30
- );
31
  $this->default_options = array(
32
  'htaccfile' => array(
33
  'name' => __( 'Edit .htaccess', 'all-in-one-seo-pack' ),
@@ -40,11 +37,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_File_Editor' ) ) {
40
  ),
41
  );
42
 
43
- if ( ! empty( $help_text ) ) {
44
- foreach ( $help_text as $k => $v ) {
45
- $this->default_options[ $k ]['help_text'] = $v;
46
- }
47
- }
48
  $this->tabs = array(
49
  'htaccess' => array( 'name' => __( '.htaccess' ) ),
50
  );
25
  $this->current_tab = $_REQUEST['tab'];
26
  }
27
 
 
 
 
28
  $this->default_options = array(
29
  'htaccfile' => array(
30
  'name' => __( 'Edit .htaccess', 'all-in-one-seo-pack' ),
37
  ),
38
  );
39
 
 
 
 
 
 
40
  $this->tabs = array(
41
  'htaccess' => array( 'name' => __( '.htaccess' ) ),
42
  );
modules/aioseop_importer_exporter.php CHANGED
@@ -17,26 +17,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Importer_Exporter' ) ) {
17
  $this->prefix = 'aiosp_importer_exporter_'; // option prefix
18
  $this->file = __FILE__;
19
  parent::__construct();
20
- $help_text = array(
21
- 'import_submit' => __(
22
- "Select a valid All in One SEO Pack ini file and click 'Import' to import options from a previous state or install of All in One SEO Pack.<br /><a href='https://semperplugins.com/documentation/importer-exporter-module/' target='_blank'>Click here for documentation on this setting</a>",
23
- 'all-in-one-seo-pack'
24
- ),
25
- 'export_choices' => __(
26
- "You may choose to export settings from active modules, and content from post data.<br /><a href='https://semperplugins.com/documentation/importer-exporter-module/' target='_blank'>Click here for documentation on this setting</a>",
27
- 'all-in-one-seo-pack'
28
- ),
29
- 'export_post_types' => __(
30
- "Select which Post Types you want to export your All in One SEO Pack meta data for.<br /><a href='https://semperplugins.com/documentation/importer-exporter-module/' target='_blank'>Click here for documentation on this setting</a>",
31
- 'all-in-one-seo-pack'
32
- ),
33
- );
34
  $this->warnings = array();
35
  $this->default_options = array(
36
  'import_submit' => array(
37
  'name' => __( 'Import', 'all-in-one-seo-pack' ),
38
  'default' => '',
39
  'type' => 'file',
 
40
  'save' => false,
41
  ),
42
  'export_choices' => array(
@@ -70,11 +57,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Importer_Exporter' ) ) {
70
  ) . '<br />',
71
  ),
72
  );
73
- if ( ! empty( $help_text ) ) {
74
- foreach ( $help_text as $k => $v ) {
75
- $this->default_options[ $k ]['help_text'] = $v;
76
- }
77
- }
78
  $this->layout = array(
79
  'default' => array(
80
  'name' => $this->name,
@@ -515,9 +497,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Importer_Exporter' ) ) {
515
  case 'Export':
516
  // Creates Files Contents
517
  $settings_file = 'settings_aioseop.ini';
518
- $buf = '; ' . __(
519
- 'Settings export file for All in One SEO Pack', '
 
 
520
  all-in-one-seo-pack'
 
 
521
  ) . "\n";
522
 
523
  // Adds all settings to settings file
17
  $this->prefix = 'aiosp_importer_exporter_'; // option prefix
18
  $this->file = __FILE__;
19
  parent::__construct();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  $this->warnings = array();
21
  $this->default_options = array(
22
  'import_submit' => array(
23
  'name' => __( 'Import', 'all-in-one-seo-pack' ),
24
  'default' => '',
25
  'type' => 'file',
26
+ 'class' => 'aioseop_file_upload',
27
  'save' => false,
28
  ),
29
  'export_choices' => array(
57
  ) . '<br />',
58
  ),
59
  );
 
 
 
 
 
60
  $this->layout = array(
61
  'default' => array(
62
  'name' => $this->name,
497
  case 'Export':
498
  // Creates Files Contents
499
  $settings_file = 'settings_aioseop.ini';
500
+ /* 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. */
501
+ $buf = '; ' . sprintf(
502
+ __(
503
+ 'Settings export file for %s', '
504
  all-in-one-seo-pack'
505
+ ),
506
+ AIOSEOP_PLUGIN_NAME
507
  ) . "\n";
508
 
509
  // Adds all settings to settings file
modules/aioseop_opengraph.php CHANGED
@@ -1,1891 +1,1924 @@
1
- <?php
2
- /**
3
- * The Opengraph class.
4
- *
5
- * @package All-in-One-SEO-Pack
6
- * @version 2.3.16
7
- */
8
- if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
9
- class All_in_One_SEO_Pack_Opengraph extends All_in_One_SEO_Pack_Module {
10
- var $fb_object_types;
11
- var $type;
12
-
13
- /**
14
- * Module constructor.
15
- *
16
- * @since 2.3.14 Added display filter.
17
- * @since 2.3.16 #1066 Force init on constructor.
18
- */
19
- function __construct() {
20
- add_action( 'admin_enqueue_scripts', array( $this, 'og_admin_enqueue_scripts' ) );
21
-
22
- $this->name = __( 'Social Meta', 'all-in-one-seo-pack' ); // Human-readable name of the plugin
23
- $this->prefix = 'aiosp_opengraph_'; // option prefix
24
- $this->file = __FILE__; // the current file
25
- $this->fb_object_types = array(
26
- 'Activities' => array(
27
- 'activity' => __( 'Activity', 'all-in-one-seo-pack' ),
28
- 'sport' => __( 'Sport', 'all-in-one-seo-pack' ),
29
- ),
30
- 'Businesses' => array(
31
- 'bar' => __( 'Bar', 'all-in-one-seo-pack' ),
32
- 'company' => __( 'Company', 'all-in-one-seo-pack' ),
33
- 'cafe' => __( 'Cafe', 'all-in-one-seo-pack' ),
34
- 'hotel' => __( 'Hotel', 'all-in-one-seo-pack' ),
35
- 'restaurant' => __( 'Restaurant', 'all-in-one-seo-pack' ),
36
- ),
37
- 'Groups' => array(
38
- 'cause' => __( 'Cause', 'all-in-one-seo-pack' ),
39
- 'sports_league' => __( 'Sports League', 'all-in-one-seo-pack' ),
40
- 'sports_team' => __( 'Sports Team', 'all-in-one-seo-pack' ),
41
- ),
42
- 'Organizations' => array(
43
- 'band' => __( 'Band', 'all-in-one-seo-pack' ),
44
- 'government' => __( 'Government', 'all-in-one-seo-pack' ),
45
- 'non_profit' => __( 'Non Profit', 'all-in-one-seo-pack' ),
46
- 'school' => __( 'School', 'all-in-one-seo-pack' ),
47
- 'university' => __( 'University', 'all-in-one-seo-pack' ),
48
- ),
49
- 'People' => array(
50
- 'actor' => __( 'Actor', 'all-in-one-seo-pack' ),
51
- 'athlete' => __( 'Athlete', 'all-in-one-seo-pack' ),
52
- 'author' => __( 'Author', 'all-in-one-seo-pack' ),
53
- 'director' => __( 'Director', 'all-in-one-seo-pack' ),
54
- 'musician' => __( 'Musician', 'all-in-one-seo-pack' ),
55
- 'politician' => __( 'Politician', 'all-in-one-seo-pack' ),
56
- 'profile' => __( 'Profile', 'all-in-one-seo-pack' ),
57
- 'public_figure' => __( 'Public Figure', 'all-in-one-seo-pack' ),
58
- ),
59
- 'Places' => array(
60
- 'city' => __( 'City', 'all-in-one-seo-pack' ),
61
- 'country' => __( 'Country', 'all-in-one-seo-pack' ),
62
- 'landmark' => __( 'Landmark', 'all-in-one-seo-pack' ),
63
- 'state_province' => __( 'State Province', 'all-in-one-seo-pack' ),
64
- ),
65
- 'Products and Entertainment' => array(
66
- 'album' => __( 'Album', 'all-in-one-seo-pack' ),
67
- 'book' => __( 'Book', 'all-in-one-seo-pack' ),
68
- 'drink' => __( 'Drink', 'all-in-one-seo-pack' ),
69
- 'food' => __( 'Food', 'all-in-one-seo-pack' ),
70
- 'game' => __( 'Game', 'all-in-one-seo-pack' ),
71
- 'movie' => __( 'Movie', 'all-in-one-seo-pack' ),
72
- 'product' => __( 'Product', 'all-in-one-seo-pack' ),
73
- 'song' => __( 'Song', 'all-in-one-seo-pack' ),
74
- 'tv_show' => __( 'TV Show', 'all-in-one-seo-pack' ),
75
- 'episode' => __( 'Episode', 'all-in-one-seo-pack' ),
76
- ),
77
- 'Websites' => array(
78
- 'article' => __( 'Article', 'all-in-one-seo-pack' ),
79
- 'blog' => __( 'Blog', 'all-in-one-seo-pack' ),
80
- 'website' => __( 'Website', 'all-in-one-seo-pack' ),
81
- ),
82
- );
83
- parent::__construct();
84
-
85
- $this->help_text = array(
86
- 'setmeta' => __( 'Checking this box will use the Home Title and Home Description set in All in One SEO Pack, General Settings as the Open Graph title and description for your home page.', 'all-in-one-seo-pack' ),
87
- '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' ),
88
- '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' ),
89
- 'title_shortcodes' => __( 'Run shortcodes that appear in social title meta tags.', 'all-in-one-seo-pack' ),
90
- 'description_shortcodes' => __( 'Run shortcodes that appear in social description meta tags.', 'all-in-one-seo-pack' ),
91
- 'sitename' => __( 'The Site Name is the name that is used to identify your website.', 'all-in-one-seo-pack' ),
92
- 'hometitle' => __( 'The Home Title is the Open Graph title for your home page.', 'all-in-one-seo-pack' ),
93
- 'description' => __( 'The Home Description is the Open Graph description for your home page.', 'all-in-one-seo-pack' ),
94
- 'homeimage' => __( 'The Home Image is the Open Graph image for your home page.', 'all-in-one-seo-pack' ),
95
- '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' ),
96
- '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' ),
97
- 'fallback' => __( 'This option lets you fall back to the default image if no image could be found above.', 'all-in-one-seo-pack' ),
98
- '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' ),
99
- 'dimgwidth' => __( 'This option lets you set a default width for your images, where unspecified.', 'all-in-one-seo-pack' ),
100
- 'dimgheight' => __( 'This option lets you set a default height for your images, where unspecified.', 'all-in-one-seo-pack' ),
101
- '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' ),
102
- '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' ),
103
- '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' ),
104
- 'imagewidth' => __( 'Enter the width for your Open Graph image in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
105
- 'imageheight' => __( 'Enter the height for your Open Graph image in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
106
- 'video' => __( 'This option lets you specify a link to the Open Graph video used on this Page or Post.', 'all-in-one-seo-pack' ),
107
- 'videowidth' => __( 'Enter the width for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
108
- 'videoheight' => __( 'Enter the height for your Open Graph video in pixels (i.e. 600).', 'all-in-one-seo-pack' ),
109
- 'defcard' => __( 'Select the default type of Twitter Card to display.', 'all-in-one-seo-pack' ),
110
- 'setcard' => __( 'Select the Twitter Card type to use for this Page or Post, overriding the default setting.', 'all-in-one-seo-pack' ),
111
- 'twitter_site' => __( 'Enter the Twitter username associated with your website here.', 'all-in-one-seo-pack' ),
112
- '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' ),
113
- 'twitter_domain' => __( 'Enter the name of your website here.', 'all-in-one-seo-pack' ),
114
- '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' ),
115
- 'gen_tags' => __( 'Automatically generate article tags for Facebook type article when not provided.', 'all-in-one-seo-pack' ),
116
- 'gen_keywords' => __( 'Use keywords in generated article tags.', 'all-in-one-seo-pack' ),
117
- 'gen_categories' => __( 'Use categories in generated article tags.', 'all-in-one-seo-pack' ),
118
- 'gen_post_tags' => __( 'Use post tags in generated article tags.', 'all-in-one-seo-pack' ),
119
- 'types' => __( 'Select which Post Types you want to use All in One SEO Pack to set Open Graph meta values for.', 'all-in-one-seo-pack' ),
120
- 'title' => __( 'This is the Open Graph title of this Page or Post.', 'all-in-one-seo-pack' ),
121
- 'desc' => __( 'This is the Open Graph description of this Page or Post.', 'all-in-one-seo-pack' ),
122
- 'category' => __( 'Select the Open Graph type that best describes the content of this Page or Post.', 'all-in-one-seo-pack' ),
123
- 'facebook_debug' => __( 'Press this button to have Facebook re-fetch and debug this page.', 'all-in-one-seo-pack' ),
124
- 'section' => __( 'This Open Graph meta allows you to add a general section name that best describes this content.', 'all-in-one-seo-pack' ),
125
- 'tag' => __( 'This Open Graph meta allows you to add a list of keywords that best describe this content.', 'all-in-one-seo-pack' ),
126
- 'facebook_publisher' => __( 'Link articles to the Facebook page associated with your website.', 'all-in-one-seo-pack' ),
127
- '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' ),
128
- 'person_or_org' => __( 'Are the social profile links for your website for a person or an organization?', 'all-in-one-seo-pack' ),
129
- 'profile_links' => __( "Add URLs for your website's social profiles here (Facebook, Twitter, Google+, Instagram, LinkedIn), one per line.", 'all-in-one-seo-pack' ),
130
- 'social_name' => __( 'Add the name of the person or organization who owns these profiles.', 'all-in-one-seo-pack' ),
131
- );
132
-
133
- $this->help_anchors = array(
134
- 'title_shortcodes' => '#run-shortcodes-in-title',
135
- 'description_shortcodes' => '#run-shortcodes-in-description',
136
- 'generate_descriptions' => '#auto-generate-og-descriptions',
137
- 'setmeta' => '#use-aioseo-title-and-description',
138
- 'sitename' => '#site-name',
139
- 'hometitle' => '#home-title-and-description',
140
- 'description' => '#home-title-and-description',
141
- 'homeimage' => '#home-image',
142
- 'defimg' => '#select-og-image-source',
143
- 'fallback' => '#use-default-if-no-image-found',
144
- 'dimg' => '#default-og-image',
145
- 'dimgwidth' => '#default-image-width',
146
- 'dimgheight' => '#default-image-height',
147
- 'meta_key' => '#use-custom-field-for-image',
148
- 'profile_links' => '#social-profile-links',
149
- 'person_or_org' => '#social-profile-links',
150
- 'social_name' => '#social-profile-links',
151
- 'key' => '#facebook-admin-id',
152
- 'appid' => '#facebook-app-id',
153
- 'gen_tags' => '#automatically-generate-article-tags',
154
- 'gen_keywords' => '#use-keywords-in-article-tags',
155
- 'gen_categories' => '#use-categories-in-article-tags',
156
- 'gen_post_tags' => '#use-post-tags-in-article-tags',
157
- 'facebook_publisher' => '#show-facebook-publisher-on-articles',
158
- 'facebook_author' => '#show-facebook-author-on-articles',
159
- 'types' => '#enable-facebook-meta-for',
160
- 'defcard' => '#default-twitter-card',
161
- 'twitter_site' => '#twitter-site',
162
- 'twitter_creator' => '#show-twitter-author',
163
- 'twitter_domain' => '#twitter-domain',
164
- 'scan_header' => '#scan-social-meta',
165
- 'title' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#title',
166
- 'desc' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#description',
167
- 'image' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#image',
168
- 'customimg' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-image',
169
- 'imagewidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height',
170
- 'imageheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-image-width-height',
171
- 'video' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-video',
172
- 'videowidth' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height',
173
- 'videoheight' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#specify-video-width-height',
174
- 'category' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-object-type',
175
- 'facebook_debug' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#facebook-debug',
176
- 'section' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-section',
177
- 'tag' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#article-tags',
178
- 'setcard' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#twitter-card-type',
179
- 'customimg_twitter' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/#custom-twitter-image',
180
- );
181
-
182
- if ( is_admin() ) {
183
- add_action( 'admin_init', array( $this, 'admin_init' ), 5 );
184
- } else {
185
- add_action( 'wp', array( $this, 'type_setup' ) );
186
- }
187
-
188
- if ( ! is_admin() || defined( 'DOING_AJAX' ) ) {
189
- $this->do_opengraph();
190
- }
191
- // Set variables after WordPress load.
192
- add_action( 'init', array( &$this, 'init' ), 999999 );
193
- add_filter( 'jetpack_enable_open_graph', '__return_false' ); // Avoid having duplicate meta tags
194
- // Force refresh of Facebook cache.
195
- add_action( 'post_updated', array( &$this, 'force_fb_refresh_update' ), 10, 3 );
196
- add_action( 'transition_post_status', array( &$this, 'force_fb_refresh_transition' ), 10, 3 );
197
- add_action( 'edited_term', array( &$this, 'save_tax_data' ), 10, 3 );
198
- // Adds special filters
199
- add_filter( 'aioseop_opengraph_placeholder', array( &$this, 'filter_placeholder' ) );
200
- add_action( 'aiosp_activate_opengraph', array( $this, 'activate_module' ) );
201
- add_action( 'created_term', array( $this, 'created_term' ), 10, 3 );
202
- // Call to init to generate menus
203
- $this->init();
204
- }
205
-
206
- /**
207
- * Sets the terms defaults after a new term is created.
208
- *
209
- * @param int $term_id Term ID.
210
- * @param int $tt_id Term taxonomy ID.
211
- * @param string $taxonomy Taxonomy slug.
212
- */
213
- function created_term( $term_id, $tt_id, $taxonomy_name ) {
214
- $k = 'settings';
215
- $prefix = $this->get_prefix( $k );
216
- $tax = get_taxonomy( $taxonomy_name );
217
- $this->set_object_type_for_taxonomy( $prefix, $k, $taxonomy_name, $tax, false, array( $term_id ) );
218
- }
219
-
220
- /**
221
- * Sets the defaults for a taxonomy.
222
- *
223
- * @param string $prefix The prefix of this module.
224
- * @param string $k The key against which the options will be determined/set.
225
- * @param string $taxonomy_name The name of the taxonomy.
226
- * @param Object $tax The taxonomy object.
227
- * @param bool $bail_if_no_terms Bail if the taxonomy has no terms.
228
- * @param array $terms The terms in the taxonomy.
229
- */
230
- private function set_object_type_for_taxonomy( $prefix, $k, $taxonomy_name, $tax, $bail_if_no_terms = false, $terms = null ) {
231
- $object_type = null;
232
- if ( ! $terms ) {
233
- $terms = get_terms(
234
- $taxonomy_name, array(
235
- 'meta_query' => array(
236
- array(
237
- 'key' => '_' . $prefix . $k,
238
- 'compare' => 'NOT EXISTS',
239
- ),
240
- ),
241
- 'number' => PHP_INT_MAX,
242
- 'fields' => 'ids',
243
- 'hide_empty' => false,
244
- )
245
- );
246
- }
247
-
248
- if ( empty( $terms ) && $bail_if_no_terms ) {
249
- return false;
250
- }
251
-
252
- if ( true === $tax->_builtin ) {
253
- $object_type = 'article';
254
- } else {
255
- // custom taxonomy. Let's get a post against this to determine its post type.
256
- $posts = get_posts(
257
- array(
258
- 'numberposts' => 1,
259
- 'post_type' => 'any',
260
- 'tax_query' => array(
261
- array(
262
- 'taxonomy' => $taxonomy_name,
263
- 'field' => 'term_id',
264
- 'terms' => $terms,
265
- ),
266
- ),
267
- )
268
- );
269
- if ( $posts ) {
270
- global $aioseop_options;
271
- $post_type = $posts[0]->post_type;
272
- if ( isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules'][ $this->prefix . 'options' ] ) ) {
273
- $og_options = $aioseop_options['modules'][ $this->prefix . 'options' ];
274
-
275
- // now let's see what default object type is set for this post type.
276
- $object_type_set = $og_options[ $this->prefix . $post_type . '_fb_object_type' ];
277
- if ( ! empty( $object_type_set ) ) {
278
- $object_type = $object_type_set;
279
- }
280
- }
281
- }
282
- }
283
-
284
- if ( $object_type ) {
285
- $opts[ $prefix . $k . '_category' ] = $object_type;
286
- foreach ( $terms as $term_id ) {
287
- update_term_meta( $term_id, '_' . $prefix . $k, $opts );
288
- }
289
- }
290
-
291
- return true;
292
- }
293
-
294
- /**
295
- * Called when this module is activated.
296
- */
297
- public function activate_module() {
298
- if ( $this->locations !== null ) {
299
- foreach ( $this->locations as $k => $v ) {
300
- if ( ! isset( $v['type'] ) || 'metabox' !== $v['type'] ) {
301
- continue;
302
- }
303
- $this->set_virgin_tax_terms( $k );
304
- }
305
- }
306
- }
307
- /**
308
- * This iterates over all taxonomies that do not have a opengraph setting defined and sets the defaults.
309
- *
310
- * @param string $k The key against which the options will be determined/set.
311
- */
312
- private function set_virgin_tax_terms( $k ) {
313
- $prefix = $this->get_prefix( $k );
314
- $opts = $this->default_options( $k );
315
- $taxonomies = get_taxonomies( array( 'public' => true ), 'object' );
316
- if ( ! $taxonomies ) {
317
- return;
318
- }
319
- foreach ( $taxonomies as $name => $tax ) {
320
- $this->set_object_type_for_taxonomy( $prefix, $k, $name, $tax, true, null );
321
-
322
- }
323
- }
324
-
325
- /**
326
- * Hook called after WordPress has been loaded.
327
- *
328
- * @since 2.4.14
329
- */
330
- public function init() {
331
- $count_desc = __( ' characters. Open Graph allows up to a maximum of %1$s chars for the %2$s.', 'all-in-one-seo-pack' );
332
- // Create default options
333
- $this->default_options = array(
334
- 'scan_header' => array(
335
- 'name' => __( 'Scan Header', 'all-in-one-seo-pack' ),
336
- 'type' => 'custom',
337
- 'save' => true,
338
- ),
339
- 'setmeta' => array(
340
- 'name' => __( 'Use AIOSEO Title and Description', 'all-in-one-seo-pack' ),
341
- 'type' => 'checkbox',
342
- ),
343
- 'key' => array(
344
- 'name' => __( 'Facebook Admin ID', 'all-in-one-seo-pack' ),
345
- 'default' => '',
346
- 'type' => 'text',
347
- ),
348
- 'appid' => array(
349
- 'name' => __( 'Facebook App ID', 'all-in-one-seo-pack' ),
350
- 'default' => '',
351
- 'type' => 'text',
352
- ),
353
- 'title_shortcodes' => array(
354
- 'name' => __( 'Run Shortcodes In Title', 'all-in-one-seo-pack' ),
355
- ),
356
- 'description_shortcodes' => array(
357
- 'name' => __( 'Run Shortcodes In Description', 'all-in-one-seo-pack' ),
358
- ),
359
- 'sitename' => array(
360
- 'name' => __( 'Site Name', 'all-in-one-seo-pack' ),
361
- 'default' => get_bloginfo( 'name' ),
362
- 'type' => 'text',
363
- ),
364
- 'hometitle' => array(
365
- 'name' => __( 'Home Title', 'all-in-one-seo-pack' ),
366
- 'default' => '',
367
- 'type' => 'textarea',
368
- 'condshow' => array(
369
- 'aiosp_opengraph_setmeta' => array(
370
- 'lhs' => 'aiosp_opengraph_setmeta',
371
- 'op' => '!=',
372
- 'rhs' => 'on',
373
- ),
374
- ),
375
- ),
376
- 'description' => array(
377
- 'name' => __( 'Home Description', 'all-in-one-seo-pack' ),
378
- 'default' => '',
379
- 'type' => 'textarea',
380
- 'condshow' => array(
381
- 'aiosp_opengraph_setmeta' => array(
382
- 'lhs' => 'aiosp_opengraph_setmeta',
383
- 'op' => '!=',
384
- 'rhs' => 'on',
385
- ),
386
- ),
387
- ),
388
- 'homeimage' => array(
389
- 'name' => __( 'Home Image', 'all-in-one-seo-pack' ),
390
- 'type' => 'image',
391
- ),
392
- 'generate_descriptions' => array(
393
- 'name' => __( 'Use Content For Autogenerated OG Descriptions', 'all-in-one-seo-pack' ),
394
- 'default' => 0,
395
- ),
396
- 'defimg' => array(
397
- 'name' => __( 'Select OG:Image Source', 'all-in-one-seo-pack' ),
398
- 'type' => 'select',
399
- 'initial_options' => array(
400
- '' => __( 'Default Image' ),
401
- 'featured' => __( 'Featured Image' ),
402
- 'attach' => __( 'First Attached Image' ),
403
- 'content' => __( 'First Image In Content' ),
404
- 'custom' => __( 'Image From Custom Field' ),
405
- 'author' => __( 'Post Author Image' ),
406
- 'auto' => __( 'First Available Image' ),
407
- ),
408
- ),
409
- 'fallback' => array(
410
- 'name' => __( 'Use Default If No Image Found', 'all-in-one-seo-pack' ),
411
- 'type' => 'checkbox',
412
- ),
413
- 'dimg' => array(
414
- 'name' => __( 'Default OG:Image', 'all-in-one-seo-pack' ),
415
- 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png',
416
- 'type' => 'image',
417
- ),
418
- 'dimgwidth' => array(
419
- 'name' => __( 'Default Image Width', 'all-in-one-seo-pack' ),
420
- 'type' => 'text',
421
- 'default' => '',
422
- ),
423
- 'dimgheight' => array(
424
- 'name' => __( 'Default Image Height', 'all-in-one-seo-pack' ),
425
- 'type' => 'text',
426
- 'default' => '',
427
- ),
428
- 'meta_key' => array(
429
- 'name' => __( 'Use Custom Field For Image', 'all-in-one-seo-pack' ),
430
- 'type' => 'text',
431
- 'default' => '',
432
- ),
433
- 'image' => array(
434
- 'name' => __( 'Image', 'all-in-one-seo-pack' ),
435
- 'type' => 'radio',
436
- 'initial_options' => array(
437
- 0 => '<img style="width:50px;height:auto;display:inline-block;vertical-align:bottom;" src="' . AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png' . '">',
438
- ),
439
- ),
440
- 'customimg' => array(
441
- 'name' => __( 'Custom Image', 'all-in-one-seo-pack' ),
442
- 'type' => 'image',
443
- ),
444
- 'imagewidth' => array(
445
- 'name' => __( 'Specify Image Width', 'all-in-one-seo-pack' ),
446
- 'type' => 'text',
447
- 'default' => '',
448
- ),
449
- 'imageheight' => array(
450
- 'name' => __( 'Specify Image Height', 'all-in-one-seo-pack' ),
451
- 'type' => 'text',
452
- 'default' => '',
453
- ),
454
- 'video' => array(
455
- 'name' => __( 'Custom Video', 'all-in-one-seo-pack' ),
456
- 'type' => 'text',
457
- ),
458
- 'videowidth' => array(
459
- 'name' => __( 'Specify Video Width', 'all-in-one-seo-pack' ),
460
- 'type' => 'text',
461
- 'default' => '',
462
- 'condshow' => array(
463
- 'aioseop_opengraph_settings_video' => array(
464
- 'lhs' => 'aioseop_opengraph_settings_video',
465
- 'op' => '!=',
466
- 'rhs' => '',
467
- ),
468
- ),
469
- ),
470
- 'videoheight' => array(
471
- 'name' => __( 'Specify Video Height', 'all-in-one-seo-pack' ),
472
- 'type' => 'text',
473
- 'default' => '',
474
- 'condshow' => array(
475
- 'aioseop_opengraph_settings_video' => array(
476
- 'lhs' => 'aioseop_opengraph_settings_video',
477
- 'op' => '!=',
478
- 'rhs' => '',
479
- ),
480
- ),
481
- ),
482
- 'defcard' => array(
483
- 'name' => __( 'Default Twitter Card', 'all-in-one-seo-pack' ),
484
- 'type' => 'select',
485
- 'default' => 'summary',
486
- 'initial_options' => array(
487
- 'summary' => __( 'Summary', 'all-in-one-seo-pack' ),
488
- 'summary_large_image' => __( 'Summary Large Image', 'all-in-one-seo-pack' ),
489
-
490
- /*
491
- REMOVING THIS TWITTER CARD TYPE FROM SOCIAL META MODULE
492
- 'photo' => __( 'Photo', 'all-in-one-seo-pack' )
493
- */
494
- ),
495
- ),
496
- 'setcard' => array(
497
- 'name' => __( 'Twitter Card Type', 'all-in-one-seo-pack' ),
498
- 'type' => 'select',
499
- 'initial_options' => array(
500
- 'summary_large_image' => __( 'Summary Large Image', 'all-in-one-seo-pack' ),
501
- 'summary' => __( 'Summary', 'all-in-one-seo-pack' ),
502
-
503
- /*
504
- REMOVING THIS TWITTER CARD TYPE FROM SOCIAL META MODULE
505
- 'photo' => __( 'Photo', 'all-in-one-seo-pack' )
506
- */
507
- ),
508
- ),
509
- 'twitter_site' => array(
510
- 'name' => __( 'Twitter Site', 'all-in-one-seo-pack' ),
511
- 'type' => 'text',
512
- 'default' => '',
513
- ),
514
- 'twitter_creator' => array(
515
- 'name' => __( 'Show Twitter Author', 'all-in-one-seo-pack' ),
516
- ),
517
- 'twitter_domain' => array(
518
- 'name' => __( 'Twitter Domain', 'all-in-one-seo-pack' ),
519
- 'type' => 'text',
520
- 'default' => '',
521
- ),
522
- 'customimg_twitter' => array(
523
- 'name' => __( 'Custom Twitter Image', 'all-in-one-seo-pack' ),
524
- 'type' => 'image',
525
- ),
526
- 'gen_tags' => array(
527
- 'name' => __( 'Automatically Generate Article Tags', 'all-in-one-seo-pack' ),
528
- ),
529
- 'gen_keywords' => array(
530
- 'name' => __( 'Use Keywords In Article Tags', 'all-in-one-seo-pack' ),
531
- 'default' => 'on',
532
- 'condshow' => array( 'aiosp_opengraph_gen_tags' => 'on' ),
533
- ),
534
- 'gen_categories' => array(
535
- 'name' => __( 'Use Categories In Article Tags', 'all-in-one-seo-pack' ),
536
- 'default' => 'on',
537
- 'condshow' => array( 'aiosp_opengraph_gen_tags' => 'on' ),
538
- ),
539
- 'gen_post_tags' => array(
540
- 'name' => __( 'Use Post Tags In Article Tags', 'all-in-one-seo-pack' ),
541
- 'default' => 'on',
542
- 'condshow' => array( 'aiosp_opengraph_gen_tags' => 'on' ),
543
- ),
544
- 'types' => array(
545
- 'name' => __( 'Enable Facebook Meta for Post Types', 'all-in-one-seo-pack' ),
546
- 'type' => 'multicheckbox',
547
- 'default' => array( 'post' => 'post', 'page' => 'page' ),
548
- 'initial_options' => $this->get_post_type_titles( array( '_builtin' => false ) ),
549
- ),
550
- 'title' => array(
551
- 'name' => __( 'Title', 'all-in-one-seo-pack' ),
552
- 'default' => '',
553
- 'type' => 'text',
554
- 'size' => 95,
555
- 'count' => 1,
556
- 'count_desc' => $count_desc,
557
- ),
558
- 'desc' => array(
559
- 'name' => __( 'Description', 'all-in-one-seo-pack' ),
560
- 'default' => '',
561
- 'type' => 'textarea',
562
- 'cols' => 250,
563
- 'rows' => 4,
564
- 'count' => 1,
565
- 'count_desc' => $count_desc,
566
- ),
567
- 'category' => array(
568
- 'name' => __( 'Facebook Object Type', 'all-in-one-seo-pack' ),
569
- 'type' => 'select',
570
- 'style' => '',
571
- 'default' => '',
572
- 'initial_options' => $this->fb_object_types,
573
- ),
574
- 'facebook_debug' => array(
575
- 'name' => __( 'Facebook Debug', 'all-in-one-seo-pack' ),
576
- 'type' => 'html',
577
- 'save' => false,
578
- 'default' => '<a
579
- name="aioseop_opengraph_settings_facebook_debug"
580
- id="aioseop_opengraph_settings_facebook_debug"
581
- class="button-primary"
582
- href=""
583
- target="_blank">' . __( 'Debug This Post', 'all-in-one-seo-pack' ) . '</a>',
584
- ),
585
- 'section' => array(
586
- 'name' => __( 'Article Section', 'all-in-one-seo-pack' ),
587
- 'type' => 'text',
588
- 'default' => '',
589
- 'condshow' => array( 'aioseop_opengraph_settings_category' => 'article' ),
590
- ),
591
- 'tag' => array(
592
- 'name' => __( 'Article Tags', 'all-in-one-seo-pack' ),
593
- 'type' => 'text',
594
- 'default' => '',
595
- 'condshow' => array( 'aioseop_opengraph_settings_category' => 'article' ),
596
- ),
597
- 'facebook_publisher' => array(
598
- 'name' => __( 'Show Facebook Publisher on Articles', 'all-in-one-seo-pack' ),
599
- 'type' => 'text',
600
- 'default' => '',
601
- ),
602
- 'facebook_author' => array(
603
- 'name' => __( 'Show Facebook Author on Articles', 'all-in-one-seo-pack' ),
604
- ),
605
- 'profile_links' => array(
606
- 'name' => __( 'Social Profile Links', 'all-in-one-seo-pack' ),
607
- 'type' => 'textarea',
608
- 'cols' => 60,
609
- 'rows' => 5,
610
- ),
611
- 'person_or_org' => array(
612
- 'name' => __( 'Person or Organization?', 'all-in-one-seo-pack' ),
613
- 'type' => 'radio',
614
- 'initial_options' => array(
615
- 'person' => __( 'Person', 'all-in-one-seo-pack' ),
616
- 'org' => __( 'Organization', 'all-in-one-seo-pack' ),
617
- ),
618
- ),
619
- 'social_name' => array(
620
- 'name' => __( 'Associated Name', 'all-in-one-seo-pack' ),
621
- 'type' => 'text',
622
- 'default' => '',
623
- ),
624
- );
625
- // load initial options / set defaults
626
- $this->update_options();
627
- $display = array();
628
- if ( isset( $this->options['aiosp_opengraph_types'] ) && ! empty( $this->options['aiosp_opengraph_types'] ) ) {
629
- $display = $this->options['aiosp_opengraph_types'];
630
- }
631
- $this->locations = array(
632
- 'opengraph' => array(
633
- 'name' => $this->name,
634
- 'prefix' => 'aiosp_',
635
- 'type' => 'settings',
636
- 'options' => array(
637
- 'scan_header',
638
- 'setmeta',
639
- 'key',
640
- 'appid',
641
- 'sitename',
642
- 'title_shortcodes',
643
- 'description_shortcodes',
644
- 'hometitle',
645
- 'description',
646
- 'homeimage',
647
- 'generate_descriptions',
648
- 'defimg',
649
- 'fallback',
650
- 'dimg',
651
- 'dimgwidth',
652
- 'dimgheight',
653
- 'meta_key',
654
- 'defcard',
655
- 'profile_links',
656
- 'person_or_org',
657
- 'social_name',
658
- 'twitter_site',
659
- 'twitter_creator',
660
- 'twitter_domain',
661
- 'gen_tags',
662
- 'gen_keywords',
663
- 'gen_categories',
664
- 'gen_post_tags',
665
- 'types',
666
- 'facebook_publisher',
667
- 'facebook_author',
668
- ),
669
- ),
670
- 'settings' => array(
671
- 'name' => __( 'Social Settings', 'all-in-one-seo-pack' ),
672
- 'type' => 'metabox',
673
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/',
674
- 'options' => array(
675
- 'title',
676
- 'desc',
677
- 'image',
678
- 'customimg',
679
- 'imagewidth',
680
- 'imageheight',
681
- 'video',
682
- 'videowidth',
683
- 'videoheight',
684
- 'category',
685
- 'facebook_debug',
686
- 'section',
687
- 'tag',
688
- 'setcard',
689
- 'customimg_twitter',
690
- ),
691
- 'display' => apply_filters( 'aioseop_opengraph_display', $display ),
692
- 'prefix' => 'aioseop_opengraph_',
693
- ),
694
- );
695
- $this->layout = array(
696
- 'home' => array(
697
- 'name' => __( 'Home Page Settings', 'all-in-one-seo-pack' ),
698
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#use-aioseo-title-and-description',
699
- 'options' => array( 'setmeta', 'sitename', 'hometitle', 'description', 'homeimage' ),
700
- ),
701
- 'image' => array(
702
- 'name' => __( 'Image Settings', 'all-in-one-seo-pack' ),
703
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#select-og-image-source',
704
- 'options' => array( 'defimg', 'fallback', 'dimg', 'dimgwidth', 'dimgheight', 'meta_key' ),
705
- ),
706
- 'links' => array(
707
- 'name' => __( 'Social Profile Links', 'all-in-one-seo-pack' ),
708
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links',
709
- 'options' => array( 'profile_links', 'person_or_org', 'social_name' ),
710
- ),
711
- 'facebook' => array(
712
- 'name' => __( 'Facebook Settings', 'all-in-one-seo-pack' ),
713
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#facebook-settings',
714
- 'options' => array(
715
- 'key',
716
- 'appid',
717
- 'types',
718
- 'gen_tags',
719
- 'gen_keywords',
720
- 'gen_categories',
721
- 'gen_post_tags',
722
- 'facebook_publisher',
723
- 'facebook_author',
724
- ),
725
- ),
726
- 'twitter' => array(
727
- 'name' => __( 'Twitter Settings', 'all-in-one-seo-pack' ),
728
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#default-twitter-card',
729
- 'options' => array( 'defcard', 'setcard', 'twitter_site', 'twitter_creator', 'twitter_domain' ),
730
- ),
731
- 'default' => array(
732
- 'name' => __( 'Advanced Settings', 'all-in-one-seo-pack' ),
733
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/',
734
- 'options' => array(), // this is set below, to the remaining options -- pdb
735
- ),
736
- 'scan_meta' => array(
737
- 'name' => __( 'Scan Social Meta', 'all-in-one-seo-pack' ),
738
- 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#scan_meta',
739
- 'options' => array( 'scan_header' ),
740
- ),
741
- );
742
- $other_options = array();
743
- foreach ( $this->layout as $k => $v ) {
744
- $other_options = array_merge( $other_options, $v['options'] );
745
- }
746
-
747
- $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
748
- }
749
-
750
- /**
751
- * Forces FaceBook OpenGraph to refresh its cache when a post is changed to
752
- *
753
- * @param $new_status
754
- * @param $old_status
755
- * @param $post
756
- *
757
- * @todo this and force_fb_refresh_update can probably have the remote POST extracted out.
758
- *
759
- * @see https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
760
- * @since 2.3.11
761
- */
762
- function force_fb_refresh_transition( $new_status, $old_status, $post ) {
763
- if ( 'publish' !== $new_status ) {
764
- return;
765
- }
766
- if ( 'future' !== $old_status ) {
767
- return;
768
- }
769
-
770
- $current_post_type = get_post_type();
771
-
772
- // Only ping Facebook if Social SEO is enabled on this post type.
773
- if ( $this->option_isset( 'types' ) && is_array( $this->options['aiosp_opengraph_types'] ) && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
774
- $post_url = aioseop_get_permalink( $post->ID );
775
- $endpoint = sprintf(
776
- 'https://graph.facebook.com/?%s', http_build_query(
777
- array(
778
- 'id' => $post_url,
779
- 'scrape' => true,
780
- )
781
- )
782
- );
783
- wp_remote_post( $endpoint, array( 'blocking' => false ) );
784
- }
785
- }
786
-
787
- /**
788
- * Forces FaceBook OpenGraph refresh on update.
789
- *
790
- * @param $post_id
791
- * @param $post_after
792
- *
793
- * @see https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
794
- * @since 2.3.11
795
- */
796
- function force_fb_refresh_update( $post_id, $post_after ) {
797
-
798
- $current_post_type = get_post_type();
799
-
800
- // Only ping Facebook if Social SEO is enabled on this post type.
801
- if ( 'publish' === $post_after->post_status && $this->option_isset( 'types' ) && is_array( $this->options['aiosp_opengraph_types'] ) && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
802
- $post_url = aioseop_get_permalink( $post_id );
803
- $endpoint = sprintf(
804
- 'https://graph.facebook.com/?%s', http_build_query(
805
- array(
806
- 'id' => $post_url,
807
- 'scrape' => true,
808
- )
809
- )
810
- );
811
- wp_remote_post( $endpoint, array( 'blocking' => false ) );
812
- }
813
- }
814
-
815
- function settings_page_init() {
816
- add_filter( 'aiosp_output_option', array( $this, 'display_custom_options' ), 10, 2 );
817
- }
818
-
819
- function filter_options( $options, $location ) {
820
- if ( $location == 'settings' ) {
821
- $prefix = $this->get_prefix( $location ) . $location . '_';
822
- list( $legacy, $images ) = $this->get_all_images( $options );
823
- if ( isset( $options ) && isset( $options[ "{$prefix}image" ] ) ) {
824
- $thumbnail = $options[ "{$prefix}image" ];
825
- if ( ctype_digit( (string) $thumbnail ) || ( $thumbnail == 'post' ) ) {
826
- if ( $thumbnail == 'post' ) {
827
- $thumbnail = $images['post1'];
828
- } elseif ( ! empty( $legacy[ $thumbnail ] ) ) {
829
- $thumbnail = $legacy[ $thumbnail ];
830
- }
831
- }
832
- $options[ "{$prefix}image" ] = $thumbnail;
833
- }
834
- if ( empty( $options[ $prefix . 'image' ] ) ) {
835
- $img = array_keys( $images );
836
- if ( ! empty( $img ) && ! empty( $img[1] ) ) {
837
- $options[ $prefix . 'image' ] = $img[1];
838
- }
839
- }
840
- }
841
-
842
- return $options;
843
- }
844
-
845
- /**
846
- * Applies filter to module settings.
847
- *
848
- * @since 2.3.11
849
- * @since 2.4.14 Added filter for description and title placeholders.
850
- * @since 2.3.15 do_shortcode on description.
851
- *
852
- * @see [plugin]\admin\aioseop_module_class.php > display_options()
853
- */
854
- function filter_settings( $settings, $location, $current ) {
855
- global $aiosp, $post;
856
- if ( $location == 'opengraph' || $location == 'settings' ) {
857
- $prefix = $this->get_prefix( $location ) . $location . '_';
858
- if ( $location == 'opengraph' ) {
859
- return $settings;
860
- }
861
- if ( $location == 'settings' ) {
862
- list( $legacy, $settings[ $prefix . 'image' ]['initial_options'] ) = $this->get_all_images( $current );
863
- $opts = array( 'title', 'desc' );
864
- $current_post_type = get_post_type();
865
- if ( isset( $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
866
- $flat_type_list = array();
867
- foreach ( $this->fb_object_types as $k => $v ) {
868
- if ( is_array( $v ) ) {
869
- $flat_type_list = array_merge( $flat_type_list, $v );
870
- } else {
871
- $flat_type_list[ $k ] = $v;
872
- }
873
- }
874
- $settings[ $prefix . 'category' ]['initial_options'] = array_merge(
875
- array(
876
- $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] => __( 'Default ', 'all-in-one-seo-pack' ) . ' - '
877
- . $flat_type_list[ $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ],
878
- ),
879
- $settings[ $prefix . 'category' ]['initial_options']
880
- );
881
- }
882
- if ( isset( $this->options['aiosp_opengraph_defcard'] ) ) {
883
- $settings[ $prefix . 'setcard' ]['default'] = $this->options['aiosp_opengraph_defcard'];
884
- }
885
- $info = $aiosp->get_page_snippet_info();
886
- $title = $info['title'];
887
- $description = $info['description'];
888
-
889
- // Description options
890
- if ( is_object( $post ) ) {
891
- // Always show excerpt
892
- $description = empty( $this->options['aiosp_opengraph_generate_descriptions'] )
893
- ? $aiosp->trim_excerpt_without_filters(
894
- $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ),
895
- 1000
896
- )
897
- : $aiosp->trim_excerpt_without_filters(
898
- $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ),
899
- 1000
900
- );
901
- }
902
-
903
- // #1308 - we want to make sure we are ignoring php version only in the admin area while editing the post, so that it does not impact #932.
904
- $screen = get_current_screen();
905
- $ignore_php_version = is_admin() && isset( $screen->id ) && 'post' == $screen->id;
906
-
907
- // Add filters
908
- $description = apply_filters( 'aioseop_description', $description, false, $ignore_php_version );
909
- // Add placholders
910
- $settings[ "{$prefix}title" ]['placeholder'] = apply_filters( 'aioseop_opengraph_placeholder', $title );
911
- $settings[ "{$prefix}desc" ]['placeholder'] = apply_filters( 'aioseop_opengraph_placeholder', $description );
912
- }
913
- if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] ) {
914
- foreach ( $opts as $opt ) {
915
- if ( isset( $settings[ $prefix . $opt ] ) ) {
916
- $settings[ $prefix . $opt ]['type'] = 'hidden';
917
- $settings[ $prefix . $opt ]['label'] = 'none';
918
- $settings[ $prefix . $opt ]['help_text'] = '';
919
- unset( $settings[ $prefix . $opt ]['count'] );
920
- }
921
- }
922
- }
923
- }
924
-
925
- return $settings;
926
- }
927
-
928
- /**
929
- * Applies filter to module options.
930
- * These will display in the "Social Settings" object tab.
931
- * filter:{prefix}override_options
932
- *
933
- * @since 2.3.11
934
- * @since 2.4.14 Overrides empty og:type values.
935
- *
936
- * @see [plugin]\admin\aioseop_module_class.php > display_options()
937
- *
938
- * @global array $aioseop_options Plugin options.
939
- *
940
- * @param array $options Current options.
941
- * @param string $location Location where filter is called.
942
- * @param array $settings Settings.
943
- *
944
- * @return array
945
- */
946
- function override_options( $options, $location, $settings ) {
947
- global $aioseop_options;
948
- // Prepare default and prefix
949
- $prefix = $this->get_prefix( $location ) . $location . '_';
950
- $opts = array();
951
-
952
- foreach ( $settings as $k => $v ) {
953
- if ( $v['save'] ) {
954
- $opts[ $k ] = $v['default'];
955
- }
956
- }
957
- foreach ( $options as $k => $v ) {
958
- switch ( $k ) {
959
- case $prefix . 'category':
960
- if ( empty( $v ) ) {
961
- // Get post type
962
- $type = isset( get_current_screen()->post_type )
963
- ? get_current_screen()->post_type
964
- : null;
965
- // Assign default from plugin options
966
- if ( ! empty( $type )
967
- && isset( $aioseop_options['modules'] )
968
- && isset( $aioseop_options['modules']['aiosp_opengraph_options'] )
969
- && isset( $aioseop_options['modules']['aiosp_opengraph_options'][ 'aiosp_opengraph_' . $type . '_fb_object_type' ] )
970
- ) {
971
- $options[ $prefix . 'category' ] =
972
- $aioseop_options['modules']['aiosp_opengraph_options'][ 'aiosp_opengraph_' . $type . '_fb_object_type' ];
973
- }
974
- }
975
- break;
976
- }
977
- if ( $v === null ) {
978
- unset( $options[ $k ] );
979
- }
980
- }
981
- $options = wp_parse_args( $options, $opts );
982
-
983
- return $options;
984
- }
985
-
986
- /**
987
- * Applies filter to metabox settings before they are saved.
988
- * Sets custom as default if a custom image is uploaded.
989
- * filter:{prefix}filter_metabox_options
990
- * filter:{prefix}filter_term_metabox_options
991
- *
992
- * @since 2.3.11
993
- * @since 2.4.14 Fixes for aioseop-pro #67 and other bugs found.
994
- *
995
- * @see [plugin]\admin\aioseop_module_class.php > save_post_data()
996
- * @see [this file] > save_tax_data()
997
- *
998
- * @param array $options List of current options.
999
- * @param string $location Location where filter is called.
1000
- * @param int $id Either post_id or term_id.
1001
- *
1002
- * @return array
1003
- */
1004
- function filter_metabox_options( $options, $location, $post_id ) {
1005
- if ( $location == 'settings' ) {
1006
- $prefix = $this->get_prefix( $location ) . $location . '_';
1007
- if ( isset( $options[ $prefix . 'customimg_checker' ] )
1008
- && $options[ $prefix . 'customimg_checker' ]
1009
- ) {
1010
- $options[ $prefix . 'image' ] = $options[ $prefix . 'customimg' ];
1011
- }
1012
- }
1013
- return $options;
1014
- }
1015
-
1016
- /** Custom settings **/
1017
- function display_custom_options( $buf, $args ) {
1018
- if ( $args['name'] == 'aiosp_opengraph_scan_header' ) {
1019
- $buf .= '<div class="aioseop aioseop_options aiosp_opengraph_settings"><div class="aioseop_wrapper aioseop_custom_type" id="aiosp_opengraph_scan_header_wrapper"><div class="aioseop_input" id="aiosp_opengraph_scan_header" style="padding-left:20px;">';
1020
- $args['options']['type'] = 'submit';
1021
- $args['attr'] = " class='button-primary' ";
1022
- $args['value'] = $args['options']['default'] = __( 'Scan Now', 'all-in-one-seo-pack' );
1023
- $buf .= __( 'Scan your site for duplicate social meta tags.', 'all-in-one-seo-pack' );
1024
- $buf .= '<br /><br />' . $this->get_option_html( $args );
1025
- $buf .= '</div></div></div>';
1026
- }
1027
-
1028
- return $buf;
1029
- }
1030
-
1031
- function add_attributes( $output ) {
1032
- // avoid having duplicate meta tags
1033
- $type = $this->type;
1034
- if ( empty( $type ) ) {
1035
- $type = 'website';
1036
- }
1037
- $schema_types = array(
1038
- 'album' => 'MusicAlbum',
1039
- 'article' => 'Article',
1040
- 'bar' => 'BarOrPub',
1041
- 'blog' => 'Blog',
1042
- 'book' => 'Book',
1043
- 'cafe' => 'CafeOrCoffeeShop',
1044
- 'city' => 'City',
1045
- 'country' => 'Country',
1046
- 'episode' => 'Episode',
1047
- 'food' => 'FoodEvent',
1048
- 'game' => 'Game',
1049
- 'hotel' => 'Hotel',
1050
- 'landmark' => 'LandmarksOrHistoricalBuildings',
1051
- 'movie' => 'Movie',
1052
- 'product' => 'Product',
1053
- 'profile' => 'ProfilePage',
1054
- 'restaurant' => 'Restaurant',
1055
- 'school' => 'School',
1056
- 'sport' => 'SportsEvent',
1057
- 'website' => 'WebSite',
1058
- );
1059
-
1060
- if ( ! empty( $schema_types[ $type ] ) ) {
1061
- $type = $schema_types[ $type ];
1062
- } else {
1063
- $type = 'WebSite';
1064
- }
1065
-
1066
- $attributes = apply_filters(
1067
- $this->prefix . 'attributes', array(
1068
- 'prefix="og: http://ogp.me/ns#"',
1069
- )
1070
- );
1071
-
1072
- foreach ( $attributes as $attr ) {
1073
- if ( strpos( $output, $attr ) === false ) {
1074
- $output .= "\n\t$attr ";
1075
- }
1076
- }
1077
-
1078
- return $output;
1079
- }
1080
-
1081
- /**
1082
- * Add our social meta.
1083
- *
1084
- * @since 1.0.0
1085
- * @since 2.3.11.5 Support for multiple fb_admins.
1086
- * @since 2.3.13 Adds filter:aioseop_description on description.
1087
- * @since 2.4.14 Fixes for aioseop-pro #67.
1088
- * @since 2.3.15 Always do_shortcode on descriptions, removed for titles.
1089
- *
1090
- * @global object $post Current WP_Post object.
1091
- * @global object $aiosp All in one seo plugin object.
1092
- * @global array $aioseop_options All in one seo plugin options.
1093
- * @global object $wp_query WP_Query global instance.
1094
- */
1095
- function add_meta() {
1096
- global $post, $aiosp, $aioseop_options, $wp_query;
1097
- $metabox = $this->get_current_options( array(), 'settings' );
1098
- $key = $this->options['aiosp_opengraph_key'];
1099
- $key = $this->options['aiosp_opengraph_key'];
1100
- $dimg = $this->options['aiosp_opengraph_dimg'];
1101
- $current_post_type = get_post_type();
1102
- $title = $description = $image = $video = '';
1103
- $type = $this->type;
1104
- $sitename = $this->options['aiosp_opengraph_sitename'];
1105
-
1106
- $appid = isset( $this->options['aiosp_opengraph_appid'] ) ? $this->options['aiosp_opengraph_appid'] : '';
1107
-
1108
- if ( ! empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
1109
- $first_page = false;
1110
- if ( $aiosp->get_page_number() < 2 ) {
1111
- $first_page = true;
1112
- }
1113
- } else {
1114
- $first_page = true;
1115
- }
1116
- $url = $aiosp->aiosp_mrt_get_url( $wp_query );
1117
- $url = apply_filters( 'aioseop_canonical_url', $url );
1118
-
1119
- $setmeta = $this->options['aiosp_opengraph_setmeta'];
1120
- $social_links = '';
1121
- if ( is_front_page() ) {
1122
- $title = $this->options['aiosp_opengraph_hometitle'];
1123
- if ( $first_page ) {
1124
- $description = $this->options['aiosp_opengraph_description'];
1125
- if ( empty( $description ) ) {
1126
- $description = get_bloginfo( 'description' );
1127
- }
1128
- }
1129
- if ( ! empty( $this->options['aiosp_opengraph_homeimage'] ) ) {
1130
- $thumbnail = $this->options['aiosp_opengraph_homeimage'];
1131
- } else {
1132
- $thumbnail = $this->options['aiosp_opengraph_dimg'];
1133
- }
1134
-
1135
- /* If Use AIOSEO Title and Desc Selected */
1136
- if ( $setmeta ) {
1137
- $title = $aiosp->wp_title();
1138
- if ( $first_page ) {
1139
- $description = $aiosp->get_aioseop_description( $post );
1140
- }
1141
- }
1142
-
1143
- /* Add some defaults */
1144
- if ( empty( $title ) ) {
1145
- $title = get_bloginfo( 'name' );
1146
- }
1147
- if ( empty( $sitename ) ) {
1148
- $sitename = get_bloginfo( 'name' );
1149
- }
1150
-
1151
- if ( empty( $description ) && $first_page && ! empty( $post ) && ! post_password_required( $post ) ) {
1152
-
1153
- if ( ! empty( $post->post_content ) || ! empty( $post->post_excerpt ) ) {
1154
- $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ), 1000 );
1155
-
1156
- if ( ! empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) {
1157
- $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
1158
- }
1159
- }
1160
- }
1161
-
1162
- if ( empty( $description ) && $first_page ) {
1163
- $description = get_bloginfo( 'description' );
1164
- }
1165
- if ( ! empty( $this->options['aiosp_opengraph_profile_links'] ) ) {
1166
- $social_links = $this->options['aiosp_opengraph_profile_links'];
1167
- if ( ! empty( $this->options['aiosp_opengraph_social_name'] ) ) {
1168
- $social_name = $this->options['aiosp_opengraph_social_name'];
1169
- } else {
1170
- $social_name = '';
1171
- }
1172
- if ( $this->options['aiosp_opengraph_person_or_org'] == 'person' ) {
1173
- $social_type = 'Person';
1174
- } else {
1175
- $social_type = 'Organization';
1176
- }
1177
- }
1178
- } elseif ( is_singular() && $this->option_isset( 'types' )
1179
- && is_array( $this->options['aiosp_opengraph_types'] )
1180
- && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] )
1181
- ) {
1182
-
1183
- if ( $type == 'article' ) {
1184
- if ( ! empty( $metabox['aioseop_opengraph_settings_section'] ) ) {
1185
- $section = $metabox['aioseop_opengraph_settings_section'];
1186
- }
1187
- if ( ! empty( $metabox['aioseop_opengraph_settings_tag'] ) ) {
1188
- $tag = $metabox['aioseop_opengraph_settings_tag'];
1189
- }
1190
- if ( ! empty( $this->options['aiosp_opengraph_facebook_publisher'] ) ) {
1191
- $publisher = $this->options['aiosp_opengraph_facebook_publisher'];
1192
- }
1193
- }
1194
-
1195
- if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
1196
- $domain = $this->options['aiosp_opengraph_twitter_domain'];
1197
- }
1198
-
1199
- if ( $type == 'article' && ! empty( $post ) ) {
1200
- if ( isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_facebook_author'] ) ) {
1201
- $author = get_the_author_meta( 'facebook', $post->post_author );
1202
- }
1203
-
1204
- if ( isset( $post->post_date_gmt ) ) {
1205
- $published_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_date_gmt ) );
1206
- }
1207
-
1208
- if ( isset( $post->post_modified_gmt ) ) {
1209
- $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified_gmt ) );
1210
- }
1211
- }
1212
-
1213
- $image = $metabox['aioseop_opengraph_settings_image'];
1214
- $video = $metabox['aioseop_opengraph_settings_video'];
1215
- $title = $metabox['aioseop_opengraph_settings_title'];
1216
- $description = $metabox['aioseop_opengraph_settings_desc'];
1217
-
1218
- /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
1219
- global $aiosp;
1220
- if ( empty( $title ) ) {
1221
- $title = $aiosp->wp_title();
1222
- }
1223
- if ( empty( $description ) ) {
1224
- $description = trim( strip_tags( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
1225
- }
1226
-
1227
- /* Add default title */
1228
- if ( empty( $title ) ) {
1229
- $title = get_the_title();
1230
- }
1231
-
1232
- // Add default description.
1233
- if ( empty( $description ) && ! post_password_required( $post ) ) {
1234
-
1235
- $description = $post->post_excerpt;
1236
-
1237
- if ( $this->options['aiosp_opengraph_generate_descriptions'] || empty( $description ) ) {
1238
- $description = $post->post_content;
1239
- }
1240
- }
1241
- if ( empty( $type ) ) {
1242
- $type = 'article';
1243
- }
1244
- } elseif ( AIOSEOPPRO && ( is_category() || is_tag() || is_tax() ) ) {
1245
- if ( isset( $this->options['aioseop_opengraph_settings_category'] ) ) {
1246
- $type = $this->options['aioseop_opengraph_settings_category'];
1247
- }
1248
- if ( isset( $metabox['aioseop_opengraph_settings_category'] ) ) {
1249
- $type = $metabox['aioseop_opengraph_settings_category'];
1250
- }
1251
- if ( $type == 'article' ) {
1252
- if ( ! empty( $metabox['aioseop_opengraph_settings_section'] ) ) {
1253
- $section = $metabox['aioseop_opengraph_settings_section'];
1254
- }
1255
- if ( ! empty( $metabox['aioseop_opengraph_settings_tag'] ) ) {
1256
- $tag = $metabox['aioseop_opengraph_settings_tag'];
1257
- }
1258
- if ( ! empty( $this->options['aiosp_opengraph_facebook_publisher'] ) ) {
1259
- $publisher = $this->options['aiosp_opengraph_facebook_publisher'];
1260
- }
1261
- }
1262
- if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
1263
- $domain = $this->options['aiosp_opengraph_twitter_domain'];
1264
- }
1265
- if ( $type == 'article' && ! empty( $post ) ) {
1266
- if ( isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_facebook_author'] ) ) {
1267
- $author = get_the_author_meta( 'facebook', $post->post_author );
1268
- }
1269
-
1270
- if ( isset( $post->post_date_gmt ) ) {
1271
- $published_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_date_gmt ) );
1272
- }
1273
- if ( isset( $post->post_modified_gmt ) ) {
1274
- $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified_gmt ) );
1275
- }
1276
- }
1277
- $image = $metabox['aioseop_opengraph_settings_image'];
1278
- $video = $metabox['aioseop_opengraph_settings_video'];
1279
- $title = $metabox['aioseop_opengraph_settings_title'];
1280
- $description = $metabox['aioseop_opengraph_settings_desc'];
1281
- /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
1282
- global $aiosp;
1283
- if ( empty( $title ) ) {
1284
- $title = $aiosp->wp_title();
1285
- }
1286
- if ( empty( $description ) ) {
1287
- $term_id = isset( $_GET['tag_ID'] ) ? (int) $_GET['tag_ID'] : 0;
1288
- $term_id = $term_id ? $term_id : get_queried_object()->term_id;
1289
- $description = trim( strip_tags( get_term_meta( $term_id, '_aioseop_description', true ) ) );
1290
- }
1291
- // Add default title
1292
- if ( empty( $title ) ) {
1293
- $title = get_the_title();
1294
- }
1295
- // Add default description.
1296
- if ( empty( $description ) && ! post_password_required( $post ) ) {
1297
- $description = get_queried_object()->description;
1298
- }
1299
- if ( empty( $type ) ) {
1300
- // https://github.com/semperfiwebdesign/aioseop-pro/issues/321
1301
- if ( AIOSEOPPRO && ( is_category() || is_tag() || is_tax() ) ) {
1302
- $og_options = $aioseop_options['modules'][ $this->prefix . 'options' ];
1303
- $current_post_type = get_post_type();
1304
- // check if the post type's object type is set.
1305
- if ( isset( $og_options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
1306
- $type = $og_options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ];
1307
- } elseif ( in_array( $current_post_type, array( 'post', 'page' ) ) ) {
1308
- $type = 'article';
1309
- }
1310
- } else {
1311
- $type = 'website';
1312
- }
1313
- }
1314
- } elseif ( is_home() && ! is_front_page() ) {
1315
- // This is the blog page but not the homepage.
1316
- global $aiosp;
1317
- $image = $metabox['aioseop_opengraph_settings_image'];
1318
- $video = $metabox['aioseop_opengraph_settings_video'];
1319
- $title = $metabox['aioseop_opengraph_settings_title'];
1320
- $description = $metabox['aioseop_opengraph_settings_desc'];
1321
-
1322
- if ( empty( $description ) ) {
1323
- // If there's not social description, fall back to the SEO description.
1324
- $description = trim( strip_tags( get_post_meta( get_option( 'page_for_posts' ), '_aioseop_description', true ) ) );
1325
- }
1326
- if ( empty( $title ) ) {
1327
- $title = $aiosp->wp_title();
1328
- }
1329
- } else {
1330
- return;
1331
- }
1332
-
1333
- if ( $type === 'article' && ! empty( $post ) && is_singular() ) {
1334
- if ( ! empty( $this->options['aiosp_opengraph_gen_tags'] ) ) {
1335
- if ( ! empty( $this->options['aiosp_opengraph_gen_keywords'] ) ) {
1336
- $keywords = $aiosp->get_main_keywords();
1337
- $keywords = $this->apply_cf_fields( $keywords );
1338
- $keywords = apply_filters( 'aioseop_keywords', $keywords );
1339
- if ( ! empty( $keywords ) && ! empty( $tag ) ) {
1340
- $tag .= ',' . $keywords;
1341
- } elseif ( empty( $tag ) ) {
1342
- $tag = $keywords;
1343
- }
1344
- }
1345
- $tag = $aiosp->keyword_string_to_list( $tag );
1346
- if ( ! empty( $this->options['aiosp_opengraph_gen_categories'] ) ) {
1347
- $tag = array_merge( $tag, $aiosp->get_all_categories( $post->ID ) );
1348
- }
1349
- if ( ! empty( $this->options['aiosp_opengraph_gen_post_tags'] ) ) {
1350
- $tag = array_merge( $tag, $aiosp->get_all_tags( $post->ID ) );
1351
- }
1352
- }
1353
- if ( ! empty( $tag ) ) {
1354
- $tag = $aiosp->clean_keyword_list( $tag );
1355
- }
1356
- }
1357
-
1358
- if ( ! empty( $this->options['aiosp_opengraph_title_shortcodes'] ) ) {
1359
- $title = do_shortcode( $title );
1360
- }
1361
- if ( ! empty( $description ) ) {
1362
- $description = $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) );
1363
- if ( ! empty( $this->options['aiosp_opengraph_description_shortcodes'] ) ) {
1364
- $description = do_shortcode( $description );
1365
- }
1366
- $description = $aiosp->trim_excerpt_without_filters( $description, 1000 );
1367
- }
1368
-
1369
- $title = $this->apply_cf_fields( $title );
1370
- $description = $this->apply_cf_fields( $description );
1371
-
1372
- /* Data Validation */
1373
- $title = strip_tags( esc_attr( $title ) );
1374
- $sitename = strip_tags( esc_attr( $sitename ) );
1375
- $description = strip_tags( esc_attr( $description ) );
1376
-
1377
- if ( empty( $thumbnail ) && ! empty( $image ) ) {
1378
- $thumbnail = $image;
1379
- }
1380
-
1381
- // Add user supplied default image.
1382
- if ( empty( $thumbnail ) ) {
1383
- if ( empty( $this->options['aiosp_opengraph_defimg'] ) ) {
1384
- $thumbnail = $this->options['aiosp_opengraph_dimg'];
1385
- } else {
1386
- $img_type = $this->options['aiosp_opengraph_defimg'];
1387
- if ( ! empty( $post ) ) {
1388
- // Customize the type of image per post/post_type.
1389
- $img_type = apply_filters( $this->prefix . 'default_image_type', $img_type, $post, $type );
1390
- }
1391
- switch ( $img_type ) {
1392
- case 'featured':
1393
- $thumbnail = $this->get_the_image_by_post_thumbnail();
1394
- break;
1395
- case 'attach':
1396
- $thumbnail = $this->get_the_image_by_attachment();
1397
- break;
1398
- case 'content':
1399
- $thumbnail = $this->get_the_image_by_scan();
1400
- break;
1401
- case 'custom':
1402
- $meta_key = $this->options['aiosp_opengraph_meta_key'];
1403
- if ( ! empty( $meta_key ) && ! empty( $post ) ) {
1404
- $meta_key = explode( ',', $meta_key );
1405
- $thumbnail = $this->get_the_image_by_meta_key(
1406
- array(
1407
- 'post_id' => $post->ID,
1408
- 'meta_key' => $meta_key,
1409
- )
1410
- );
1411
- }
1412
- break;
1413
- case 'auto':
1414
- $thumbnail = $this->get_the_image();
1415
- break;
1416
- case 'author':
1417
- $thumbnail = $this->get_the_image_by_author();
1418
- break;
1419
- default:
1420
- $thumbnail = $this->options['aiosp_opengraph_dimg'];
1421
- }
1422
- }
1423
- }
1424
-
1425
- if ( empty( $thumbnail ) && ! empty( $this->options['aiosp_opengraph_fallback'] ) ) {
1426
- $thumbnail = $this->options['aiosp_opengraph_dimg'];
1427
- if ( ! empty( $post ) ) {
1428
- // Customize the default image per post/post_type.
1429
- $thumbnail = apply_filters( $this->prefix . 'default_image', $thumbnail, $post, $type );
1430
- }
1431
- }
1432
-
1433
- if ( ! empty( $thumbnail ) ) {
1434
- $thumbnail = esc_url( $thumbnail );
1435
- $thumbnail = set_url_scheme( $thumbnail );
1436
- }
1437
-
1438
- $width = $height = '';
1439
- if ( ! empty( $thumbnail ) ) {
1440
- if ( ! empty( $metabox['aioseop_opengraph_settings_imagewidth'] ) ) {
1441
- $width = $metabox['aioseop_opengraph_settings_imagewidth'];
1442
- }
1443
- if ( ! empty( $metabox['aioseop_opengraph_settings_imageheight'] ) ) {
1444
- $height = $metabox['aioseop_opengraph_settings_imageheight'];
1445
- }
1446
- if ( empty( $width ) && ! empty( $this->options['aiosp_opengraph_dimgwidth'] ) ) {
1447
- $width = $this->options['aiosp_opengraph_dimgwidth'];
1448
- }
1449
- if ( empty( $height ) && ! empty( $this->options['aiosp_opengraph_dimgheight'] ) ) {
1450
- $height = $this->options['aiosp_opengraph_dimgheight'];
1451
- }
1452
- }
1453
-
1454
- if ( ! empty( $video ) ) {
1455
- if ( ! empty( $metabox['aioseop_opengraph_settings_videowidth'] ) ) {
1456
- $videowidth = $metabox['aioseop_opengraph_settings_videowidth'];
1457
- }
1458
- if ( ! empty( $metabox['aioseop_opengraph_settings_videoheight'] ) ) {
1459
- $videoheight = $metabox['aioseop_opengraph_settings_videoheight'];
1460
- }
1461
- }
1462
-
1463
- $card = 'summary';
1464
- if ( ! empty( $this->options['aiosp_opengraph_defcard'] ) ) {
1465
- $card = $this->options['aiosp_opengraph_defcard'];
1466
- }
1467
-
1468
- if ( ! empty( $metabox['aioseop_opengraph_settings_setcard'] ) ) {
1469
- $card = $metabox['aioseop_opengraph_settings_setcard'];
1470
- }
1471
-
1472
- // support for changing legacy twitter cardtype-photo to summary large image
1473
- if ( $card == 'photo' ) {
1474
- $card = 'summary_large_image';
1475
- }
1476
-
1477
- $site = $domain = $creator = '';
1478
-
1479
- if ( ! empty( $this->options['aiosp_opengraph_twitter_site'] ) ) {
1480
- $site = $this->options['aiosp_opengraph_twitter_site'];
1481
- $site = AIOSEOP_Opengraph_Public::prepare_twitter_username( $site );
1482
- }
1483
-
1484
- if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
1485
- $domain = $this->options['aiosp_opengraph_twitter_domain'];
1486
- }
1487
-
1488
- if ( ! empty( $post ) && isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_twitter_creator'] ) ) {
1489
- $creator = get_the_author_meta( 'twitter', $post->post_author );
1490
- $creator = AIOSEOP_Opengraph_Public::prepare_twitter_username( $creator );
1491
- }
1492
-
1493
- if ( ! empty( $thumbnail ) ) {
1494
- $twitter_thumbnail = $thumbnail; // Default Twitter image if custom isn't set.
1495
- }
1496
-
1497
- if ( isset( $metabox['aioseop_opengraph_settings_customimg_twitter'] ) && ! empty( $metabox['aioseop_opengraph_settings_customimg_twitter'] ) ) {
1498
- // Set Twitter image from custom.
1499
- $twitter_thumbnail = set_url_scheme( $metabox['aioseop_opengraph_settings_customimg_twitter'] );
1500
- }
1501
-
1502
- // Apply last filters.
1503
- $description = apply_filters( 'aioseop_description', $description );
1504
-
1505
- $meta = array(
1506
- 'facebook' => array(
1507
- 'title' => 'og:title',
1508
- 'type' => 'og:type',
1509
- 'url' => 'og:url',
1510
- 'thumbnail' => 'og:image',
1511
- 'width' => 'og:image:width',
1512
- 'height' => 'og:image:height',
1513
- 'video' => 'og:video',
1514
- 'videowidth' => 'og:video:width',
1515
- 'videoheight' => 'og:video:height',
1516
- 'sitename' => 'og:site_name',
1517
- 'key' => 'fb:admins',
1518
- 'appid' => 'fb:app_id',
1519
- 'description' => 'og:description',
1520
- 'section' => 'article:section',
1521
- 'tag' => 'article:tag',
1522
- 'publisher' => 'article:publisher',
1523
- 'author' => 'article:author',
1524
- 'published_time' => 'article:published_time',
1525
- 'modified_time' => 'article:modified_time',
1526
- ),
1527
- 'twitter' => array(
1528
- 'card' => 'twitter:card',
1529
- 'site' => 'twitter:site',
1530
- 'creator' => 'twitter:creator',
1531
- 'domain' => 'twitter:domain',
1532
- 'title' => 'twitter:title',
1533
- 'description' => 'twitter:description',
1534
- 'twitter_thumbnail' => 'twitter:image',
1535
- ),
1536
- );
1537
-
1538
- // Only show if "use schema.org markup is checked".
1539
- if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
1540
- $meta['google+'] = array( 'thumbnail' => 'image' );
1541
- }
1542
-
1543
- $tags = array(
1544
- 'facebook' => array( 'name' => 'property', 'value' => 'content' ),
1545
- 'twitter' => array( 'name' => 'name', 'value' => 'content' ),
1546
- 'google+' => array( 'name' => 'itemprop', 'value' => 'content' ),
1547
- );
1548
-
1549
- foreach ( $meta as $t => $data ) {
1550
- foreach ( $data as $k => $v ) {
1551
- if ( empty( $$k ) ) {
1552
- $$k = '';
1553
- }
1554
- $filtered_value = $$k;
1555
- $filtered_value = apply_filters( $this->prefix . 'meta', $filtered_value, $t, $k );
1556
- if ( ! empty( $filtered_value ) ) {
1557
- if ( ! is_array( $filtered_value ) ) {
1558
- $filtered_value = array( $filtered_value );
1559
- }
1560
-
1561
- /**
1562
- * This is to accomodate multiple fb:admins on separate lines.
1563
- * @TODO Eventually we'll want to put this in its own function so things like images work too.
1564
- */
1565
- if ( 'key' === $k ) {
1566
- $fbadmins = explode( ',', str_replace( ' ', '', $filtered_value[0] ) ); // Trim spaces then turn comma-separated values into an array.
1567
- foreach ( $fbadmins as $fbadmin ) {
1568
- echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . $fbadmin . '" />' . "\n";
1569
- }
1570
- } else {
1571
- // For everything else.
1572
- foreach ( $filtered_value as $f ) {
1573
- // #1363: use esc_attr( $f ) instead of htmlspecialchars_decode( $f, ENT_QUOTES )
1574
- echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . esc_attr( $f ) . '" />' . "\n";
1575
- }
1576
- }
1577
- }
1578
- }
1579
- }
1580
- $social_link_schema = '';
1581
- if ( ! empty( $social_links ) ) {
1582
- $home_url = esc_url( get_home_url() );
1583
- $social_links = explode( "\n", $social_links );
1584
- foreach ( $social_links as $k => $v ) {
1585
- $v = trim( $v );
1586
- if ( empty( $v ) ) {
1587
- unset( $social_links[ $k ] );
1588
- } else {
1589
- $v = esc_url( $v );
1590
- $social_links[ $k ] = $v;
1591
- }
1592
- }
1593
- $social_links = join( '","', $social_links );
1594
- $social_link_schema = <<<END
1595
- <script type="application/ld+json">
1596
- { "@context" : "http://schema.org",
1597
- "@type" : "{$social_type}",
1598
- "name" : "{$social_name}",
1599
- "url" : "{$home_url}",
1600
- "sameAs" : ["{$social_links}"]
1601
- }
1602
- </script>
1603
-
1604
- END;
1605
- }
1606
-
1607
- // Only show if "use schema.org markup is checked".
1608
- if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
1609
- echo apply_filters( 'aiosp_opengraph_social_link_schema', $social_link_schema );
1610
- }
1611
- }
1612
-
1613
- /**
1614
- * Do / adds opengraph properties to meta.
1615
- * @since 2.3.11
1616
- *
1617
- * @global array $aioseop_options AIOSEOP plugin options.
1618
- */
1619
- public function do_opengraph() {
1620
- global $aioseop_options;
1621
- if ( ! empty( $aioseop_options )
1622
- && ! empty( $aioseop_options['aiosp_schema_markup'] )
1623
- ) {
1624
- add_filter( 'language_attributes', array( &$this, 'add_attributes' ) );
1625
- }
1626
- if ( ! defined( 'DOING_AJAX' ) ) {
1627
- add_action( 'aioseop_modules_wp_head', array( &$this, 'add_meta' ), 5 );
1628
- // Add social meta to AMP plugin.
1629
- if ( apply_filters( 'aioseop_enable_amp_social_meta', true ) === true ) {
1630
- add_action( 'amp_post_template_head', array( &$this, 'add_meta' ), 12 );
1631
- }
1632
- }
1633
- }
1634
-
1635
- /**
1636
- * Set up types.
1637
- *
1638
- * @since ?
1639
- * @since 2.3.15 Change to website for homepage and blog post index page, default to object.
1640
- */
1641
- function type_setup() {
1642
- $this->type = 'object'; // Default to type object if we don't have some other rule.
1643
-
1644
- if ( is_home() || is_front_page() ) {
1645
- $this->type = 'website'; // Home page and blog page should be website.
1646
- } elseif ( is_singular() && $this->option_isset( 'types' ) ) {
1647
- $metabox = $this->get_current_options( array(), 'settings' );
1648
- $current_post_type = get_post_type();
1649
- if ( ! empty( $metabox['aioseop_opengraph_settings_category'] ) ) {
1650
- $this->type = $metabox['aioseop_opengraph_settings_category'];
1651
- } elseif ( isset( $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
1652
- $this->type = $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ];
1653
- }
1654
- }
1655
- }
1656
-
1657
- /**
1658
- * Inits hooks and others for admin init.
1659
- * action:admin_init.
1660
- *
1661
- * @since 2.3.11
1662
- * @since 2.4.14 Refactored function name, and new filter added for defaults and missing term metabox.
1663
- */
1664
- function admin_init() {
1665
- add_filter( $this->prefix . 'display_settings', array( &$this, 'filter_settings' ), 10, 3 );
1666
- add_filter( $this->prefix . 'override_options', array( &$this, 'override_options' ), 10, 3 );
1667
- add_filter(
1668
- $this->get_prefix( 'settings' ) . 'default_options', array(
1669
- &$this,
1670
- 'filter_default_options',
1671
- ), 10, 2
1672
- );
1673
- add_filter(
1674
- $this->get_prefix( 'settings' ) . 'filter_metabox_options', array(
1675
- &$this,
1676
- 'filter_metabox_options',
1677
- ), 10, 3
1678
- );
1679
- add_filter(
1680
- $this->get_prefix( 'settings' ) . 'filter_term_metabox_options', array(
1681
- &$this,
1682
- 'filter_metabox_options',
1683
- ), 10, 3
1684
- );
1685
- $post_types = $this->get_post_type_titles();
1686
- $rempost = array(
1687
- 'revision' => 1,
1688
- 'nav_menu_item' => 1,
1689
- 'custom_css' => 1,
1690
- 'customize_changeset' => 1,
1691
- );
1692
- $post_types = array_diff_key( $post_types, $rempost );
1693
- $this->default_options['types']['initial_options'] = $post_types;
1694
- foreach ( $post_types as $slug => $name ) {
1695
- $field = $slug . '_fb_object_type';
1696
- $this->default_options[ $field ] = array(
1697
- 'name' => "$name " . __( 'Object Type', 'all-in-one-seo-pack' ) . "<br />($slug)",
1698
- 'type' => 'select',
1699
- 'style' => '',
1700
- 'initial_options' => $this->fb_object_types,
1701
- 'default' => 'article',
1702
- 'condshow' => array( 'aiosp_opengraph_types\[\]' => $slug ),
1703
- );
1704
- $this->help_text[ $field ] = __( 'Choose a default value that best describes the content of your post type.', 'all-in-one-seo-pack' );
1705
- $this->help_anchors[ $field ] = '#content-object-types';
1706
- $this->locations['opengraph']['options'][] = $field;
1707
- $this->layout['facebook']['options'][] = $field;
1708
- }
1709
- $this->setting_options();
1710
- $this->add_help_text_links();
1711
-
1712
- }
1713
-
1714
- function get_all_images( $options = null, $p = null ) {
1715
- static $img = array();
1716
- if ( ! is_array( $options ) ) {
1717
- $options = array();
1718
- }
1719
- if ( ! empty( $this->options['aiosp_opengraph_meta_key'] ) ) {
1720
- $options['meta_key'] = $this->options['aiosp_opengraph_meta_key'];
1721
- }
1722
- if ( empty( $img ) ) {
1723
- $size = apply_filters( 'post_thumbnail_size', 'large' );
1724
- $default = $this->get_the_image_by_default();
1725
- if ( ! empty( $default ) ) {
1726
- $default = set_url_scheme( $default );
1727
- $img[ $default ] = 0;
1728
- }
1729
- $img = array_merge( $img, parent::get_all_images( $options, null ) );
1730
- }
1731
-
1732
- if ( ! empty( $options ) && ! empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
1733
- $img[ $options['aioseop_opengraph_settings_customimg'] ] = 'customimg';
1734
- }
1735
-
1736
- if ( ! empty( $options ) && ! empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
1737
- $img[ $options['aioseop_opengraph_settings_customimg'] ] = 'customimg';
1738
- $img[ $options['aioseop_opengraph_settings_customimg_twitter'] ] = 'customimg_twitter';
1739
- }
1740
-
1741
- if ( $author_img = $this->get_the_image_by_author( $p ) ) {
1742
- $image['author'] = $author_img;
1743
- }
1744
- $image = array_flip( $img );
1745
- $images = array();
1746
- if ( ! empty( $image ) ) {
1747
- foreach ( $image as $k => $v ) {
1748
- $images[ $v ] = '<img height=150 src="' . $v . '">';
1749
- }
1750
- }
1751
-
1752
- return array( $image, $images );
1753
- }
1754
-
1755
- function get_the_image_by_author( $options = null, $p = null ) {
1756
- if ( $p === null ) {
1757
- global $post;
1758
- } else {
1759
- $post = $p;
1760
- }
1761
- if ( ! empty( $post ) && ! empty( $post->post_author ) ) {
1762
- $matches = array();
1763
- $get_avatar = get_avatar( $post->post_author, 300 );
1764
- if ( preg_match( "/src='(.*?)'/i", $get_avatar, $matches ) ) {
1765
- return $matches[1];
1766
- }
1767
- }
1768
-
1769
- return false;
1770
- }
1771
-
1772
- function get_the_image( $options = null, $p = null ) {
1773
- $meta_key = $this->options['aiosp_opengraph_meta_key'];
1774
-
1775
- return parent::get_the_image( array( 'meta_key' => $meta_key ), $p );
1776
- }
1777
-
1778
- function get_the_image_by_default( $args = array() ) {
1779
- return $this->options['aiosp_opengraph_dimg'];
1780
- }
1781
-
1782
- function settings_update() {
1783
-
1784
- }
1785
-
1786
- /**
1787
- * Admin Enqueue Scripts
1788
- *
1789
- * Add hook in \All_in_One_SEO_Pack_Module::enqueue_metabox_scripts - Bails adding hook if not on target valid screen.
1790
- * Add hook in \All_in_One_SEO_Pack_Module::add_page_hooks - Function itself is hooked based on the screen_id/page.
1791
- *
1792
- * @since 2.9.2
1793
- *
1794
- * @see 'admin_enqueue_scripts' hook
1795
- * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
1796
- *
1797
- * @param string $hook_suffix
1798
- */
1799
- public function admin_enqueue_scripts( $hook_suffix ) {
1800
- wp_enqueue_script(
1801
- 'aioseop-opengraph-script',
1802
- AIOSEOP_PLUGIN_URL . 'js/modules/aioseop_opengraph.js',
1803
- array(),
1804
- AIOSEOP_VERSION
1805
- );
1806
-
1807
- // Dev note: If certain JS files need to be restricted to select screens, then follow concept
1808
- // used in `All_in_One_SEO_Pack::admin_enqueue_scripts()` (v2.9.1); which uses the `$hook_suffix`
1809
- // and a switch-case. This also helps prevent unnessecarily processing localized data when it isn't needed.
1810
- parent::admin_enqueue_scripts( $hook_suffix );
1811
- }
1812
-
1813
- /**
1814
- * Enqueue our file upload scripts and styles.
1815
- * @param $hook
1816
- */
1817
- function og_admin_enqueue_scripts( $hook ) {
1818
-
1819
- if ( 'all-in-one-seo_page_aiosp_opengraph' != $hook && 'term.php' != $hook ) {
1820
- // Only enqueue if we're on the social module settings page.
1821
- return;
1822
- }
1823
-
1824
- wp_enqueue_script( 'media-upload' );
1825
- wp_enqueue_script( 'thickbox' );
1826
- wp_enqueue_style( 'thickbox' );
1827
- wp_enqueue_media();
1828
- }
1829
-
1830
- function save_tax_data( $term_id, $tt_id, $taxonomy ) {
1831
- static $update = false;
1832
- if ( $update ) {
1833
- return;
1834
- }
1835
- if ( $this->locations !== null ) {
1836
- foreach ( $this->locations as $k => $v ) {
1837
- if ( isset( $v['type'] ) && ( $v['type'] === 'metabox' ) ) {
1838
- $opts = $this->default_options( $k );
1839
- $options = array();
1840
- $update = false;
1841
- foreach ( $opts as $l => $o ) {
1842
- if ( isset( $_POST[ $l ] ) ) {
1843
- $options[ $l ] = stripslashes_deep( $_POST[ $l ] );
1844
- $options[ $l ] = esc_attr( $options[ $l ] );
1845
- $update = true;
1846
- }
1847
- }
1848
- if ( $update ) {
1849
- $prefix = $this->get_prefix( $k );
1850
- $options = apply_filters( $prefix . 'filter_term_metabox_options', $options, $k, $term_id );
1851
- update_term_meta( $term_id, '_' . $prefix . $k, $options );
1852
- }
1853
- }
1854
- }
1855
- }
1856
- }
1857
-
1858
- /**
1859
- * Returns the placeholder filtered and ready for DOM display.
1860
- * filter:aioseop_opengraph_placeholder
1861
- * @since 2.4.14
1862
- *
1863
- * @param mixed $placeholder Placeholder to be filtered.
1864
- * @param string $type Type of the value to be filtered.
1865
- *
1866
- * @return string
1867
- */
1868
- public function filter_placeholder( $placeholder, $type = 'text' ) {
1869
- return strip_tags( trim( $placeholder ) );
1870
- }
1871
-
1872
- /**
1873
- * Returns filtered default options.
1874
- * filter:{prefix}default_options
1875
- * @since 2.4.13
1876
- *
1877
- * @param array $options Default options.
1878
- * @param string $location Location.
1879
- *
1880
- * @return array
1881
- */
1882
- public function filter_default_options( $options, $location ) {
1883
- if ( $location === 'settings' ) {
1884
- $prefix = $this->get_prefix( $location ) . $location . '_';
1885
- // Add image checker as default
1886
- $options[ $prefix . 'customimg_checker' ] = 0;
1887
- }
1888
- return $options;
1889
- }
1890
- }
1891
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Opengraph class.
4
+ *
5
+ * @package All-in-One-SEO-Pack
6
+ * @version 2.3.16
7
+ */
8
+ if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
9
+ class All_in_One_SEO_Pack_Opengraph extends All_in_One_SEO_Pack_Module {
10
+ var $fb_object_types;
11
+ var $type;
12
+
13
+ /**
14
+ * Module constructor.
15
+ *
16
+ * @since 2.3.14 Added display filter.
17
+ * @since 2.3.16 #1066 Force init on constructor.
18
+ */
19
+ function __construct() {
20
+ add_action( 'admin_enqueue_scripts', array( $this, 'og_admin_enqueue_scripts' ) );
21
+
22
+ $this->name = __( 'Social Meta', 'all-in-one-seo-pack' ); // Human-readable name of the plugin
23
+ $this->prefix = 'aiosp_opengraph_'; // option prefix
24
+ $this->file = __FILE__; // the current file
25
+ $this->fb_object_types = array(
26
+ 'Activities' => array(
27
+ 'activity' => __( 'Activity', 'all-in-one-seo-pack' ),
28
+ 'sport' => __( 'Sport', 'all-in-one-seo-pack' ),
29
+ ),
30
+ 'Businesses' => array(
31
+ 'bar' => __( 'Bar', 'all-in-one-seo-pack' ),
32
+ 'company' => __( 'Company', 'all-in-one-seo-pack' ),
33
+ 'cafe' => __( 'Cafe', 'all-in-one-seo-pack' ),
34
+ 'hotel' => __( 'Hotel', 'all-in-one-seo-pack' ),
35
+ 'restaurant' => __( 'Restaurant', 'all-in-one-seo-pack' ),
36
+ ),
37
+ 'Groups' => array(
38
+ 'cause' => __( 'Cause', 'all-in-one-seo-pack' ),
39
+ 'sports_league' => __( 'Sports League', 'all-in-one-seo-pack' ),
40
+ 'sports_team' => __( 'Sports Team', 'all-in-one-seo-pack' ),
41
+ ),
42
+ 'Organizations' => array(
43
+ 'band' => __( 'Band', 'all-in-one-seo-pack' ),
44
+ 'government' => __( 'Government', 'all-in-one-seo-pack' ),
45
+ 'non_profit' => __( 'Non Profit', 'all-in-one-seo-pack' ),
46
+ 'school' => __( 'School', 'all-in-one-seo-pack' ),
47
+ 'university' => __( 'University', 'all-in-one-seo-pack' ),
48
+ ),
49
+ 'People' => array(
50
+ 'actor' => __( 'Actor', 'all-in-one-seo-pack' ),
51
+ 'athlete' => __( 'Athlete', 'all-in-one-seo-pack' ),
52
+ 'author' => __( 'Author', 'all-in-one-seo-pack' ),
53
+ 'director' => __( 'Director', 'all-in-one-seo-pack' ),
54
+ 'musician' => __( 'Musician', 'all-in-one-seo-pack' ),
55
+ 'politician' => __( 'Politician', 'all-in-one-seo-pack' ),
56
+ 'profile' => __( 'Profile', 'all-in-one-seo-pack' ),
57
+ 'public_figure' => __( 'Public Figure', 'all-in-one-seo-pack' ),
58
+ ),
59
+ 'Places' => array(
60
+ 'city' => __( 'City', 'all-in-one-seo-pack' ),
61
+ 'country' => __( 'Country', 'all-in-one-seo-pack' ),
62
+ 'landmark' => __( 'Landmark', 'all-in-one-seo-pack' ),
63
+ 'state_province' => __( 'State Province', 'all-in-one-seo-pack' ),
64
+ ),
65
+ 'Products and Entertainment' => array(
66
+ 'album' => __( 'Album', 'all-in-one-seo-pack' ),
67
+ 'book' => __( 'Book', 'all-in-one-seo-pack' ),
68
+ 'drink' => __( 'Drink', 'all-in-one-seo-pack' ),
69
+ 'food' => __( 'Food', 'all-in-one-seo-pack' ),
70
+ 'game' => __( 'Game', 'all-in-one-seo-pack' ),
71
+ 'movie' => __( 'Movie', 'all-in-one-seo-pack' ),
72
+ 'product' => __( 'Product', 'all-in-one-seo-pack' ),
73
+ 'song' => __( 'Song', 'all-in-one-seo-pack' ),
74
+ 'tv_show' => __( 'TV Show', 'all-in-one-seo-pack' ),
75
+ 'episode' => __( 'Episode', 'all-in-one-seo-pack' ),
76
+ ),
77
+ 'Websites' => array(
78
+ 'article' => __( 'Article', 'all-in-one-seo-pack' ),
79
+ 'website' => __( 'Website', 'all-in-one-seo-pack' ),
80
+ ),
81
+ );
82
+ parent::__construct();
83
+
84
+ if ( is_admin() ) {
85
+ add_action( 'admin_init', array( $this, 'admin_init' ), 5 );
86
+ } else {
87
+ add_action( 'wp', array( $this, 'type_setup' ) );
88
+ }
89
+
90
+ if ( ! is_admin() || defined( 'DOING_AJAX' ) || defined( 'AIOSEOP_UNIT_TESTING' ) ) {
91
+ $this->do_opengraph();
92
+ }
93
+ // Set variables after WordPress load.
94
+ add_action( 'init', array( &$this, 'init' ), 999999 );
95
+ add_filter( 'jetpack_enable_open_graph', '__return_false' ); // Avoid having duplicate meta tags
96
+ add_filter( $this->prefix . 'meta', array( $this, 'handle_meta_tag' ), 10, 5 );
97
+ // Force refresh of Facebook cache.
98
+ add_action( 'post_updated', array( &$this, 'force_fb_refresh_update' ), 10, 3 );
99
+ add_action( 'transition_post_status', array( &$this, 'force_fb_refresh_transition' ), 10, 3 );
100
+ add_action( 'edited_term', array( &$this, 'save_tax_data' ), 10, 3 );
101
+ // Adds special filters
102
+ add_filter( 'aioseop_opengraph_placeholder', array( &$this, 'filter_placeholder' ) );
103
+ add_action( 'aiosp_activate_opengraph', array( $this, 'activate_module' ) );
104
+ add_action( 'created_term', array( $this, 'created_term' ), 10, 3 );
105
+ // Call to init to generate menus
106
+ $this->init();
107
+ }
108
+
109
+ /**
110
+ * Process meta tags for specific idiosyncrasies.
111
+ *
112
+ * @since 3.0
113
+ *
114
+ * @param string $value The value that is proposed to be shown in the tag.
115
+ * @param string $network The social network.
116
+ * @param string $meta_tag The meta tag without the network name prefixed.
117
+ * @param string $network_meta_tag The meta tag with the network name prefixed. This is not always $network:$meta_tag.
118
+ * @param array $extra_params Extra parameters that might be required to process the meta tag.
119
+ *
120
+ * @return string The final value that will be shown.
121
+ */
122
+ function handle_meta_tag( $value, $network, $meta_tag, $network_meta_tag, $extra_params ) {
123
+ switch ( $meta_tag ) {
124
+ case 'type':
125
+ // https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/1013
126
+ if ( 'blog' === $value ) {
127
+ $value = 'website';
128
+ }
129
+ break;
130
+ }
131
+
132
+ /**
133
+ * Disables truncation of meta tags. Return true to shortcircuit and disable truncation.
134
+ *
135
+ * @since 3.0
136
+ *
137
+ * @issue https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/808
138
+ * @issue https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/2296
139
+ *
140
+ * @param bool The value that is proposed to be shown in the tag.
141
+ * @param string $network The social network.
142
+ * @param string $meta_tag The meta tag without the network name prefixed.
143
+ * @param string $network_meta_tag The meta tag with the network name prefixed. This is not always $network:$meta_tag.
144
+ * @param array $extra_params Extra parameters that might be required to process the meta tag.
145
+ */
146
+ if ( true === apply_filters( $this->prefix . 'disable_meta_tag_truncation', false, $network, $meta_tag, $network_meta_tag ) ) {
147
+ return $value;
148
+ }
149
+
150
+ if ( isset( $extra_params['auto_generate_desc'] ) && $extra_params['auto_generate_desc'] ) {
151
+ switch ( $network_meta_tag ) {
152
+ case 'twitter:title':
153
+ // https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/markup.html
154
+ $value = trim( $this->substr( $value, 0, 70 ) );
155
+ break;
156
+ case 'og:description':
157
+ case 'twitter:description':
158
+ $value = trim( $this->substr( $value, 0, 200 ) );
159
+ break;
160
+ }
161
+ }
162
+ return $value;
163
+ }
164
+
165
+ /**
166
+ * Sets the terms defaults after a new term is created.
167
+ *
168
+ * @param int $term_id Term ID.
169
+ * @param int $tt_id Term taxonomy ID.
170
+ * @param string $taxonomy Taxonomy slug.
171
+ */
172
+ function created_term( $term_id, $tt_id, $taxonomy_name ) {
173
+ $k = 'settings';
174
+ $prefix = $this->get_prefix( $k );
175
+ $tax = get_taxonomy( $taxonomy_name );
176
+ $this->set_object_type_for_taxonomy( $prefix, $k, $taxonomy_name, $tax, false, array( $term_id ) );
177
+ }
178
+
179
+ /**
180
+ * Sets the defaults for a taxonomy.
181
+ *
182
+ * @param string $prefix The prefix of this module.
183
+ * @param string $k The key against which the options will be determined/set.
184
+ * @param string $taxonomy_name The name of the taxonomy.
185
+ * @param Object $tax The taxonomy object.
186
+ * @param bool $bail_if_no_terms Bail if the taxonomy has no terms.
187
+ * @param array $terms The terms in the taxonomy.
188
+ */
189
+ private function set_object_type_for_taxonomy( $prefix, $k, $taxonomy_name, $tax, $bail_if_no_terms = false, $terms = null ) {
190
+ $object_type = null;
191
+ if ( ! $terms ) {
192
+ $terms = get_terms(
193
+ $taxonomy_name, array(
194
+ 'meta_query' => array(
195
+ array(
196
+ 'key' => '_' . $prefix . $k,
197
+ 'compare' => 'NOT EXISTS',
198
+ ),
199
+ ),
200
+ 'number' => PHP_INT_MAX,
201
+ 'fields' => 'ids',
202
+ 'hide_empty' => false,
203
+ )
204
+ );
205
+ }
206
+
207
+ if ( empty( $terms ) && $bail_if_no_terms ) {
208
+ return false;
209
+ }
210
+
211
+ if ( true === $tax->_builtin ) {
212
+ $object_type = 'article';
213
+ } else {
214
+ // custom taxonomy. Let's get a post against this to determine its post type.
215
+ $posts = get_posts(
216
+ array(
217
+ 'numberposts' => 1,
218
+ 'post_type' => 'any',
219
+ 'tax_query' => array(
220
+ array(
221
+ 'taxonomy' => $taxonomy_name,
222
+ 'field' => 'term_id',
223
+ 'terms' => $terms,
224
+ ),
225
+ ),
226
+ )
227
+ );
228
+ if ( $posts ) {
229
+ global $aioseop_options;
230
+ $post_type = $posts[0]->post_type;
231
+ if ( isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules'][ $this->prefix . 'options' ] ) ) {
232
+ $og_options = $aioseop_options['modules'][ $this->prefix . 'options' ];
233
+
234
+ // now let's see what default object type is set for this post type.
235
+ $object_type_set = $og_options[ $this->prefix . $post_type . '_fb_object_type' ];
236
+ if ( ! empty( $object_type_set ) ) {
237
+ $object_type = $object_type_set;
238
+ }
239
+ }
240
+ }
241
+ }
242
+
243
+ if ( $object_type ) {
244
+ $opts[ $prefix . $k . '_category' ] = $object_type;
245
+ foreach ( $terms as $term_id ) {
246
+ update_term_meta( $term_id, '_' . $prefix . $k, $opts );
247
+ }
248
+ }
249
+
250
+ return true;
251
+ }
252
+
253
+ /**
254
+ * Called when this module is activated.
255
+ */
256
+ public function activate_module() {
257
+ if ( $this->locations !== null ) {
258
+ foreach ( $this->locations as $k => $v ) {
259
+ if ( ! isset( $v['type'] ) || 'metabox' !== $v['type'] ) {
260
+ continue;
261
+ }
262
+ $this->set_virgin_tax_terms( $k );
263
+ }
264
+ }
265
+ }
266
+ /**
267
+ * This iterates over all taxonomies that do not have a opengraph setting defined and sets the defaults.
268
+ *
269
+ * @param string $k The key against which the options will be determined/set.
270
+ */
271
+ private function set_virgin_tax_terms( $k ) {
272
+ $prefix = $this->get_prefix( $k );
273
+ $opts = $this->default_options( $k );
274
+ $taxonomies = get_taxonomies( array( 'public' => true ), 'object' );
275
+ if ( ! $taxonomies ) {
276
+ return;
277
+ }
278
+ foreach ( $taxonomies as $name => $tax ) {
279
+ $this->set_object_type_for_taxonomy( $prefix, $k, $name, $tax, true, null );
280
+
281
+ }
282
+ }
283
+
284
+ /**
285
+ * Hook called after WordPress has been loaded.
286
+ *
287
+ * @since 2.4.14
288
+ */
289
+ public function init() {
290
+ $count_desc = __( ' characters. We recommend a maximum of %1$s chars for the %2$s.', 'all-in-one-seo-pack' );
291
+ // Create default options
292
+ $this->default_options = array(
293
+ 'scan_header' => array(
294
+ 'name' => __( 'Scan Header', 'all-in-one-seo-pack' ),
295
+ 'type' => 'custom',
296
+ 'save' => true,
297
+ ),
298
+ 'setmeta' => array(
299
+ 'name' => __( 'Use AIOSEO Title and Description', 'all-in-one-seo-pack' ),
300
+ 'type' => 'checkbox',
301
+ ),
302
+ 'key' => array(
303
+ 'name' => __( 'Facebook Admin ID', 'all-in-one-seo-pack' ),
304
+ 'default' => '',
305
+ 'type' => 'text',
306
+ ),
307
+ 'appid' => array(
308
+ 'name' => __( 'Facebook App ID', 'all-in-one-seo-pack' ),
309
+ 'default' => '',
310
+ 'type' => 'text',
311
+ ),
312
+ 'title_shortcodes' => array(
313
+ 'name' => __( 'Run Shortcodes In Title', 'all-in-one-seo-pack' ),
314
+ ),
315
+ 'description_shortcodes' => array(
316
+ 'name' => __( 'Run Shortcodes In Description', 'all-in-one-seo-pack' ),
317
+ ),
318
+ 'sitename' => array(
319
+ 'name' => __( 'Site Name', 'all-in-one-seo-pack' ),
320
+ 'default' => get_bloginfo( 'name' ),
321
+ 'type' => 'text',
322
+ ),
323
+ 'hometitle' => array(
324
+ 'name' => __( 'Home Title', 'all-in-one-seo-pack' ),
325
+ 'default' => '',
326
+ 'type' => 'text',
327
+ 'class' => 'aioseop_count_chars',
328
+ 'count' => true,
329
+ 'count_desc' => $count_desc,
330
+ 'size' => 95,
331
+ 'condshow' => array(
332
+ 'aiosp_opengraph_setmeta' => array(
333
+ 'lhs' => 'aiosp_opengraph_setmeta',
334
+ 'op' => '!=',
335
+ 'rhs' => 'on',
336
+ ),
337
+ ),
338
+ ),
339
+ 'description' => array(
340
+ 'name' => __( 'Home Description', 'all-in-one-seo-pack' ),
341
+ 'default' => '',
342
+ 'type' => 'textarea',
343
+ 'class' => 'aioseop_count_chars',
344
+ 'count' => true,
345
+ 'count_desc' => $count_desc,
346
+ 'size' => 200,
347
+ 'condshow' => array(
348
+ 'aiosp_opengraph_setmeta' => array(
349
+ 'lhs' => 'aiosp_opengraph_setmeta',
350
+ 'op' => '!=',
351
+ 'rhs' => 'on',
352
+ ),
353
+ ),
354
+ ),
355
+ 'homeimage' => array(
356
+ 'name' => __( 'Home Image', 'all-in-one-seo-pack' ),
357
+ 'type' => 'image',
358
+ ),
359
+ 'generate_descriptions' => array(
360
+ 'name' => __( 'Use Content For Autogenerated OG Descriptions', 'all-in-one-seo-pack' ),
361
+ 'default' => 0,
362
+ ),
363
+ 'defimg' => array(
364
+ 'name' => __( 'Select OG:Image Source', 'all-in-one-seo-pack' ),
365
+ 'type' => 'select',
366
+ 'initial_options' => array(
367
+ '' => __( 'Default Image' ),
368
+ 'featured' => __( 'Featured Image' ),
369
+ 'attach' => __( 'First Attached Image' ),
370
+ 'content' => __( 'First Image In Content' ),
371
+ 'custom' => __( 'Image From Custom Field' ),
372
+ 'author' => __( 'Post Author Image' ),
373
+ 'auto' => __( 'First Available Image' ),
374
+ ),
375
+ ),
376
+ 'fallback' => array(
377
+ 'name' => __( 'Use Default If No Image Found', 'all-in-one-seo-pack' ),
378
+ 'type' => 'checkbox',
379
+ ),
380
+ 'dimg' => array(
381
+ 'name' => __( 'Default OG:Image', 'all-in-one-seo-pack' ),
382
+ 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png',
383
+ 'type' => 'image',
384
+ ),
385
+ 'dimgwidth' => array(
386
+ 'name' => __( 'Default Image Width', 'all-in-one-seo-pack' ),
387
+ 'type' => 'text',
388
+ 'default' => '',
389
+ ),
390
+ 'dimgheight' => array(
391
+ 'name' => __( 'Default Image Height', 'all-in-one-seo-pack' ),
392
+ 'type' => 'text',
393
+ 'default' => '',
394
+ ),
395
+ 'meta_key' => array(
396
+ 'name' => __( 'Use Custom Field For Image', 'all-in-one-seo-pack' ),
397
+ 'type' => 'text',
398
+ 'default' => '',
399
+ ),
400
+ 'image' => array(
401
+ 'name' => __( 'Image', 'all-in-one-seo-pack' ),
402
+ 'type' => 'radio',
403
+ 'initial_options' => array(
404
+ 0 => '<img style="width:50px;height:auto;display:inline-block;vertical-align:bottom;" src="' . AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png' . '">',
405
+ ),
406
+ ),
407
+ 'customimg' => array(
408
+ 'name' => __( 'Custom Image', 'all-in-one-seo-pack' ),
409
+ 'type' => 'image',
410
+ ),
411
+ 'imagewidth' => array(
412
+ 'name' => __( 'Specify Image Width', 'all-in-one-seo-pack' ),
413
+ 'type' => 'text',
414
+ 'default' => '',
415
+ ),
416
+ 'imageheight' => array(
417
+ 'name' => __( 'Specify Image Height', 'all-in-one-seo-pack' ),
418
+ 'type' => 'text',
419
+ 'default' => '',
420
+ ),
421
+ 'video' => array(
422
+ 'name' => __( 'Custom Video', 'all-in-one-seo-pack' ),
423
+ 'type' => 'text',
424
+ ),
425
+ 'videowidth' => array(
426
+ 'name' => __( 'Specify Video Width', 'all-in-one-seo-pack' ),
427
+ 'type' => 'text',
428
+ 'default' => '',
429
+ 'condshow' => array(
430
+ 'aioseop_opengraph_settings_video' => array(
431
+ 'lhs' => 'aioseop_opengraph_settings_video',
432
+ 'op' => '!=',
433
+ 'rhs' => '',
434
+ ),
435
+ ),
436
+ ),
437
+ 'videoheight' => array(
438
+ 'name' => __( 'Specify Video Height', 'all-in-one-seo-pack' ),
439
+ 'type' => 'text',
440
+ 'default' => '',
441
+ 'condshow' => array(
442
+ 'aioseop_opengraph_settings_video' => array(
443
+ 'lhs' => 'aioseop_opengraph_settings_video',
444
+ 'op' => '!=',
445
+ 'rhs' => '',
446
+ ),
447
+ ),
448
+ ),
449
+ 'defcard' => array(
450
+ 'name' => __( 'Default Twitter Card', 'all-in-one-seo-pack' ),
451
+ 'type' => 'select',
452
+ 'default' => 'summary',
453
+ 'initial_options' => array(
454
+ 'summary' => __( 'Summary', 'all-in-one-seo-pack' ),
455
+ 'summary_large_image' => __( 'Summary Large Image', 'all-in-one-seo-pack' ),
456
+
457
+ /*
458
+ REMOVING THIS TWITTER CARD TYPE FROM SOCIAL META MODULE
459
+ 'photo' => __( 'Photo', 'all-in-one-seo-pack' )
460
+ */
461
+ ),
462
+ ),
463
+ 'setcard' => array(
464
+ 'name' => __( 'Twitter Card Type', 'all-in-one-seo-pack' ),
465
+ 'type' => 'select',
466
+ 'initial_options' => array(
467
+ 'summary_large_image' => __( 'Summary Large Image', 'all-in-one-seo-pack' ),
468
+ 'summary' => __( 'Summary', 'all-in-one-seo-pack' ),
469
+
470
+ /*
471
+ REMOVING THIS TWITTER CARD TYPE FROM SOCIAL META MODULE
472
+ 'photo' => __( 'Photo', 'all-in-one-seo-pack' )
473
+ */
474
+ ),
475
+ ),
476
+ 'twitter_site' => array(
477
+ 'name' => __( 'Twitter Site', 'all-in-one-seo-pack' ),
478
+ 'type' => 'text',
479
+ 'default' => '',
480
+ ),
481
+ 'twitter_creator' => array(
482
+ 'name' => __( 'Show Twitter Author', 'all-in-one-seo-pack' ),
483
+ ),
484
+ 'twitter_domain' => array(
485
+ 'name' => __( 'Twitter Domain', 'all-in-one-seo-pack' ),
486
+ 'type' => 'text',
487
+ 'default' => '',
488
+ ),
489
+ 'customimg_twitter' => array(
490
+ 'name' => __( 'Custom Twitter Image', 'all-in-one-seo-pack' ),
491
+ 'type' => 'image',
492
+ ),
493
+ 'gen_tags' => array(
494
+ 'name' => __( 'Automatically Generate Article Tags', 'all-in-one-seo-pack' ),
495
+ ),
496
+ 'gen_keywords' => array(
497
+ 'name' => __( 'Use Keywords In Article Tags', 'all-in-one-seo-pack' ),
498
+ 'default' => 'on',
499
+ 'condshow' => array( 'aiosp_opengraph_gen_tags' => 'on' ),
500
+ ),
501
+ 'gen_categories' => array(
502
+ 'name' => __( 'Use Categories In Article Tags', 'all-in-one-seo-pack' ),
503
+ 'default' => 'on',
504
+ 'condshow' => array( 'aiosp_opengraph_gen_tags' => 'on' ),
505
+ ),
506
+ 'gen_post_tags' => array(
507
+ 'name' => __( 'Use Post Tags In Article Tags', 'all-in-one-seo-pack' ),
508
+ 'default' => 'on',
509
+ 'condshow' => array( 'aiosp_opengraph_gen_tags' => 'on' ),
510
+ ),
511
+ 'types' => array(
512
+ 'name' => __( 'Enable Facebook Meta for Post Types', 'all-in-one-seo-pack' ),
513
+ 'type' => 'multicheckbox',
514
+ 'default' => array( 'post' => 'post', 'page' => 'page' ),
515
+ 'initial_options' => $this->get_post_type_titles( array( '_builtin' => false ) ),
516
+ ),
517
+ 'title' => array(
518
+ 'name' => __( 'Title', 'all-in-one-seo-pack' ),
519
+ 'default' => '',
520
+ 'type' => 'text',
521
+ 'size' => 95,
522
+ 'count' => 1,
523
+ 'count_desc' => $count_desc,
524
+ ),
525
+ 'desc' => array(
526
+ 'name' => __( 'Description', 'all-in-one-seo-pack' ),
527
+ 'default' => '',
528
+ 'type' => 'textarea',
529
+ 'cols' => 50,
530
+ 'rows' => 4,
531
+ 'count' => 1,
532
+ 'count_desc' => $count_desc,
533
+ ),
534
+ 'category' => array(
535
+ 'name' => __( 'Facebook Object Type', 'all-in-one-seo-pack' ),
536
+ 'type' => 'select',
537
+ 'style' => '',
538
+ 'default' => '',
539
+ 'initial_options' => $this->fb_object_types,
540
+ ),
541
+ 'facebook_debug' => array(
542
+ 'name' => __( 'Facebook Debug', 'all-in-one-seo-pack' ),
543
+ 'type' => 'html',
544
+ 'save' => false,
545
+ 'default' => '<a
546
+ name="aioseop_opengraph_settings_facebook_debug"
547
+ id="aioseop_opengraph_settings_facebook_debug"
548
+ class="button-primary"
549
+ href=""
550
+ target="_blank">' . __( 'Debug This Post', 'all-in-one-seo-pack' ) . '</a>',
551
+ ),
552
+ 'section' => array(
553
+ 'name' => __( 'Article Section', 'all-in-one-seo-pack' ),
554
+ 'type' => 'text',
555
+ 'default' => '',
556
+ 'condshow' => array( 'aioseop_opengraph_settings_category' => 'article' ),
557
+ ),
558
+ 'tag' => array(
559
+ 'name' => __( 'Article Tags', 'all-in-one-seo-pack' ),
560
+ 'type' => 'text',
561
+ 'default' => '',
562
+ 'condshow' => array( 'aioseop_opengraph_settings_category' => 'article' ),
563
+ ),
564
+ 'facebook_publisher' => array(
565
+ 'name' => __( 'Show Facebook Publisher on Articles', 'all-in-one-seo-pack' ),
566
+ 'type' => 'text',
567
+ 'default' => '',
568
+ ),
569
+ 'facebook_author' => array(
570
+ 'name' => __( 'Show Facebook Author on Articles', 'all-in-one-seo-pack' ),
571
+ ),
572
+ 'profile_links' => array(
573
+ 'name' => __( 'Social Profile Links', 'all-in-one-seo-pack' ),
574
+ 'type' => 'textarea',
575
+ 'cols' => 60,
576
+ 'rows' => 5,
577
+ ),
578
+ 'person_or_org' => array(
579
+ 'name' => __( 'Person or Organization?', 'all-in-one-seo-pack' ),
580
+ 'type' => 'radio',
581
+ 'initial_options' => array(
582
+ 'person' => __( 'Person', 'all-in-one-seo-pack' ),
583
+ 'org' => __( 'Organization', 'all-in-one-seo-pack' ),
584
+ ),
585
+ ),
586
+ 'social_name' => array(
587
+ 'name' => __( 'Associated Name', 'all-in-one-seo-pack' ),
588
+ 'type' => 'text',
589
+ 'default' => '',
590
+ ),
591
+ );
592
+ // load initial options / set defaults
593
+ $this->update_options();
594
+ $display = array();
595
+ if ( isset( $this->options['aiosp_opengraph_types'] ) && ! empty( $this->options['aiosp_opengraph_types'] ) ) {
596
+ $display = $this->options['aiosp_opengraph_types'];
597
+ }
598
+ $this->locations = array(
599
+ 'opengraph' => array(
600
+ 'name' => $this->name,
601
+ 'prefix' => 'aiosp_',
602
+ 'type' => 'settings',
603
+ 'options' => array(
604
+ 'scan_header',
605
+ 'setmeta',
606
+ 'key',
607
+ 'appid',
608
+ 'sitename',
609
+ 'title_shortcodes',
610
+ 'description_shortcodes',
611
+ 'hometitle',
612
+ 'description',
613
+ 'homeimage',
614
+ 'generate_descriptions',
615
+ 'defimg',
616
+ 'fallback',
617
+ 'dimg',
618
+ 'dimgwidth',
619
+ 'dimgheight',
620
+ 'meta_key',
621
+ 'defcard',
622
+ 'profile_links',
623
+ 'person_or_org',
624
+ 'social_name',
625
+ 'twitter_site',
626
+ 'twitter_creator',
627
+ 'twitter_domain',
628
+ 'gen_tags',
629
+ 'gen_keywords',
630
+ 'gen_categories',
631
+ 'gen_post_tags',
632
+ 'types',
633
+ 'facebook_publisher',
634
+ 'facebook_author',
635
+ ),
636
+ ),
637
+ 'settings' => array(
638
+ 'name' => __( 'Social Settings', 'all-in-one-seo-pack' ),
639
+ 'type' => 'metabox',
640
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-settings-individual-pagepost-settings/',
641
+ 'options' => array(
642
+ 'title',
643
+ 'desc',
644
+ 'image',
645
+ 'customimg',
646
+ 'imagewidth',
647
+ 'imageheight',
648
+ 'video',
649
+ 'videowidth',
650
+ 'videoheight',
651
+ 'category',
652
+ 'facebook_debug',
653
+ 'section',
654
+ 'tag',
655
+ 'setcard',
656
+ 'customimg_twitter',
657
+ ),
658
+ 'display' => apply_filters( 'aioseop_opengraph_display', $display ),
659
+ 'prefix' => 'aioseop_opengraph_',
660
+ ),
661
+ );
662
+ $this->layout = array(
663
+ 'home' => array(
664
+ 'name' => __( 'Home Page Settings', 'all-in-one-seo-pack' ),
665
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#use-aioseo-title-and-description',
666
+ 'options' => array( 'setmeta', 'sitename', 'hometitle', 'description', 'homeimage' ),
667
+ ),
668
+ 'image' => array(
669
+ 'name' => __( 'Image Settings', 'all-in-one-seo-pack' ),
670
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#select-og-image-source',
671
+ 'options' => array( 'defimg', 'fallback', 'dimg', 'dimgwidth', 'dimgheight', 'meta_key' ),
672
+ ),
673
+ 'links' => array(
674
+ 'name' => __( 'Social Profile Links', 'all-in-one-seo-pack' ),
675
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#social-profile-links',
676
+ 'options' => array( 'profile_links', 'person_or_org', 'social_name' ),
677
+ ),
678
+ 'facebook' => array(
679
+ 'name' => __( 'Facebook Settings', 'all-in-one-seo-pack' ),
680
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#facebook-settings',
681
+ 'options' => array(
682
+ 'key',
683
+ 'appid',
684
+ 'types',
685
+ 'gen_tags',
686
+ 'gen_keywords',
687
+ 'gen_categories',
688
+ 'gen_post_tags',
689
+ 'facebook_publisher',
690
+ 'facebook_author',
691
+ ),
692
+ ),
693
+ 'twitter' => array(
694
+ 'name' => __( 'Twitter Settings', 'all-in-one-seo-pack' ),
695
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#default-twitter-card',
696
+ 'options' => array( 'defcard', 'setcard', 'twitter_site', 'twitter_creator', 'twitter_domain' ),
697
+ ),
698
+ 'default' => array(
699
+ 'name' => __( 'Advanced Settings', 'all-in-one-seo-pack' ),
700
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/',
701
+ 'options' => array(), // this is set below, to the remaining options -- pdb
702
+ ),
703
+ 'scan_meta' => array(
704
+ 'name' => __( 'Scan Social Meta', 'all-in-one-seo-pack' ),
705
+ 'help_link' => 'https://semperplugins.com/documentation/social-meta-module/#scan_meta',
706
+ 'options' => array( 'scan_header' ),
707
+ ),
708
+ );
709
+ $other_options = array();
710
+ foreach ( $this->layout as $k => $v ) {
711
+ $other_options = array_merge( $other_options, $v['options'] );
712
+ }
713
+
714
+ $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
715
+ }
716
+
717
+ /**
718
+ * Forces FaceBook OpenGraph to refresh its cache when a post is changed to
719
+ *
720
+ * @param $new_status
721
+ * @param $old_status
722
+ * @param $post
723
+ *
724
+ * @todo this and force_fb_refresh_update can probably have the remote POST extracted out.
725
+ *
726
+ * @see https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
727
+ * @since 2.3.11
728
+ */
729
+ function force_fb_refresh_transition( $new_status, $old_status, $post ) {
730
+ if ( 'publish' !== $new_status ) {
731
+ return;
732
+ }
733
+ if ( 'future' !== $old_status ) {
734
+ return;
735
+ }
736
+
737
+ $current_post_type = get_post_type();
738
+
739
+ // Only ping Facebook if Social SEO is enabled on this post type.
740
+ if ( $this->option_isset( 'types' ) && is_array( $this->options['aiosp_opengraph_types'] ) && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
741
+ $post_url = aioseop_get_permalink( $post->ID );
742
+ $endpoint = sprintf(
743
+ 'https://graph.facebook.com/?%s', http_build_query(
744
+ array(
745
+ 'id' => $post_url,
746
+ 'scrape' => true,
747
+ )
748
+ )
749
+ );
750
+ wp_remote_post( $endpoint, array( 'blocking' => false ) );
751
+ }
752
+ }
753
+
754
+ /**
755
+ * Forces FaceBook OpenGraph refresh on update.
756
+ *
757
+ * @param $post_id
758
+ * @param $post_after
759
+ *
760
+ * @see https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
761
+ * @since 2.3.11
762
+ */
763
+ function force_fb_refresh_update( $post_id, $post_after ) {
764
+
765
+ $current_post_type = get_post_type();
766
+
767
+ // Only ping Facebook if Social SEO is enabled on this post type.
768
+ if ( 'publish' === $post_after->post_status && $this->option_isset( 'types' ) && is_array( $this->options['aiosp_opengraph_types'] ) && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
769
+ $post_url = aioseop_get_permalink( $post_id );
770
+ $endpoint = sprintf(
771
+ 'https://graph.facebook.com/?%s', http_build_query(
772
+ array(
773
+ 'id' => $post_url,
774
+ 'scrape' => true,
775
+ )
776
+ )
777
+ );
778
+ wp_remote_post( $endpoint, array( 'blocking' => false ) );
779
+ }
780
+ }
781
+
782
+ function settings_page_init() {
783
+ add_filter( 'aiosp_output_option', array( $this, 'display_custom_options' ), 10, 2 );
784
+ }
785
+
786
+ function filter_options( $options, $location ) {
787
+ if ( $location == 'settings' ) {
788
+ $prefix = $this->get_prefix( $location ) . $location . '_';
789
+ list( $legacy, $images ) = $this->get_all_images( $options );
790
+ if ( isset( $options ) && isset( $options[ "{$prefix}image" ] ) ) {
791
+ $thumbnail = $options[ "{$prefix}image" ];
792
+ if ( ctype_digit( (string) $thumbnail ) || ( $thumbnail == 'post' ) ) {
793
+ if ( $thumbnail == 'post' ) {
794
+ $thumbnail = $images['post1'];
795
+ } elseif ( ! empty( $legacy[ $thumbnail ] ) ) {
796
+ $thumbnail = $legacy[ $thumbnail ];
797
+ }
798
+ }
799
+ $options[ "{$prefix}image" ] = $thumbnail;
800
+ }
801
+ if ( empty( $options[ $prefix . 'image' ] ) ) {
802
+ $img = array_keys( $images );
803
+ if ( ! empty( $img ) && ! empty( $img[1] ) ) {
804
+ $options[ $prefix . 'image' ] = $img[1];
805
+ }
806
+ }
807
+ }
808
+
809
+ return $options;
810
+ }
811
+
812
+ /**
813
+ * Applies filter to module settings.
814
+ *
815
+ * @since 2.3.11
816
+ * @since 2.4.14 Added filter for description and title placeholders.
817
+ * @since 2.3.15 do_shortcode on description.
818
+ *
819
+ * @see [plugin]\admin\aioseop_module_class.php > display_options()
820
+ */
821
+ function filter_settings( $settings, $location, $current ) {
822
+ global $aiosp, $post;
823
+ if ( $location == 'opengraph' || $location == 'settings' ) {
824
+ $prefix = $this->get_prefix( $location ) . $location . '_';
825
+ if ( $location == 'opengraph' ) {
826
+ return $settings;
827
+ }
828
+ if ( $location == 'settings' ) {
829
+ list( $legacy, $settings[ $prefix . 'image' ]['initial_options'] ) = $this->get_all_images( $current );
830
+ $opts = array( 'title', 'desc' );
831
+ $current_post_type = get_post_type();
832
+ if ( isset( $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
833
+ $flat_type_list = array();
834
+ foreach ( $this->fb_object_types as $k => $v ) {
835
+ if ( is_array( $v ) ) {
836
+ $flat_type_list = array_merge( $flat_type_list, $v );
837
+ } else {
838
+ $flat_type_list[ $k ] = $v;
839
+ }
840
+ }
841
+ $default_fb_type = $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ];
842
+ // https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/1013
843
+ // if 'blog' is the selected type but because it is no longer a schema type, we use 'website' instead.
844
+ if ( 'blog' === $default_fb_type ) {
845
+ $default_fb_type = 'website';
846
+ }
847
+ if ( isset( $flat_type_list[ $default_fb_type ] ) ) {
848
+ $default_fb_type = $flat_type_list[ $default_fb_type ];
849
+ }
850
+ $settings[ $prefix . 'category' ]['initial_options'] = array_merge(
851
+ array(
852
+ $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] => __( 'Default ', 'all-in-one-seo-pack' ) . ' - ' . $default_fb_type,
853
+ ),
854
+ $settings[ $prefix . 'category' ]['initial_options']
855
+ );
856
+ }
857
+ if ( isset( $this->options['aiosp_opengraph_defcard'] ) ) {
858
+ $settings[ $prefix . 'setcard' ]['default'] = $this->options['aiosp_opengraph_defcard'];
859
+ }
860
+ $info = $aiosp->get_page_snippet_info();
861
+ $title = $info['title'];
862
+ $description = $info['description'];
863
+
864
+ // Description options
865
+ if ( is_object( $post ) ) {
866
+ // Always show excerpt
867
+ $description = empty( $this->options['aiosp_opengraph_generate_descriptions'] )
868
+ ? $aiosp->trim_excerpt_without_filters(
869
+ $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ),
870
+ 200
871
+ )
872
+ : $aiosp->trim_excerpt_without_filters(
873
+ $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ),
874
+ 200
875
+ );
876
+ }
877
+
878
+ // #1308 - we want to make sure we are ignoring php version only in the admin area while editing the post, so that it does not impact #932.
879
+ $screen = get_current_screen();
880
+ $ignore_php_version = is_admin() && isset( $screen->id ) && 'post' == $screen->id;
881
+
882
+ // Add filters
883
+ $description = apply_filters( 'aioseop_description', $description, false, $ignore_php_version );
884
+ // Add placholders
885
+ $settings[ "{$prefix}title" ]['placeholder'] = apply_filters( 'aioseop_opengraph_placeholder', $title );
886
+ $settings[ "{$prefix}desc" ]['placeholder'] = apply_filters( 'aioseop_opengraph_placeholder', $description );
887
+ }
888
+ if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] ) {
889
+ foreach ( $opts as $opt ) {
890
+ if ( isset( $settings[ $prefix . $opt ] ) ) {
891
+ $settings[ $prefix . $opt ]['type'] = 'hidden';
892
+ $settings[ $prefix . $opt ]['label'] = 'none';
893
+ unset( $settings[ $prefix . $opt ]['count'] );
894
+ }
895
+ }
896
+ }
897
+ }
898
+
899
+ return $settings;
900
+ }
901
+
902
+ /**
903
+ * Applies filter to module options.
904
+ * These will display in the "Social Settings" object tab.
905
+ * filter:{prefix}override_options
906
+ *
907
+ * @since 2.3.11
908
+ * @since 2.4.14 Overrides empty og:type values.
909
+ *
910
+ * @see [plugin]\admin\aioseop_module_class.php > display_options()
911
+ *
912
+ * @global array $aioseop_options Plugin options.
913
+ *
914
+ * @param array $options Current options.
915
+ * @param string $location Location where filter is called.
916
+ * @param array $settings Settings.
917
+ *
918
+ * @return array
919
+ */
920
+ function override_options( $options, $location, $settings ) {
921
+ global $aioseop_options;
922
+ // Prepare default and prefix
923
+ $prefix = $this->get_prefix( $location ) . $location . '_';
924
+ $opts = array();
925
+
926
+ foreach ( $settings as $k => $v ) {
927
+ if ( $v['save'] ) {
928
+ $opts[ $k ] = $v['default'];
929
+ }
930
+ }
931
+ foreach ( $options as $k => $v ) {
932
+ switch ( $k ) {
933
+ case $prefix . 'category':
934
+ if ( empty( $v ) ) {
935
+ // Get post type
936
+ $type = isset( get_current_screen()->post_type )
937
+ ? get_current_screen()->post_type
938
+ : null;
939
+ // Assign default from plugin options
940
+ if ( ! empty( $type )
941
+ && isset( $aioseop_options['modules'] )
942
+ && isset( $aioseop_options['modules']['aiosp_opengraph_options'] )
943
+ && isset( $aioseop_options['modules']['aiosp_opengraph_options'][ 'aiosp_opengraph_' . $type . '_fb_object_type' ] )
944
+ ) {
945
+ $options[ $prefix . 'category' ] =
946
+ $aioseop_options['modules']['aiosp_opengraph_options'][ 'aiosp_opengraph_' . $type . '_fb_object_type' ];
947
+ }
948
+ }
949
+ break;
950
+ }
951
+ if ( $v === null ) {
952
+ unset( $options[ $k ] );
953
+ }
954
+ }
955
+ $options = wp_parse_args( $options, $opts );
956
+
957
+ // https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/1013
958
+ $post_types = $this->get_post_type_titles();
959
+ foreach ( $post_types as $slug => $name ) {
960
+ $field = 'aiosp_opengraph_' . $slug . '_fb_object_type';
961
+ if ( isset( $options[ $field ] ) && 'blog' === $options[ $field ] ) {
962
+ $options[ $field ] = 'website';
963
+ }
964
+ }
965
+
966
+ return $options;
967
+ }
968
+
969
+ /**
970
+ * Applies filter to metabox settings before they are saved.
971
+ * Sets custom as default if a custom image is uploaded.
972
+ * filter:{prefix}filter_metabox_options
973
+ * filter:{prefix}filter_term_metabox_options
974
+ *
975
+ * @since 2.3.11
976
+ * @since 2.4.14 Fixes for aioseop-pro #67 and other bugs found.
977
+ *
978
+ * @see [plugin]\admin\aioseop_module_class.php > save_post_data()
979
+ * @see [this file] > save_tax_data()
980
+ *
981
+ * @param array $options List of current options.
982
+ * @param string $location Location where filter is called.
983
+ * @param int $id Either post_id or term_id.
984
+ *
985
+ * @return array
986
+ */
987
+ function filter_metabox_options( $options, $location, $post_id ) {
988
+ if ( $location == 'settings' ) {
989
+ $prefix = $this->get_prefix( $location ) . $location . '_';
990
+ if ( isset( $options[ $prefix . 'customimg_checker' ] )
991
+ && $options[ $prefix . 'customimg_checker' ]
992
+ ) {
993
+ $options[ $prefix . 'image' ] = $options[ $prefix . 'customimg' ];
994
+ }
995
+ }
996
+ return $options;
997
+ }
998
+
999
+ /** Custom settings **/
1000
+ function display_custom_options( $buf, $args ) {
1001
+ if ( $args['name'] == 'aiosp_opengraph_scan_header' ) {
1002
+ $buf .= '<div class="aioseop aioseop_options aiosp_opengraph_settings"><div class="aioseop_wrapper aioseop_custom_type" id="aiosp_opengraph_scan_header_wrapper"><div class="aioseop_input" id="aiosp_opengraph_scan_header" style="padding-left:20px;">';
1003
+ $args['options']['type'] = 'submit';
1004
+ $args['attr'] = " class='button-primary' ";
1005
+ $args['value'] = $args['options']['default'] = __( 'Scan Now', 'all-in-one-seo-pack' );
1006
+ $buf .= __( 'Scan your site for duplicate social meta tags.', 'all-in-one-seo-pack' );
1007
+ $buf .= '<br /><br />' . $this->get_option_html( $args );
1008
+ $buf .= '</div></div></div>';
1009
+ }
1010
+
1011
+ return $buf;
1012
+ }
1013
+
1014
+ function add_attributes( $output ) {
1015
+ // avoid having duplicate meta tags
1016
+ $type = $this->type;
1017
+ if ( empty( $type ) ) {
1018
+ $type = 'website';
1019
+ }
1020
+ $schema_types = array(
1021
+ 'album' => 'MusicAlbum',
1022
+ 'article' => 'Article',
1023
+ 'bar' => 'BarOrPub',
1024
+ 'blog' => 'Blog',
1025
+ 'book' => 'Book',
1026
+ 'cafe' => 'CafeOrCoffeeShop',
1027
+ 'city' => 'City',
1028
+ 'country' => 'Country',
1029
+ 'episode' => 'Episode',
1030
+ 'food' => 'FoodEvent',
1031
+ 'game' => 'Game',
1032
+ 'hotel' => 'Hotel',
1033
+ 'landmark' => 'LandmarksOrHistoricalBuildings',
1034
+ 'movie' => 'Movie',
1035
+ 'product' => 'Product',
1036
+ 'profile' => 'ProfilePage',
1037
+ 'restaurant' => 'Restaurant',
1038
+ 'school' => 'School',
1039
+ 'sport' => 'SportsEvent',
1040
+ 'website' => 'WebSite',
1041
+ );
1042
+
1043
+ if ( ! empty( $schema_types[ $type ] ) ) {
1044
+ $type = $schema_types[ $type ];
1045
+ } else {
1046
+ $type = 'WebSite';
1047
+ }
1048
+
1049
+ $attributes = apply_filters(
1050
+ $this->prefix . 'attributes', array(
1051
+ 'prefix="og: http://ogp.me/ns#"',
1052
+ )
1053
+ );
1054
+
1055
+ foreach ( $attributes as $attr ) {
1056
+ if ( strpos( $output, $attr ) === false ) {
1057
+ $output .= "\n\t$attr ";
1058
+ }
1059
+ }
1060
+
1061
+ return $output;
1062
+ }
1063
+
1064
+ /**
1065
+ * Add our social meta.
1066
+ *
1067
+ * @since 1.0.0
1068
+ * @since 2.3.11.5 Support for multiple fb_admins.
1069
+ * @since 2.3.13 Adds filter:aioseop_description on description.
1070
+ * @since 2.4.14 Fixes for aioseop-pro #67.
1071
+ * @since 2.3.15 Always do_shortcode on descriptions, removed for titles.
1072
+ *
1073
+ * @global object $post Current WP_Post object.
1074
+ * @global object $aiosp All in one seo plugin object.
1075
+ * @global array $aioseop_options All in one seo plugin options.
1076
+ * @global object $wp_query WP_Query global instance.
1077
+ */
1078
+ function add_meta() {
1079
+ global $post, $aiosp, $aioseop_options, $wp_query;
1080
+ $metabox = $this->get_current_options( array(), 'settings' );
1081
+ $key = $this->options['aiosp_opengraph_key'];
1082
+ $key = $this->options['aiosp_opengraph_key'];
1083
+ $dimg = $this->options['aiosp_opengraph_dimg'];
1084
+ $current_post_type = get_post_type();
1085
+ $title = $description = $image = $video = '';
1086
+ $type = $this->type;
1087
+ $sitename = $this->options['aiosp_opengraph_sitename'];
1088
+ $tag = '';
1089
+
1090
+ // for some reason, options is not populated correctly during unit tests.
1091
+ if ( defined( 'AIOSEOP_UNIT_TESTING' ) ) {
1092
+ $this->options = $aioseop_options['modules'][ $this->prefix . 'options' ];
1093
+ }
1094
+
1095
+ $appid = isset( $this->options['aiosp_opengraph_appid'] ) ? $this->options['aiosp_opengraph_appid'] : '';
1096
+
1097
+ if ( ! empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
1098
+ $first_page = false;
1099
+ if ( $aiosp->get_page_number() < 2 ) {
1100
+ $first_page = true;
1101
+ }
1102
+ } else {
1103
+ $first_page = true;
1104
+ }
1105
+ $url = $aiosp->aiosp_mrt_get_url( $wp_query );
1106
+ $url = apply_filters( 'aioseop_canonical_url', $url );
1107
+
1108
+ // this will collect the extra values that are required outside the below IF block.
1109
+ $extra_params = array();
1110
+
1111
+ $setmeta = $this->options['aiosp_opengraph_setmeta'];
1112
+ $social_links = '';
1113
+ if ( is_front_page() ) {
1114
+ $title = $this->options['aiosp_opengraph_hometitle'];
1115
+ if ( $first_page ) {
1116
+ $description = $this->options['aiosp_opengraph_description'];
1117
+ if ( empty( $description ) ) {
1118
+ $description = get_bloginfo( 'description' );
1119
+ }
1120
+ }
1121
+ if ( ! empty( $this->options['aiosp_opengraph_homeimage'] ) ) {
1122
+ $thumbnail = $this->options['aiosp_opengraph_homeimage'];
1123
+ } else {
1124
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
1125
+ }
1126
+
1127
+ /* If Use AIOSEO Title and Desc Selected */
1128
+ if ( $setmeta ) {
1129
+ $title = $aiosp->wp_title();
1130
+ if ( $first_page ) {
1131
+ $description = $aiosp->get_aioseop_description( $post );
1132
+ }
1133
+ }
1134
+
1135
+ /* Add some defaults */
1136
+ if ( empty( $title ) ) {
1137
+ $title = get_bloginfo( 'name' );
1138
+ }
1139
+ if ( empty( $sitename ) ) {
1140
+ $sitename = get_bloginfo( 'name' );
1141
+ }
1142
+
1143
+ if ( empty( $description ) && $first_page && ! empty( $post ) && ! post_password_required( $post ) ) {
1144
+
1145
+ if ( ! empty( $post->post_content ) || ! empty( $post->post_excerpt ) ) {
1146
+ $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ), 200 );
1147
+
1148
+ if ( ! empty( $this->options['aiosp_opengraph_generate_descriptions'] ) ) {
1149
+ $description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 200 );
1150
+ }
1151
+ }
1152
+ }
1153
+
1154
+ if ( empty( $description ) && $first_page ) {
1155
+ $description = get_bloginfo( 'description' );
1156
+ }
1157
+ if ( ! empty( $this->options['aiosp_opengraph_profile_links'] ) ) {
1158
+ $social_links = $this->options['aiosp_opengraph_profile_links'];
1159
+ if ( ! empty( $this->options['aiosp_opengraph_social_name'] ) ) {
1160
+ $social_name = $this->options['aiosp_opengraph_social_name'];
1161
+ } else {
1162
+ $social_name = '';
1163
+ }
1164
+ if ( $this->options['aiosp_opengraph_person_or_org'] == 'person' ) {
1165
+ $social_type = 'Person';
1166
+ } else {
1167
+ $social_type = 'Organization';
1168
+ }
1169
+ }
1170
+ } elseif ( is_singular() && $this->option_isset( 'types' )
1171
+ && is_array( $this->options['aiosp_opengraph_types'] )
1172
+ && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] )
1173
+ ) {
1174
+
1175
+ if ( $type == 'article' ) {
1176
+ if ( ! empty( $metabox['aioseop_opengraph_settings_section'] ) ) {
1177
+ $section = $metabox['aioseop_opengraph_settings_section'];
1178
+ }
1179
+ if ( ! empty( $metabox['aioseop_opengraph_settings_tag'] ) ) {
1180
+ $tag = $metabox['aioseop_opengraph_settings_tag'];
1181
+ }
1182
+ if ( ! empty( $this->options['aiosp_opengraph_facebook_publisher'] ) ) {
1183
+ $publisher = $this->options['aiosp_opengraph_facebook_publisher'];
1184
+ }
1185
+ }
1186
+
1187
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
1188
+ $domain = $this->options['aiosp_opengraph_twitter_domain'];
1189
+ }
1190
+
1191
+ if ( $type == 'article' && ! empty( $post ) ) {
1192
+ if ( isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_facebook_author'] ) ) {
1193
+ $author = get_the_author_meta( 'facebook', $post->post_author );
1194
+ }
1195
+
1196
+ if ( isset( $post->post_date_gmt ) ) {
1197
+ $published_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_date_gmt ) );
1198
+ }
1199
+
1200
+ if ( isset( $post->post_modified_gmt ) ) {
1201
+ $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified_gmt ) );
1202
+ }
1203
+ }
1204
+
1205
+ $image = $metabox['aioseop_opengraph_settings_image'];
1206
+ $video = $metabox['aioseop_opengraph_settings_video'];
1207
+ $title = $metabox['aioseop_opengraph_settings_title'];
1208
+ $description = $metabox['aioseop_opengraph_settings_desc'];
1209
+
1210
+ // Let's make a note of manually provided descriptions/titles as they might need special handling.
1211
+ // @issue https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/808
1212
+ // @issue https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/2296
1213
+ $title_from_main_settings = trim( strip_tags( get_post_meta( $post->ID, '_aioseop_title', true ) ) );
1214
+ $desc_from_main_settings = trim( strip_tags( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
1215
+ if ( empty( $title ) && empty( $title_from_main_settings ) ) {
1216
+ $extra_params['auto_generate_title'] = true;
1217
+ }
1218
+ if ( empty( $description ) && empty( $desc_from_main_settings ) ) {
1219
+ $extra_params['auto_generate_desc'] = true;
1220
+ }
1221
+
1222
+ /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
1223
+ global $aiosp;
1224
+ if ( empty( $title ) ) {
1225
+ $title = $aiosp->wp_title();
1226
+ }
1227
+ if ( empty( $description ) ) {
1228
+ $description = trim( strip_tags( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
1229
+ }
1230
+
1231
+ /* Add default title */
1232
+ if ( empty( $title ) ) {
1233
+ $title = get_the_title();
1234
+ }
1235
+
1236
+ // Add default description.
1237
+ if ( empty( $description ) && ! post_password_required( $post ) ) {
1238
+
1239
+ $description = $post->post_excerpt;
1240
+
1241
+ if ( $this->options['aiosp_opengraph_generate_descriptions'] || empty( $description ) ) {
1242
+ if ( ! AIOSEOPPRO || ( AIOSEOPPRO && apply_filters( $this->prefix . 'generate_descriptions_from_content', true, $post ) ) ) {
1243
+ $description = $post->post_content;
1244
+ } else {
1245
+ $description = $post->post_excerpt;
1246
+ }
1247
+ }
1248
+ }
1249
+ if ( empty( $type ) ) {
1250
+ $type = 'article';
1251
+ }
1252
+ } elseif ( AIOSEOPPRO && ( is_category() || is_tag() || is_tax() ) ) {
1253
+ if ( isset( $this->options['aioseop_opengraph_settings_category'] ) ) {
1254
+ $type = $this->options['aioseop_opengraph_settings_category'];
1255
+ }
1256
+ if ( isset( $metabox['aioseop_opengraph_settings_category'] ) ) {
1257
+ $type = $metabox['aioseop_opengraph_settings_category'];
1258
+ }
1259
+ if ( $type == 'article' ) {
1260
+ if ( ! empty( $metabox['aioseop_opengraph_settings_section'] ) ) {
1261
+ $section = $metabox['aioseop_opengraph_settings_section'];
1262
+ }
1263
+ if ( ! empty( $metabox['aioseop_opengraph_settings_tag'] ) ) {
1264
+ $tag = $metabox['aioseop_opengraph_settings_tag'];
1265
+ }
1266
+ if ( ! empty( $this->options['aiosp_opengraph_facebook_publisher'] ) ) {
1267
+ $publisher = $this->options['aiosp_opengraph_facebook_publisher'];
1268
+ }
1269
+ }
1270
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
1271
+ $domain = $this->options['aiosp_opengraph_twitter_domain'];
1272
+ }
1273
+ if ( $type == 'article' && ! empty( $post ) ) {
1274
+ if ( isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_facebook_author'] ) ) {
1275
+ $author = get_the_author_meta( 'facebook', $post->post_author );
1276
+ }
1277
+
1278
+ if ( isset( $post->post_date_gmt ) ) {
1279
+ $published_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_date_gmt ) );
1280
+ }
1281
+ if ( isset( $post->post_modified_gmt ) ) {
1282
+ $modified_time = date( 'Y-m-d\TH:i:s\Z', mysql2date( 'U', $post->post_modified_gmt ) );
1283
+ }
1284
+ }
1285
+ $image = $metabox['aioseop_opengraph_settings_image'];
1286
+ $video = $metabox['aioseop_opengraph_settings_video'];
1287
+ $title = $metabox['aioseop_opengraph_settings_title'];
1288
+ $description = $metabox['aioseop_opengraph_settings_desc'];
1289
+ /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
1290
+ global $aiosp;
1291
+ if ( empty( $title ) ) {
1292
+ $title = $aiosp->wp_title();
1293
+ }
1294
+ if ( empty( $description ) ) {
1295
+ $term_id = isset( $_GET['tag_ID'] ) ? (int) $_GET['tag_ID'] : 0;
1296
+ $term_id = $term_id ? $term_id : get_queried_object()->term_id;
1297
+ $description = trim( strip_tags( get_term_meta( $term_id, '_aioseop_description', true ) ) );
1298
+ }
1299
+ // Add default title
1300
+ if ( empty( $title ) ) {
1301
+ $title = get_the_title();
1302
+ }
1303
+ // Add default description.
1304
+ if ( empty( $description ) && ! post_password_required( $post ) ) {
1305
+ $description = get_queried_object()->description;
1306
+ }
1307
+ if ( empty( $type ) ) {
1308
+ // https://github.com/semperfiwebdesign/aioseop-pro/issues/321
1309
+ if ( AIOSEOPPRO && ( is_category() || is_tag() || is_tax() ) ) {
1310
+ $og_options = $aioseop_options['modules'][ $this->prefix . 'options' ];
1311
+ $current_post_type = get_post_type();
1312
+ // check if the post type's object type is set.
1313
+ if ( isset( $og_options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
1314
+ $type = $og_options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ];
1315
+ } elseif ( in_array( $current_post_type, array( 'post', 'page' ) ) ) {
1316
+ $type = 'article';
1317
+ }
1318
+ } else {
1319
+ $type = 'website';
1320
+ }
1321
+ }
1322
+ } elseif ( is_home() && ! is_front_page() ) {
1323
+ // This is the blog page but not the homepage.
1324
+ global $aiosp;
1325
+ $image = $metabox['aioseop_opengraph_settings_image'];
1326
+ $video = $metabox['aioseop_opengraph_settings_video'];
1327
+ $title = $metabox['aioseop_opengraph_settings_title'];
1328
+ $description = $metabox['aioseop_opengraph_settings_desc'];
1329
+
1330
+ if ( empty( $description ) ) {
1331
+ // If there's not social description, fall back to the SEO description.
1332
+ $description = trim( strip_tags( get_post_meta( get_option( 'page_for_posts' ), '_aioseop_description', true ) ) );
1333
+ }
1334
+ if ( empty( $title ) ) {
1335
+ $title = $aiosp->wp_title();
1336
+ }
1337
+ } else {
1338
+ return;
1339
+ }
1340
+
1341
+ if ( $type === 'article' && ! empty( $post ) && is_singular() ) {
1342
+ if ( ! empty( $this->options['aiosp_opengraph_gen_tags'] ) ) {
1343
+ if ( ! empty( $this->options['aiosp_opengraph_gen_keywords'] ) ) {
1344
+ $keywords = $aiosp->get_main_keywords();
1345
+ $keywords = $this->apply_cf_fields( $keywords );
1346
+ $keywords = apply_filters( 'aioseop_keywords', $keywords );
1347
+ if ( ! empty( $keywords ) && ! empty( $tag ) ) {
1348
+ $tag .= ',' . $keywords;
1349
+ } elseif ( empty( $tag ) ) {
1350
+ $tag = $keywords;
1351
+ }
1352
+ }
1353
+ $tag = $aiosp->keyword_string_to_list( $tag );
1354
+ if ( ! empty( $this->options['aiosp_opengraph_gen_categories'] ) ) {
1355
+ $tag = array_merge( $tag, $aiosp->get_all_categories( $post->ID ) );
1356
+ }
1357
+ if ( ! empty( $this->options['aiosp_opengraph_gen_post_tags'] ) ) {
1358
+ $tag = array_merge( $tag, $aiosp->get_all_tags( $post->ID ) );
1359
+ }
1360
+ }
1361
+ if ( ! empty( $tag ) ) {
1362
+ $tag = $aiosp->clean_keyword_list( $tag );
1363
+ }
1364
+ }
1365
+
1366
+ if ( ! empty( $this->options['aiosp_opengraph_title_shortcodes'] ) ) {
1367
+ $title = aioseop_do_shortcodes( $title );
1368
+ }
1369
+ if ( ! empty( $description ) ) {
1370
+ $description = $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) );
1371
+ if ( ! empty( $this->options['aiosp_opengraph_description_shortcodes'] ) ) {
1372
+ $description = aioseop_do_shortcodes( $description );
1373
+ }
1374
+ if ( ! empty( $this->options['aiosp_opengraph_generate_descriptions'] ) && $this->options['aiosp_opengraph_generate_descriptions'] ) {
1375
+ $description = $aiosp->trim_excerpt_without_filters( $description, 200 );
1376
+ } else {
1377
+ // User input still needs to be run through this function to strip tags.
1378
+ $description = $aiosp->trim_excerpt_without_filters( $description, 99999 );
1379
+ }
1380
+ }
1381
+
1382
+ $title = $this->apply_cf_fields( $title );
1383
+ $description = $this->apply_cf_fields( $description );
1384
+
1385
+ /* Data Validation */
1386
+ $title = strip_tags( esc_attr( $title ) );
1387
+ $sitename = strip_tags( esc_attr( $sitename ) );
1388
+ $description = strip_tags( esc_attr( $description ) );
1389
+
1390
+ if ( empty( $thumbnail ) && ! empty( $image ) ) {
1391
+ $thumbnail = $image;
1392
+ }
1393
+
1394
+ // Add user supplied default image.
1395
+ if ( empty( $thumbnail ) ) {
1396
+ if ( empty( $this->options['aiosp_opengraph_defimg'] ) ) {
1397
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
1398
+ } else {
1399
+ $img_type = $this->options['aiosp_opengraph_defimg'];
1400
+ if ( ! empty( $post ) ) {
1401
+ // Customize the type of image per post/post_type.
1402
+ $img_type = apply_filters( $this->prefix . 'default_image_type', $img_type, $post, $type );
1403
+ }
1404
+ switch ( $img_type ) {
1405
+ case 'featured':
1406
+ $thumbnail = $this->get_the_image_by_post_thumbnail();
1407
+ break;
1408
+ case 'attach':
1409
+ $thumbnail = $this->get_the_image_by_attachment();
1410
+ break;
1411
+ case 'content':
1412
+ $thumbnail = $this->get_the_image_by_scan();
1413
+ break;
1414
+ case 'custom':
1415
+ $meta_key = $this->options['aiosp_opengraph_meta_key'];
1416
+ if ( ! empty( $meta_key ) && ! empty( $post ) ) {
1417
+ $meta_key = explode( ',', $meta_key );
1418
+ $thumbnail = $this->get_the_image_by_meta_key(
1419
+ array(
1420
+ 'post_id' => $post->ID,
1421
+ 'meta_key' => $meta_key,
1422
+ )
1423
+ );
1424
+ }
1425
+ break;
1426
+ case 'auto':
1427
+ $thumbnail = $this->get_the_image();
1428
+ break;
1429
+ case 'author':
1430
+ $thumbnail = $this->get_the_image_by_author();
1431
+ break;
1432
+ default:
1433
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
1434
+ }
1435
+ }
1436
+ }
1437
+
1438
+ if ( empty( $thumbnail ) && ! empty( $this->options['aiosp_opengraph_fallback'] ) ) {
1439
+ $thumbnail = $this->options['aiosp_opengraph_dimg'];
1440
+ if ( ! empty( $post ) ) {
1441
+ // Customize the default image per post/post_type.
1442
+ $thumbnail = apply_filters( $this->prefix . 'default_image', $thumbnail, $post, $type );
1443
+ }
1444
+ }
1445
+
1446
+ if ( ! empty( $thumbnail ) ) {
1447
+ $thumbnail = esc_url( $thumbnail );
1448
+ $thumbnail = set_url_scheme( $thumbnail );
1449
+ }
1450
+
1451
+ $width = $height = '';
1452
+ if ( ! empty( $thumbnail ) ) {
1453
+ if ( ! empty( $metabox['aioseop_opengraph_settings_imagewidth'] ) ) {
1454
+ $width = $metabox['aioseop_opengraph_settings_imagewidth'];
1455
+ }
1456
+ if ( ! empty( $metabox['aioseop_opengraph_settings_imageheight'] ) ) {
1457
+ $height = $metabox['aioseop_opengraph_settings_imageheight'];
1458
+ }
1459
+ if ( empty( $width ) && ! empty( $this->options['aiosp_opengraph_dimgwidth'] ) ) {
1460
+ $width = $this->options['aiosp_opengraph_dimgwidth'];
1461
+ }
1462
+ if ( empty( $height ) && ! empty( $this->options['aiosp_opengraph_dimgheight'] ) ) {
1463
+ $height = $this->options['aiosp_opengraph_dimgheight'];
1464
+ }
1465
+ }
1466
+
1467
+ if ( ! empty( $video ) ) {
1468
+ if ( ! empty( $metabox['aioseop_opengraph_settings_videowidth'] ) ) {
1469
+ $videowidth = $metabox['aioseop_opengraph_settings_videowidth'];
1470
+ }
1471
+ if ( ! empty( $metabox['aioseop_opengraph_settings_videoheight'] ) ) {
1472
+ $videoheight = $metabox['aioseop_opengraph_settings_videoheight'];
1473
+ }
1474
+ }
1475
+
1476
+ $card = 'summary';
1477
+ if ( ! empty( $this->options['aiosp_opengraph_defcard'] ) ) {
1478
+ $card = $this->options['aiosp_opengraph_defcard'];
1479
+ }
1480
+
1481
+ if ( ! empty( $metabox['aioseop_opengraph_settings_setcard'] ) ) {
1482
+ $card = $metabox['aioseop_opengraph_settings_setcard'];
1483
+ }
1484
+
1485
+ // support for changing legacy twitter cardtype-photo to summary large image
1486
+ if ( $card == 'photo' ) {
1487
+ $card = 'summary_large_image';
1488
+ }
1489
+
1490
+ $site = $domain = $creator = '';
1491
+
1492
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_site'] ) ) {
1493
+ $site = $this->options['aiosp_opengraph_twitter_site'];
1494
+ $site = AIOSEOP_Opengraph_Public::prepare_twitter_username( $site );
1495
+ }
1496
+
1497
+ if ( ! empty( $this->options['aiosp_opengraph_twitter_domain'] ) ) {
1498
+ $domain = $this->options['aiosp_opengraph_twitter_domain'];
1499
+ }
1500
+
1501
+ if ( ! empty( $post ) && isset( $post->post_author ) && ! empty( $this->options['aiosp_opengraph_twitter_creator'] ) ) {
1502
+ $creator = get_the_author_meta( 'twitter', $post->post_author );
1503
+ $creator = AIOSEOP_Opengraph_Public::prepare_twitter_username( $creator );
1504
+ }
1505
+
1506
+ if ( ! empty( $thumbnail ) ) {
1507
+ $twitter_thumbnail = $thumbnail; // Default Twitter image if custom isn't set.
1508
+ }
1509
+
1510
+ if ( isset( $metabox['aioseop_opengraph_settings_customimg_twitter'] ) && ! empty( $metabox['aioseop_opengraph_settings_customimg_twitter'] ) ) {
1511
+ // Set Twitter image from custom.
1512
+ $twitter_thumbnail = set_url_scheme( $metabox['aioseop_opengraph_settings_customimg_twitter'] );
1513
+ }
1514
+
1515
+ // Apply last filters.
1516
+ $description = apply_filters( 'aioseop_description', $description );
1517
+
1518
+ $meta = array(
1519
+ 'facebook' => array(
1520
+ 'title' => 'og:title',
1521
+ 'type' => 'og:type',
1522
+ 'url' => 'og:url',
1523
+ 'thumbnail' => 'og:image',
1524
+ 'width' => 'og:image:width',
1525
+ 'height' => 'og:image:height',
1526
+ 'video' => 'og:video',
1527
+ 'videowidth' => 'og:video:width',
1528
+ 'videoheight' => 'og:video:height',
1529
+ 'sitename' => 'og:site_name',
1530
+ 'key' => 'fb:admins',
1531
+ 'appid' => 'fb:app_id',
1532
+ 'description' => 'og:description',
1533
+ 'section' => 'article:section',
1534
+ 'tag' => 'article:tag',
1535
+ 'publisher' => 'article:publisher',
1536
+ 'author' => 'article:author',
1537
+ 'published_time' => 'article:published_time',
1538
+ 'modified_time' => 'article:modified_time',
1539
+ ),
1540
+ 'twitter' => array(
1541
+ 'card' => 'twitter:card',
1542
+ 'site' => 'twitter:site',
1543
+ 'creator' => 'twitter:creator',
1544
+ 'domain' => 'twitter:domain',
1545
+ 'title' => 'twitter:title',
1546
+ 'description' => 'twitter:description',
1547
+ 'twitter_thumbnail' => 'twitter:image',
1548
+ ),
1549
+ );
1550
+
1551
+ // https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/1848
1552
+ if ( is_ssl() ) {
1553
+ $meta['facebook'] += array( 'thumbnail_1' => 'og:image:secure_url' );
1554
+ $thumbnail_1 = $thumbnail;
1555
+ }
1556
+
1557
+ $tags = array(
1558
+ 'facebook' => array( 'name' => 'property', 'value' => 'content' ),
1559
+ 'twitter' => array( 'name' => 'name', 'value' => 'content' ),
1560
+ );
1561
+
1562
+ foreach ( $meta as $t => $data ) {
1563
+ foreach ( $data as $k => $v ) {
1564
+ if ( empty( $$k ) ) {
1565
+ $$k = '';
1566
+ }
1567
+ $filtered_value = $$k;
1568
+
1569
+ /**
1570
+ * Process meta tags for their idiosyncracies.
1571
+ *
1572
+ * @since 3.0
1573
+ *
1574
+ * @param string $filtered_value The value that is proposed to be shown in the tag.
1575
+ * @param string $t The social network.
1576
+ * @param string $k The meta tag without the network name prefixed.
1577
+ * @param string $v The meta tag with the network name prefixed. This is not always $network:$meta_tag.
1578
+ * @param array $extra_params Extra parameters that might be required to process the meta tag.
1579
+ */
1580
+ $filtered_value = apply_filters( $this->prefix . 'meta', $filtered_value, $t, $k, $v, $extra_params );
1581
+ if ( ! empty( $filtered_value ) ) {
1582
+ if ( ! is_array( $filtered_value ) ) {
1583
+ $filtered_value = array( $filtered_value );
1584
+ }
1585
+
1586
+ /**
1587
+ * This is to accomodate multiple fb:admins on separate lines.
1588
+ * @TODO Eventually we'll want to put this in its own function so things like images work too.
1589
+ */
1590
+ if ( 'key' === $k ) {
1591
+ $fbadmins = explode( ',', str_replace( ' ', '', $filtered_value[0] ) ); // Trim spaces then turn comma-separated values into an array.
1592
+ foreach ( $fbadmins as $fbadmin ) {
1593
+ echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . $fbadmin . '" />' . "\n";
1594
+ }
1595
+ } else {
1596
+ // For everything else.
1597
+ foreach ( $filtered_value as $f ) {
1598
+ // #1363: use esc_attr( $f ) instead of htmlspecialchars_decode( $f, ENT_QUOTES )
1599
+ echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . esc_attr( $f ) . '" />' . "\n";
1600
+ }
1601
+ }
1602
+ }
1603
+ }
1604
+ }
1605
+ $social_link_schema = '';
1606
+ if ( ! empty( $social_links ) ) {
1607
+ $home_url = esc_url( get_home_url() );
1608
+ $social_links = explode( "\n", $social_links );
1609
+ foreach ( $social_links as $k => $v ) {
1610
+ $v = trim( $v );
1611
+ if ( empty( $v ) ) {
1612
+ unset( $social_links[ $k ] );
1613
+ } else {
1614
+ $v = esc_url( $v );
1615
+ $social_links[ $k ] = $v;
1616
+ }
1617
+ }
1618
+ $social_links = join( '","', $social_links );
1619
+ $social_link_schema = <<<END
1620
+ <script type="application/ld+json">
1621
+ { "@context" : "https://schema.org",
1622
+ "@type" : "{$social_type}",
1623
+ "name" : "{$social_name}",
1624
+ "url" : "{$home_url}",
1625
+ "sameAs" : ["{$social_links}"]
1626
+ }
1627
+ </script>
1628
+
1629
+ END;
1630
+ }
1631
+
1632
+ // Only show if "use schema.org markup is checked".
1633
+ if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
1634
+ echo apply_filters( 'aiosp_opengraph_social_link_schema', $social_link_schema );
1635
+ }
1636
+ }
1637
+
1638
+ /**
1639
+ * Do / adds opengraph properties to meta.
1640
+ * @since 2.3.11
1641
+ *
1642
+ * @global array $aioseop_options AIOSEOP plugin options.
1643
+ */
1644
+ public function do_opengraph() {
1645
+ global $aioseop_options;
1646
+ if ( ! empty( $aioseop_options )
1647
+ && ! empty( $aioseop_options['aiosp_schema_markup'] )
1648
+ ) {
1649
+ add_filter( 'language_attributes', array( &$this, 'add_attributes' ) );
1650
+ }
1651
+ if ( ! defined( 'DOING_AJAX' ) ) {
1652
+ add_action( 'aioseop_modules_wp_head', array( &$this, 'add_meta' ), 5 );
1653
+ // Add social meta to AMP plugin.
1654
+ if ( apply_filters( 'aioseop_enable_amp_social_meta', true ) === true ) {
1655
+ add_action( 'amp_post_template_head', array( &$this, 'add_meta' ), 12 );
1656
+ }
1657
+ }
1658
+ }
1659
+
1660
+ /**
1661
+ * Set up types.
1662
+ *
1663
+ * @since ?
1664
+ * @since 2.3.15 Change to website for homepage and blog post index page, default to object.
1665
+ */
1666
+ function type_setup() {
1667
+ $this->type = 'object'; // Default to type object if we don't have some other rule.
1668
+
1669
+ if ( is_home() || is_front_page() ) {
1670
+ $this->type = 'website'; // Home page and blog page should be website.
1671
+ } elseif ( is_singular() && $this->option_isset( 'types' ) ) {
1672
+ $metabox = $this->get_current_options( array(), 'settings' );
1673
+ $current_post_type = get_post_type();
1674
+ if ( ! empty( $metabox['aioseop_opengraph_settings_category'] ) ) {
1675
+ $this->type = $metabox['aioseop_opengraph_settings_category'];
1676
+ } elseif ( isset( $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ] ) ) {
1677
+ $this->type = $this->options[ "aiosp_opengraph_{$current_post_type}_fb_object_type" ];
1678
+ }
1679
+ }
1680
+ }
1681
+
1682
+ /**
1683
+ * Inits hooks and others for admin init.
1684
+ * action:admin_init.
1685
+ *
1686
+ * @since 2.3.11
1687
+ * @since 2.4.14 Refactored function name, and new filter added for defaults and missing term metabox.
1688
+ */
1689
+ function admin_init() {
1690
+ add_filter( $this->prefix . 'display_settings', array( &$this, 'filter_settings' ), 10, 3 );
1691
+ add_filter( $this->prefix . 'override_options', array( &$this, 'override_options' ), 10, 3 );
1692
+ add_filter(
1693
+ $this->get_prefix( 'settings' ) . 'default_options', array(
1694
+ &$this,
1695
+ 'filter_default_options',
1696
+ ), 10, 2
1697
+ );
1698
+ add_filter(
1699
+ $this->get_prefix( 'settings' ) . 'filter_metabox_options', array(
1700
+ &$this,
1701
+ 'filter_metabox_options',
1702
+ ), 10, 3
1703
+ );
1704
+ add_filter(
1705
+ $this->get_prefix( 'settings' ) . 'filter_term_metabox_options', array(
1706
+ &$this,
1707
+ 'filter_metabox_options',
1708
+ ), 10, 3
1709
+ );
1710
+ $post_types = $this->get_post_type_titles();
1711
+ $rempost = array(
1712
+ 'revision' => 1,
1713
+ 'nav_menu_item' => 1,
1714
+ 'custom_css' => 1,
1715
+ 'customize_changeset' => 1,
1716
+ );
1717
+ $post_types = array_diff_key( $post_types, $rempost );
1718
+ $this->default_options['types']['initial_options'] = $post_types;
1719
+ foreach ( $post_types as $slug => $name ) {
1720
+ $field = $slug . '_fb_object_type';
1721
+ $this->default_options[ $field ] = array(
1722
+ 'name' => "$name " . __( 'Object Type', 'all-in-one-seo-pack' ) . "<br />($slug)",
1723
+ 'type' => 'select',
1724
+ 'style' => '',
1725
+ 'initial_options' => $this->fb_object_types,
1726
+ 'default' => 'article',
1727
+ 'condshow' => array( 'aiosp_opengraph_types\[\]' => $slug ),
1728
+ );
1729
+ $this->locations['opengraph']['options'][] = $field;
1730
+ $this->layout['facebook']['options'][] = $field;
1731
+ }
1732
+ $this->setting_options();
1733
+ }
1734
+
1735
+ function get_all_images( $options = null, $p = null ) {
1736
+ static $img = array();
1737
+ if ( ! is_array( $options ) ) {
1738
+ $options = array();
1739
+ }
1740
+ if ( ! empty( $this->options['aiosp_opengraph_meta_key'] ) ) {
1741
+ $options['meta_key'] = $this->options['aiosp_opengraph_meta_key'];
1742
+ }
1743
+ if ( empty( $img ) ) {
1744
+ $size = apply_filters( 'post_thumbnail_size', 'large' );
1745
+ $default = $this->get_the_image_by_default();
1746
+ if ( ! empty( $default ) ) {
1747
+ $default = set_url_scheme( $default );
1748
+ $img[ $default ] = 0;
1749
+ }
1750
+ $img = array_merge( $img, parent::get_all_images( $options, null ) );
1751
+ }
1752
+
1753
+ if ( ! empty( $options ) && ! empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
1754
+ $img[ $options['aioseop_opengraph_settings_customimg'] ] = 'customimg';
1755
+ }
1756
+
1757
+ if ( ! empty( $options ) && ! empty( $options['aioseop_opengraph_settings_customimg'] ) ) {
1758
+ $img[ $options['aioseop_opengraph_settings_customimg'] ] = 'customimg';
1759
+ $img[ $options['aioseop_opengraph_settings_customimg_twitter'] ] = 'customimg_twitter';
1760
+ }
1761
+
1762
+ if ( $author_img = $this->get_the_image_by_author( $p ) ) {
1763
+ $image['author'] = $author_img;
1764
+ }
1765
+ $image = array_flip( $img );
1766
+ $images = array();
1767
+ if ( ! empty( $image ) ) {
1768
+ foreach ( $image as $k => $v ) {
1769
+ $images[ $v ] = '<img height=150 src="' . $v . '">';
1770
+ }
1771
+ }
1772
+
1773
+ return array( $image, $images );
1774
+ }
1775
+
1776
+ function get_the_image_by_author( $options = null, $p = null ) {
1777
+ if ( $p === null ) {
1778
+ global $post;
1779
+ } else {
1780
+ $post = $p;
1781
+ }
1782
+ if ( ! empty( $post ) && ! empty( $post->post_author ) ) {
1783
+ $matches = array();
1784
+ $get_avatar = get_avatar( $post->post_author, 300 );
1785
+ if ( preg_match( "/src='(.*?)'/i", $get_avatar, $matches ) ) {
1786
+ return $matches[1];
1787
+ }
1788
+ }
1789
+
1790
+ return false;
1791
+ }
1792
+
1793
+ function get_the_image( $options = null, $p = null ) {
1794
+ $meta_key = $this->options['aiosp_opengraph_meta_key'];
1795
+
1796
+ return parent::get_the_image( array( 'meta_key' => $meta_key ), $p );
1797
+ }
1798
+
1799
+ function get_the_image_by_default( $args = array() ) {
1800
+ return $this->options['aiosp_opengraph_dimg'];
1801
+ }
1802
+
1803
+ function settings_update() {
1804
+
1805
+ }
1806
+
1807
+ /**
1808
+ * Admin Enqueue Scripts
1809
+ *
1810
+ * Add hook in \All_in_One_SEO_Pack_Module::enqueue_metabox_scripts - Bails adding hook if not on target valid screen.
1811
+ * Add hook in \All_in_One_SEO_Pack_Module::add_page_hooks - Function itself is hooked based on the screen_id/page.
1812
+ *
1813
+ * @since 2.9.2
1814
+ *
1815
+ * @see 'admin_enqueue_scripts' hook
1816
+ * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
1817
+ *
1818
+ * @param string $hook_suffix
1819
+ */
1820
+ public function admin_enqueue_scripts( $hook_suffix ) {
1821
+ wp_enqueue_script(
1822
+ 'aioseop-opengraph-script',
1823
+ AIOSEOP_PLUGIN_URL . 'js/modules/aioseop_opengraph.js',
1824
+ array(),
1825
+ AIOSEOP_VERSION
1826
+ );
1827
+
1828
+ wp_enqueue_script(
1829
+ 'aioseop-post-edit-script',
1830
+ AIOSEOP_PLUGIN_URL . 'js/count-chars.js',
1831
+ array(),
1832
+ AIOSEOP_VERSION
1833
+ );
1834
+
1835
+ $localize_post_edit = array(
1836
+ 'aiosp_title_extra' => 0,
1837
+ );
1838
+ wp_localize_script( 'aioseop-post-edit-script', 'aioseop_count_chars', $localize_post_edit );
1839
+
1840
+ // Dev note: If certain JS files need to be restricted to select screens, then follow concept
1841
+ // used in `All_in_One_SEO_Pack::admin_enqueue_scripts()` (v2.9.1); which uses the `$hook_suffix`
1842
+ // and a switch-case. This also helps prevent unnessecarily processing localized data when it isn't needed.
1843
+ parent::admin_enqueue_scripts( $hook_suffix );
1844
+ }
1845
+
1846
+ /**
1847
+ * Enqueue our file upload scripts and styles.
1848
+ * @param $hook
1849
+ */
1850
+ function og_admin_enqueue_scripts( $hook ) {
1851
+
1852
+ if ( 'all-in-one-seo_page_aiosp_opengraph' != $hook && 'term.php' != $hook ) {
1853
+ // Only enqueue if we're on the social module settings page.
1854
+ return;
1855
+ }
1856
+
1857
+ wp_enqueue_script( 'media-upload' );
1858
+ wp_enqueue_script( 'thickbox' );
1859
+ wp_enqueue_style( 'thickbox' );
1860
+ wp_enqueue_media();
1861
+ }
1862
+
1863
+ function save_tax_data( $term_id, $tt_id, $taxonomy ) {
1864
+ static $update = false;
1865
+ if ( $update ) {
1866
+ return;
1867
+ }
1868
+ if ( $this->locations !== null ) {
1869
+ foreach ( $this->locations as $k => $v ) {
1870
+ if ( isset( $v['type'] ) && ( $v['type'] === 'metabox' ) ) {
1871
+ $opts = $this->default_options( $k );
1872
+ $options = array();
1873
+ $update = false;
1874
+ foreach ( $opts as $l => $o ) {
1875
+ if ( isset( $_POST[ $l ] ) ) {
1876
+ $options[ $l ] = stripslashes_deep( $_POST[ $l ] );
1877
+ $options[ $l ] = esc_attr( $options[ $l ] );
1878
+ $update = true;
1879
+ }
1880
+ }
1881
+ if ( $update ) {
1882
+ $prefix = $this->get_prefix( $k );
1883
+ $options = apply_filters( $prefix . 'filter_term_metabox_options', $options, $k, $term_id );
1884
+ update_term_meta( $term_id, '_' . $prefix . $k, $options );
1885
+ }
1886
+ }
1887
+ }
1888
+ }
1889
+ }
1890
+
1891
+ /**
1892
+ * Returns the placeholder filtered and ready for DOM display.
1893
+ * filter:aioseop_opengraph_placeholder
1894
+ * @since 2.4.14
1895
+ *
1896
+ * @param mixed $placeholder Placeholder to be filtered.
1897
+ * @param string $type Type of the value to be filtered.
1898
+ *
1899
+ * @return string
1900
+ */
1901
+ public function filter_placeholder( $placeholder, $type = 'text' ) {
1902
+ return strip_tags( trim( $placeholder ) );
1903
+ }
1904
+
1905
+ /**
1906
+ * Returns filtered default options.
1907
+ * filter:{prefix}default_options
1908
+ * @since 2.4.13
1909
+ *
1910
+ * @param array $options Default options.
1911
+ * @param string $location Location.
1912
+ *
1913
+ * @return array
1914
+ */
1915
+ public function filter_default_options( $options, $location ) {
1916
+ if ( $location === 'settings' ) {
1917
+ $prefix = $this->get_prefix( $location ) . $location . '_';
1918
+ // Add image checker as default
1919
+ $options[ $prefix . 'customimg_checker' ] = 0;
1920
+ }
1921
+ return $options;
1922
+ }
1923
+ }
1924
+ }
modules/aioseop_performance.php CHANGED
@@ -17,12 +17,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
17
  $this->file = __FILE__; // The current file.
18
  parent::__construct();
19
 
20
- $this->help_text = array(
21
- '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' ),
22
- 'execution_time' => __( 'This setting allows you to raise your PHP execution time to a reasonable value.', 'all-in-one-seo-pack' ),
23
- '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' ),
24
- );
25
-
26
  $this->default_options = array(
27
  'memory_limit' => array(
28
  'name' => __( 'Raise memory limit', 'all-in-one-seo-pack' ),
@@ -51,24 +45,16 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
51
  ),
52
  );
53
 
54
- $this->help_anchors = array(
55
- 'memory_limit' => '#raise-memory-limit',
56
- 'execution_time' => '#raise-execution-time',
57
- 'force_rewrites' => '#force-rewrites',
58
- );
59
-
60
  global $aiosp, $aioseop_options;
61
- if ( aioseop_option_isset( 'aiosp_rewrite_titles' ) && $aioseop_options['aiosp_rewrite_titles'] ) {
62
- $this->default_options['force_rewrites'] = array(
63
- 'name' => __( 'Force Rewrites:', 'all-in-one-seo-pack' ),
64
- 'default' => 1,
65
- 'type' => 'radio',
66
- 'initial_options' => array(
67
- 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
68
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
69
- ),
70
- );
71
- }
72
 
73
  $this->layout = array(
74
  'default' => array(
@@ -91,8 +77,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
91
 
92
  $this->default_options = array_merge( $this->default_options, $system_status );
93
 
94
- $this->add_help_text_links();
95
-
96
  add_filter( $this->prefix . 'display_options', array( $this, 'display_options_filter' ), 10, 2 );
97
  add_filter( $this->prefix . 'update_options', array( $this, 'update_options_filter' ), 10, 2 );
98
  add_action( $this->prefix . 'settings_update', array( $this, 'settings_update_action' ), 10, 2 );
@@ -110,12 +94,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
110
  if ( $location == null ) {
111
  $options[ $this->prefix . 'force_rewrites' ] = 1;
112
  global $aiosp;
113
- if ( aioseop_option_isset( 'aiosp_rewrite_titles' ) ) {
114
- $opts = $aiosp->get_current_options( array(), null );
115
- $options[ $this->prefix . 'force_rewrites' ] = $opts['aiosp_force_rewrites'];
116
- }
117
  }
118
-
119
  return $options;
120
  }
121
 
@@ -266,7 +247,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
266
  __( 'Search Engine Visibility', 'all-in-one-seo-pack' ) => $blog_public,
267
  __( 'Permalink Setting', 'all-in-one-seo-pack' ) => $perm_struct,
268
  );
269
- $debug_info['Active Plugins'] = null;
270
  $active_plugins = $inactive_plugins = array();
271
  $plugins = get_plugins();
272
  foreach ( $plugins as $path => $plugin ) {
@@ -276,10 +257,11 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
276
  $inactive_plugins[ $plugin['Name'] ] = $plugin['Version'];
277
  }
278
  }
279
- $debug_info['Inactive Plugins'] = null;
280
  $debug_info = array_merge( $debug_info, (array) $inactive_plugins );
281
 
282
- $mail_text = __( 'All in One SEO Pack Pro Debug Info', 'all-in-one-seo-pack' ) . "\r\n------------------\r\n\r\n";
 
283
  $page_text = '';
284
  if ( ! empty( $debug_info ) ) {
285
  foreach ( $debug_info as $name => $value ) {
@@ -315,8 +297,11 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
315
  if ( $file_handle = @fopen( $file_path, 'w' ) ) {
316
  // @codingStandardsIgnoreEnd
317
  global $aiosp;
318
- $buf = '; ' . __(
319
- 'Settings export file for All in One SEO Pack', 'all-in-one-seo-pack'
 
 
 
320
  ) . "\n";
321
 
322
  // Adds all settings and posts data to settings file
17
  $this->file = __FILE__; // The current file.
18
  parent::__construct();
19
 
 
 
 
 
 
 
20
  $this->default_options = array(
21
  'memory_limit' => array(
22
  'name' => __( 'Raise memory limit', 'all-in-one-seo-pack' ),
45
  ),
46
  );
47
 
 
 
 
 
 
 
48
  global $aiosp, $aioseop_options;
49
+ $this->default_options['force_rewrites'] = array(
50
+ 'name' => __( 'Force Rewrites:', 'all-in-one-seo-pack' ),
51
+ 'default' => 1,
52
+ 'type' => 'radio',
53
+ 'initial_options' => array(
54
+ 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
55
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
56
+ ),
57
+ );
 
 
58
 
59
  $this->layout = array(
60
  'default' => array(
77
 
78
  $this->default_options = array_merge( $this->default_options, $system_status );
79
 
 
 
80
  add_filter( $this->prefix . 'display_options', array( $this, 'display_options_filter' ), 10, 2 );
81
  add_filter( $this->prefix . 'update_options', array( $this, 'update_options_filter' ), 10, 2 );
82
  add_action( $this->prefix . 'settings_update', array( $this, 'settings_update_action' ), 10, 2 );
94
  if ( $location == null ) {
95
  $options[ $this->prefix . 'force_rewrites' ] = 1;
96
  global $aiosp;
97
+ $opts = $aiosp->get_current_options( array(), null );
98
+ $options[ $this->prefix . 'force_rewrites' ] = $opts['aiosp_force_rewrites'];
 
 
99
  }
 
100
  return $options;
101
  }
102
 
247
  __( 'Search Engine Visibility', 'all-in-one-seo-pack' ) => $blog_public,
248
  __( 'Permalink Setting', 'all-in-one-seo-pack' ) => $perm_struct,
249
  );
250
+ $debug_info[ __( 'Active Plugins', 'all-in-one-seo-pack' ) ] = null;
251
  $active_plugins = $inactive_plugins = array();
252
  $plugins = get_plugins();
253
  foreach ( $plugins as $path => $plugin ) {
257
  $inactive_plugins[ $plugin['Name'] ] = $plugin['Version'];
258
  }
259
  }
260
+ $debug_info[ __( 'Inactive Plugins', 'all-in-one-seo-pack' ) ] = null;
261
  $debug_info = array_merge( $debug_info, (array) $inactive_plugins );
262
 
263
+ /* 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. */
264
+ $mail_text = sprintf( __( '%s Debug Info', 'all-in-one-seo-pack' ), 'All in One SEO Pack Pro' ) . "\r\n------------------\r\n\r\n";
265
  $page_text = '';
266
  if ( ! empty( $debug_info ) ) {
267
  foreach ( $debug_info as $name => $value ) {
297
  if ( $file_handle = @fopen( $file_path, 'w' ) ) {
298
  // @codingStandardsIgnoreEnd
299
  global $aiosp;
300
+ /* 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. */
301
+ $buf = '; ' . sprintf(
302
+ __(
303
+ 'Settings export file for %s', 'all-in-one-seo-pack'
304
+ ), AIOSEOP_PLUGIN_NAME
305
  ) . "\n";
306
 
307
  // Adds all settings and posts data to settings file
modules/aioseop_robots.php CHANGED
@@ -21,12 +21,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Robots' ) ) {
21
  $this->file = __FILE__; // the current file
22
  parent::__construct();
23
 
24
- $help_text = array(
25
- 'type' => __( 'Rule Type', 'all-in-one-seo-pack' ),
26
- 'agent' => __( 'User Agent', 'all-in-one-seo-pack' ),
27
- 'path' => __( 'Directory Path', 'all-in-one-seo-pack' ),
28
- );
29
-
30
  $this->default_options = array(
31
  'usage' => array(
32
  'type' => 'html',
@@ -60,7 +54,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Robots' ) ) {
60
  'type' => 'submit',
61
  'class' => 'button-primary add-edit-rule',
62
  'name' => __( 'Add Rule', 'all-in-one-seo-pack' ) . ' &raquo;',
63
- 'style' => 'margin-left: 20px;',
64
  'label' => 'none',
65
  'save' => false,
66
  'value' => 1,
@@ -87,12 +80,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Robots' ) ) {
87
 
88
  $this->default_options = array_merge( $this->default_options, $this->rule_fields );
89
 
90
- if ( ! empty( $help_text ) ) {
91
- foreach ( $help_text as $k => $v ) {
92
- $this->default_options[ $k ]['help_text'] = $v;
93
- }
94
- }
95
-
96
  $this->layout = array(
97
  'default' => array(
98
  'name' => __( 'Create a Robots.txt File', 'all-in-one-seo-pack' ),
21
  $this->file = __FILE__; // the current file
22
  parent::__construct();
23
 
 
 
 
 
 
 
24
  $this->default_options = array(
25
  'usage' => array(
26
  'type' => 'html',
54
  'type' => 'submit',
55
  'class' => 'button-primary add-edit-rule',
56
  'name' => __( 'Add Rule', 'all-in-one-seo-pack' ) . ' &raquo;',
 
57
  'label' => 'none',
58
  'save' => false,
59
  'value' => 1,
80
 
81
  $this->default_options = array_merge( $this->default_options, $this->rule_fields );
82
 
 
 
 
 
 
 
83
  $this->layout = array(
84
  'default' => array(
85
  'name' => __( 'Create a Robots.txt File', 'all-in-one-seo-pack' ),
modules/aioseop_sitemap.php CHANGED
@@ -166,49 +166,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
166
  }
167
  parent::__construct();
168
  // TODO This could be move up to the class field default/initial values.
169
- $this->comment_string = 'Sitemap %s generated by All in One SEO Pack %s by Michael Torbert of Semper Fi Web Design on %s';
170
-
171
- $this->help_text = array(
172
- 'rss_sitemap' => __( 'Create RSS Sitemap as well.', 'all-in-one-seo-pack' ),
173
- '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' ),
174
- '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' ),
175
- 'max_posts' => __( 'Allows you to specify the maximum number of posts in a sitemap (up to 50,000).', 'all-in-one-seo-pack' ),
176
- 'posttypes' => __( 'Select which Post Types appear in your sitemap.', 'all-in-one-seo-pack' ),
177
- 'taxonomies' => __( 'Select which taxonomy archives appear in your sitemap', 'all-in-one-seo-pack' ),
178
- 'archive' => __( 'Include Date Archives in your sitemap.', 'all-in-one-seo-pack' ),
179
- 'author' => __( 'Include Author Archives in your sitemap.', 'all-in-one-seo-pack' ),
180
- 'images' => __( 'Exclude Images in your sitemap.', 'all-in-one-seo-pack' ),
181
- 'gzipped' => __( 'Create a compressed sitemap file in .xml.gz format.', 'all-in-one-seo-pack' ),
182
- 'robots' => __( 'Places a link to your Sitemap.xml into your virtual Robots.txt file.', 'all-in-one-seo-pack' ),
183
- 'rewrite' => __( 'Dynamically creates the XML sitemap instead of using a static file.', 'all-in-one-seo-pack' ),
184
- 'addl_url' => __( 'URL to the page. This field accepts relative URLs or absolute URLs with the protocol specified.', 'all-in-one-seo-pack' ),
185
- 'addl_prio' => __( 'The priority of the page.', 'all-in-one-seo-pack' ),
186
- 'addl_freq' => __( 'The frequency of the page.', 'all-in-one-seo-pack' ),
187
- 'addl_mod' => __( 'Last modified date of the page.', 'all-in-one-seo-pack' ),
188
- 'excl_categories' => __( 'Entries from these categories will be excluded from the sitemap.', 'all-in-one-seo-pack' ),
189
- 'excl_pages' => __( 'Use page slugs or page IDs, seperated by commas, to exclude pages from the sitemap.', 'all-in-one-seo-pack' ),
190
- );
191
-
192
- $this->help_anchors = array(
193
- 'rss_sitemap' => '#create-rss_sitemap',
194
- 'daily_cron' => '#schedule-updates',
195
- 'indexes' => '#enable-sitemap-indexes',
196
- 'max_posts' => '#enable-sitemap-indexes',
197
- 'posttypes' => '#post-types-and-taxonomies',
198
- 'taxonomies' => '#post-types-and-taxonomies',
199
- 'archive' => '#include-archive-pages',
200
- 'author' => '#include-archive-pages',
201
- 'images' => '#exclude-images',
202
- 'gzipped' => '#create-compressed-sitemap',
203
- 'robots' => '#link-from-virtual-robots',
204
- 'rewrite' => '#dynamically-generate-sitemap',
205
- 'addl_url' => '#additional-pages',
206
- 'addl_prio' => '#additional-pages',
207
- 'addl_freq' => '#additional-pages',
208
- 'addl_mod' => '#additional-pages',
209
- 'excl_categories' => '#excluded-items',
210
- 'excl_pages' => '#excluded-items',
211
- );
212
 
213
  $this->default_options = array(
214
  'rss_sitemap' => array( 'name' => __( 'Create RSS Sitemap', 'all-in-one-seo-pack' ) ),
@@ -223,11 +181,14 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
223
  ),
224
  'default' => 0,
225
  ),
226
- 'indexes' => array( 'name' => __( 'Enable Sitemap Indexes', 'all-in-one-seo-pack' ) ),
 
 
 
227
  'max_posts' => array(
228
  'name' => __( 'Maximum Posts Per Sitemap Page', 'all-in-one-seo-pack' ),
229
  'type' => 'text',
230
- 'default' => 50000,
231
  'condshow' => array(
232
  "{$this->prefix}indexes" => 'on',
233
  "{$this->prefix}indexes" => 'on',
@@ -246,14 +207,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
246
  'archive' => array( 'name' => __( 'Include Date Archive Pages', 'all-in-one-seo-pack' ) ),
247
  'author' => array( 'name' => __( 'Include Author Pages', 'all-in-one-seo-pack' ) ),
248
  'images' => array( 'name' => __( 'Exclude Images', 'all-in-one-seo-pack' ) ),
249
- 'gzipped' => array(
250
- 'name' => __( 'Create Compressed Sitemap', 'all-in-one-seo-pack' ),
251
- 'default' => 'On',
252
- ),
253
- 'robots' => array(
254
- 'name' => __( 'Link From Virtual Robots.txt', 'all-in-one-seo-pack' ),
255
- 'default' => 'On',
256
- ),
257
  'rewrite' => array(
258
  'name' => __( 'Dynamically Generate Sitemap', 'all-in-one-seo-pack' ),
259
  'default' => 'On',
@@ -325,8 +278,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
325
 
326
  $arr[ $k . '_' . $opt ] = array(
327
  'name' => $this->ucwords( $val ),
328
- /* translators: Help Text string to display information about multiple different settings. */
329
- 'help_text' => sprintf( __( 'Manually set the %1$s of your %2$s.', 'all-in-one-seo-pack' ), $v, $val ),
330
  'type' => 'select',
331
  'initial_options' => $iopts,
332
  'default' => 'no',
@@ -348,27 +299,23 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
348
  'addl_url' => array(
349
  'name' => __( 'Page URL', 'all-in-one-seo-pack' ),
350
  'type' => 'url',
351
- 'label' => 'top',
352
  'save' => false,
353
  ),
354
  'addl_prio' => array(
355
  'name' => __( 'Page Priority', 'all-in-one-seo-pack' ),
356
  'type' => 'select',
357
  'initial_options' => $prio,
358
- 'label' => 'top',
359
  'save' => false,
360
  ),
361
  'addl_freq' => array(
362
  'name' => __( 'Page Frequency', 'all-in-one-seo-pack' ),
363
  'type' => 'select',
364
  'initial_options' => $freq,
365
- 'label' => 'top',
366
  'save' => false,
367
  ),
368
  'addl_mod' => array(
369
  'name' => __( 'Last Modified', 'all-in-one-seo-pack' ),
370
  'type' => 'date',
371
- 'label' => 'top',
372
  'save' => false,
373
  'class' => 'aiseop-date',
374
  ),
@@ -389,10 +336,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
389
  );
390
 
391
  $excl_options = array(
392
- 'excl_categories' => array(
393
- 'name' => __( 'Excluded Categories', 'all-in-one-seo-pack' ),
394
- 'type' => 'multicheckbox',
395
- 'initial_options' => '',
396
  ),
397
  'excl_pages' => array(
398
  'name' => __( 'Excluded Pages', 'all-in-one-seo-pack' ),
@@ -428,8 +375,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
428
 
429
  $this->default_options = array_merge( $status_options, $this->default_options, $addl_options, $excl_options, $prio_options, $freq_options );
430
 
431
- $this->add_help_text_links();
432
-
433
  add_action(
434
  'after_doing_aioseop_updates',
435
  array(
@@ -445,6 +390,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
445
  add_filter( $this->prefix . 'output_option', array( $this, 'display_custom_options' ), 10, 2 );
446
  add_action( $this->prefix . 'daily_update_cron', array( $this, 'daily_update' ) );
447
  add_action( 'init', array( $this, 'make_dynamic_xsl' ) );
 
 
448
  add_action( 'transition_post_status', array( $this, 'update_sitemap_from_posts' ), 10, 3 );
449
  add_action( 'after_doing_aioseop_updates', array( $this, 'scan_sitemaps' ) );
450
  add_action( 'all_admin_notices', array( $this, 'sitemap_notices' ) );
@@ -453,23 +400,30 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
453
  /**
454
  * Sitemap notices.
455
  *
 
 
 
 
456
  * @since 2.4.1
457
  */
458
  public function sitemap_notices() {
459
-
460
- $sitemap_max_url_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_sitemap_max_url_notice_dismissed', true );
461
- if ( ! empty( $sitemap_max_url_notice_dismissed ) ) {
462
- return;
463
- } elseif ( ! current_user_can( 'aiosp_manage_seo' ) ) {
464
  return;
465
  }
466
 
 
467
  $options = $this->options;
468
 
469
  if (
470
- isset( $options[ "{$this->prefix}indexes" ] ) &&
471
- 'on ' !== $options[ "{$this->prefix}indexes" ] &&
472
- 1001 < $options[ "{$this->prefix}max_posts" ]
 
 
 
 
 
 
473
  ) {
474
  $num_terms = 0;
475
  $post_counts = $this->get_total_post_count(
@@ -486,32 +440,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
486
 
487
  $sitemap_urls = $post_counts + $num_terms;
488
 
489
- if ( 1001 > $sitemap_urls ) {
490
- return;
 
 
491
  }
492
-
493
- $aioseop_plugin_dirname = AIOSEOP_PLUGIN_DIRNAME;
494
-
495
- printf(
496
- '<div id="message" class="notice-warning notice is-dismissible aioseop-notice sitemap_max_urls_notice visibility-notice">' .
497
- '<p>' .
498
- '<strong>%1$s</strong><br />' .
499
- '%2$s' .
500
- '</p>' .
501
- '</div>',
502
- // TODO Add esc_* or wp_kses function or _e().
503
- __( 'Notice: To avoid problems with your XML Sitemap, we strongly recommend you enable Sitemap Indexes and set the Maximum Posts per Sitemap Page to 1000.', 'all-in-one-seo-pack' ),
504
- sprintf(
505
- // TODO Add esc_* or wp_kses function.
506
- /* translators: Links to the current AIOSEOP Sitemap settings. */
507
- __( '%1$s Click here%2$s to make these recommended changes.', 'all-in-one-seo-pack' ),
508
- sprintf(
509
- '<a href="%s">',
510
- esc_url( get_admin_url( null, "admin.php?page=$aioseop_plugin_dirname/modules/aioseop_sitemap.php" ) )
511
- ),
512
- '</a>'
513
- )
514
- );
515
  }
516
  }
517
 
@@ -523,6 +458,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
523
  * @param $post
524
  */
525
  public function update_sitemap_from_posts( $new_status, $old_status, $post ) {
 
 
 
 
526
 
527
  if ( $this->option_isset( 'rewrite' ) ) {
528
  // TODO if dynamic, delete transient (we currently don't do transients).
@@ -601,6 +540,72 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
601
  update_option( $this->prefix . 'cron_last_run', $last_run );
602
  }
603
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
  /**
605
  * Initialize options, after constructor.
606
  */
@@ -621,7 +626,16 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
621
  $this->setup_rewrites();
622
  }
623
 
624
- if ( $this->option_isset( 'robots' ) ) {
 
 
 
 
 
 
 
 
 
625
  add_action( 'do_robots', array( $this, 'do_robots' ), 100 );
626
  }
627
 
@@ -676,6 +690,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
676
 
677
  /**
678
  * Add post type details for settings once post types have been registered.
 
 
 
 
679
  */
680
  public function add_post_types() {
681
  $post_type_titles = $this->get_post_type_titles( array( 'public' => true ) );
@@ -683,16 +701,44 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
683
  if ( isset( $post_type_titles['attachment'] ) ) {
684
  $post_type_titles['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' );
685
  }
686
- $this->default_options['posttypes']['initial_options'] = array_merge( array( 'all' => __( 'All Post Types', 'all-in-one-seo-pack' ) ), $post_type_titles );
687
- $this->default_options['taxonomies']['initial_options'] = array_merge( array( 'all' => __( 'All Taxonomies', 'all-in-one-seo-pack' ) ), $taxonomy_titles );
688
- $this->default_options['posttypes']['default'] = array_keys( $this->default_options['posttypes']['initial_options'] );
689
- $this->default_options['taxonomies']['default'] = array_keys( $this->default_options['taxonomies']['initial_options'] );
690
- $this->default_options['excl_categories']['initial_options'] = $this->get_category_titles();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
691
 
692
- $prio_help = __( 'Manually set the priority for the ', 'all-in-one-seo-pack' );
693
- $freq_help = __( 'Manually set the frequency for the ', 'all-in-one-seo-pack' );
694
- $post_name = __( ' Post Type', 'all-in-one-seo-pack' );
695
- $tax_name = __( ' Taxonomy', 'all-in-one-seo-pack' );
696
 
697
  foreach ( $post_type_titles as $k => $v ) {
698
  $key = 'prio_post_' . $k;
@@ -702,7 +748,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
702
  array(
703
  $key => array(
704
  'name' => $v . $post_name,
705
- 'help_text' => $prio_help . $v . $post_name,
706
  'type' => 'select',
707
  'initial_options' => $this->prio,
708
  'default' => 'no',
@@ -718,7 +763,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
718
  array(
719
  $key => array(
720
  'name' => $v . $post_name,
721
- 'help_text' => $freq_help . $v . $post_name,
722
  'type' => 'select',
723
  'initial_options' => $this->freq,
724
  'default' => 'no',
@@ -736,7 +780,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
736
  array(
737
  $key => array(
738
  'name' => $v . $tax_name,
739
- 'help_text' => $prio_help . $v . $tax_name,
740
  'type' => 'select',
741
  'initial_options' => $this->prio,
742
  'default' => 'no',
@@ -752,7 +795,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
752
  array(
753
  $key => array(
754
  'name' => $v . $tax_name,
755
- 'help_text' => $freq_help . $v . $tax_name,
756
  'type' => 'select',
757
  'initial_options' => $this->freq,
758
  'default' => 'no',
@@ -860,6 +902,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
860
  *
861
  * @since 2.3.6
862
  * @since 2.3.12.3 Refactored to use aioseop_home_url() for compatibility purposes.
 
 
863
  *
864
  * @param $options
865
  *
@@ -876,7 +920,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
876
 
877
  /* translators: Link to documentation. */
878
  $options[ $this->prefix . 'link' ] = sprintf( __( 'Click here to %s.', 'all-in-one-seo-pack' ), '<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'view your XML sitemap', 'all-in-one-seo-pack' ) . '</a>' );
879
- $options[ $this->prefix . 'link' ] .= __( ' Your sitemap has been created with content and images.', 'all-in-one-seo-pack' );
880
 
881
  if ( $options[ "{$this->prefix}rss_sitemap" ] ) {
882
  $url_rss = aioseop_home_url( '/' . $this->get_filename() . '.rss' );
@@ -897,15 +941,22 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
897
  }
898
  }
899
  if ( ! get_option( 'blog_public' ) ) {
900
- global $wp_version;
901
- if ( version_compare( $wp_version, '3.5.0', '>=' ) || function_exists( 'set_url_scheme' ) ) {
902
- $privacy_link = '<a href="options-reading.php">' . __( 'Reading Settings', 'all-in-one-seo-pack' ) . '</a>';
903
- } else {
904
- $privacy_link = '<a href="options-privacy.php">' . __( 'Privacy Settings', 'all-in-one-seo-pack' ) . '</a>';
905
- }
906
  /* translators: Link to settings to disable "Discourage search engines from indexing this site". */
907
- $options[ $this->prefix . 'link' ] .= '<p class="aioseop_error_notice">' . sprintf( __( 'Warning: your privacy settings are configured to ask search engines to not index your site; you can change this under %s for your blog.', 'all-in-one-seo-pack' ), $privacy_link );
 
 
 
 
 
 
 
 
 
908
  }
 
 
 
909
  return $options;
910
  }
911
 
@@ -916,6 +967,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
916
  *
917
  * @todo This needs nonce support.
918
  *
 
 
 
919
  * @param $options
920
  *
921
  * @return mixed
@@ -985,6 +1039,30 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
985
  }
986
  }
987
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
988
  return $options;
989
  }
990
 
@@ -1027,9 +1105,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1027
  $siteurl = get_home_url( $blog_id );
1028
  }
1029
  $url = $siteurl . '/' . $this->get_filename() . '.xml';
1030
- if ( $sitemap_options[ "{$this->prefix}gzipped" ] ) {
1031
- $url .= '.gz';
1032
- }
1033
  $siteurls[] = $url;
1034
  }
1035
  }
@@ -1098,17 +1173,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1098
  */
1099
  public function scan_match_files() {
1100
  $scan1 = '';
1101
- $scan2 = '';
1102
  $files = array();
1103
 
1104
  $filename = $this->get_filename();
1105
  if ( ! empty( $filename ) ) {
1106
  $scan1 = get_home_path() . $filename . '*.xml';
1107
- if ( ! empty( $this->options[ "{$this->prefix}gzipped" ] ) ) {
1108
- $scan2 .= get_home_path() . $filename . '*.xml.gz';
1109
- }
1110
 
1111
- if ( empty( $scan1 ) && empty( $scan2 ) ) {
1112
  return $files;
1113
  }
1114
  $home_path = get_home_path();
@@ -1121,12 +1192,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1121
  $files[] = $home_path . $f;
1122
  continue;
1123
  }
1124
- if ( ! empty( $scan2 ) && fnmatch( $scan2, $home_path . $f ) ) {
1125
- $files[] = $home_path . $f;
1126
- }
1127
  }
1128
  }
1129
-
1130
  return $files;
1131
  }
1132
  }
@@ -1269,9 +1336,11 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1269
  $matches
1270
  ) ) {
1271
  if ( ! empty( $this->options[ "{$this->prefix}rewrite" ] ) ) {
 
1272
  $msg .= '<p>' . sprintf(
1273
- __( "Warning: a static sitemap '%1\$s' generated by All in One SEO Pack %2\$s on %3\$s already exists that may conflict with dynamic sitemap generation.", 'all-in-one-seo-pack' ),
1274
  $f,
 
1275
  $matches[2],
1276
  $matches[3]
1277
  ) . "</p>\n";
@@ -1291,7 +1360,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1291
  $problem_files[] = $f;
1292
 
1293
  // This is causing all problem_files to be deleted automatically; which may be the intent.
1294
- // TODO Either create a seperate variable for this set of problem_files, or a final loop to clean problem_files before returning.
1295
  foreach ( $problem_files as $f => $file ) {
1296
  $files[ $f ] = realpath( $file );
1297
  $this->delete_file( realpath( $file ) );
@@ -1325,8 +1394,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1325
  $msg .= "<input type='hidden' name='aioseop_sitemap_conflict[]' value='" . esc_attr( basename( realpath( $p ) ) ) . "'>\n";
1326
  }
1327
  $msg .= "<input type='hidden' name='nonce-aioseop' value='" . wp_create_nonce( 'aioseop-nonce' ) . "'>\n";
1328
- $msg .= "<input type='submit' name='aioseop_sitemap_rename_files' value='" . __( 'Rename Conflicting Files', 'all-in-one-seo-pack' ) . "'> ";
1329
- $msg .= "<input type='submit' name='aioseop_sitemap_delete_files' value='" . __( 'Delete Conflicting Files', 'all-in-one-seo-pack' ) . "'>";
1330
 
1331
  $msg = '<form action="" method="post">' . $msg . '</form>';
1332
  }
@@ -1365,34 +1434,23 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1365
  * @return array
1366
  */
1367
  public function get_rewrite_rules( $prefix_removed_rules_with = null ) {
1368
- $sitemap_rules_gzipped = array();
1369
- $sitemap_rules_normal = array(
1370
  $this->get_filename() . '.xml' => 'index.php?' . $this->prefix . 'path=root',
1371
  $this->get_filename() . '_(.+)_(\d+).xml' => 'index.php?' . $this->prefix . 'path=$matches[1]&' . $this->prefix . 'page=$matches[2]',
1372
  $this->get_filename() . '_(.+).xml' => 'index.php?' . $this->prefix . 'path=$matches[1]',
1373
  );
1374
 
1375
  if ( isset( $this->options[ "{$this->prefix}rss_sitemap" ] ) && $this->options[ "{$this->prefix}rss_sitemap" ] ) {
1376
- $sitemap_rules_normal += array(
1377
  $this->get_filename() . '.rss' => 'index.php?' . $this->prefix . 'path=rss',
1378
  $this->get_filename() . 'latest.rss' => 'index.php?' . $this->prefix . 'path=rss_latest',
1379
  );
1380
  } elseif ( ! empty( $prefix_removed_rules_with ) ) {
1381
- $sitemap_rules_normal += array(
1382
  $prefix_removed_rules_with . $this->get_filename() . '.rss' => 'index.php?' . $this->prefix . 'path=rss',
1383
  $prefix_removed_rules_with . $this->get_filename() . 'latest.rss' => 'index.php?' . $this->prefix . 'path=rss_latest',
1384
  );
1385
  }
1386
-
1387
- if ( $this->options[ "{$this->prefix}gzipped" ] ) {
1388
- $sitemap_rules_gzipped = array(
1389
- $this->get_filename() . '.xml.gz' => 'index.php?' . $this->prefix . 'gzipped=1&' . $this->prefix . 'path=root.gz',
1390
- $this->get_filename() . '_(.+)_(\d+).xml.gz' => 'index.php?' . $this->prefix . 'path=$matches[1].gz&' . $this->prefix . 'page=$matches[2]',
1391
- $this->get_filename() . '_(.+).xml.gz' => 'index.php?' . $this->prefix . 'path=$matches[1].gz',
1392
- );
1393
- }
1394
- $sitemap_rules = $sitemap_rules_gzipped + $sitemap_rules_normal;
1395
-
1396
  return $sitemap_rules;
1397
  }
1398
 
@@ -1458,20 +1516,19 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1458
  /**
1459
  * Stop timing and log memory usage for debug info.
1460
  *
 
 
 
1461
  * @param string $sitemap_type
1462
- * @param bool $compressed
1463
  * @param bool $dynamic
1464
  */
1465
- public function log_stats( $sitemap_type = 'static', $compressed = false, $dynamic = true ) {
1466
  $time = timer_stop();
1467
  $end_memory_usage = memory_get_peak_usage();
1468
  $sitemap_memory_usage = $end_memory_usage - $this->start_memory_usage;
1469
  $end_memory_usage = $end_memory_usage / 1024.0 / 1024.0;
1470
  $sitemap_memory_usage = $sitemap_memory_usage / 1024.0 / 1024.0;
1471
  $sitemap_type = __( 'static', 'all-in-one-seo-pack ' );
1472
- if ( $compressed ) {
1473
- $sitemap_type = __( 'compressed', 'all-in-one-seo-pack' );
1474
- }
1475
  if ( $dynamic ) {
1476
  $sitemap_type = __( 'dynamic', 'all-in-one-seo-pack ' );
1477
  }
@@ -1481,6 +1538,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1481
  /**
1482
  * Handle outputting of dynamic sitemaps, logging.
1483
  *
 
 
 
1484
  * @param $query
1485
  */
1486
  public function sitemap_output_hook( $query ) {
@@ -1493,33 +1553,31 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1493
  }
1494
  $this->start_memory_usage = memory_get_peak_usage();
1495
  $sitemap_type = $query->query_vars[ "{$this->prefix}path" ];
1496
- $gzipped = false;
1497
- if ( $this->substr( $sitemap_type, - 3 ) === '.gz' ) {
1498
- $gzipped = true;
1499
- $sitemap_type = $this->substr( $sitemap_type, 0, - 3 );
1500
- }
1501
  $blog_charset = get_option( 'blog_charset' );
1502
- if ( $this->options[ "{$this->prefix}gzipped" ] && $gzipped ) {
1503
- header( "Content-Type: application/x-gzip; charset=$blog_charset", true );
1504
- } else {
1505
- $gzipped = false;
1506
- header( "Content-Type: text/xml; charset=$blog_charset", true );
1507
- }
1508
 
1509
  // Always follow and noindex the sitemap.
1510
  header( 'X-Robots-Tag: noindex, follow', true );
1511
 
1512
  do_action( $this->prefix . 'add_headers', $query, $this->options );
1513
 
1514
- if ( $gzipped ) {
1515
- ob_start();
 
 
 
 
 
 
 
 
 
1516
  }
1517
- $this->do_rewrite_sitemap( $sitemap_type, $page );
1518
- if ( $gzipped ) {
1519
- // TODO Add esc_* function.
1520
- echo gzencode( ob_get_clean() );
1521
- }
1522
- $this->log_stats( $sitemap_type, $gzipped );
1523
  exit();
1524
 
1525
  }
@@ -1573,7 +1631,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1573
  $sitemap_data = $this->get_all_post_priority_data( $sitemap_type, 'publish', $page );
1574
  } elseif ( in_array( $sitemap_type, $taxonomies ) ) {
1575
  // TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
1576
- $sitemap_data = $this->get_term_priority_data( get_terms( $sitemap_type, $this->get_tax_args( $page ) ) );
1577
  } else {
1578
  // TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
1579
  if ( is_array( $this->extra_sitemaps ) && in_array( $sitemap_type, $this->extra_sitemaps ) ) {
@@ -1592,14 +1650,18 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1592
  *
1593
  * Output sitemaps dynamically based on rewrite rules.
1594
  *
 
 
 
1595
  * @param $sitemap_type
1596
  * @param int $page
 
1597
  */
1598
  public function do_rewrite_sitemap( $sitemap_type, $page = 0 ) {
1599
  $this->add_post_types();
1600
  $comment = 'dynamically';
1601
  // TODO Add esc_* or wp_kses function.
1602
- echo $this->do_build_sitemap( $sitemap_type, $page, '', $comment );
1603
  }
1604
 
1605
  /**
@@ -1612,12 +1674,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1612
  */
1613
  public function get_sitemap_url() {
1614
 
1615
- $gz = '';
1616
- if ( $this->options[ "{$this->prefix}gzipped" ] ) {
1617
- $gz .= '.gz';
1618
- }
1619
-
1620
- $url = aioseop_home_url( '/' . $this->get_filename() . ".xml$gz" );
1621
 
1622
  return $url;
1623
  }
@@ -1710,7 +1767,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1710
  $this->write_sitemaps( $this->get_filename(), $rss, '.rss' );
1711
  }
1712
 
1713
- $this->log_stats( 'root', $this->options[ "{$this->prefix}gzipped" ], false );
1714
  }
1715
  } else {
1716
  delete_transient( "{$this->prefix}rules_flushed" );
@@ -1739,33 +1796,29 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1739
  /**
1740
  * Write multiple sitemaps.
1741
  *
1742
- * Write sitemaps (compressed or otherwise) to the filesystem.
1743
  *
1744
  * @param $filename
1745
  * @param $contents
1746
  */
1747
  public function write_sitemaps( $filename, $contents, $extn = '.xml' ) {
1748
  $this->write_sitemap( $filename . $extn, $contents );
1749
- if ( $this->options[ "{$this->prefix}gzipped" ] ) {
1750
- $this->write_sitemap( $filename . $extn . '.gz', $contents, true );
1751
- }
1752
  }
1753
 
1754
  /**
1755
  * Write single sitemap.
1756
  *
1757
- * Write a single sitemap to the filesystem, handle compression.
 
 
 
1758
  *
1759
  * @param $filename
1760
  * @param $contents
1761
- * @param bool $gzip
1762
  *
1763
  * @return bool
1764
  */
1765
- public function write_sitemap( $filename, $contents, $gzip = false ) {
1766
- if ( $gzip ) {
1767
- $contents = gzencode( $contents );
1768
- }
1769
  add_filter( 'upload_mimes', array( $this, 'add_xml_mime_type' ) );
1770
  $filename = $this->get_home_path() . sanitize_file_name( $filename );
1771
  remove_filter( 'upload_mimes', array( $this, 'add_xml_mime_type' ) );
@@ -1879,18 +1932,17 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1879
  *
1880
  * @since 2.3.6
1881
  * @since 2.3.12.3 Refactored to use aioseop_home_url() for compatibility purposes.
 
1882
  *
1883
  * @return array
1884
  */
1885
  public function get_sitemap_index_filenames() {
 
1886
  $files = array();
1887
  $options = $this->options;
1888
  $prefix = $this->get_filename();
1889
  $suffix = '.xml';
1890
 
1891
- if ( $options[ "{$this->prefix}gzipped" ] ) {
1892
- $suffix .= '.gz';
1893
- }
1894
  if ( empty( $options[ "{$this->prefix}posttypes" ] ) ) {
1895
  $options[ "{$this->prefix}posttypes" ] = array();
1896
  }
@@ -1898,21 +1950,75 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1898
  $options[ "{$this->prefix}taxonomies" ] = array();
1899
  }
1900
  $options[ "{$this->prefix}posttypes" ] = array_diff( $options[ "{$this->prefix}posttypes" ], array( 'all' ) );
1901
- $options[ "{$this->prefix}taxonomies" ] = array_diff( $options[ "{$this->prefix}taxonomies" ], array( 'all' ) );
1902
 
1903
  $files[] = array( 'loc' => aioseop_home_url( '/' . $prefix . '_addl' . $suffix ) );
1904
 
1905
- if ( ! empty( $options[ "{$this->prefix}posttypes" ] ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1906
  $prio = $this->get_default_priority( 'post' );
1907
  $freq = $this->get_default_frequency( 'post' );
1908
- $post_counts = $this->get_all_post_counts(
1909
- array(
1910
- 'post_type' => $options[ "{$this->prefix}posttypes" ],
1911
- 'post_status' => 'publish',
1912
- )
 
 
 
 
 
 
 
 
 
 
 
 
1913
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1914
 
1915
- foreach ( $options[ "{$this->prefix}posttypes" ] as $sm ) {
1916
  if ( 0 === intval( $post_counts[ $sm ] ) ) {
1917
  continue;
1918
  }
@@ -1958,29 +2064,32 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1958
  }
1959
 
1960
  if ( ! empty( $options[ "{$this->prefix}taxonomies" ] ) ) {
1961
- foreach ( $options[ "{$this->prefix}taxonomies" ] as $sm ) {
1962
- $term_count = wp_count_terms( $sm, array( 'hide_empty' => true ) );
 
 
 
1963
  if ( ! is_wp_error( $term_count ) && ( $term_count > 0 ) ) {
1964
  if ( ! empty( $this->options[ "{$this->prefix}indexes" ] ) ) {
1965
  if ( $term_count > $this->max_posts ) {
1966
  $count = 1;
1967
  for ( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) {
1968
  $files[] = array(
1969
- 'loc' => aioseop_home_url( '/' . $prefix . '_' . $sm . '_' . ( $count ++ ) . $suffix ),
1970
  'changefreq' => $this->get_default_frequency( 'taxonomies' ),
1971
  'priority' => $this->get_default_priority( 'taxonomies' ),
1972
  );
1973
  }
1974
  } else {
1975
  $files[] = array(
1976
- 'loc' => aioseop_home_url( '/' . $prefix . '_' . $sm . $suffix ),
1977
  'changefreq' => $this->get_default_frequency( 'taxonomies' ),
1978
  'priority' => $this->get_default_priority( 'taxonomies' ),
1979
  );
1980
  }
1981
  } else {
1982
  $files[] = array(
1983
- 'loc' => aioseop_home_url( '/' . $prefix . '_' . $sm . $suffix ),
1984
  'changefreq' => $this->get_default_frequency( 'taxonomies' ),
1985
  'priority' => $this->get_default_priority( 'taxonomies' ),
1986
  );
@@ -2033,6 +2142,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2033
  if ( ( 'root' === $sitemap_type ) && ! empty( $this->options[ "{$this->prefix}indexes" ] ) ) {
2034
  return $this->build_sitemap_index( $sitemap_data, sprintf( $comment, $filename ) );
2035
  } else {
 
 
 
2036
  return $this->build_sitemap( $sitemap_data, $sitemap_type, sprintf( $comment, $filename ) );
2037
  }
2038
  }
@@ -2128,7 +2240,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2128
  }
2129
  }
2130
  }
2131
- $this->log_stats( 'indexed', $options[ "{$this->prefix}gzipped" ], false );
2132
  }
2133
 
2134
  public function remove_posts_page( $postspageid ) {
@@ -2232,7 +2344,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2232
  if ( is_array( $home ) ) {
2233
  array_unshift( $prio, $home );
2234
  }
2235
- $terms = get_terms( $options[ "{$this->prefix}taxonomies" ], $this->get_tax_args() );
2236
  $prio2 = $this->get_term_priority_data( $terms );
2237
  $prio3 = $this->get_addl_pages_only();
2238
  $prio = array_merge( $child, $prio, $prio2, $prio3 );
@@ -2575,7 +2687,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2575
  */
2576
  public function get_term_priority_data( $terms ) {
2577
  $prio = array();
2578
- if ( is_array( $terms ) ) {
2579
  $def_prio = $this->get_default_priority( 'taxonomies' );
2580
  $def_freq = $this->get_default_frequency( 'taxonomies' );
2581
  foreach ( $terms as $term ) {
@@ -3268,7 +3380,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3268
  $timestamp = mysql2date( 'U', $post->post_modified_gmt );
3269
  $pr_info['rss'] = array(
3270
  'title' => $title,
3271
- 'description' => $this->get_the_excerpt( $post ),
3272
  'pubDate' => date( 'r', $timestamp ),
3273
  'timestamp ' => $timestamp,
3274
  'post_type' => $post->post_type,
@@ -3287,60 +3399,32 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3287
  return $prio;
3288
  }
3289
 
3290
- /**
3291
- * Return the excerpt of the given post.
3292
- *
3293
- * @param WP_Post $post The post object.
3294
- *
3295
- * @return string
3296
- */
3297
- private function get_the_excerpt( $post ) {
3298
- global $wp_version;
3299
- if ( has_excerpt( $post->ID ) ) {
3300
- if ( version_compare( $wp_version, '4.5.0', '>=' ) ) {
3301
- return get_the_excerpt( $post );
3302
- }
3303
-
3304
- $text = strip_shortcodes( $post->post_content );
3305
- $text = apply_filters( 'the_content', $text );
3306
- $text = str_replace( ']]>', ']]&gt;', $text );
3307
-
3308
- $excerpt_length = apply_filters( 'excerpt_length', 55 );
3309
- $excerpt_more = apply_filters( 'excerpt_more', '[&hellip;]' );
3310
- return wp_trim_words( $text, $excerpt_length, $excerpt_more );
3311
- }
3312
- return '';
3313
- }
3314
-
3315
  /**
3316
  * Return the images attached to the term.
3317
  *
3318
  * @param WP_Term $term the term object.
3319
  *
3320
  * @since 2.4
 
3321
  *
3322
  * @return array
3323
  */
3324
  private function get_images_from_term( $term ) {
3325
- global $wp_version;
3326
-
3327
  if ( ! aiosp_include_images() ) {
3328
  return array();
3329
  }
3330
 
3331
  $images = array();
3332
- // the table term meta table is not defined for lower versions.
3333
- if ( version_compare( $wp_version, '4.4.0', '>=' ) ) {
3334
- $thumbnail_id = get_term_meta( $term->term_id, 'thumbnail_id', true );
3335
- if ( $thumbnail_id ) {
3336
- $image = wp_get_attachment_url( $thumbnail_id );
3337
- if ( $image ) {
3338
- $images['image:image'] = array(
3339
- 'image:loc' => $image,
3340
- 'image:caption' => wp_get_attachment_caption( $thumbnail_id ),
3341
- 'image:title' => get_the_title( $thumbnail_id ),
3342
- );
3343
- }
3344
  }
3345
  }
3346
 
@@ -3352,6 +3436,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3352
  *
3353
  * @todo Add ~`get_attachment_postid_to_url()` function.
3354
  * @todo Benchmark `wp_get_attachment_image_src()` & `wp_get_attachment_url()`.
 
3355
  *
3356
  * @since 2.4
3357
  * @since 2.11 Optimization #2008 - Reduce the need to convert url to id.
@@ -3384,7 +3469,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3384
  $attributes = wp_get_attachment_image_src( $post->ID );
3385
  if ( $attributes ) {
3386
  $rtn_image_attributes[] = array(
3387
- 'image:loc' => $this->clean_url( $attributes[0] ),
3388
  'image:caption' => wp_get_attachment_caption( $post->ID ),
3389
  'image:title' => get_the_title( $post->ID ),
3390
  );
@@ -3484,13 +3569,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3484
  if ( ! isset( $this->image_ids_urls[ $v1_image_id ] ) ) {
3485
  // Sets any remaining post image IDs that weren't converted from URL.
3486
  $this->image_ids_urls[ $v1_image_id ] = array(
3487
- 'base_url' => $this->clean_url( wp_get_attachment_url( $v1_image_id ) ),
3488
  );
3489
 
3490
  $transient_update = true;
3491
  } else {
3492
  if ( empty( $this->image_ids_urls[ $v1_image_id ]['base_url'] ) ) {
3493
- $this->image_ids_urls[ $v1_image_id ]['base_url'] = $this->clean_url( wp_get_attachment_url( $v1_image_id ) );
3494
 
3495
  $transient_update = true;
3496
  }
@@ -3697,7 +3782,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3697
  }
3698
  $code .= ']';
3699
 
3700
- $gallery_content .= do_shortcode( $code );
3701
  }
3702
  }
3703
 
@@ -3713,7 +3798,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3713
  *
3714
  * @return string
3715
  */
3716
- public function clean_url( $url ) {
3717
  // remove the query string.
3718
  $url = strtok( $url, '?' );
3719
  // make the url XML-safe.
@@ -3733,33 +3818,20 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3733
  * @since 2.4.1
3734
  * @since 2.4.3 Compatibility with Pre v4.7 wp_parse_url().
3735
  * @since 2.11 Sitemap Optimization #2008 - Changed to a more appropriate name.
 
3736
  *
3737
  * @return bool
3738
  */
3739
  public function is_image_url_valid( $image ) {
3740
- global $wp_version;
3741
-
3742
  // Bail if empty image.
3743
  if ( empty( $image ) ) {
3744
  return false;
3745
  }
3746
 
3747
- global $wp_version;
3748
- if ( version_compare( $wp_version, '4.4', '<' ) ) {
3749
- // TODO Change to wp_parse_url().
3750
- $p_url = parse_url( $image );
3751
- $url = $p_url['scheme'] . $p_url['host'] . $p_url['path'];
3752
- } elseif ( version_compare( $wp_version, '4.7', '<' ) ) {
3753
- // Compatability for older WP version that don't have 4.7 changes.
3754
- // @link https://core.trac.wordpress.org/changeset/38726
3755
- $p_url = wp_parse_url( $image );
3756
- $url = $p_url['scheme'] . $p_url['host'] . $p_url['path'];
3757
- } else {
3758
- $component = PHP_URL_PATH;
3759
- $url = wp_parse_url( $image, $component );
3760
- }
3761
 
3762
- // make the url absolute, if its relative.
3763
  $image = aiosp_common::absolutize_url( $image );
3764
  // TODO Change to wp_parse_url().
3765
  $extn = pathinfo( parse_url( $image, PHP_URL_PATH ), PATHINFO_EXTENSION );
@@ -3836,41 +3908,67 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
3836
  }
3837
 
3838
  /**
 
 
3839
  * Return excluded categories for taxonomy queries.
3840
  *
3841
- * @param int $page
 
 
3842
  *
 
 
3843
  * @return array
3844
  */
3845
- public function get_tax_args( $page = 0 ) {
3846
  $args = array();
3847
- if ( $this->option_isset( 'excl_categories' ) ) {
3848
- $args['exclude'] = $this->options[ $this->prefix . 'excl_categories' ];
3849
- }
3850
  if ( ! empty( $this->options[ "{$this->prefix}indexes" ] ) ) {
3851
  $args['number'] = $this->max_posts;
3852
  $args['offset'] = $page * $this->max_posts;
3853
  }
3854
 
 
 
 
 
 
 
 
 
 
 
 
3855
  $args = apply_filters( $this->prefix . 'tax_args', $args, $page, $this->options );
3856
 
3857
  return $args;
3858
  }
3859
 
3860
  /**
 
 
3861
  * Return excluded categories and pages for post queries.
3862
  *
3863
- * @param $args
 
3864
  *
 
3865
  * @return mixed
3866
  */
3867
  public function set_post_args( $args ) {
3868
- if ( $this->option_isset( 'excl_categories' ) ) {
3869
- $cats = array();
3870
- foreach ( $this->options[ $this->prefix . 'excl_categories' ] as $c ) {
3871
- $cats[] = - $c;
 
 
 
 
 
 
 
 
3872
  }
3873
- $args['category'] = implode( ',', $cats );
3874
  }
3875
  if ( $this->option_isset( 'excl_pages' ) ) {
3876
  $args['exclude'] = $this->options[ $this->prefix . 'excl_pages' ];
@@ -4053,6 +4151,26 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
4053
  return aioseop_get_permalink( $post );
4054
  }
4055
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4056
  /**
4057
  * Return term counts using wp_count_terms().
4058
  *
@@ -4068,13 +4186,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
4068
  if ( is_array( $args['taxonomy'] ) ) {
4069
  $args['taxonomy'] = array_shift( $args['taxonomy'] );
4070
  }
4071
- $term_counts = wp_count_terms( $args['taxonomy'], array( 'hide_empty' => true ) );
4072
  } else {
4073
  foreach ( $args['taxonomy'] as $taxonomy ) {
4074
  if ( 'all' === $taxonomy ) {
4075
  continue;
4076
  }
4077
- $term_counts[ $taxonomy ] = wp_count_terms( $taxonomy, array( 'hide_empty' => true ) );
4078
  }
4079
  }
4080
  }
@@ -4176,24 +4294,26 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
4176
  /**
4177
  * Return post data using get_posts().
4178
  *
4179
- * @param $args
 
 
 
4180
  *
 
4181
  * @return array|mixed
4182
  */
4183
  public function get_all_post_type_data( $args ) {
 
4184
  $defaults = array(
4185
  'numberposts' => $this->max_posts,
4186
  'offset' => 0,
4187
  'category' => 0,
4188
  'orderby' => 'post_date',
4189
- 'order' => 'DESC',
4190
  'include' => array(),
4191
  'exclude' => array(),
4192
  'post_type' => 'any',
4193
- 'meta_key' => '',
4194
- 'meta_value' => '',
4195
- 'meta_compare' => '',
4196
- 'meta_query' => '',
4197
  'cache_results' => false,
4198
  'no_found_rows' => true,
4199
  );
@@ -4228,24 +4348,107 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
4228
  }
4229
  }
4230
  }
4231
-
4232
- $ex_args = $args;
4233
- $ex_args['meta_key'] = '_aioseop_sitemap_exclude';
4234
- $ex_args['meta_value'] = 'on';
4235
- $ex_args['meta_compare'] = '=';
4236
- $ex_args['fields'] = 'ids';
4237
- $ex_args['posts_per_page'] = - 1;
4238
- $q = new WP_Query( $ex_args );
4239
  if ( ! is_array( $args['exclude'] ) ) {
4240
  $args['exclude'] = explode( ',', $args['exclude'] );
4241
  }
4242
- if ( ! empty( $q->posts ) ) {
4243
- $args['exclude'] = array_merge( $args['exclude'], $q->posts );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4244
  }
4245
  $this->excludes = array_merge( $args['exclude'], $exclude_slugs ); // Add excluded slugs and IDs to class var.
4246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4247
  // TODO: consider using WP_Query instead of get_posts to improve efficiency.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4248
  $posts = get_posts( apply_filters( $this->prefix . 'post_query', $args ) );
 
 
 
4249
  if ( ! empty( $exclude_slugs ) ) {
4250
  foreach ( $posts as $k => $v ) {
4251
  // TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
@@ -4254,6 +4457,30 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
4254
  }
4255
  }
4256
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4257
  $posts = apply_filters( $this->prefix . 'post_filter', $posts, $args );
4258
 
4259
  return $posts;
166
  }
167
  parent::__construct();
168
  // TODO This could be move up to the class field default/initial values.
169
+ $this->comment_string = 'Sitemap %s generated by ' . AIOSEOP_PLUGIN_NAME . ' %s by Michael Torbert of Semper Fi Web Design on %s';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  $this->default_options = array(
172
  'rss_sitemap' => array( 'name' => __( 'Create RSS Sitemap', 'all-in-one-seo-pack' ) ),
181
  ),
182
  'default' => 0,
183
  ),
184
+ 'indexes' => array(
185
+ 'name' => __( 'Enable Sitemap Indexes', 'all-in-one-seo-pack' ),
186
+ 'default' => 'on',
187
+ ),
188
  'max_posts' => array(
189
  'name' => __( 'Maximum Posts Per Sitemap Page', 'all-in-one-seo-pack' ),
190
  'type' => 'text',
191
+ 'default' => 1000,
192
  'condshow' => array(
193
  "{$this->prefix}indexes" => 'on',
194
  "{$this->prefix}indexes" => 'on',
207
  'archive' => array( 'name' => __( 'Include Date Archive Pages', 'all-in-one-seo-pack' ) ),
208
  'author' => array( 'name' => __( 'Include Author Pages', 'all-in-one-seo-pack' ) ),
209
  'images' => array( 'name' => __( 'Exclude Images', 'all-in-one-seo-pack' ) ),
 
 
 
 
 
 
 
 
210
  'rewrite' => array(
211
  'name' => __( 'Dynamically Generate Sitemap', 'all-in-one-seo-pack' ),
212
  'default' => 'On',
278
 
279
  $arr[ $k . '_' . $opt ] = array(
280
  'name' => $this->ucwords( $val ),
 
 
281
  'type' => 'select',
282
  'initial_options' => $iopts,
283
  'default' => 'no',
299
  'addl_url' => array(
300
  'name' => __( 'Page URL', 'all-in-one-seo-pack' ),
301
  'type' => 'url',
 
302
  'save' => false,
303
  ),
304
  'addl_prio' => array(
305
  'name' => __( 'Page Priority', 'all-in-one-seo-pack' ),
306
  'type' => 'select',
307
  'initial_options' => $prio,
 
308
  'save' => false,
309
  ),
310
  'addl_freq' => array(
311
  'name' => __( 'Page Frequency', 'all-in-one-seo-pack' ),
312
  'type' => 'select',
313
  'initial_options' => $freq,
 
314
  'save' => false,
315
  ),
316
  'addl_mod' => array(
317
  'name' => __( 'Last Modified', 'all-in-one-seo-pack' ),
318
  'type' => 'date',
 
319
  'save' => false,
320
  'class' => 'aiseop-date',
321
  ),
336
  );
337
 
338
  $excl_options = array(
339
+ 'excl_terms' => array(
340
+ 'name' => __( 'Excluded Terms', 'all-in-one-seo-pack' ),
341
+ 'type' => 'multiselect',
342
+ 'class' => 'aioseop-exclude-terms',
343
  ),
344
  'excl_pages' => array(
345
  'name' => __( 'Excluded Pages', 'all-in-one-seo-pack' ),
375
 
376
  $this->default_options = array_merge( $status_options, $this->default_options, $addl_options, $excl_options, $prio_options, $freq_options );
377
 
 
 
378
  add_action(
379
  'after_doing_aioseop_updates',
380
  array(
390
  add_filter( $this->prefix . 'output_option', array( $this, 'display_custom_options' ), 10, 2 );
391
  add_action( $this->prefix . 'daily_update_cron', array( $this, 'daily_update' ) );
392
  add_action( 'init', array( $this, 'make_dynamic_xsl' ) );
393
+
394
+ // TODO is this required for dynamic sitemap?
395
  add_action( 'transition_post_status', array( $this, 'update_sitemap_from_posts' ), 10, 3 );
396
  add_action( 'after_doing_aioseop_updates', array( $this, 'scan_sitemaps' ) );
397
  add_action( 'all_admin_notices', array( $this, 'sitemap_notices' ) );
400
  /**
401
  * Sitemap notices.
402
  *
403
+ * @todo Move admin notice functions. Possibly to where it is first saved & loaded (`load_sitemap_options`).
404
+ *
405
+ * @global AIOSEOP_Notices $aioseop_notices
406
+ *
407
  * @since 2.4.1
408
  */
409
  public function sitemap_notices() {
410
+ if ( ! current_user_can( 'aiosp_manage_seo' ) ) {
 
 
 
 
411
  return;
412
  }
413
 
414
+ global $aioseop_notices;
415
  $options = $this->options;
416
 
417
  if (
418
+ (
419
+ isset( $options[ "{$this->prefix}indexes" ] ) &&
420
+ 'on' !== $options[ "{$this->prefix}indexes" ]
421
+ ) ||
422
+ (
423
+ isset( $options[ "{$this->prefix}indexes" ] ) &&
424
+ 'on' === $options[ "{$this->prefix}indexes" ] &&
425
+ 1000 < $options[ "{$this->prefix}max_posts" ]
426
+ )
427
  ) {
428
  $num_terms = 0;
429
  $post_counts = $this->get_total_post_count(
440
 
441
  $sitemap_urls = $post_counts + $num_terms;
442
 
443
+ if ( 1000 < $sitemap_urls ) {
444
+ $aioseop_notices->activate_notice( 'sitemap_max_warning' );
445
+ } else {
446
+ $aioseop_notices->deactivate_notice( 'sitemap_max_warning' );
447
  }
448
+ } else {
449
+ $aioseop_notices->deactivate_notice( 'sitemap_max_warning' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  }
451
  }
452
 
458
  * @param $post
459
  */
460
  public function update_sitemap_from_posts( $new_status, $old_status, $post ) {
461
+ // ignore WP API requests.
462
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
463
+ return;
464
+ }
465
 
466
  if ( $this->option_isset( 'rewrite' ) ) {
467
  // TODO if dynamic, delete transient (we currently don't do transients).
540
  update_option( $this->prefix . 'cron_last_run', $last_run );
541
  }
542
 
543
+ /**
544
+ * Admin Enqueue Scripts
545
+ *
546
+ * Hook function to enqueue scripts and localize data to scripts.
547
+ *
548
+ * @since 3.0
549
+ *
550
+ * @see 'admin_enqueue_scripts' hook
551
+ * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
552
+ *
553
+ * @param string $hook_suffix The current admin page.
554
+ */
555
+ public function admin_enqueue_scripts( $hook_suffix ) {
556
+ parent::admin_enqueue_scripts( $hook_suffix );
557
+ if ( $this->pagehook !== $hook_suffix ) {
558
+ return;
559
+ }
560
+
561
+ wp_enqueue_script(
562
+ 'aioseop-selectize',
563
+ 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js',
564
+ array( 'jquery' ),
565
+ AIOSEOP_VERSION
566
+ );
567
+
568
+ wp_enqueue_script(
569
+ 'aioseop-search-terms',
570
+ AIOSEOP_PLUGIN_URL . 'js/modules/aioseop_sitemap.js',
571
+ array( 'jquery' ),
572
+ AIOSEOP_VERSION,
573
+ true
574
+ );
575
+ }
576
+
577
+ /**
578
+ * Load styles for module.
579
+ *
580
+ * @since 3.0
581
+ *
582
+ * @see 'admin_enqueue_scripts' hook
583
+ * @link https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
584
+ *
585
+ * @param string $hook_suffix The current admin page.
586
+ */
587
+ public function admin_enqueue_styles( $hook_suffix ) {
588
+ parent::admin_enqueue_styles( $hook_suffix );
589
+ if ( $this->pagehook !== $hook_suffix ) {
590
+ return;
591
+ }
592
+
593
+ wp_enqueue_style(
594
+ 'aioseop-selectize',
595
+ 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.css',
596
+ false,
597
+ AIOSEOP_VERSION,
598
+ false
599
+ );
600
+ wp_enqueue_style(
601
+ 'aioseop-selectize-default',
602
+ 'https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.default.min.css',
603
+ false,
604
+ AIOSEOP_VERSION,
605
+ false
606
+ );
607
+ }
608
+
609
  /**
610
  * Initialize options, after constructor.
611
  */
626
  $this->setup_rewrites();
627
  }
628
 
629
+ /**
630
+ * Filters whether to display the URL to the XML Sitemap on our virtual robots.txt file.
631
+ *
632
+ * Defaults to true. Return __return_false in order to not display the URL.
633
+ *
634
+ * @since 3.0
635
+ *
636
+ * @param boolean Defaults to true.
637
+ */
638
+ if ( apply_filters( 'aioseop_robotstxt_sitemap_url', true ) ) {
639
  add_action( 'do_robots', array( $this, 'do_robots' ), 100 );
640
  }
641
 
690
 
691
  /**
692
  * Add post type details for settings once post types have been registered.
693
+ *
694
+ * @todo This function is being used to set up option values. This could possibly be refactored to something better suited.
695
+ *
696
+ * @since 3.0 Add custom taxonomy support for Excluding Terms setting. (#240)
697
  */
698
  public function add_post_types() {
699
  $post_type_titles = $this->get_post_type_titles( array( 'public' => true ) );
701
  if ( isset( $post_type_titles['attachment'] ) ) {
702
  $post_type_titles['attachment'] = __( 'Media / Attachments', 'all-in-one-seo-pack' );
703
  }
704
+ $this->default_options['posttypes']['initial_options'] = array_merge( array( 'all' => __( 'All Post Types', 'all-in-one-seo-pack' ) ), $post_type_titles );
705
+ $this->default_options['taxonomies']['initial_options'] = array_merge( array( 'all' => __( 'All Taxonomies', 'all-in-one-seo-pack' ) ), $taxonomy_titles );
706
+ $this->default_options['posttypes']['default'] = array_keys( $this->default_options['posttypes']['initial_options'] );
707
+ $this->default_options['taxonomies']['default'] = array_keys( $this->default_options['taxonomies']['initial_options'] );
708
+
709
+ // Exclude Terms element items.
710
+ $this->default_options['excl_terms']['initial_options'] = array();
711
+ $taxonomies_active = array();
712
+ if ( is_array( $this->options['aiosp_sitemap_taxonomies'] ) ) {
713
+ $taxonomies_active = $this->options['aiosp_sitemap_taxonomies'];
714
+ } elseif ( ! empty( $this->options['aiosp_sitemap_taxonomies'] ) ) {
715
+ $taxonomies_active = array( $this->options['aiosp_sitemap_taxonomies'] );
716
+ }
717
+
718
+ $args_taxonomy_key = array_search( 'all', $taxonomies_active, true );
719
+ if ( false !== $args_taxonomy_key ) {
720
+ // Remove 'all' as an invalid post_type. Use registered post_types selected instead.
721
+ unset( $taxonomies_active[ $args_taxonomy_key ] );
722
+ // Adds all the taxonomies regardless if other taxonomies are selected; ensures all taxonomies are added.
723
+ $taxonomies_active = array_merge( $taxonomies_active, get_taxonomies() );
724
+ }
725
+
726
+ $excl_terms_init_opts = array();
727
+ foreach ( $taxonomies_active as $v1_taxonomy ) {
728
+ $args_terms = array(
729
+ 'taxonomy' => $v1_taxonomy,
730
+ 'hide_empty' => false,
731
+ );
732
+
733
+ $taxonomy_terms_tmp = $this->get_term_titles( $args_terms );
734
+ foreach ( $taxonomy_terms_tmp as $k2_id => $v2_term ) {
735
+ $excl_terms_init_opts[ $v1_taxonomy . '-' . $k2_id ] = $v2_term . ' (' . $v1_taxonomy . ')';
736
+ }
737
+ }
738
+ $this->default_options['excl_terms']['initial_options'] = $excl_terms_init_opts;
739
 
740
+ $post_name = ' ' . __( 'Post Type', 'all-in-one-seo-pack' );
741
+ $tax_name = ' ' . __( 'Taxonomy', 'all-in-one-seo-pack' );
 
 
742
 
743
  foreach ( $post_type_titles as $k => $v ) {
744
  $key = 'prio_post_' . $k;
748
  array(
749
  $key => array(
750
  'name' => $v . $post_name,
 
751
  'type' => 'select',
752
  'initial_options' => $this->prio,
753
  'default' => 'no',
763
  array(
764
  $key => array(
765
  'name' => $v . $post_name,
 
766
  'type' => 'select',
767
  'initial_options' => $this->freq,
768
  'default' => 'no',
780
  array(
781
  $key => array(
782
  'name' => $v . $tax_name,
 
783
  'type' => 'select',
784
  'initial_options' => $this->prio,
785
  'default' => 'no',
795
  array(
796
  $key => array(
797
  'name' => $v . $tax_name,
 
798
  'type' => 'select',
799
  'initial_options' => $this->freq,
800
  'default' => 'no',
902
  *
903
  * @since 2.3.6
904
  * @since 2.3.12.3 Refactored to use aioseop_home_url() for compatibility purposes.
905
+ * @since 3.0 Change 'excl_terms' to include taxonomy slugs with term id. (Pro #240)
906
+ * @since 3.0 Remove WP < 3.5 old Privacy Settings link
907
  *
908
  * @param $options
909
  *
920
 
921
  /* translators: Link to documentation. */
922
  $options[ $this->prefix . 'link' ] = sprintf( __( 'Click here to %s.', 'all-in-one-seo-pack' ), '<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'view your XML sitemap', 'all-in-one-seo-pack' ) . '</a>' );
923
+ $options[ $this->prefix . 'link' ] .= ' ' . __( 'Your sitemap has been created with content and images.', 'all-in-one-seo-pack' );
924
 
925
  if ( $options[ "{$this->prefix}rss_sitemap" ] ) {
926
  $url_rss = aioseop_home_url( '/' . $this->get_filename() . '.rss' );
941
  }
942
  }
943
  if ( ! get_option( 'blog_public' ) ) {
944
+ $privacy_link = '<a href="options-reading.php">' . __( 'Reading Settings', 'all-in-one-seo-pack' ) . '</a>';
 
 
 
 
 
945
  /* translators: Link to settings to disable "Discourage search engines from indexing this site". */
946
+ $options[ $this->prefix . 'link' ] .= '<p class="aioseop_error_notice">' . sprintf( __( 'Warning: your privacy settings are configured to ask search engines to not index your site; you can change this under %s for your site.', 'all-in-one-seo-pack' ), $privacy_link );
947
+ }
948
+
949
+ $excl_terms = array();
950
+ if ( isset( $options[ $this->prefix . 'excl_terms' ] ) && is_array( $options[ $this->prefix . 'excl_terms' ] ) ) {
951
+ foreach ( $options[ $this->prefix . 'excl_terms' ] as $k1_taxonomy => $v1_tax_terms ) {
952
+ foreach ( $v1_tax_terms['terms'] as $v2_term ) {
953
+ $excl_terms[] = $k1_taxonomy . '-' . $v2_term;
954
+ }
955
+ }
956
  }
957
+
958
+ $options[ $this->prefix . 'excl_terms' ] = $excl_terms;
959
+
960
  return $options;
961
  }
962
 
967
  *
968
  * @todo This needs nonce support.
969
  *
970
+ * @since ?
971
+ * @since 3.0 Change saving 'excl_terms' to database with tax_query format for custom taxonomy support. (Pro #240)
972
+ *
973
  * @param $options
974
  *
975
  * @return mixed
1039
  }
1040
  }
1041
 
1042
+ if ( ! empty( $_POST[ $this->prefix . 'excl_terms' ] ) ) {
1043
+ $raw_excl_terms = filter_input( INPUT_POST, $this->prefix . 'excl_terms', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
1044
+
1045
+ // Parse taxonomy terms {$taxonomy_slug}-{$term_id}
1046
+ $excl_terms = array();
1047
+ foreach ( $raw_excl_terms as $v1_tax_term ) {
1048
+ $term_id = explode( '-', $v1_tax_term );
1049
+ $term_id = intval( end( $term_id ) );
1050
+ $taxonomy_slug = sanitize_text_field( str_replace( '-' . $term_id, '', $v1_tax_term ) );
1051
+
1052
+ // Initialize taxonomy => terms array if not yet set.
1053
+ if ( ! isset( $excl_terms[ $taxonomy_slug ] ) ) {
1054
+ $excl_terms[ $taxonomy_slug ] = array(
1055
+ 'terms' => array(),
1056
+ );
1057
+ }
1058
+
1059
+ $excl_terms[ $taxonomy_slug ]['taxonomy'] = $taxonomy_slug;
1060
+ $excl_terms[ $taxonomy_slug ]['terms'][] = $term_id;
1061
+ }
1062
+
1063
+ $options[ $this->prefix . 'excl_terms' ] = $excl_terms;
1064
+ }
1065
+
1066
  return $options;
1067
  }
1068
 
1105
  $siteurl = get_home_url( $blog_id );
1106
  }
1107
  $url = $siteurl . '/' . $this->get_filename() . '.xml';
 
 
 
1108
  $siteurls[] = $url;
1109
  }
1110
  }
1173
  */
1174
  public function scan_match_files() {
1175
  $scan1 = '';
 
1176
  $files = array();
1177
 
1178
  $filename = $this->get_filename();
1179
  if ( ! empty( $filename ) ) {
1180
  $scan1 = get_home_path() . $filename . '*.xml';
 
 
 
1181
 
1182
+ if ( empty( $scan1 ) ) {
1183
  return $files;
1184
  }
1185
  $home_path = get_home_path();
1192
  $files[] = $home_path . $f;
1193
  continue;
1194
  }
 
 
 
1195
  }
1196
  }
 
1197
  return $files;
1198
  }
1199
  }
1336
  $matches
1337
  ) ) {
1338
  if ( ! empty( $this->options[ "{$this->prefix}rewrite" ] ) ) {
1339
+ /* translators: %1$s, %2$s, etc. are placeholders and should not be translated. %1$s expands to the name of a sitemap file, %2$s to the name of the plugin, All in One SEO Pack, %3$s is replaced with the plugin version number and %4$s with a date. */
1340
  $msg .= '<p>' . sprintf(
1341
+ __( "Warning: a static sitemap '%1\$s' generated by %2\$s %3\$s on %4\$s already exists that may conflict with dynamic sitemap generation.", 'all-in-one-seo-pack' ),
1342
  $f,
1343
+ AIOSEOP_PLUGIN_NAME,
1344
  $matches[2],
1345
  $matches[3]
1346
  ) . "</p>\n";
1360
  $problem_files[] = $f;
1361
 
1362
  // This is causing all problem_files to be deleted automatically; which may be the intent.
1363
+ // TODO Either create a separate variable for this set of problem_files, or a final loop to clean problem_files before returning.
1364
  foreach ( $problem_files as $f => $file ) {
1365
  $files[ $f ] = realpath( $file );
1366
  $this->delete_file( realpath( $file ) );
1394
  $msg .= "<input type='hidden' name='aioseop_sitemap_conflict[]' value='" . esc_attr( basename( realpath( $p ) ) ) . "'>\n";
1395
  }
1396
  $msg .= "<input type='hidden' name='nonce-aioseop' value='" . wp_create_nonce( 'aioseop-nonce' ) . "'>\n";
1397
+ $msg .= "<input type='submit' name='aioseop_sitemap_delete_files' class='aioseop_delete_files_button button-primary' value='" . __( 'Delete Conflicting Files', 'all-in-one-seo-pack' ) . "' aria-label='" . __( 'Delete Conflicting Files', 'all-in-one-seo-pack' ) . "'>";
1398
+ $msg .= "<input type='submit' name='aioseop_sitemap_rename_files' class='aioseop_rename_files_button button-secondary' value='" . __( 'Rename Conflicting Files', 'all-in-one-seo-pack' ) . "' aria-label='" . __( 'Rename Conflicting Files', 'all-in-one-seo-pack' ) . "'> ";
1399
 
1400
  $msg = '<form action="" method="post">' . $msg . '</form>';
1401
  }
1434
  * @return array
1435
  */
1436
  public function get_rewrite_rules( $prefix_removed_rules_with = null ) {
1437
+ $sitemap_rules = array(
 
1438
  $this->get_filename() . '.xml' => 'index.php?' . $this->prefix . 'path=root',
1439
  $this->get_filename() . '_(.+)_(\d+).xml' => 'index.php?' . $this->prefix . 'path=$matches[1]&' . $this->prefix . 'page=$matches[2]',
1440
  $this->get_filename() . '_(.+).xml' => 'index.php?' . $this->prefix . 'path=$matches[1]',
1441
  );
1442
 
1443
  if ( isset( $this->options[ "{$this->prefix}rss_sitemap" ] ) && $this->options[ "{$this->prefix}rss_sitemap" ] ) {
1444
+ $sitemap_rules += array(
1445
  $this->get_filename() . '.rss' => 'index.php?' . $this->prefix . 'path=rss',
1446
  $this->get_filename() . 'latest.rss' => 'index.php?' . $this->prefix . 'path=rss_latest',
1447
  );
1448
  } elseif ( ! empty( $prefix_removed_rules_with ) ) {
1449
+ $sitemap_rules += array(
1450
  $prefix_removed_rules_with . $this->get_filename() . '.rss' => 'index.php?' . $this->prefix . 'path=rss',
1451
  $prefix_removed_rules_with . $this->get_filename() . 'latest.rss' => 'index.php?' . $this->prefix . 'path=rss_latest',
1452
  );
1453
  }
 
 
 
 
 
 
 
 
 
 
1454
  return $sitemap_rules;
1455
  }
1456
 
1516
  /**
1517
  * Stop timing and log memory usage for debug info.
1518
  *
1519
+ * @since ?
1520
+ * @since 3.0 Removed $compressed in issue #534
1521
+ *
1522
  * @param string $sitemap_type
 
1523
  * @param bool $dynamic
1524
  */
1525
+ public function log_stats( $sitemap_type = 'static', $dynamic = true ) {
1526
  $time = timer_stop();
1527
  $end_memory_usage = memory_get_peak_usage();
1528
  $sitemap_memory_usage = $end_memory_usage - $this->start_memory_usage;
1529
  $end_memory_usage = $end_memory_usage / 1024.0 / 1024.0;
1530
  $sitemap_memory_usage = $sitemap_memory_usage / 1024.0 / 1024.0;
1531
  $sitemap_type = __( 'static', 'all-in-one-seo-pack ' );
 
 
 
1532
  if ( $dynamic ) {
1533
  $sitemap_type = __( 'dynamic', 'all-in-one-seo-pack ' );
1534
  }
1538
  /**
1539
  * Handle outputting of dynamic sitemaps, logging.
1540
  *
1541
+ * @since ?
1542
+ * @since 3.0 Show 404 template for empty content. #2190
1543
+ *
1544
  * @param $query
1545
  */
1546
  public function sitemap_output_hook( $query ) {
1553
  }
1554
  $this->start_memory_usage = memory_get_peak_usage();
1555
  $sitemap_type = $query->query_vars[ "{$this->prefix}path" ];
1556
+
 
 
 
 
1557
  $blog_charset = get_option( 'blog_charset' );
1558
+ header( "Content-Type: text/xml; charset=$blog_charset", true );
 
 
 
 
 
1559
 
1560
  // Always follow and noindex the sitemap.
1561
  header( 'X-Robots-Tag: noindex, follow', true );
1562
 
1563
  do_action( $this->prefix . 'add_headers', $query, $this->options );
1564
 
1565
+ $content = $this->do_rewrite_sitemap( $sitemap_type, $page );
1566
+
1567
+ // if the sitemap has no content, it's probabaly invalid and is being called directly.
1568
+ // @issue https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/2190
1569
+ if ( empty( $content ) ) {
1570
+ $query->set_404();
1571
+ status_header( 404 );
1572
+ header( "Content-Type: text/html; charset=$blog_charset", true );
1573
+ nocache_headers();
1574
+ include( get_404_template() );
1575
+ exit();
1576
  }
1577
+
1578
+ echo $content;
1579
+
1580
+ $this->log_stats( $sitemap_type );
 
 
1581
  exit();
1582
 
1583
  }
1631
  $sitemap_data = $this->get_all_post_priority_data( $sitemap_type, 'publish', $page );
1632
  } elseif ( in_array( $sitemap_type, $taxonomies ) ) {
1633
  // TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
1634
+ $sitemap_data = $this->get_term_priority_data( get_terms( $this->get_tax_args( (array) $sitemap_type, $page ) ) );
1635
  } else {
1636
  // TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
1637
  if ( is_array( $this->extra_sitemaps ) && in_array( $sitemap_type, $this->extra_sitemaps ) ) {
1650
  *
1651
  * Output sitemaps dynamically based on rewrite rules.
1652
  *
1653
+ * @since ?
1654
+ * @since 3.0 Return a (string) value. #2190
1655
+ *
1656
  * @param $sitemap_type
1657
  * @param int $page
1658
+ * @return string
1659
  */
1660
  public function do_rewrite_sitemap( $sitemap_type, $page = 0 ) {
1661
  $this->add_post_types();
1662
  $comment = 'dynamically';
1663
  // TODO Add esc_* or wp_kses function.
1664
+ return $this->do_build_sitemap( $sitemap_type, $page, '', $comment );
1665
  }
1666
 
1667
  /**
1674
  */
1675
  public function get_sitemap_url() {
1676
 
1677
+ $url = aioseop_home_url( '/' . $this->get_filename() . '.xml' );
 
 
 
 
 
1678
 
1679
  return $url;
1680
  }
1767
  $this->write_sitemaps( $this->get_filename(), $rss, '.rss' );
1768
  }
1769
 
1770
+ $this->log_stats( 'root', false );
1771
  }
1772
  } else {
1773
  delete_transient( "{$this->prefix}rules_flushed" );
1796
  /**
1797
  * Write multiple sitemaps.
1798
  *
1799
+ * Write sitemaps to the filesystem.
1800
  *
1801
  * @param $filename
1802
  * @param $contents
1803
  */
1804
  public function write_sitemaps( $filename, $contents, $extn = '.xml' ) {
1805
  $this->write_sitemap( $filename . $extn, $contents );
 
 
 
1806
  }
1807
 
1808
  /**
1809
  * Write single sitemap.
1810
  *
1811
+ * Write a single sitemap to the filesystem.
1812
+ *
1813
+ * @since ?
1814
+ * @since 3.0 Removed $gzip in issue #534
1815
  *
1816
  * @param $filename
1817
  * @param $contents
 
1818
  *
1819
  * @return bool
1820
  */
1821
+ public function write_sitemap( $filename, $contents ) {
 
 
 
1822
  add_filter( 'upload_mimes', array( $this, 'add_xml_mime_type' ) );
1823
  $filename = $this->get_home_path() . sanitize_file_name( $filename );
1824
  remove_filter( 'upload_mimes', array( $this, 'add_xml_mime_type' ) );
1932
  *
1933
  * @since 2.3.6
1934
  * @since 2.3.12.3 Refactored to use aioseop_home_url() for compatibility purposes.
1935
+ * @since 3.0 Changed to exclude noindex post types. #1382
1936
  *
1937
  * @return array
1938
  */
1939
  public function get_sitemap_index_filenames() {
1940
+ global $aioseop_options;
1941
  $files = array();
1942
  $options = $this->options;
1943
  $prefix = $this->get_filename();
1944
  $suffix = '.xml';
1945
 
 
 
 
1946
  if ( empty( $options[ "{$this->prefix}posttypes" ] ) ) {
1947
  $options[ "{$this->prefix}posttypes" ] = array();
1948
  }
1950
  $options[ "{$this->prefix}taxonomies" ] = array();
1951
  }
1952
  $options[ "{$this->prefix}posttypes" ] = array_diff( $options[ "{$this->prefix}posttypes" ], array( 'all' ) );
1953
+ $options[ "{$this->prefix}taxonomies" ] = $this->show_or_hide_taxonomy( array_diff( $options[ "{$this->prefix}taxonomies" ], array( 'all' ) ) );
1954
 
1955
  $files[] = array( 'loc' => aioseop_home_url( '/' . $prefix . '_addl' . $suffix ) );
1956
 
1957
+ // Get post types selected, and NoIndex post types & Index posts.
1958
+ $post_types = $options[ "{$this->prefix}posttypes" ];
1959
+ if ( is_array( $aioseop_options['aiosp_cpostnoindex'] ) ) {
1960
+ foreach ( $post_types as $index => $post_type ) {
1961
+ if ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'], true ) ) {
1962
+ $args = array(
1963
+ 'post_type' => $post_type,
1964
+ 'meta_query' => array(
1965
+ 'relation' => 'OR',
1966
+ array(
1967
+ 'key' => '_aioseop_noindex',
1968
+ 'value' => 'off',
1969
+ 'compare' => '=',
1970
+ ),
1971
+ ),
1972
+ 'fields' => 'ids',
1973
+ 'posts_per_page' => 1,
1974
+ );
1975
+ $q = new WP_Query( $args );
1976
+ if ( 0 === $q->post_count ) {
1977
+ unset( $post_types[ $index ] );
1978
+ }
1979
+ }
1980
+ }
1981
+ }
1982
+
1983
+ if ( ! empty( $post_types ) ) {
1984
  $prio = $this->get_default_priority( 'post' );
1985
  $freq = $this->get_default_frequency( 'post' );
1986
+
1987
+ // Get post counts from posts type. Exclude if NoIndex is on, and does not contain excluded terms.
1988
+ $args = array(
1989
+ 'post_type' => $post_types,
1990
+ 'post_status' => 'publish',
1991
+ 'meta_query' => array(
1992
+ 'relation' => 'OR',
1993
+ array(
1994
+ 'key' => '_aioseop_noindex',
1995
+ 'value' => 'on',
1996
+ 'compare' => '!=',
1997
+ ),
1998
+ array(
1999
+ 'key' => '_aioseop_noindex',
2000
+ 'compare' => 'NOT EXISTS',
2001
+ ),
2002
+ ),
2003
  );
2004
+ if ( $this->option_isset( 'excl_terms' ) ) {
2005
+ // Adds excluded terms to exclude from query.
2006
+ foreach ( $this->options[ $this->prefix . 'excl_terms' ] as $k1_taxonomy => $v1_tax_terms ) {
2007
+ if ( ! isset( $args['tax_query'] ) ) {
2008
+ $args['tax_query'] = array(
2009
+ 'relation' => 'AND',
2010
+ );
2011
+ }
2012
+ $args['tax_query'][] = array(
2013
+ 'taxonomy' => $k1_taxonomy,
2014
+ 'terms' => $v1_tax_terms['terms'],
2015
+ 'operator' => 'NOT IN',
2016
+ );
2017
+ }
2018
+ }
2019
+ $post_counts = $this->get_all_post_counts( $args );
2020
 
2021
+ foreach ( $post_types as $sm ) {
2022
  if ( 0 === intval( $post_counts[ $sm ] ) ) {
2023
  continue;
2024
  }
2064
  }
2065
 
2066
  if ( ! empty( $options[ "{$this->prefix}taxonomies" ] ) ) {
2067
+ foreach ( $options[ "{$this->prefix}taxonomies" ] as $v1_taxonomy ) {
2068
+ $tax_args = $this->get_tax_args( array( $v1_taxonomy ) );
2069
+ $tax_args['fields'] = 'count';
2070
+
2071
+ $term_count = get_terms( $tax_args );
2072
  if ( ! is_wp_error( $term_count ) && ( $term_count > 0 ) ) {
2073
  if ( ! empty( $this->options[ "{$this->prefix}indexes" ] ) ) {
2074
  if ( $term_count > $this->max_posts ) {
2075
  $count = 1;
2076
  for ( $tc = 0; $tc < $term_count; $tc += $this->max_posts ) {
2077
  $files[] = array(
2078
+ 'loc' => aioseop_home_url( '/' . $prefix . '_' . $v1_taxonomy . '_' . ( $count ++ ) . $suffix ),
2079
  'changefreq' => $this->get_default_frequency( 'taxonomies' ),
2080
  'priority' => $this->get_default_priority( 'taxonomies' ),
2081
  );
2082
  }
2083
  } else {
2084
  $files[] = array(
2085
+ 'loc' => aioseop_home_url( '/' . $prefix . '_' . $v1_taxonomy . $suffix ),
2086
  'changefreq' => $this->get_default_frequency( 'taxonomies' ),
2087
  'priority' => $this->get_default_priority( 'taxonomies' ),
2088
  );
2089
  }
2090
  } else {
2091
  $files[] = array(
2092
+ 'loc' => aioseop_home_url( '/' . $prefix . '_' . $v1_taxonomy . $suffix ),
2093
  'changefreq' => $this->get_default_frequency( 'taxonomies' ),
2094
  'priority' => $this->get_default_priority( 'taxonomies' ),
2095
  );
2142
  if ( ( 'root' === $sitemap_type ) && ! empty( $this->options[ "{$this->prefix}indexes" ] ) ) {
2143
  return $this->build_sitemap_index( $sitemap_data, sprintf( $comment, $filename ) );
2144
  } else {
2145
+ if ( empty( $sitemap_data ) ) {
2146
+ return '';
2147
+ }
2148
  return $this->build_sitemap( $sitemap_data, $sitemap_type, sprintf( $comment, $filename ) );
2149
  }
2150
  }
2240
  }
2241
  }
2242
  }
2243
+ $this->log_stats( 'indexed', false );
2244
  }
2245
 
2246
  public function remove_posts_page( $postspageid ) {
2344
  if ( is_array( $home ) ) {
2345
  array_unshift( $prio, $home );
2346
  }
2347
+ $terms = get_terms( $this->get_tax_args( $options[ "{$this->prefix}taxonomies" ] ) );
2348
  $prio2 = $this->get_term_priority_data( $terms );
2349
  $prio3 = $this->get_addl_pages_only();
2350
  $prio = array_merge( $child, $prio, $prio2, $prio3 );
2687
  */
2688
  public function get_term_priority_data( $terms ) {
2689
  $prio = array();
2690
+ if ( is_array( $terms ) && ! empty( $terms ) ) {
2691
  $def_prio = $this->get_default_priority( 'taxonomies' );
2692
  $def_freq = $this->get_default_frequency( 'taxonomies' );
2693
  foreach ( $terms as $term ) {
3380
  $timestamp = mysql2date( 'U', $post->post_modified_gmt );
3381
  $pr_info['rss'] = array(
3382
  'title' => $title,
3383
+ 'description' => get_the_excerpt( $post ),
3384
  'pubDate' => date( 'r', $timestamp ),
3385
  'timestamp ' => $timestamp,
3386
  'post_type' => $post->post_type,
3399
  return $prio;
3400
  }
3401
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3402
  /**
3403
  * Return the images attached to the term.
3404
  *
3405
  * @param WP_Term $term the term object.
3406
  *
3407
  * @since 2.4
3408
+ * @since 3.0 remove check for WP 4.4
3409
  *
3410
  * @return array
3411
  */
3412
  private function get_images_from_term( $term ) {
 
 
3413
  if ( ! aiosp_include_images() ) {
3414
  return array();
3415
  }
3416
 
3417
  $images = array();
3418
+
3419
+ $thumbnail_id = get_term_meta( $term->term_id, 'thumbnail_id', true );
3420
+ if ( $thumbnail_id ) {
3421
+ $image = wp_get_attachment_url( $thumbnail_id );
3422
+ if ( $image ) {
3423
+ $images['image:image'] = array(
3424
+ 'image:loc' => $image,
3425
+ 'image:caption' => wp_get_attachment_caption( $thumbnail_id ),
3426
+ 'image:title' => get_the_title( $thumbnail_id ),
3427
+ );
 
 
3428
  }
3429
  }
3430
 
3436
  *
3437
  * @todo Add ~`get_attachment_postid_to_url()` function.
3438
  * @todo Benchmark `wp_get_attachment_image_src()` & `wp_get_attachment_url()`.
3439
+ * @todo Look into using 'wp_get_attachment_image_url()'.
3440
  *
3441
  * @since 2.4
3442
  * @since 2.11 Optimization #2008 - Reduce the need to convert url to id.
3469
  $attributes = wp_get_attachment_image_src( $post->ID );
3470
  if ( $attributes ) {
3471
  $rtn_image_attributes[] = array(
3472
+ 'image:loc' => $this->aioseop_clean_url( $attributes[0] ),
3473
  'image:caption' => wp_get_attachment_caption( $post->ID ),
3474
  'image:title' => get_the_title( $post->ID ),
3475
  );
3569
  if ( ! isset( $this->image_ids_urls[ $v1_image_id ] ) ) {
3570
  // Sets any remaining post image IDs that weren't converted from URL.
3571
  $this->image_ids_urls[ $v1_image_id ] = array(
3572
+ 'base_url' => $this->aioseop_clean_url( wp_get_attachment_url( $v1_image_id ) ),
3573
  );
3574
 
3575
  $transient_update = true;
3576
  } else {
3577
  if ( empty( $this->image_ids_urls[ $v1_image_id ]['base_url'] ) ) {
3578
+ $this->image_ids_urls[ $v1_image_id ]['base_url'] = $this->aioseop_clean_url( wp_get_attachment_url( $v1_image_id ) );
3579
 
3580
  $transient_update = true;
3581
  }
3782
  }
3783
  $code .= ']';
3784
 
3785
+ $gallery_content .= aioseop_do_shortcodes( $code );
3786
  }
3787
  }
3788
 
3798
  *
3799
  * @return string
3800
  */
3801
+ public function aioseop_clean_url( $url ) {
3802
  // remove the query string.
3803
  $url = strtok( $url, '?' );
3804
  // make the url XML-safe.
3818
  * @since 2.4.1
3819
  * @since 2.4.3 Compatibility with Pre v4.7 wp_parse_url().
3820
  * @since 2.11 Sitemap Optimization #2008 - Changed to a more appropriate name.
3821
+ * @since 3.0 remove checks for old WP versions
3822
  *
3823
  * @return bool
3824
  */
3825
  public function is_image_url_valid( $image ) {
 
 
3826
  // Bail if empty image.
3827
  if ( empty( $image ) ) {
3828
  return false;
3829
  }
3830
 
3831
+ $component = PHP_URL_PATH;
3832
+ $url = wp_parse_url( $image, $component );
 
 
 
 
 
 
 
 
 
 
 
 
3833
 
3834
+ // Make the url absolute, if its relative.
3835
  $image = aiosp_common::absolutize_url( $image );
3836
  // TODO Change to wp_parse_url().
3837
  $extn = pathinfo( parse_url( $image, PHP_URL_PATH ), PATHINFO_EXTENSION );
3908
  }
3909
 
3910
  /**
3911
+ * Set Taxonomy Args
3912
+ *
3913
  * Return excluded categories for taxonomy queries.
3914
  *
3915
+ * @since ?
3916
+ * @since 3.0.0 Added $taxonomies parameter.
3917
+ * @since 3.0 Change 'exclude' to support excluding custom taxonomy terms. (Pro #240)
3918
  *
3919
+ * @param array $taxonomies The array of taxonomy slugs.
3920
+ * @param int $page The page number.
3921
  * @return array
3922
  */
3923
+ public function get_tax_args( $taxonomies, $page = 0 ) {
3924
  $args = array();
3925
+
 
 
3926
  if ( ! empty( $this->options[ "{$this->prefix}indexes" ] ) ) {
3927
  $args['number'] = $this->max_posts;
3928
  $args['offset'] = $page * $this->max_posts;
3929
  }
3930
 
3931
+ $args['taxonomy'] = $this->show_or_hide_taxonomy( $taxonomies );
3932
+
3933
+ if ( $this->option_isset( 'excl_terms' ) ) {
3934
+ $args['exclude'] = array();
3935
+ foreach ( $taxonomies as $v1_taxonomy ) {
3936
+ if ( isset( $this->options[ $this->prefix . 'excl_terms' ][ $v1_taxonomy ] ) ) {
3937
+ $args['exclude'] = array_merge( $args['exclude'], $this->options[ $this->prefix . 'excl_terms' ][ $v1_taxonomy ]['terms'] );
3938
+ }
3939
+ }
3940
+ }
3941
+
3942
  $args = apply_filters( $this->prefix . 'tax_args', $args, $page, $this->options );
3943
 
3944
  return $args;
3945
  }
3946
 
3947
  /**
3948
+ * Set Post Args
3949
+ *
3950
  * Return excluded categories and pages for post queries.
3951
  *
3952
+ * @since ?
3953
+ * @since 3.0 Change 'excl_terms' to tax_query format. (Pro #240)
3954
  *
3955
+ * @param $args
3956
  * @return mixed
3957
  */
3958
  public function set_post_args( $args ) {
3959
+ if ( $this->option_isset( 'excl_terms' ) ) {
3960
+ foreach ( $this->options[ $this->prefix . 'excl_terms' ] as $k1_taxonomy => $v1_tax_terms ) {
3961
+ if ( ! isset( $args['tax_query'] ) ) {
3962
+ $args['tax_query'] = array(
3963
+ 'relation' => 'AND',
3964
+ );
3965
+ }
3966
+ $args['tax_query'][] = array(
3967
+ 'taxonomy' => $k1_taxonomy,
3968
+ 'terms' => $v1_tax_terms['terms'],
3969
+ 'operator' => 'NOT IN',
3970
+ );
3971
  }
 
3972
  }
3973
  if ( $this->option_isset( 'excl_pages' ) ) {
3974
  $args['exclude'] = $this->options[ $this->prefix . 'excl_pages' ];
4151
  return aioseop_get_permalink( $post );
4152
  }
4153
 
4154
+ /**
4155
+ * Show or hide the taxonomy/taxonomies.
4156
+ *
4157
+ * @since 3.0.0
4158
+ *
4159
+ * @param array $taxonomy The array of taxonomy slugs.
4160
+ *
4161
+ * @return array The array of taxonomy slugs that need to be shown.
4162
+ */
4163
+ private function show_or_hide_taxonomy( $taxonomy ) {
4164
+ /**
4165
+ * Determines whether to show or hide the taxonomy/taxonomies.
4166
+ *
4167
+ * @since 3.0.0
4168
+ *
4169
+ * @param array $taxonomy The array of taxonomy slugs.
4170
+ */
4171
+ return apply_filters( "{$this->prefix}show_taxonomy", $taxonomy );
4172
+ }
4173
+
4174
  /**
4175
  * Return term counts using wp_count_terms().
4176
  *
4186
  if ( is_array( $args['taxonomy'] ) ) {
4187
  $args['taxonomy'] = array_shift( $args['taxonomy'] );
4188
  }
4189
+ $term_counts = wp_count_terms( $this->show_or_hide_taxonomy( $args['taxonomy'] ), array( 'hide_empty' => true ) );
4190
  } else {
4191
  foreach ( $args['taxonomy'] as $taxonomy ) {
4192
  if ( 'all' === $taxonomy ) {
4193
  continue;
4194
  }
4195
+ $term_counts[ $taxonomy ] = wp_count_terms( $this->show_or_hide_taxonomy( $taxonomy ), array( 'hide_empty' => true ) );
4196
  }
4197
  }
4198
  }
4294
  /**
4295
  * Return post data using get_posts().
4296
  *
4297
+ * @since ?
4298
+ * @since 3.0 Changed to exclude noindex post types & posts. #1382
4299
+ *
4300
+ * @global array $aioseop_options
4301
  *
4302
+ * @param array $args Query Arguments.
4303
  * @return array|mixed
4304
  */
4305
  public function get_all_post_type_data( $args ) {
4306
+ global $aioseop_options;
4307
  $defaults = array(
4308
  'numberposts' => $this->max_posts,
4309
  'offset' => 0,
4310
  'category' => 0,
4311
  'orderby' => 'post_date',
4312
+ 'order' => 'ASC',
4313
  'include' => array(),
4314
  'exclude' => array(),
4315
  'post_type' => 'any',
4316
+ 'meta_query' => array(),
 
 
 
4317
  'cache_results' => false,
4318
  'no_found_rows' => true,
4319
  );
4348
  }
4349
  }
4350
  }
 
 
 
 
 
 
 
 
4351
  if ( ! is_array( $args['exclude'] ) ) {
4352
  $args['exclude'] = explode( ',', $args['exclude'] );
4353
  }
4354
+
4355
+ // Exclude (method) query args.
4356
+ $ex_args = $args;
4357
+ $ex_args['meta_query'] = array(
4358
+ 'relation' => 'OR',
4359
+
4360
+ array(
4361
+ 'key' => '_aioseop_sitemap_exclude',
4362
+ 'value' => 'on',
4363
+ 'compare' => '=',
4364
+ ),
4365
+ array(
4366
+ 'key' => '_aioseop_noindex',
4367
+ 'value' => 'on',
4368
+ 'compare' => '=',
4369
+ ),
4370
+ );
4371
+ $ex_args['fields'] = 'ids';
4372
+ $ex_args['posts_per_page'] = $this->max_posts;
4373
+
4374
+ // Exclude (method) query.
4375
+ $q_exclude = new WP_Query( $ex_args );
4376
+ if ( ! empty( $q_exclude->posts ) ) {
4377
+ $args['exclude'] = array_merge( $args['exclude'], $q_exclude->posts );
4378
  }
4379
  $this->excludes = array_merge( $args['exclude'], $exclude_slugs ); // Add excluded slugs and IDs to class var.
4380
 
4381
+ // Avoid if possible.
4382
+ // Include (method) query args for including posts that may have been excluded;
4383
+ // for example, exclude post type, but include certain posts.
4384
+ // NOTE: Do NOT use this for basic including. It's best to avoid an additional query.
4385
+ $args_include = array(
4386
+ 'post_type' => array(),
4387
+ 'meta_query' => array(
4388
+ 'relation' => 'OR',
4389
+ array(
4390
+ 'key' => '_aioseop_noindex',
4391
+ 'value' => 'off',
4392
+ 'compare' => '=',
4393
+ ),
4394
+
4395
+ ),
4396
+ 'posts_per_page' => $this->max_posts,
4397
+ );
4398
+
4399
+ // Exclude from main query, and check if a Query Include is needed.
4400
+ // Check for NoIndex Post Types, BUT also check for Index on NoIdex Post Type.
4401
+ if ( is_array( $aioseop_options['aiosp_cpostnoindex'] ) ) {
4402
+ // Check if wp_query_args post_type is an array or string.
4403
+ if ( is_array( $args['post_type'] ) ) {
4404
+ foreach ( $args['post_type'] as $index => $post_type ) {
4405
+ if ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'], true ) ) {
4406
+ $args_include['post_type'][] = $post_type;
4407
+ unset( $args['post_type'][ $index ] );
4408
+ }
4409
+ }
4410
+ } else {
4411
+ if ( in_array( $args['post_type'], $aioseop_options['aiosp_cpostnoindex'], true ) ) {
4412
+ $args_include['post_type'][] = $args['post_type'];
4413
+
4414
+ $q_include = new WP_Query( $args_include );
4415
+ // Return posts on single post type query, since no additional query is needed.
4416
+ return $q_include->posts;
4417
+ }
4418
+ }
4419
+ }
4420
+
4421
+ // Avoid if possible.
4422
+ // Include (method) query.
4423
+ // NOTE: Do NOT use this for basic including. It's best to avoid an additional query.
4424
+ $posts_include = array();
4425
+ if ( ! empty( $args_include['post_type'] ) ) {
4426
+ $q_include = new WP_Query( $args_include );
4427
+ // When posts exists from the include method, add to $posts_include to add to final query.
4428
+ if ( ! empty( $q_include->posts ) ) {
4429
+ $posts_include = $q_include->posts;
4430
+ }
4431
+ }
4432
+
4433
  // TODO: consider using WP_Query instead of get_posts to improve efficiency.
4434
+ /**
4435
+ * {$module_prefix}post_query
4436
+ *
4437
+ * Arguments to use on get_posts().
4438
+ *
4439
+ * @since ?
4440
+ *
4441
+ * @param array $args {
4442
+ * Arguments/params for get_posts.
4443
+ * @see get_posts()
4444
+ * @link https://developer.wordpress.org/reference/functions/get_posts/
4445
+ * }
4446
+ *
4447
+ */
4448
  $posts = get_posts( apply_filters( $this->prefix . 'post_query', $args ) );
4449
+
4450
+ // TODO Possibly change to exclude with post__not_in.
4451
+ // Hardcoded exclude concept.
4452
  if ( ! empty( $exclude_slugs ) ) {
4453
  foreach ( $posts as $k => $v ) {
4454
  // TODO Add `true` in 3rd argument with in_array(); which changes it to a strict comparison.
4457
  }
4458
  }
4459
  }
4460
+ // Hardcoded include concept.
4461
+ foreach ( $posts_include as $k1_post_id => $v1_post ) {
4462
+ $posts[ $k1_post_id ] = $v1_post;
4463
+ }
4464
+
4465
+ /**
4466
+ * {$module_prefix}post_filter
4467
+ *
4468
+ * Posts from finalized query for sitemap data.
4469
+ *
4470
+ * @since ?
4471
+ *
4472
+ * @param array $posts {
4473
+ * @type WP_Post ${$post_id} {
4474
+ * @see WP_Post object for more information.
4475
+ * @link https://codex.wordpress.org/Class_Reference/WP_Post
4476
+ * }
4477
+ * }
4478
+ * @param array $args {
4479
+ * Arguments/params for get_posts.
4480
+ * @see get_posts()
4481
+ * @link https://developer.wordpress.org/reference/functions/get_posts/
4482
+ * }
4483
+ */
4484
  $posts = apply_filters( $this->prefix . 'post_filter', $posts, $args );
4485
 
4486
  return $posts;
modules/images/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
public/js/vendor/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Silence is golden.
5
+ */
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === All in One SEO Pack ===
2
  Contributors: hallsofmontezuma, semperplugins, wpsmort, arnaudbroes
3
  Tags: SEO, Google Search Console, XML Sitemap, meta description, meta title, noindex
4
- Requires at least: 4.6
5
  Tested up to: 5.2
6
- Stable tag: 2.12.1
7
  License: GPLv2 or later
8
  Requires PHP: 5.2.4
9
 
@@ -49,7 +49,7 @@ https://www.youtube.com/watch?v=46MR4FboMaA
49
 
50
  == Changelog ==
51
 
52
- All in One SEO Pack [Changelog](https://semperfiwebdesign.com/all-in-one-seo-pack-release-history/)
53
 
54
  == Frequently Asked Questions ==
55
 
1
  === All in One SEO Pack ===
2
  Contributors: hallsofmontezuma, semperplugins, wpsmort, arnaudbroes
3
  Tags: SEO, Google Search Console, XML Sitemap, meta description, meta title, noindex
4
+ Requires at least: 4.7
5
  Tested up to: 5.2
6
+ Stable tag: 3.0
7
  License: GPLv2 or later
8
  Requires PHP: 5.2.4
9
 
49
 
50
  == Changelog ==
51
 
52
+ All in One SEO Pack [Changelog](https://semperplugins.com/all-in-one-seo-pack-changelog/)
53
 
54
  == Frequently Asked Questions ==
55