WP Meta SEO - Version 3.7.0

Version Description

  • Add : Compatible with Gutemberg editor
  • Fix : Reload analysis in metabox
  • Fix : Render title tag
Download this release

Release Info

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

Code changes from version 3.6.8 to 3.7.0

css/materialize/materialize.css CHANGED
@@ -19,9 +19,8 @@
19
 
20
  .wpmstabs {
21
  position: relative;
22
- overflow-x: auto;
23
- overflow-y: hidden;
24
- height: 48px;
25
  width: 100%;
26
  background-color: #2196F3;
27
  margin: 0 auto;
19
 
20
  .wpmstabs {
21
  position: relative;
22
+ overflow: auto;
23
+ min-height: 48px;
 
24
  width: 100%;
25
  background-color: #2196F3;
26
  margin: 0 auto;
css/metabox-tabs.css CHANGED
@@ -433,6 +433,12 @@ div.wpmseo-tab-content {
433
  float: right;
434
  }
435
 
 
 
 
 
 
 
436
  .gsc_keywords_filter{
437
  margin: 5px 0;
438
  width: 100%;
@@ -461,4 +467,12 @@ div.wpmseo-tab-content {
461
 
462
  .wpms_show_tooltip{
463
  float: left;
 
 
 
 
 
 
 
 
464
  }
433
  float: right;
434
  }
435
 
436
+ .reload_analysis .spinner {
437
+ position: relative;
438
+ top: 0;
439
+ right: 0
440
+ }
441
+
442
  .gsc_keywords_filter{
443
  margin: 5px 0;
444
  width: 100%;
467
 
468
  .wpms_show_tooltip{
469
  float: left;
470
+ }
471
+
472
+ .icons-mboxdone {
473
+ color:#46B450
474
+ }
475
+
476
+ .icons-mboxwarning {
477
+ color:#FFB900
478
  }
css/metaseo_admin.css CHANGED
@@ -686,4 +686,43 @@ span.wpms-seoImgRemove{
686
 
687
  #wpmseo_meta {
688
  display: block !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
689
  }
686
 
687
  #wpmseo_meta {
688
  display: block !important;
689
+ }
690
+
691
+ .wpms_remove_link {
692
+ width: 100%;
693
+ color: #f00 !important;
694
+ cursor: pointer;
695
+ }
696
+
697
+ @media screen and (max-width: 782px) {
698
+ #col_image_name, .col_image_name.column-col_image_name,
699
+ #col_image_title, .col_image_title.column-col_image_title,
700
+ #col_image_alternative, .col_image_alternative.column-col_image_alternative,
701
+ #col_image_legend, .col_image_legend.column-col_image_legend,
702
+ #col_image_desc, .col_image_desc.column-col_image_desc,
703
+ .column-col_image_name,
704
+ .column-col_image_title,
705
+ .column-col_image_alternative,
706
+ .column-col_image_legend,
707
+ .column-col_image_desc,
708
+ .wp-meta-seo_page_metaseo_link_meta #post_id, .wp-meta-seo_page_metaseo_link_meta .column-post_id,
709
+ .wp-meta-seo_page_metaseo_link_meta #col_link_title, .wp-meta-seo_page_metaseo_link_meta .column-col_link_title,
710
+ .wp-meta-seo_page_metaseo_link_meta #col_link_label, .wp-meta-seo_page_metaseo_link_meta .column-col_link_label,
711
+ .wp-meta-seo_page_metaseo_link_meta #col_follow, .wp-meta-seo_page_metaseo_link_meta .column-col_follow,
712
+ .wp-meta-seo_page_metaseo_link_meta tbody td
713
+ {
714
+ display: none !important;
715
+ }
716
+
717
+ .metaseo_images tbody .check-column,
718
+ .metaseo_images tbody .wpms_link_html {
719
+ display: table-cell !important;
720
+ }
721
+ .metaseo_images td {
722
+ display: table-cell !important;
723
+ }
724
+
725
+ .metaseo_images th {
726
+ width: 100px !important;
727
+ }
728
  }
inc/class.image-helper.php CHANGED
@@ -176,7 +176,6 @@ class ImageHelper
176
  $ifound[$order]['width'] = $tag->getAttribute('width');
177
  $ifound[$order]['height'] = $tag->getAttribute('height');
178
  $ifound[$order]['alt'] = trim($tag->getAttribute('alt'));
179
- $ifound[$order]['title'] = trim($tag->getAttribute('title'));
180
  } else {
181
  continue;
182
  }
@@ -213,7 +212,7 @@ class ImageHelper
213
  * @param array $meta_checkout
214
  * @return array
215
  */
216
- public static function IPrepare($imgs, $posts, $meta_checkout = array())
217
  {
218
  $iNotGood = array();
219
  $iNotGoodTotal = array();
@@ -316,21 +315,17 @@ class ImageHelper
316
  }
317
 
318
  //Get image that its meta/metas is/are not good
319
- if (count($meta_checkout) > 0) {
320
- foreach ($meta_checkout as $key => $meta) {
321
- $meta_value = $img[$meta];
322
- $imNotGood[$iID][$post->ID]['ID'] = $post->ID;
323
- $imNotGood[$iID][$post->ID]['title'] = $post->post_title;
324
- $imNotGood[$iID][$post->ID]['post_type'] = $post->post_type;
325
- $imNotGood[$iID][$post->ID]['meta'][$order]['img_src'] = $img['src'];
326
- $imNotGood[$iID][$post->ID]['meta'][$order]['type'][$meta] = $meta_value;
327
- if ($meta_value == '') {
328
- if (!isset($imNotGoodTotal[$iID][$meta])) {
329
- $imNotGoodTotal[$iID][$meta] = 0;
330
- }
331
- $imNotGoodTotal[$iID][$meta]++;
332
- }
333
  }
 
334
  }
335
  }
336
  }
@@ -346,17 +341,13 @@ class ImageHelper
346
  $imNotGood[$iID] = array();
347
  }
348
  if (!isset($imNotGoodTotal[$iID])) {
349
- foreach ($meta_checkout as $mkey) {
350
- $imNotGoodTotal[$iID][$mkey] = 0;
351
- }
352
  }
353
  }
354
 
355
  foreach ($imNotGoodTotal as &$mStatis) {
356
- foreach ($meta_checkout as $mkey) {
357
- if (!isset($mStatis[$mkey])) {
358
- $mStatis[$mkey] = 0;
359
- }
360
  }
361
  }
362
 
@@ -401,7 +392,6 @@ class ImageHelper
401
  }
402
 
403
  $msg = array();
404
- $meta_keys = array('alt', 'title');
405
  $_imgs = array_flip($imgs);
406
  $post_types = MetaSeoContentListTable::getPostTypes();
407
 
@@ -432,7 +422,7 @@ class ImageHelper
432
  WHERE " . implode(' AND ', $where) . " ORDER BY ID";
433
  // query post
434
  $posts = $wpdb->get_results($query);
435
- $results = self::IPrepare($imgs, $posts, $meta_keys);
436
  //Update some value into fields in wp_postmeta
437
  if (count($results['iNotGood']) > 0) {
438
  foreach ($results['iNotGood'] as $iID => $post_group) {
@@ -470,19 +460,12 @@ class ImageHelper
470
  if (count($results['imNotGood']) > 0) {
471
  foreach ($results['imNotGood'] as $iID => $post_group) {
472
  //This has a litle bit value
473
- foreach ($meta_keys as $mkey) {
474
- $text = '';
475
- if ($mkey == 'alt') {
476
- $text = ' text';
477
- }
478
-
479
- if ($results['imNotGoodTotal'][$iID][$mkey] > 1) {
480
- $i = $results['imNotGoodTotal'][$iID][$mkey] . ' ' . $mkey . $text;
481
- $msg[$iID]['imNotGood']['msg'][$mkey] = $i . __('s are missing', 'wp-meta-seo');
482
- } elseif ($results['imNotGoodTotal'][$iID][$mkey] == 1) {
483
- $i = $results['imNotGoodTotal'][$iID][$mkey] . ' ' . $mkey . $text;
484
- $msg[$iID]['imNotGood']['msg'][$mkey] = $i . __(' is missing', 'wp-meta-seo');
485
- }
486
  }
487
 
488
  $msg[$iID]['imNotGood']['warning'] = true;
@@ -498,7 +481,7 @@ class ImageHelper
498
  update_post_meta($iID, '_metaseo_fix_metas', $post_group);
499
 
500
 
501
- if ($results['imNotGoodTotal'][$iID]['alt'] == 0 && $results['imNotGoodTotal'][$iID]['title'] == 0) {
502
  if ($results['iNotGoodTotal'][$iID] != -1) {
503
  $msg[$iID]['imNotGood']['button'] = '<a href="javascript:void(0);"
504
  class=" fix-metas wpmsbtn wpmsbtn_small wpmsbtn_secondary" data-img-name="' . $_imgs[$iID] . '"
176
  $ifound[$order]['width'] = $tag->getAttribute('width');
177
  $ifound[$order]['height'] = $tag->getAttribute('height');
178
  $ifound[$order]['alt'] = trim($tag->getAttribute('alt'));
 
179
  } else {
180
  continue;
181
  }
212
  * @param array $meta_checkout
213
  * @return array
214
  */
215
+ public static function IPrepare($imgs, $posts)
216
  {
217
  $iNotGood = array();
218
  $iNotGoodTotal = array();
315
  }
316
 
317
  //Get image that its meta/metas is/are not good
318
+ $meta_value = $img['alt'];
319
+ $imNotGood[$iID][$post->ID]['ID'] = $post->ID;
320
+ $imNotGood[$iID][$post->ID]['title'] = $post->post_title;
321
+ $imNotGood[$iID][$post->ID]['post_type'] = $post->post_type;
322
+ $imNotGood[$iID][$post->ID]['meta'][$order]['img_src'] = $img['src'];
323
+ $imNotGood[$iID][$post->ID]['meta'][$order]['type']['alt'] = $meta_value;
324
+ if ($meta_value == '') {
325
+ if (!isset($imNotGoodTotal[$iID]['alt'])) {
326
+ $imNotGoodTotal[$iID]['alt'] = 0;
 
 
 
 
 
327
  }
328
+ $imNotGoodTotal[$iID]['alt']++;
329
  }
330
  }
331
  }
341
  $imNotGood[$iID] = array();
342
  }
343
  if (!isset($imNotGoodTotal[$iID])) {
344
+ $imNotGoodTotal[$iID]['alt'] = 0;
 
 
345
  }
346
  }
347
 
348
  foreach ($imNotGoodTotal as &$mStatis) {
349
+ if (!isset($mStatis['alt'])) {
350
+ $mStatis['alt'] = 0;
 
 
351
  }
352
  }
353
 
392
  }
393
 
394
  $msg = array();
 
395
  $_imgs = array_flip($imgs);
396
  $post_types = MetaSeoContentListTable::getPostTypes();
397
 
422
  WHERE " . implode(' AND ', $where) . " ORDER BY ID";
423
  // query post
424
  $posts = $wpdb->get_results($query);
425
+ $results = self::IPrepare($imgs, $posts);
426
  //Update some value into fields in wp_postmeta
