WP Meta SEO - Version 4.0.13

Version Description

  • Fix : JS error when edit a post
    • Fix : Exclude external link and replicate the custom link in sitemap
Download this release

Release Info

Developer JoomUnited
Plugin Icon 128x128 WP Meta SEO
Version 4.0.13
Comparing to
See all releases

Code changes from version 4.0.12 to 4.0.13

assets/js/wp-metaseo-metabox.js CHANGED
@@ -401,7 +401,11 @@ jQuery(document).ready(function ($) {
401
  }
402
  });
403
 
404
- addLinkToSearchBox('page-load');
 
 
 
 
405
  jQuery('.icons-key-csl-search').on('click', function() {
406
  addLinkToSearchBox();
407
  jQuery("#wpms-search-input-csl").focus();
@@ -469,16 +473,19 @@ jQuery(document).ready(function ($) {
469
  return typeof wp !== 'undefined' && typeof wp.blocks !== 'undefined';
470
  }
471
 
472
- // Save post edit gutenberg
473
- if (isGutenbergActive()) {
474
- wp.data.subscribe(function () {
475
- var isSavingPost = wp.data.select('core/editor').isSavingPost();
476
- var isAutosavingPost = wp.data.select('core/editor').isAutosavingPost();
 
 
477
 
478
- if (isSavingPost && !isAutosavingPost) {
479
- wpms_filter_search_keywords();
480
- }
481
- });
 
482
  }
483
 
484
  // Enter action
401
  }
402
  });
403
 
404
+ // CHeck is google console connected
405
+ if (typeof wpmseoMetaboxL10n.keyword_console_connected !== "undefined" && parseInt(wpmseoMetaboxL10n.keyword_console_connected) === 1) {
406
+ addLinkToSearchBox('page-load');
407
+ }
408
+
409
  jQuery('.icons-key-csl-search').on('click', function() {
410
  addLinkToSearchBox();
411
  jQuery("#wpms-search-input-csl").focus();
473
  return typeof wp !== 'undefined' && typeof wp.blocks !== 'undefined';
474
  }
475
 
476
+ // CHeck is google console connected
477
+ if (typeof wpmseoMetaboxL10n.keyword_console_connected !== "undefined" && parseInt(wpmseoMetaboxL10n.keyword_console_connected) === 1) {
478
+ // Save post edit gutenberg
479
+ if (isGutenbergActive()) {
480
+ wp.data.subscribe(function () {
481
+ var isSavingPost = wp.data.select('core/editor').isSavingPost();
482
+ var isAutosavingPost = wp.data.select('core/editor').isAutosavingPost();
483
 
484
+ if (isSavingPost && !isAutosavingPost) {
485
+ wpms_filter_search_keywords();
486
+ }
487
+ });
488
+ }
489
  }
490
 
491
  // Enter action
inc/class.metaseo-metabox.php CHANGED
@@ -383,6 +383,15 @@ class WPMSEOMetabox extends WPMSEOMeta
383
  $cached_replacement_vars[$var] = $value;
384
  }
385
 
 
 
 
 
 
 
 
 
 
386
  $cached_replacement_vars['sitename'] = get_option('blogname');
387
  $plugin_active = json_encode(get_option('active_plugins'));
388
  $array_keyword = array(
@@ -400,7 +409,8 @@ class WPMSEOMetabox extends WPMSEOMeta
400
  'no_parent_text' => esc_html__('(no parent)', 'wp-meta-seo'),
401
  'show_keywords' => 0,
402
  'image_loader' => esc_url(WPMETASEO_PLUGIN_URL . '/assets/images/ajax-loader1.gif'),
403
- 'keyword_filter_return' => esc_html__('No search queries are currently indexed in the search console... Try typing custom keywords.', 'wp-meta-seo')
 
404
  );
405
  $settings = get_option('_metaseo_settings');
406
  if (isset($settings['metaseo_showkeywords']) && (int) $settings['metaseo_showkeywords'] === 1) {
383
  $cached_replacement_vars[$var] = $value;
384
  }
