WP Meta SEO - Version 4.4.4

Version Description

  • Fix : Google search console on Elementor
Download this release

Release Info

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

Code changes from version 4.4.3 to 4.4.4

assets/css/elementor/wpms-elementor.css CHANGED
@@ -168,3 +168,129 @@ input, select, textarea, button {
168
  width: 120px;
169
  margin-left: 20px;
170
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  width: 120px;
169
  margin-left: 20px;
170
  }
171
+
172
+ /* Google search console keywords */
173
+ #wpms-metabox-on-elementor .wpms-top-description {
174
+ font-size: 14px;
175
+ }
176
+
177
+ #wpms-metabox-on-elementor .search_gsc_keywords_content,
178
+ #wpms-metabox-on-elementor .filter_gsc_keywords_content {
179
+ width: 100% !important;
180
+ }
181
+
182
+ #wpms-metabox-on-elementor .filter_gsc_keywords_content {
183
+ margin-top: 10px;
184
+ }
185
+ #wpms-metabox-on-elementor .search_gsc_keywords_content {
186
+ margin-bottom: 15px !important;
187
+ }
188
+
189
+ #wpms-metabox-on-elementor .search_gsc_keywords_content .label-filter {
190
+ margin-right: 10px;
191
+ }
192
+
193
+ #wpms-metabox-on-elementor .wpmseo_gsc_keywords input,
194
+ #wpms-metabox-on-elementor .wpmseo_gsc_keywords button,
195
+ #wpms-metabox-on-elementor .wpmseo_gsc_keywords select {
196
+ height: 40px;
197
+ }
198
+
199
+ #wpmseo_gsc_keywords {
200
+ padding-left: 10px;
201
+ }
202
+ #wpms-metabox-on-elementor .wpms-form-table .wp-list-table tr td {
203
+ padding: 8px !important;
204
+ }
205
+
206
+ #wpms-metabox-on-elementor .column-keyword {
207
+ text-align: left;
208
+ }
209
+ #wpms-metabox-on-elementor .search .icons-key-csl-search .obtain {
210
+ color: #ff8726;
211
+ opacity: 1;
212
+ }
213
+
214
+ /*
215
+ #wpms-metabox-on-elementor .filter-row-checkbox {
216
+ -moz-appearance:none;
217
+ -webkit-appearance:none;
218
+ border-radius: 4px;
219
+ }
220
+
221
+ #wpms-metabox-on-elementor .filter-row-checkbox:checked {
222
+ color: #FFF;
223
+ background: #49bf88;
224
+ }*/
225
+ /* custom checkbox */
226
+ #wpms-metabox-on-elementor .filter-row-checkbox {
227
+ float: left;
228
+ margin: 0 0 40px;
229
+ font-size: 16px;
230
+ color: #495057;
231
+ padding-top: 5px;
232
+ line-height: 20px;
233
+ }
234
+
235
+ #wpms-metabox-on-elementor .filter-row-checkbox:checked {
236
+ background-color: #49bf88;
237
+ }
238
+
239
+ #wpms-metabox-on-elementor .filter-row-checkbox:checked:after {
240
+ content: '\2714';
241
+ color:white;
242
+ }
243
+
244
+ #wpms-metabox-on-elementor .filter-row-checkbox{
245
+ text-align: center;
246
+ display: table-cell;
247
+ vertical-align: middle;
248
+ width: 20px !important;
249
+ height: 20px !important;
250
+ appearance:none;
251
+ box-shadow: none;
252
+ font-size: 16px !important;
253
+ padding: 0 !important;
254
+ margin-right: 20px !important;
255
+ border: 1px solid #ddd !important;
256
+ border-radius: 4px !important;
257
+ }
258
+
259
+ #gsc_keywords_table label.gsc-sort-by:before {
260
+ font-size: 16px;
261
+ padding-right: 2px;
262
+ }
263
+
264
+ #gsc_keywords_table label.gsc-sort-by.down:before {
265
+ content: '\25bc';
266
+ }
267
+
268
+ #gsc_keywords_table label.gsc-sort-by.up:before {
269
+ content: '\25b2';
270
+ }
271
+ #wpms-metabox-on-elementor .label-filter {
272
+ width: 25% !important;
273
+ text-align: left;
274
+ min-width: 90px;
275
+ /*padding-left: 15px;*/
276
+ }
277
+
278
+ #wpms-metabox-on-elementor .type-filter-input,
279
+ #wpms-metabox-on-elementor .wpms-search-keyword-url {
280
+ width: 70% !important;
281
+ }
282
+
283
+ #wpms-metabox-on-elementor .wpms-search-keyword-url {
284
+ margin-top: 10px;
285
+ }
286
+
287
+ .button-search {
288
+ width: 100% !important;
289
+ margin-top: 10px;
290
+ /*padding-left: 15px;*/
291
+ }
292
+
293
+ .gsc_keywords_time_filter {
294
+ margin-left: 0!important;
295
+ width: 92% !important;
296
+ }
assets/js/elementor/wpms-elementor.js CHANGED
@@ -255,8 +255,10 @@ jQuery(function ($) {
255
  // Active SEO page optimation
256
  $('#elementor-wpms-general').addClass('active');
257
  $('#elementor-wpms-social').removeClass('active');
 
258
  $('#wpmseo_general').show();
259
  $('#wpmseo_social').hide();
 
260
 
261
  // Call js after meta seo tab ready
262
  if (typeof tmpData['title'] !== 'undefined') {
@@ -308,14 +310,26 @@ jQuery(function ($) {
308
  .on('click', '#elementor-wpms-general', (e) => {
309
  $('#elementor-wpms-social').removeClass('active');
310
  $('#elementor-wpms-general').addClass('active');
 
311
  $('#wpmseo_social').hide();
312
  $('#wpmseo_general').show();
 
313
  })
314
  .on('click', '#elementor-wpms-social', (e) => {
315
  $('#elementor-wpms-general').removeClass('active');
316
  $('#elementor-wpms-social').addClass('active');
 
317
  $('#wpmseo_general').hide();
318
  $('#wpmseo_social').show();
 
 
 
 
 
 
 
 
 
319
  })
320
 
321
  // when change follow of post/page in metabox view
@@ -631,4 +645,265 @@ jQuery(function ($) {
631
  .on('focusout', '.wpms-bootstrap-tagsinput > input', function (e) {
632
  $(this).attr('size', 1);
633
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
634
  });
255
  // Active SEO page optimation
256
  $('#elementor-wpms-general').addClass('active');
257
  $('#elementor-wpms-social').removeClass('active');
258
+ $('#elementor-wpms-gsc').removeClass('active');
259
  $('#wpmseo_general').show();
260
  $('#wpmseo_social').hide();
261
+ $('#wpmseo_gsc_keywords').hide();
262
 
263
  // Call js after meta seo tab ready
264
  if (typeof tmpData['title'] !== 'undefined') {
310
  .on('click', '#elementor-wpms-general', (e) => {
311
  $('#elementor-wpms-social').removeClass('active');
312
  $('#elementor-wpms-general').addClass('active');
313
+ $('#elementor-wpms-gsc').removeClass('active');
314
  $('#wpmseo_social').hide();
315
  $('#wpmseo_general').show();
316
+ $('#wpmseo_gsc_keywords').hide();
317
  })
318
  .on('click', '#elementor-wpms-social', (e) => {
319
  $('#elementor-wpms-general').removeClass('active');
320
  $('#elementor-wpms-social').addClass('active');
321
+ $('#elementor-wpms-gsc').removeClass('active');
322
  $('#wpmseo_general').hide();
323
  $('#wpmseo_social').show();
324
+ $('#wpmseo_gsc_keywords').hide();
325
+ })
326
+ .on('click', '#elementor-wpms-gsc', (e) => {
327
+ $('#elementor-wpms-gsc').addClass('active');
328
+ $('#elementor-wpms-social').removeClass('active');
329
+ $('#elementor-wpms-general').removeClass('active');
330
+ $('#wpmseo_general').hide();
331
+ $('#wpmseo_social').hide();
332
+ $('#wpmseo_gsc_keywords').show();
333
  })
334
 
335
  // when change follow of post/page in metabox view
645
  .on('focusout', '.wpms-bootstrap-tagsinput > input', function (e) {
646
  $(this).attr('size', 1);
647
  });
648
+ });
649
+
650
+ /* Google search console addon */
651
+ jQuery(function ($) {
652
+ var tmpGSC = [];
653
+ // When active Meta SEO tab, run the first load
654
+ $(document).on('click', '#wpms-onelementor-tab', () => {
655
+ // Check is google console connected
656
+ if (typeof wpmseoMetaboxL10n.keyword_console_connected !== "undefined" && parseInt(wpmseoMetaboxL10n.keyword_console_connected) === 1) {
657
+
658
+ // when change elementor tab, save tmp data
659
+ if (typeof tmpGSC['typeName'] !== 'undefined') {
660
+ $('.filter-type-name').val(tmpGSC['typeName']);
661
+ }
662
+ if (typeof tmpGSC['searchKey'] !== 'undefined') {
663
+ $('#wpms-search-input-csl').val(tmpGSC['searchKey']);
664
+ if (tmpGSC['searchKey'] !== '') {
665
+ $(".icons-key-csl-search").addClass('obtain');
666
+ } else {
667
+ $(".icons-key-csl-search").remove('obtain');
668
+ }
669
+ } else {
670
+ addLinkToSearchBox();
671
+ }
672
+ if (typeof tmpGSC['filterTime'] !== 'undefined') {
673
+ $('.gsc_keywords_time_filter select').val(tmpGSC['filterTime']);
674
+ }
675
+ if (typeof tmpGSC['filter-row1'] !== 'undefined') {
676
+ $('#filter-row1').attr('checked', 'checked');
677
+ $('#gsc_keywords_table tr >th:nth-child(4),#gsc_keywords_table tr >td:nth-child(4)').show();
678
+ }
679
+ if (typeof tmpGSC['filter-row2'] !== 'undefined') {
680
+ $('#filter-row2').attr('checked', 'checked');
681
+ $('#gsc_keywords_table tr >th:nth-child(5),#gsc_keywords_table tr >td:nth-child(5)').show();
682
+ }
683
+
684
+ // first loading
685
+ wpms_filter_search_keywords();
686
+ }
687
+ })
688
+ // On change filter type name
689
+ .on('change', '.filter-type-name', (e) => {
690
+ const $this = $(e.target);
691
+ var select = $this.val();
692
+ tmpGSC['typeName'] = select;
693
+ var placeholder = 'Add keywords like "Apple pie recipe..."';
694
+ if (select === 'page') {
695
+ placeholder = 'Paste URL to fetch the Google Search keywords';
696
+ }
697
+
698
+ $(".icons-key-csl-search").removeClass('obtain');
699
+ $("#wpms-search-input-csl").val('').attr('placeholder', placeholder).focus();
700
+ })
701
+
702
+ .on('change', '.gsc_keywords_time_filter select', (e) => {
703
+ const $this = $(e.target);
704
+ tmpGSC['filterTime'] = $this.val();
705
+ console.log(tmpGSC['filterTime']);
706
+ wpms_filter_search_keywords();
707
+ })
708
+
709
+ .on('click', '#wpms-csl-search-submit', () => {
710
+ var keycsl = $('.wpms-search-key-csl').val().trim().toLocaleString();
711
+
712
+ if (keycsl === '') {
713
+ $('#wpms-search-input-csl').focus();
714
+ }
715
+
716
+ wpms_filter_search_keywords();
717
+ })
718
+
719
+ .on('keyup', '#wpms-search-input-csl', () => {
720
+ var keycsl = $('#wpms-search-input-csl').val();
721
+ tmpGSC['searchKey'] = keycsl;
722
+ if (keycsl === '') {
723
+ $(".icons-key-csl-search").removeClass('obtain');
724
+ } else {
725
+ $("#wpms-search-input-csl").removeClass('obtain');
726
+ $(".icons-key-csl-search").addClass('obtain');
727
+ }
728
+ })
729
+
730
+ .on('click', '.icons-key-csl-search', () => {
731
+ addLinkToSearchBox();
732
+ $("#wpms-search-input-csl").focus();
733
+ $('select[name="filter_type_name"]').val('page');
734
+ return false;
735
+ })
736
+
737
+ // Show filter row
738
+ .on('click', '.filter-row', () => {
739
+ $('#filter-row-list').toggle('fade');
740
+ });
741
+
742
+ // Show filter row outside
743
+ $(document).mouseup(function (e) {
744
+ var container = $("#filter-row-list");
745
+ // if the target of the click isn't the container nor a descendant of the container
746
+ if (!container.is(e.target) && container.has(e.target).length === 0) {
747
+ container.hide('fade');
748
+ }
749
+ })
750
+ // Set filter row
751
+ .on('click', '.filter-row-checkbox', () => {
752
+ var showitems = [];
753
+ $('input[name="filter-row-name"]:checked').each(function () {
754
+ tmpGSC[this.id] = this.value;
755
+ showitems.push(this.value);
756
+ });
757
+ $('#gsc_keywords_table tr >th:nth-child(4),#gsc_keywords_table tr >th:nth-child(5),#gsc_keywords_table tr >td:nth-child(4), #gsc_keywords_table tr >td:nth-child(5)').hide();
758
+
759
+
760
+ if (showitems.length > 0) {
761
+ $.each(showitems, function (i, showitem) {
762
+ $('#gsc_keywords_table tr >th:nth-child('+showitem+'), #gsc_keywords_table tr >td:nth-child('+showitem+')').show();
763
+ });
764
+ }
765
+ });
766
+
767
+ // Enter action
768
+ $(document).on("keypress","#wpms-search-input-csl", (e) => {
769
+ if(e.which === 13){
770
+ e.preventDefault();
771
+ wpms_filter_search_keywords();
772
+ }
773
+ })
774
+ // Sort table
775
+ .on('click', '#gsc_keywords_table label.gsc-sort-by', (e) => {
776
+ const $this = $(e.target);
777
+ $('#gsc_keywords_table label.gsc-sort-by').not($this).removeClass('sorted down up');
778
+
779
+ if ($this.hasClass('down')) {
780
+ $this.removeClass('down').addClass('sorted up').attr('data-order', 'ascending');
781
+ } else {
782
+ $this.removeClass('up').addClass('sorted down').attr('data-order', 'descending');
783
+ }
784
+
785
+ var page = $('#gsc_keywords_table tfoot').data('page');
786
+ if (typeof page === 'undefined') {
787
+ page = 2;
788
+ }
789
+ wpms_filter_search_keywords_more(parseInt(page) - 1, 1);
790
+ })
791
+
792
+ .on('click', '#gsc_keywords_table tfoot', (e) => {
793
+ const $this = $(e.target);
794
+ const page = $this.data('page');
795
+ wpms_filter_search_keywords_more(page, 2);
796
+ });
797
+
798
+
799
+ // Call ajax to search keywords
800
+ function wpms_filter_search_keywords() {
801
+ var time = $('select[name="gsc_keywords_time_filter_select"] option:selected').val();
802
+ var keycsl = '';
803
+ if (typeof $('input.wpms-search-key-csl').val() !== 'undefined') {
804
+ keycsl = $('input.wpms-search-key-csl').val().trim().toLocaleString();
805
+ }
806
+ var searchType = $('select[name="filter_type_name"] option:selected').val();
807
+ var postId = $('#post_ID').val();
808
+ var showitems = [];
809
+ $('input[name="filter-row-name"]:checked').each(function () {
810
+ showitems.push(this.value);
811
+ });
812
+
813
+ var sorteditem = $("#gsc_keywords_table label.sorted");
814
+ var dataSort = '';
815
+ if (sorteditem.length > 0) {
816
+ dataSort = JSON.stringify([sorteditem.attr('data-sort'), sorteditem.attr('data-order')]);
817
+ }
818
+
819
+ $('table#gsc_keywords_table tbody#the-list').html('<tr><td colspan="6" class="td-page-loader"><img class="page-loader-loadmore" src="'+wpmseoMetaboxL10n.image_loader+'"></td></tr>');
820
+
821
+ $.ajax({
822
+ url: ajaxurl,
823
+ method: 'POST',
824
+ dataType: 'json',
825
+ data: {
826
+ action: 'wpms_filter_search_keywords',
827
+ time : time,
828
+ postId: postId,
829
+ showitems : showitems,
830
+ keycsl : keycsl,
831
+ searchType : searchType,
832
+ dataSort : dataSort,
833
+ wpms_nonce: wpmseoMetaboxL10n.wpms_nonce
834
+ },
835
+ success: function (res) {
836
+ $('.wpms_load_more_keyword td.td-page-loader').remove();
837
+ if(res.status){
838
+ $('.wpms_load_more_keyword').data('page',2);
839
+ $('.wpms_list_gsc_keywords tr').remove();
840
+ $('.wpms_list_gsc_keywords').append(res.html);
841
+ } else {
842
+ $('.wpms_list_gsc_keywords').html('<tr><td colspan="6">'+wpmseoMetaboxL10n.keyword_filter_return+'</td></tr>');
843
+ }
844
+ }
845
+ });
846
+ }
847
+
848
+ function wpms_filter_search_keywords_more(page, type) {
849
+ if (typeof page === 'undefined') {
850
+ page = 1;
851
+ }
852
+ var $this = $('#gsc_keywords_table tfoot');
853
+ var time = $('select[name="gsc_keywords_time_filter_select"] option:selected').val();
854
+ var keycsl = $('input.wpms-search-key-csl').val().trim().toLocaleString();
855
+ var searchType = $('select[name="filter_type_name"] option:selected').val();
856
+ var postId = $('#post_ID').val();
857
+ var showitems = [];
858
+ $('input[name="filter-row-name"]:checked').each(function () {
859
+ showitems.push(this.value);
860
+ });
861
+
862
+ var sorteditem = $("#gsc_keywords_table label.sorted");
863
+ var dataSort = '';
864
+ if (sorteditem.length > 0) {
865
+ dataSort = JSON.stringify([sorteditem.attr('data-sort'), sorteditem.attr('data-order')]);
866
+ }
867
+ var loadder = '<tr><td colspan="6" class="td-page-loader"><img class="page-loader-loadmore" src="'+wpmseoMetaboxL10n.image_loader+'"></td></tr>';
868
+ if (type === 1) {
869
+ // Sort loader
870
+ $('table#gsc_keywords_table tbody#the-list').html(loadder);
871
+ } else {
872
+ $('table#gsc_keywords_table tbody#the-list').append(loadder);
873
+ }
874
+ $.ajax({
875
+ url: ajaxurl,
876
+ method: 'POST',
877
+ dataType: 'json',
878
+ data: {
879
+ action: 'wpms_filter_search_keywords',
880
+ time : time,
881
+ postId: postId,
882
+ page:page,
883
+ showitems : showitems,
884
+ keycsl : keycsl,
885
+ searchType : searchType,
886
+ dataSort : dataSort,
887
+ wpms_nonce: wpmseoMetaboxL10n.wpms_nonce
888
+ },
889
+ success: function (res) {
890
+ if(res.status){
891
+ $this.data('page',res.page);
892
+ $('.wpms_list_gsc_keywords tr').remove();
893
+ $('.wpms_list_gsc_keywords').append(res.html);
894
+ } else {
895
+ $('.wpms_list_gsc_keywords').html('<tr><td colspan="6">'+wpmseoMetaboxL10n.keyword_filter_return+'</td></tr>');
896
+ }
897
+ }
898
+ });
899
+ }
900
+
901
+ function addLinkToSearchBox() {
902
+ const link = window.location.protocol + '//' + $('#wpmseosnippet').find('.url').text();
903
+ if (typeof link !== 'undefined') {
904
+ $("#wpms-search-input-csl").val(link);
905
+ }
906
+
907
+ $(".icons-key-csl-search").addClass('obtain');
908
+ }
909
  });
inc/class.metaseo-admin.php CHANGED
@@ -1254,6 +1254,7 @@ class MetaSeoAdmin
1254
  '<div>' . html_entity_decode(stripcslashes($_POST['datas']['content']), ENT_COMPAT, 'UTF-8') . '</div>',
1255
  $_POST['datas']['post_id']
1256
  );
 
1257
  $content = $this->injectAcfField($content, $_POST['datas']['post_id']);
1258
 
1259
  $content = $this->injectWooCommerce($content, $_POST['datas']['post_id']);
@@ -1285,6 +1286,21 @@ class MetaSeoAdmin
1285
  $tags_h5 = wpmsExtractTags($content, 'h5', false, true);
1286
  $tags_h6 = wpmsExtractTags($content, 'h6', false, true);
1287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1288
  $test = false;
1289
  if (empty($tags_h1) && empty($tags_h2) && empty($tags_h3)
1290
  && empty($tags_h4) && empty($tags_h5) && empty($tags_h6)) {
@@ -1295,7 +1311,7 @@ class MetaSeoAdmin
1295
  foreach ($tags_h1 as $order => $tagh1) {
1296
  $words_tagh1 = preg_split(
1297
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1298
- utf8_decode(strtolower($tagh1['contents'])),
1299
  -1,
1300
  PREG_SPLIT_NO_EMPTY
1301
  );
@@ -1315,7 +1331,7 @@ class MetaSeoAdmin
1315
  foreach ($tags_h2 as $order => $tagh2) {
1316
  $words_tagh2 = preg_split(
1317
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1318
- utf8_decode(strtolower($tagh2['contents'])),
1319
  -1,
1320
  PREG_SPLIT_NO_EMPTY
1321
  );
@@ -1334,7 +1350,7 @@ class MetaSeoAdmin
1334
  foreach ($tags_h3 as $order => $tagh3) {
1335
  $words_tagh3 = preg_split(
1336
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1337
- utf8_decode(strtolower($tagh3['contents'])),
1338
  -1,
1339
  PREG_SPLIT_NO_EMPTY
1340
  );
@@ -1353,7 +1369,7 @@ class MetaSeoAdmin
1353
  foreach ($tags_h4 as $order => $tagh4) {
1354
  $words_tagh4 = preg_split(
1355
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1356
- utf8_decode(strtolower($tagh4['contents'])),
1357
  -1,
1358
  PREG_SPLIT_NO_EMPTY
1359
  );
@@ -1372,7 +1388,7 @@ class MetaSeoAdmin
1372
  foreach ($tags_h5 as $order => $tagh5) {
1373
  $words_tagh5 = preg_split(
1374
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1375
- utf8_decode(strtolower($tagh5['contents'])),
1376
  -1,
1377
  PREG_SPLIT_NO_EMPTY
1378
  );
@@ -1391,7 +1407,7 @@ class MetaSeoAdmin
1391
  foreach ($tags_h6 as $order => $tagh6) {
1392
  $words_tagh6 = preg_split(
1393
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1394
- utf8_decode(strtolower($tagh6['contents'])),
1395
  -1,
1396
  PREG_SPLIT_NO_EMPTY
1397
  );
@@ -1766,6 +1782,87 @@ class MetaSeoAdmin
1766
  wp_send_json(array('circliful' => $circliful, 'output' => $output, 'check' => $check, 'right_output' => $right_output));
1767
  }
1768
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1769
  /**
1770
  * Validate propertyin page optimization
1771
  *
1254
  '<div>' . html_entity_decode(stripcslashes($_POST['datas']['content']), ENT_COMPAT, 'UTF-8') . '</div>',
1255
  $_POST['datas']['post_id']
1256
  );
1257
+
1258
  $content = $this->injectAcfField($content, $_POST['datas']['post_id']);
1259
 
1260
  $content = $this->injectWooCommerce($content, $_POST['datas']['post_id']);
1286
  $tags_h5 = wpmsExtractTags($content, 'h5', false, true);
1287
  $tags_h6 = wpmsExtractTags($content, 'h6', false, true);
1288
 
1289
+ // extract heading tags from WPBakery plugin shortcode
1290
+ if (is_plugin_active('js_composer/js_composer.php') && isset($_POST['datas']['content'])) {
1291
+ $textContent = $_POST['datas']['content'];
1292
+ $textContent = html_entity_decode(stripcslashes($textContent), ENT_COMPAT, 'UTF-8');
1293
+ $msPostTitle = isset($_POST['datas']['title']) ? $_POST['datas']['title'] : '';
1294
+ $vcCustomHeading = $this->wpmsShortcodeExtract($msPostTitle, $textContent, array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'));
1295
+ if (!empty($vcCustomHeading)) {
1296
+ $tags_h1 = array_merge($tags_h1, $vcCustomHeading['h1']);
1297
+ $tags_h2 = array_merge($tags_h2, $vcCustomHeading['h2']);
1298
+ $tags_h3 = array_merge($tags_h3, $vcCustomHeading['h3']);
1299
+ $tags_h4 = array_merge($tags_h4, $vcCustomHeading['h4']);
1300
+ $tags_h5 = array_merge($tags_h5, $vcCustomHeading['h5']);
1301
+ $tags_h6 = array_merge($tags_h6, $vcCustomHeading['h6']);
1302
+ }
1303
+ }
1304
  $test = false;
1305
  if (empty($tags_h1) && empty($tags_h2) && empty($tags_h3)
1306
  && empty($tags_h4) && empty($tags_h5) && empty($tags_h6)) {
1311
  foreach ($tags_h1 as $order => $tagh1) {
1312
  $words_tagh1 = preg_split(
1313
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1314
+ strtolower($tagh1['contents']),
1315
  -1,
1316
  PREG_SPLIT_NO_EMPTY
1317
  );
1331
  foreach ($tags_h2 as $order => $tagh2) {
1332
  $words_tagh2 = preg_split(
1333
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1334
+ strtolower($tagh2['contents']),
1335
  -1,
1336
  PREG_SPLIT_NO_EMPTY
1337
  );
1350
  foreach ($tags_h3 as $order => $tagh3) {
1351
  $words_tagh3 = preg_split(
1352
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1353
+ strtolower($tagh3['contents']),
1354
  -1,
1355
  PREG_SPLIT_NO_EMPTY
1356
  );
1369
  foreach ($tags_h4 as $order => $tagh4) {
1370
  $words_tagh4 = preg_split(
1371
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1372
+ strtolower($tagh4['contents']),
1373
  -1,
1374
  PREG_SPLIT_NO_EMPTY
1375
  );
1388
  foreach ($tags_h5 as $order => $tagh5) {
1389
  $words_tagh5 = preg_split(
1390
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1391
+ strtolower($tagh5['contents']),
1392
  -1,
1393
  PREG_SPLIT_NO_EMPTY
1394
  );
1407
  foreach ($tags_h6 as $order => $tagh6) {
1408
  $words_tagh6 = preg_split(
1409
  '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
1410
+ strtolower($tagh6['contents']),
1411
  -1,
1412
  PREG_SPLIT_NO_EMPTY
1413
  );
1782
  wp_send_json(array('circliful' => $circliful, 'output' => $output, 'check' => $check, 'right_output' => $right_output));
1783
  }
1784
 
1785
+ /**
1786
+ * Extract html heading tags from WPBakery Page Builder shortcode
1787
+ *
1788
+ * @param string $postTitle Post title
1789
+ * @param string $textContent Text content page/post
1790
+ * @param array $search Html heading tags to extract
1791
+ *
1792
+ * @return array
1793
+ */
1794
+ public function wpmsShortcodeExtract($postTitle, $textContent, $search)
1795
+ {
1796
+ $extracted = array();
1797
+ // Capture vc_custom_heading shortcode from post content
1798
+ if (preg_match_all('/\[vc_custom_heading(.*?)\]/i', $textContent, $matches)) {
1799
+ if (!empty($matches)) {
1800
+ foreach ($matches[1] as $vcCustomHeading) {
1801
+ $attrs = shortcode_parse_atts(trim($vcCustomHeading));
1802
+ if (!empty($attrs['font_container'])) {
1803
+ foreach ($search as $s) {
1804
+ if (strpos($attrs['font_container'], 'tag:' . $s . '|') !== false) {
1805
+ $tag = $s;
1806
+ break; // find out html tag
1807
+ }
1808
+ }
1809
+ } else {
1810
+ $tag = 'h2'; // default by WPBakery page builder if empty font_container attr
1811
+ }
1812
+
1813
+ // Check case source="post_title"
1814
+ $content = '';
1815
+ if (isset($attrs['source']) && $attrs['source'] === 'post_title') {
1816
+ $content = $postTitle;
1817
+ } elseif (isset($attrs['text']) && !empty($attrs['text'])) {
1818
+ $content = $attrs['text'];
1819
+ }
1820
+
1821
+ if (!empty($attrs) && isset($tag)) {
1822
+ $extracted[$tag][] = array(
1823
+ 'tag_name' => $tag,
1824
+ 'offset' => '',
1825
+ 'contents' => $content,
1826
+ 'attributes' => array(),
1827
+ 'full_tag' => '[vc_custom_heading ' . $vcCustomHeading . ']'
1828
+ );
1829
+ }
1830
+ }
1831
+ }
1832
+ }
1833
+
1834
+ // Capture trx_sc_title shortcode from post content
1835
+ if (preg_match_all('/\[trx_sc_title(.*?)\]/i', $textContent, $matches)) {
1836
+ if (!empty($matches)) {
1837
+ foreach ($matches[1] as $trxScTitle) {
1838
+ $attrs = shortcode_parse_atts(trim($trxScTitle));
1839
+ if (!empty($attrs['title_tag'])) {
1840
+ $titleTag = $attrs['title_tag'];
1841
+ } else {
1842
+ $titleTag = 'h2'; // default by WPBakery page builder if empty title_tag attr
1843
+ }
1844
+
1845
+ // Check case source="post_title"
1846
+ $title = '';
1847
+ if (isset($attrs['title'])) {
1848
+ $title = $attrs['title'];
1849
+ }
1850
+
1851
+ if (!empty($attrs) && !empty($title)) {
1852
+ $extracted[$titleTag][] = array(
1853
+ 'tag_name' => $titleTag,
1854
+ 'offset' => '',
1855
+ 'contents' => $title,
1856
+ 'attributes' => array(),
1857
+ 'full_tag' => '[trx_sc_title ' . $trxScTitle . ']'
1858
+ );
1859
+ }
1860
+ }
1861
+ }
1862
+ }
1863
+
1864
+ return $extracted;
1865
+ }
1866
  /**
1867
  * Validate propertyin page optimization
1868
  *
inc/class.metaseo-metabox.php CHANGED
@@ -696,7 +696,7 @@ class WPMSEOMetabox extends WPMSEOMeta
696
  href="#wpmseo_general">' . esc_html__('SEO page optimization', 'wp-meta-seo') . '</a></li>';
697
 
698
  if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
699
- $service = $this->serverWebmaster();
700
  if (!empty($service)) {
701
  // get domain
702
  $option = get_option(WPMS_GSC, array('profile' => ''));
@@ -706,7 +706,7 @@ class WPMSEOMetabox extends WPMSEOMeta
706
  }
707
  if ($check_connected) {
708
  $wpmsMetaboxContent .= '<li class="tab wpmstab col">';
709
- $wpmsMetaboxContent .= '<a class="wpmseo_tablink" href="#wpmseo_gsc_keywords">';
710
  $wpmsMetaboxContent .= esc_html__('Search console keywords', 'wp-meta-seo');
711
  $wpmsMetaboxContent .= '</a>';
712
  $wpmsMetaboxContent .= '</li>';
@@ -783,11 +783,11 @@ class WPMSEOMetabox extends WPMSEOMeta
783
  }
784
 
785
  /**
786
- * Get server webmaster
787
  *
788
- * @return boolean|Wpms_Google_Service_Webmasters
789
  */
790
- public function serverWebmaster()
791
  {
792
  try {
793
  if (!class_exists('Wpms_Api_Google', false)) {
@@ -817,7 +817,7 @@ class WPMSEOMetabox extends WPMSEOMeta
817
 
818
  $this->client = new Wpms_Api_Google_Client($gsc, 'wpms-gsc', 'https://www.googleapis.com/webmasters/v3/');
819
  if (!is_null($this->client->getAccessToken())) {
820
- $service = new Wpms_Google_Service_Webmasters($this->client);
821
  return $service;
822
  }
823
  return false;
696
  href="#wpmseo_general">' . esc_html__('SEO page optimization', 'wp-meta-seo') . '</a></li>';
697
 
698
  if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
699
+ $service = $this->serviceSearchConsole();
700
  if (!empty($service)) {
701
  // get domain
702
  $option = get_option(WPMS_GSC, array('profile' => ''));
706
  }
707
  if ($check_connected) {
708
  $wpmsMetaboxContent .= '<li class="tab wpmstab col">';
709
+ $wpmsMetaboxContent .= '<a id="elementor-wpms-gsc" class="wpmseo_tablink" href="#wpmseo_gsc_keywords">';
710
  $wpmsMetaboxContent .= esc_html__('Search console keywords', 'wp-meta-seo');
711
  $wpmsMetaboxContent .= '</a>';
712
  $wpmsMetaboxContent .= '</li>';
783
  }
784
 
785
  /**
786
+ * Get Google service Search Console
787
  *
788
+ * @return boolean|Wpms_Google_Service_SearchConsole
789
  */
790
+ public function serviceSearchConsole()
791
  {
792
  try {
793
  if (!class_exists('Wpms_Api_Google', false)) {
817
 
818
  $this->client = new Wpms_Api_Google_Client($gsc, 'wpms-gsc', 'https://www.googleapis.com/webmasters/v3/');
819
  if (!is_null($this->client->getAccessToken())) {
820
+ $service = new Wpms_Google_Service_SearchConsole($this->client);
821
  return $service;
822
  }
823
  return false;
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.7
5
  Tested up to: 5.8.1
6
- Stable tag: 4.4.3
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -25,7 +25,8 @@ WP Meta SEO gives you the control over all your SEO optimization. Bulk SEO conte
25
  * Facebook and Twitter social sharing custom elements per content
26
  * Breadcrumb generator
27
  * Gutenberg SEO content checker
28
- * Canonical URL management for post, pages and categories
 
29
 
30
 
31
  ## WP Meta SEO Addon plugin (optional), additional search engine optimization
@@ -258,6 +259,9 @@ Yes WP Meta SEO is compatible with Gutenberg editor since 3.7 version.
258
 
259
  == Changelog ==
260
 
 
 
 
261
  = 4.4.3 =
262
  * Add : Default post image setting for social meta
263
  * Fix : SEO checker on Elementor Meta SEO meta box
@@ -706,7 +710,7 @@ Yes WP Meta SEO is compatible with Gutenberg editor since 3.7 version.
706
  == Upgrade Notice ==
707
 
708
  Update through the automatic WordPress updater, all WP Meta SEO content will remain in place.
709
- You WON'T lose any SEO content: meta, alt, titles
710
 
711
 
712
  == Requirements ==
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.7
5
  Tested up to: 5.8.1
6
+ Stable tag: 4.4.4
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
25
  * Facebook and Twitter social sharing custom elements per content
26
  * Breadcrumb generator
27
  * Gutenberg SEO content checker
28
+ * Canonical URL management for post, pages and categories
29
+ * Elementor full integration with live onPage SEO in the Elementor page editor
30
 
31
 
32
  ## WP Meta SEO Addon plugin (optional), additional search engine optimization
259
 
260
  == Changelog ==
261
 
262
+ = 4.4.4 =
263
+ * Fix : Google search console on Elementor
264
+
265
  = 4.4.3 =
266
  * Add : Default post image setting for social meta
267
  * Fix : SEO checker on Elementor Meta SEO meta box
710
  == Upgrade Notice ==
711
 
712
  Update through the automatic WordPress updater, all WP Meta SEO content will remain in place.
713
+ You WON'T lose any SEO content: meta, alt, titles
714
 
715
 
716
  == Requirements ==
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.4.3
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
@@ -133,7 +133,7 @@ if (!defined('WPMSEO_VERSION')) {
133
  /**
134
  * Plugin version
135
  */
136
- define('WPMSEO_VERSION', '4.4.3');
137
  }
138
 
139
  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.4.4
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
133
  /**
134
  * Plugin version
135
  */
136
+ define('WPMSEO_VERSION', '4.4.4');
137
  }
138
 
139
  if (!defined('WPMS_CLIENTID')) {