All in One SEO Pack - Version 2.3.13

Version Description

Download this release

Release Info

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

Code changes from version 2.3.12.5 to 2.3.13

admin/aioseop_module_class.php CHANGED
@@ -503,11 +503,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
503
  $regex = '';
504
  $cont = 0;
505
  foreach ( $list as $l ) {
506
- if ( $cont && ! empty( $l ) ) {
507
- $regex .= '|';
 
 
 
 
508
  }
509
- $cont = 1;
510
- $regex .= preg_quote( trim( $l ), $quote );
511
  }
512
 
513
  return $regex;
@@ -932,10 +934,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
932
  */
933
  function settings_export( $buf ) {
934
  global $aiosp;
935
- $post_types = null;
936
  $has_data = null;
937
  $general_settings = null;
938
- $exporter_choices = '';
939
  if ( ! empty( $_REQUEST['aiosp_importer_exporter_export_choices'] ) ) {
940
  $exporter_choices = $_REQUEST['aiosp_importer_exporter_export_choices'];
941
  }
@@ -954,6 +956,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
954
  $buf .= $this->post_data_export( '_aioseop', array(
955
  'posts_per_page' => - 1,
956
  'post_type' => $post_types,
 
957
  ) );
958
  }
959
 
@@ -2531,8 +2534,14 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
2531
  $this->settings_page_init();
2532
  ?>
2533
  <div class="wrap <?php echo get_class( $this ); ?>">
 
 
 
 
 
 
2534
  <div id="aioseop_settings_header">
2535
- <?php if ( ! empty( $message ) ) {
2536
  echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>";
2537
  } ?>
2538
  <div id="icon-aioseop" class="icon32"><br></div>
503
  $regex = '';
504
  $cont = 0;
505
  foreach ( $list as $l ) {
506
+ if ( ! empty( trim( $l ) ) ) {
507
+ if ( $cont ) {
508
+ $regex .= '|';
509
+ }
510
+ $cont = 1;
511
+ $regex .= preg_quote( trim( $l ), $quote );
512
  }
 
 
513
  }
514
 
515
  return $regex;
934
  */
935
  function settings_export( $buf ) {
936
  global $aiosp;
937
+ $post_types = apply_filters( 'aioseop_export_settings_exporter_post_types', null );
938
  $has_data = null;
939
  $general_settings = null;
940
+ $exporter_choices = apply_filters( 'aioseop_export_settings_exporter_choices', '' );
941
  if ( ! empty( $_REQUEST['aiosp_importer_exporter_export_choices'] ) ) {
942
  $exporter_choices = $_REQUEST['aiosp_importer_exporter_export_choices'];
943
  }
956
  $buf .= $this->post_data_export( '_aioseop', array(
957
  'posts_per_page' => - 1,
958
  'post_type' => $post_types,
959
+ 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private', 'inherit' ),
960
  ) );
961
  }
962
 
2534
  $this->settings_page_init();
2535
  ?>
2536
  <div class="wrap <?php echo get_class( $this ); ?>">
2537
+ <?php
2538
+ ob_start();
2539
+ do_action( $this->prefix . 'settings_header_errors', $location );
2540
+ $errors = ob_get_clean();
2541
+ echo $errors;
2542
+ ?>
2543
  <div id="aioseop_settings_header">
2544
+ <?php if ( ! empty( $message ) && empty( $errors ) ) {
2545
  echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>";
2546
  } ?>
2547
  <div id="icon-aioseop" class="icon32"><br></div>