385
 
386
+ $check_connected = false;
387
+ if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
388
+ // get domain
389
+ $option = get_option(WPMS_GSC, array('profile' => ''));
390
+ if (!empty($option['profile'])) {
391
+ $check_connected = true;
392
+ }
393
+ }
394
+
395
  $cached_replacement_vars['sitename'] = get_option('blogname');
396
  $plugin_active = json_encode(get_option('active_plugins'));
397
  $array_keyword = array(
409
  'no_parent_text' => esc_html__('(no parent)', 'wp-meta-seo'),
410
  'show_keywords' => 0,
411
  'image_loader' => esc_url(WPMETASEO_PLUGIN_URL . '/assets/images/ajax-loader1.gif'),
412
+ 'keyword_filter_return' => esc_html__('No search queries are currently indexed in the search console... Try typing custom keywords.', 'wp-meta-seo'),
413
+ 'keyword_console_connected' => ($check_connected) ? 1 : 0
414
  );
415
  $settings = get_option('_metaseo_settings');
416
  if (isset($settings['metaseo_showkeywords']) && (int) $settings['metaseo_showkeywords'] === 1) {
inc/class.metaseo-sitemap.php CHANGED
@@ -570,6 +570,71 @@ class MetaSeoSitemap
570
  return array('path' => $xml_path, 'name' => $xml_file);
571
  }