427
  if (count($results['iNotGood']) > 0) {
428
  foreach ($results['iNotGood'] as $iID => $post_group) {
460
  if (count($results['imNotGood']) > 0) {
461
  foreach ($results['imNotGood'] as $iID => $post_group) {
462
  //This has a litle bit value
463
+ if ($results['imNotGoodTotal'][$iID]['alt'] > 1) {
464
+ $i = $results['imNotGoodTotal'][$iID]['alt'] . ' ' . 'alt text';
465
+ $msg[$iID]['imNotGood']['msg']['alt'] = $i . __('s are missing', 'wp-meta-seo');
466
+ } elseif ($results['imNotGoodTotal'][$iID]['alt'] == 1) {
467
+ $i = $results['imNotGoodTotal'][$iID]['alt'] . ' ' . 'alt text';
468
+ $msg[$iID]['imNotGood']['msg']['alt'] = $i . __(' is missing', 'wp-meta-seo');
 
 
 
 
 
 
 
469
  }
470
 
471
  $msg[$iID]['imNotGood']['warning'] = true;
481
  update_post_meta($iID, '_metaseo_fix_metas', $post_group);
482
 
483
 
484
+ if ($results['imNotGoodTotal'][$iID]['alt'] == 0) {
485
  if ($results['iNotGoodTotal'][$iID] != -1) {
486
  $msg[$iID]['imNotGood']['button'] = '<a href="javascript:void(0);"
487
  class=" fix-metas wpmsbtn wpmsbtn_small wpmsbtn_secondary" data-img-name="' . $_imgs[$iID] . '"
inc/class.metaseo-admin.php CHANGED
@@ -673,10 +673,15 @@ class MetaSeoAdmin
673
  */
674
  public function createFieldAnalysis($data_title, $alt, $dashicon, $label, $value_hidden)
675
  {
676
- $output = '<div class="metaseo_analysis metaseo_tool" data-title="' . $data_title . '" data-alt="' . $alt . '">
677
- <i class="metaseo-dashicons material-icons dashicons-before"
678
- style="' . ($dashicon == 'done' ? 'color:#46B450' : 'color:#FFB900') . '">
679
- ' . $dashicon . '</i>' . $label . '</div>';
 
 
 
 
 
680
  $output .= '<input type="hidden" class="wpms_analysis_hidden"
681
  name="wpms[' . $data_title . ']" value="' . $value_hidden . '">';
682
  return $output;
@@ -705,10 +710,11 @@ class MetaSeoAdmin
705
  wp_send_json(false);
706
  }
707
 
708
- if (isset($_POST['datas']['post_id'])) {
709
  update_post_meta($_POST['datas']['post_id'], 'wpms_validate_analysis', '');
710
  }
711
 
 
712
  $check = 0;
713
  $output = '';
714
 
@@ -722,162 +728,182 @@ class MetaSeoAdmin
722
 
723
  // do shortcode js_composer plugin
724
  if (is_plugin_active('js_composer_theme/js_composer.php')) {
725
- add_shortcode( 'mk_fancy_title', 'vc_do_shortcode' );
726
  }
727
 
728
  $content = apply_filters(
729
  'the_content',
730
  '<div>' . html_entity_decode(stripcslashes($_POST['datas']['content'])) . '</div>'
731
  );
732
- if ($content == '') {
 
733
  $output .= $this->createFieldAnalysis(
734
  'heading_title',
735
  $tooltip_page['title_in_heading'],
736
- 'warning',
737
  __('Page title word in content heading', 'wp-meta-seo'),
738
- 0
739
  );
 
740
  } else {
741
- $dom = new DOMDocument;
742
- libxml_use_internal_errors(true);
743
- if ($dom->loadHTML($content)) {
744
- // Extracting the specified elements from the web page
745
- $tags_h1 = $dom->getElementsByTagName('h1');
746
- $tags_h2 = $dom->getElementsByTagName('h2');
747
- $tags_h3 = $dom->getElementsByTagName('h3');
748
- $tags_h4 = $dom->getElementsByTagName('h4');
749
- $tags_h5 = $dom->getElementsByTagName('h5');
750
- $tags_h6 = $dom->getElementsByTagName('h6');
751
-
752
- $test = false;
753
- if (empty($tags_h1) && empty($tags_h2) && empty($tags_h3)
754
- && empty($tags_h4) && empty($tags_h5) && empty($tags_h6)) {
 
 
 
 
 
 
755
  $test = false;
756
- } else {
757
- // check tag h1
758
- if (!empty($tags_h1)) {
759
- foreach ($tags_h1 as $order => $tagh1) {
760
- $words_tagh1 = preg_split(
761
- '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
762
- utf8_decode(strtolower($tagh1->nodeValue)),
763
- -1,
764
- PREG_SPLIT_NO_EMPTY
765
- );
766
- if (is_array($words_tagh1) && is_array($words_post_title)) {
767
- foreach ($words_tagh1 as $mh) {
768
- if (in_array($mh, $words_post_title) && $mh != '') {
769
- $test = true;
 
 
 
 
770
  }
771
  }
772
  }
773
  }
774
- }
775
 
776
- // check tag h2
777
- if (!empty($tags_h2)) {
778
- foreach ($tags_h2 as $order => $tagh2) {
779
- $words_tagh2 = preg_split(
780
- '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
781
- utf8_decode(strtolower($tagh2->nodeValue)),
782
- -1,
783
- PREG_SPLIT_NO_EMPTY
784
- );
785
- if (is_array($words_tagh2) && is_array($words_post_title)) {
786
- foreach ($words_tagh2 as $mh) {
787
- if (in_array($mh, $words_post_title) && $mh != '') {
788
- $test = true;
 
789
  }
790
  }
791
  }
792
  }
793
- }
794
 
795
- // check tag h3
796
- if (!empty($tags_h3)) {
797
- foreach ($tags_h3 as $order => $tagh3) {
798
- $words_tagh3 = preg_split(
799
- '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
800
- utf8_decode(strtolower($tagh3->nodeValue)),
801
- -1,
802
- PREG_SPLIT_NO_EMPTY
803
- );
804
- if (is_array($words_tagh3) && is_array($words_post_title)) {
805
- foreach ($words_tagh3 as $mh) {
806
- if (in_array($mh, $words_post_title) && $mh != '') {
807
- $test = true;
 
808
  }
809
  }
810
  }
811
  }
812
- }
813
 
814
- // check tag h4
815
- if (!empty($tags_h4)) {
816
- foreach ($tags_h4 as $order => $tagh4) {
817
- $words_tagh4 = preg_split(
818
- '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
819
- utf8_decode(strtolower($tagh4->nodeValue)),
820
- -1,
821
- PREG_SPLIT_NO_EMPTY
822
- );
823
- if (is_array($words_tagh4) && is_array($words_post_title)) {
824
- foreach ($words_tagh4 as $mh) {
825
- if (in_array($mh, $words_post_title) && $mh != '') {
826
- $test = true;
 
827
  }
828
  }
829
  }
830
  }
831
- }
832
 
833
- // check tag h5
834
- if (!empty($tags_h5)) {
835
- foreach ($tags_h5 as $order => $tagh5) {
836
- $words_tagh5 = preg_split(
837
- '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
838
- utf8_decode(strtolower($tagh5->nodeValue)),
839
- -1,
840
- PREG_SPLIT_NO_EMPTY
841
- );
842
- if (is_array($words_tagh5) && is_array($words_post_title)) {
843
- foreach ($words_tagh5 as $mh) {
844
- if (in_array($mh, $words_post_title) && $mh != '') {
845
- $test = true;
 
846
  }
847
  }
848
  }
849
  }
850
- }
851
 
852
- // check tag h6
853
- if (!empty($tags_h6)) {
854
- foreach ($tags_h6 as $order => $tagh6) {
855
- $words_tagh6 = preg_split(
856
- '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
857
- utf8_decode(strtolower($tagh6->nodeValue)),
858
- -1,
859
- PREG_SPLIT_NO_EMPTY
860
- );
861
- if (is_array($words_tagh6) && is_array($words_post_title)) {
862
- foreach ($words_tagh6 as $mh) {
863
- if (in_array($mh, $words_post_title) && $mh != '') {
864
- $test = true;
 
865
  }
866
  }
867
  }
868
  }
869
  }
870
- }
871
 
872
- if ($test || (!empty($meta_analysis) && !empty($meta_analysis['heading_title']))) {
873
- $output .= $this->createFieldAnalysis(
874
- 'heading_title',
875
- $tooltip_page['title_in_heading'],
876
- 'done',
877
- __('Page title word in content heading', 'wp-meta-seo'),
878
- 1
879
- );
880
- $check++;
 
 
 
 
 
 
 
 
 
881
  } else {
882
  $output .= $this->createFieldAnalysis(
883
  'heading_title',
@@ -887,14 +913,6 @@ class MetaSeoAdmin
887
  0
888
  );
889
  }
890
- } else {
891
- $output .= $this->createFieldAnalysis(
892
- 'heading_title',
893
- $tooltip_page['title_in_heading'],
894
- 'warning',
895
- __('Page title word in content heading', 'wp-meta-seo'),
896
- 0
897
- );
898
  }
899
  }
900
 
@@ -924,7 +942,7 @@ class MetaSeoAdmin
924
  $test1 = false;
925
  }
926
 
927
- if ($test1) {
928
  $output .= $this->createFieldAnalysis(
929
  'content_title',
930
  $tooltip_page['title_in_content'],
@@ -934,18 +952,29 @@ class MetaSeoAdmin
934
  );
935
  $check++;
936
  } else {
937
- $output .= $this->createFieldAnalysis(
938
- 'content_title',
939
- $tooltip_page['title_in_content'],
940
- 'warning',
941
- __('Page title word in content', 'wp-meta-seo'),
942
- 0
943
- );
 
 
 
 
 
 
 
 
 
 
 
944
  }
945
 
946
  // page url matches page title
947
  $mtitle = $_POST['datas']['title'];
948
- if ($_POST['datas']['mpageurl'] == sanitize_title($mtitle)) {
949
  $output .= $this->createFieldAnalysis(
950
  'pageurl',
951
  $tooltip_page['page_url'],
@@ -955,18 +984,35 @@ class MetaSeoAdmin
955
  );
956
  $check++;
957
  } else {
958
- $output .= $this->createFieldAnalysis(
959
- 'pageurl',
960
- $tooltip_page['page_url'],
961
- 'warning',
962
- __('Page url matches with page title', 'wp-meta-seo'),
963
- 0
964
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
965
  }
966
 
967
  // meta title filled
968
- if (($_POST['datas']['meta_title'] != ''
969
- && mb_strlen($_POST['datas']['meta_title'], 'UTF-8') <= self::$title_length)) {
970
  $output .= $this->createFieldAnalysis(
971
  'metatitle',
972
  $tooltip_page['meta_title'],
@@ -976,18 +1022,29 @@ class MetaSeoAdmin
976
  );
977
  $check++;
978
  } else {
979
- $output .= $this->createFieldAnalysis(
980
- 'metatitle',
981
- $tooltip_page['meta_title'],
982
- 'warning',
983
- __('Meta title filled', 'wp-meta-seo'),
984
- 0
985
- );
 
 
 
 
 
 
 
 
 
 
 
 
986
  }
987
 
988
  // desc filled
989
- if ($_POST['datas']['meta_desc'] != ''
990
- && mb_strlen($_POST['datas']['meta_desc'], 'UTF-8') <= self::$desc_length) {
991
  $output .= $this->createFieldAnalysis(
992
  'metadesc',
993
  $tooltip_page['meta_desc'],
@@ -997,13 +1054,25 @@ class MetaSeoAdmin
997
  );
998
  $check++;
999
  } else {
1000
- $output .= $this->createFieldAnalysis(
1001
- 'metadesc',
1002
- $tooltip_page['meta_desc'],
1003
- 'warning',
1004
- __('Meta description filled', 'wp-meta-seo'),
1005
- 0
1006
- );
 
 
 
 
 
 
 
 
 
 
 
 
1007
  }
1008
 
1009
  // image resize
@@ -1019,7 +1088,7 @@ class MetaSeoAdmin
1019
  'imgalt',
1020
  $tooltip_page['image_alt'],
1021
  'done',
1022
- __('Image have meta title or alt', 'wp-meta-seo'),
1023
  1
1024
  );
1025
  $check += 2;
@@ -1041,21 +1110,24 @@ class MetaSeoAdmin
1041
  continue;
1042
  }
1043
 
1044
- if (!empty($width_origin) && !empty($height_origin)) {
1045
- if (((int)$width_origin != (int)$tag->getAttribute('width'))
1046
- || ((int)$height_origin != (int)$tag->getAttribute('height'))) {
1047
- $img_wrong = true;
 
 
 
 
1048
  }
1049
  }
1050
 
1051
- $image_title = $tag->getAttribute('title');
1052
  $image_alt = $tag->getAttribute('alt');
1053
- if ($image_title == '' || $image_alt == '') {
1054
  $img_wrong_alt = true;
1055
  }
1056
  }
1057
 
1058
- if ($img_wrong == false) {
1059
  $output .= $this->createFieldAnalysis(
1060
  'imgresize',
1061
  $tooltip_page['image_resize'],
@@ -1065,33 +1137,56 @@ class MetaSeoAdmin
1065
  );
1066
  $check++;
1067
  } else {
1068
- $output .= $this->createFieldAnalysis(
1069
- 'imgresize',
1070
- $tooltip_page['image_resize'],
1071
- 'warning',
1072
- __('Wrong image resize', 'wp-meta-seo'),
1073
- 0
1074
- );
 
 
 
 
 
 
 
 
 
 
 
1075
  }
1076
 
1077
- if ($img_wrong_alt == false) {
1078
  $output .= $this->createFieldAnalysis(
1079
  'imgalt',
1080
  $tooltip_page['image_alt'],
1081
  'done',
1082
- __('Image have meta title or alt', 'wp-meta-seo'),
1083
  1
1084
  );
1085
  $check++;
1086
  } else {
1087
- $output .= $this->createFieldAnalysis(
1088
- 'imgalt',
1089
- $tooltip_page['image_alt'],
1090
- 'warning',
1091
- __('Image have meta title or alt', 'wp-meta-seo'),
1092
- 0
1093
- );
 
 
 
 
 
 
 
 
 
 
 
1094
  }
 
1095
  } else {
1096
  $output .= $this->createFieldAnalysis(
1097
  'imgresize',
@@ -1104,7 +1199,7 @@ class MetaSeoAdmin
1104
  'imgalt',
1105
  $tooltip_page['image_alt'],
1106
  'warning',
1107
- __('Image have meta title or alt', 'wp-meta-seo'),
1108
  0
1109
  );
1110
  }
@@ -1134,6 +1229,24 @@ class MetaSeoAdmin
1134
  wp_send_json(true);
1135
  }
1136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1137
  /**
1138
  * Ajax update link meta title and content editor
1139
  */
@@ -1147,7 +1260,7 @@ class MetaSeoAdmin
1147
  $sql = $wpdb->prepare(
1148
  "SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE id=%d",
1149
  array(
1150
- $_POST['link_id']
1151
  )
1152
  );
1153
  $link_detail = $wpdb->get_row($sql);
@@ -3202,6 +3315,9 @@ class MetaSeoAdmin
3202
  case 'update_link':
3203
  $this->updateLink();
3204
  break;
 
 
 
3205
  case 'save_settings404':
3206
  $this->save404Settings();
3207
  break;
673
  */
674
  public function createFieldAnalysis($data_title, $alt, $dashicon, $label, $value_hidden)
675
  {
676
+ $output = '<div class="metaseo_analysis metaseo_tool" data-title="' . $data_title . '" data-alt="' . $alt . '">';
677
+ if ($dashicon == 'done') {
678
+ $output .= '<i class="metaseo-dashicons material-icons dashicons-before icons-mboxdone">done</i>';
679
+ } else {
680
+ $output .= '<i class="metaseo-dashicons material-icons dashicons-before icons-mboxwarning">warning</i>';
681
+ }
682
+
683
+ $output .= $label;
684
+ $output .= '</div>';
685
  $output .= '<input type="hidden" class="wpms_analysis_hidden"
686
  name="wpms[' . $data_title . ']" value="' . $value_hidden . '">';
687
  return $output;
710
  wp_send_json(false);
711
  }
712
 
713
+ if (isset($_POST['datas']['post_id']) && empty($_POST['datas']['first_load'])) {
714
  update_post_meta($_POST['datas']['post_id'], 'wpms_validate_analysis', '');
715
  }
716
 
717
+ $meta_analysis = get_post_meta((int)$_POST['datas']['post_id'], 'wpms_validate_analysis', true);
718
  $check = 0;
719
  $output = '';
720
 
728
 
729
  // do shortcode js_composer plugin
730
  if (is_plugin_active('js_composer_theme/js_composer.php')) {
731
+ add_shortcode('mk_fancy_title', 'vc_do_shortcode');
732
  }
733
 
734
  $content = apply_filters(
735
  'the_content',
736
  '<div>' . html_entity_decode(stripcslashes($_POST['datas']['content'])) . '</div>'
737
  );
738
+
739
+ if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['heading_title'])) {
740
  $output .= $this->createFieldAnalysis(
741
  'heading_title',
742
  $tooltip_page['title_in_heading'],
743
+ 'done',
744
  __('Page title word in content heading', 'wp-meta-seo'),
745
+ 1
746
  );
747
+ $check++;
748
  } else {
749
+ if ($content == '') {
750
+ $output .= $this->createFieldAnalysis(
751
+ 'heading_title',
752
+ $tooltip_page['title_in_heading'],
753
+ 'warning',
754
+ __('Page title word in content heading', 'wp-meta-seo'),
755
+ 0
756
+ );
757
+ } else {
758
+ $dom = new DOMDocument;
759
+ libxml_use_internal_errors(true);
760
+ if ($dom->loadHTML($content)) {
761
+ // Extracting the specified elements from the web page
762
+ $tags_h1 = $dom->getElementsByTagName('h1');
763
+ $tags_h2 = $dom->getElementsByTagName('h2');
764
+ $tags_h3 = $dom->getElementsByTagName('h3');
765
+ $tags_h4 = $dom->getElementsByTagName('h4');
766
+ $tags_h5 = $dom->getElementsByTagName('h5');
767
+ $tags_h6 = $dom->getElementsByTagName('h6');
768
+
769
  $test = false;
770
+ if (empty($tags_h1) && empty($tags_h2) && empty($tags_h3)
771
+ && empty($tags_h4) && empty($tags_h5) && empty($tags_h6)) {
772
+ $test = false;
773
+ } else {
774
+ // check tag h1
775
+ if (!empty($tags_h1)) {
776
+ foreach ($tags_h1 as $order => $tagh1) {
777
+ $words_tagh1 = preg_split(
778
+ '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
779
+ utf8_decode(strtolower($tagh1->nodeValue)),
780
+ -1,
781
+ PREG_SPLIT_NO_EMPTY
782
+ );
783
+ if (is_array($words_tagh1) && is_array($words_post_title)) {
784
+ foreach ($words_tagh1 as $mh) {
785
+ if (in_array($mh, $words_post_title) && $mh != '') {
786
+ $test = true;
787
+ }
788
  }
789
  }
790
  }
791
  }
 
792
 
793
+ // check tag h2
794
+ if (!empty($tags_h2)) {
795
+ foreach ($tags_h2 as $order => $tagh2) {
796
+ $words_tagh2 = preg_split(
797
+ '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
798
+ utf8_decode(strtolower($tagh2->nodeValue)),
799
+ -1,
800
+ PREG_SPLIT_NO_EMPTY
801
+ );
802
+ if (is_array($words_tagh2) && is_array($words_post_title)) {
803
+ foreach ($words_tagh2 as $mh) {
804
+ if (in_array($mh, $words_post_title) && $mh != '') {
805
+ $test = true;
806
+ }
807
  }
808
  }
809
  }
810
  }
 
811
 
812
+ // check tag h3
813
+ if (!empty($tags_h3)) {
814
+ foreach ($tags_h3 as $order => $tagh3) {
815
+ $words_tagh3 = preg_split(
816
+ '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
817
+ utf8_decode(strtolower($tagh3->nodeValue)),
818
+ -1,
819
+ PREG_SPLIT_NO_EMPTY
820
+ );
821
+ if (is_array($words_tagh3) && is_array($words_post_title)) {
822
+ foreach ($words_tagh3 as $mh) {
823
+ if (in_array($mh, $words_post_title) && $mh != '') {
824
+ $test = true;
825
+ }
826
  }
827
  }
828
  }
829
  }
 
830
 
831
+ // check tag h4
832
+ if (!empty($tags_h4)) {
833
+ foreach ($tags_h4 as $order => $tagh4) {
834
+ $words_tagh4 = preg_split(
835
+ '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
836
+ utf8_decode(strtolower($tagh4->nodeValue)),
837
+ -1,
838
+ PREG_SPLIT_NO_EMPTY
839
+ );
840
+ if (is_array($words_tagh4) && is_array($words_post_title)) {
841
+ foreach ($words_tagh4 as $mh) {
842
+ if (in_array($mh, $words_post_title) && $mh != '') {
843
+ $test = true;
844
+ }
845
  }
846
  }
847
  }
848
  }
 
849
 
850
+ // check tag h5
851
+ if (!empty($tags_h5)) {
852
+ foreach ($tags_h5 as $order => $tagh5) {
853
+ $words_tagh5 = preg_split(
854
+ '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
855
+ utf8_decode(strtolower($tagh5->nodeValue)),
856
+ -1,
857
+ PREG_SPLIT_NO_EMPTY
858
+ );
859
+ if (is_array($words_tagh5) && is_array($words_post_title)) {
860
+ foreach ($words_tagh5 as $mh) {
861
+ if (in_array($mh, $words_post_title) && $mh != '') {
862
+ $test = true;
863
+ }
864
  }
865
  }
866
  }
867
  }
 
868
 
869
+ // check tag h6
870
+ if (!empty($tags_h6)) {
871
+ foreach ($tags_h6 as $order => $tagh6) {
872
+ $words_tagh6 = preg_split(
873
+ '/((^\p{P}+)|(\p{P}*\s+\p{P}*)|(\p{P}+$))/',
874
+ utf8_decode(strtolower($tagh6->nodeValue)),
875
+ -1,
876
+ PREG_SPLIT_NO_EMPTY
877
+ );
878
+ if (is_array($words_tagh6) && is_array($words_post_title)) {
879
+ foreach ($words_tagh6 as $mh) {
880
+ if (in_array($mh, $words_post_title) && $mh != '') {
881
+ $test = true;
882
+ }
883
  }
884
  }
885
  }
886
  }
887
  }
 
888
 
889
+ if ($test) {
890
+ $output .= $this->createFieldAnalysis(
891
+ 'heading_title',
892
+ $tooltip_page['title_in_heading'],
893
+ 'done',
894
+ __('Page title word in content heading', 'wp-meta-seo'),
895
+ 1
896
+ );
897
+ $check++;
898
+ } else {
899
+ $output .= $this->createFieldAnalysis(
900
+ 'heading_title',
901
+ $tooltip_page['title_in_heading'],
902
+ 'warning',
903
+ __('Page title word in content heading', 'wp-meta-seo'),
904
+ 0
905
+ );
906
+ }
907
  } else {
908
  $output .= $this->createFieldAnalysis(
909
  'heading_title',
913
  0
914
  );
915
  }
 
 
 
 
 
 
 
 
916
  }
917
  }
918
 
942
  $test1 = false;
943
  }
944
 
945
+ if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['content_title'])) {
946
  $output .= $this->createFieldAnalysis(
947
  'content_title',
948
  $tooltip_page['title_in_content'],
952
  );
953
  $check++;
954
  } else {
955
+ if ($test1) {
956
+ $output .= $this->createFieldAnalysis(
957
+ 'content_title',
958
+ $tooltip_page['title_in_content'],
959
+ 'done',
960
+ __('Page title word in content', 'wp-meta-seo'),
961
+ 1
962
+ );
963
+ $check++;
964
+ } else {
965
+ $output .= $this->createFieldAnalysis(
966
+ 'content_title',
967
+ $tooltip_page['title_in_content'],
968
+ 'warning',
969
+ __('Page title word in content', 'wp-meta-seo'),
970
+ 0
971
+ );
972
+ }
973
  }
974
 
975
  // page url matches page title
976
  $mtitle = $_POST['datas']['title'];
977
+ if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['pageurl'])) {
978
  $output .= $this->createFieldAnalysis(
979
  'pageurl',
980
  $tooltip_page['page_url'],
984
  );
985
  $check++;
986
  } else {
987
+ if ($_POST['datas']['editor'] == 'gutenberg') {
988
+ $infos = pathinfo($_POST['datas']['mpageurl']);
989
+ $mpageurl = $infos['filename'];
990
+ } else {
991
+ $mpageurl = $_POST['datas']['mpageurl'];
992
+ }
993
+
994
+ if ($mpageurl == sanitize_title($mtitle)) {
995
+ $output .= $this->createFieldAnalysis(
996
+ 'pageurl',
997
+ $tooltip_page['page_url'],
998
+ 'done',
999
+ __('Page url matches with page title', 'wp-meta-seo'),
1000
+ 1
1001
+ );
1002
+ $check++;
1003
+ } else {
1004
+ $output .= $this->createFieldAnalysis(
1005
+ 'pageurl',
1006
+ $tooltip_page['page_url'],
1007
+ 'warning',
1008
+ __('Page url matches with page title', 'wp-meta-seo'),
1009
+ 0
1010
+ );
1011
+ }
1012
  }
1013
 
1014
  // meta title filled
1015
+ if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['metatitle'])) {
 
1016
  $output .= $this->createFieldAnalysis(
1017
  'metatitle',
1018
  $tooltip_page['meta_title'],
1022
  );
1023
  $check++;
1024
  } else {
1025
+ if (($_POST['datas']['meta_title'] != ''
1026
+ && mb_strlen($_POST['datas']['meta_title'], 'UTF-8') <= self::$title_length)) {
1027
+ $output .= $this->createFieldAnalysis(
1028
+ 'metatitle',
1029
+ $tooltip_page['meta_title'],
1030
+ 'done',
1031
+ __('Meta title filled', 'wp-meta-seo'),
1032
+ 1
1033
+ );
1034
+ $check++;
1035
+ } else {
1036
+ $output .= $this->createFieldAnalysis(
1037
+ 'metatitle',
1038
+ $tooltip_page['meta_title'],
1039
+ 'warning',
1040
+ __('Meta title filled', 'wp-meta-seo'),
1041
+ 0
1042
+ );
1043
+ }
1044
  }
