All in One SEO Pack - Version 2.4

Version Description

Download this release

Release Info

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

Code changes from version 2.3.16 to 2.4

admin/aioseop_module_class.php CHANGED
@@ -1338,8 +1338,12 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1338
  }
1339
 
1340
  /**
1341
- * @param null $options
1342
- * @param null $p
 
 
 
 
1343
  *
1344
  * @return array
1345
  */
@@ -1386,10 +1390,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1386
  }
1387
 
1388
  if ( ! empty( $meta_key ) && ! empty( $post ) ) {
1389
- $meta_key = explode( ',', $meta_key );
1390
  $image = $this->get_the_image_by_meta_key( array(
1391
  'post_id' => $post->ID,
1392
- 'meta_key' => $meta_key,
1393
  ) );
1394
  if ( ! empty( $image ) ) {
1395
  $img[] = array( 'type' => 'meta_key', 'id' => $meta_key, 'link' => $image );
1338
  }
1339
 
1340
  /**
1341
+ * Returns available social seo images.
1342
+ *
1343
+ * @since 2.4 #1079 Fixes array_flip warning on opengraph module.
1344
+ *
1345
+ * @param array $options Plugin/module options.
1346
+ * @param object $p Post.
1347
  *
1348
  * @return array
1349
  */
1390
  }
1391
 
1392
  if ( ! empty( $meta_key ) && ! empty( $post ) ) {
 
1393
  $image = $this->get_the_image_by_meta_key( array(
1394
  'post_id' => $post->ID,
1395
+ 'meta_key' => explode( ',', $meta_key ),
1396
  ) );
1397
  if ( ! empty( $image ) ) {
1398
  $img[] = array( 'type' => 'meta_key', 'id' => $meta_key, 'link' => $image );
aioseop_class.php CHANGED
@@ -54,6 +54,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
54
 
55
  /**
56
  * All_in_One_SEO_Pack constructor.
 
 
57
  */
58
  function __construct() {
59
  global $aioseop_options;
@@ -1161,6 +1163,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1161
  /**
1162
  * Use custom callback for outputting snippet
1163
  *
 
 
1164
  * @param $buf
1165
  * @param $args
1166
  *
@@ -1178,10 +1182,16 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1178
  }
1179
 
1180
  if ( $this->strlen( $title ) > 70 ) {
1181
- $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
 
 
 
1182
  }
1183
  if ( $this->strlen( $description ) > 156 ) {
1184
- $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
 
 
 
1185
  }
1186
  $extra_title_len = 0;
1187
  if ( empty( $title_format ) ) {
@@ -1263,12 +1273,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1263
 
1264
  $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
1265
  $title = $title_format;
1266
- $extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
1267
  }
1268
 
1269
  $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( $description ) );
1270
- $extra_title_len = (int) $extra_title_len;
1271
- $args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
1272
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
1273
 
1274
  return $buf;
@@ -2425,6 +2434,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2425
 
2426
  /**
2427
  * @since 2.3.14 #932 Adds filter "aioseop_description", removes extra filtering.
 
2428
  *
2429
  * @param null $post
2430
  *
@@ -2460,11 +2470,12 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2460
  }
2461
  $description = $this->internationalize( $description );
2462
  }
2463
- if ( empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ) ) {
2464
- $description = $this->trim_excerpt_without_filters( $description );
2465
- }
2466
 
2467
- return apply_filters( 'aioseop_description', $description );
 
 
 
 
2468
  }
2469
 
2470
  /**
@@ -2525,6 +2536,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2525
  *
2526
  * @since 2.3.13 #899 Fixes non breacking space, applies filter "aioseop_description".
2527
  * @since 2.3.14 #932 Removes filter "aioseop_description".
 
2528
  *
2529
  * @param object $post Post object.
2530
  *
@@ -2549,8 +2561,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2549
  if ( ! empty( $aioseop_options['aiosp_run_shortcodes'] ) ) {
2550
  $content = do_shortcode( $content );
2551
  }
2552
- $content = wp_strip_all_tags( $content );
2553
- $description = $this->trim_excerpt_without_filters( $this->internationalize( $content ) );
2554
  }
2555
  }
2556
 
@@ -3283,6 +3294,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3283
  }
3284
 
3285
  /**
 
 
3286
  * @param $settings
3287
  * @param $location
3288
  * @param $current
@@ -3331,8 +3344,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3331
  global $post;
3332
  $info = $this->get_page_snippet_info();
3333
  extract( $info );
3334
- $settings["{$prefix}title"]['placeholder'] = $title;
3335
- $settings["{$prefix}description"]['placeholder'] = $description;
3336
  $settings["{$prefix}keywords"]['placeholder'] = $keywords;
3337
  }
3338
 
@@ -3573,6 +3586,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3573
  *
3574
  * @since 2.3.13 #899 Adds filter:aioseop_description.
3575
  * @since 2.3.14 #593 Adds filter:aioseop_title.
 
3576
  */
3577
  function add_hooks() {
3578
  global $aioseop_options, $aioseop_update_checker;
@@ -3615,7 +3629,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3615
  add_action( 'amp_post_template_head', array( $this, 'amp_head' ), 11 );
3616
  add_action( 'template_redirect', array( $this, 'template_redirect' ), 0 );
3617
  }
3618
- add_filter( 'aioseop_description', array( &$this, 'filter_description' ) );
3619
  add_filter( 'aioseop_title', array( &$this, 'filter_title' ) );
3620
  }
3621
 
@@ -4891,12 +4905,14 @@ EOF;
4891
  * @since 2.3.14 Strips excerpt anchor texts.
4892
  * @since 2.3.14 Encodes to SEO ready HTML entities.
4893
  * @since 2.3.14 #593 encode/decode refactored.
 
4894
  *
4895
- * @param string $value Value to filter.
 
4896
  *
4897
  * @return string
4898
  */
4899
- public function filter_description( $value) {
4900
  if ( preg_match( '/5.2[\s\S]+/', PHP_VERSION ) )
4901
  $value = htmlspecialchars( wp_strip_all_tags( htmlspecialchars_decode( $value ) ) );
4902
  // Decode entities
@@ -4914,12 +4930,15 @@ EOF;
4914
  );
4915
  // Strip html
4916
  $value = wp_strip_all_tags( $value );
4917
- // Encode to valid SEO html entities
4918
- $value = $this->seo_entity_encode( $value );
4919
  // Internal whitespace trim.
4920
  $value = preg_replace( '/\s\s+/u', ' ', $value );
4921
- // External trim.
4922
- return trim( $value );
 
 
 
4923
  }
4924
 
4925
  /**
@@ -4928,6 +4947,7 @@ EOF;
4928
  *
4929
  * @since 2.3.14
4930
  * @since 2.3.14.2 Hot fix on apostrophes.
 
4931
  *
4932
  * @param string $value Value to decode.
4933
  *
@@ -4939,7 +4959,7 @@ EOF;
4939
  array(
4940
  '/\“|\”|&#[xX]00022;|&#34;|&[lLrRbB](dquo|DQUO)(?:[rR])?;|&#[xX]0201[dDeE];'
4941
  .'|&[OoCc](pen|lose)[Cc]urly[Dd]ouble[Qq]uote;|&#822[012];|&#[xX]27;/', // Double quotes
4942
- '/&#8217;|&apos;/', // Apostrophes
4943
  ),
4944
  array(
4945
  '"', // Double quotes
54
 
55
  /**
56
  * All_in_One_SEO_Pack constructor.
57
+ *
58
+ * @since 2.3.14 #921 More google analytics options added.
59
  */
60
  function __construct() {
61
  global $aioseop_options;
1163
  /**
1164
  * Use custom callback for outputting snippet
1165
  *
1166
+ * @since 2.3.16 Decodes HTML entities on title, description and title length count.
1167
+ *
1168
  * @param $buf
1169
  * @param $args
1170
  *
1182
  }
1183
 
1184
  if ( $this->strlen( $title ) > 70 ) {
1185
+ $title = $this->trim_excerpt_without_filters(
1186
+ $this->html_entity_decode( $title ),
1187
+ 70
1188
+ ) . '...';
1189
  }
1190
  if ( $this->strlen( $description ) > 156 ) {
1191
+ $description = $this->trim_excerpt_without_filters(
1192
+ $this->html_entity_decode( $description ),
1193
+ 156
1194
+ ) . '...';
1195
  }
1196
  $extra_title_len = 0;
1197
  if ( empty( $title_format ) ) {
1273
 
1274
  $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
1275
  $title = $title_format;
1276
+ $extra_title_len = strlen( $this->html_entity_decode( str_replace( $replace_title, '', $title_format ) ) );
1277
  }
1278
 
1279
  $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( $description ) );
1280
+ $args['value'] .= '<script>var aiosp_title_extra = '. (int) $extra_title_len . ';</script>';
 
1281
  $buf = $this->get_option_row( $args['name'], $args['options'], $args );
1282
 
1283
  return $buf;
2434
 
2435
  /**
2436
  * @since 2.3.14 #932 Adds filter "aioseop_description", removes extra filtering.
2437
+ * @since 2.4 #951 Trim/truncates occurs inside filter "aioseop_description".
2438
  *
2439
  * @param null $post
2440
  *
2470
  }
2471
  $description = $this->internationalize( $description );
2472
  }
 
 
 
2473
 
2474
+ return apply_filters(
2475
+ 'aioseop_description',
2476
+ $description,
2477
+ empty( $aioseop_options['aiosp_dont_truncate_descriptions'] )
2478
+ );
2479
  }
2480
 
2481
  /**
2536
  *
2537
  * @since 2.3.13 #899 Fixes non breacking space, applies filter "aioseop_description".
2538
  * @since 2.3.14 #932 Removes filter "aioseop_description".
2539
+ * @since 2.4 #951 Removes "wp_strip_all_tags" and "trim_excerpt_without_filters", they are done later in filter.
2540
  *
2541
  * @param object $post Post object.
2542
  *
2561
  if ( ! empty( $aioseop_options['aiosp_run_shortcodes'] ) ) {
2562
  $content = do_shortcode( $content );
2563
  }
2564
+ $description =$this->internationalize( $content );
 
2565
  }
2566
  }
2567
 
3294
  }
3295
 
3296
  /**
3297
+ * @since 2.3.16 Forces HTML entity decode on placeholder values.
3298
+ *
3299
  * @param $settings
3300
  * @param $location
3301
  * @param $current
3344
  global $post;
3345
  $info = $this->get_page_snippet_info();
3346
  extract( $info );
3347
+ $settings["{$prefix}title"]['placeholder'] = $this->html_entity_decode( $title );
3348
+ $settings["{$prefix}description"]['placeholder'] = $this->html_entity_decode( $description );
3349
  $settings["{$prefix}keywords"]['placeholder'] = $keywords;
3350
  }
3351
 
3586
  *
3587
  * @since 2.3.13 #899 Adds filter:aioseop_description.
3588
  * @since 2.3.14 #593 Adds filter:aioseop_title.
3589
+ * @since 2.4 #951 Increases filter:aioseop_description arguments number.
3590
  */
3591
  function add_hooks() {
3592
  global $aioseop_options, $aioseop_update_checker;
3629
  add_action( 'amp_post_template_head', array( $this, 'amp_head' ), 11 );
3630
  add_action( 'template_redirect', array( $this, 'template_redirect' ), 0 );
3631
  }
3632
+ add_filter( 'aioseop_description', array( &$this, 'filter_description' ), 10, 2 );
3633
  add_filter( 'aioseop_title', array( &$this, 'filter_title' ) );
3634
  }
3635
 
4905
  * @since 2.3.14 Strips excerpt anchor texts.
4906
  * @since 2.3.14 Encodes to SEO ready HTML entities.
4907
  * @since 2.3.14 #593 encode/decode refactored.
4908
+ * @since 2.4 #951 Reorders filters/encodings/decondings applied and adds additional param.
4909
  *
4910
+ * @param string $value Value to filter.
4911
+ * @param bool $truncate Flag that indicates if value should be truncated/cropped.
4912
  *
4913
  * @return string
4914
  */
4915
+ public function filter_description( $value, $truncate = false ) {
4916
  if ( preg_match( '/5.2[\s\S]+/', PHP_VERSION ) )
4917
  $value = htmlspecialchars( wp_strip_all_tags( htmlspecialchars_decode( $value ) ) );
4918
  // Decode entities
4930
  );
4931
  // Strip html
4932
  $value = wp_strip_all_tags( $value );
4933
+ // External trim
4934
+ $value = trim( $value );
4935
  // Internal whitespace trim.
4936
  $value = preg_replace( '/\s\s+/u', ' ', $value );
4937
+ // Truncate / crop
4938
+ if ( ! empty( $truncate ) )
4939
+ $value = $this->trim_excerpt_without_filters( $value );
4940
+ // Encode to valid SEO html entities
4941
+ return $this->seo_entity_encode( $value );
4942
  }