admin/display/general-metaboxes.php CHANGED
@@ -73,7 +73,7 @@ class aiosp_metaboxes {
73
  // Eventually if nothing is returned we should just remove this section.
74
 
75
  if ( get_locale() != 'en_US' ) { ?>
76
- <div><strong>
77
  <?php
78
 
79
  if ( $aiosp_trans->percent_translated < 100 ) {
73
  // Eventually if nothing is returned we should just remove this section.
74
 
75
  if ( get_locale() != 'en_US' ) { ?>
76
+ <div class="aioseop_translations"><strong>
77
  <?php
78
 
79
  if ( $aiosp_trans->percent_translated < 100 ) {
aioseop_class.php CHANGED
@@ -161,7 +161,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
161
  'description_format' => __( 'This controls the format of Meta Descriptions.The following macros are supported:', 'all-in-one-seo-pack' ) .
162
  '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
163
  __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
164
- __( '%description% - This outputs the description you write for each page/post or the autogenerated description, if you have that option enabled', 'all-in-one-seo-pack' ) . '</li><li>' .
165
  __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . '</li><li>' .
166
  __( '%wp_title% - The original WordPress title, e.g. post_title for posts', 'all-in-one-seo-pack' ) . '</li><li>' .
167
  __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '</li></ul>',
@@ -216,7 +216,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
216
  'paginated_noindex' => __( 'Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
217
  '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' ),
218
  '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' ),
219
- 'generate_descriptions' => __( 'Check this and your Meta Descriptions will be auto-generated from your excerpt or content.', 'all-in-one-seo-pack' ),
220
  'run_shortcodes' => __( 'Check this and shortcodes will get executed for descriptions auto-generated from content.', 'all-in-one-seo-pack' ),
221
  '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' ),
222
  'dont_truncate_descriptions' => __( 'Check this to prevent your Description from being truncated regardless of its length.', 'all-in-one-seo-pack' ),
@@ -1245,7 +1245,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1245
  $extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
1246
  }
1247
 
1248
- $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( wp_strip_all_tags( $description ) ) );
1249
  $extra_title_len = (int) $extra_title_len;
1250
  $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
1251
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
@@ -2475,6 +2475,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2475
  }
2476
  $description = $this->internationalize( $description );
2477
  }
 
2478
  if ( empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ) ) {
2479
  $description = $this->trim_excerpt_without_filters( $description );
2480
  }
@@ -2535,7 +2536,12 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2535
  }
2536
 
2537
  /**
2538
- * @param $post
 
 
 
 
 
2539
  *
2540
  * @return mixed|string
2541
  */
@@ -2563,10 +2569,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2563
  }
2564
  }
2565
 
2566
- // Internal whitespace trim.
2567
- $description = preg_replace( '/\s\s+/u', ' ', $description );
2568
-
2569
- return $description;
2570
  }
2571
 
2572
  /**
@@ -3572,6 +3575,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3572
  return preg_replace( '/<title([^>]*?)\s*>([^<]*?)<\/title\s*>/is', '<title\\1>' . preg_replace( '/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . '</title>', $content, 1 );
3573
  }
3574
 
 
 
 
 
 
3575
  function add_hooks() {
3576
  global $aioseop_options, $aioseop_update_checker;
3577
 
@@ -3613,6 +3621,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3613
  add_action( 'amp_post_template_head', array( $this, 'amp_head' ), 11 );
3614
  add_action( 'template_redirect', array( $this, 'template_redirect' ), 0 );
3615
  }
 
3616
  }
3617
 
3618
  function visibility_warning() {
@@ -4522,14 +4531,30 @@ EOF;
4522
  if ( ! empty( $blog_page ) ) {
4523
  $post = $blog_page;
4524
  }
 
4525
  if ( ! is_home() || ( ! is_front_page() && ! is_home() ) ) {
4526
- // Don't show if we're on the home page and the home page is the latest posts.
4527
- $wp_admin_bar->add_menu( array(
4528
- 'id' => 'aiosp_edit_' . $post->ID,
4529
- 'parent' => AIOSEOP_PLUGIN_DIRNAME,
4530
- 'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
4531
- 'href' => get_edit_post_link( $post->ID ) . '#aiosp',
4532
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4533
  }
4534
  }
4535
  }
@@ -4808,6 +4833,41 @@ EOF;
4808
  function display_settings_footer() {
4809
  }
4810
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4811
  function display_right_sidebar() {
4812
  global $wpdb;
4813
 
161
  'description_format' => __( 'This controls the format of Meta Descriptions.The following macros are supported:', 'all-in-one-seo-pack' ) .
162
  '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
163
  __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . '</li><li>' .
164
+ __( '%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>' .
165
  __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . '</li><li>' .
166
  __( '%wp_title% - The original WordPress title, e.g. post_title for posts', 'all-in-one-seo-pack' ) . '</li><li>' .
167
  __( '%current_date% - The current date (localized)', 'all-in-one-seo-pack' ) . '</li></ul>',
216
  'paginated_noindex' => __( 'Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
217
  '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' ),
218
  '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' ),
219
+ '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' ),
220
  'run_shortcodes' => __( 'Check this and shortcodes will get executed for descriptions auto-generated from content.', 'all-in-one-seo-pack' ),
221
  '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' ),
222
  'dont_truncate_descriptions' => __( 'Check this to prevent your Description from being truncated regardless of its length.', 'all-in-one-seo-pack' ),
1245
  $extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
1246
  }
1247
 
1248
+ $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( $description ) );
1249
  $extra_title_len = (int) $extra_title_len;
1250
  $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
1251
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
2475
  }
2476
  $description = $this->internationalize( $description );
2477
  }
2478
+ $description = htmlspecialchars( wp_strip_all_tags( htmlspecialchars_decode( $description ) ) );
2479
  if ( empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ) ) {
2480
  $description = $this->trim_excerpt_without_filters( $description );
2481
  }
2536
  }
2537
 
2538
  /**
2539
+ * Gets post description.
2540
+ * Auto-generates description if settings are ON.
2541
+ *
2542
+ * @since 2.3.13 #899 Fixes non breacking space, applies filter "aioseop_description".
2543
+ *
2544
+ * @param object $post Post object.
2545
  *
2546
  * @return mixed|string
2547
  */