572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  /**
574
  * Create sitemap
575
  *
@@ -635,6 +700,15 @@ class MetaSeoSitemap
635
  // Check anchor links
636
  $permalink = strstr($permalink, '#', true);
637
  }
 
 
 
 
 
 
 
 
 
638
  if (!in_array($permalink, $list_links)) {
639
  $list_links[] = $permalink;
640
  if ($type !== 'taxonomy') {
@@ -711,6 +785,15 @@ class MetaSeoSitemap
711
  // Check anchor links
712
  $permalink = strstr($permalink, '#', true);
713
  }
 
 
 
 
 
 
 
 
 
714
  if (!in_array($permalink, $list_links)) {
715
  $list_links[] = $permalink;
716
  if ($type === 'taxonomy') {
@@ -767,6 +850,15 @@ class MetaSeoSitemap
767
  // Check anchor links
768
  $permalink = strstr($permalink, '#', true);
769
  }
 
 
 
 
 
 
 
 
 
770
  if (!in_array($permalink, $list_links)) {
771
  $list_links[] = $permalink;
772
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
@@ -838,6 +930,15 @@ class MetaSeoSitemap
838
  // Check anchor links
839
  $permalink = strstr($permalink, '#', true);
840
  }
 
 
 
 
 
 
 
 
 
841
  if (!in_array($permalink, $list_links)) {
842
  $list_links[] = $permalink;
843
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
@@ -893,6 +994,15 @@ class MetaSeoSitemap
893
  // Check anchor links
894
  $listUrls[$key]['link'] = strstr($listUrls[$key]['link'], '#', true);
895
  }
 
 
 
 
 
 
 
 
 
896
  if (!in_array($listUrls[$key]['link'], $list_links)) {
897
  $list_links[] = $listUrls[$key]['link'];
898
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
@@ -935,6 +1045,15 @@ class MetaSeoSitemap
935
  // Check anchor links
936
  $permalink = strstr($permalink, '#', true);
937
  }
 
 
 
 
 
 
 
 
 
938
  if (!in_array($permalink, $list_links)) {
939
  $list_links[] = $permalink;
940
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
@@ -984,6 +1103,15 @@ class MetaSeoSitemap
984
  // Check anchor links
985
  $permalink = strstr($permalink, '#', true);
986
  }
 
 
 
 
 
 
 
 
 
987
  if (!in_array($permalink, $list_links)) {
988
  $list_links[] = $permalink;
989
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
@@ -1194,7 +1322,7 @@ class MetaSeoSitemap
1194
  while (have_posts()) {
1195
  the_post();
1196
  if ((get_post_meta(get_the_ID(), '_yoast_wpseo_meta-robots-noindex', true) === '1'
1197
- && get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) !== 'always')
1198
  || (get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) === 'never')
1199
  || (get_post_meta(get_the_ID(), '_yoast_wpms_redirect', true) !== '')) {
1200
  continue;
@@ -1237,7 +1365,7 @@ class MetaSeoSitemap
1237
  if (isset($this->settings_sitemap['wpms_html_sitemap_page'])
1238
  && (int) $page->ID !== (int) $this->settings_sitemap['wpms_html_sitemap_page']) {
1239
  if ((get_post_meta($page->ID, '_yoast_wpseo_meta-robots-noindex', true) === '1'
1240
- && get_post_meta($page->ID, '_yoast_wpseo_sitemap-include', true) !== 'always')
1241
  || (get_post_meta($page->ID, '_yoast_wpseo_sitemap-include', true) === 'never')
1242
  || (get_post_meta($page->ID, '_yoast_wpms_redirect', true) !== '')) {
1243
  continue;
@@ -1548,13 +1676,6 @@ ORDER BY p.post_date DESC', array('publish', $post_type, $taxo, $cat->slug)));
1548
 
1549
  $html = $this->sitemapThemeDefault();
1550
  } elseif ($theme === 'tab') {
1551
- wp_enqueue_script(
1552
- 'wpms_materialize_js',
1553
- plugins_url('assets/js/materialize/materialize.min.js', dirname(__FILE__)),
1554
- array('jquery'),
1555
- WPMSEO_VERSION,
1556
- true
1557
- );
1558
  wp_enqueue_script(
1559
  'wpms_tabs_js',
1560
  plugins_url('assets/js/wpms-tabs.js', dirname(__FILE__)),
@@ -1608,13 +1729,6 @@ ORDER BY p.post_date DESC', array('publish', $post_type, $taxo, $cat->slug)));
1608
  }
1609
  echo '</div>';
1610
  } elseif ($theme === 'accordions') {
1611
- wp_enqueue_script(
1612
- 'wpms_materialize_js',
1613
- plugins_url('assets/js/materialize/materialize.min.js', dirname(__FILE__)),
1614
- array('jquery'),
1615
- WPMSEO_VERSION,
1616
- true
1617
- );
1618
  wp_enqueue_style(
1619
  'wpms_materialize_style',
1620
  plugins_url('assets/css/materialize/materialize_frontend_accordions_theme.css', dirname(__FILE__)),
570
  return array('path' => $xml_path, 'name' => $xml_file);
571
  }
572
 
573
+ /**
574
+ * Check external link
575
+ *
576
+ * @param string $link Link to check
577
+ *
578
+ * @return boolean
579
+ */
580
+ public function checkExternalLink($link)
581
+ {
582
+ if (empty($link)) {
583
+ return true;
584
+ }
585
+
586
+ $parseLink = parse_url($link);
587
+
588
+ if (empty($parseLink['host'])) {
589
+ // Maybe is an internal link
590
+ return false;
591
+ }
592
+
593
+ if ($parseLink['host'] === $_SERVER['HTTP_HOST']) {
594
+ // Is an internal link
595
+ return false;
596
+ }
597
+
598
+ return true;
599
+ }
600
+
601
+ /**
602
+ * Check custom link
603
+ *
604
+ * @param string $link Link to check
605
+ *
606
+ * @return string
607
+ */
608
+ public function customLink($link)
609
+ {
610
+ if (empty($link)) {
611
+ return $link;
612
+ }
613
+
614
+ if (preg_match('#http(s?)://#i', $link)) {
615
+ return $link;
616
+ }
617
+
618
+ $parseHome = parse_url(home_url());
619
+
620
+ $http = (is_ssl()) ? 'https:' : 'http:';
621
+ $host = (!empty($parseHome['host']) ? $parseHome['host'] : '');
622
+ $host .= (!empty($parseHome['path']) ? $parseHome['path'] : '');
623
+
624
+ if (substr($link, 0, 2) === '//') {
625
+ return $http . $link;
626
+ }
627
+
628
+ // Force the path become relative.
629
+ if (substr($link, 0, 1) === '/') {
630
+ if (!empty($host)) {
631
+ return $http . '//' . $host . $link;
632
+ }
633
+ }
634
+
635
+ return $link;
636
+ }
637
+
638
  /**
639
  * Create sitemap
640
  *
700
  // Check anchor links
701
  $permalink = strstr($permalink, '#', true);
702
  }
703
+
704
+ // Filter full link with custom link
705
+ $permalink = $this->customLink($permalink);
706
+
707
+ // Check to exclude external link
708
+ if ($this->checkExternalLink($permalink)) {
709
+ continue;
710
+ }
711
+
712
  if (!in_array($permalink, $list_links)) {
713
  $list_links[] = $permalink;
714
  if ($type !== 'taxonomy') {
785
  // Check anchor links
786
  $permalink = strstr($permalink, '#', true);
787
  }
788
+
789
+ // Filter full link with custom link
790
+ $permalink = $this->customLink($permalink);
791
+
792
+ // Check to exclude external link
793
+ if ($this->checkExternalLink($permalink)) {
794
+ continue;
795
+ }
796
+
797
  if (!in_array($permalink, $list_links)) {
798
  $list_links[] = $permalink;
799
  if ($type === 'taxonomy') {
850
  // Check anchor links
851
  $permalink = strstr($permalink, '#', true);
852
  }
853
+
854
+ // Filter full link with custom link
855
+ $permalink = $this->customLink($permalink);
856
+
857
+ // Check to exclude external link
858
+ if ($this->checkExternalLink($permalink)) {
859
+ continue;
860
+ }
861
+
862
  if (!in_array($permalink, $list_links)) {
863
  $list_links[] = $permalink;
864
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
930
  // Check anchor links
931
  $permalink = strstr($permalink, '#', true);
932
  }
933
+
934
+ // Filter full link with custom link
935
+ $permalink = $this->customLink($permalink);
936
+
937
+ // Check to exclude external link
938
+ if ($this->checkExternalLink($permalink)) {
939
+ continue;
940
+ }
941
+
942
  if (!in_array($permalink, $list_links)) {
943
  $list_links[] = $permalink;
944
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
994
  // Check anchor links
995
  $listUrls[$key]['link'] = strstr($listUrls[$key]['link'], '#', true);
996
  }
997
+
998
+ // Filter full link with custom link
999
+ $listUrls[$key]['link'] = $this->customLink($listUrls[$key]['link']);
1000
+
1001
+ // Check to exclude external link
1002
+ if ($this->checkExternalLink($listUrls[$key]['link'])) {
1003
+ continue;
1004
+ }
1005
+
1006
  if (!in_array($listUrls[$key]['link'], $list_links)) {
1007
  $list_links[] = $listUrls[$key]['link'];
1008
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
1045
  // Check anchor links
1046
  $permalink = strstr($permalink, '#', true);
1047
  }
1048
+
1049
+ // Filter full link with custom link
1050
+ $permalink = $this->customLink($permalink);
1051
+
1052
+ // Check to exclude external link
1053
+ if ($this->checkExternalLink($permalink)) {
1054
+ continue;
1055
+ }
1056
+
1057
  if (!in_array($permalink, $list_links)) {
1058
  $list_links[] = $permalink;
1059
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
1103
  // Check anchor links
1104
  $permalink = strstr($permalink, '#', true);
1105
  }
1106
+
1107
+ // Filter full link with custom link
1108
+ $permalink = $this->customLink($permalink);
1109
+
1110
+ // Check to exclude external link
1111
+ if ($this->checkExternalLink($permalink)) {
1112
+ continue;
1113
+ }
1114
+
1115
  if (!in_array($permalink, $list_links)) {
1116
  $list_links[] = $permalink;
1117
  $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
1322
  while (have_posts()) {
1323
  the_post();
1324
  if ((get_post_meta(get_the_ID(), '_yoast_wpseo_meta-robots-noindex', true) === '1'
1325
+ && get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) !== 'always')
1326
  || (get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) === 'never')
1327
  || (get_post_meta(get_the_ID(), '_yoast_wpms_redirect', true) !== '')) {
1328
  continue;
1365
  if (isset($this->settings_sitemap['wpms_html_sitemap_page'])
1366
  && (int) $page->ID !== (int) $this->settings_sitemap['wpms_html_sitemap_page']) {
1367
  if ((get_post_meta($page->ID, '_yoast_wpseo_meta-robots-noindex', true) === '1'
1368
+ && get_post_meta($page->ID, '_yoast_wpseo_sitemap-include', true) !== 'always')
1369
  || (get_post_meta($page->ID, '_yoast_wpseo_sitemap-include', true) === 'never')
1370
  || (get_post_meta($page->ID, '_yoast_wpms_redirect', true) !== '')) {
1371
  continue;
1676
 
1677
  $html = $this->sitemapThemeDefault();
1678
  } elseif ($theme === 'tab') {
 
 
 
 
 
 
 
1679
  wp_enqueue_script(
1680
  'wpms_tabs_js',
1681
  plugins_url('assets/js/wpms-tabs.js', dirname(__FILE__)),
1729
  }
1730
  echo '</div>';
1731
  } elseif ($theme === 'accordions') {
 
 
 
 
 
 
 
1732
  wp_enqueue_style(
1733
  'wpms_materialize_style',
1734
  plugins_url('assets/css/materialize/materialize_frontend_accordions_theme.css', dirname(__FILE__)),
languages/wp-meta-seo-en_US.mo CHANGED
Binary file
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: JoomUnited
3
  Tags: google, webmaster tools, keywords, meta, meta description, meta keywords, meta title, robots meta, search engine optimization, seo, wordpress seo, yahoo, image optimization, image resize, custom post seo, redirect, redirection, 301, broken link
4
  Requires at least: 4.0
5
  Tested up to: 5.2.4
6
- Stable tag: 4.0.12
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -258,6 +258,10 @@ Yes WP Meta SEO is compatible with Gutenberg editor since 3.7 version.
258
 
259
  == Changelog ==
260
 
 
 
 
 
261
  = 4.0.12 =
262
  * Add : Compatibility with Google Search Console integration
263
 
3
  Tags: google, webmaster tools, keywords, meta, meta description, meta keywords, meta title, robots meta, search engine optimization, seo, wordpress seo, yahoo, image optimization, image resize, custom post seo, redirect, redirection, 301, broken link
4
  Requires at least: 4.0
5
  Tested up to: 5.2.4
6
+ Stable tag: 4.0.13
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
258
 
259
  == Changelog ==
260
 
261
+ = 4.0.13 =
262
+ * Fix : JS error when edit a post
263
+ * Fix : Exclude external link and replicate the custom link in sitemap
264
+
265
  = 4.0.12 =
266
  * Add : Compatibility with Google Search Console integration
267
 
wp-meta-seo.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WP Meta SEO
5
  * Plugin URI: http://www.joomunited.com/wordpress-products/wp-meta-seo
6
  * Description: WP Meta SEO is a plugin for WordPress to fill meta for content, images and main SEO info in a single view.
7
- * Version: 4.0.12
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
@@ -132,7 +132,7 @@ if (!defined('WPMSEO_VERSION')) {
132
  /**
133
  * Plugin version
134
  */
135
- define('WPMSEO_VERSION', '4.0.12');
136
  }
137
 
138
  if (!defined('WPMS_CLIENTID')) {
4
  * Plugin Name: WP Meta SEO
5
  * Plugin URI: http://www.joomunited.com/wordpress-products/wp-meta-seo
6
  * Description: WP Meta SEO is a plugin for WordPress to fill meta for content, images and main SEO info in a single view.
7
+ * Version: 4.0.13
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
132
  /**
133
  * Plugin version
134
  */
135
+ define('WPMSEO_VERSION', '4.0.13');
136
  }
137
 
138
  if (!defined('WPMS_CLIENTID')) {