4943
 
4944
  /**
4947
  *
4948
  * @since 2.3.14
4949
  * @since 2.3.14.2 Hot fix on apostrophes.
4950
+ * @since 2.3.16 &#039; Added to the list of apostrophes.
4951
  *
4952
  * @param string $value Value to decode.
4953
  *
4959
  array(
4960
  '/\“|\”|&#[xX]00022;|&#34;|&[lLrRbB](dquo|DQUO)(?:[rR])?;|&#[xX]0201[dDeE];'
4961
  .'|&[OoCc](pen|lose)[Cc]urly[Dd]ouble[Qq]uote;|&#822[012];|&#[xX]27;/', // Double quotes
4962
+ '/&#039;|&#8217;|&apos;/', // Apostrophes
4963
  ),
4964
  array(
4965
  '"', // Double quotes
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.16
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
@@ -31,14 +31,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
31
  * The original WordPress SEO plugin.
32
  *
33
  * @package All-in-One-SEO-Pack
34
- * @version 2.3.16
35
  */
36
 
37
  if ( ! defined( 'AIOSEOPPRO' ) ) {
38
  define( 'AIOSEOPPRO', false );
39
  }
40
  if ( ! defined( 'AIOSEOP_VERSION' ) ) {
41
- define( 'AIOSEOP_VERSION', '2.3.16' );
42
  }
43
  global $aioseop_plugin_name;
44
  $aioseop_plugin_name = 'All in One SEO Pack';
@@ -233,7 +233,7 @@ if ( AIOSEOPPRO ) {
233
  $aioseop_update_checker->license_key = '';
234
  }
235
  $aioseop_update_checker->options_page = AIOSEOP_PLUGIN_DIRNAME . "/aioseop_class.php";
236
- $aioseop_update_checker->renewal_page = 'https://semperplugins.com/all-in-one-seo-pack-pro-support-updates-renewal/';
237
 
238
  $aioseop_update_checker->addQueryArgFilter( array( $aioseop_update_checker, 'add_secret_key' ) );
239
  }
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.4
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
31
  * The original WordPress SEO plugin.
32
  *
33
  * @package All-in-One-SEO-Pack
34
+ * @version 2.4
35
  */
36
 
37
  if ( ! defined( 'AIOSEOPPRO' ) ) {
38
  define( 'AIOSEOPPRO', false );
39
  }
40
  if ( ! defined( 'AIOSEOP_VERSION' ) ) {
41
+ define( 'AIOSEOP_VERSION', '2.4' );
42
  }
43
  global $aioseop_plugin_name;
44
  $aioseop_plugin_name = 'All in One SEO Pack';
233
  $aioseop_update_checker->license_key = '';
234
  }
235
  $aioseop_update_checker->options_page = AIOSEOP_PLUGIN_DIRNAME . "/aioseop_class.php";
236
+ $aioseop_update_checker->renewal_page = 'https://semperplugins.com/all-in-one-seo-pack-pro-version/';
237
 
238
  $aioseop_update_checker->addQueryArgFilter( array( $aioseop_update_checker, 'add_secret_key' ) );
239
  }
css/modules/aioseop_module-rtl.css CHANGED
@@ -46,7 +46,6 @@
46
  }
47
 
48
  .aioseop input[type="text"] {
49
- height: 35px;
50
  padding: 2px 10px 2px 0
51
  }
52
 
@@ -317,4 +316,4 @@ form#aiosp_settings_form,
317
 
318
  #aioseop-about .aioseop_metabox_text ul {
319
  padding-right: 15px;
320
- }
46
  }