1045
 
1046
  // desc filled
1047
+ if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['metadesc'])) {
 
1048
  $output .= $this->createFieldAnalysis(
1049
  'metadesc',
1050
  $tooltip_page['meta_desc'],
1054
  );
1055
  $check++;
1056
  } else {
1057
+ if ($_POST['datas']['meta_desc'] != ''
1058
+ && mb_strlen($_POST['datas']['meta_desc'], 'UTF-8') <= self::$desc_length) {
1059
+ $output .= $this->createFieldAnalysis(
1060
+ 'metadesc',
1061
+ $tooltip_page['meta_desc'],
1062
+ 'done',
1063
+ __('Meta description filled', 'wp-meta-seo'),
1064
+ 1
1065
+ );
1066
+ $check++;
1067
+ } else {
1068
+ $output .= $this->createFieldAnalysis(
1069
+ 'metadesc',
1070
+ $tooltip_page['meta_desc'],
1071
+ 'warning',
1072
+ __('Meta description filled', 'wp-meta-seo'),
1073
+ 0
1074
+ );
1075
+ }
1076
  }
1077
 
1078
  // image resize
1088
  'imgalt',
1089
  $tooltip_page['image_alt'],
1090
  'done',
1091
+ __('Image have meta alt', 'wp-meta-seo'),
1092
  1
1093
  );
1094
  $check += 2;
1110
  continue;
1111
  }
1112
 
1113
+ if ((int)$tag->getAttribute('width') == 0 && (int)$tag->getAttribute('height') == 0) {
1114
+ $img_wrong = false;
1115
+ } else {
1116
+ if (!empty($width_origin) && !empty($height_origin)) {
1117
+ if (((int)$width_origin != (int)$tag->getAttribute('width'))
1118
+ || ((int)$height_origin != (int)$tag->getAttribute('height'))) {
1119
+ $img_wrong = true;
1120
+ }
1121
  }
1122
  }
1123
 
 
1124
  $image_alt = $tag->getAttribute('alt');
1125
+ if ($image_alt == '') {
1126
  $img_wrong_alt = true;
1127
  }
1128
  }
1129
 
1130
+ if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['imgresize'])) {
1131
  $output .= $this->createFieldAnalysis(
1132
  'imgresize',
1133
  $tooltip_page['image_resize'],
1137
  );
1138
  $check++;
1139
  } else {
1140
+ if ($img_wrong == false) {
1141
+ $output .= $this->createFieldAnalysis(
1142
+ 'imgresize',
1143
+ $tooltip_page['image_resize'],
1144
+ 'done',
1145
+ __('Wrong image resize', 'wp-meta-seo'),
1146
+ 1
1147
+ );
1148
+ $check++;
1149
+ } else {
1150
+ $output .= $this->createFieldAnalysis(
1151
+ 'imgresize',
1152
+ $tooltip_page['image_resize'],
1153
+ 'warning',
1154
+ __('Wrong image resize', 'wp-meta-seo'),
1155
+ 0
1156
+ );
1157
+ }
1158
  }
1159
 
1160
+ if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['imgalt'])) {
1161
  $output .= $this->createFieldAnalysis(
1162
  'imgalt',
1163
  $tooltip_page['image_alt'],
1164
  'done',
1165
+ __('Image have meta alt', 'wp-meta-seo'),
1166
  1
1167
  );
1168
  $check++;
1169
  } else {
1170
+ if ($img_wrong_alt == false) {
1171
+ $output .= $this->createFieldAnalysis(
1172
+ 'imgalt',
1173
+ $tooltip_page['image_alt'],
1174
+ 'done',
1175
+ __('Image have meta alt', 'wp-meta-seo'),
1176
+ 1
1177
+ );
1178
+ $check++;
1179
+ } else {
1180
+ $output .= $this->createFieldAnalysis(
1181
+ 'imgalt',
1182
+ $tooltip_page['image_alt'],
1183
+ 'warning',
1184
+ __('Image have meta alt', 'wp-meta-seo'),
1185
+ 0
1186
+ );
1187
+ }
1188
  }
1189
+
1190
  } else {
1191
  $output .= $this->createFieldAnalysis(
1192
  'imgresize',
1199
  'imgalt',
1200
  $tooltip_page['image_alt'],
1201
  'warning',
1202
+ __('Image have meta alt', 'wp-meta-seo'),
1203
  0
1204
  );
1205
  }
1229
  wp_send_json(true);
1230
  }
1231
 
1232
+ /**
1233
+ * Remove link in source 404
1234
+ */
1235
+ public function removeLink()
1236
+ {
1237
+ if (!current_user_can('manage_options')) {
1238
+ wp_send_json(array('status' => false));
1239
+ }
1240
+
1241
+ global $wpdb;
1242
+ if (isset($_POST['link_id'])) {
1243
+ $wpdb->delete($wpdb->prefix . 'wpms_links', array('id' => (int)$_POST['link_id']));
1244
+ wp_send_json(array('status' => true));
1245
+ }
1246
+
1247
+ wp_send_json(array('status' => false));
1248
+ }
1249
+
1250
  /**
1251
  * Ajax update link meta title and content editor
1252
  */
1260
  $sql = $wpdb->prepare(
1261
  "SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE id=%d",
1262
  array(
1263
+ (int)$_POST['link_id']
1264
  )
1265
  );
1266
  $link_detail = $wpdb->get_row($sql);
3315
  case 'update_link':
3316
  $this->updateLink();
3317
  break;
3318
+ case 'remove_link':
3319
+ $this->removeLink();
3320
+ break;
3321
  case 'save_settings404':
3322
  $this->save404Settings();
3323
  break;
inc/class.metaseo-broken-link-table.php CHANGED
@@ -190,10 +190,10 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
190
  $class[] = $desc_first ? 'asc' : 'desc';
191
  }
192
  $hr = esc_url(add_query_arg(compact('orderby', 'order'), $current_url));
193
- $column_display_name = '<a href="' . $hr . '">';
194
- $column_display_name .= '<span>' . $column_display_name . '</span>';
195
- $column_display_name .= '<span class="sorting-indicator"></span>';
196
- $column_display_name .= '</a>';
197
  }
198
 
199
  $id = $with_id ? "id='$column_key'" : '';
@@ -203,9 +203,9 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
203
  }
204
 
205
  if ($column_key === 'cb') {
206
- echo "<th scope='col' $id $class style='padding:8px 10px;'>$column_display_name</th>";
207
  } else {
208
- echo "<th scope='col' $id $class $style colspan=\"3\">$column_display_name</th>";
209
  }
210
  }
211
  }
@@ -1228,6 +1228,7 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
1228
  if ($post->post_excerpt != 'metaseo_404_page') {
1229
  if ($post->post_status == 'publish') {
1230
  if (isset($post->post_content) && $post->post_content != '') {
 
1231
  preg_match_all("#<a[^>]*>.*?</a>#si", $post->post_content, $matches, PREG_PATTERN_ORDER);
1232
  foreach (array_unique($matches[0]) as $i => $content) {
1233
  $dom->loadHTML($content);
@@ -1257,6 +1258,7 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
1257
  );
1258
  }
1259
 
 
1260
  preg_match_all(
1261
  '/(<img[\s]+[^>]*src\s*=\s*)([\"\'])([^>]+?)\2([^<>]*>)/i',
1262
  $post->post_content,
@@ -1415,7 +1417,12 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
1415
 
1416
  // scan link in comment content
1417
  $k = 0;
1418
- $off_set = ($_POST['comment_paged'] - 1) * $limit_comment_content;
 
 
 
 
 
1419
  $query = "SELECT * FROM " . $wpdb->prefix . "comments
1420
  WHERE comment_approved = 1 AND comment_content != '' LIMIT $limit_comment_content OFFSET $off_set";
1421
  $comments_content = $wpdb->get_results($query);
190
  $class[] = $desc_first ? 'asc' : 'desc';
191
  }
192
  $hr = esc_url(add_query_arg(compact('orderby', 'order'), $current_url));
193
+ $column_name = '<a href="' . $hr . '">';
194
+ $column_name .= '<span>' . $column_display_name . '</span>';
195
+ $column_name .= '<span class="sorting-indicator"></span>';
196
+ $column_name .= '</a>';
197
  }
198
 
199
  $id = $with_id ? "id='$column_key'" : '';
203
  }
204
 
205
  if ($column_key === 'cb') {
206
+ echo "<th scope='col' $id $class style='padding:8px 10px;'>$column_name</th>";
207
  } else {
208
+ echo "<th scope='col' $id $class $style colspan=\"3\">$column_name</th>";
209
  }
210
  }
211
  }
1228
  if ($post->post_excerpt != 'metaseo_404_page') {
1229
  if ($post->post_status == 'publish') {
1230
  if (isset($post->post_content) && $post->post_content != '') {
1231
+ // find <a> tag in current post content
1232
  preg_match_all("#<a[^>]*>.*?</a>#si", $post->post_content, $matches, PREG_PATTERN_ORDER);
1233
  foreach (array_unique($matches[0]) as $i => $content) {
1234
  $dom->loadHTML($content);
1258
  );
1259
  }
1260
 
1261
+ // find <img> tag in current post content
1262
  preg_match_all(
1263
  '/(<img[\s]+[^>]*src\s*=\s*)([\"\'])([^>]+?)\2([^<>]*>)/i',
1264
  $post->post_content,
1417
 
1418
  // scan link in comment content
1419
  $k = 0;
1420
+ if (isset($_POST['comment_paged'])) {
1421
+ $off_set = ($_POST['comment_paged'] - 1) * $limit_comment_content;
1422
+ } else {
1423
+ $off_set = 0;
1424
+ }
1425
+
1426
  $query = "SELECT * FROM " . $wpdb->prefix . "comments
1427
  WHERE comment_approved = 1 AND comment_content != '' LIMIT $limit_comment_content OFFSET $off_set";
1428
  $comments_content = $wpdb->get_results($query);
inc/class.metaseo-content-list-table.php CHANGED
@@ -300,6 +300,7 @@ class MetaSeoContentListTable extends WP_List_Table
300
  } else {
301
  $post_type = "'" . $post_type . "'";
302
  }
 
303
  $where[] = "post_type IN ($post_type)";
304
 
305
  $states = get_post_stati(array('show_in_admin_all_list' => true));
@@ -348,11 +349,11 @@ class MetaSeoContentListTable extends WP_List_Table
348
  if (isset($_GET['wpms_duplicate_meta']) && $_GET['wpms_duplicate_meta'] != 'none') {
349
  if ($_GET['wpms_duplicate_meta'] == 'duplicate_title') {
350
  $where[] = "mt.meta_key = '_metaseo_metatitle'";
351
- $where[] = "mt.meta_value IN (SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key='_metaseo_metatitle' GROUP BY meta_value HAVING COUNT(*) >= 2)";
352
 
353
  } elseif ($_GET['wpms_duplicate_meta'] == 'duplicate_desc') {
354
  $where[] = "md.meta_key = '_metaseo_metadesc'";
355
- $where[] = "md.meta_value IN (SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key='_metaseo_metadesc' GROUP BY meta_value HAVING COUNT(*) >= 2)";
356
  }
357
  }
358
 
@@ -367,7 +368,6 @@ class MetaSeoContentListTable extends WP_List_Table
367
  . " WHERE " . implode(' AND ', $where) . $orderStr;
368
 
369
  $total_items = $wpdb->get_var($query);
370
-
371
  $query = "SELECT DISTINCT ID, post_title, post_name, post_type, post_status,
372
  mt.meta_value AS metatitle, md.meta_value AS metadesc ,mk.meta_value AS metakeywords "
373
  . " FROM $wpdb->posts"
300
  } else {
301
  $post_type = "'" . $post_type . "'";
302
  }
303
+
304
  $where[] = "post_type IN ($post_type)";
305
 
306
  $states = get_post_stati(array('show_in_admin_all_list' => true));
349
  if (isset($_GET['wpms_duplicate_meta']) && $_GET['wpms_duplicate_meta'] != 'none') {
350
  if ($_GET['wpms_duplicate_meta'] == 'duplicate_title') {
351
  $where[] = "mt.meta_key = '_metaseo_metatitle'";
352
+ $where[] = "mt.meta_value IN (SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key='_metaseo_metatitle' AND meta_value != '' GROUP BY meta_value HAVING COUNT(*) >= 2)";
353
 
354
  } elseif ($_GET['wpms_duplicate_meta'] == 'duplicate_desc') {
355
  $where[] = "md.meta_key = '_metaseo_metadesc'";
356
+ $where[] = "md.meta_value IN (SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key='_metaseo_metadesc' AND meta_value != '' GROUP BY meta_value HAVING COUNT(*) >= 2)";
357
  }
358
  }
359
 
368
  . " WHERE " . implode(' AND ', $where) . $orderStr;
369
 
370
  $total_items = $wpdb->get_var($query);
 
371
  $query = "SELECT DISTINCT ID, post_title, post_name, post_type, post_status,
372
  mt.meta_value AS metatitle, md.meta_value AS metadesc ,mk.meta_value AS metakeywords "
373
  . " FROM $wpdb->posts"
inc/class.metaseo-dashboard.php CHANGED
@@ -28,15 +28,13 @@ class MetaSeoDashboard
28
  $imgs = 0;
29
  $imgs_are_good = 0;
30
  $imgs_metas_are_good = array();
31
- $meta_keys = array('alt', 'title');
32
  $response = array(
33
  'imgs_statis' => array(0, 0, 100),
34
  'imgs_metas_statis' => array(0, 0, 100),
35
  );
36
- foreach ($meta_keys as $meta_key) {
37
- $imgs_metas_are_good[$meta_key] = 0;
38
- $imgs_metas_are_not_good[$meta_key] = 0;
39
- }
40
 
41
  $post_types = MetaSeoContentListTable::getPostTypes();
42
  $query = "SELECT `ID`,`post_content`
@@ -91,11 +89,9 @@ class MetaSeoDashboard
91
  $imgs_are_good++;
92
  }
93
 
94
- foreach ($meta_keys as $meta_key) {
95
- if (trim($tag->getAttribute($meta_key))
96
- || (!empty($meta_analysis) && !empty($meta_analysis['imgalt']))) {
97
- $imgs_metas_are_good[$meta_key]++;
98
- }
99
  }
100
  }
101
 
@@ -104,7 +100,7 @@ class MetaSeoDashboard
104
  }
105
 
106
  //Report analytic of images optimization
107
- $imgs_metas = ceil(($imgs_metas_are_good['alt'] + $imgs_metas_are_good['title']) / 2);
108
  $response['imgs_statis'][0] = $imgs_are_good;
109
  $response['imgs_statis'][1] = $imgs;
110
  $response['imgs_metas_statis'][0] = $imgs_metas;
@@ -244,14 +240,18 @@ class MetaSeoDashboard
244
  public static function getCountPost()
245
  {
246
  global $wpdb;
 
247
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
248
- $post_types = "'" . implode("', '", $post_types) . "'";
 
249
  $states = get_post_stati(array('show_in_admin_all_list' => true));
250
- $states['trash'] = 'trash';
251
  $all_states = "'" . implode("', '", $states) . "'";
252
- $total_posts = $wpdb->get_var(
253
- "SELECT COUNT(*) FROM $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types)"
254
- );
 
 
 
255
  return $total_posts;
256
  }
257
 
@@ -309,14 +309,7 @@ class MetaSeoDashboard
309
  public static function dashboardMetaTitle()
310
  {
311
  $results = MetaSeoDashboard::updateDashboard('metatitle');
312
- if (isset($_POST['type']) && $_POST['type'] == 'dashboard_widgets') {
313
- wp_send_json($results);
314
- }
315
- ob_start();
316
- require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/meta_title.php';
317
- $html = ob_get_contents();
318
- ob_end_clean();
319
- wp_send_json($html);
320
  }
321
 
322
  /**
@@ -373,14 +366,7 @@ class MetaSeoDashboard
373
  public static function dashboardMetaDesc()
374
  {
375
  $results = MetaSeoDashboard::updateDashboard('metadesc');
376
- if (isset($_POST['type']) && $_POST['type'] == 'dashboard_widgets') {
377
- wp_send_json($results);
378
- }
379
- ob_start();
380
- require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/meta_desc.php';
381
- $html = ob_get_contents();
382
- ob_end_clean();
383
- wp_send_json($html);
384
  }
385
 
386
  /**
@@ -390,9 +376,9 @@ class MetaSeoDashboard
390
  public static function linkMeta()
391
  {
392
  global $wpdb;
393
- $mlink_complete = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "wpms_links WHERE meta_title !=''");
394
  $mcount_link = $wpdb->get_var(
395
- "SELECT COUNT(*) FROM " . $wpdb->prefix . "wpms_links WHERE type !='404_automaticaly'"
396
  );
397
 
398
  if ($mcount_link == 0) {
@@ -411,14 +397,7 @@ class MetaSeoDashboard
411
  public static function dashboardLinkMeta()
412
  {
413
  $results = MetaSeoDashboard::linkMeta();
414
- if (isset($_POST['type']) && $_POST['type'] == 'dashboard_widgets') {
415
- wp_send_json($results);
416
- }
417
- ob_start();
418
- require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/link_meta.php';
419
- $html = ob_get_contents();
420
- ob_end_clean();
421
- wp_send_json($html);
422
  }
423
 
424
  /**
@@ -447,14 +426,7 @@ class MetaSeoDashboard
447
  public static function dashboardPermalink()
448
  {
449
  $permalink = MetaSeoDashboard::permalink();
450
- if (isset($_POST['type']) && $_POST['type'] == 'dashboard_widgets') {
451
- wp_send_json($permalink);
452
- }
453
- ob_start();
454
- require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/permalink.php';
455
- $html = ob_get_contents();
456
- ob_end_clean();
457
- wp_send_json($html);
458
  }
459
 
460
  /**
@@ -492,14 +464,7 @@ class MetaSeoDashboard
492
  public static function dashboardNewContent()
493
  {
494
  $results = MetaSeoDashboard::updateDashboard('newcontent');
495
- if (isset($_POST['type']) && $_POST['type'] == 'dashboard_widgets') {
496
- wp_send_json($results);
497
- }
498
- ob_start();
499
- require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/new_content.php';
500
- $html = ob_get_contents();
501
- ob_end_clean();
502
- wp_send_json($html);
503
  }
504
 
505
  /**
@@ -580,32 +545,6 @@ class MetaSeoDashboard
580
  return array('image_optimize' => $image_optimize, 'count_image' => $count_image, 'percent' => $precent);
581
  }
582
 
583
- /**
584
- * get meta data dashboard
585
- * @param string $name param name
586
- * @return array
587
- */
588
- public static function getMetaDataDashBoard($name)
589
- {
590
- $results = array();
591
- switch ($name) {
592
- case 'metatitle':
593
- $results = MetaSeoDashboard::metaTitle();
594
- break;
595
- case 'metadesc':
596
- $results = MetaSeoDashboard::metaDesc();
597
- break;
598
- case 'newcontent':
599
- $results = MetaSeoDashboard::newContent();
600
- break;
601
- case 'image_meta':
602
- $results = MetaSeoDashboard::moptimizationChecking();
603
- break;
604
- }
605
-
606
- return $results;
607
- }
608
-
609
  /**
610
  * update time dashboard update
611
  * @param $name
@@ -624,24 +563,26 @@ class MetaSeoDashboard
624
  */
