Version Description
- Fix Detect new type of 404 and add tooltip
- Fix comment content not detected
- Fix Autosaving too fast in safari or firefox
Download this release
Release Info
Developer | JoomUnited |
Plugin | WP Meta SEO |
Version | 2.0.2 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.0.2
- css/metaseo_admin.css +10 -0
- inc/class.metaseo-admin.php +2 -3
- inc/class.metaseo-broken-link-table.php +328 -112
- inc/class.metaseo-content-list-table.php +2 -1
- inc/class.metaseo-dashboard.php +2 -2
- inc/pages/content-meta.php +15 -0
- inc/pages/metaseo-broken-link.php +13 -3
- js/metaseo_admin.js +29 -74
- readme.txt +17 -10
- wp-meta-seo.php +2 -2
css/metaseo_admin.css
CHANGED
@@ -569,3 +569,13 @@ strong {
|
|
569 |
font-size:20px;
|
570 |
color:#32373C
|
571 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
569 |
font-size:20px;
|
570 |
color:#32373C
|
571 |
}
|
572 |
+
|
573 |
+
.metaseo_help_status{
|
574 |
+
font-size: 21px !important;
|
575 |
+
}
|
576 |
+
|
577 |
+
.wpms_content_loader{
|
578 |
+
width: 20px;
|
579 |
+
height: 20px;
|
580 |
+
display:none;
|
581 |
+
}
|
inc/class.metaseo-admin.php
CHANGED
@@ -43,7 +43,6 @@ class MetaSeo_Admin {
|
|
43 |
|
44 |
//register ajax update meta handler...
|
45 |
add_action( 'wp_ajax_updateContentMeta', array($this, 'updateContentMeta_callback') );
|
46 |
-
add_action( 'admin_init', array($this, 'stop_heartbeat') , 1 );
|
47 |
add_action('admin_init', array($this,'metaseo_field_settings'));
|
48 |
add_action('admin_init', array($this,'metaseo_create_404page'));
|
49 |
add_action('init', array($this,'wpms_load_langguage'));
|
@@ -346,8 +345,8 @@ class MetaSeo_Admin {
|
|
346 |
$link_new = $_POST['link_new'];
|
347 |
$post = get_post($_POST['postid']);
|
348 |
if(!empty($post) && !empty($post->post_content)){
|
349 |
-
if(strpos(
|
350 |
-
$content = str_replace($link_old, $link_new,
|
351 |
$my_post = array(
|
352 |
'ID' => $_POST['postid'],
|
353 |
'post_content' => $content
|
43 |
|
44 |
//register ajax update meta handler...
|
45 |
add_action( 'wp_ajax_updateContentMeta', array($this, 'updateContentMeta_callback') );
|
|
|
46 |
add_action('admin_init', array($this,'metaseo_field_settings'));
|
47 |
add_action('admin_init', array($this,'metaseo_create_404page'));
|
48 |
add_action('init', array($this,'wpms_load_langguage'));
|
345 |
$link_new = $_POST['link_new'];
|
346 |
$post = get_post($_POST['postid']);
|
347 |
if(!empty($post) && !empty($post->post_content)){
|
348 |
+
if(strpos($post->post_content, $link_old) !== false){
|
349 |
+
$content = str_replace($link_old, $link_new, $post->post_content);
|
350 |
$my_post = array(
|
351 |
'ID' => $_POST['postid'],
|
352 |
'post_content' => $content
|
inc/class.metaseo-broken-link-table.php
CHANGED
@@ -378,7 +378,7 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
378 |
<?php
|
379 |
submit_button(__('Filter'), 'button', 'filter_type_action', false, array('id' => 'broken-submit'));
|
380 |
echo '<div style="float:left;padding-left: 5px;"><div class="wpmf_process" data-w="0"></div>';
|
381 |
-
echo '<div data-paged="1" class="button wpms_scan_link">' . __('Index internal broken links', 'wp-meta-seo') . '</div></div>';
|
382 |
echo '<span class="spinner"></span>';
|
383 |
|
384 |
}
|
@@ -439,18 +439,34 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
439 |
'recheck' => '<a class="wpms_action_link wpms-recheck-button" data-link_id="' . $rec->id . '" data-type="' . $rec->type . '" data-source_id="' . $rec->source_id . '" title="' . __('Recheck this link', 'wp-meta-seo') . '"><div class="wpms_icon_action"><i class="material-icons">loop</i></div><span>' . __('Recheck', 'wp-meta-seo') . '</span></a>'
|
440 |
);
|
441 |
echo $this->row_actions($row_action, false);
|
442 |
-
if(!empty($rec->source_id)
|
443 |
-
$
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
$
|
|
|
|
|
|
|
452 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
|
|
|
454 |
}
|
455 |
}
|
456 |
}
|
@@ -464,6 +480,12 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
464 |
}else{
|
465 |
echo '<span class="wpms-input-text-wrap"><span class="title">'.__('Text', 'wp-meta-seo').'</span><input type="text" name="link_text" class="wpms-link-text-field" value="'.esc_attr($rec->link_text).'" data-type="only" /></span>';
|
466 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
}else{
|
468 |
echo '<span class="wpms-input-text-wrap"><span class="title">'.__('Text', 'wp-meta-seo').'</span><input readonly type="text" name="link_text" class="wpms-link-text-field" value="(None)" data-type="only" /></span>';
|
469 |
}
|
@@ -511,15 +533,15 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
511 |
break;
|
512 |
|
513 |
case 'col_link_text':
|
514 |
-
if ($rec->type == 'image') {
|
515 |
-
echo '<td colspan="3" class="link_text"><span style="float: left;margin-right: 5px;"><i class="material-icons">photo</i></span><span> ' . __('Image', 'wp-meta-seo') . '</span></td>';
|
516 |
} elseif ($rec->type == 'comment') {
|
517 |
-
echo '<td colspan="3" class="link_text"><span
|
518 |
} else {
|
519 |
if (strip_tags($rec->link_text) != '') {
|
520 |
echo '<td colspan="3" class="link_text">' . strip_tags($rec->link_text) . '</td>';
|
521 |
} else {
|
522 |
-
echo '<td colspan="3" class="link_text"><i>(
|
523 |
}
|
524 |
}
|
525 |
|
@@ -527,16 +549,24 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
527 |
|
528 |
case 'col_source':
|
529 |
if ($rec->type == '404_automaticaly') {
|
530 |
-
|
|
|
|
|
531 |
} else {
|
532 |
-
if ($rec->type == 'comment') {
|
533 |
$source = get_comment($rec->source_id);
|
534 |
if(!empty($source)){
|
535 |
$row_action = array(
|
536 |
'edit' => '<a target="_blank" href="' . get_edit_comment_link($rec->source_id) . '" title="Edit this item">Edit</a>',
|
537 |
'view' => '<a target="_blank" href="' . get_comment_link($rec->source_id) . '" title="View “test”" rel="permalink">View</a>'
|
538 |
);
|
539 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
540 |
}
|
541 |
} else {
|
542 |
$source = get_post($rec->source_id);
|
@@ -545,8 +575,9 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
545 |
'edit' => '<a target="_blank" href="' . get_edit_post_link($rec->source_id) . '" title="Edit this item">Edit</a>',
|
546 |
'view' => '<a target="_blank" href="' . get_post_permalink($rec->source_id) . '" title="View “test”" rel="permalink">View</a>'
|
547 |
);
|
548 |
-
|
549 |
-
$source_inner = '<
|
|
|
550 |
}
|
551 |
}
|
552 |
|
@@ -762,8 +793,8 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
762 |
$wpdb->query(
|
763 |
$wpdb->prepare(
|
764 |
"DELETE FROM " . $wpdb->prefix . "wpms_links WHERE source_id = %d
|
765 |
-
AND type = %s
|
766 |
-
", $comment_ID, 'comment'
|
767 |
)
|
768 |
);
|
769 |
}
|
@@ -780,64 +811,63 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
780 |
}
|
781 |
|
782 |
public static function wpms_update_comment($comment_ID) {
|
|
|
783 |
$comment = get_comment($comment_ID);
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
$
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
$
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
'
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
|
|
818 |
|
819 |
-
|
820 |
-
|
821 |
|
822 |
-
|
823 |
-
|
|
|
|
|
|
|
|
|
824 |
}
|
825 |
-
|
826 |
-
|
|
|
827 |
);
|
828 |
}
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
$post = $post_after;
|
834 |
-
$dom = new DOMDocument;
|
835 |
-
libxml_use_internal_errors(true);
|
836 |
-
$links_in_content = array();
|
837 |
-
|
838 |
-
if($post->post_excerpt != 'metaseo_404_page'){
|
839 |
-
if (isset($post->post_content) && $post->post_content != '') {
|
840 |
-
preg_match_all("#<a[^>]*>.*?</a>#si", $post->post_content, $matches, PREG_PATTERN_ORDER);
|
841 |
foreach (array_unique($matches[0]) as $i => $content) {
|
842 |
preg_match('/< *a[^>]*href *= *["\']?([^"\']*)/i', $content, $matches);
|
843 |
$href = $matches[1];
|
@@ -845,31 +875,30 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
845 |
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
846 |
$link_text = preg_replace("/<a\s(.+?)>(.+?)<\/a>/is", "$2", $content);
|
847 |
$row_action = array(
|
848 |
-
'edit' => '<a href="' .
|
849 |
-
'view' => '<a href="' .
|
850 |
);
|
851 |
-
$source_link = '<a href="' .
|
852 |
-
$links_in_content[$href.'
|
853 |
}
|
854 |
-
preg_match_all('/(<img[\s]+[^>]*src\s*=\s*)([\"\'])([^>]+?)\2([^<>]*>)/i', $
|
855 |
foreach (array_unique($matches[0]) as $content) {
|
856 |
-
|
857 |
-
$row_action = array(
|
858 |
-
'edit' => '<a href="' . get_edit_post_link($post->ID) . '" title="Edit this item">Edit</a>',
|
859 |
-
'view' => '<a href="' . get_post_permalink($post->ID) . '" title="View “test”" rel="permalink">View</a>'
|
860 |
-
);
|
861 |
-
$source_link = '<a href="' . get_edit_post_link($post->ID) . '"><b>' . $post->post_title . '</b></a>';
|
862 |
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $content, $matches);
|
863 |
$src = $matches[1];
|
864 |
$status = MetaSeo_Broken_Link_Table::get_urlstatus($src);
|
865 |
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
866 |
$link_text = '';
|
867 |
-
$
|
|
|
|
|
|
|
|
|
|
|
868 |
}
|
869 |
}
|
870 |
|
871 |
global $wpdb;
|
872 |
-
$sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE source_id=%d AND type
|
873 |
$links = $wpdb->get_results($sql);
|
874 |
foreach ($links as $link) {
|
875 |
if (empty($links_in_content[$link->link_url.$link->type])) {
|
@@ -884,12 +913,86 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
884 |
MetaSeo_Broken_Link_Table::wpms_insert_link($link, $wpdb);
|
885 |
}
|
886 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
887 |
}
|
888 |
}
|
889 |
|
890 |
public static function wpms_scan_link() {
|
891 |
|
892 |
global $wpdb, $_wp_column_headers;
|
|
|
893 |
$limit_comment = 10;
|
894 |
$limit_post = 1;
|
895 |
|
@@ -910,37 +1013,27 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
910 |
}
|
911 |
|
912 |
$where[] = "post_type IN ($post_type)";
|
913 |
-
$states =
|
914 |
-
$
|
915 |
-
$all_states = "'" . implode("', '", $states) . "'";
|
916 |
-
|
917 |
-
if (empty($_REQUEST['post_status'])) {
|
918 |
-
$where[] = "post_status IN ($all_states)";
|
919 |
-
} else {
|
920 |
-
$requested_state = $_REQUEST['post_status'];
|
921 |
-
if (in_array($requested_state, $states)) {
|
922 |
-
$where[] = "post_status IN ('$requested_state')";
|
923 |
-
} else {
|
924 |
-
$where[] = "post_status IN ($all_states)";
|
925 |
-
}
|
926 |
-
}
|
927 |
-
|
928 |
$total_comments = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "comments");
|
929 |
$total_posts = $wpdb->get_var("SELECT COUNT(*)"
|
930 |
. " FROM $wpdb->posts "
|
931 |
. " WHERE " . implode(' AND ', $where));
|
932 |
|
933 |
$total_link = (int)$total_comments + (int) $total_posts;
|
934 |
-
$
|
935 |
-
$
|
936 |
-
|
937 |
-
if($total_comments < $limit_comment) $percent_comment = 50;
|
938 |
-
if(!empty($total_posts)) $percent_post = 50/$total_posts;
|
939 |
-
if($total_posts < $limit_post) $percent_post = 50;
|
940 |
|
941 |
-
|
942 |
-
$
|
943 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
944 |
if (!empty($comments)) {
|
945 |
foreach ($comments as $comment) {
|
946 |
if (!empty($comment->comment_author_url)) {
|
@@ -954,12 +1047,61 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
954 |
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
955 |
$coms = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action, $comment->comment_ID, $comment->comment_author_url, $comment->comment_author, 'comment', $status, $status_type);
|
956 |
MetaSeo_Broken_Link_Table::wpms_insert_link($coms, $wpdb);
|
957 |
-
$i++;
|
958 |
}
|
959 |
}
|
960 |
wp_send_json(array('status' => false, 'type' => 'limit' , 'percent' => $percent_comment));
|
961 |
}
|
962 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
963 |
// scan link in post
|
964 |
$j = 0;
|
965 |
$off_set = ($_POST['paged'] - 1) * $limit_post;
|
@@ -1157,6 +1299,20 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
1157 |
case '404_automaticaly':
|
1158 |
wp_send_json(array('status' => true, 'type' => '404_automaticaly', 'status_text' => $status_text, 'new_link' => esc_url($_POST['new_link'])));
|
1159 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1160 |
case 'image':
|
1161 |
$post = get_post($link_detail->source_id);
|
1162 |
if(!empty($post)){
|
@@ -1171,6 +1327,30 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
1171 |
wp_send_json(array('status' => true, 'type' => 'image', 'status_text' => $status_text, 'new_link' => esc_url($edit_result['raw_url']) ));
|
1172 |
}
|
1173 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1174 |
case 'url':
|
1175 |
$post = get_post($link_detail->source_id);
|
1176 |
if(!empty($post)){
|
@@ -1194,6 +1374,10 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
1194 |
|
1195 |
break;
|
1196 |
case 'comment':
|
|
|
|
|
|
|
|
|
1197 |
wp_update_comment(array('comment_ID' => $link_detail->source_id, 'comment_author_url' => $_POST['new_link']));
|
1198 |
wp_send_json(array('status' => true, 'type' => 'orther', 'status_text' => $status_text, 'new_link' => $_POST['new_link']));
|
1199 |
break;
|
@@ -1214,6 +1398,22 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
1214 |
case '404_automaticaly':
|
1215 |
wp_send_json(true);
|
1216 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1217 |
case 'image':
|
1218 |
$post = get_post($link_detail->source_id);
|
1219 |
if(!empty($post)){
|
@@ -1228,6 +1428,22 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
|
|
1228 |
}
|
1229 |
wp_send_json(true);
|
1230 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1231 |
case 'url':
|
1232 |
$post = get_post($link_detail->source_id);
|
1233 |
if(!empty($post)){
|
378 |
<?php
|
379 |
submit_button(__('Filter'), 'button', 'filter_type_action', false, array('id' => 'broken-submit'));
|
380 |
echo '<div style="float:left;padding-left: 5px;"><div class="wpmf_process" data-w="0"></div>';
|
381 |
+
echo '<div data-comment_paged="1" data-paged="1" class="button wpms_scan_link">' . __('Index internal broken links', 'wp-meta-seo') . '</div></div>';
|
382 |
echo '<span class="spinner"></span>';
|
383 |
|
384 |
}
|
439 |
'recheck' => '<a class="wpms_action_link wpms-recheck-button" data-link_id="' . $rec->id . '" data-type="' . $rec->type . '" data-source_id="' . $rec->source_id . '" title="' . __('Recheck this link', 'wp-meta-seo') . '"><div class="wpms_icon_action"><i class="material-icons">loop</i></div><span>' . __('Recheck', 'wp-meta-seo') . '</span></a>'
|
440 |
);
|
441 |
echo $this->row_actions($row_action, false);
|
442 |
+
if(!empty($rec->source_id)){
|
443 |
+
if($rec->type == 'url'){
|
444 |
+
$iii = 0;
|
445 |
+
$pos = get_post($rec->source_id);
|
446 |
+
if(!empty($pos)){
|
447 |
+
preg_match_all("#<a[^>]*>.*?</a>#si", $pos->post_content, $matches, PREG_PATTERN_ORDER);
|
448 |
+
foreach ($matches[0] as $i => $content) {
|
449 |
+
preg_match('/< *a[^>]*href *= *["\']?([^"\']*)/i', $content, $matches);
|
450 |
+
$href = $matches[1];
|
451 |
+
if($href == $rec->link_url){
|
452 |
+
$iii++;
|
453 |
+
}
|
454 |
+
|
455 |
}
|
456 |
+
}
|
457 |
+
}elseif($rec->type == 'comment_content_url'){
|
458 |
+
$jjj = 0;
|
459 |
+
$com = get_comment($rec->source_id);
|
460 |
+
if(!empty($pos)){
|
461 |
+
preg_match_all("#<a[^>]*>.*?</a>#si", $com->comment_content, $matches, PREG_PATTERN_ORDER);
|
462 |
+
foreach ($matches[0] as $i => $content) {
|
463 |
+
preg_match('/< *a[^>]*href *= *["\']?([^"\']*)/i', $content, $matches);
|
464 |
+
$href = $matches[1];
|
465 |
+
if($href == $rec->link_url){
|
466 |
+
$jjj++;
|
467 |
+
}
|
468 |
|
469 |
+
}
|
470 |
}
|
471 |
}
|
472 |
}
|
480 |
}else{
|
481 |
echo '<span class="wpms-input-text-wrap"><span class="title">'.__('Text', 'wp-meta-seo').'</span><input type="text" name="link_text" class="wpms-link-text-field" value="'.esc_attr($rec->link_text).'" data-type="only" /></span>';
|
482 |
}
|
483 |
+
}elseif($rec->type == 'comment_content_url'){
|
484 |
+
if($jjj>1){
|
485 |
+
echo '<span class="wpms-input-text-wrap"><span class="title">'.__('Text', 'wp-meta-seo').'</span><input type="text" name="link_text" class="wpms-link-text-field" placeholder="'.__('Multiple link', 'wp-meta-seo').'" data-type="multi" /></span>';
|
486 |
+
}else{
|
487 |
+
echo '<span class="wpms-input-text-wrap"><span class="title">'.__('Text', 'wp-meta-seo').'</span><input type="text" name="link_text" class="wpms-link-text-field" value="'.esc_attr($rec->link_text).'" data-type="only" /></span>';
|
488 |
+
}
|
489 |
}else{
|
490 |
echo '<span class="wpms-input-text-wrap"><span class="title">'.__('Text', 'wp-meta-seo').'</span><input readonly type="text" name="link_text" class="wpms-link-text-field" value="(None)" data-type="only" /></span>';
|
491 |
}
|
533 |
break;
|
534 |
|
535 |
case 'col_link_text':
|
536 |
+
if ($rec->type == 'image' || $rec->type == 'comment_content_image') {
|
537 |
+
echo '<td colspan="3" class="link_text"><span style="float: left;margin-right: 5px;"><i class="material-icons metaseo_help_status" alt="Images">photo</i></span><span> ' . __('Image', 'wp-meta-seo') . '</span></td>';
|
538 |
} elseif ($rec->type == 'comment') {
|
539 |
+
echo '<td colspan="3" class="link_text"><span> ' . $rec->link_text . '</span></td>';
|
540 |
} else {
|
541 |
if (strip_tags($rec->link_text) != '') {
|
542 |
echo '<td colspan="3" class="link_text">' . strip_tags($rec->link_text) . '</td>';
|
543 |
} else {
|
544 |
+
echo '<td colspan="3" class="link_text"><i>'.__('No text on this link','wp-meta-seo').'</i></td>';
|
545 |
}
|
546 |
}
|
547 |
|
549 |
|
550 |
case 'col_source':
|
551 |
if ($rec->type == '404_automaticaly') {
|
552 |
+
$source_inner = '<span style="float: left;margin-right: 5px;"><i class="material-icons metaseo_help_status" alt="External URL indexed">link</i></span>';
|
553 |
+
$source_inner .= __('404 automaticaly indexed', 'wp-meta-seo');
|
554 |
+
echo '<td colspan="3">' . $source_inner . '</td>';
|
555 |
} else {
|
556 |
+
if ($rec->type == 'comment' || $rec->type == 'comment_content_url' || $rec->type == 'comment_content_image') {
|
557 |
$source = get_comment($rec->source_id);
|
558 |
if(!empty($source)){
|
559 |
$row_action = array(
|
560 |
'edit' => '<a target="_blank" href="' . get_edit_comment_link($rec->source_id) . '" title="Edit this item">Edit</a>',
|
561 |
'view' => '<a target="_blank" href="' . get_comment_link($rec->source_id) . '" title="View “test”" rel="permalink">View</a>'
|
562 |
);
|
563 |
+
|
564 |
+
if($rec->type == 'comment'){
|
565 |
+
$source_inner = '<span style="float: left;margin-right: 5px;"><i class="material-icons metaseo_help_status" alt="Comments">person_outline</i></span>';
|
566 |
+
}else{
|
567 |
+
$source_inner = '<span style="float: left;margin-right: 5px;"><i class="material-icons metaseo_help_status" alt="Comments content">chat_bubble</i></span>';
|
568 |
+
}
|
569 |
+
$source_inner .= '<a target="_blank" href="' . get_edit_comment_link($rec->source_id) . '">' . $source->comment_author . '</a>';
|
570 |
}
|
571 |
} else {
|
572 |
$source = get_post($rec->source_id);
|
575 |
'edit' => '<a target="_blank" href="' . get_edit_post_link($rec->source_id) . '" title="Edit this item">Edit</a>',
|
576 |
'view' => '<a target="_blank" href="' . get_post_permalink($rec->source_id) . '" title="View “test”" rel="permalink">View</a>'
|
577 |
);
|
578 |
+
|
579 |
+
$source_inner = '<span style="float: left;margin-right: 5px;"><i class="material-icons metaseo_help_status" alt="Post , Page , Custom post">layers</i></span>';
|
580 |
+
$source_inner .= '<a target="_blank" href="' . get_edit_post_link($rec->source_id) . '">' . $source->post_title . '</a>';
|
581 |
}
|
582 |
}
|
583 |
|
793 |
$wpdb->query(
|
794 |
$wpdb->prepare(
|
795 |
"DELETE FROM " . $wpdb->prefix . "wpms_links WHERE source_id = %d
|
796 |
+
AND (type = %s || type = %s || type = %s)
|
797 |
+
", $comment_ID, 'comment','comment_content_url','comment_content_image'
|
798 |
)
|
799 |
);
|
800 |
}
|
811 |
}
|
812 |
|
813 |
public static function wpms_update_comment($comment_ID) {
|
814 |
+
global $wpdb;
|
815 |
$comment = get_comment($comment_ID);
|
816 |
+
$status = wp_get_comment_status( $comment_ID );
|
817 |
+
if($status == 'approved'){
|
818 |
+
if (!empty($comment->comment_author_url)) {
|
819 |
+
$status = MetaSeo_Broken_Link_Table::get_urlstatus(($comment->comment_author_url));
|
820 |
+
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
821 |
+
$sql = $wpdb->prepare("SELECT COUNT(*) FROM " . $wpdb->prefix . "wpms_links WHERE source_id=%d AND type=%s ", array($comment_ID, 'comment'));
|
822 |
+
$check = $wpdb->get_var($sql);
|
823 |
+
if ($check == 0) {
|
824 |
+
$value = array(
|
825 |
+
'link_url' => $comment->comment_author_url,
|
826 |
+
'link_text' => $comment->comment_author,
|
827 |
+
'source_id' => $comment_ID,
|
828 |
+
'type' => 'comment',
|
829 |
+
'status_code' => $status,
|
830 |
+
'status_text' => ($status != 'Server Not Found') ? substr($status, 9) : 'Server Not Found',
|
831 |
+
'broken_indexed' => 0,
|
832 |
+
'broken_internal' => 0,
|
833 |
+
'warning' => 0,
|
834 |
+
'dismissed' => 0,
|
835 |
+
);
|
836 |
+
if (isset($status_type) && $status_type != 'ok') {
|
837 |
+
$value[$status_type] = 1;
|
838 |
+
}
|
839 |
+
$wpdb->insert(
|
840 |
+
$wpdb->prefix . 'wpms_links', $value
|
841 |
+
);
|
842 |
+
} else {
|
843 |
+
$value = array('link_url' => $comment->comment_author_url,
|
844 |
+
'status_code' => $status,
|
845 |
+
'status_text' => ($status != 'Server Not Found') ? substr($status, 9) : 'Server Not Found',
|
846 |
+
'broken_indexed' => 0,
|
847 |
+
'broken_internal' => 0,
|
848 |
+
'warning' => 0,
|
849 |
+
'dismissed' => 0,
|
850 |
+
);
|
851 |
|
852 |
+
if (isset($_POST['link_redirect']))
|
853 |
+
$value['link_url_redirect'] = ($_POST['link_redirect']);
|
854 |
|
855 |
+
if (isset($status_type) && $status_type != 'ok') {
|
856 |
+
$value[$status_type] = 1;
|
857 |
+
}
|
858 |
+
$wpdb->update(
|
859 |
+
$wpdb->prefix . 'wpms_links', $value, array('source_id' => $comment_ID, 'type' => 'comment'), array('%s', '%s', '%s', '%d', '%d', '%d', '%d'), array('%d', '%s')
|
860 |
+
);
|
861 |
}
|
862 |
+
}else{
|
863 |
+
$wpdb->query(
|
864 |
+
$wpdb->prepare("DELETE FROM ".$wpdb->prefix . "wpms_links WHERE source_id = %d AND (type = %s)", array($comment_ID,'comment') )
|
865 |
);
|
866 |
}
|
867 |
+
|
868 |
+
|
869 |
+
if (isset($comment->comment_content) && $comment->comment_content != '') {
|
870 |
+
preg_match_all("#<a[^>]*>.*?</a>#si", $comment->comment_content, $matches, PREG_PATTERN_ORDER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
871 |
foreach (array_unique($matches[0]) as $i => $content) {
|
872 |
preg_match('/< *a[^>]*href *= *["\']?([^"\']*)/i', $content, $matches);
|
873 |
$href = $matches[1];
|
875 |
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
876 |
$link_text = preg_replace("/<a\s(.+?)>(.+?)<\/a>/is", "$2", $content);
|
877 |
$row_action = array(
|
878 |
+
'edit' => '<a href="' . get_edit_comment_link($comment->comment_ID) . '" title="Edit this item">Edit</a>',
|
879 |
+
'view' => '<a href="' . get_comment_link($comment->comment_ID) . '" title="View “test”" rel="permalink">View</a>'
|
880 |
);
|
881 |
+
$source_link = '<a href="' . get_edit_comment_link($comment->comment_ID) . '"><b>' . $comment->comment_author . '</b></a>';
|
882 |
+
$links_in_content[$href.'comment_content_url'.$comment->comment_ID.$link_text] = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action , $comment->comment_ID, $href, $link_text, 'comment_content_url', $status, $status_type);
|
883 |
}
|
884 |
+
preg_match_all('/(<img[\s]+[^>]*src\s*=\s*)([\"\'])([^>]+?)\2([^<>]*>)/i', $comment->comment_content, $matches, PREG_PATTERN_ORDER);
|
885 |
foreach (array_unique($matches[0]) as $content) {
|
|
|
|
|
|
|
|
|
|
|
|
|
886 |
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $content, $matches);
|
887 |
$src = $matches[1];
|
888 |
$status = MetaSeo_Broken_Link_Table::get_urlstatus($src);
|
889 |
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
890 |
$link_text = '';
|
891 |
+
$row_action = array(
|
892 |
+
'edit' => '<a href="' . get_edit_comment_link($comment->comment_ID) . '" title="Edit this item">Edit</a>',
|
893 |
+
'view' => '<a href="' . get_comment_link($comment->comment_ID) . '" title="View “test”" rel="permalink">View</a>'
|
894 |
+
);
|
895 |
+
$source_link = '<a href="' . get_edit_comment_link($comment->comment_ID) . '"><b>' . $comment->comment_author . '</b></a>';
|
896 |
+
$links_in_content[$src.'comment_content_image'.$comment->comment_ID] = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action , $comment->comment_ID, $src, $link_text, 'comment_content_image', $status, $status_type);
|
897 |
}
|
898 |
}
|
899 |
|
900 |
global $wpdb;
|
901 |
+
$sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE source_id=%d AND (type = %s || type = %s)", array($comment->comment_ID, "comment_content_url" , "comment_content_image"));
|
902 |
$links = $wpdb->get_results($sql);
|
903 |
foreach ($links as $link) {
|
904 |
if (empty($links_in_content[$link->link_url.$link->type])) {
|
913 |
MetaSeo_Broken_Link_Table::wpms_insert_link($link, $wpdb);
|
914 |
}
|
915 |
}
|
916 |
+
|
917 |
+
|
918 |
+
}else{
|
919 |
+
global $wpdb;
|
920 |
+
$wpdb->query(
|
921 |
+
$wpdb->prepare("DELETE FROM ".$wpdb->prefix . "wpms_links WHERE source_id = %d AND (type = %s || type = %s || type = %s)", array($comment_ID,'comment','comment_content_url','comment_content_image') )
|
922 |
+
);
|
923 |
+
}
|
924 |
+
}
|
925 |
+
|
926 |
+
public static function wpms_update_post($post_ID, $post_after, $post_before) {
|
927 |
+
$post = $post_after;
|
928 |
+
$dom = new DOMDocument;
|
929 |
+
libxml_use_internal_errors(true);
|
930 |
+
$links_in_content = array();
|
931 |
+
|
932 |
+
if($post->post_excerpt != 'metaseo_404_page'){
|
933 |
+
if($post->post_status == 'publish'){
|
934 |
+
if (isset($post->post_content) && $post->post_content != '') {
|
935 |
+
|
936 |
+
preg_match_all("#<a[^>]*>.*?</a>#si", $post->post_content, $matches, PREG_PATTERN_ORDER);
|
937 |
+
foreach (array_unique($matches[0]) as $i => $content) {
|
938 |
+
preg_match('/< *a[^>]*href *= *["\']?([^"\']*)/i', $content, $matches);
|
939 |
+
$href = $matches[1];
|
940 |
+
$status = MetaSeo_Broken_Link_Table::get_urlstatus($href);
|
941 |
+
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
942 |
+
$link_text = preg_replace("/<a\s(.+?)>(.+?)<\/a>/is", "$2", $content);
|
943 |
+
$row_action = array(
|
944 |
+
'edit' => '<a href="' . get_edit_post_link($post->ID) . '" title="Edit this item">Edit</a>',
|
945 |
+
'view' => '<a href="' . get_post_permalink($post->ID) . '" title="View “test”" rel="permalink">View</a>'
|
946 |
+
);
|
947 |
+
$source_link = '<a href="' . get_edit_post_link($post->ID) . '"><b>' . $post->post_title . '</b></a>';
|
948 |
+
$links_in_content[$href.'url'.$post->ID.$link_text] = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action, $post->ID, $href, $link_text, 'url', $status, $status_type);
|
949 |
+
}
|
950 |
+
preg_match_all('/(<img[\s]+[^>]*src\s*=\s*)([\"\'])([^>]+?)\2([^<>]*>)/i', $post->post_content, $matches, PREG_PATTERN_ORDER);
|
951 |
+
foreach (array_unique($matches[0]) as $content) {
|
952 |
+
|
953 |
+
$row_action = array(
|
954 |
+
'edit' => '<a href="' . get_edit_post_link($post->ID) . '" title="Edit this item">Edit</a>',
|
955 |
+
'view' => '<a href="' . get_post_permalink($post->ID) . '" title="View “test”" rel="permalink">View</a>'
|
956 |
+
);
|
957 |
+
$source_link = '<a href="' . get_edit_post_link($post->ID) . '"><b>' . $post->post_title . '</b></a>';
|
958 |
+
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $content, $matches);
|
959 |
+
$src = $matches[1];
|
960 |
+
$status = MetaSeo_Broken_Link_Table::get_urlstatus($src);
|
961 |
+
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
962 |
+
$link_text = '';
|
963 |
+
$links_in_content[$src.'img'.$post->ID] = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action, $post->ID, $src, $link_text, 'image', $status, $status_type);
|
964 |
+
}
|
965 |
+
}
|
966 |
+
|
967 |
+
global $wpdb;
|
968 |
+
$sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE source_id=%d AND type != %s", array($post->ID, "comment"));
|
969 |
+
$links = $wpdb->get_results($sql);
|
970 |
+
foreach ($links as $link) {
|
971 |
+
if (empty($links_in_content[$link->link_url.$link->type])) {
|
972 |
+
$wpdb->delete($wpdb->prefix . "wpms_links", array('id' => $link->id), array('%d'));
|
973 |
+
} else {
|
974 |
+
unset($links_in_content[$link->link_url.$link->type.$link->link_text]);
|
975 |
+
}
|
976 |
+
}
|
977 |
+
|
978 |
+
if (!empty($links_in_content)) {
|
979 |
+
foreach ($links_in_content as $link){
|
980 |
+
MetaSeo_Broken_Link_Table::wpms_insert_link($link, $wpdb);
|
981 |
+
}
|
982 |
+
}
|
983 |
+
}else{
|
984 |
+
global $wpdb;
|
985 |
+
$wpdb->query(
|
986 |
+
$wpdb->prepare("DELETE FROM ".$wpdb->prefix . "wpms_links WHERE source_id = %d AND (type = %s || type = %s)", array($post->ID,'image','url') )
|
987 |
+
);
|
988 |
+
}
|
989 |
}
|
990 |
}
|
991 |
|
992 |
public static function wpms_scan_link() {
|
993 |
|
994 |
global $wpdb, $_wp_column_headers;
|
995 |
+
$limit_comment_content = 1;
|
996 |
$limit_comment = 10;
|
997 |
$limit_post = 1;
|
998 |
|
1013 |
}
|
1014 |
|
1015 |
$where[] = "post_type IN ($post_type)";
|
1016 |
+
$states = 'publish';
|
1017 |
+
$where[] = "post_status = '$states'";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1018 |
$total_comments = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "comments");
|
1019 |
$total_posts = $wpdb->get_var("SELECT COUNT(*)"
|
1020 |
. " FROM $wpdb->posts "
|
1021 |
. " WHERE " . implode(' AND ', $where));
|
1022 |
|
1023 |
$total_link = (int)$total_comments + (int) $total_posts;
|
1024 |
+
$percent_comment_content = 33.33;
|
1025 |
+
$percent_comment = 33.33;
|
1026 |
+
$percent_post = 33.33;
|
|
|
|
|
|
|
1027 |
|
1028 |
+
if(!empty($total_comments)) $percent_comment_content = 33.33/$total_comments;
|
1029 |
+
if($total_comments < $limit_comment_content) $percent_comment_content = 33.33;
|
1030 |
+
if(!empty($total_comments)) $percent_comment = 33.33/$total_comments;
|
1031 |
+
if($total_comments < $limit_comment) $percent_comment = 33.33;
|
1032 |
+
if(!empty($total_posts)) $percent_post = 33.33/$total_posts;
|
1033 |
+
if($total_posts < $limit_post) $percent_post = 33.33;
|
1034 |
+
|
1035 |
+
// scan link in comment url
|
1036 |
+
$comments = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "comments WHERE comment_approved = 1 AND comment_author_url != '' AND comment_author_url NOT IN (SELECT link_url FROM " . $wpdb->prefix . "wpms_links WHERE type='comment') LIMIT $limit_comment");
|
1037 |
if (!empty($comments)) {
|
1038 |
foreach ($comments as $comment) {
|
1039 |
if (!empty($comment->comment_author_url)) {
|
1047 |
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
1048 |
$coms = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action, $comment->comment_ID, $comment->comment_author_url, $comment->comment_author, 'comment', $status, $status_type);
|
1049 |
MetaSeo_Broken_Link_Table::wpms_insert_link($coms, $wpdb);
|
|
|
1050 |
}
|
1051 |
}
|
1052 |
wp_send_json(array('status' => false, 'type' => 'limit' , 'percent' => $percent_comment));
|
1053 |
}
|
1054 |
|
1055 |
+
// scan link in comment content
|
1056 |
+
$k = 0;
|
1057 |
+
$off_set = ($_POST['comment_paged'] - 1) * $limit_comment_content;
|
1058 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "comments WHERE comment_approved = 1 AND comment_content != '' LIMIT $limit_comment_content OFFSET $off_set";
|
1059 |
+
$comments_content = $wpdb->get_results($query);
|
1060 |
+
if (!empty($comments_content)) {
|
1061 |
+
foreach ($comments_content as $comment) {
|
1062 |
+
$dom = new DOMDocument;
|
1063 |
+
libxml_use_internal_errors(true);
|
1064 |
+
if (isset($comment->comment_content) && $comment->comment_content != '') {
|
1065 |
+
preg_match_all("#<a[^>]*>.*?</a>#si", $comment->comment_content, $matches, PREG_PATTERN_ORDER);
|
1066 |
+
foreach (array_unique($matches[0]) as $i => $content) {
|
1067 |
+
preg_match('/< *a[^>]*href *= *["\']?([^"\']*)/i', $content, $matches);
|
1068 |
+
$href = $matches[1];
|
1069 |
+
$status = MetaSeo_Broken_Link_Table::get_urlstatus($href);
|
1070 |
+
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
1071 |
+
$link_text = preg_replace("/<a\s(.+?)>(.+?)<\/a>/is", "$2", $content);
|
1072 |
+
$row_action = array(
|
1073 |
+
'edit' => '<a href="' . get_edit_comment_link($comment->comment_ID) . '" title="Edit this item">Edit</a>',
|
1074 |
+
'view' => '<a href="' . get_comment_link($comment->comment_ID) . '" title="View “test”" rel="permalink">View</a>'
|
1075 |
+
);
|
1076 |
+
$source_link = '<a href="' . get_edit_comment_link($comment->comment_ID) . '"><b>' . $comment->comment_author . '</b></a>';
|
1077 |
+
$link_a = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action, $comment->comment_ID, $href, $link_text, 'comment_content_url', $status, $status_type);
|
1078 |
+
MetaSeo_Broken_Link_Table::wpms_insert_link($link_a, $wpdb);
|
1079 |
+
}
|
1080 |
+
preg_match_all('/(<img[\s]+[^>]*src\s*=\s*)([\"\'])([^>]+?)\2([^<>]*>)/i', $comment->comment_content, $matches, PREG_PATTERN_ORDER);
|
1081 |
+
foreach (array_unique($matches[0]) as $content) {
|
1082 |
+
|
1083 |
+
$row_action = array(
|
1084 |
+
'edit' => '<a href="' . get_edit_comment_link($comment->comment_ID) . '" title="Edit this item">Edit</a>',
|
1085 |
+
'view' => '<a href="' . get_comment_link($comment->comment_ID) . '" title="View “test”" rel="permalink">View</a>'
|
1086 |
+
);
|
1087 |
+
$source_link = '<a href="' . get_edit_comment_link($comment->comment_ID) . '"><b>' . $comment->comment_author . '</b></a>';
|
1088 |
+
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $content, $matches);
|
1089 |
+
$src = $matches[1];
|
1090 |
+
$status = MetaSeo_Broken_Link_Table::get_urlstatus($src);
|
1091 |
+
$status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
|
1092 |
+
$link_text = '';
|
1093 |
+
$link_sou = MetaSeo_Broken_Link_Table::get_result_link($source_link, $row_action, $comment->comment_ID, $src, $link_text, 'comment_content_image', $status, $status_type);
|
1094 |
+
MetaSeo_Broken_Link_Table::wpms_insert_link($link_sou, $wpdb);
|
1095 |
+
}
|
1096 |
+
}
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
$k++;
|
1100 |
+
if ($k >= $limit_comment_content) {
|
1101 |
+
wp_send_json(array('status' => false, 'type' => 'limit_comment_content', 'paged' => $_POST['comment_paged'] ,'percent' => $percent_comment_content*count($comments_content)));
|
1102 |
+
}
|
1103 |
+
}
|
1104 |
+
|
1105 |
// scan link in post
|
1106 |
$j = 0;
|
1107 |
$off_set = ($_POST['paged'] - 1) * $limit_post;
|
1299 |
case '404_automaticaly':
|
1300 |
wp_send_json(array('status' => true, 'type' => '404_automaticaly', 'status_text' => $status_text, 'new_link' => esc_url($_POST['new_link'])));
|
1301 |
break;
|
1302 |
+
case 'comment_content_image':
|
1303 |
+
$comment = get_comment($link_detail->source_id);
|
1304 |
+
if(!empty($comment)){
|
1305 |
+
$old_value = $comment->comment_content;
|
1306 |
+
$edit_result = MetaSeo_Broken_Link_Table::edit_linkimg($old_value, $_POST['new_link'], $link_detail->link_url);
|
1307 |
+
$my_comment = array(
|
1308 |
+
'comment_ID' => $link_detail->source_id,
|
1309 |
+
'comment_content' => $edit_result['content']
|
1310 |
+
);
|
1311 |
+
remove_action('edit_comment', array('MetaSeo_Broken_Link_Table', 'wpms_update_comment'));
|
1312 |
+
wp_update_comment($my_comment);
|
1313 |
+
wp_send_json(array('status' => true, 'type' => 'image', 'status_text' => $status_text, 'new_link' => esc_url($edit_result['raw_url']) ));
|
1314 |
+
}
|
1315 |
+
break;
|
1316 |
case 'image':
|
1317 |
$post = get_post($link_detail->source_id);
|
1318 |
if(!empty($post)){
|
1327 |
wp_send_json(array('status' => true, 'type' => 'image', 'status_text' => $status_text, 'new_link' => esc_url($edit_result['raw_url']) ));
|
1328 |
}
|
1329 |
break;
|
1330 |
+
|
1331 |
+
case 'comment_content_url':
|
1332 |
+
$comment = get_comment($link_detail->source_id);
|
1333 |
+
if(!empty($comment)){
|
1334 |
+
$old_value = $comment->comment_content;
|
1335 |
+
if(isset($_POST['data_type']) && $_POST['data_type'] == 'multi' && $_POST['new_text'] == ''){
|
1336 |
+
$edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $_POST['new_link'], $link_detail->link_url);
|
1337 |
+
$new_text = '';
|
1338 |
+
}else{
|
1339 |
+
$edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $_POST['new_link'], $link_detail->link_url, $_POST['new_text']);
|
1340 |
+
$new_text = strip_tags($edit_result['link_text']);
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
$my_comment = array(
|
1344 |
+
'comment_ID' => $link_detail->source_id,
|
1345 |
+
'comment_content' => $edit_result['content']
|
1346 |
+
);
|
1347 |
+
remove_action('edit_comment', array('MetaSeo_Broken_Link_Table', 'wpms_update_comment'));
|
1348 |
+
wp_update_comment($my_comment);
|
1349 |
+
wp_send_json(array('status' => true, 'type' => 'url', 'status_text' => $status_text, 'new_link' => $edit_result['raw_url'], 'new_text' => $new_text ));
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
break;
|
1353 |
+
|
1354 |
case 'url':
|
1355 |
$post = get_post($link_detail->source_id);
|
1356 |
if(!empty($post)){
|
1374 |
|
1375 |
break;
|
1376 |
case 'comment':
|
1377 |
+
//$comment = get_comment($link_detail->source_id);
|
1378 |
+
//$old_value = $comment->comment_content;
|
1379 |
+
//$edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $_POST['new_link'], 'http://www.testdev-united.com/wordpress/wp-file-download-sech/' , 'hehe');
|
1380 |
+
//var_dump($edit_result);die();
|
1381 |
wp_update_comment(array('comment_ID' => $link_detail->source_id, 'comment_author_url' => $_POST['new_link']));
|
1382 |
wp_send_json(array('status' => true, 'type' => 'orther', 'status_text' => $status_text, 'new_link' => $_POST['new_link']));
|
1383 |
break;
|
1398 |
case '404_automaticaly':
|
1399 |
wp_send_json(true);
|
1400 |
break;
|
1401 |
+
|
1402 |
+
case 'comment_content_image':
|
1403 |
+
$comment = get_comment($link_detail->source_id);
|
1404 |
+
if(!empty($comment)){
|
1405 |
+
$old_value = $comment->comment_content;
|
1406 |
+
$new_content = MetaSeo_Broken_Link_Table::wpms_unlink_img($old_value, $link_detail->link_url);
|
1407 |
+
remove_action('edit_comment', array('MetaSeo_Broken_Link_Table', 'wpms_update_comment'));
|
1408 |
+
$my_comment = array(
|
1409 |
+
'comment_ID' => $link_detail->source_id,
|
1410 |
+
'comment_content' => $new_content
|
1411 |
+
);
|
1412 |
+
wp_update_comment($my_comment);
|
1413 |
+
}
|
1414 |
+
wp_send_json(true);
|
1415 |
+
break;
|
1416 |
+
|
1417 |
case 'image':
|
1418 |
$post = get_post($link_detail->source_id);
|
1419 |
if(!empty($post)){
|
1428 |
}
|
1429 |
wp_send_json(true);
|
1430 |
break;
|
1431 |
+
|
1432 |
+
case 'comment_content_url':
|
1433 |
+
$comment = get_comment($link_detail->source_id);
|
1434 |
+
if(!empty($comment)){
|
1435 |
+
$old_value = $comment->comment_content;
|
1436 |
+
$new_content = MetaSeo_Broken_Link_Table::wpms_unlink_html($old_value, $link_detail->link_url);
|
1437 |
+
remove_action('edit_comment', array('MetaSeo_Broken_Link_Table', 'wpms_update_comment'));
|
1438 |
+
$my_comment = array(
|
1439 |
+
'comment_ID' => $link_detail->source_id,
|
1440 |
+
'comment_content' => $new_content
|
1441 |
+
);
|
1442 |
+
wp_update_comment($my_comment);
|
1443 |
+
}
|
1444 |
+
wp_send_json(true);
|
1445 |
+
break;
|
1446 |
+
|
1447 |
case 'url':
|
1448 |
$post = get_post($link_detail->source_id);
|
1449 |
if(!empty($post)){
|
inc/class.metaseo-content-list-table.php
CHANGED
@@ -126,7 +126,7 @@ class MetaSeo_Content_List_Table extends WP_List_Table {
|
|
126 |
|
127 |
function get_columns() {
|
128 |
$preview = __(" This is a rendering of what this post might look like in Google's search results.", 'wp-meta-seo');
|
129 |
-
$info = sprintf('<a class="info-content"><img src=' . WPMETASEO_PLUGIN_URL . 'img/info.png
|
130 |
. '<p class="tooltip-metacontent">'
|
131 |
.$preview
|
132 |
.'</p></a>');
|
@@ -352,6 +352,7 @@ class MetaSeo_Content_List_Table extends WP_List_Table {
|
|
352 |
echo '<span class="snippet_metalink" id="snippet_metalink_' . $rec->ID . '">' . $rec->link . '</span>';
|
353 |
|
354 |
echo '<p id="snippet_desc' . $rec->ID . '" class="snippet_metades">' . $rec->metadesc . '</p></div>';
|
|
|
355 |
echo '<span id="savedInfo' . $rec->ID . '" style="position: relative; display: block;float:right" class="saved-info metaseo-msg-success"><span style="position:absolute; float:right" class="meta-update"></span></span>';
|
356 |
echo '</div></td>';
|
357 |
break;
|
126 |
|
127 |
function get_columns() {
|
128 |
$preview = __(" This is a rendering of what this post might look like in Google's search results.", 'wp-meta-seo');
|
129 |
+
$info = sprintf('<a class="info-content"><img src=' . WPMETASEO_PLUGIN_URL . 'img/info.png>'
|
130 |
. '<p class="tooltip-metacontent">'
|
131 |
.$preview
|
132 |
.'</p></a>');
|
352 |
echo '<span class="snippet_metalink" id="snippet_metalink_' . $rec->ID . '">' . $rec->link . '</span>';
|
353 |
|
354 |
echo '<p id="snippet_desc' . $rec->ID . '" class="snippet_metades">' . $rec->metadesc . '</p></div>';
|
355 |
+
echo '<img class="wpms_loader'.$rec->ID.' wpms_content_loader" src=' . WPMETASEO_PLUGIN_URL . 'img/update_loading.gif>';
|
356 |
echo '<span id="savedInfo' . $rec->ID . '" style="position: relative; display: block;float:right" class="saved-info metaseo-msg-success"><span style="position:absolute; float:right" class="meta-update"></span></span>';
|
357 |
echo '</div></td>';
|
358 |
break;
|
inc/class.metaseo-dashboard.php
CHANGED
@@ -130,7 +130,7 @@ class MetaSeo_Dashboard {
|
|
130 |
$contents = $this->get_contents($url);
|
131 |
$content = $contents[0];
|
132 |
}
|
133 |
-
|
134 |
$doc = new DOMDocument();
|
135 |
libxml_use_internal_errors( true );
|
136 |
@$doc->loadHTML($content);
|
@@ -165,7 +165,7 @@ class MetaSeo_Dashboard {
|
|
165 |
curl_setopt($curl_array[$i], CURLOPT_URL, $url);
|
166 |
curl_setopt($curl_array[$i], CURLOPT_USERAGENT, $useragent); // set user agent
|
167 |
curl_setopt($curl_array[$i], CURLOPT_RETURNTRANSFER, TRUE);
|
168 |
-
curl_setopt($curl_array[$i], CURLOPT_FOLLOWLOCATION, TRUE);
|
169 |
curl_setopt($curl_array[$i], CURLOPT_CONNECTTIMEOUT, 5);
|
170 |
curl_setopt($curl_array[$i], CURLOPT_ENCODING, "UTF-8");
|
171 |
curl_multi_add_handle($mh, $curl_array[$i]);
|
130 |
$contents = $this->get_contents($url);
|
131 |
$content = $contents[0];
|
132 |
}
|
133 |
+
|
134 |
$doc = new DOMDocument();
|
135 |
libxml_use_internal_errors( true );
|
136 |
@$doc->loadHTML($content);
|
165 |
curl_setopt($curl_array[$i], CURLOPT_URL, $url);
|
166 |
curl_setopt($curl_array[$i], CURLOPT_USERAGENT, $useragent); // set user agent
|
167 |
curl_setopt($curl_array[$i], CURLOPT_RETURNTRANSFER, TRUE);
|
168 |
+
//curl_setopt($curl_array[$i], CURLOPT_FOLLOWLOCATION, TRUE);
|
169 |
curl_setopt($curl_array[$i], CURLOPT_CONNECTTIMEOUT, 5);
|
170 |
curl_setopt($curl_array[$i], CURLOPT_ENCODING, "UTF-8");
|
171 |
curl_multi_add_handle($mh, $curl_array[$i]);
|
inc/pages/content-meta.php
CHANGED
@@ -34,26 +34,41 @@ if (!empty($_REQUEST['_wp_http_referer'])) {
|
|
34 |
<script type="text/javascript">
|
35 |
jQuery(document).ready(function($){
|
36 |
$('.metaseo-metatitle').each(function() {
|
|
|
37 |
metaseo_updateTitle(this.id, false, false);
|
38 |
});
|
39 |
|
40 |
$('.metaseo-metakeywords').each(function() {
|
|
|
41 |
metaseo_updatekeywords(this.id, false, false);
|
42 |
});
|
43 |
|
44 |
$('.metaseo-metadesc').each(function() {
|
|
|
45 |
metaseo_updateDesc(this.id,false);
|
46 |
});
|
47 |
|
48 |
$('.metaseo-metatitle').bind('input propertychange', function() {
|
|
|
|
|
|
|
|
|
49 |
metaseo_updateTitle(this.id, true);
|
50 |
});
|
51 |
|
52 |
$('.metaseo-metakeywords').bind('input propertychange', function() {
|
|
|
|
|
|
|
|
|
53 |
metaseo_updatekeywords(this.id, true);
|
54 |
});
|
55 |
|
56 |
$('.metaseo-metadesc').bind('input propertychange', function() {
|
|
|
|
|
|
|
|
|
57 |
metaseo_updateDesc(this.id, true);
|
58 |
});
|
59 |
|
34 |
<script type="text/javascript">
|
35 |
jQuery(document).ready(function($){
|
36 |
$('.metaseo-metatitle').each(function() {
|
37 |
+
metaseo_titlelength(this.id, false , false);
|
38 |
metaseo_updateTitle(this.id, false, false);
|
39 |
});
|
40 |
|
41 |
$('.metaseo-metakeywords').each(function() {
|
42 |
+
metaseo_keywordlength(this.id, false , false);
|
43 |
metaseo_updatekeywords(this.id, false, false);
|
44 |
});
|
45 |
|
46 |
$('.metaseo-metadesc').each(function() {
|
47 |
+
metaseo_desclength(this.id, false , false);
|
48 |
metaseo_updateDesc(this.id,false);
|
49 |
});
|
50 |
|
51 |
$('.metaseo-metatitle').bind('input propertychange', function() {
|
52 |
+
metaseo_titlelength(this.id, true);
|
53 |
+
});
|
54 |
+
|
55 |
+
$('.metaseo-metatitle').blur(function() {
|
56 |
metaseo_updateTitle(this.id, true);
|
57 |
});
|
58 |
|
59 |
$('.metaseo-metakeywords').bind('input propertychange', function() {
|
60 |
+
metaseo_keywordlength(this.id, true);
|
61 |
+
});
|
62 |
+
|
63 |
+
$('.metaseo-metakeywords').blur(function() {
|
64 |
metaseo_updatekeywords(this.id, true);
|
65 |
});
|
66 |
|
67 |
$('.metaseo-metadesc').bind('input propertychange', function() {
|
68 |
+
metaseo_keywordlength(this.id, true);
|
69 |
+
});
|
70 |
+
|
71 |
+
$('.metaseo-metadesc').blur(function() {
|
72 |
metaseo_updateDesc(this.id, true);
|
73 |
});
|
74 |
|
inc/pages/metaseo-broken-link.php
CHANGED
@@ -50,7 +50,8 @@ if (!empty($_REQUEST['_wp_http_referer'])) {
|
|
50 |
dataType: 'json',
|
51 |
data: {
|
52 |
'action': 'wpms_scan_link',
|
53 |
-
'paged' : $this.data('paged')
|
|
|
54 |
},
|
55 |
success: function (res) {
|
56 |
if(res.status == false){
|
@@ -62,9 +63,18 @@ if (!empty($_REQUEST['_wp_http_referer'])) {
|
|
62 |
$('.wpmf_process').data('w' , wpmf_process_new);
|
63 |
$('.wpmf_process').css('width' , wpmf_process_new +'%').show();
|
64 |
$this.click();
|
65 |
-
}else if(res.type == '
|
66 |
var wpmf_process = $('.wpmf_process').data('w');
|
67 |
-
if(wpmf_process <
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
var wpmf_process_new = parseFloat(wpmf_process) + parseFloat(res.percent);
|
69 |
if(wpmf_process_new > 100) wpmf_process_new = 100;
|
70 |
$('.wpmf_process').data('w' , wpmf_process_new);
|
50 |
dataType: 'json',
|
51 |
data: {
|
52 |
'action': 'wpms_scan_link',
|
53 |
+
'paged' : $this.data('paged'),
|
54 |
+
'comment_paged' : $this.data('comment_paged')
|
55 |
},
|
56 |
success: function (res) {
|
57 |
if(res.status == false){
|
63 |
$('.wpmf_process').data('w' , wpmf_process_new);
|
64 |
$('.wpmf_process').css('width' , wpmf_process_new +'%').show();
|
65 |
$this.click();
|
66 |
+
}else if(res.type == 'limit_comment_content'){
|
67 |
var wpmf_process = $('.wpmf_process').data('w');
|
68 |
+
if(wpmf_process < 33.33 ) wpmf_process = 33.33;
|
69 |
+
var wpmf_process_new = parseFloat(wpmf_process) + parseFloat(res.percent);
|
70 |
+
if(wpmf_process_new > 100) wpmf_process_new = 100;
|
71 |
+
$('.wpmf_process').data('w' , wpmf_process_new);
|
72 |
+
$('.wpmf_process').css('width' , wpmf_process_new +'%').show();
|
73 |
+
$this.data('comment_paged' , parseInt(res.paged)+1);
|
74 |
+
$this.click();
|
75 |
+
}else{
|
76 |
+
var wpmf_process = $('.wpmf_process').data('w');
|
77 |
+
if(wpmf_process < 66.66 ) wpmf_process = 66.66;
|
78 |
var wpmf_process_new = parseFloat(wpmf_process) + parseFloat(res.percent);
|
79 |
if(wpmf_process_new > 100) wpmf_process_new = 100;
|
80 |
$('.wpmf_process').data('w' , wpmf_process_new);
|
js/metaseo_admin.js
CHANGED
@@ -26,7 +26,8 @@ var oldTitleValues = {};
|
|
26 |
var oldKeywordsValues = {};
|
27 |
var oldDescValues = {};
|
28 |
var metaContentChangeWait;
|
29 |
-
|
|
|
30 |
var title = jQuery.trim(metaseo_clean(jQuery('#' + metatitle_id).val()));
|
31 |
var postid = metatitle_id.replace('metaseo-metatitle-', '');
|
32 |
var counter_id = 'metaseo-metatitle-len' + postid;
|
@@ -45,26 +46,24 @@ function metaseo_updateTitle(metatitle_id, needToSave, updateSnippet) {
|
|
45 |
if(typeof updateSnippet == "undefined" || updateSnippet !== false) {
|
46 |
jQuery('#snippet_title' + postid).text(title.substr(0, title_max_len) );
|
47 |
}
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
if (needToSave === true && oldTitleValues[postid] != title ) {
|
50 |
-
|
51 |
-
clearTimeout(metaContentChangeWait);
|
52 |
-
metaContentChangeWait = setTimeout(function() {
|
53 |
-
saveMetaContentChanges('metatitle', postid, title);
|
54 |
-
}, 1000);
|
55 |
}
|
56 |
|
57 |
//Push the new value into the array
|
58 |
oldTitleValues[postid] = title;
|
59 |
}
|
60 |
|
61 |
-
function
|
62 |
var keywords = jQuery.trim(metaseo_clean(jQuery('#' + metakeywords_id).val()));
|
63 |
var postid = metakeywords_id.replace('metaseo-metakeywords-', '');
|
64 |
|
65 |
var counter_id = 'metaseo-metakeywords-len' + postid;
|
66 |
-
console.log(keywords_max_len-keywords.length);
|
67 |
-
console.log(counter_id);
|
68 |
jQuery('#' + counter_id).text(keywords_max_len-keywords.length);
|
69 |
|
70 |
if (keywords.length >= keywords_max_len) {
|
@@ -73,17 +72,15 @@ function metaseo_updatekeywords(metakeywords_id, needToSave, updateSnippet) {
|
|
73 |
else {
|
74 |
jQuery('#' + counter_id).removeClass('word-exceed');
|
75 |
}
|
|
|
76 |
|
77 |
-
|
78 |
-
|
|
|
79 |
if (needToSave === true && oldKeywordsValues[postid] != keywords ) {
|
80 |
-
|
81 |
-
clearTimeout(metaContentChangeWait);
|
82 |
-
metaContentChangeWait = setTimeout(function() {
|
83 |
-
saveMetaContentChanges('metakeywords', postid, keywords);
|
84 |
-
}, 1000);
|
85 |
}
|
86 |
-
|
87 |
//Push the new value into the array
|
88 |
oldKeywordsValues[postid] = keywords;
|
89 |
}
|
@@ -127,7 +124,7 @@ function saveMetaLinkChanges(button_update){
|
|
127 |
});
|
128 |
}
|
129 |
|
130 |
-
function
|
131 |
var desc = jQuery.trim(metaseo_clean(jQuery('#' + metadesc_id).val()));
|
132 |
var postid = metadesc_id.replace('metaseo-metadesc-', '');
|
133 |
var counter_id = 'metaseo-metadesc-len' + postid;
|
@@ -141,13 +138,14 @@ function metaseo_updateDesc(metadesc_id, needToSave) {
|
|
141 |
}
|
142 |
|
143 |
jQuery('#snippet_desc' + postid).text(desc.substr(0, desc_max_len) );
|
|
|
144 |
|
145 |
-
if (needToSave === true && oldDescValues[postid] != desc) {
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
151 |
}
|
152 |
|
153 |
//Push the new value into the array
|
@@ -156,7 +154,7 @@ function metaseo_updateDesc(metadesc_id, needToSave) {
|
|
156 |
|
157 |
var autosaveNotification;
|
158 |
function saveMetaContentChanges(metakey, postid, data) {
|
159 |
-
|
160 |
var postData = {
|
161 |
'action': 'updateContentMeta',
|
162 |
'metakey': metakey,
|
@@ -165,6 +163,7 @@ function saveMetaContentChanges(metakey, postid, data) {
|
|
165 |
};
|
166 |
// We can also pass the url value separately from ajaxurl for front end AJAX implementations
|
167 |
jQuery.post(myAjax.ajax_url, postData, function(response) {
|
|
|
168 |
result = jQuery.parseJSON(response);
|
169 |
|
170 |
if (result.updated == true) {
|
@@ -188,7 +187,6 @@ function checkspecial(element_id){
|
|
188 |
if(meta_type=='change_image_name'){
|
189 |
var str = (element.val());
|
190 |
if( /^[\w\d\-\s+_.$]*$/.test( str ) == false ) {
|
191 |
-
clearTimeout(metaChangeWait);
|
192 |
return false;
|
193 |
}else{
|
194 |
return true;
|
@@ -198,29 +196,14 @@ function checkspecial(element_id){
|
|
198 |
}
|
199 |
}
|
200 |
|
201 |
-
var metaChangeWait;
|
202 |
function metaseo_update(element_id) {
|
203 |
//metaseo-img-alt-4
|
204 |
var element = jQuery(element_id);
|
205 |
var post_id = element.data('post-id');
|
206 |
var meta_type = element.data('meta-type');
|
207 |
var meta_value = element.val();
|
208 |
-
|
209 |
-
clearTimeout(metaChangeWait);
|
210 |
-
metaChangeWait = setTimeout(function() {
|
211 |
-
if(saveChanges(element_id, post_id, meta_type, meta_value)){
|
212 |
-
//jQuery(element_id).parent().find('span.meta-update').removeClass('update-loader');
|
213 |
-
|
214 |
-
if(meta_type === 'change_image_name'){
|
215 |
-
jQuery('a.img-resize[data-post-id="'+ post_id +'"]').data('img-name', meta_value);
|
216 |
-
}
|
217 |
-
|
218 |
-
}
|
219 |
-
}, 1000);
|
220 |
}
|
221 |
|
222 |
-
|
223 |
-
|
224 |
function saveChanges(element_id, post_id, meta_type, meta_value) {
|
225 |
|
226 |
var element = jQuery(element_id);
|
@@ -258,7 +241,6 @@ function saveChanges(element_id, post_id, meta_type, meta_value) {
|
|
258 |
saveChanges(element_id, post_id, meta_type, meta_value);
|
259 |
}
|
260 |
|
261 |
-
metaChangeWait = -1 ;
|
262 |
updated = response.updated;
|
263 |
|
264 |
if (updated == true) {
|
@@ -406,8 +388,7 @@ function saveChanges(element_id, post_id, meta_type, meta_value) {
|
|
406 |
var input = $this.parent().find('input');
|
407 |
var id = input.attr('id');
|
408 |
|
409 |
-
input.val($this.data('default-value'));
|
410 |
-
metaseo_fix_meta(input);
|
411 |
}
|
412 |
//--------------------------------
|
413 |
//Optimize a single post
|
@@ -649,15 +630,11 @@ function importMetaData(that, event){
|
|
649 |
var post_id = element.data('post-id');
|
650 |
var meta_type = element.data('meta-type');
|
651 |
var meta_value = element.val();
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
if(saveChanges(that, post_id, meta_type, meta_value)){
|
656 |
-
if(meta_type === 'change_image_name'){
|
657 |
-
jQuery('a.img-resize[data-post-id="'+ post_id +'"]').data('img-name', meta_value);
|
658 |
-
}
|
659 |
}
|
660 |
-
}
|
661 |
}
|
662 |
|
663 |
function checkeyCode(event,that){
|
@@ -763,9 +740,6 @@ jQuery(document).ready(function($) {
|
|
763 |
if(!checkspecial(this)){
|
764 |
msg = 'Should not special char';
|
765 |
}
|
766 |
-
else{
|
767 |
-
metaseo_update(this);
|
768 |
-
}
|
769 |
}
|
770 |
|
771 |
if(msg.length > 0){
|
@@ -777,25 +751,6 @@ jQuery(document).ready(function($) {
|
|
777 |
}
|
778 |
});
|
779 |
|
780 |
-
$('.metaseo-img-meta').bind('input propertychange', function(){
|
781 |
-
var savedInfo = $(this).parent().find('span.saved-info');
|
782 |
-
var metaseoValue = $(this).val();
|
783 |
-
|
784 |
-
if(checkspecial(this) === true){
|
785 |
-
if($(this).hasClass('metaseo-img-name')){
|
786 |
-
if(metaseoValue.trim().length > 0
|
787 |
-
&& typeof metaseoValueHolder[this.id] != 'undefined'
|
788 |
-
&& metaseoValueHolder[this.id] !== metaseoValue) {
|
789 |
-
metaseo_update(this);
|
790 |
-
}
|
791 |
-
}
|
792 |
-
else{
|
793 |
-
metaseo_update(this);
|
794 |
-
}
|
795 |
-
|
796 |
-
}
|
797 |
-
});
|
798 |
-
|
799 |
$('.metaseo-img-meta').each(function(i, element){
|
800 |
if($(this).hasClass('metaseo-img-name')){
|
801 |
metaseoValueHolder[this.id+'_prev'] = jQuery(this).val();
|
26 |
var oldKeywordsValues = {};
|
27 |
var oldDescValues = {};
|
28 |
var metaContentChangeWait;
|
29 |
+
|
30 |
+
function metaseo_titlelength(metatitle_id, needToSave, updateSnippet) {
|
31 |
var title = jQuery.trim(metaseo_clean(jQuery('#' + metatitle_id).val()));
|
32 |
var postid = metatitle_id.replace('metaseo-metatitle-', '');
|
33 |
var counter_id = 'metaseo-metatitle-len' + postid;
|
46 |
if(typeof updateSnippet == "undefined" || updateSnippet !== false) {
|
47 |
jQuery('#snippet_title' + postid).text(title.substr(0, title_max_len) );
|
48 |
}
|
49 |
+
}
|
50 |
+
|
51 |
+
function metaseo_updateTitle(metatitle_id, needToSave, updateSnippet) {
|
52 |
+
var title = jQuery.trim(metaseo_clean(jQuery('#' + metatitle_id).val()));
|
53 |
+
var postid = metatitle_id.replace('metaseo-metatitle-', '');
|
54 |
if (needToSave === true && oldTitleValues[postid] != title ) {
|
55 |
+
saveMetaContentChanges('metatitle', postid, title);
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
//Push the new value into the array
|
59 |
oldTitleValues[postid] = title;
|
60 |
}
|
61 |
|
62 |
+
function metaseo_keywordlength(metakeywords_id, needToSave, updateSnippet) {
|
63 |
var keywords = jQuery.trim(metaseo_clean(jQuery('#' + metakeywords_id).val()));
|
64 |
var postid = metakeywords_id.replace('metaseo-metakeywords-', '');
|
65 |
|
66 |
var counter_id = 'metaseo-metakeywords-len' + postid;
|
|
|
|
|
67 |
jQuery('#' + counter_id).text(keywords_max_len-keywords.length);
|
68 |
|
69 |
if (keywords.length >= keywords_max_len) {
|
72 |
else {
|
73 |
jQuery('#' + counter_id).removeClass('word-exceed');
|
74 |
}
|
75 |
+
}
|
76 |
|
77 |
+
function metaseo_updatekeywords(metakeywords_id, needToSave, updateSnippet) {
|
78 |
+
var keywords = jQuery.trim(metaseo_clean(jQuery('#' + metakeywords_id).val()));
|
79 |
+
var postid = metakeywords_id.replace('metaseo-metakeywords-', '');
|
80 |
if (needToSave === true && oldKeywordsValues[postid] != keywords ) {
|
81 |
+
saveMetaContentChanges('metakeywords', postid, keywords);
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
+
|
84 |
//Push the new value into the array
|
85 |
oldKeywordsValues[postid] = keywords;
|
86 |
}
|
124 |
});
|
125 |
}
|
126 |
|
127 |
+
function metaseo_desclength(metadesc_id, needToSave) {
|
128 |
var desc = jQuery.trim(metaseo_clean(jQuery('#' + metadesc_id).val()));
|
129 |
var postid = metadesc_id.replace('metaseo-metadesc-', '');
|
130 |
var counter_id = 'metaseo-metadesc-len' + postid;
|
138 |
}
|
139 |
|
140 |
jQuery('#snippet_desc' + postid).text(desc.substr(0, desc_max_len) );
|
141 |
+
}
|
142 |
|
|
|
143 |
|
144 |
+
function metaseo_updateDesc(metadesc_id, needToSave) {
|
145 |
+
var desc = jQuery.trim(metaseo_clean(jQuery('#' + metadesc_id).val()));
|
146 |
+
var postid = metadesc_id.replace('metaseo-metadesc-', '');
|
147 |
+
if (needToSave === true && oldDescValues[postid] != desc) {
|
148 |
+
saveMetaContentChanges('metadesc', postid, desc);
|
149 |
}
|
150 |
|
151 |
//Push the new value into the array
|
154 |
|
155 |
var autosaveNotification;
|
156 |
function saveMetaContentChanges(metakey, postid, data) {
|
157 |
+
jQuery('.wpms_loader' + postid).show();
|
158 |
var postData = {
|
159 |
'action': 'updateContentMeta',
|
160 |
'metakey': metakey,
|
163 |
};
|
164 |
// We can also pass the url value separately from ajaxurl for front end AJAX implementations
|
165 |
jQuery.post(myAjax.ajax_url, postData, function(response) {
|
166 |
+
jQuery('.wpms_loader' + postid).hide();
|
167 |
result = jQuery.parseJSON(response);
|
168 |
|
169 |
if (result.updated == true) {
|
187 |
if(meta_type=='change_image_name'){
|
188 |
var str = (element.val());
|
189 |
if( /^[\w\d\-\s+_.$]*$/.test( str ) == false ) {
|
|
|
190 |
return false;
|
191 |
}else{
|
192 |
return true;
|
196 |
}
|
197 |
}
|
198 |
|
|
|
199 |
function metaseo_update(element_id) {
|
200 |
//metaseo-img-alt-4
|
201 |
var element = jQuery(element_id);
|
202 |
var post_id = element.data('post-id');
|
203 |
var meta_type = element.data('meta-type');
|
204 |
var meta_value = element.val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
}
|
206 |
|
|
|
|
|
207 |
function saveChanges(element_id, post_id, meta_type, meta_value) {
|
208 |
|
209 |
var element = jQuery(element_id);
|
241 |
saveChanges(element_id, post_id, meta_type, meta_value);
|
242 |
}
|
243 |
|
|
|
244 |
updated = response.updated;
|
245 |
|
246 |
if (updated == true) {
|
388 |
var input = $this.parent().find('input');
|
389 |
var id = input.attr('id');
|
390 |
|
391 |
+
input.val($this.data('default-value')).focus();
|
|
|
392 |
}
|
393 |
//--------------------------------
|
394 |
//Optimize a single post
|
630 |
var post_id = element.data('post-id');
|
631 |
var meta_type = element.data('meta-type');
|
632 |
var meta_value = element.val();
|
633 |
+
if(saveChanges(that, post_id, meta_type, meta_value)){
|
634 |
+
if(meta_type === 'change_image_name'){
|
635 |
+
jQuery('a.img-resize[data-post-id="'+ post_id +'"]').data('img-name', meta_value);
|
|
|
|
|
|
|
|
|
636 |
}
|
637 |
+
}
|
638 |
}
|
639 |
|
640 |
function checkeyCode(event,that){
|
740 |
if(!checkspecial(this)){
|
741 |
msg = 'Should not special char';
|
742 |
}
|
|
|
|
|
|
|
743 |
}
|
744 |
|
745 |
if(msg.length > 0){
|
751 |
}
|
752 |
});
|
753 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
754 |
$('.metaseo-img-meta').each(function(i, element){
|
755 |
if($(this).hasClass('metaseo-img-name')){
|
756 |
metaseoValueHolder[this.id+'_prev'] = jQuery(this).val();
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: JoomUnited
|
|
3 |
Tags: google, webmaster tools, keywords, meta, meta description, meta keywords, meta title, robots meta, search engine optimization, seo, wordpress seo, yahoo, image optimization, image resize, custom post seo, redirect, redirection, 301, broken link
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 4.4.2
|
6 |
-
Stable tag: 2.0.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -141,6 +141,8 @@ Feel free to ask SEO questions on our forum or here in the support section
|
|
141 |
* Activate the plugin through the 'Plugins' menu in WordPress
|
142 |
* Use the WP Meta SEO WordPress left menu
|
143 |
|
|
|
|
|
144 |
Once the plugin is installed, open the bulk edition through the admin menu or open a content to load SEO on page analysis.
|
145 |
The plugin will check on install if there's Yoast SEO or All in one SEO and ask for a meta import. Global parameter "Search engine visibility" is also checked to avoid SEO error.
|
146 |
|
@@ -192,23 +194,28 @@ This manual SEO validation on click on the reload analysis button.
|
|
192 |
== Screenshots ==
|
193 |
|
194 |
1. Main dashboard of the plugin with SEO optimization check
|
195 |
-
1. Bulk content meta edition with AJAX saving
|
196 |
1. On page dynamic SEO analysis for page, posts and custom post type
|
197 |
-
1.
|
|
|
198 |
1. Image resized in HTML (with handles) is automatically detected and can be resized
|
199 |
-
1.
|
200 |
-
1.
|
201 |
-
1.
|
202 |
|
203 |
== Changelog ==
|
204 |
|
|
|
|
|
|
|
|
|
|
|
205 |
= 2.0.1 =
|
206 |
-
* Fix
|
207 |
|
208 |
= 2.0.0 =
|
209 |
-
* Add
|
210 |
-
* Add
|
211 |
-
* Add
|
212 |
|
213 |
= 1.7.3 =
|
214 |
* Fix og: link broken (facebook)
|
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.4.2
|
6 |
+
Stable tag: 2.0.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
141 |
* Activate the plugin through the 'Plugins' menu in WordPress
|
142 |
* Use the WP Meta SEO WordPress left menu
|
143 |
|
144 |
+
**Full documentation available here:** https://www.joomunited.com/documentation/wp-meta-seo-documentation
|
145 |
+
|
146 |
Once the plugin is installed, open the bulk edition through the admin menu or open a content to load SEO on page analysis.
|
147 |
The plugin will check on install if there's Yoast SEO or All in one SEO and ask for a meta import. Global parameter "Search engine visibility" is also checked to avoid SEO error.
|
148 |
|
194 |
== Screenshots ==
|
195 |
|
196 |
1. Main dashboard of the plugin with SEO optimization check
|
|
|
197 |
1. On page dynamic SEO analysis for page, posts and custom post type
|
198 |
+
1. Bulk content meta SEO edition with AJAX saving
|
199 |
+
1. Batch copy information of your images
|
200 |
1. Image resized in HTML (with handles) is automatically detected and can be resized
|
201 |
+
1. 404 and redirect manager, remove all 404 errors
|
202 |
+
1. Custom WP Meta SEO 404 page and redirect all 404 page
|
203 |
+
1. Social sharing information, display the SEO content you want on sharing
|
204 |
|
205 |
== Changelog ==
|
206 |
|
207 |
+
= 2.0.2 =
|
208 |
+
* Fix Detect new type of 404 and add tooltip
|
209 |
+
* Fix comment content not detected
|
210 |
+
* Fix Autosaving too fast in safari or firefox
|
211 |
+
|
212 |
= 2.0.1 =
|
213 |
+
* Fix Googlefont style on Safari browser
|
214 |
|
215 |
= 2.0.0 =
|
216 |
+
* Add 404 and redirect manager
|
217 |
+
* Add Options to redirect all 404 to home page
|
218 |
+
* Add Setup 404 page as: WP Meta SEO page, custom page, defulat page
|
219 |
|
220 |
= 1.7.3 =
|
221 |
* Fix og: link broken (facebook)
|
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: 2.0.
|
8 |
* Text Domain: wp-meta-seo
|
9 |
* Domain Path: /languages
|
10 |
* Author: JoomUnited
|
@@ -47,7 +47,7 @@ if (!defined('URL'))
|
|
47 |
define('URL', get_site_url());
|
48 |
|
49 |
if (!defined('WPMSEO_VERSION')) {
|
50 |
-
define('WPMSEO_VERSION', '2.0.
|
51 |
}
|
52 |
|
53 |
if (!defined('WPMSEO_FILE'))
|
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: 2.0.2
|
8 |
* Text Domain: wp-meta-seo
|
9 |
* Domain Path: /languages
|
10 |
* Author: JoomUnited
|
47 |
define('URL', get_site_url());
|
48 |
|
49 |
if (!defined('WPMSEO_VERSION')) {
|
50 |
+
define('WPMSEO_VERSION', '2.0.2');
|
51 |
}
|
52 |
|
53 |
if (!defined('WPMSEO_FILE'))
|