47
 
48
  .aioseop input[type="text"] {
 
49
  padding: 2px 10px 2px 0
50
  }
51
 
316
 
317
  #aioseop-about .aioseop_metabox_text ul {
318
  padding-right: 15px;
319
+ }
css/modules/aioseop_module.css CHANGED
@@ -32,23 +32,18 @@
32
  padding-top: 2px;
33
  outline: none;
34
  color: #888;
35
- border: 2px solid #888;
36
- border-radius: 33px;
37
- width: 22px;
38
- height: 20px;
39
  font-family: sans-serif;
40
  }
41
 
42
  .aioseop_help_text_link span {
43
- position: absolute;
44
- left: 21px;
45
  font-size: 14px;
46
  }
47
 
48
  .aioseop_help_text_link:before {
49
- content: '\a0?';
50
- color: #888;
51
- font-size: 19px;
 
52
  }
53
 
54
  #aioseop-support .aioseop_metabox_text,
@@ -92,10 +87,6 @@
92
  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==);
93
  }
94
 
95
- .aioseop_help_text_link.aioseop_meta_box_help:before {
96
- font-size: 14px;
97
- }
98
-
99
  .aioseop_meta_box_help > label {
100
  position: absolute;
101
  margin-left: 8px;
@@ -136,11 +127,16 @@ div.aioseop_tip_icon:before {
136
  position: relative;
137
  }
138
 
 
 
 
 
 
 
139
  .aioseop_label {
140
  color: #5F5F5F;
141
  font-weight: bold;
142
  line-height: 19px;
143
- padding-left: 10px; /*changed from 20px to 10px for certain language support*/
144
  display: inline-block;
145
  text-align: left;
146
  position: absolute;
@@ -152,7 +148,7 @@ div.aioseop_tip_icon:before {
152
 
153
  .aioseop_option_div {
154
  max-height: 360px;
155
- min-height: 43px;
156
  width: 95%;
157
  overflow-y: auto;
158
  }
@@ -163,6 +159,7 @@ div.aioseop_tip_icon:before {
163
 
164
  .aioseop input[type="text"] {
165
  color: #515151;
 
166
  padding: 10px 0 10px 10px;
167
  font-size: 14px;
168
  width: 95%;
@@ -182,7 +179,7 @@ div.aioseop_tip_icon:before {
182
  .aioseop_help_text_div {
183
  text-align: left;
184
  width: 100%;
185
- margin: 10px 0 10px 0;
186
  }
187
 
188
  .aioseop_help_text {
@@ -290,9 +287,6 @@ div.aioseop_tip_icon:before {
290
  clear: left;
291
  }
292
 
293
- .aioseop_options_wrapper {
294
- }
295
-
296
  .aioseop_options_wrapper .hndle {
297
  font-size: 15px;
298
  font-family: Georgia,
@@ -816,51 +810,6 @@ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
816
  /* max-width: 900px; */
817
  }
818
 
819
- #aiosp div.preview_snippet {
820
- border: 1px solid #ebebeb;
821
- padding: 15px 15px 20px 7px;
822
- background-color: #fff;
823
- }
824
-
825
- div#aioseop_snippet {
826
- font-family: arial, sans-serif;
827
- font-size: 13px;
828
- }
829
-
830
- div#aioseop_snippet > h3 {
831
- font-size: 16px;
832
- padding: 8px 0;
833
- border: 0;
834
- background: inherit;
835
- }
836
-
837
- div#aioseop_snippet > h3 > a {
838
- color: #12c;
839
- text-decoration: none;
840
- cursor: pointer;
841
- }
842
-
843
- div#aioseop_snippet > div {
844
- color: #222;
845
- max-width: 42em;
846
- }
847
-
848
- div#aioseop_snippet > div > div {
849
- display: block;
850
- margin-bottom: 1px;
851
- }
852
-
853
- div#aioseop_snippet > div > div > cite {
854
- color: #093;
855
- font-style: normal;
856
- }
857
-
858
- div#aioseop_snippet > div > span {
859
- margin: 0;
860
- padding: 0;
861
- border: 0;
862
- }
863
-
864
  #aiosp_sitemap_addl_pages,
865
  #aiosp_video_sitemap_addl_pages {
866
  clear: left;
@@ -1029,6 +978,11 @@ table.aioseop_table td, table.aioseop_table th {
1029
  height: 0;
1030
  }
1031
 
 
 
 
 
 
1032
  .aioseop_module.error.below-h2 {
1033
  padding: 5px 0;
1034
  margin: 0 477px 15px 0 !important;
@@ -1036,7 +990,6 @@ table.aioseop_table td, table.aioseop_table th {
1036
 
1037
  #aioseop_opengraph_settings .inside {
1038
  margin: 0;
1039
- padding: 0;
1040
  }
1041
 
1042
  #aioseop_opengraph_settings_image_wrapper img {
@@ -1061,7 +1014,7 @@ table.aioseop_table td, table.aioseop_table th {
1061
  }
1062
 
1063
  #aiosp {
1064
- width: 100%;
1065
  }
1066
 
1067
  .aioseop_input.aioseop_top_label .aioseop_option_input {
@@ -1199,37 +1152,21 @@ div.aioseop_notice a.aioseop_dismiss_link {
1199
  }
1200
 
1201
  .aioseop_header_tabs li a.aioseop_header_tab {
1202
- height: 18px;
1203
- font: 13px/18px Arial,
1204
- Helvetica,
1205
- sans-serif normal;
1206
  text-decoration: none;
1207
  margin: 5px 5px 0 0;
1208
- padding: 4px 5px 2px;
1209
  cursor: pointer;
1210
  -webkit-border-top-right-radius: 3px;
1211
  -webkit-border-top-left-radius: 3px;
1212
  border-top-right-radius: 3px;
1213
  border-top-left-radius: 3px;
1214
- background-color: rgb(255, 255, 255);
1215
- background-color: rgba(255, 255, 255, 0.5);
1216
  border: 1px solid #ccc;
1217
  color: #5F5F5F;
1218
  }
1219
 
1220
- /* Fix for Chrome */
1221
- @media screen and (-webkit-min-device-pixel-ratio:0) {
1222
-
1223
- .aioseop_header_tabs li a.aioseop_header_tab {
1224
- padding-bottom: 0;
1225
- }
1226
- }
1227
-
1228
- /* Fix for Safari */
1229
- _:-webkit-full-screen:not(:root:root), .aioseop_header_tabs li a.aioseop_header_tab {
1230
- padding-bottom: 2px;
1231
- }
1232
-
1233
  .aioseop_header_tabs li:first-child a.aioseop_header_tab {
1234
  border-left: solid 1px #CCC;
1235
  margin-left: 5px;
@@ -1239,7 +1176,7 @@ _:-webkit-full-screen:not(:root:root), .aioseop_header_tabs li a.aioseop_header_
1239
  border: solid 1px #CCC;
1240
  background-color: rgb(255, 255, 255);
1241
  background-color: rgba(255, 255, 255, 0.5);
1242
- padding-left: 5px;
1243
  }
1244
 
1245
  .aioseop_loading {
@@ -1335,3 +1272,134 @@ div.sfwd_debug_error {
1335
  margin-left: 20px !important;
1336
  margin-bottom: 10px !important;
1337
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  padding-top: 2px;
33
  outline: none;
34
  color: #888;
 
 
 
 
35
  font-family: sans-serif;
36
  }
37
 
38
  .aioseop_help_text_link span {
 
 
39
  font-size: 14px;
40
  }
41
 
42
  .aioseop_help_text_link:before {
43
+ content: "\f223";
44
+ font-size: 27px;
45
+ font-family: dashicons;
46
+ vertical-align: middle;
47
  }
48
 
49
  #aioseop-support .aioseop_metabox_text,
87
  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==);
88
  }
89
 
 
 
 
 
90
  .aioseop_meta_box_help > label {
91
  position: absolute;
92
  margin-left: 8px;
127
  position: relative;
128
  }
129
 