625
  public static function updateOptionDash($options_dashboard, $name)
626
  {
627
- if (!empty($options_dashboard) && is_array($options_dashboard)) {
628
- if (empty($options_dashboard[$name])) {
629
- $results = MetaSeoDashboard::getMetaDataDashBoard($name);
630
- $options_dashboard[$name] = $results;
631
- update_option('options_dashboard', $options_dashboard);
632
- MetaSeoDashboard::dashLastUpdate($name);
633
- } else {
634
- $option_last_update_post = get_option('wpms_last_update_post');
635
- $option_last_dash_update = get_option('_wpms_dash_last_update');
636
- if (!empty($option_last_update_post) && $option_last_update_post > $option_last_dash_update) {
637
- $results = MetaSeoDashboard::getMetaDataDashBoard($name);
638
- $options_dashboard[$name] = $results;
639
- update_option('options_dashboard', $options_dashboard);
640
- MetaSeoDashboard::dashLastUpdate($name);
641
- }
 
 
 
 
642
  }
643
- } else {
644
- $results = MetaSeoDashboard::getMetaDataDashBoard($name);
645
  $options_dashboard[$name] = $results;
646
  update_option('options_dashboard', $options_dashboard);
647
  MetaSeoDashboard::dashLastUpdate($name);
@@ -657,7 +598,7 @@ class MetaSeoDashboard
657
  $imgs = 0;
658
  $imgs_are_good = 0;
659
  $imgs_metas_are_good = array();
660
- $meta_keys = array('alt', 'title');
661
  // create default value
662
  $response = array(
663
  'imgs_statis' => array(0, 0, 100),
@@ -671,16 +612,13 @@ class MetaSeoDashboard
671
  if (!empty($options_dashboard) && is_array($options_dashboard)
672
  && !empty($options_dashboard['image_meta']) && $option_last_update_post < $option_last_dash_update) {
673
  $results = $options_dashboard['image_meta'];
674
- if (isset($_POST['type']) && $_POST['type'] == 'dashboard_widgets') {
675
- $results['status'] = true;
676
- wp_send_json($results);
677
- }
678
  }
679
 
680
  // find img good and not good in post content to update
681
  foreach ($meta_keys as $meta_key) {
682
  $imgs_metas_are_good[$meta_key] = 0;
683
- $imgs_metas_are_not_good[$meta_key] = 0;
684
  }
685
 
686
  $limit = 50;
@@ -743,19 +681,19 @@ class MetaSeoDashboard
743
  $imgs_metas_are_good[$meta_key]++;
744
  }
745
  }
 
746
  }
747
-
748
- $imgs++;
749
  }
750
  }
751
 
 
752
  //Report analytic of images optimization
753
- $c_imgs_metas = ceil(($imgs_metas_are_good['alt'] + $imgs_metas_are_good['title']) / 2);
 
754
  $response['imgs_statis'][0] = $imgs_are_good + (int)$_POST['imgs_statis'];
755
- $response['imgs_statis'][1] = $imgs + (int)$_POST['imgs_count'];
756
  $response['imgs_metas_statis'][0] = $c_imgs_metas + (int)$_POST['imgs_metas_statis'];
757
- $response['imgs_metas_statis'][1] = $imgs + (int)$_POST['imgs_count'];
758
- $response['imgs_count'] = $imgs + (int)$_POST['imgs_count'];
759
  $response['page'] = (int)$_POST['page'];
760
  } else {
761
  if (!empty($_POST['imgs_count'])) {
28
  $imgs = 0;
29
  $imgs_are_good = 0;
30
  $imgs_metas_are_good = array();
 
31
  $response = array(
32
  'imgs_statis' => array(0, 0, 100),
33
  'imgs_metas_statis' => array(0, 0, 100),
34
  );
35
+
36
+ $imgs_metas_are_good['alt'] = 0;
37
+ $imgs_metas_are_not_good['alt'] = 0;
 
38
 
39
  $post_types = MetaSeoContentListTable::getPostTypes();
40
  $query = "SELECT `ID`,`post_content`
89
  $imgs_are_good++;
90
  }
91
 
92
+ if (trim($tag->getAttribute('alt'))
93
+ || (!empty($meta_analysis) && !empty($meta_analysis['imgalt']))) {
94
+ $imgs_metas_are_good['alt']++;
 
 
95
  }
96
  }
97
 
100
  }
101
 
102
  //Report analytic of images optimization
103
+ $imgs_metas = $imgs_metas_are_good['alt'];
104
  $response['imgs_statis'][0] = $imgs_are_good;
105
  $response['imgs_statis'][1] = $imgs;
106
  $response['imgs_metas_statis'][0] = $imgs_metas;
240
  public static function getCountPost()
241
  {
242
  global $wpdb;
243
+ $where = array();
244
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
245
+ $post_type = "'" . implode("', '", esc_sql($post_types)) . "'";
246
+ $where[] = "post_type IN ($post_type)";
247
  $states = get_post_stati(array('show_in_admin_all_list' => true));
 
248
  $all_states = "'" . implode("', '", $states) . "'";
249
+ $where[] = "post_status IN ($all_states)";
250
+ $query = "SELECT COUNT(ID) "
251
+ . " FROM $wpdb->posts "
252
+ . " WHERE " . implode(' AND ', $where);
253
+
254
+ $total_posts = $wpdb->get_var($query);
255
  return $total_posts;
256
  }
257
 
309
  public static function dashboardMetaTitle()
310
  {
311
  $results = MetaSeoDashboard::updateDashboard('metatitle');
312
+ wp_send_json($results);
 
 
 
 
 
 
 
313
  }
314
 
315
  /**
366
  public static function dashboardMetaDesc()
367
  {
368
  $results = MetaSeoDashboard::updateDashboard('metadesc');
369
+ wp_send_json($results);
 
 
 
 
 
 
 
370
  }
371
 
372
  /**
376
  public static function linkMeta()
377
  {
378
  global $wpdb;
379
+ $mlink_complete = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "wpms_links WHERE meta_title !='' AND type ='url'");
380
  $mcount_link = $wpdb->get_var(
381
+ "SELECT COUNT(*) FROM " . $wpdb->prefix . "wpms_links WHERE type ='url'"
382
  );
383
 
384
  if ($mcount_link == 0) {
397
  public static function dashboardLinkMeta()
398
  {
399
  $results = MetaSeoDashboard::linkMeta();
400
+ wp_send_json($results);
 
 
 
 
 
 
 
401
  }
402
 
403
  /**
426
  public static function dashboardPermalink()
427
  {
428
  $permalink = MetaSeoDashboard::permalink();
429
+ wp_send_json($permalink);
 
 
 
 
 
 
 
430
  }
431
 
432
  /**
464
  public static function dashboardNewContent()
465
  {
466
  $results = MetaSeoDashboard::updateDashboard('newcontent');
467
+ wp_send_json($results);
 
 
 
 
 
 
 
468
  }
469
 
470
  /**
545
  return array('image_optimize' => $image_optimize, 'count_image' => $count_image, 'percent' => $precent);
546
  }
547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
  /**
549
  * update time dashboard update
550
  * @param $name
563
  */
564
  public static function updateOptionDash($options_dashboard, $name)
565
  {
566
+ $last_update_post = get_option('wpms_last_update_post');
567
+ $last_dash_update = get_option('_wpms_dash_last_update');
568
+ if (empty($options_dashboard) || is_array($options_dashboard)
569
+ || (!empty($options_dashboard) && empty($options_dashboard[$name]))
570
+ || (!empty($options_dashboard) && !empty($options_dashboard[$name]) && !empty($last_update_post) && $last_update_post > $last_dash_update)) {
571
+ $results = array();
572
+ switch ($name) {
573
+ case 'metatitle':
574
+ $results = MetaSeoDashboard::metaTitle();
575
+ break;
576
+ case 'metadesc':
577
+ $results = MetaSeoDashboard::metaDesc();
578
+ break;
579
+ case 'newcontent':
580
+ $results = MetaSeoDashboard::newContent();
581
+ break;
582
+ case 'image_meta':
583
+ $results = MetaSeoDashboard::moptimizationChecking();
584
+ break;
585
  }
 
 
586
  $options_dashboard[$name] = $results;
587
  update_option('options_dashboard', $options_dashboard);
588
  MetaSeoDashboard::dashLastUpdate($name);
598
  $imgs = 0;
599
  $imgs_are_good = 0;
600
  $imgs_metas_are_good = array();
601
+ $meta_keys = array('alt');
602
  // create default value
603
  $response = array(
604
  'imgs_statis' => array(0, 0, 100),
612
  if (!empty($options_dashboard) && is_array($options_dashboard)
613
  && !empty($options_dashboard['image_meta']) && $option_last_update_post < $option_last_dash_update) {
614
  $results = $options_dashboard['image_meta'];
615
+ $results['status'] = true;
616
+ wp_send_json($results);
 
 
617
  }
618
 
619
  // find img good and not good in post content to update
620
  foreach ($meta_keys as $meta_key) {
621
  $imgs_metas_are_good[$meta_key] = 0;
 
622
  }
623
 
624
  $limit = 50;
681
  $imgs_metas_are_good[$meta_key]++;
682
  }
683
  }
684
+ $imgs++;
685
  }
 
 
686
  }
687
  }
688
 
689
+ $countImg = $imgs + (int)$_POST['imgs_count'];
690
  //Report analytic of images optimization
691
+ $c_imgs_metas = $imgs_metas_are_good['alt'];
692
+ // get results for image resize
693
  $response['imgs_statis'][0] = $imgs_are_good + (int)$_POST['imgs_statis'];
694
+ // get results for image meta
695
  $response['imgs_metas_statis'][0] = $c_imgs_metas + (int)$_POST['imgs_metas_statis'];
696
+ $response['imgs_statis'][1] = $response['imgs_metas_statis'][1] = $response['imgs_count'] = $countImg;
 
697
  $response['page'] = (int)$_POST['page'];
698
  } else {
699
  if (!empty($_POST['imgs_count'])) {
inc/class.metaseo-image-list-table.php CHANGED
@@ -518,6 +518,11 @@ $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types) O
518
  $this->_column_headers = array($columns, $hidden, $sortable);
519
 
520
  $this->items = $wpdb->get_results($query);
 
 
 
 
 
521
  }
522
 
523
  /**
@@ -1395,7 +1400,6 @@ $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types) O
1395
 
1396
  if ($meta_type != 'alt_text') {
1397
  $data = array('ID' => $post_id, $aliases[$meta_type] => $meta_value);
1398
-
1399
  if (wp_update_post($data)) {
1400
  $response->updated = true;
1401
  $response->msg = __($label . ' was saved', 'wp-meta-seo');
@@ -1406,11 +1410,12 @@ $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types) O
1406
  $response->msg = __($label . ' was saved', 'wp-meta-seo');
1407
  }
1408
 
1409
- if ($meta_type == 'alt_text' || $meta_type == 'image_title') {
1410
  $settings = get_option('_metaseo_settings');
1411
  if (!isset($settings['metaseo_overridemeta']) || (!empty($settings['metaseo_overridemeta'])
1412
  && $settings['metaseo_overridemeta'] == 1)) {
1413
  // call function auto override in content
 
1414
  self::autoUpdatePostContent($post_id, $meta_type, $meta_value);
1415
  $response->type = 'auto_override';
1416
  $response->pid = $post_id;
@@ -1440,7 +1445,6 @@ $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types) O
1440
  if (method_exists('MetaSeoImageListTable', $fn)) {
1441
  //Get list of posts contain this image and its clones
1442
  $posts = ImageHelper::getPostList($post_id, 'fix_metas');
1443
-
1444
  if (count($posts) > 0) {
1445
  $img_counter = 0;
1446
  //Now the time to resize the images
@@ -1744,6 +1748,7 @@ $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types) O
1744
  if (!wp_update_post(array('ID' => $post->ID, 'post_content' => $post_content))) {
1745
  $response->msg = __('The post haven\'t been updated, please check again!', 'wp-meta-seo');
1746
  } else {
 
1747
  $response->updated = true;
1748
  $response->msg = __(ucfirst($meta_type) . ' was saved', 'wp-meta-seo');
1749
  }
@@ -1994,8 +1999,8 @@ $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types) O
1994
  }
1995
 
1996
  /**
1997
- * Get attachment ID
1998
- * @param $url
1999
  * @return int
2000
  */
2001
  public static function getAttachmentId($url)
518
  $this->_column_headers = array($columns, $hidden, $sortable);
519
 
520
  $this->items = $wpdb->get_results($query);
521
+ if (isset($_GET['slmeta']) && ($_GET['slmeta'] == 'missing_information' || $_GET['slmeta'] == 'resizeimages')) {
522
+ foreach ($this->items as $item) {
523
+ $item->alt = get_post_meta($item->ID, '_wp_attachment_image_alt', true);
524
+ }
525
+ }
526
  }
527
 
528
  /**
1400
 
1401
  if ($meta_type != 'alt_text') {
1402
  $data = array('ID' => $post_id, $aliases[$meta_type] => $meta_value);
 
1403
  if (wp_update_post($data)) {
1404
  $response->updated = true;
1405
  $response->msg = __($label . ' was saved', 'wp-meta-seo');
1410
  $response->msg = __($label . ' was saved', 'wp-meta-seo');
1411
  }
1412
 
1413
+ if ($meta_type == 'alt_text') {
1414
  $settings = get_option('_metaseo_settings');
1415
  if (!isset($settings['metaseo_overridemeta']) || (!empty($settings['metaseo_overridemeta'])
1416
  && $settings['metaseo_overridemeta'] == 1)) {
1417
  // call function auto override in content
1418
+
1419
  self::autoUpdatePostContent($post_id, $meta_type, $meta_value);
1420
  $response->type = 'auto_override';
1421
  $response->pid = $post_id;
1445
  if (method_exists('MetaSeoImageListTable', $fn)) {
1446
  //Get list of posts contain this image and its clones
1447
  $posts = ImageHelper::getPostList($post_id, 'fix_metas');
 
1448
  if (count($posts) > 0) {
1449
  $img_counter = 0;
1450
  //Now the time to resize the images
1748
  if (!wp_update_post(array('ID' => $post->ID, 'post_content' => $post_content))) {
1749
  $response->msg = __('The post haven\'t been updated, please check again!', 'wp-meta-seo');
1750
  } else {
1751
+ update_option('wpms_last_update_post', time());
1752
  $response->updated = true;
1753
  $response->msg = __(ucfirst($meta_type) . ' was saved', 'wp-meta-seo');
1754
  }
1999
  }
2000
 
2001
  /**
2002
+ * Get attachment ID from URL
2003
+ * @param string $url URl of attachment
2004
  * @return int
2005
  */
2006
  public static function getAttachmentId($url)
inc/class.metaseo-link-list-table.php CHANGED
@@ -604,17 +604,28 @@ class MetaSeoLinkListTable extends WP_List_Table
604
 
605
  case 'post_id':
606
  $post = get_post($rec->source_id);
607
- $row_action = array(
608
- 'edit' => '<a target="_blank" href="' . get_edit_post_link($rec->source_id) . '"
 
 
 
 
 
 
 
 
 
609
  title="Edit this item">Edit</a>',
610
- 'view' => '<a target="_blank" href="' . get_permalink($rec->source_id) . '"
611
  title="View &#8220;test&#8221;" rel="permalink">View</a>'
612
- );
613
- echo '<td class="col_id" colspan="3">';
614
- echo '<a target="_blank"
615
  href="' . get_edit_post_link($rec->source_id) . '">' . $post->post_title . '</a>';
616
- echo $this->row_actions($row_action, false);
617
- echo '</td>';
 
 
618
  break;
619
 
620
  case 'col_link_url':
604
 
605
  case 'post_id':
606
  $post = get_post($rec->source_id);
607
+ if (empty($post)) {
608
+ echo '<td class="col_id" colspan="3">';
609
+ echo '<a target="_blank"
610
+ href="#">' . __('Not found', 'wp-meta-seo') . '</a>';
611
+ echo '<p class="wpms_remove_link"
612
+ data-link_id="' . $rec->id . '">
613
+ <span>' . __('Remove link', 'wp-meta-seo') . '</span></p>';
614
+ echo '</td>';
615
+ } else {
616
+ $row_action = array(
617
+ 'edit' => '<a target="_blank" href="' . get_edit_post_link($rec->source_id) . '"
618
  title="Edit this item">Edit</a>',
619
+ 'view' => '<a target="_blank" href="' . get_permalink($rec->source_id) . '"
620
  title="View &#8220;test&#8221;" rel="permalink">View</a>'
621
+ );
622
+ echo '<td class="col_id" colspan="3">';
623
+ echo '<a target="_blank"
624
  href="' . get_edit_post_link($rec->source_id) . '">' . $post->post_title . '</a>';
625
+ echo $this->row_actions($row_action, false);
626
+ echo '</td>';
627
+ }
628
+
629
  break;
630
 
631
  case 'col_link_url':
inc/class.metaseo-meta.php CHANGED
@@ -51,22 +51,22 @@ class WPMSEOMeta
51
  'help' => '',
52
  'rows' => 2
53
  ),
54
- 'keywords' => array(
55
  'type' => 'textarea',
56
  'title' => '',
57
  'default_value' => '',
 
 
58
  'description' => '',
59
  'help' => '',
60
- 'rows' => 2
61
  ),