2569
  }
2570
  }
2571
 
2572
+ return apply_filters( 'aioseop_description', $description );
 
 
 
2573
  }
2574
 
2575
  /**
3575
  return preg_replace( '/<title([^>]*?)\s*>([^<]*?)<\/title\s*>/is', '<title\\1>' . preg_replace( '/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . '</title>', $content, 1 );
3576
  }
3577
 
3578
+ /**
3579
+ * Adds wordpress hooks.
3580
+ *
3581
+ * @since 2.3.13 #899 Adds filter:aioseop_description.
3582
+ */
3583
  function add_hooks() {
3584
  global $aioseop_options, $aioseop_update_checker;
3585
 
3621
  add_action( 'amp_post_template_head', array( $this, 'amp_head' ), 11 );
3622
  add_action( 'template_redirect', array( $this, 'template_redirect' ), 0 );
3623
  }
3624
+ add_filter( 'aioseop_description', array( &$this, 'filter_description' ) );
3625
  }
3626
 
3627
  function visibility_warning() {
4531
  if ( ! empty( $blog_page ) ) {
4532
  $post = $blog_page;
4533
  }
4534
+ // Don't show if we're on the home page and the home page is the latest posts.
4535
  if ( ! is_home() || ( ! is_front_page() && ! is_home() ) ) {
4536
+ global $wp_the_query;
4537
+ $current_object = $wp_the_query->get_queried_object();
4538
+
4539
+ if ( ! empty( $current_object ) && ! empty( $current_object->post_type ) ){
4540
+ // Try the main query.
4541
+ $edit_post_link = get_edit_post_link( $current_object->ID );
4542
+ echo $edit_post_link;
4543
+ $wp_admin_bar->add_menu( array(
4544
+ 'id' => 'aiosp_edit_' . $current_object->ID,
4545
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
4546
+ 'title' => 'Edit SEO',
4547
+ 'href' => $edit_post_link . '#aiosp'
4548
+ ) );
4549
+ }else{
4550
+ // Try the post object.
4551
+ $wp_admin_bar->add_menu( array(
4552
+ 'id' => 'aiosp_edit_' . $post->ID,
4553
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
4554
+ 'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
4555
+ 'href' => get_edit_post_link( $post->ID ) . '#aiosp',
4556
+ ) );
4557
+ }
4558
  }
4559
  }
4560
  }
4833
  function display_settings_footer() {
4834
  }
4835
 