130
+ .aioseop_tabs .aioseop_meta_box_help,
131
+ .aioseop_tabs .aioseop_meta_box_help:active {
132
+ margin-top: 4px;
133
+ margin-right: 45px;
134
+ }
135
+
136
  .aioseop_label {
137
  color: #5F5F5F;
138
  font-weight: bold;
139
  line-height: 19px;
 
140
  display: inline-block;
141
  text-align: left;
142
  position: absolute;
148
 
149
  .aioseop_option_div {
150
  max-height: 360px;
151
+ min-height: 37px;
152
  width: 95%;
153
  overflow-y: auto;
154
  }
159
 
160
  .aioseop input[type="text"] {
161
  color: #515151;
162
+ height: 35px;
163
  padding: 10px 0 10px 10px;
164
  font-size: 14px;
165
  width: 95%;
179
  .aioseop_help_text_div {
180
  text-align: left;
181
  width: 100%;
182
+ margin: 0;
183
  }
184
 
185
  .aioseop_help_text {
287
  clear: left;
288
  }
289
 
 
 
 
290
  .aioseop_options_wrapper .hndle {
291
  font-size: 15px;
292
  font-family: Georgia,
810
  /* max-width: 900px; */
811
  }
812
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
813
  #aiosp_sitemap_addl_pages,
814
  #aiosp_video_sitemap_addl_pages {
815
  clear: left;
978
  height: 0;
979
  }
980
 
981
+ #aiosp_title_metabox #aiosp_force_rewrites_wrapper {
982
+ display: none;
983
+ height: 0;
984
+ }
985
+
986
  .aioseop_module.error.below-h2 {
987
  padding: 5px 0;
988
  margin: 0 477px 15px 0 !important;
990
 
991
  #aioseop_opengraph_settings .inside {
992
  margin: 0;
 
993
  }
994
 
995
  #aioseop_opengraph_settings_image_wrapper img {
1014
  }
1015
 
1016
  #aiosp {
1017
+ width: auto;
1018
  }
1019
 
1020
  .aioseop_input.aioseop_top_label .aioseop_option_input {
1152
  }
1153
 
1154
  .aioseop_header_tabs li a.aioseop_header_tab {
1155
+ font-size: 14px;
1156
+ line-height: 37px;
 
 
1157
  text-decoration: none;
1158
  margin: 5px 5px 0 0;
1159
+ padding: 10px;
1160
  cursor: pointer;
1161
  -webkit-border-top-right-radius: 3px;
1162
  -webkit-border-top-left-radius: 3px;
1163
  border-top-right-radius: 3px;
1164
  border-top-left-radius: 3px;
1165
+ background-color: #e5e5e5;
 
1166
  border: 1px solid #ccc;
1167
  color: #5F5F5F;
1168
  }
1169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1170
  .aioseop_header_tabs li:first-child a.aioseop_header_tab {
1171
  border-left: solid 1px #CCC;
1172
  margin-left: 5px;
1176
  border: solid 1px #CCC;
1177
  background-color: rgb(255, 255, 255);
1178
  background-color: rgba(255, 255, 255, 0.5);
1179
+ padding: 10px;
1180
  }
1181
 
1182
  .aioseop_loading {
1272
  margin-left: 20px !important;
1273
  margin-bottom: 10px !important;
1274
  }