62
- 'desc' => array(
63
  'type' => 'textarea',
64
  'title' => '',
65
  'default_value' => '',
66
- 'class' => 'desc',
67
- 'rows' => 3,
68
  'description' => '',
69
  'help' => '',
 
70
  ),
71
  'metaseo_chart' => array(
72
  'type' => 'metaseo_chart',
51
  'help' => '',
52
  'rows' => 2
53
  ),
54
+ 'desc' => array(
55
  'type' => 'textarea',
56
  'title' => '',
57
  'default_value' => '',
58
+ 'class' => 'desc',
59
+ 'rows' => 3,
60
  'description' => '',
61
  'help' => '',
 
62
  ),
63
+ 'keywords' => array(
64
  'type' => 'textarea',
65
  'title' => '',
66
  'default_value' => '',
 
 
67
  'description' => '',
68
  'help' => '',
69
+ 'rows' => 2
70
  ),
71
  'metaseo_chart' => array(
72
  'type' => 'metaseo_chart',
inc/class.metaseo-metabox.php CHANGED
@@ -291,7 +291,9 @@ class WPMSEOMetabox extends WPMSEOMeta
291
  }
292
 
293
  $cached_replacement_vars['sitename'] = get_option('blogname');
 
294
  $array_keyword = array(
 
295
  'field_prefix' => self::$form_prefix,
296
  'choose_image' => __('Use Image', 'wp-meta-seo'),
297
  'wpmseo_meta_desc_length' => self::$meta_length,
@@ -468,11 +470,9 @@ class WPMSEOMetabox extends WPMSEOMeta
468
  {
469
  $output = '<div class="metaseo_analysis metaseo_tool" data-title="' . $data_title . '" data-alt="' . $alt . '">';
470
  if ($dashicon == 'done') {
471
- $output .= '<i class="metaseo-dashicons material-icons dashicons-before"
472
- style="color:#46B450")">done</i>' . $label . '</div>';
473
  } else {
474
- $output .= '<i class="metaseo-dashicons material-icons dashicons-before"
475
- style="color:#FFB900")">warning</i>' . $label . '</div>';
476
  }
477
 
478
  $output .= '<input type="hidden" class="wpms_analysis_hidden" name="wpms[' . $data_title . ']"
291
  }
292
 
293
  $cached_replacement_vars['sitename'] = get_option('blogname');
294
+ $plugin_active = json_encode(get_option('active_plugins'));
295
  $array_keyword = array(
296
+ 'plugin_active' => $plugin_active,
297
  'field_prefix' => self::$form_prefix,
298
  'choose_image' => __('Use Image', 'wp-meta-seo'),
299
  'wpmseo_meta_desc_length' => self::$meta_length,
470
  {
471
  $output = '<div class="metaseo_analysis metaseo_tool" data-title="' . $data_title . '" data-alt="' . $alt . '">';
472
  if ($dashicon == 'done') {
473
+ $output .= '<i class="metaseo-dashicons material-icons dashicons-before icons-mboxdone">done</i>' . $label . '</div>';
 
474
  } else {
475
+ $output .= '<i class="metaseo-dashicons material-icons dashicons-before icons-mboxwarning">warning</i>' . $label . '</div>';
 
476
  }
477
 
478
  $output .= '<input type="hidden" class="wpms_analysis_hidden" name="wpms[' . $data_title . ']"
inc/class.metaseo-opengraph.php CHANGED
@@ -289,11 +289,20 @@ class MetaSeoOpenGraph
289
  * Get meta for front page
290
  * @return array
291
  */
292
- public function getFrontPageMeta()
293
  {
294
  $mpage_on_front = get_option('page_on_front');
295
  $title = esc_attr(get_post_meta($mpage_on_front, '_metaseo_metatitle', true));
296
  $desc = esc_attr(get_post_meta($mpage_on_front, '_metaseo_metadesc', true));
 
 
 
 
 
 
 
 
 
297
  $page_follow = get_post_meta($mpage_on_front, '_metaseo_metafollow', true);
298
  $page_index = get_post_meta($mpage_on_front, '_metaseo_metaindex', true);
299
  return array(
289
  * Get meta for front page
290
  * @return array
291
  */
292
+ public function getFrontPageMeta($settings)
293
  {
294
  $mpage_on_front = get_option('page_on_front');
295
  $title = esc_attr(get_post_meta($mpage_on_front, '_metaseo_metatitle', true));
296
  $desc = esc_attr(get_post_meta($mpage_on_front, '_metaseo_metadesc', true));
297
+
298
+ if ($title == '') {
299
+ $title = esc_attr($settings['metaseo_title_home']);
300
+ }
301
+
302
+ if ($desc == '') {
303
+ $desc = esc_attr($settings['metaseo_desc_home']);
304
+ }
305
+
306
  $page_follow = get_post_meta($mpage_on_front, '_metaseo_metafollow', true);
307
  $page_index = get_post_meta($mpage_on_front, '_metaseo_metaindex', true);
308
  return array(
inc/class.metaseo-sitemap.php CHANGED
@@ -338,7 +338,7 @@ class MetaSeoSitemap
338
  add_settings_field(
339
  'wpms_sitemap_include_lang',
340
  $label,
341
- array($this, 'wpms_sitemap_include_lang'),
342
  'metaseo_settings_sitemap',
343
  'metaseo_sitemap',
344
  array(
338
  add_settings_field(
339
  'wpms_sitemap_include_lang',
340
  $label,
341
+ array($this, 'sitemapIncludeLanguages'),
342
  'metaseo_settings_sitemap',
343
  'metaseo_sitemap',
344
  array(
inc/pages/dashboard.php CHANGED
@@ -158,7 +158,7 @@ $plugin_imgRecycle_file = 'imagerecycle-pdf-image-compression/wp-image-recycle.p
158
  </div>
159
 
160
  <div class="wpms_dash_widgets wpms_dash_imgsmeta"
161
- data-alt="<?php _e('We recommend to use both alt text and image title.
162
  The main advantage is that it helps search engines discover your images and display
163
  them in image search results. Plus, these tags improve the accessibility of your site
164
  and give more information about your images. Use our bulk
@@ -170,7 +170,7 @@ $plugin_imgRecycle_file = 'imagerecycle-pdf-image-compression/wp-image-recycle.p
170
  <div class="row">
171
  <div class="wpms_dashboard_widgets_left">
172
  <h4 class="panel-title dashboard-title">
173
- <?php _e('IMAGE TITLE/ALT', 'wp-meta-seo') ?>
174
  </h4>
175
  <h3 class="dashboard-title percent_1">0%</h3>
176
  <p class="dashboard-title percent_2">
158
  </div>
159
 
160
  <div class="wpms_dash_widgets wpms_dash_imgsmeta"
161
+ data-alt="<?php _e('We recommend to use both alt text.
162
  The main advantage is that it helps search engines discover your images and display
163
  them in image search results. Plus, these tags improve the accessibility of your site
164
  and give more information about your images. Use our bulk
170
  <div class="row">
171
  <div class="wpms_dashboard_widgets_left">
172
  <h4 class="panel-title dashboard-title">
173
+ <?php _e('IMAGE ALT', 'wp-meta-seo') ?>
174
  </h4>
175
  <h3 class="dashboard-title percent_1">0%</h3>
176
  <p class="dashboard-title percent_2">
inc/pages/dashboard/imgsmeta.php DELETED
@@ -1,25 +0,0 @@
1
- <div class="panel panel-success-full panel-updates">
2
- <div class="panel-body">
3
- <div class="row">
4
- <div class="col-xs-7 col-lg-8">
5
- <h4 class="panel-title text-success"><?php _e('Image title/alt', 'wp-meta-seo') ?></h4>
6
- <h3><?php echo $results['imgs_metas_statis'][2] . '%' ?></h3>
7
- <div class="progress">
8
- <div style="width: <?php echo $results['imgs_metas_statis'][2] . '%' ?>" aria-valuemax="100"
9
- aria-valuemin="0" aria-valuenow="<?php echo $results['imgs_metas_statis'][2] ?>"
10
- role="progressbar" class="progress-bar progress-bar-info">
11
- <span class="sr-only"><?php echo $results['imgs_metas_statis'][2] . '%' ?>
12
- Complete (success)</span>
13
- </div>
14
- </div>
15
- <p><?php _e('Image data filled (in content)', 'wp-meta-seo') ?>
16
- : <?php echo $results['imgs_metas_statis'][0] . '/' . $results['imgs_metas_statis'][1] ?></p>
17
- </div>
18
- <div class="col-xs-5 col-lg-4 text-right">
19
- <label>
20
- <input type="text" value="<?php echo $results['imgs_metas_statis'][2] ?>" class="dial-info">
21
- </label>
22
- </div>
23
- </div>
24
- </div>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pages/dashboard/imgsresize.php DELETED
@@ -1,24 +0,0 @@
1
- <div class="panel panel-danger-full panel-updates">
2
- <div class="panel-body">
3
- <div class="row">
4
- <div class="col-xs-7 col-lg-8">
5
- <h4 class="panel-title text-warning"><?php _e('HTML image resizing', 'wp-meta-seo') ?></h4>
6
- <h3><?php echo $results['imgs_statis'][2] . '%' ?></h3>
7
- <div class="progress">
8
- <div style="width: <?php echo $results['imgs_statis'][2] . '%' ?>" aria-valuemax="100"
9
- aria-valuemin="0" aria-valuenow="<?php echo $results['imgs_statis'][2] ?>" role="progressbar"
10
- class="progress-bar progress-bar-warning">
11
- <span class="sr-only"><?php echo $results['imgs_statis'][2] . '%' ?> Complete (success)</span>
12
- </div>
13
- </div>
14
- <p><?php _e('Wrong resized images', 'wp-meta-seo') ?>
15
- : <?php echo $results['imgs_statis'][0] . '/' . $results['imgs_statis'][1] ?></p>
16
- </div>
17
- <div class="col-xs-5 col-lg-4 text-right">
18
- <label>
19
- <input type="text" value="<?php echo $results['imgs_statis'][2] ?>" class="dial-warning">
20
- </label>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pages/dashboard/link_meta.php DELETED
@@ -1,24 +0,0 @@
1
- <div class="panel panel-updates">
2
- <div class="panel-body">
3
- <div class="row">
4
- <div class="col-xs-7 col-lg-8">
5
- <h4 class="panel-title text-success"><?php _e('Link titles', 'wp-meta-seo') ?></h4>
6
- <h3><?php echo $results[0] . '%' ?></h3>
7
- <div class="progress">
8
- <div style="width: <?php echo $results[0] . '%' ?>" aria-valuemax="100" aria-valuemin="0"
9
- aria-valuenow="<?php echo $results[0] ?>" role="progressbar"
10
- class="progress-bar progress-bar-success">
11
- <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
12
- </div>
13
- </div>
14
- <p><?php _e('Links title completed', 'wp-meta-seo') ?>
15
- : <?php echo $results[1][0] . '/' . $results[1][1]; ?></p>
16
- </div>
17
- <div class="col-xs-5 col-lg-4 text-right">
18
- <label>
19
- <input type="text" value="<?php echo $results[0] ?>" class="dial-success">
20
- </label>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pages/dashboard/meta_desc.php DELETED
@@ -1,24 +0,0 @@
1
- <div class="panel panel-success-full panel-updates">
2
- <div class="panel-body">
3
- <div class="row">
4
- <div class="col-xs-7 col-lg-8">
5
- <h4 class="panel-title text-success"><?php _e('Meta Description', 'wp-meta-seo') ?></h4>
6
- <h3><?php echo $results[0] . '%' ?></h3>
7
- <div class="progress">
8
- <div style="width: <?php echo $results[0] . '%' ?>" aria-valuemax="100" aria-valuemin="0"
9
- aria-valuenow="<?php echo $results[0] ?>" role="progressbar"
10
- class="progress-bar progress-bar-info">
11
- <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
12
- </div>
13
- </div>
14
- <p><?php _e('Meta description filled', 'wp-meta-seo') ?>
15
- : <?php echo $results[1][0] . '/' . $results[1][1] ?></p>
16
- </div>
17
- <div class="col-xs-5 col-lg-4 text-right">
18
- <label>
19
- <input type="text" value="<?php echo $results[0] ?>" class="dial-info">
20
- </label>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pages/dashboard/meta_title.php DELETED
@@ -1,24 +0,0 @@
1
- <div class="panel panel-danger-full panel-updates">
2
- <div class="panel-body">
3
- <div class="row">
4
- <div class="col-xs-7 col-lg-8">
5
- <h4 class="panel-title text-warning"><?php _e('Meta Title', 'wp-meta-seo') ?></h4>
6
- <h3><?php echo $results[0] . '%' ?></h3>
7
- <div class="progress">
8
- <div style="width: <?php echo $results[0] . '%' ?>" aria-valuemax="100" aria-valuemin="0"
9
- aria-valuenow="<?php echo $results[0] ?>" role="progressbar"
10
- class="progress-bar progress-bar-warning">
11
- <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
12
- </div>
13
- </div>
14
- <p><?php _e('Meta title filled', 'wp-meta-seo') ?>
15
- : <?php echo $results[1][0] . '/' . $results[1][1] ?></p>
16
- </div>
17
- <div class="col-xs-5 col-lg-4 text-right">
18
- <label>
19
- <input type="text" value="<?php echo $results[0] ?>" class="dial-warning">
20
- </label>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pages/dashboard/new_content.php DELETED
@@ -1,23 +0,0 @@
1
- <div class="panel panel-updates">
2
- <div class="panel-body">
3
- <div class="row">
4
- <div class="col-xs-7 col-lg-8">
5
- <h4 class="panel-title text-danger"><?php _e('New or updated content', 'wp-meta-seo') ?></h4>
6
- <h3><?php echo $results[0] . '%' ?></h3>
7
- <div class="progress">
8
- <div style="width: <?php echo $results[0] . '%' ?>" aria-valuemax="100" aria-valuemin="0"
9
- aria-valuenow="<?php echo $results[0] ?>" role="progressbar"
10
- class="progress-bar progress-bar-danger">
11
- <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
12
- </div>
13
- </div>
14
- <p><?php _e('Latest month new or updated content', 'wp-meta-seo') ?>: <?php echo $results[1][0] ?></p>
15
- </div>
16
- <div class="col-xs-5 col-lg-4 text-right">
17
- <label>
18
- <input type="text" value="<?php echo $results[0] ?>" class="dial-danger">
19
- </label>
20
- </div>
21
- </div>
22
- </div>
23
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pages/dashboard/permalink.php DELETED
@@ -1,23 +0,0 @@
1
- <div class="panel panel-updates">
2
- <div class="panel-body">
3
- <div class="row">
4
- <div class="col-xs-7 col-lg-8">
5
- <h4 class="panel-title text-success"><?php _e('Permalinks settings', 'wp-meta-seo') ?></h4>
6
- <h3><?php echo $permalink . '%' ?></h3>
7
- <div class="progress">
8
- <div style="width: <?php echo $permalink . '%' ?>" aria-valuemax="100" aria-valuemin="0"
9
- aria-valuenow="<?php echo $permalink ?>" role="progressbar"
10
- class="progress-bar progress-bar-success">
11
- <span class="sr-only"><?php echo $permalink . '%' ?> Complete (success)</span>
12
- </div>
13
- </div>
14
- <p><?php _e('Optimized at', 'wp-meta-seo') ?>: <?php echo $permalink . '%' ?></p>
15
- </div>
16
- <div class="col-xs-5 col-lg-4 text-right">
17
- <label>
18
- <input type="text" value="<?php echo $permalink ?>" class="dial-success">
19
- </label>
20
- </div>
21
- </div>
22
- </div>
23
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/pages/dashboard_widgets.php CHANGED
@@ -142,7 +142,7 @@
142
  </div>
143
 
144
  <div class="wpms_dash_widgets wpms_dash_imgsmeta"
145
- data-alt="<?php _e('We recommend to use both alt text and image title.
146
  The main advantage is that it helps search engines discover your images and display
147
  them in image search results. Plus, these tags improve the accessibility of your site and
148
  give more information about your images. Use our bulk image
@@ -154,7 +154,7 @@
154
  <div class="row">
155
  <div class="wpms_dashboard_widgets_left">
156
  <h4 class="panel-title dashboard-title">
157
- <?php _e('IMAGE TITLE/ALT', 'wp-meta-seo') ?>
158
  </h4>
159
  <div class="panel-bottom">
160
  <h3 class="dashboard-title percent_1">0%</h3>
142
  </div>
143
 
144
  <div class="wpms_dash_widgets wpms_dash_imgsmeta"
145
+ data-alt="<?php _e('We recommend to use both alt text.
146
  The main advantage is that it helps search engines discover your images and display
147
  them in image search results. Plus, these tags improve the accessibility of your site and
148
  give more information about your images. Use our bulk image
154
  <div class="row">
155
  <div class="wpms_dashboard_widgets_left">
156
  <h4 class="panel-title dashboard-title">
157
+ <?php _e('IMAGE ALT', 'wp-meta-seo') ?>
158
  </h4>
159
  <div class="panel-bottom">
160
  <h3 class="dashboard-title percent_1">0%</h3>
inc/pages/link-meta.php CHANGED
@@ -37,6 +37,13 @@ if (!empty($_REQUEST['_wp_http_referer'])) {
37
  $(this).closest('tr').find('.wpms_update_link').show();
38
  });
39
 
 
 
 
 
 
 
 
40
  $('.wpms_update_link').on('click', function () {
41
  saveMetaLinkChanges(this);
42
  });
@@ -49,9 +56,10 @@ if (!empty($_REQUEST['_wp_http_referer'])) {
49
  wpmsUpdateFollow(this);
50
  });
51
 
 
52
  $('.wpms_scan_link').on('click', function () {
53
  var $this = $(this);
54
- wpms_scan_link($this);
55
  });
56
  });
57
 
37
  $(this).closest('tr').find('.wpms_update_link').show();
38
  });
39
 
40
+ // remove link in source 404
41
+ $('.wpms_remove_link').on('click', function () {
42
+ var link_id = $(this).data('link_id');
43
+ wpmsRemoveLink(link_id);
44
+ });
45
+
46
+ // update link title
47
  $('.wpms_update_link').on('click', function () {
48
  saveMetaLinkChanges(this);
49
  });
56
  wpmsUpdateFollow(this);
57
  });
58
 
59
+ // index link
60
  $('.wpms_scan_link').on('click', function () {
61
  var $this = $(this);
62
+ wpmsScanLink($this);
63
  });
64
  });
65
 