4836
+ /**
4837
+ * Filters meta value and applies generic cleanup.
4838
+ * - Decode HTML entities.
4839
+ * - Removal of urls.
4840
+ * - Internal trim.
4841
+ * - External trim.
4842
+ * - Strips HTML.
4843
+ * Returns cleaned value.
4844
+ *
4845
+ * @since 2.3.13
4846
+ *
4847
+ * @param string $value Value to filter.
4848
+ *
4849
+ * @return string
4850
+ */
4851
+ public function filter_description( $value) {
4852
+ // Decode entities
4853
+ $value = html_entity_decode( $value );
4854
+ $value = preg_replace(
4855
+ array(
4856
+ '@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@',// Remove URLs
4857
+ ),
4858
+ array(
4859
+ '', // Replacement URLs
4860
+ ),
4861
+ $value
4862
+ );
4863
+ // Strip html
4864
+ $value = wp_strip_all_tags( $value );
4865
+ // Internal whitespace trim.
4866
+ $value = preg_replace( '/\s\s+/u', ' ', $value );
4867
+ // External trim.
4868
+ return trim( $value );
4869
+ }
4870
+
4871
  function display_right_sidebar() {
4872
  global $wpdb;
4873
 
all_in_one_seo_pack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: All In One SEO Pack
4
  Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
5
  Description: Out-of-the-box SEO for your WordPress blog. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. More than 30 million downloads since 2007.
6
- Version: 2.3.12.5
7
  Author: Michael Torbert
8
  Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
9
  Text Domain: all-in-one-seo-pack
3
  Plugin Name: All In One SEO Pack
4
  Plugin URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
5
  Description: Out-of-the-box SEO for your WordPress blog. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. More than 30 million downloads since 2007.
6
+ Version: 2.3.13
7
  Author: Michael Torbert
8
  Author URI: https://semperplugins.com/all-in-one-seo-pack-pro-version/
9
  Text Domain: all-in-one-seo-pack
css/modules/aioseop_module.css CHANGED
@@ -361,6 +361,10 @@ div.aioseop_tip_icon:before {
361
  margin-top: 20px;
362
  }
363
 
 
 
 
 
364
  .aioseop_option_label {
365
  float: left;
366
  margin: 0;
361
  margin-top: 20px;
362
  }
363
 
364
+ .aioseop_translations {
365
+ margin-top: 15px;
366
+ }
367
+
368
  .aioseop_option_label {
369
  float: left;
370
  margin: 0;
modules/aioseop_importer_exporter.php CHANGED
@@ -120,12 +120,11 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Importer_Exporter' ) ) {
120
 
121
  function debug_post_types() {
122
  $post_types = $this->get_post_type_titles();
123
- $rempost = array(
124
- 'attachment' => 1,
125
- 'revision' => 1,
126
- 'nav_menu_item' => 1,
127
- 'custom_css' => 1,
128
  'customize_changeset' => 1,
 
 
 
129
  );
130
  $this->default_options['export_post_types']['initial_options'] = array_diff_key(
131
  $post_types,
@@ -201,7 +200,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Importer_Exporter' ) ) {
201
 
202
  if ( is_array( $this->warnings ) ) {
203
  foreach ( $this->warnings as $warning ) {
204
- echo "<p>" . esc_html( $warning ) . "</p>";
205
  }
206
  }
207
  echo '</div>';
@@ -493,7 +492,14 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Importer_Exporter' ) ) {
493
  }
494
  }
495
  } catch ( Exception $e ) {
 
 
496
  $this->warnings[] = $e->getMessage();
 
 
 
 
 
497
  }
498
 
499
  // Shows all errors found
120
 
121
  function debug_post_types() {
122
  $post_types = $this->get_post_type_titles();
123
+ $rempost = array(
 
 
 
 
124
  'customize_changeset' => 1,
125
+ 'custom_css' => 1,
126
+ 'revision' => 1,
127
+ 'nav_menu_item' => 1,
128
  );
129
  $this->default_options['export_post_types']['initial_options'] = array_diff_key(
130
  $post_types,
200
 
201
  if ( is_array( $this->warnings ) ) {
202
  foreach ( $this->warnings as $warning ) {
203
+ echo "<p>" . wp_kses( wp_unslash( $warning ), 'b, strong, i, em' ) . "</p>";
204
  }
205
  }
206
  echo '</div>';
492
  }
493
  }
494
  } catch ( Exception $e ) {
495
+ // Shows only one warning when compromised file is imported
496
+ $this->warnings = array();
497
  $this->warnings[] = $e->getMessage();
498
+ add_action(
499
+ $this->prefix . 'settings_header_errors',
500
+ array( $this, 'show_import_warnings' )
501
+ );
502
+ break;
503
  }