1275
+
1276
+ /**
1277
+ * Edit Post screen specific styling
1278
+ *
1279
+ */
1280
+ .postbox-container .aioseop_option_div {
1281
+ width: 100%;
1282
+ }
1283
+
1284
+ .postbox-container .aioseop_option_div input[type="text"],
1285
+ .postbox-container .aioseop_option_div textarea {
1286
+ width: 99%;
1287
+ max-width: 900px;
1288
+ }
1289
+
1290
+ .postbox-container .aioseop_option_label {
1291
+ max-width: none;
1292
+ height: auto !important;
1293
+ }
1294
+
1295
+ .postbox-container .aioseop_wrapper {
1296
+ padding: 0;
1297
+ }
1298
+
1299
+ .postbox-container .aioseop_input {
1300
+ display: block;
1301
+ margin-bottom: 10px;
1302
+ padding: 0;
1303
+ }
1304
+
1305
+ .postbox-container .aioseop_option_input {
1306
+ width: 63%;
1307
+ padding: 0;
1308
+ }
1309
+
1310
+ .postbox-container div#aiosp_upgrade_wrapper {
1311
+ float: none;
1312
+ width: auto;
1313
+ margin: 0;
1314
+ padding: 0;
1315
+ }
1316
+
1317
+ .postbox-container div#aiosp_upgrade_wrapper .aioseop_input {
1318
+ display: block;
1319
+ padding: 0;
1320
+ }
1321
+
1322
+ .postbox-container div#aiosp_upgrade_wrapper .aioseop_input .aioseop_option_input {
1323
+ float: none;
1324
+ width: auto;
1325
+ padding: 0;
1326
+ }
1327
+
1328
+ .postbox-container div#aiosp_upgrade_wrapper .aioseop_input .aioseop_option_input .aioseop_option_div {
1329
+ width: auto;
1330
+ min-height: 0;
1331
+ padding: 10px 0;
1332
+ }
1333
+
1334
+ .aioseop_tabs .aioseop_options {
1335
+ margin: 0;
1336
+ }
1337
+
1338
+ #aioseop_opengraph_settings .aioseop_options {
1339
+ clear: both;
1340
+ margin-top: 35px;
1341
+ }
1342
+
1343
+ #aioseop_opengraph_settings .aioseop_option_input {
1344
+ width: 70%;
1345
+ }
1346
+
1347
+ /**
1348
+ * Preview Snippet styling
1349
+ *
1350
+ */
1351
+ div#aiosp_snippet_wrapper {
1352
+ border: 1px solid #888;
1353
+ clear: both;
1354
+ padding: 10px 10px 0;
1355
+ max-width: 97%;
1356
+ margin-bottom: 15px;
1357
+ }
1358
+
1359
+ div#aiosp_snippet_wrapper .aioseop_option_label {
1360
+ height: auto !important;
1361
+ }
1362
+
1363
+ div#aiosp_snippet_wrapper .aioseop_input.aioseop_top_label .aioseop_option_input {
1364
+ margin: 0;
1365
+ }
1366
+
1367
+ div#aioseop_snippet {
1368
+ font-family: arial, sans-serif;
1369
+ font-size: 13px;
1370
+ }
1371
+
1372
+ div#aioseop_snippet > h3 {
1373
+ margin: 10px 0 5px;
1374
+ font-size: 18px;
1375
+ border: 0;
1376
+ background: inherit;
1377
+ font-weight: normal;
1378
+ }
1379
+
1380
+ div#aioseop_snippet > h3 > a {
1381
+ color: #12c;
1382
+ text-decoration: none;
1383
+ cursor: pointer;
1384
+ }
1385
+
1386
+ div#aioseop_snippet > div {
1387
+ color: #545454;
1388
+ max-width: 48em;
1389
+ }
1390
+
1391
+ div#aioseop_snippet > div > div {
1392
+ display: block;
1393
+ margin-bottom: 1px;
1394
+ }
1395
+
1396
+ div#aioseop_snippet > div > div > cite {
1397
+ color: #093;
1398
+ font-style: normal;
1399
+ }
1400
+
1401
+ div#aioseop_snippet > div > span {
1402
+ margin: 0;
1403
+ padding: 0;
1404
+ border: 0;
1405
+ }
inc/commonstrings.php CHANGED
@@ -34,6 +34,7 @@ class AIOSP_Common_Strings {
34
  // Update checker strings (incomplete... need to separate out html).
35
  __( 'Purchase one now', 'all-in-one-seo-pack' );
36
  __( 'License Key is not set yet or invalid. ', 'all-in-one-seo-pack' );
 
37
  __( ' Need a license key?', 'all-in-one-seo-pack' );
38
  __( 'Notice: ', 'all-in-one-seo-pack' );
39
  __( 'Manage Licenses', 'all-in-one-seo-pack' );
@@ -47,12 +48,28 @@ class AIOSP_Common_Strings {
47
  __( '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' );
48
  __('%s is almost ready.', 'all-in-one-seo-pack' );
49
  __('You must <a href="%s">enter a valid License Key</a> for it to work.', 'all-in-one-seo-pack' );
50
- __( ' Need a license key?', 'all-in-one-seo-pack' );
51
- __( 'Purchase one now', 'all-in-one-seo-pack' );
52
  __( "There is a new version of %s available. Go to <a href='%s'>the plugins page</a> for details.", 'all-in-one-seo-pack' );
53
  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>' );
54
- __( 'Manage Licenses', 'all-in-one-seo-pack' );
55
- __( 'License Key is not set yet or invalid. ', 'all-in-one-seo-pack' );
56
- __( ' Need a license key?', 'all-in-one-seo-pack' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
  }
34
  // Update checker strings (incomplete... need to separate out html).
35
  __( 'Purchase one now', 'all-in-one-seo-pack' );
36
  __( 'License Key is not set yet or invalid. ', 'all-in-one-seo-pack' );
37
+ /* translators: Please mind the space at the beginning of the string. */
38
  __( ' Need a license key?', 'all-in-one-seo-pack' );
39
  __( 'Notice: ', 'all-in-one-seo-pack' );
40
  __( 'Manage Licenses', 'all-in-one-seo-pack' );
48
  __( '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' );
49
  __('%s is almost ready.', 'all-in-one-seo-pack' );
50
  __('You must <a href="%s">enter a valid License Key</a> for it to work.', 'all-in-one-seo-pack' );
 
 
51
  __( "There is a new version of %s available. Go to <a href='%s'>the plugins page</a> for details.", 'all-in-one-seo-pack' );
52
  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>' );
53
+ __( 'Track Outbound Forms:', 'all-in-one-seo-pack' );
54
+ __( 'Track Events:', 'all-in-one-seo-pack' );
55
+ __( 'Track URL Changes:', 'all-in-one-seo-pack' );
56
+ __( 'Track Page Visibility:', 'all-in-one-seo-pack' );
57
+ __( 'Track Media Query:', 'all-in-one-seo-pack' );
58
+ __( 'Track Elements Visibility:', 'all-in-one-seo-pack' );
59
+ __( 'Track Page Scrolling:', 'all-in-one-seo-pack' );
60
+ __( 'Track Facebook and Twitter:', 'all-in-one-seo-pack' );
61
+ __( 'Ensure URL Consistency:', 'all-in-one-seo-pack' );
62
+ __( 'Check this if you want to track outbound forms with Google Analytics.', 'all-in-one-seo-pack' );
63
+ __( 'Check this if you want to track events with Google Analytics.', 'all-in-one-seo-pack' );
64
+ __( 'Check this if you want to track URL changes for single pages with Google Analytics.', 'all-in-one-seo-pack' );
65
+ __( 'Check this if you want to track how long pages are in visible state with Google Analytics.', 'all-in-one-seo-pack' );
66
+ /* 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
67
+ 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. */
68
+ __( 'Check this if you want to track media query matching and queries with Google Analytics.', 'all-in-one-seo-pack' );
69
+ /* 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. */
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
  }
inc/sitemap-xsl.php CHANGED
@@ -143,9 +143,10 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
143
  <thead>
144
  <tr>
145
  <th width="50%">URL</th>
 
146
  <th>Priority</th>
147
  <th>Change Frequency</th>
148
- <th>LastChange</th>
149
  </tr>
150
  </thead>
151
  <tbody>
@@ -175,6 +176,9 @@ echo '<?xml version="1.0" encoding="UTF-8"?>';
175
  </xsl:if>
176
  </xsl:for-each>
177
  </td>
 
 
 
178
  <td>
179
  <xsl:if test="string(number(sitemap:priority))!='NaN'">
180
  <xsl:value-of select="concat(sitemap:priority*100,'%')"/>
143
  <thead>
144
  <tr>
145
  <th width="50%">URL</th>
146
+ <th>Images</th>
147
  <th>Priority</th>
148
  <th>Change Frequency</th>
149
+ <th>Last Change</th>
150
  </tr>
151
  </thead>
152
  <tbody>
176
  </xsl:if>
177
  </xsl:for-each>
178
  </td>
179
+ <td>
180
+ <xsl:value-of select="count(image:image)"/>
181
+ </td>
182
  <td>
183
  <xsl:if test="string(number(sitemap:priority))!='NaN'">
184
  <xsl:value-of select="concat(sitemap:priority*100,'%')"/>
modules/aioseop_sitemap.php CHANGED
@@ -10,6 +10,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
10
 
11
  /**
12
  * Class All_in_One_SEO_Pack_Sitemap
 
 
 
13
  */
14
  class All_in_One_SEO_Pack_Sitemap extends All_in_One_SEO_Pack_Module {
15
  var $cache_struct = null;
@@ -621,14 +624,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
621
  $url = aioseop_home_url( '/' . $options[ $this->prefix . 'filename' ] . '.xml' );
622
 
623
  $options[ $this->prefix . 'link' ] = sprintf( __( 'Click here to %s.', 'all-in-one-seo-pack' ), '<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'view your sitemap', 'all-in-one-seo-pack' ) . '</a>' );
624
- $options[ $this->prefix . 'link' ] .= __( ' Your sitemap has been created', 'all-in-one-seo-pack' );
625
  if ( '0' !== get_option( 'blog_public' ) ){
626
- $options[ $this->prefix . 'link' ] .= __( ' and changes are automatically submitted to search engines.', 'all-in-one-seo-pack' );
627
  }
628
- $options[ $this->prefix . 'link' ] .= '.';
629
-
630
-
631
-
632
 
633
  if ( $this->option_isset( 'rewrite' ) ) {
634
  $rule = $this->get_rewrite_url( $url );
@@ -1651,6 +1650,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1651
  );
1652
  }
1653
 
 
 
1654
  return $files;
1655
  }
1656
 
@@ -1818,13 +1819,14 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1818
  }
1819
  $prio = $this->get_all_post_priority_data( $options["{$this->prefix}posttypes"] );
1820
 
1821
- $home = array(
1822
- 'loc' => aioseop_home_url(),
1823
- 'priority' => $this->get_default_priority( 'homepage' ),
1824
- 'changefreq' => $this->get_default_frequency( 'homepage' ),
1825
- );
1826
 
1827
- $posts = $postspageid = get_option( 'page_for_posts' ); // It's 0 if posts are on homepage, otherwise it's the id of the posts page.
 
 
 
 
 
1828
 
1829
  $this->paginate = false;