js/cliffpyles.js CHANGED
@@ -12,22 +12,35 @@ jQuery(document).ready(function ($) {
12
  wpms_validate_analysis();
13
  }
14
 
15
- function reload_analysis() {
16
- $('.wpmseotab .spinner').css({'visibility': ' inherit'}).show();
17
- $('.metaseo_right').html('');
18
- var title = $('#title').val();
19
  var meta_title = $('#metaseo_wpmseo_title').val();
20
- var mpageurl = $('#editable-post-name-full').text();
21
  var meta_desc = $('#metaseo_wpmseo_desc').val();
22
- var mcontent = '';
23
 
24
- if (typeof tinyMCE !== 'undefined' && tinyMCE.get('content') !== null) {
25
- mcontent = tinyMCE.editors.content.getContent();
 
 
 
 
 
 
 
 
 
 
26
  } else {
27
- mcontent = $('#content').val();
 
 
 
 
 
 
28
  }
29
 
30
- var data = {'post_id': jQuery('.metaseo-progress-bar').data('post_id'), 'title': title, 'meta_title': meta_title, 'mpageurl': mpageurl, 'meta_desc': meta_desc, 'content': mcontent};
 
31
  $.ajax({
32
  dataType: 'json',
33
  method: 'POST',
@@ -35,13 +48,22 @@ jQuery(document).ready(function ($) {
35
  data: {
36
  'action': 'wpms',
37
  'task': 'reload_analysis',
38
- 'datas': data
 
 
 
 
 
 
 
 
 
39
  },
40
  success: function (res) {
41
  if (res) {
42
  $('.wpmseotab .spinner').hide();
43
  $('.metaseo_right').html(res.output);
44
- mcheck = res.check;
45
  $('#progressController').val(res.circliful).change();
46
  jQuery('.metaseo_tool').qtip({
47
  content: {
@@ -72,10 +94,11 @@ jQuery(document).ready(function ($) {
72
  }
73
 
74
  // init load analysis
75
- reload_analysis();
 
76
  // reload analysis
77
  $('#reload_analysis').on('click', function () {
78
- reload_analysis();
79
  });
80
 
81
  drawInactive(iProgressCTX);
@@ -131,10 +154,10 @@ jQuery(document).ready(function ($) {
131
  drawProgress(aProgress, percentage, $pCaption);
132
 
133
  function wpms_validate_analysis() {
134
- jQuery(document).on('click', '.metaseo-dashicons.icons-mwarning', function () {
135
  var $this = $(this);
136
- jQuery(this).removeClass('icons-mwarning').addClass('dashicons-yes');
137
- if (mcheck == 0) {
138
  mcheck = jQuery('#metaseo_alanysis_ok').val();
139
  mcheck++;
140
  } else {
@@ -152,7 +175,7 @@ jQuery(document).ready(function ($) {
152
  'field': $this.parent('.metaseo_analysis').data('title')
153
  },
154
  success: function (res) {
155
- if (res != false) {
156
  $('#progressController').val(circliful).change();
157
  }
158
  }
@@ -160,6 +183,4 @@ jQuery(document).ready(function ($) {
160
 
161
  });
162
  }
163
-
164
-
165
  });
12
  wpms_validate_analysis();
13
  }
14
 
15
+ function reload_analysis(first_load) {
16
+ var mpageurl = '', title = '', mcontent = '', current_editor = '';
 
 
17
  var meta_title = $('#metaseo_wpmseo_title').val();
 
18
  var meta_desc = $('#metaseo_wpmseo_desc').val();
 
19
 
20
+ if (wpmseoMetaboxL10n.plugin_active.indexOf('gutenberg.php') !== -1 && typeof wp.blocks !== "undefined") {
21
+ mpageurl = $('#wp-admin-bar-view').find('a').attr('href');
22
+ current_editor = 'gutenberg';
23
+ if (parseInt(first_load) === 1) {
24
+ title = window._wpGutenbergPost.title.rendered;
25
+ } else {
26
+ title = $('.editor-post-title__input').val();
27
+ }
28
+
29
+ if (typeof wp.data !== "undefined" && typeof wp.data.select('core/editor') !== "undefined") {
30
+ mcontent = wp.data.select('core/editor').getEditedPostContent();
31
+ }
32
  } else {
33
+ mpageurl = $('#editable-post-name-full').text();
34
+ title = $('#title').val();
35
+ if (typeof tinyMCE !== 'undefined' && tinyMCE.get('content') !== null) {
36
+ mcontent = tinyMCE.editors.content.getContent();
37
+ } else {
38
+ mcontent = $('#content').val();
39
+ }
40
  }
41
 
42
+ $('.wpmseotab .spinner').css({'visibility': ' inherit'}).show();
43
+ $('.metaseo_right').html('');
44
  $.ajax({
45
  dataType: 'json',
46
  method: 'POST',
48
  data: {
49
  'action': 'wpms',
50
  'task': 'reload_analysis',
51
+ 'datas': {
52
+ 'editor': current_editor,
53
+ 'first_load': first_load,
54
+ 'post_id': jQuery('.metaseo-progress-bar').data('post_id'),
55
+ 'title': title,
56
+ 'meta_title': meta_title,
57
+ 'mpageurl': mpageurl,
58
+ 'meta_desc': meta_desc,
59
+ 'content': mcontent
60
+ }
61
  },
62
  success: function (res) {
63
  if (res) {
64
  $('.wpmseotab .spinner').hide();
65
  $('.metaseo_right').html(res.output);
66
+ mcheck = parseInt(res.check);
67
  $('#progressController').val(res.circliful).change();
68
  jQuery('.metaseo_tool').qtip({
69
  content: {
94
  }
95
 
96
  // init load analysis
97
+ reload_analysis(1);
98
+
99
  // reload analysis
100
  $('#reload_analysis').on('click', function () {
101
+ reload_analysis(0);
102
  });
103
 
104
  drawInactive(iProgressCTX);
154
  drawProgress(aProgress, percentage, $pCaption);
155
 
156
  function wpms_validate_analysis() {
157
+ jQuery(document).on('click', '.metaseo-dashicons.icons-mboxwarning', function () {
158
  var $this = $(this);
159
+ jQuery(this).removeClass('icons-mboxwarning').addClass('icons-mboxdone').html('done');
160
+ if (mcheck === 0) {
161
  mcheck = jQuery('#metaseo_alanysis_ok').val();
162
  mcheck++;
163
  } else {
175
  'field': $this.parent('.metaseo_analysis').data('title')
176
  },
177
  success: function (res) {
178
+ if (res !== false) {
179
  $('#progressController').val(circliful).change();
180
  }
181
  }
183
 
184
  });
185
  }
 
 
186
  });
js/dashboard.js CHANGED
@@ -8,8 +8,7 @@ jQuery(document).ready(function ($) {
8
  dataType: 'json',
9
  data: {
10
  action: 'wpms',
11
- task: 'dash_permalink',
12
- type: 'dashboard_widgets'
13
  },
14
  success: function (res) {
15
  $('.wpms_dash_permalink .percent_1').html(res +'%');
@@ -29,8 +28,7 @@ jQuery(document).ready(function ($) {
29
  dataType: 'json',
30
  data: {
31
  action: 'wpms',
32
- task: 'dash_newcontent',
33
- type: 'dashboard_widgets'
34
  },
35
  success: function (res) {
36
  $('.wpms_dash_newcontent .percent_1').html(res[0] +'%');
@@ -51,8 +49,7 @@ jQuery(document).ready(function ($) {
51
  dataType: 'json',
52
  data: {
53
  action: 'wpms',
54
- task: 'dash_linkmeta',
55
- type: 'dashboard_widgets'
56
  },
57
  success: function (res) {
58
  $('.wpms_dash_linkmeta .percent_1').html(res[0] +'%');
@@ -73,8 +70,7 @@ jQuery(document).ready(function ($) {
73
  dataType: 'json',
74
  data: {
75
  action: 'wpms',
76
- task: 'dash_metatitle',
77
- type: 'dashboard_widgets'
78
  },
79
  success: function (res) {
80
  $('.wpms_dash_metatitle .percent_1').html(res[0] +'%');
@@ -97,7 +93,6 @@ jQuery(document).ready(function ($) {
97
  data: {
98
  action: 'wpms',
99
  task: 'dash_imgsmeta',
100
- type: 'dashboard_widgets',
101
  page : page,
102
  imgs_statis : imgs_statis,
103
  imgs_metas_statis : imgs_meta,
@@ -131,8 +126,7 @@ jQuery(document).ready(function ($) {
131
  dataType: 'json',
132
  data: {
133
  action: 'wpms',
134
- task: 'dash_metadesc',
135
- type: 'dashboard_widgets'
136
  },
137
  success: function (res) {
138
  $('.wpms_dash_metadesc .percent_1').html(res[0] +'%');
8
  dataType: 'json',
9
  data: {
10
  action: 'wpms',
11
+ task: 'dash_permalink'
 
12
  },
13
  success: function (res) {
14
  $('.wpms_dash_permalink .percent_1').html(res +'%');
28
  dataType: 'json',
29
  data: {
30
  action: 'wpms',
31
+ task: 'dash_newcontent'
 
32
  },
33
  success: function (res) {
34
  $('.wpms_dash_newcontent .percent_1').html(res[0] +'%');
49
  dataType: 'json',
50
  data: {
51
  action: 'wpms',
52
+ task: 'dash_linkmeta'
 
53
  },
54
  success: function (res) {
55
  $('.wpms_dash_linkmeta .percent_1').html(res[0] +'%');
70
  dataType: 'json',
71
  data: {
72
  action: 'wpms',
73
+ task: 'dash_metatitle'
 
74
  },
75
  success: function (res) {
76
  $('.wpms_dash_metatitle .percent_1').html(res[0] +'%');
93
  data: {
94
  action: 'wpms',
95
  task: 'dash_imgsmeta',
 
96
  page : page,
97
  imgs_statis : imgs_statis,
98
  imgs_metas_statis : imgs_meta,
126
  dataType: 'json',
127
  data: {
128
  action: 'wpms',
129
+ task: 'dash_metadesc'
 
130
  },
131
  success: function (res) {
132
  $('.wpms_dash_metadesc .percent_1').html(res[0] +'%');
js/dashboard_widgets.js CHANGED
@@ -8,8 +8,7 @@ jQuery(document).ready(function ($) {
8
  dataType: 'json',
9
  data: {
10
  action: 'wpms',
11
- task: 'dash_permalink',
12
- type: 'dashboard_widgets'
13
  },
14
  success: function (res) {
15
  $('.wpms_dash_permalink .percent_1').html(res +'%');
@@ -29,8 +28,7 @@ jQuery(document).ready(function ($) {
29
  dataType: 'json',
30
  data: {
31
  action: 'wpms',
32
- task: 'dash_newcontent',
33
- type: 'dashboard_widgets'
34
  },
35
  success: function (res) {
36
  $('.wpms_dash_newcontent .percent_1').html(res[0] +'%');
@@ -51,8 +49,7 @@ jQuery(document).ready(function ($) {
51
  dataType: 'json',
52
  data: {
53
  action: 'wpms',
54
- task: 'dash_linkmeta',
55
- type: 'dashboard_widgets'
56
  },
57
  success: function (res) {
58
  $('.wpms_dash_linkmeta .percent_1').html(res[0] +'%');
@@ -73,8 +70,7 @@ jQuery(document).ready(function ($) {
73
  dataType: 'json',
74
  data: {
75
  action: 'wpms',
76
- task: 'dash_metatitle',
77
- type: 'dashboard_widgets'
78
  },
79
  success: function (res) {
80
  $('.wpms_dash_metatitle .percent_1').html(res[0] +'%');
@@ -97,7 +93,6 @@ jQuery(document).ready(function ($) {
97
  data: {
98
  action: 'wpms',
99
  task: 'dash_imgsmeta',
100
- type: 'dashboard_widgets',
101
  page : page,
102
  imgs_statis : imgs_statis,
103
  imgs_metas_statis : imgs_meta,
@@ -131,8 +126,7 @@ jQuery(document).ready(function ($) {
131
  dataType: 'json',
132
  data: {
133
  action: 'wpms',
134
- task: 'dash_metadesc',
135
- type: 'dashboard_widgets'
136
  },
137
  success: function (res) {
138
  $('.wpms_dash_metadesc .percent_1').html(res[0] +'%');
8
  dataType: 'json',
9
  data: {
10
  action: 'wpms',
11
+ task: 'dash_permalink'
 
12
  },
13
  success: function (res) {
14
  $('.wpms_dash_permalink .percent_1').html(res +'%');
28
  dataType: 'json',
29
  data: {
30
  action: 'wpms',
31
+ task: 'dash_newcontent'
 
32
  },
33
  success: function (res) {
34
  $('.wpms_dash_newcontent .percent_1').html(res[0] +'%');
49
  dataType: 'json',
50
  data: {
51
  action: 'wpms',
52
+ task: 'dash_linkmeta'
 
53
  },
54
  success: function (res) {
55
  $('.wpms_dash_linkmeta .percent_1').html(res[0] +'%');
70
  dataType: 'json',
71
  data: {
72
  action: 'wpms',
73
+ task: 'dash_metatitle'
 
74
  },
75
  success: function (res) {
76
  $('.wpms_dash_metatitle .percent_1').html(res[0] +'%');
93
  data: {
94
  action: 'wpms',
95
  task: 'dash_imgsmeta',
 
96
  page : page,
97
  imgs_statis : imgs_statis,
98
  imgs_metas_statis : imgs_meta,
126
  dataType: 'json',
127
  data: {
128
  action: 'wpms',
129
+ task: 'dash_metadesc'
 
130
  },
131
  success: function (res) {
132
  $('.wpms_dash_metadesc .percent_1').html(res[0] +'%');
js/metaseo_admin.js CHANGED
@@ -122,6 +122,29 @@ function metaseo_updatekeywords(metakeywords_id, needToSave) {
122
  oldKeywordsValues[postid] = keywords;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  /**
126
  * Update meta title for link
127
  * @param button_update
@@ -226,7 +249,7 @@ function wpmsChangeFollow(button) {
226
  * Scan link to save to database
227
  * @param $this
228
  */
229
- function wpms_scan_link($this) {
230
  if ($this.hasClass('page_link_meta')) {
231
  jQuery('.spinner_apply_follow').css('visibility', 'visible').show();
232
  }
@@ -288,7 +311,6 @@ function wpms_scan_link($this) {
288
  */
289
  function wpmsUpdateFollow(button) {
290
  var $this = jQuery(button);
291
- jQuery('.spinner_apply_follow').css('visibility', 'visible').show();
292
  var follow_value = jQuery('.metaseo_follow_action').val();
293
  if (follow_value === 'follow_selected' || follow_value === 'nofollow_selected') {
294
  if (parseInt(follow_value) === 0)
@@ -315,6 +337,8 @@ function wpmsUpdateFollow(button) {
315
  follow_value: follow_value
316
  };
317
  }
 
 
318
  jQuery.ajax({
319
  url: ajaxurl,
320
  method: 'POST',
122
  oldKeywordsValues[postid] = keywords;
123
  }
124
 
125
+
126
+ /**
127
+ * remove link
128
+ * @param link_id id of this link
129
+ */
130
+ function wpmsRemoveLink(link_id) {
131
+ jQuery.ajax({
132
+ url: ajaxurl,
133
+ method: 'POST',
134
+ dataType: 'json',
135
+ data: {
136
+ 'action': 'wpms',
137
+ 'task': 'remove_link',
138
+ 'link_id': link_id
139
+ },
140
+ success: function (response) {
141
+ if (response.status) {
142
+ jQuery('#record_' + link_id).remove();
143
+ }
144
+ }
145
+ });
146
+ }
147
+
148
  /**
149
  * Update meta title for link
150
  * @param button_update
249
  * Scan link to save to database
250
  * @param $this
251
  */
252
+ function wpmsScanLink($this) {
253
  if ($this.hasClass('page_link_meta')) {
254
  jQuery('.spinner_apply_follow').css('visibility', 'visible').show();
255
  }
311
  */
312
  function wpmsUpdateFollow(button) {
313
  var $this = jQuery(button);
 
314
  var follow_value = jQuery('.metaseo_follow_action').val();
315
  if (follow_value === 'follow_selected' || follow_value === 'nofollow_selected') {
316
  if (parseInt(follow_value) === 0)
337
  follow_value: follow_value
338
  };
339
  }
340
+
341
+ jQuery('.spinner_apply_follow').css('visibility', 'visible').show();
342
  jQuery.ajax({
343
  url: ajaxurl,
344
  method: 'POST',
js/wp-metaseo-metabox.js CHANGED
@@ -17,9 +17,9 @@ function msReplaceVariables(str, callback) {
17
  if (typeof str === 'undefined') {
18
  return;
19
  }
20
- // title
21
- if (jQuery('#title').length) {
22
- str = str.replace(/%%title%%/g, jQuery('#title').val().replace(/(<([^>]+)>)/ig, ''));
23
  }
24
 
25
  // These are added in the head for performance reasons.
@@ -268,7 +268,15 @@ function metaseo_status_length(len, id) {
268
  })();
269
 
270
  var replacedVars = []; // jshint ignore:line
 
271
  jQuery(document).ready(function ($) {
 
 
 
 
 
 
 
272
  if (jQuery('.wpmseo-metabox-tabs-div').length > 0) {
273
  var active_tab = window.location.hash;
274
  if (active_tab === '' || active_tab.search('wpmseo') === -1) {
@@ -313,7 +321,7 @@ jQuery(document).ready(function ($) {
313
  msUpdateKeywords();
314
  });
315
 
316
- jQuery('#title').keyup(function () {
317
  msUpdateTitle();
318
  msUpdateDesc();
319
  });
17
  if (typeof str === 'undefined') {
18
  return;
19
  }
20
+
21
+ if (jQuery(wpmsdivtitle).length) {
22
+ str = str.replace(/%%title%%/g, jQuery(wpmsdivtitle).val().replace(/(<([^>]+)>)/ig, ''));
23
  }
24
 
25
  // These are added in the head for performance reasons.
268
  })();
269
 
270
  var replacedVars = []; // jshint ignore:line
271
+ var wpmsdivtitle = '';
272
  jQuery(document).ready(function ($) {
273
+ // title
274
+ if (wpmseoMetaboxL10n.plugin_active.indexOf('gutenberg.php') !== -1 && typeof wp.blocks !== "undefined") {
275
+ wpmsdivtitle = '.editor-post-title__input';
276
+ } else {
277
+ wpmsdivtitle = '#title';
278
+ }
279
+
280
  if (jQuery('.wpmseo-metabox-tabs-div').length > 0) {
281
  var active_tab = window.location.hash;
282
  if (active_tab === '' || active_tab.search('wpmseo') === -1) {
321
  msUpdateKeywords();
322
  });
323
 
324
+ jQuery(wpmsdivtitle).keyup(function () {
325
  msUpdateTitle();
326
  msUpdateDesc();
327
  });
js/wpms-broken-link.js CHANGED
@@ -14,7 +14,7 @@ jQuery(document).ready(function ($) {
14
  */
15
  $('.wpms_scan_link').on('click', function () {
16
  var $this = $(this);
17
- wpms_scan_link($this);
18
  });
19
 
20
  $('.wpms_flush_link').on('click', function () {
14
  */
15
  $('.wpms_scan_link').on('click', function () {
16
  var $this = $(this);
17
+ wpmsScanLink($this);
18
  });
19
 
20
  $('.wpms_flush_link').on('click', function () {
jutranslation/assets/js/jutranslation.js CHANGED
@@ -2,8 +2,8 @@ var joomunited_url = 'https://www.joomunited.com/';
2
 
3
  jQuery(document).ready(function($){
4
  // Define jutranslation_ajax_action if doesn't exist
5
- if (typeof jutranslation_ajax_action === 'undefined') {
6
- jutranslation_ajax_action='';
7
  }
8
 
9
  //Load the available version from Joomunited
@@ -97,20 +97,19 @@ jQuery(document).ready(function($){
97
 
98
  //Initialize ajax request datas
99
  var ajax_data = {
100
- action : jutranslation_ajax_action,
101
  slug: slug,
102
  strings : JSON.stringify(strings),
103
  language : result.datas.language,
104
  extension_version : result.datas.version,
105
  revision : result.datas.revision,
106
  modified : modified,
107
- wp_nonce : jutranslation_token
108
  };
109
- ajax_data[jutranslation_token] = 1;
110
-
111
  $.ajax({
112
  type: 'POST',
113
- url: jutranslation_base_url + 'task=jutranslation.saveStrings',
114
  data: ajax_data,
115
  success: function (result2) {
116
  result2 = JSON.parse(result2);
@@ -229,19 +228,19 @@ jQuery(document).ready(function($){
229
  if (modified === 1) {
230
  //Initialize ajax request datas
231
  var ajax_data = {
232
- action : jutranslation_ajax_action,
233
  strings: JSON.stringify(values),
234
  language: language,
235
  slug: slug,
236
  destination: 'edition',
237
  modified: '1',
238
- wp_nonce : jutranslation_token
239
  };
240
- ajax_data[jutranslation_token] = 1;
241
 
242
  $.ajax({
243
  type: 'POST',
244
- url: jutranslation_base_url + 'task=jutranslation.saveStrings',
245
  data: ajax_data,
246
  success: function (result) {
247
  result = JSON.parse(result);
@@ -339,18 +338,18 @@ jQuery(document).ready(function($){
339
 
340
  //Initialize ajax request datas
341
  var ajax_data = {
342
- action : jutranslation_ajax_action,
343
  strings : JSON.stringify(overrides),
344
  language : this.language,
345
  slug: slug,
346
  destination : 'override',
347
- wp_nonce : jutranslation_token
348
  };
349
- ajax_data[jutranslation_token] = 1;
350
 
351
  $.ajax({
352
  type : 'POST',
353
- url : jutranslation_base_url + 'task=jutranslation.saveStrings',
354
  data : ajax_data,
355
  success : function(result){
356
  result = JSON.parse(result);
@@ -385,10 +384,10 @@ jQuery(document).ready(function($){
385
  e.preventDefault();
386
  if(typeof SqueezeBox !== 'undefined' ){
387
  //Open Joomla lightbox
388
- SqueezeBox.open(jutranslation_base_url + 'action=&task=jutranslation.showViewForm&language=' + $(this).closest('tr').attr('data-lang'), {handler: 'iframe'});
389
  }else{
390
  //Open Wordpress lightbox
391
- tb_show('Share with Joomunited',jutranslation_base_url + 'action=' + jutranslation_ajax_action + '&task=jutranslation.showViewForm&slug=' + $(this).closest('tr').attr('data-slug') + '&language=' + $(this).closest('tr').attr('data-lang') + '&TB_iframe=true');
392
  }
393
  });
394
 
@@ -697,11 +696,12 @@ jQuery(document).ready(function($){
697
  var strings = {};
698
  $.ajax({
699
  type: 'POST',
700
- url: jutranslation_base_url + 'task=jutranslation.getTranslation',
701
  data: {
702
- action : jutranslation_ajax_action,
703
  language: language,
704
- slug: slug
 
705
  },
706
  success: function (result) {
707
  result = JSON.parse(result);
@@ -739,7 +739,7 @@ jQuery(document).ready(function($){
739
  * @param version2
740
  * @param revision_version1
741
  * @param revision_version2
742
- * @return 1 if version1>version2, -1 if version1<version2 , 0 if version1==version2
743
  */
744
  function versionCompare(version1, version2, revision_version1, revision_version2){
745
  if(version1==='') {
2
 
3
  jQuery(document).ready(function($){
4
  // Define jutranslation_ajax_action if doesn't exist
5
+ if (typeof jutranslation.ajax_action === 'undefined') {
6
+ jutranslation.ajax_action='';
7
  }
8
 
9
  //Load the available version from Joomunited
97
 
98
  //Initialize ajax request datas
99
  var ajax_data = {
100
+ action : jutranslation.ajax_action,
101
  slug: slug,
102
  strings : JSON.stringify(strings),
103
  language : result.datas.language,
104
  extension_version : result.datas.version,
105
  revision : result.datas.revision,
106
  modified : modified,
107
+ wp_nonce : jutranslation.token
108
  };
109
+ ajax_data[jutranslation.token] = 1;
 
110
  $.ajax({
111
  type: 'POST',
112
+ url: jutranslation.base_url + 'task=jutranslation.saveStrings',
113
  data: ajax_data,
114
  success: function (result2) {
115
  result2 = JSON.parse(result2);
228
  if (modified === 1) {
229
  //Initialize ajax request datas
230
  var ajax_data = {
231
+ action : jutranslation.ajax_action,
232
  strings: JSON.stringify(values),
233
  language: language,
234
  slug: slug,
235
  destination: 'edition',
236
  modified: '1',
237
+ wp_nonce : jutranslation.token
238
  };
239
+ ajax_data[jutranslation.token] = 1;
240
 
241
  $.ajax({
242
  type: 'POST',
243
+ url: jutranslation.base_url + 'task=jutranslation.saveStrings',
244
  data: ajax_data,
245
  success: function (result) {
246
  result = JSON.parse(result);
338
 
339
  //Initialize ajax request datas
340
  var ajax_data = {
341
+ action : jutranslation.ajax_action,
342
  strings : JSON.stringify(overrides),
343
  language : this.language,
344
  slug: slug,
345
  destination : 'override',
346
+ wp_nonce : jutranslation.token
347
  };
348
+ ajax_data[jutranslation.token] = 1;
349
 
350
  $.ajax({
351
  type : 'POST',
352
+ url : jutranslation.base_url + 'task=jutranslation.saveStrings',
353
  data : ajax_data,
354
  success : function(result){
355
  result = JSON.parse(result);
384
  e.preventDefault();
385
  if(typeof SqueezeBox !== 'undefined' ){
386
  //Open Joomla lightbox
387
+ SqueezeBox.open(jutranslation.base_url + 'action=&task=jutranslation.showViewForm&language=' + $(this).closest('tr').attr('data-lang'), {handler: 'iframe'});
388
  }else{
389
  //Open Wordpress lightbox
390
+ tb_show('Share with Joomunited',jutranslation.base_url + 'action=' + jutranslation.ajax_action + '&task=jutranslation.showViewForm&slug=' + $(this).closest('tr').attr('data-slug') + '&language=' + $(this).closest('tr').attr('data-lang') + '&TB_iframe=true');
391
  }
392
  });
393
 
696
  var strings = {};
697
  $.ajax({
698
  type: 'POST',
699
+ url: jutranslation.base_url + 'task=jutranslation.getTranslation',
700
  data: {
701
+ action : jutranslation.ajax_action,
702
  language: language,
703
+ slug: slug,
704
+ wp_nonce : jutranslation.token
705
  },
706
  success: function (result) {
707
  result = JSON.parse(result);
739
  * @param version2
740
  * @param revision_version1
741
  * @param revision_version2
742
+ * @return int 1 if version1>version2, -1 if version1<version2 , 0 if version1==version2
743
  */
744
  function versionCompare(version1, version2, revision_version1, revision_version2){
745
  if(version1==='') {
jutranslation/jutranslation.php CHANGED
@@ -1,41 +1,76 @@
1
  <?php
 
 
 
 
 
2
 
3
  namespace Joomunited\WPMetaSEO\Jutranslation;
4
 
5
  /**
6
  * Class Jutranslation
7
- * @package Joomunited\WPMetaSEO\Jutranslation
8
  */
9
  class Jutranslation
10
  {
 
 
 
 
 
11
  public static $extension_slug;
 
 
 
 
 
 
12
  public static $extension_name;
 
 
 
 
 
 
13
  public static $text_domain;
 
 
 
 
 
 
14
  public static $language_file;
15
 
 
 
 
 
 
16
  public static $main_plugin_file;
17
 
18
  /**
19
  * Initialize Jutranslation
20
- * @param $main_plugin_file
21
- * @param $extension_slug
22
- * @param $extension_name
23
- * @param $text_domain
24
- * @param $language_file
 
 
 
25
  */
26
  public static function init($main_plugin_file, $extension_slug, $extension_name, $text_domain, $language_file)
27
  {
28
- Jutranslation::$main_plugin_file = $main_plugin_file;
29
- Jutranslation::$extension_slug = $extension_slug;
30
- Jutranslation::$extension_name = $extension_name;
31
- Jutranslation::$text_domain = $text_domain;
32
- Jutranslation::$language_file = plugin_dir_path(Jutranslation::$main_plugin_file) . $language_file;
33
 
34
  //Load override file
35
  add_action('load_textdomain', array(__CLASS__, 'overrideLanguage'), 1, 2);
36
 
37
- add_filter(Jutranslation::$extension_slug . '_get_addons', function ($addons) {
38
- $addon = new \StdClass();
39
  $addon->main_plugin_file = Jutranslation::$main_plugin_file;
40
  $addon->extension_name = Jutranslation::$extension_name;
41
  $addon->extension_slug = Jutranslation::$extension_slug;
@@ -64,28 +99,33 @@ class Jutranslation
64
 
65
  /**
66
  * Ajax queries dispatcher
 
 
67
  */
68
  public static function dispatchQuery()
69
  {
 
 
70
  if (!isset($_REQUEST['task'])) {
71
  die;
72
  }
73
 
74
  switch ($_REQUEST['task']) {
75
  case 'jutranslation.saveStrings':
76
- Jutranslation::saveStrings();
77
  break;
78
  case 'jutranslation.getTranslation':
79
- Jutranslation::getTranslation();
80
  break;
81
  case 'jutranslation.showViewForm':
82
- Jutranslation::showViewForm();
83
  break;
84
  }
85
  }
86
 
87
  /**
88
  * Return the main html content for jutranslation
 
89
  * @return void
90
  */
91
  public static function getInput()
@@ -94,24 +134,22 @@ class Jutranslation
94
  echo '<div class="control-group">';
95
 
96
  //Declare all js and css to include
97
- $jsInline = array(
98
- 'jutranslation_token="' . wp_create_nonce('jutranslation') . '";',
99
- 'jutranslation_ajax_action="jutranslation_' . Jutranslation::$extension_slug . '";',
100
- 'jutranslation_base_url=ajaxurl+"?";'
101
- );
102
- echo '<script type="text/javascript">' . implode(PHP_EOL, $jsInline) . '</script>';
103
  wp_enqueue_script(
104
  'jutranslation',
105
- plugin_dir_url(Jutranslation::$main_plugin_file) . 'jutranslation/assets/js/jutranslation.js'
106
  );
107
  wp_enqueue_style(
108
  'jutranslation',
109
- plugin_dir_url(Jutranslation::$main_plugin_file) . 'jutranslation/assets/css/jutranslation.css'
110
  );
 
 
 
 
 
111
 
112
  add_thickbox();
113
 
114
-
115
  //Get all installed languages
116
  $installed_languages = array();
117
  foreach (wp_get_installed_translations('core') as $type) {
@@ -145,7 +183,7 @@ class Jutranslation
145
  $installed_languages = array_unique($installed_languages);
146
 
147
  //Get addons
148
- $addons = apply_filters(Jutranslation::$extension_slug . '_get_addons', array());
149
  ksort($addons);
150
 
151
  $languages = array();
@@ -229,7 +267,7 @@ class Jutranslation
229
  $plugin_data = get_plugin_data($addon->main_plugin_file);
230
  $extension_version = $plugin_data['Version'];
231
 
232
- echo 'Current ' . $addon->extension_name . ' version is ' . $extension_version . '<br/>';
233
  }
234
  echo '</p>';
235
 
@@ -247,31 +285,31 @@ class Jutranslation
247
  <tbody>';
248
 
249
  foreach ($languages as $language) {
250
- echo '<tr data-slug="' . $language->extension->extension_slug . '" data-lang="' . $language->languageCode .
251
- '" data-installed="' . $language->installed . '" data-version="' . $language->extension_version . '">';
252
  echo '<td ' . (count($addons) > 1 ? '' : 'style="display:none;"') . '>' .
253
- $language->extension->extension_name . '</td>';
254
- echo '<td>' . $language->languageCode . '</td>';
255
  echo '<td class="current_version">' .
256
- ($language->installed ? ($language->language_version ? ($language->revision ? $language->language_version .
257
- ' rev' . $language->revision : $language->language_version . ' rev' .
258
  $language->revision) : 'Unknown') : 'Not installed') . '</td>';
259
  echo '<td><div class="original_content">';
260
  echo '<span class="latest_version"><img src="' .
261
- plugin_dir_url(Jutranslation::$main_plugin_file) . 'jutranslation/assets/images/radio.svg" '.
262
- ' alt="loading"/></span><br/>';
263
- echo '<a class="jutranslation-override" href="#" data-language="' . $language->languageCode .
264
- '">Override (<span class="jutranslation-override-count">' . $language->overrided . '</span>)</a> ';
265
  if ($language->languageCode !== 'en-US') {
266
  //Reference en-US file can't be modified
267
  echo '<a class="jutranslation-edition" href="#" data-language="' .
268
- $language->languageCode . '">Edit original file</a>';
269
  }
270
 
271
  //No sharing for en-US
272
  if ($language->languageCode !== 'en-US') {
273
  echo ' <a class="jutranslation-share" style="' . (($language->modified === '0') ? 'display:none' : '') .
274
- '" href="#" data-language="' . $language->languageCode . '">Share with Joomunited</a>';
275
  }
276
  echo '</div><div class="temporary_content"></div></td>';
277
  echo '</tr>';
@@ -304,6 +342,8 @@ class Jutranslation
304
 
305
  /**
306
  * Save a post translation for a given language
 
 
307
  */
308
  protected static function saveStrings()
309
  {
@@ -335,7 +375,7 @@ class Jutranslation
335
  die();
336
  }
337
 
338
- $addons = apply_filters(Jutranslation::$extension_slug . '_get_addons', array());
339
  if (!isset($addons[$plugin])) {
340
  echo json_encode(array('status' => 'error', 'message' => 'plugin not found'));
341
  die();
@@ -345,7 +385,8 @@ class Jutranslation
345
  $destination = $_POST['destination'];
346
  $file = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR . 'plugins';
347
  $file .= DIRECTORY_SEPARATOR . $addons[$plugin]->text_domain . '-' . str_replace('-', '_', $language);
348
- $extension_version = $revision = '';
 
349
  switch ($destination) {
350
  case 'override':
351
  $file .= '.override.mo';
@@ -415,7 +456,7 @@ class Jutranslation
415
  //Check if strings is a valid array
416
  $strings = json_decode($strings);
417
  if ($strings === false || !is_object($strings) || !count((array)$strings)) {
418
- $strings = new \StdClass();
419
  }
420
 
421
  // Load translation class
@@ -449,8 +490,15 @@ class Jutranslation
449
  die();
450
  }
451
 
 
 
 
 
 
452
  protected static function getTranslation()
453
  {
 
 
454
  //Get and check language
455
  $language = $_POST['language'];
456
  if (!$language) {
@@ -472,7 +520,7 @@ class Jutranslation
472
  die();
473
  }
474
 
475
- $addons = apply_filters(Jutranslation::$extension_slug . '_get_addons', array());
476
  if (!isset($addons[$plugin])) {
477
  echo json_encode(array('status' => 'error', 'message' => 'plugin not found'));
478
  die();
@@ -555,9 +603,15 @@ class Jutranslation
555
 
556
  /**
557
  * Show submit form to share translation
 
 
 
 
558
  */
559
  protected static function showViewForm()
560
  {
 
 
561
  echo '<!doctype html>';
562
  echo '<html lang="en">';
563
  echo '<head>';
@@ -569,10 +623,10 @@ class Jutranslation
569
  //Get and check language
570
  $language = $_GET['language'];
571
  if (!$language) {
572
- throw new Exception('language empty');
573
  }
574
  if (!preg_match('/^[a-z]{2,3}(?:-[a-zA-Z]{4})?(?:-[A-Z]{2,3})?$/', $language)) {
575
- throw new Exception('invalid language code');
576
  }
577
 
578
  $plugin = $_GET['slug'];
@@ -585,7 +639,7 @@ class Jutranslation
585
  die();
586
  }
587
 
588
- $addons = apply_filters(Jutranslation::$extension_slug . '_get_addons', array());
589
  if (!isset($addons[$plugin])) {
590
  echo json_encode(array('status' => 'error', 'message' => 'plugin not found'));
591
  die();
@@ -619,14 +673,14 @@ class Jutranslation
619
 
620
  echo '<form method="POST" '.
621
  ' action="https://www.joomunited.com/index.php?option=com_jutranslation&task=contribution.share">';
622
- echo '<input type="hidden" name="extension" value="' . $addons[$plugin]->extension_slug . '" />';
623
- echo '<input type="hidden" name="extension_language" value="' . $language . '" />';
624
- echo '<input type="hidden" name="extension_version" value="' . $version . '" />';
625
- echo '<textarea style="display: none" name="strings">' . htmlentities($strings) . '</textarea>';
626
  echo '</form>';
627
  //Add waiting image
628
  echo '<div style="text-align:center"><img src="' .
629
- plugin_dir_url(Jutranslation::$main_plugin_file) . 'jutranslation/assets/images/preview_loader.gif"</div>';
630
 
631
  //Submit automatically the form on page loading
632
  echo '<script type="text/javascript">document.forms[0].submit();</script>';
@@ -638,13 +692,16 @@ class Jutranslation
638
 
639
  /**
640
  * Load overrided languages
641
- * @param $text_domain
642
- * @param $mofile
 
 
 
643
  */
644
  public static function overrideLanguage($text_domain, $mofile)
645
  {
646
  //Only for our plugin and addons
647
- $addons = apply_filters(Jutranslation::$extension_slug . '_get_addons', array());
648
 
649
  foreach ($addons as $addon) {
650
  if ($text_domain === $addon->text_domain) {
1
  <?php
2
+ /**
3
+ * Jutranslation main file
4
+ *
5
+ * @package Joomunited\WPMetaSEO\Jutranslation
6
+ */
7
 
8
  namespace Joomunited\WPMetaSEO\Jutranslation;
9
 
10
  /**
11
  * Class Jutranslation
 
12
  */
13
  class Jutranslation
14
  {
15
+ /**
16
+ * Extension slug
17
+ *
18
+ * @var string $extension_slug
19
+ */
20
  public static $extension_slug;
21
+
22
+ /**
23
+ * Extension real name
24
+ *
25
+ * @var string $extension_name
26
+ */
27
  public static $extension_name;
28
+
29
+ /**
30
+ * Extension text domain
31
+ *
32
+ * @var string $text_domain
33
+ */
34
  public static $text_domain;
35
+
36
+ /**
37
+ * Language file
38
+ *
39
+ * @var string $language_file
40
+ */
41
  public static $language_file;
42
 
43
+ /**
44
+ * The main plugin php file
45
+ *
46
+ * @var string $main_plugin_file
47
+ */
48
  public static $main_plugin_file;
49
 
50
  /**
51
  * Initialize Jutranslation
52
+ *
53
+ * @param string $main_plugin_file Main plugin file
54
+ * @param string $extension_slug Extension slug
55
+ * @param string $extension_name Extension name
56
+ * @param string $text_domain Text domain
57
+ * @param string $language_file Language file
58
+ *
59
+ * @return void
60
  */
61
  public static function init($main_plugin_file, $extension_slug, $extension_name, $text_domain, $language_file)
62
  {
63
+ self::$main_plugin_file = $main_plugin_file;
64
+ self::$extension_slug = $extension_slug;
65
+ self::$extension_name = $extension_name;
66
+ self::$text_domain = $text_domain;
67
+ self::$language_file = plugin_dir_path(self::$main_plugin_file) . $language_file;
68
 
69
  //Load override file
70
  add_action('load_textdomain', array(__CLASS__, 'overrideLanguage'), 1, 2);
71
 
72
+ add_filter(self::$extension_slug . '_get_addons', function ($addons) {
73
+ $addon = new \stdClass();
74
  $addon->main_plugin_file = Jutranslation::$main_plugin_file;
75
  $addon->extension_name = Jutranslation::$extension_name;
76
  $addon->extension_slug = Jutranslation::$extension_slug;
99
 
100
  /**
101
  * Ajax queries dispatcher
102
+ *
103
+ * @return void
104
  */
105
  public static function dispatchQuery()
106
  {
107
+ check_ajax_referer('jutranslation', 'wp_nonce');
108
+
109
  if (!isset($_REQUEST['task'])) {
110
  die;
111
  }
112
 
113
  switch ($_REQUEST['task']) {
114
  case 'jutranslation.saveStrings':
115
+ self::saveStrings();
116
  break;
117
  case 'jutranslation.getTranslation':
118
+ self::getTranslation();
119
  break;
120
  case 'jutranslation.showViewForm':
121
+ self::showViewForm();
122
  break;
123
  }
124
  }
125
 
126
  /**
127
  * Return the main html content for jutranslation
128
+ *
129
  * @return void
130
  */
131
  public static function getInput()
134
  echo '<div class="control-group">';
135
 
136
  //Declare all js and css to include
 
 
 
 
 
 
137
  wp_enqueue_script(
138
  'jutranslation',
139
+ plugin_dir_url(self::$main_plugin_file) . 'jutranslation/assets/js/jutranslation.js'
140
  );
141
  wp_enqueue_style(
142
  'jutranslation',
143
+ plugin_dir_url(self::$main_plugin_file) . 'jutranslation/assets/css/jutranslation.css'
144
  );
145
+ wp_localize_script('jutranslation', 'jutranslation', array(
146
+ 'token' => wp_create_nonce('jutranslation'),
147
+ 'ajax_action' => 'jutranslation_' . self::$extension_slug ,
148
+ 'base_url' => admin_url('admin-ajax.php').'?'
149
+ ));
150
 
151
  add_thickbox();
152
 
 
153
  //Get all installed languages
154
  $installed_languages = array();
155
  foreach (wp_get_installed_translations('core') as $type) {
183
  $installed_languages = array_unique($installed_languages);
184
 
185
  //Get addons
186
+ $addons = apply_filters(self::$extension_slug . '_get_addons', array());
187
  ksort($addons);
188
 
189
  $languages = array();
267
  $plugin_data = get_plugin_data($addon->main_plugin_file);
268
  $extension_version = $plugin_data['Version'];
269
 
270
+ echo 'Current ' . esc_html($addon->extension_name) . ' version is ' . esc_html($extension_version) . '<br/>';
271
  }
272
  echo '</p>';
273
 
285
  <tbody>';
286
 
287
  foreach ($languages as $language) {
288
+ echo '<tr data-slug="' . esc_attr($language->extension->extension_slug) . '" data-lang="' . esc_attr($language->languageCode) .
289
+ '" data-installed="' . esc_attr($language->installed) . '" data-version="' . esc_attr($language->extension_version) . '">';
290
  echo '<td ' . (count($addons) > 1 ? '' : 'style="display:none;"') . '>' .
291
+ esc_html($language->extension->extension_name) . '</td>';
292
+ echo '<td>' . esc_html($language->languageCode) . '</td>';
293
  echo '<td class="current_version">' .
294
+ esc_html($language->installed ? ($language->language_version ? ($language->revision ? esc_html($language->language_version .
295
+ ' rev' . $language->revision) : $language->language_version . ' rev' .
296
  $language->revision) : 'Unknown') : 'Not installed') . '</td>';
297
  echo '<td><div class="original_content">';
298
  echo '<span class="latest_version"><img src="' .
299
+ esc_attr(plugin_dir_url(self::$main_plugin_file) . 'jutranslation/assets/images/radio.svg') .
300
+ '" alt="loading"/></span><br/>';
301
+ echo '<a class="jutranslation-override" href="#" data-language="' . esc_attr($language->languageCode) .
302
+ '">Override (<span class="jutranslation-override-count">' . esc_html($language->overrided) . '</span>)</a> ';
303
  if ($language->languageCode !== 'en-US') {
304
  //Reference en-US file can't be modified
305
  echo '<a class="jutranslation-edition" href="#" data-language="' .
306
+ esc_attr($language->languageCode) . '">Edit original file</a>';
307
  }
308
 
309
  //No sharing for en-US
310
  if ($language->languageCode !== 'en-US') {
311
  echo ' <a class="jutranslation-share" style="' . (($language->modified === '0') ? 'display:none' : '') .
312
+ '" href="#" data-language="' . esc_attr($language->languageCode) . '">Share with Joomunited</a>';
313
  }
314
  echo '</div><div class="temporary_content"></div></td>';
315
  echo '</tr>';
342
 
343
  /**
344
  * Save a post translation for a given language
345
+ *
346
+ * @return void
347
  */
348
  protected static function saveStrings()
349
  {
375
  die();
376
  }
377
 
378
+ $addons = apply_filters(self::$extension_slug . '_get_addons', array());
379
  if (!isset($addons[$plugin])) {
380
  echo json_encode(array('status' => 'error', 'message' => 'plugin not found'));
381
  die();
385
  $destination = $_POST['destination'];
386
  $file = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR . 'plugins';
387
  $file .= DIRECTORY_SEPARATOR . $addons[$plugin]->text_domain . '-' . str_replace('-', '_', $language);
388
+ $extension_version = '';
389
+ $revision = '';
390
  switch ($destination) {
391
  case 'override':
392
  $file .= '.override.mo';
456
  //Check if strings is a valid array
457
  $strings = json_decode($strings);
458
  if ($strings === false || !is_object($strings) || !count((array)$strings)) {
459
+ $strings = new \stdClass();
460
  }
461
 
462
  // Load translation class
490
  die();
491
  }
492
 
493
+ /**
494
+ * Get a translation file content
495
+ *
496
+ * @return void
497
+ */
498
  protected static function getTranslation()
499
  {
500
+ check_ajax_referer('jutranslation', 'wp_nonce');
501
+
502
  //Get and check language
503
  $language = $_POST['language'];
504
  if (!$language) {
520
  die();
521
  }
522
 
523
+ $addons = apply_filters(self::$extension_slug . '_get_addons', array());
524
  if (!isset($addons[$plugin])) {
525
  echo json_encode(array('status' => 'error', 'message' => 'plugin not found'));
526
  die();
603
 
604
  /**
605
  * Show submit form to share translation
606
+ *
607
+ * @throws Exception If language or code invalid
608
+ *
609
+ * @return void
610
  */
611
  protected static function showViewForm()
612
  {
613
+ check_ajax_referer('jutranslation', 'wp_nonce');
614
+
615
  echo '<!doctype html>';
616
  echo '<html lang="en">';
617
  echo '<head>';
623
  //Get and check language
624
  $language = $_GET['language'];
625
  if (!$language) {
626
+ throw new \Exception('language empty');
627
  }
628
  if (!preg_match('/^[a-z]{2,3}(?:-[a-zA-Z]{4})?(?:-[A-Z]{2,3})?$/', $language)) {
629
+ throw new \Exception('invalid language code');
630
  }
631
 
632
  $plugin = $_GET['slug'];
639
  die();
640
  }
641
 
642
+ $addons = apply_filters(self::$extension_slug . '_get_addons', array());
643
  if (!isset($addons[$plugin])) {
644
  echo json_encode(array('status' => 'error', 'message' => 'plugin not found'));
645
  die();
673
 
674
  echo '<form method="POST" '.
675
  ' action="https://www.joomunited.com/index.php?option=com_jutranslation&task=contribution.share">';
676
+ echo '<input type="hidden" name="extension" value="' . esc_attr($addons[$plugin]->extension_slug) . '" />';
677
+ echo '<input type="hidden" name="extension_language" value="' . esc_attr($language) . '" />';
678
+ echo '<input type="hidden" name="extension_version" value="' . esc_attr($version) . '" />';
679
+ echo '<textarea style="display: none" name="strings">' . esc_html($strings) . '</textarea>';
680
  echo '</form>';
681
  //Add waiting image
682
  echo '<div style="text-align:center"><img src="' .
683
+ esc_attr(plugin_dir_url(self::$main_plugin_file) . 'jutranslation/assets/images/preview_loader.gif"') .'</div>';
684
 
685
  //Submit automatically the form on page loading
686
  echo '<script type="text/javascript">document.forms[0].submit();</script>';
692
 
693
  /**
694
  * Load overrided languages
695
+ *
696
+ * @param string $text_domain Text domain to load
697
+ * @param string $mofile Mo file to load
698
+ *
699
+ * @return void;
700
  */
701
  public static function overrideLanguage($text_domain, $mofile)
702
  {
703
  //Only for our plugin and addons
704
+ $addons = apply_filters(self::$extension_slug . '_get_addons', array());
705
 
706
  foreach ($addons as $addon) {
707
  if ($text_domain === $addon->text_domain) {
languages/wp-meta-seo-en_US.mo CHANGED
Binary file
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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: 4.9.4
6
- Stable tag: 3.6.8
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -24,6 +24,7 @@ WP Meta SEO gives you the control over all your meta content and images. Bulk SE
24
  * Generate XML and HTML sitemaps
25
  * Facebook and Twitter social sharing custom elements per content
26
  * Breadcrumb generator
 
27
 
28
  > <strong>Features included in WP Meta SEO Addon</strong><br>
29
  > * Google Search Console keyword suggestion in content
@@ -259,6 +260,9 @@ You can also use the link: www.your-website.com/sitemap.xml after checking the o
259
  = Is there a real interest for SEO to display a HTML sitemap? =
260
  It could be! if you have a lot of pages that need to be indexed with no specific priority. Our advice is to keep only the main menus of your website in the HTML sitemap.
261
 
 
 
 
262
  == Screenshots ==
263
 
264
  1. Main dashboard of the plugin with SEO optimization check
@@ -272,6 +276,11 @@ It could be! if you have a lot of pages that need to be indexed with no specific
272
 
273
  == Changelog ==
274
 
 
 
 
 
 
275
  = 3.6.8 =
276
  * Fix : Conflict with Origin PageBuilder plugin
277
  * Fix : Save post and page slow request
2
  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: 4.9.5
6
+ Stable tag: 3.7.0
7
  Requires PHP: 5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
24
  * Generate XML and HTML sitemaps
25
  * Facebook and Twitter social sharing custom elements per content
26
  * Breadcrumb generator
27
+ * Gutenberg new WordPress content ediotor compatible!
28
 
29
  > <strong>Features included in WP Meta SEO Addon</strong><br>
30
  > * Google Search Console keyword suggestion in content
260
  = Is there a real interest for SEO to display a HTML sitemap? =
261
  It could be! if you have a lot of pages that need to be indexed with no specific priority. Our advice is to keep only the main menus of your website in the HTML sitemap.
262
 
263
+ = Is it compatible with Gutenberg Editor? =
264
+ Yes WP Meta SEO is compatible with Gutenberg editor since 3.7 version.
265
+
266
  == Screenshots ==
267
 
268
  1. Main dashboard of the plugin with SEO optimization check
276
 
277
  == Changelog ==
278
 
279
+ = 3.7.0 =
280
+ * Add : Compatible with Gutemberg editor
281
+ * Fix : Reload analysis in metabox
282
+ * Fix : Render title tag
283
+
284
  = 3.6.8 =
285
  * Fix : Conflict with Origin PageBuilder plugin
286
  * Fix : Save post and page slow request
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: 3.6.8
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
@@ -99,7 +99,7 @@ if (!defined('WPMSEO_VERSION')) {
99
  /**
100
  * plugin version
101
  */
102
- define('WPMSEO_VERSION', '3.6.8');
103
  }
104
 
105
  if (!defined('WPMS_CLIENTID')) {
@@ -177,7 +177,8 @@ if (is_admin()) {
177
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-google-analytics.php');
178
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-admin.php');
179
  add_action( 'plugins_loaded', 'wpmsAdminInit', 15 );
180
- function wpmsAdminInit() {
 
181
  $GLOBALS['metaseo_admin'] = new MetaSeoAdmin;
182
  }
183
 
@@ -324,7 +325,7 @@ if (is_admin()) {
324
 
325
  // is front page
326
  if (is_front_page() && 'page' == get_option('show_on_front') && is_page(get_option('page_on_front'))) {
327
- $metas = $opengraph->getFrontPageMeta();
328
  $meta_title_esc = $meta_twtitle = $meta_fbtitle = $metas['title'];
329
  $meta_desc_esc = $meta_twdesc = $meta_fbdesc = $metas['desc'];
330
  $page_follow = $metas['page_follow'];
@@ -399,11 +400,24 @@ if (is_admin()) {
399
  }
400
 
401
  add_filter( 'pre_get_document_title', 'wpmstitle', 15 );
 
 
 
402
  function wpmstitle($title) {
403
  global $wp_query;
 
 
 
 
 
 
 
 
 
404
  if (empty($wp_query->post)) {
405
  return $title;
406
  }
 
407
  $is_shop = false;
408
  if ( function_exists( 'is_shop' ) ) {
409
  if (is_shop()) {
@@ -426,7 +440,7 @@ if (is_admin()) {
426
 
427
  // is front page
428
  if (is_front_page() && 'page' == get_option('show_on_front') && is_page(get_option('page_on_front'))) {
429
- $metas = $opengraph->getFrontPageMeta();
430
  $meta_title = $metas['title'];
431
  }
432
 
@@ -657,7 +671,7 @@ function wpmsTemplateRedirect()
657
  $sql = $wpdb->prepare(
658
  "SELECT * FROM " . $wpdb->prefix . "posts WHERE post_title = %s AND post_excerpt = %s",
659
  array(
660
- "WP Meta SEO 404 Page",
661
  "metaseo_404_page"
662
  )
663
  );
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: 3.7.0
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
99
  /**
100
  * plugin version
101
  */
102
+ define('WPMSEO_VERSION', '3.7.0');
103
  }
104
 
105
  if (!defined('WPMS_CLIENTID')) {
177
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-google-analytics.php');
178
  require_once(WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-admin.php');
179
  add_action( 'plugins_loaded', 'wpmsAdminInit', 15 );
180
+ function wpmsAdminInit()
181
+ {
182
  $GLOBALS['metaseo_admin'] = new MetaSeoAdmin;
183
  }
184
 
325
 
326
  // is front page
327
  if (is_front_page() && 'page' == get_option('show_on_front') && is_page(get_option('page_on_front'))) {
328
+ $metas = $opengraph->getFrontPageMeta($settings);
329
  $meta_title_esc = $meta_twtitle = $meta_fbtitle = $metas['title'];
330
  $meta_desc_esc = $meta_twdesc = $meta_fbdesc = $metas['desc'];
331
  $page_follow = $metas['page_follow'];
400
  }
401
 
402
  add_filter( 'pre_get_document_title', 'wpmstitle', 15 );
403
+ add_filter( 'wp_title', 'wpmstitle', 15, 3 );
404
+ add_filter( 'thematic_doctitle', 'wpmstitle', 15 );
405
+ add_filter( 'woo_title', 'wpmstitle', 99 );
406
  function wpmstitle($title) {
407
  global $wp_query;
408
+ $settings = get_option('_metaseo_settings');
409
+ if (empty($settings)) {
410
+ return $title;
411
+ }
412
+
413
+ if (empty($settings['metaseo_metatitle_tab'])) {
414
+ return $title;
415
+ }
416
+
417
  if (empty($wp_query->post)) {
418
  return $title;
419
  }
420
+
421
  $is_shop = false;
422
  if ( function_exists( 'is_shop' ) ) {
423
  if (is_shop()) {
440
 
441
  // is front page
442
  if (is_front_page() && 'page' == get_option('show_on_front') && is_page(get_option('page_on_front'))) {
443
+ $metas = $opengraph->getFrontPageMeta($settings);
444
  $meta_title = $metas['title'];
445
  }
446
 
671
  $sql = $wpdb->prepare(
672
  "SELECT * FROM " . $wpdb->prefix . "posts WHERE post_title = %s AND post_excerpt = %s",
673
  array(
674
+ "404 error page",
675
  "metaseo_404_page"
676
  )
677
  );