504
 
505
  // Shows all errors found
modules/aioseop_opengraph.php CHANGED
@@ -729,6 +729,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
729
  }
730
 
731
  function filter_settings( $settings, $location, $current ) {
 
732
  if ( $location == 'opengraph' || $location == 'settings' ) {
733
  $prefix = $this->get_prefix( $location ) . $location . '_';
734
  if ( $location == 'opengraph' ) {
@@ -756,10 +757,27 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
756
  if ( isset( $this->options["aiosp_opengraph_defcard"] ) ) {
757
  $settings[ $prefix . 'setcard' ]['default'] = $this->options["aiosp_opengraph_defcard"];
758
  }
759
- global $aiosp;
760
  $info = $aiosp->get_page_snippet_info();
761
  extract( $info );
762
- $settings["{$prefix}title"]['placeholder'] = $title;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
  $settings["{$prefix}desc"]['placeholder'] = $description;
764
  }
765
  if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] ) {
@@ -879,6 +897,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
879
  *
880
  * @since 1.0.0
881
  * @since 2.3.11.5 Support for multiple fb_admins.
 
882
  */
883
  function add_meta() {
884
  global $post, $aiosp, $aioseop_options, $wp_query;
@@ -1198,6 +1217,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
1198
  $twitter_thumbnail = set_url_scheme( $metabox['aioseop_opengraph_settings_customimg_twitter'] );
1199
  }
1200
 
 
 
 
1201
  $meta = Array(
1202
  'facebook' => Array(
1203
  'title' => 'og:title',
@@ -1258,12 +1280,12 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
1258
  * This is to accomodate multiple fb:admins on separate lines.
1259
  * @TODO Eventually we'll want to put this in its own function so things like images work too.
1260
  */
1261
- if( 'key' === $k ){
1262
  $fbadmins = explode( ',', str_replace(' ', '', $filtered_value[0] ) ); // Trim spaces then turn comma-separated values into an array.
1263
  foreach( $fbadmins as $fbadmin){
1264
  echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . $fbadmin . '" />' . "\n";
1265
  }
1266
- }else{
1267
  // For everything else.
1268
  foreach ( $filtered_value as $f ) {
1269
  echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . $f . '" />' . "\n";
729
  }
730
 
731
  function filter_settings( $settings, $location, $current ) {
732
+ global $aiosp, $post;
733
  if ( $location == 'opengraph' || $location == 'settings' ) {
734
  $prefix = $this->get_prefix( $location ) . $location . '_';
735
  if ( $location == 'opengraph' ) {
757
  if ( isset( $this->options["aiosp_opengraph_defcard"] ) ) {
758
  $settings[ $prefix . 'setcard' ]['default'] = $this->options["aiosp_opengraph_defcard"];
759
  }
 
760
  $info = $aiosp->get_page_snippet_info();
761
  extract( $info );
762
+
763
+ // Description options
764
+ if ( is_object( $post ) )
765
+ // Always show excerpt
766
+ $description = empty( $this->options['aiosp_opengraph_generate_descriptions'] )
767
+ ? $aiosp->trim_excerpt_without_filters(
768
+ $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_excerpt ) ),
769
+ 1000
770
+ )
771
+ : $aiosp->trim_excerpt_without_filters(
772
+ $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ),
773
+ 1000
774
+ );
775
+
776
+ // Add filters
777
+ $description = apply_filters( 'aioseop_description', $description );
778
+ // Add placholders
779
+
780
+ $settings["{$prefix}title"]['placeholder'] = $title;
781
  $settings["{$prefix}desc"]['placeholder'] = $description;
782
  }
783
  if ( isset( $current[ $prefix . 'setmeta' ] ) && $current[ $prefix . 'setmeta' ] ) {
897
  *
898
  * @since 1.0.0
899
  * @since 2.3.11.5 Support for multiple fb_admins.
900
+ * @since 2.3.13 Adds filter:aioseop_description on description.
901
  */
902
  function add_meta() {
903
  global $post, $aiosp, $aioseop_options, $wp_query;
1217
  $twitter_thumbnail = set_url_scheme( $metabox['aioseop_opengraph_settings_customimg_twitter'] );
1218
  }
1219
 
1220
+ // Apply last filters.
1221
+ $description = apply_filters( 'aioseop_description', $description );
1222
+
1223
  $meta = Array(
1224
  'facebook' => Array(
1225
  'title' => 'og:title',
1280
  * This is to accomodate multiple fb:admins on separate lines.
1281
  * @TODO Eventually we'll want to put this in its own function so things like images work too.
1282
  */
1283
+ if ( 'key' === $k ){
1284
  $fbadmins = explode( ',', str_replace(' ', '', $filtered_value[0] ) ); // Trim spaces then turn comma-separated values into an array.
1285
  foreach( $fbadmins as $fbadmin){
1286
  echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . $fbadmin . '" />' . "\n";
1287
  }
1288
+ } else {
1289
  // For everything else.
1290
  foreach ( $filtered_value as $f ) {
1291
  echo '<meta ' . $tags[ $t ]['name'] . '="' . $v . '" ' . $tags[ $t ]['value'] . '="' . $f . '" />' . "\n";
modules/aioseop_performance.php CHANGED
@@ -80,6 +80,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
80
 
81
  $system_status = array(
82
  'status' => array( 'default' => '', 'type' => 'html', 'label' => 'none', 'save' => false ),
 
83
  );
84
 
85
  $this->layout['system_status'] = array(
@@ -151,6 +152,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
151
 
152
  function settings_page_init() {
153
  $this->default_options['status']['default'] = $this->get_serverinfo();
 
154
  }
155
 
156
  function menu_order() {
@@ -228,9 +230,15 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
228
  $ms = __( 'N/A', 'all-in-one-seo-pack' );
229
  }
230
 
231
- $siteurl = get_option( 'siteurl' );
232
- $homeurl = get_option( 'home' );
233
- $db_version = get_option( 'db_version' );
 
 
 
 
 
 
234
 
235
  $debug_info = array(
236
  __( 'Operating System', 'all-in-one-seo-pack' ) => PHP_OS,
@@ -253,6 +261,11 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
253
  __( 'WordPress DB Version', 'all-in-one-seo-pack' ) => $db_version,
254
  __( 'Multisite', 'all-in-one-seo-pack' ) => $ms,
255
  __( 'Active Theme', 'all-in-one-seo-pack' ) => $theme['Name'] . ' ' . $theme['Version'],
 
 
 
 
 
256
  );
257
  $debug_info['Active Plugins'] = null;
258
  $active_plugins = $inactive_plugins = array();
@@ -288,7 +301,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
288
  echo "<div class='sfwd_debug_error'>" . __( 'Form submission error: verification check failed.', 'all-in-one-seo-pack' ) . '</div>';
289
  break;
290
  }
291
- if ( $_REQUEST['sfwd_update_check'] ) {
292
  global $aioseop_update_checker;
293
  $aioseop_update_checker->checkForUpdates();
294
  echo "<div class='sfwd_debug_mail_sent'>" . sprintf( __( '%s has checked for updates.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ) . '</div>';
@@ -299,7 +312,32 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
299
  $email = sanitize_email( $_REQUEST['sfwd_debug_send_email'] );
300
  }
301
  if ( $email ) {
302
- if ( wp_mail( $email, sprintf( __( 'SFWD Debug Mail From Site %s.', 'all-in-one-seo-pack' ), $siteurl ), $mail_text ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  echo "<div class='sfwd_debug_mail_sent'>" . sprintf( __( 'Sent to %s.', 'all-in-one-seo-pack' ), $email ) . '</div>';
304
  } else {
305
  echo "<div class='sfwd_debug_error'>" . sprintf( __( 'Failed to send to %s.', 'all-in-one-seo-pack' ), $email ) . '</div>';
@@ -309,9 +347,14 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
309
  }
310
  }
311
  } while ( 0 ); // Control structure for use with break.
 
 
 
 
 
 
312
  $nonce = wp_create_nonce( 'sfwd-debug-nonce' );
313
- $buf = "<ul class='sfwd_debug_settings'>\n{$page_text}\n</ul>\n<p>\n" .
314
- '<input name="sfwd_debug_send_email" type="text" value="" placeholder="' . __( 'E-mail debug information', 'all-in-one-seo-pack' ) . '"><input name="sfwd_debug_nonce" type="hidden" value="' .
315
  $nonce . '"><input name="sfwd_debug_submit" type="submit" value="' . __( 'Submit', 'all-in-one-seo-pack' ) . '" class="button-primary">';
316
 
317
  if ( AIOSEOPPRO ) {
@@ -320,5 +363,25 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
320
 
321
  return $buf;
322
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  }
324
  }
80
 
81
  $system_status = array(
82
  'status' => array( 'default' => '', 'type' => 'html', 'label' => 'none', 'save' => false ),
83
+ 'send_email' => array( 'default' => '', 'type' => 'html', 'label' => 'none', 'save' => false ),
84
  );
85
 
86
  $this->layout['system_status'] = array(
152
 
153
  function settings_page_init() {
154
  $this->default_options['status']['default'] = $this->get_serverinfo();
155
+ $this->default_options['send_email']['default'] = $this->get_email_input();
156
  }
157
 
158
  function menu_order() {
230
  $ms = __( 'N/A', 'all-in-one-seo-pack' );
231
  }
232
 
233
+ $siteurl = get_option( 'siteurl' );
234
+ $homeurl = get_option( 'home' );
235
+ $db_version = get_option( 'db_version' );
236
+ $site_title = get_bloginfo( 'name' );
237
+ $language = get_bloginfo( 'language' );
238
+ $front_displays = get_option( 'show_on_front' );
239
+ $page_on_front = get_option( 'page_on_front' );
240
+ $blog_public = get_option( 'blog_public' );
241
+ $perm_struct = get_option( 'permalink_structure' );
242
 
243
  $debug_info = array(
244
  __( 'Operating System', 'all-in-one-seo-pack' ) => PHP_OS,
261
  __( 'WordPress DB Version', 'all-in-one-seo-pack' ) => $db_version,
262
  __( 'Multisite', 'all-in-one-seo-pack' ) => $ms,
263
  __( 'Active Theme', 'all-in-one-seo-pack' ) => $theme['Name'] . ' ' . $theme['Version'],
264
+ __( 'Site Title', 'all-in-one-seo-pack' ) => $site_title,
265
+ __( 'Site Language', 'all-in-one-seo-pack' ) => $language,
266
+ __( 'Front Page Displays', 'all-in-one-seo-pack' ) => $front_displays === 'page' ? $front_displays . ' [ID = ' . $page_on_front . ']' : $front_displays,
267
+ __( 'Search Engine Visibility', 'all-in-one-seo-pack' ) => $blog_public,
268
+ __( 'Permalink Setting', 'all-in-one-seo-pack' ) => $perm_struct,
269
  );
270
  $debug_info['Active Plugins'] = null;
271
  $active_plugins = $inactive_plugins = array();
301
  echo "<div class='sfwd_debug_error'>" . __( 'Form submission error: verification check failed.', 'all-in-one-seo-pack' ) . '</div>';
302
  break;
303
  }
304
+ if ( ! empty( $_REQUEST['sfwd_update_check'] ) ) {
305
  global $aioseop_update_checker;
306
  $aioseop_update_checker->checkForUpdates();
307
  echo "<div class='sfwd_debug_mail_sent'>" . sprintf( __( '%s has checked for updates.', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME ) . '</div>';
312
  $email = sanitize_email( $_REQUEST['sfwd_debug_send_email'] );
313
  }
314
  if ( $email ) {
315
+ $attachments = array();
316
+ $upload_dir = wp_upload_dir();
317
+ $dir = $upload_dir['basedir'] . '/aiosp-log/';
318
+ if ( wp_mkdir_p( $dir ) ) {
319
+ $file_path = $dir . 'settings_aioseop-' . date( 'Y-m-d' ) . '-' . time() . '.ini';
320
+ if ( ! file_exists( $file_path ) ) {
321
+ if ( $file_handle = @fopen( $file_path, 'w' ) ) {
322
+ global $aiosp;
323
+ $buf = '; ' . __(
324
+ 'Settings export file for All in One SEO Pack', 'all-in-one-seo-pack'
325
+ ) . "\n";
326
+
327
+ // Adds all settings and posts data to settings file
328
+ add_filter( 'aioseop_export_settings_exporter_post_types', array( $this, 'get_exporter_post_types' ) );
329
+ add_filter( 'aioseop_export_settings_exporter_choices', array( $this, 'get_exporter_choices' ) );
330
+
331
+ $buf = $aiosp->settings_export( $buf );
332
+ $buf = apply_filters( 'aioseop_export_settings', $buf );
333
+ fwrite( $file_handle, $buf );
334
+ fclose( $file_handle );
335
+ $attachments[] = $file_path;
336
+ }
337
+ }
338
+ }
339
+
340
+ if ( wp_mail( $email, sprintf( __( 'SFWD Debug Mail From Site %s.', 'all-in-one-seo-pack' ), $siteurl ), $mail_text, '', $attachments ) ) {
341
  echo "<div class='sfwd_debug_mail_sent'>" . sprintf( __( 'Sent to %s.', 'all-in-one-seo-pack' ), $email ) . '</div>';
342
  } else {
343
  echo "<div class='sfwd_debug_error'>" . sprintf( __( 'Failed to send to %s.', 'all-in-one-seo-pack' ), $email ) . '</div>';
347
  }
348
  }
349
  } while ( 0 ); // Control structure for use with break.
350
+ $buf = "<ul class='sfwd_debug_settings'>\n{$page_text}\n</ul>\n";
351
+
352
+ return $buf;
353
+ }
354
+
355
+ function get_email_input() {
356
  $nonce = wp_create_nonce( 'sfwd-debug-nonce' );
357
+ $buf = '<input name="sfwd_debug_send_email" type="text" value="" placeholder="' . __( 'E-mail debug information', 'all-in-one-seo-pack' ) . '"><input name="sfwd_debug_nonce" type="hidden" value="' .
 
358
  $nonce . '"><input name="sfwd_debug_submit" type="submit" value="' . __( 'Submit', 'all-in-one-seo-pack' ) . '" class="button-primary">';
359
 
360
  if ( AIOSEOPPRO ) {
363
 
364
  return $buf;
365
  }
366
+
367
+ function get_exporter_choices() {
368
+ return array( 1, 2 );
369
+ }
370
+
371
+ function get_exporter_post_types() {
372
+ $post_types = $this->get_post_type_titles();
373
+ $rempost = array(
374
+ 'customize_changeset' => 1,
375
+ 'custom_css' => 1,
376
+ 'revision' => 1,
377
+ 'nav_menu_item' => 1,
378
+ );
379
+ $post_types = array_diff_key(
380
+ $post_types,
381
+ $rempost
382
+ );
383
+
384
+ return array_keys( $post_types );
385
+ }
386
  }
387
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtor
4
  Tags: seo, all in one seo, google, twitter, page, image seo, social, search engine optimization, sitemap, WordPress SEO, meta, meta description, xml sitemap, google sitemap, sitemaps, robots meta, yahoo, bing, news sitemaps, multisite, canonical, nofollow, noindex, keywords, description, webmaster tools, google webmaster tools, google analytics
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
- Stable tag: 2.3.12.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -130,7 +130,4 @@ enhancements:
130
  -Update for Social Meta Module - Photo Twitter Card
131
  -Add support for the full set of Twitter meta tags (https://dev.twitter.com/cards/markup)
132
  -Bugfix for issue with Nonindex options for post types
133
- -Bugfix for schema.org OG markup
134
-
135
-
136
-
4
  Tags: seo, all in one seo, google, twitter, page, image seo, social, search engine optimization, sitemap, WordPress SEO, meta, meta description, xml sitemap, google sitemap, sitemaps, robots meta, yahoo, bing, news sitemaps, multisite, canonical, nofollow, noindex, keywords, description, webmaster tools, google webmaster tools, google analytics
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
+ Stable tag: 2.3.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
130
  -Update for Social Meta Module - Photo Twitter Card
131
  -Add support for the full set of Twitter meta tags (https://dev.twitter.com/cards/markup)
132
  -Bugfix for issue with Nonindex options for post types
133
+ -Bugfix for schema.org OG markup