1830
  if ( $posts ) {
@@ -1949,7 +1951,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
1949
 
1950
  $xml_header = '<?xml-stylesheet type="text/xsl" href="' . $xsl_url . '"?>' . "\r\n"
1951
  . '<urlset ';
1952
- $namespaces = apply_filters( $this->prefix . 'xml_namespace', array( 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9' ) );
 
 
 
1953
  if ( ! empty( $namespaces ) ) {
1954
  $ns = array();
1955
  foreach ( $namespaces as $k => $v ) {
@@ -2105,7 +2110,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2105
  } else {
2106
  $pr_info['changefreq'] = $def_freq;
2107
  }
2108
- $prio[] = $pr_info;
 
 
2109
  }
2110
  }
2111
 
@@ -2293,11 +2300,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2293
  function get_addl_pages() {
2294
  $home = array();
2295
  $home = array(
2296
- 'loc' => aioseop_home_url(),
2297
- 'priority' => $this->get_default_priority( 'homepage' ),
2298
- 'changefreq' => $this->get_default_frequency( 'homepage' ),
 
2299
  );
2300
- $posts = get_option( 'page_for_posts' );
 
2301
  if ( $posts ) {
2302
  $posts = $this->get_permalink( $posts );
2303
  if ( $posts == $home['loc'] ) {
@@ -2551,12 +2560,15 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2551
  }
2552
  if ( is_array( $posts ) ) {
2553
  foreach ( $posts as $post ) {
 
 
2554
  $url = '';
2555
  $post->filter = 'sample';
2556
  if ( 'get_permalink' === $linkfunc ) {
2557
  $url = $this->get_permalink( $post );
2558
  } else {
2559
  $url = call_user_func( $linkfunc, $post );
 
2560
  }
2561
  $date = $post->post_modified;
2562
  if ( '0000-00-00 00:00:00' === $date ) {
@@ -2596,7 +2608,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2596
  $pr_info['changefreq'] = $this->options[ $this->prefix . 'freq_post_' . $post->post_type ];
2597
  }
2598
  }
2599
- $pr_info = array( 'loc' => $url ) + $pr_info; // Prepend loc to the array.
 
 
 
2600
  if ( is_float( $pr_info['priority'] ) ) {
2601
  $pr_info['priority'] = sprintf( '%0.1F', $pr_info['priority'] );
2602
  }
@@ -2609,6 +2624,115 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
2609
 
2610
  return $prio;
2611
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2612
 
2613
  /**
2614
  * Return excluded categories for taxonomy queries.
10
 
11
  /**
12
  * Class All_in_One_SEO_Pack_Sitemap
13
+ *
14
+ * @since ?
15
+ * @since 2.4 Include images in sitemap.
16
  */
17
  class All_in_One_SEO_Pack_Sitemap extends All_in_One_SEO_Pack_Module {
18
  var $cache_struct = null;
624
  $url = aioseop_home_url( '/' . $options[ $this->prefix . 'filename' ] . '.xml' );
625
 
626
  $options[ $this->prefix . 'link' ] = sprintf( __( 'Click here to %s.', 'all-in-one-seo-pack' ), '<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'view your sitemap', 'all-in-one-seo-pack' ) . '</a>' );
627
+ $options[ $this->prefix . 'link' ] .= __( ' Your sitemap has been created with content and images.', 'all-in-one-seo-pack' );
628
  if ( '0' !== get_option( 'blog_public' ) ){
629
+ $options[ $this->prefix . 'link' ] .= ' ' . __( 'Changes are automatically submitted to search engines.', 'all-in-one-seo-pack' );
630
  }
 
 
 
 
631
 
632
  if ( $this->option_isset( 'rewrite' ) ) {
633
  $rule = $this->get_rewrite_url( $url );
1650
  );
1651
  }
1652
 
1653
+ $files = apply_filters( 'aioseop_sitemap_index_filenames', $files, $prefix, $suffix );
1654
+
1655
  return $files;
1656
  }
1657
 
1819
  }
1820
  $prio = $this->get_all_post_priority_data( $options["{$this->prefix}posttypes"] );
1821
 
1822
+ $posts = $postspageid = (int) get_option( 'page_for_posts' ); // It's 0 if posts are on homepage, otherwise it's the id of the posts page.
 
 
 
 
1823
 
1824
+ $home = array(
1825
+ 'loc' => aioseop_home_url(),
1826
+ 'priority' => $this->get_default_priority( 'homepage' ),
1827
+ 'changefreq' => $this->get_default_frequency( 'homepage' ),
1828
+ 'image:image' => $this->get_images_from_post( (int) get_option( 'page_on_front' ) ),
1829
+ );
1830
 
1831
  $this->paginate = false;
1832
  if ( $posts ) {
1951
 
1952
  $xml_header = '<?xml-stylesheet type="text/xsl" href="' . $xsl_url . '"?>' . "\r\n"
1953
  . '<urlset ';
1954
+ $namespaces = apply_filters( $this->prefix . 'xml_namespace', array(
1955
+ 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9',
1956
+ 'xmlns:image' => 'http://www.google.com/schemas/sitemap-image/1.1',
1957
+ ) );
1958
  if ( ! empty( $namespaces ) ) {
1959
  $ns = array();
1960
  foreach ( $namespaces as $k => $v ) {
2110
  } else {
2111
  $pr_info['changefreq'] = $def_freq;
2112
  }
2113
+
2114
+ $pr_info['image:image'] = $this->get_images_from_term( $term );
2115
+ $prio[] = $pr_info;
2116
  }
2117
  }
2118
 
2300
  function get_addl_pages() {
2301
  $home = array();
2302
  $home = array(
2303
+ 'loc' => aioseop_home_url(),
2304
+ 'priority' => $this->get_default_priority( 'homepage' ),
2305
+ 'changefreq' => $this->get_default_frequency( 'homepage' ),
2306
+ 'image:image' => $this->get_images_from_post( (int) get_option( 'page_on_front' ) ),
2307
  );
2308
+
2309
+ $posts = (int) get_option( 'page_for_posts' );
2310
  if ( $posts ) {
2311
  $posts = $this->get_permalink( $posts );
2312
  if ( $posts == $home['loc'] ) {
2560
  }
2561
  if ( is_array( $posts ) ) {
2562
  foreach ( $posts as $post ) {
2563
+ // Determine if we check the post for images.
2564
+ $is_single = true;
2565
  $url = '';
2566
  $post->filter = 'sample';
2567
  if ( 'get_permalink' === $linkfunc ) {
2568
  $url = $this->get_permalink( $post );
2569
  } else {
2570
  $url = call_user_func( $linkfunc, $post );
2571
+ $is_single = false;
2572
  }
2573
  $date = $post->post_modified;
2574
  if ( '0000-00-00 00:00:00' === $date ) {
2608
  $pr_info['changefreq'] = $this->options[ $this->prefix . 'freq_post_' . $post->post_type ];
2609
  }
2610
  }
2611
+ $pr_info = array(
2612
+ 'loc' => $url,
2613
+ 'image:image' => $is_single ? $this->get_images_from_post( $post ) : null,
2614
+ ) + $pr_info; // Prepend loc to the array.
2615
  if ( is_float( $pr_info['priority'] ) ) {
2616
  $pr_info['priority'] = sprintf( '%0.1F', $pr_info['priority'] );
2617
  }
2624
 
2625
  return $prio;
2626
  }
2627
+
2628
+ /**
2629
+ * Return the images attached to the term.
2630
+ *
2631
+ * @param WP_Term $term the term object.
2632
+ *
2633
+ * @since 2.4
2634
+ *
2635
+ * @return array
2636
+ */
2637
+ private function get_images_from_term( $term ) {
2638
+
2639
+ if ( false === apply_filters( 'aioseo_include_images_in_sitemap', true ) ) {
2640
+ return array();
2641
+ }
2642
+
2643
+ $images = array();
2644
+ $thumbnail_id = get_term_meta( $term->term_id, 'thumbnail_id', true );
2645
+ if ( $thumbnail_id ) {
2646
+ $image = wp_get_attachment_url( $thumbnail_id );
2647
+ if ( $image ) {
2648
+ $images['image:image'] = array(
2649
+ 'image:loc' => $image,
2650
+ );
2651
+ }
2652
+ }
2653
+
2654
+ return $images;
2655
+ }
2656
+
2657
+ /**
2658
+ * Return the images from the post.
2659
+ *
2660
+ * @param WP_Post $post the post object.
2661
+ *
2662
+ * @since 2.4
2663
+ *
2664
+ * @return array
2665
+ */
2666
+ private function get_images_from_post( $post ) {
2667
+
2668
+ if ( false === apply_filters( 'aioseo_include_images_in_sitemap', true ) ) {
2669
+ return array();
2670
+ }
2671
+
2672
+ $images = array();
2673
+
2674
+ if ( is_numeric( $post ) ) {
2675
+ if ( 0 === $post ) {
2676
+ return null;
2677
+ }
2678
+ $post = get_post( $post );
2679
+ }
2680
+
2681
+ if ( 'attachment' === $post->post_type ) {
2682
+ if ( false === strpos( $post->post_mime_type, 'image/' ) ) {
2683
+ // Ignore all attachments except images.
2684
+ return null;
2685
+ }
2686
+ $attributes = wp_get_attachment_image_src( $post->ID );
2687
+ if ( $attributes ) {
2688
+ $images[] = array(
2689
+ 'image:loc' => $attributes[0],
2690
+ );
2691
+ }
2692
+
2693
+ return $images;
2694
+ }
2695
+
2696
+ // Check featured image.
2697
+ $attached_url = get_the_post_thumbnail_url( $post->ID );
2698
+ if ( false !== $attached_url ) {
2699
+ $images[] = $attached_url;
2700
+ }
2701
+
2702
+ // Check images in the content.
2703
+ $content = $post->post_content;
2704
+ $total = substr_count( $content, '<img ' ) + substr_count( $content, '<IMG ' );
2705
+ if ( $total > 0 ) {
2706
+ $dom = new domDocument();
2707
+ // Non-compliant HTML might give errors, so ignore them.
2708
+ libxml_use_internal_errors( true );
2709
+ $dom->loadHTML( $content );
2710
+ libxml_clear_errors();
2711
+ // @codingStandardsIgnoreStart
2712
+ $dom->preserveWhiteSpace = false;
2713
+ // @codingStandardsIgnoreEnd
2714
+ $matches = $dom->getElementsByTagName( 'img' );
2715
+ foreach ( $matches as $match ) {
2716
+ $images[] = $match->getAttribute( 'src' );
2717
+ }
2718
+ }
2719
+
2720
+ if ( $images ) {
2721
+ $tmp = $images;
2722
+ if ( 1 < count( $images ) ) {
2723
+ // Filter out duplicates.
2724
+ $tmp = array_unique( $images );
2725
+ }
2726
+ $images = array();
2727
+ foreach ( $tmp as $image ) {
2728
+ $images[] = array(
2729
+ 'image:loc' => $image,
2730
+ );
2731
+ }
2732
+ }
2733
+
2734
+ return $images;
2735
+ }
2736
 
2737
  /**
2738
  * Return excluded categories for taxonomy queries.
public/google-analytics.php CHANGED
@@ -3,18 +3,45 @@
3
  if ( ! class_exists( 'aioseop_google_analytics' ) ) {
4
 
5
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/aioseop_module_class.php' ); // Include the module base class.
6
-
 
 
 
 
 
 
7
  class aioseop_google_analytics extends All_in_One_SEO_Pack_Module {
8
- // TODO Rather than extending the module base class, we should find a better way for the shared functions like moving them to our common functions class.
9
 
10
- function __construct() {
 
 
 
 
 
 
 
 
 
11
  $this->google_analytics();
12
  }
13
 
14
- function google_analytics() {
 
 
 
 
 
 
 
 
 
 
15
  global $aioseop_options;
16
- $analytics = '';
17
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_exclude_users'] ) && is_user_logged_in() ) {
 
 
 
18
  global $current_user;
19
  if ( empty( $current_user ) ) {
20
  wp_get_current_user();
@@ -30,64 +57,17 @@ if ( ! class_exists( 'aioseop_google_analytics' ) ) {
30
  ob_start();
31
  $analytics = $this->universal_analytics();
32
  echo $analytics;
33
-
34
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && $aioseop_options['aiosp_ga_track_outbound_links'] ) { ?>
35
- <script type="text/javascript">
36
- function recordOutboundLink(link, category, action) {
37
- ga('send', 'event', category, action);
38
- if (link.target == '_blank') return true;
39
- setTimeout('document.location = "' + link.href + '"', 100);
40
- return false;
41
- }
42
-
43
- /* use regular Javascript for this */
44
- function getAttr(ele, attr) {
45
- var result = (ele.getAttribute && ele.getAttribute(attr)) || null;
46
- if (!result) {
47
- var attrs = ele.attributes;
48
- var length = attrs.length;
49
- for (var i = 0; i < length; i++)
50
- if (attr[i].nodeName === attr) result = attr[i].nodeValue;
51
- }
52
- return result;
53
- }
54
-
55
- function aiosp_addLoadEvent(func) {
56
- var oldonload = window.onload;
57
- if (typeof window.onload != 'function') {
58
- window.onload = func;
59
- } else {
60
- window.onload = function () {
61
- if (oldonload) {
62
- oldonload();
63
- }
64
- func();
65
- }
66
- }
67
- }
68
-
69
- function aiosp_addEvent(element, evnt, funct) {
70
- if (element.attachEvent)
71
- return element.attachEvent('on' + evnt, funct);
72
- else
73
- return element.addEventListener(evnt, funct, false);
74
- }
75
-
76
- aiosp_addLoadEvent(function () {
77
- var links = document.getElementsByTagName('a');
78
- for (var x = 0; x < links.length; x++) {
79
- if (typeof links[x] == 'undefined') continue;
80
- aiosp_addEvent(links[x], 'onclick', function () {
81
- var mydomain = new RegExp(document.domain, 'i');
82
- href = getAttr(this, 'href');
83
- if (href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
84
- recordOutboundLink(this, 'Outbound Links', href);
85
- }
86
- });
87
- }
88
- });
89
- </script>
90
- <?php
91
  }
92
  $analytics = ob_get_clean();
93
  }
@@ -97,29 +77,31 @@ if ( ! class_exists( 'aioseop_google_analytics' ) ) {
97
  }
98
 
99
  /**
100
- * Handle Universal Analytics.
 
101
  *
102
- * @since ?
103
  * @since 2.3.15 Added aioseop_ga_attributes filter hook for attributes.
 
104
  *
105
- * @return string
106
  */
107
- function universal_analytics() {
108
  global $aioseop_options;
109
- $analytics = '';
110
  $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
111
  if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) {
112
  $cookie_domain = $this->get_analytics_domain();
113
  }
114
  if ( ! empty( $cookie_domain ) ) {
115
  $cookie_domain = esc_js( $cookie_domain );
116
- $cookie_domain = "'cookieDomain': '{$cookie_domain}'";
117
  }
118
  if ( empty( $cookie_domain ) ) {
119
- $domain = ", 'auto'";
120
  }
121
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
122
- $allow_linker = "'allowLinker': true"; // This is put into $js_options later.
 
 
123
  if ( ! empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) {
124
  $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] );
125
  $addl_domains = preg_split( '/[\s,]+/', $addl_domains );
@@ -130,72 +112,59 @@ if ( ! class_exists( 'aioseop_google_analytics' ) ) {
130
  if ( ! empty( $domain_list ) ) {
131
  $domain_list .= ', ';
132
  }
133
- $domain_list .= "'" . $d . "'";
134
  }
135
  }
136
  }
137
  }
138
  }
139
- $extra_options = '';
140
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
141
- $extra_options .= "ga('require', 'displayfeatures');";
 
142
  }
143
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) {
144
- if ( ! empty( $extra_options ) ) {
145
- $extra_options .= "\n\t\t\t";
146
  }
147
- $extra_options .= "ga('require', 'ec');";
148
- }
149
- if ( ! empty( $domain_list ) ) {
150
- if ( ! empty( $extra_options ) ) {
151
- $extra_options .= "\n\t\t\t";
152
  }
153
- $extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );";
154
- }
155
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
156
- if ( ! empty( $extra_options ) ) {
157
- $extra_options .= "\n\t\t\t";
158
  }
159
- $extra_options .= "ga('require', 'linkid', 'linkid.js');";
160
- }
161
-
162
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
163
- if ( ! empty( $extra_options ) ) {
164
- $extra_options .= "\n\t\t\t";
165
  }
166
- $extra_options .= "ga('set', 'anonymizeIp', true);";
167
  }
 
168
  $js_options = array();
169
  foreach ( array( 'cookie_domain', 'allow_linker' ) as $opts ) {
170
  if ( ! empty( $$opts ) ) {
171
  $js_options[] = $$opts;
172
  }
173
  }
174
- if ( ! empty( $js_options ) ) {
175
- $js_options = implode( ',', $js_options );
176
- $js_options = ', { ' . $js_options . ' } ';
177
- } else {
178
- $js_options = '';
179
- }
180
- $analytics_id = esc_js( $aioseop_options['aiosp_google_analytics_id'] );
181
- $attributes = apply_filters( 'aioseop_ga_attributes', '' );
182
- $open_script_line = preg_replace( '/\s+/', ' ', "<script $attributes type=\"text/javascript\">" ); // This is just to get the number of spaces right.
183
- $analytics = <<<EOF
184
-
185
- $open_script_line
186
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
187
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
188
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
189
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
190
-
191
- ga('create', '{$analytics_id}'{$domain}{$js_options});
192
- {$extra_options}
193
- ga('send', 'pageview');
194
  </script>
195
-
196
- EOF;
197
-
198
- return $analytics;
199
  }
200
 
201
  /**
@@ -206,7 +175,6 @@ EOF;
206
  if ( ! empty( $aioseop_options['aiosp_ga_domain'] ) ) {
207
  return $this->sanitize_domain( $aioseop_options['aiosp_ga_domain'] );
208
  }
209
-
210
  return '';
211
  }
212
 
3
  if ( ! class_exists( 'aioseop_google_analytics' ) ) {
4
 
5
  require_once( AIOSEOP_PLUGIN_DIR . 'admin/aioseop_module_class.php' ); // Include the module base class.
6
+ /**
7
+ * Google Analytics module.
8
+ * TODO: Rather than extending the module base class, we should find a better way
9
+ * for the shared functions like moving them to our common functions class.
10
+ *
11
+ * @since 2.3.14 #921 Autotrack added and class refactored.
12
+ */
13
  class aioseop_google_analytics extends All_in_One_SEO_Pack_Module {
 
14
 
15
+ /**
16
+ * @todo Rather than extending the module base class,
17
+ * we should find a better way for the shared functions
18
+ * like moving them to our common functions class.
19
+ */
20
+
21
+ /**
22
+ * Default module constructor.
23
+ */
24
+ public function __construct() {
25
  $this->google_analytics();
26
  }
27
 
28
+ /**
29
+ * Inits Google Analytics.
30
+ *
31
+ * @since 2.3.14 Refactored to work with autotrack.js.
32
+ *
33
+ * @link https://github.com/googleanalytics/autotrack
34
+ *
35
+ * @global array $aioseop_options All-in-on-seo saved settings/options.
36
+ * @global object $current_user Current logged in WP user.
37
+ */
38
+ public function google_analytics() {
39
  global $aioseop_options;
40
+ // Exclude tracking for users?
41
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] )
42
+ && ! empty( $aioseop_options['aiosp_ga_exclude_users'] )
43
+ && is_user_logged_in()
44
+ ) {
45
  global $current_user;
46
  if ( empty( $current_user ) ) {
47
  wp_get_current_user();
57
  ob_start();
58
  $analytics = $this->universal_analytics();
59
  echo $analytics;
60
+ if ( apply_filters(
61
+ 'aioseop_ga_enable_autotrack',
62
+ ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && $aioseop_options['aiosp_ga_track_outbound_links'],
63
+ $aioseop_options
64
+ ) ) {
65
+ $autotrack = apply_filters(
66
+ 'aiosp_google_autotrack',
67
+ 'https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.0/autotrack.js'
68
+ );
69
+ ?><script async src="<?php echo $autotrack ?>"></script>
70
+ <?php // Requested indent #921
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
  $analytics = ob_get_clean();
73
  }
77
  }
78
 
79
  /**
80
+ * Handle Universal Analytics.
81
+ * Adds analytics.
82
  *
 
83
  * @since 2.3.15 Added aioseop_ga_attributes filter hook for attributes.
84
+ * @since 2.3.14 Refactored to work with autotrack.js and code optimized.
85
  *
86
+ * @global array $aioseop_options All-in-on-seo saved settings/options.
87
  */
88
+ public function universal_analytics() {
89
  global $aioseop_options;
 
90
  $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
91
  if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) {
92
  $cookie_domain = $this->get_analytics_domain();
93
  }
94
  if ( ! empty( $cookie_domain ) ) {
95
  $cookie_domain = esc_js( $cookie_domain );
96
+ $cookie_domain = '\'cookieDomain\': \'' . $cookie_domain . '\'';
97
  }
98
  if ( empty( $cookie_domain ) ) {
99
+ $domain = ', \'auto\'';
100
  }
101
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] )
102
+ && ! empty( $aioseop_options['aiosp_ga_multi_domain'] )
103
+ ) {
104
+ $allow_linker = '\'allowLinker\': true';
105
  if ( ! empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) {
106
  $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] );
107
  $addl_domains = preg_split( '/[\s,]+/', $addl_domains );
112
  if ( ! empty( $domain_list ) ) {
113
  $domain_list .= ', ';
114
  }
115
+ $domain_list .= '\'' . $d . '\'';
116
  }
117
  }
118
  }
119
  }
120
  }
121
+ $extra_options = array();
122
+ if ( ! empty( $domain_list ) ) {
123
+ $extra_options[] = 'ga(\'require\', \'linker\');';
124
+ $extra_options[] = 'ga(\'linker:autoLink\', ['. $domain_list . '] );';
125
  }
126
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) {
127
+ if ( ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
128
+ $extra_options[] = 'ga(\'require\', \'displayfeatures\');';
129
  }
130
+ if ( ! empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) {
131
+ $extra_options[] = 'ga(\'require\', \'ec\');';
 
 
 
132
  }
133
+ if ( ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
134
+ $extra_options[] = 'ga(\'require\', \'linkid\', \'linkid.js\');';
 
 
 
135
  }
136
+ if ( ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
137
+ $extra_options[] = 'ga(\'set\', \'anonymizeIp\', true);';
138
+ }
139
+ if ( ! empty( $aioseop_options['aiosp_ga_track_outbound_links'] ) ) {
140
+ $extra_options[] = 'ga(\'require\', \'outboundLinkTracker\');';
 
141
  }
 
142
  }
143
+ $extra_options = apply_filters( 'aioseop_ga_extra_options', $extra_options, $aioseop_options );
144
  $js_options = array();
145
  foreach ( array( 'cookie_domain', 'allow_linker' ) as $opts ) {
146
  if ( ! empty( $$opts ) ) {
147
  $js_options[] = $$opts;
148
  }
149
  }
150
+ $js_options = empty( $js_options )
151
+ ? ''
152
+ : ', { ' . implode( ',', $js_options ) . ' } ';
153
+ // Prepare analytics
154
+ $analytics_id = esc_js( $aioseop_options['aiosp_google_analytics_id'] );
155
+ ob_start()
156
+ ?>
157
+ <script type="text/javascript" <?php echo preg_replace( '/\s+/', ' ', apply_filters( 'aioseop_ga_attributes', '' ) ) ?>>
158
+ window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
159
+ ga('create', '<?php echo $analytics_id ?>'<?php echo $domain ?><?php echo $js_options ?>);
160
+ // Plugins
161
+ <?php foreach ( $extra_options as $option ) : ?><?php echo $option ?><?php endforeach ?>
162
+
163
+ ga('send', 'pageview');
 
 
 
 
 
 
164
  </script>
165
+ <script async src="https://www.google-analytics.com/analytics.js"></script>
166
+ <?php
167
+ return ob_get_clean();
 
168
  }
169
 
170
  /**
175
  if ( ! empty( $aioseop_options['aiosp_ga_domain'] ) ) {
176
  return $this->sanitize_domain( $aioseop_options['aiosp_ga_domain'] );
177
  }
 
178
  return '';
179
  }
180
 
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.8
7
- Stable tag: 2.3.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -21,6 +21,7 @@ Use **All in One SEO Pack** to optimize your WordPress site for SEO. It's easy a
21
  First created in 2007, see why AIOSEO is one of the all time most downloaded plugins for WordPress.
22
 
23
  * XML Sitemap support - submit your sitemap to Google and Bing and improve your SEO
 
24
  * Google AMP support (Accelerated Mobile Pages)
25
  * Google Analytics support
26
  * Support for SEO on Custom Post Types
@@ -82,7 +83,7 @@ https://www.youtube.com/watch?v=A0VKinM5s00
82
  6. **Additional Pages for XML Sitemap** You can easily configure any additional pages to be added to the sitemap in addition to the dynamically generated WordPress pages. This ensures that search engines like Google will see ALL of your website's content.
83
  7. **Quick-Edit** Quickly edit your WordPress SEO data without having to go back and forth between different screens.
84
  8. **SEO Menu** All in One offers an extensive array of premium SEO features for free. Perfect for the novice or advanced user.
85
-
86
 
87
  == Upgrade Notice ==
88
 
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.8
7
+ Stable tag: 2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
21
  First created in 2007, see why AIOSEO is one of the all time most downloaded plugins for WordPress.
22
 
23
  * XML Sitemap support - submit your sitemap to Google and Bing and improve your SEO
24
+ * Image XML Sitemap submitted to Google and Bing to improve your Image SEO
25
  * Google AMP support (Accelerated Mobile Pages)
26
  * Google Analytics support
27
  * Support for SEO on Custom Post Types
83
  6. **Additional Pages for XML Sitemap** You can easily configure any additional pages to be added to the sitemap in addition to the dynamically generated WordPress pages. This ensures that search engines like Google will see ALL of your website's content.
84
  7. **Quick-Edit** Quickly edit your WordPress SEO data without having to go back and forth between different screens.
85
  8. **SEO Menu** All in One offers an extensive array of premium SEO features for free. Perfect for the novice or advanced user.
86
+ 9. **Google XML Sitemap** Automatically sent to Google and other search engines. Include images in your sitemap!
87
 
88
  == Upgrade Notice ==
89