WP Meta SEO - Version 3.2.4

Version Description

  • WP Meta SEO Addon compatibility
  • Fix conflict with DIVI layout injector plugin
Download this release

Release Info

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

Code changes from version 3.2.3 to 3.2.4

Files changed (38) hide show
  1. css/broken_link.css +58 -0
  2. css/metaseo_admin.css +11 -3
  3. inc/class.metaseo-admin.php +94 -10
  4. inc/class.metaseo-broken-link-table.php +148 -77
  5. inc/class.metaseo-content-list-table.php +2 -3
  6. inc/class.metaseo-dashboard.php +426 -55
  7. inc/class.metaseo-image-list-table.php +2 -2
  8. inc/class.metaseo-link-list-table.php +2 -2
  9. inc/class.metaseo-metabox.php +9 -3
  10. inc/class.metaseo-sitemap.php +257 -19
  11. inc/google_analytics/tracking/code-classic.php +9 -0
  12. inc/google_analytics/tracking/code-universal.php +9 -0
  13. inc/google_analytics/tracking/events-classic.php +9 -0
  14. inc/google_analytics/tracking/events-universal.php +9 -0
  15. inc/google_analytics/wpmsgapi.php +8 -1
  16. inc/google_analytics/wpmstools.php +8 -1
  17. inc/pages/dashboard.php +45 -58
  18. inc/pages/dashboard/imgsmeta.php +19 -0
  19. inc/pages/dashboard/imgsresize.php +19 -0
  20. inc/pages/dashboard/link_meta.php +19 -0
  21. inc/pages/dashboard/meta_desc.php +19 -0
  22. inc/pages/dashboard/meta_title.php +19 -0
  23. inc/pages/dashboard/new_content.php +19 -0
  24. inc/pages/dashboard/permalink.php +19 -0
  25. inc/pages/metaseo-broken-link.php +5 -1
  26. inc/pages/settings.php +60 -1
  27. inc/pages/sitemaps/metaseo-google-sitemap.php +15 -0
  28. inc/pages/sitemaps/metaseo-source_pages.php +1 -1
  29. inc/pages/sitemaps/metaseo-source_posts.php +19 -16
  30. inc/pages/sitemaps/metaseo-source_posts_custom.php +84 -0
  31. inc/pages/sitemaps/sitemap_menus.php +9 -0
  32. js/dashboard.js +169 -27
  33. js/metaseo_admin.js +24 -25
  34. js/metaseo_sitemap.js +53 -20
  35. js/site-jPages.js +11 -1
  36. js/wpms-broken-link.js +264 -186
  37. readme.txt +7 -2
  38. wp-meta-seo.php +48 -6
css/broken_link.css ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .custom_redirect_editor_content{
2
+ display: none;
3
+ width: 100%;
4
+ }
5
+
6
+ .custom_redirect_editor_content.show{
7
+ display:block;
8
+ }
9
+
10
+ .link-target{
11
+ display: none;
12
+ }
13
+
14
+ .wp-list-table .wpms-input-text-wrap{
15
+ width: 100%;
16
+ float: left;
17
+ }
18
+
19
+ table.metaseo_images .wpms-input-text-wrap input{
20
+ max-width:80% !important;
21
+ float: left;
22
+ }
23
+
24
+ .wlink-btn{
25
+ float: left;
26
+ padding: 2px;
27
+ cursor: pointer;
28
+ }
29
+
30
+ .wpms_form_add_customlink{
31
+ width: 50%;
32
+ float: left;
33
+ }
34
+
35
+ .custom_redirect_editor_content .wpms-input-text-wrap th{
36
+ width: 100px;
37
+ }
38
+
39
+ .custom_redirect_editor_content .wpms-input-text-wrap td{
40
+ padding: 15px 0px;
41
+ }
42
+
43
+ .wpms-update-link-button{
44
+ margin-right: 40px !important;
45
+ }
46
+
47
+ .wpms_form_add_customlink .custom_redirect_status{
48
+ float: left;
49
+ margin-left: 15%;
50
+ }
51
+
52
+ .wp-list-table .wpms-inline-editor-content{
53
+ width: 100%;
54
+ }
55
+
56
+ .wpms_outgoing{
57
+ color: #4caf50;
58
+ }
css/metaseo_admin.css CHANGED
@@ -416,7 +416,7 @@ strong {
416
  line-height: 26px;
417
  }
418
 
419
- .wpms-link-url-field,.wpms-link-text-field,.wpms-link-redirect-field{
420
  width:85%;
421
  float: right;
422
  }
@@ -500,7 +500,7 @@ strong {
500
  padding: 10px;
501
  }
502
 
503
- .content-wpms-redirection{
504
  display: none;
505
  }
506
 
@@ -539,7 +539,7 @@ strong {
539
  color: #4caf50;
540
  }
541
 
542
- .wpmf_process{
543
  background:#81b5ee;
544
  height: 2px;
545
  width:0%;
@@ -610,6 +610,14 @@ strong {
610
  line-height: 18px !important;
611
  }
612
 
 
 
 
 
 
 
 
 
613
  .metaseo-img-lb{
614
  float:left;
615
  width: 70px;
416
  line-height: 26px;
417
  }
418
 
419
+ .wpms-link-url-field,.wpms-link-text-field,.wpms-link-redirect-field,.custom_redirect_text,.custom_redirect_url,.custom_redirect_url_redirect{
420
  width:85%;
421
  float: right;
422
  }
500
  padding: 10px;
501
  }
502
 
503
+ .content-wpms-redirection,.content-wpms-email{
504
  display: none;
505
  }
506
 
539
  color: #4caf50;
540
  }
541
 
542
+ .wpms_process{
543
  background:#81b5ee;
544
  height: 2px;
545
  width:0%;
610
  line-height: 18px !important;
611
  }
612
 
613
+ #numberFrequency{
614
+ width: 70px;
615
+ vertical-align: middle;
616
+ }
617
+
618
+ #showlinkFrequency {
619
+ padding: 3px;
620
+ }
621
  .metaseo-img-lb{
622
  float:left;
623
  width: 70px;
inc/class.metaseo-admin.php CHANGED
@@ -71,8 +71,11 @@ class MetaSeo_Admin {
71
  'wpmsga_track_exclude' => array(),
72
  'wpmsga_cookiename' => ''
73
  );
74
-
75
-
 
 
 
76
  add_action('admin_menu', array($this, 'register_menu_page'));
77
 
78
  /** Load admin js * */
@@ -102,8 +105,16 @@ class MetaSeo_Admin {
102
  add_action('deleted_comment', array('MetaSeo_Broken_Link_Table', 'wpms_deleted_comment'));
103
 
104
  add_action( 'wp_head', array( 'MetaSeo_Google_Analytics', 'tracking_code' ), 99 );
 
105
  }
106
-
 
 
 
 
 
 
 
107
  /*
108
  * Create wpms_links table
109
  */
@@ -713,10 +724,42 @@ class MetaSeo_Admin {
713
  function wpms_save_settings404() {
714
  if (isset($_POST['wpms_redirect'])) {
715
  update_option('wpms_settings_404', $_POST['wpms_redirect']);
716
- wp_send_json(true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
717
  }
 
 
718
  }
719
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  /*
721
  * Add a new field to a section of a settings page
722
  */
@@ -845,7 +888,7 @@ class MetaSeo_Admin {
845
  <?php _e("Provides show or do not show this page in search results in search results.", "wp-meta-seo"); ?></label>
846
  <?php
847
  }
848
-
849
  /*
850
  * Display showfacebook input
851
  */
@@ -974,6 +1017,10 @@ class MetaSeo_Admin {
974
  wp_localize_script('wpms-bulk', 'wpmseobulkL10n', $this->meta_seo_localize_script());
975
  }
976
 
 
 
 
 
977
  if ($current_screen->base == 'toplevel_page_metaseo_dashboard') {
978
  wp_enqueue_script('Chart', plugins_url('js/Chart.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
979
  wp_enqueue_script('jquery-knob', plugins_url('js/jquery.knob.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
@@ -1102,7 +1149,6 @@ class MetaSeo_Admin {
1102
  * or not a page is included in the menu.
1103
  */
1104
  function register_menu_page() {
1105
-
1106
  // Add main page
1107
  $admin_page = add_menu_page(__('WP Meta SEO:', 'wp-meta-seo') . ' ' . __('Dashboard', 'wp-meta-seo'), __('WP Meta SEO', 'wp-meta-seo'), 'manage_options', 'metaseo_dashboard', array(
1108
  $this, 'load_page',), 'dashicons-chart-area');
@@ -1190,8 +1236,6 @@ class MetaSeo_Admin {
1190
  ),
1191
  );
1192
 
1193
-
1194
-
1195
  // Allow submenu pages manipulation
1196
  $submenu_pages = apply_filters('metaseo_submenu_pages', $submenu_pages);
1197
 
@@ -1444,6 +1488,37 @@ class MetaSeo_Admin {
1444
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/metaseo-broken-link.php' );
1445
  break;
1446
  case 'metaseo_settings':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1447
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/settings.php' );
1448
  break;
1449
 
@@ -1687,7 +1762,9 @@ class MetaSeo_Admin {
1687
  add_action('wp_ajax_metaseo_validate_analysis', array($this, 'metaseo_validate_analysis'));
1688
  add_action('wp_ajax_metaseo_update_link', array($this, 'metaseo_update_link'));
1689
  add_action('wp_ajax_wpms_save_settings404', array($this, 'wpms_save_settings404'));
 
1690
  add_action('wp_ajax_wpms_update_link', array('MetaSeo_Broken_Link_Table', 'wpms_update_link'));
 
1691
  add_action('wp_ajax_wpms_unlink', array('MetaSeo_Broken_Link_Table', 'wpms_unlink'));
1692
  add_action('wp_ajax_wpms_recheck_link', array('MetaSeo_Broken_Link_Table', 'wpms_recheck_link'));
1693
  add_action('wp_ajax_wpms_scan_link', array('MetaSeo_Broken_Link_Table', 'wpms_scan_link'));
@@ -1698,6 +1775,13 @@ class MetaSeo_Admin {
1698
  add_action('wp_ajax_metaseo_update_pageindex', array($this, 'metaseo_update_pageindex'));
1699
  add_action('wp_ajax_wpms_backend_item_reports', array('MetaSeo_Google_Analytics', 'ajax_item_reports'));
1700
  add_action('wp_ajax_wpmsga_wpmsClearauthor', array('MetaSeo_Google_Analytics', 'wpmsga_wpmsClearauthor'));
1701
- add_action('wp_ajax_wpmsga_update_option', array('MetaSeo_Google_Analytics', 'wpmsga_update_option'));
 
 
 
 
 
 
 
1702
  }
1703
  }
71
  'wpmsga_track_exclude' => array(),
72
  'wpmsga_cookiename' => ''
73
  );
74
+
75
+ if (!get_option('_wpms_dash_last_update', false)) {
76
+ update_option('_wpms_dash_last_update',time());
77
+ }
78
+
79
  add_action('admin_menu', array($this, 'register_menu_page'));
80
 
81
  /** Load admin js * */
105
  add_action('deleted_comment', array('MetaSeo_Broken_Link_Table', 'wpms_deleted_comment'));
106
 
107
  add_action( 'wp_head', array( 'MetaSeo_Google_Analytics', 'tracking_code' ), 99 );
108
+ add_action('admin_footer', array($this, 'add_editor_footer'));
109
  }
110
+
111
+ public function add_editor_footer() {
112
+ if ( ! class_exists( '_WP_Editors', false ) ){
113
+ require_once ABSPATH . "wp-includes/class-wp-editor.php";
114
+ _WP_Editors::wp_link_dialog();
115
+ }
116
+ }
117
+
118
  /*
119
  * Create wpms_links table
120
  */
724
  function wpms_save_settings404() {
725
  if (isset($_POST['wpms_redirect'])) {
726
  update_option('wpms_settings_404', $_POST['wpms_redirect']);
727
+
728
+ }
729
+
730
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)) {
731
+ $params = array('enable','numberFrequency','showlinkFrequency');
732
+ $settinglink = array();
733
+ foreach ($params as $param){
734
+ if(isset($_POST[$param])){
735
+ $settinglink[$param] = $_POST[$param];
736
+ }
737
+ }
738
+
739
+ if(empty($settinglink['wpms_lastRun_scanlink'])){
740
+ $settinglink['wpms_lastRun_scanlink'] = time();
741
+ }
742
+ update_option('wpms_link_settings',$settinglink);
743
  }
744
+
745
+ wp_send_json(true);
746
  }
747
+
748
+ /*
749
+ * Update option wpms_email_settings
750
+ */
751
+ function wpms_save_settingemail(){
752
+ $params = array('enable','host','type_encryption','port','autentication','username','password');
753
+ $settingemail = array();
754
+ foreach ($params as $param){
755
+ if(isset($_POST[$param])){
756
+ $settingemail[$param] = $_POST[$param];
757
+ }
758
+ }
759
+ update_option('wpms_email_settings',$settingemail);
760
+ wp_send_json(true);
761
+ }
762
+
763
  /*
764
  * Add a new field to a section of a settings page
765
  */
888
  <?php _e("Provides show or do not show this page in search results in search results.", "wp-meta-seo"); ?></label>
889
  <?php
890
  }
891
+
892
  /*
893
  * Display showfacebook input
894
  */
1017
  wp_localize_script('wpms-bulk', 'wpmseobulkL10n', $this->meta_seo_localize_script());
1018
  }
1019
 
1020
+ if ($current_screen->base == 'wp-meta-seo_page_metaseo_broken_link') {
1021
+ wp_enqueue_style('wpms_brokenlink_style', plugins_url('css/broken_link.css', dirname(__FILE__)), array(), WPMSEO_VERSION);
1022
+ }
1023
+
1024
  if ($current_screen->base == 'toplevel_page_metaseo_dashboard') {
1025
  wp_enqueue_script('Chart', plugins_url('js/Chart.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
1026
  wp_enqueue_script('jquery-knob', plugins_url('js/jquery.knob.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
1149
  * or not a page is included in the menu.
1150
  */
1151
  function register_menu_page() {
 
1152
  // Add main page
1153
  $admin_page = add_menu_page(__('WP Meta SEO:', 'wp-meta-seo') . ' ' . __('Dashboard', 'wp-meta-seo'), __('WP Meta SEO', 'wp-meta-seo'), 'manage_options', 'metaseo_dashboard', array(
1154
  $this, 'load_page',), 'dashicons-chart-area');
1236
  ),
1237
  );
1238
 
 
 
1239
  // Allow submenu pages manipulation
1240
  $submenu_pages = apply_filters('metaseo_submenu_pages', $submenu_pages);
1241
 
1488
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/metaseo-broken-link.php' );
1489
  break;
1490
  case 'metaseo_settings':
1491
+ // email settings
1492
+ $email_settings = array(
1493
+ "enable" => 0,
1494
+ "host" => "smtp.gmail.com",
1495
+ "type_encryption" => "ssl",
1496
+ "port" => "465",
1497
+ "autentication" => "yes",
1498
+ "username" => "",
1499
+ "password" => "",
1500
+ );
1501
+
1502
+ $mailsettings = get_option('wpms_email_settings');
1503
+ if (is_array($mailsettings)) {
1504
+ $email_settings = array_merge($email_settings, $mailsettings);
1505
+ }
1506
+
1507
+ $html_tabemail = apply_filters('wpmsaddon_emailsettings','',$email_settings);
1508
+
1509
+ // link settings
1510
+ $link_settings = array(
1511
+ "enable" => 0,
1512
+ "numberFrequency" => 1,
1513
+ "showlinkFrequency" => "month"
1514
+ );
1515
+
1516
+ $linksettings = get_option('wpms_link_settings');
1517
+ if (is_array($linksettings)) {
1518
+ $link_settings = array_merge($link_settings, $linksettings);
1519
+ }
1520
+
1521
+ $link_settings_html = apply_filters('wpmsaddon_linksettings','',$link_settings);
1522
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/settings.php' );
1523
  break;
1524
 
1762
  add_action('wp_ajax_metaseo_validate_analysis', array($this, 'metaseo_validate_analysis'));
1763
  add_action('wp_ajax_metaseo_update_link', array($this, 'metaseo_update_link'));
1764
  add_action('wp_ajax_wpms_save_settings404', array($this, 'wpms_save_settings404'));
1765
+ add_action('wp_ajax_wpms_save_settingemail', array($this, 'wpms_save_settingemail'));
1766
  add_action('wp_ajax_wpms_update_link', array('MetaSeo_Broken_Link_Table', 'wpms_update_link'));
1767
+ add_action('wp_ajax_wpms_add_custom_redirect', array('MetaSeo_Broken_Link_Table', 'wpms_add_custom_redirect'));
1768
  add_action('wp_ajax_wpms_unlink', array('MetaSeo_Broken_Link_Table', 'wpms_unlink'));
1769
  add_action('wp_ajax_wpms_recheck_link', array('MetaSeo_Broken_Link_Table', 'wpms_recheck_link'));
1770
  add_action('wp_ajax_wpms_scan_link', array('MetaSeo_Broken_Link_Table', 'wpms_scan_link'));
1775
  add_action('wp_ajax_metaseo_update_pageindex', array($this, 'metaseo_update_pageindex'));
1776
  add_action('wp_ajax_wpms_backend_item_reports', array('MetaSeo_Google_Analytics', 'ajax_item_reports'));
1777
  add_action('wp_ajax_wpmsga_wpmsClearauthor', array('MetaSeo_Google_Analytics', 'wpmsga_wpmsClearauthor'));
1778
+ add_action('wp_ajax_wpmsga_update_option', array('MetaSeo_Google_Analytics', 'wpmsga_update_option'));
1779
+
1780
+ add_action('wp_ajax_wpms_dash_permalink', array('MetaSeo_Dashboard', 'wpms_dash_permalink'));
1781
+ add_action('wp_ajax_wpms_dash_newcontent', array('MetaSeo_Dashboard', 'wpms_dash_newcontent'));
1782
+ add_action('wp_ajax_wpms_dash_linkmeta', array('MetaSeo_Dashboard', 'wpms_dash_linkmeta'));
1783
+ add_action('wp_ajax_wpms_dash_metatitle', array('MetaSeo_Dashboard', 'wpms_dash_metatitle'));
1784
+ add_action('wp_ajax_wpms_dash_metadesc', array('MetaSeo_Dashboard', 'wpms_dash_metadesc'));
1785
+ add_action('wp_ajax_wpms_dash_imgsmeta', array('MetaSeo_Dashboard', 'wpms_dash_imgsmeta'));
1786
  }
1787
  }
inc/class.metaseo-broken-link-table.php CHANGED
@@ -69,36 +69,6 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
69
  <?php
70
  }
71
 
72
- /**
73
- * Extra controls to be displayed between bulk actions and pagination
74
- * @param string $which
75
- */
76
- function extra_tablenav($which) {
77
- echo '<div class="alignleft actions">';
78
- global $wpdb;
79
-
80
- $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
81
- $post_types = "'" . implode("', '", $post_types) . "'";
82
-
83
- $states = get_post_stati(array('show_in_admin_all_list' => true));
84
- $states['trash'] = 'trash';
85
- $all_states = "'" . implode("', '", $states) . "'";
86
-
87
- $query = "SELECT DISTINCT post_type FROM $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types) ORDER BY 'post_type' ASC";
88
- $post_types = $wpdb->get_results($query);
89
-
90
- $selected = !empty($_REQUEST['post_type_filter']) ? $_REQUEST['post_type_filter'] : -1;
91
-
92
- $options = '<option value="-1">Show All Post Types</option>';
93
-
94
- foreach ($post_types as $post_type) {
95
- $obj = get_post_type_object($post_type->post_type);
96
- $options .= sprintf('<option value="%2$s" %3$s>%1$s</option>', $obj->labels->name, $post_type->post_type, selected($selected, $post_type->post_type, false));
97
- }
98
-
99
- echo "</div>";
100
- }
101
-
102
  /**
103
  * Get a list of columns. The format is:
104
  * 'internal-name' => 'Title'
@@ -220,7 +190,9 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
220
  }
221
 
222
  if (!empty($_REQUEST['sl_broken']) && $_REQUEST['sl_broken'] != 'all') {
223
- if ($_REQUEST['sl_broken'] == 'valid_links') {
 
 
224
  $where[] = "broken_internal = 0 AND broken_indexed = 0";
225
  } elseif ($_REQUEST['sl_broken'] == 'internal_broken_links') {
226
  $where[] = "broken_internal = 1";
@@ -319,6 +291,9 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
319
  * Displays the search box.
320
  */
321
  function search_box1() {
 
 
 
322
  if (empty($_REQUEST['txtkeyword']) && !$this->has_items())
323
  return;
324
  $txtkeyword = (!empty($_REQUEST['txtkeyword'])) ? urldecode(stripslashes($_REQUEST['txtkeyword'])) : "";
@@ -332,7 +307,6 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
332
  echo '<input type="hidden" name="detached" value="' . esc_attr($_REQUEST['detached']) . '" />';
333
  ?>
334
  <p class="search-box">
335
-
336
  <input type="search" id="image-search-input" name="txtkeyword" value="<?php echo esc_attr(stripslashes($txtkeyword)); ?>" />
337
  <?php submit_button('Search URL', 'button', 'search', false, array('id' => 'search-submit')); ?>
338
  </p>
@@ -363,7 +337,14 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
363
 
364
  /* Add fillter broken */
365
  function broken_fillter($name) {
366
- $brokens = array('valid_links' => __('Valid links', 'wp-meta-seo'), 'automaticaly_indexed' => __('404 automaticaly indexed', 'wp-meta-seo'), 'internal_broken_links' => __('Internal broken links', 'wp-meta-seo'));
 
 
 
 
 
 
 
367
  $curent_broken = isset($_REQUEST['sl_broken']) ? $_REQUEST['sl_broken'] : 'all';
368
  ?>
369
  <label for="filter-by-broken" class="screen-reader-text"><?php _e('Filter by broken', 'wp-meta-seo'); ?></label>
@@ -385,7 +366,7 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
385
 
386
  /* Add fillter type */
387
  function type_fillter($name) {
388
- $types = array('url' => 'URL', 'image' => 'Image', 'other' => 'Other');
389
  $curent_type = isset($_REQUEST['sltype']) ? $_REQUEST['sltype'] : 'all';
390
  ?>
391
  <label for="filter-by-type" class="screen-reader-text"><?php _e('Filter by type', 'wp-meta-seo'); ?></label>
@@ -404,7 +385,7 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
404
 
405
  <?php
406
  submit_button(__('Filter'), 'button', 'filter_type_action', false, array('id' => 'broken-submit'));
407
- echo '<div style="float:left;padding-left: 5px;"><div class="wpmf_process" data-w="0"></div>';
408
  echo '<div data-comment_paged="1" data-paged="1" class="button wpms_scan_link">' . __('Index internal broken links', 'wp-meta-seo') . '</div></div>';
409
  echo '<span class="spinner"></span>';
410
  }
@@ -441,7 +422,7 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
441
  if (!empty($records)) {
442
  foreach ($records as $rec) {
443
  $i++;
444
- echo '<tr id="record_' . $i . '" data-link="' . $i . '" data-post_id="' . $rec->source_id . '">';
445
  foreach ($columns as $column_name => $column_display_name) {
446
 
447
  $class = sprintf('class="%1$s column-%1$s"', $column_name);
@@ -462,11 +443,20 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
462
  }
463
  echo '<td class="wpms_link_html" colspan="3">';
464
  echo '<input type="hidden" class="wpms_link_text" value="' . esc_attr($rec->link_text) . '">';
465
- echo '<a class="link_html" target="_blank" href="' . esc_url($value_url) . '">' . $value_url . '</a>';
 
 
 
 
 
 
 
 
 
466
  $row_action = array(
467
- 'edit' => '<a class="wpms_action_link wpms-edit-button" title="Edit this link"><div class="wpms_icon_action"><i class="material-icons">mode_edit</i></div><span>' . __('Redirect', 'wp-meta-seo') . '</span></a>',
468
- 'delete' => '<a class="wpms_action_link submitdelete wpms-unlink-button" data-link_id="' . $rec->id . '" data-type="' . $rec->type . '" data-source_id="' . $rec->source_id . '" title="' . __('Remove this link from all posts', 'wp-meta-seo') . '"><div class="wpms_icon_action"><i class="material-icons">delete_forever</i></div><span>' . __('Remove link', 'wp-meta-seo') . '</span></a>',
469
- '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>'
470
  );
471
  echo $this->row_actions($row_action, false);
472
  if (!empty($rec->source_id)) {
@@ -515,17 +505,36 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
515
  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>';
516
  }
517
  } else {
518
- 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>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
  }
520
  ?>
521
 
522
- <span class="wpms-input-text-wrap"><span class="title"><?php _e('URL', 'wp-meta-seo'); ?></span><input <?php echo ($rec->type == '404_automaticaly') ? 'readonly' : '' ?> type="text" name="link_url" class="wpms-link-url-field" value="<?php echo esc_attr($value_url); ?>" /></span>
523
- <span class="wpms-input-text-wrap"><span class="title"><?php _e('Redirect', 'wp-meta-seo'); ?></span><input type="text" name="link_url_redirect" class="wpms-link-redirect-field" value="<?php echo esc_attr($rec->link_url_redirect); ?>" /></span>
 
 
 
 
524
  </label>
525
 
526
  <div class="submit wpms-inline-editor-buttons">
527
  <input type="button" class="button-secondary cancel alignleft wpms-cancel-button" value="<?php echo esc_attr(__('Cancel', 'wp-meta-seo')); ?>" />
528
- <input type="button" data-type="<?php echo $rec->type ?>" data-link_id="<?php echo $rec->id ?>" data-source_id="<?php echo $rec->source_id ?>" class="button-primary save alignright wpms-update-link-button" value="<?php echo esc_attr(__('Update', 'wp-meta-seo')); ?>" />
529
  </div>
530
  </div>
531
  <?php
@@ -539,7 +548,6 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
539
  break;
540
  case 'col_status':
541
  echo '<td colspan="3" class="col_status">';
542
-
543
  if (strpos($rec->status_text, '200') !== false) {
544
  echo '<i class="material-icons wpms_ok metaseo_help_status" alt="Link is OK">done</i>';
545
  } elseif (strpos($rec->status_text, '301') !== false) {
@@ -585,8 +593,8 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
585
  $source = get_comment($rec->source_id);
586
  if (!empty($source)) {
587
  $row_action = array(
588
- 'edit' => '<a target="_blank" href="' . get_edit_comment_link($rec->source_id) . '" title="Edit this item">Edit</a>',
589
- 'view' => '<a target="_blank" href="' . get_comment_link($rec->source_id) . '" title="View &#8220;test&#8221;" rel="permalink">View</a>'
590
  );
591
 
592
  if ($rec->type == 'comment') {
@@ -600,7 +608,7 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
600
  $source = get_post($rec->source_id);
601
  if (!empty($source)) {
602
  $row_action = array(
603
- 'edit' => '<a target="_blank" href="' . get_edit_post_link($rec->source_id) . '" title="Edit this item">Edit</a>',
604
  'view' => '<a target="_blank" href="' . get_post_permalink($rec->source_id) . '" title="View &#8220;test&#8221;" rel="permalink">View</a>'
605
  );
606
 
@@ -614,7 +622,11 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
614
  echo $source_inner;
615
  echo $this->row_actions($row_action, false);
616
  } else {
617
- echo '<a>' . __('Source Not Found', 'wp-meta-seo') . '</a>';
 
 
 
 
618
  }
619
  echo '</td>';
620
  break;
@@ -980,6 +992,8 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
980
  $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'))
981
  );
982
  }
 
 
983
  }
984
 
985
  /*
@@ -1045,6 +1059,8 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1045
  );
1046
  }
1047
  }
 
 
1048
  }
1049
 
1050
  /*
@@ -1204,6 +1220,20 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1204
  wp_send_json(array('status' => false, 'type' => 'limit_post', 'paged' => $_POST['paged'], 'percent' => $percent_post * count($results)));
1205
  }
1206
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1207
  wp_send_json(array('status' => true));
1208
  }
1209
 
@@ -1267,6 +1297,11 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1267
  */
1268
  public static function wpms_check_internal_link($link, $siteUrl, $value) {
1269
  $info_link = parse_url($link);
 
 
 
 
 
1270
  $info_site_url = parse_url($siteUrl);
1271
  $domain_link = $info_link['host'] . $info_link['path'] . '/';
1272
  $domain_site = $info_site_url['host'] . $info_site_url['path'] . '/';
@@ -1337,6 +1372,14 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1337
  }
1338
  return $status_text;
1339
  }
 
 
 
 
 
 
 
 
1340
 
1341
  /*
1342
  * Update link
@@ -1349,15 +1392,27 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1349
  $link_detail = $wpdb->get_row($sql);
1350
  if (empty($link_detail))
1351
  wp_send_json(false);
1352
- $status = MetaSeo_Broken_Link_Table::get_urlstatus(($_POST['new_link']));
 
 
 
 
 
 
 
 
 
 
 
 
 
1353
  $status_text = MetaSeo_Broken_Link_Table::wpms_get_status_text($status);
1354
  $status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
1355
-
1356
  if ($link_detail->type != '404_automaticaly') {
1357
- $value = array('link_url' => ($_POST['new_link']),
1358
  'link_final_url' => '',
1359
  'link_url_redirect' => '',
1360
- 'link_text' => stripcslashes($_POST['new_text']),
1361
  'status_code' => $status,
1362
  'status_text' => $status_text,
1363
  'broken_indexed' => 0,
@@ -1365,44 +1420,48 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1365
  'warning' => 0,
1366
  'dismissed' => 0,
1367
  );
1368
- if (strpos($_POST['new_link'], 'mailto:') !== false) {
1369
- $value['link_final_url'] = $_POST['new_link'];
1370
  } else {
1371
- if (!preg_match("~^(?:f|ht)tps?://~i", $_POST['new_link'])) {
1372
  $perlink = get_option('permalink_structure');
1373
  if (empty($perlink)) {
1374
- $value['link_final_url'] = get_site_url() . '/' . $_POST['new_link'];
1375
  } else {
1376
  if (!empty($link_detail->source_id)) {
1377
- $value['link_final_url'] = get_permalink($link_detail->source_id) . $_POST['new_link'];
1378
  } else {
1379
- $value['link_final_url'] = $perlink . '/' . $_POST['new_link'];
1380
  }
1381
  }
1382
  } else {
1383
- $value['link_final_url'] = $_POST['new_link'];
1384
  }
1385
  }
1386
 
1387
- if (!empty($_POST['link_redirect']))
1388
- $value['link_url_redirect'] = ($_POST['link_redirect']);
1389
  if (isset($status_type) && $status_type != 'ok') {
1390
  $value[$status_type] = 1;
1391
  }
1392
  } else {
1393
- $status = MetaSeo_Broken_Link_Table::get_urlstatus(($_POST['link_redirect']));
1394
  $status_text = MetaSeo_Broken_Link_Table::wpms_get_status_text($status);
1395
 
1396
  $value = array(
1397
- 'link_url_redirect' => ($_POST['link_redirect']),
1398
  'status_code' => $status,
1399
  'status_text' => $status_text,
1400
  'broken_indexed' => 1
1401
  );
1402
  }
1403
 
 
 
 
 
1404
  $site_url = get_site_url();
1405
- $value = MetaSeo_Broken_Link_Table::wpms_check_internal_link($_POST['new_link'], $site_url, $value);
1406
 
1407
  $wpdb->update(
1408
  $wpdb->prefix . 'wpms_links', $value, array('id' => $_POST['link_id'])
@@ -1410,13 +1469,13 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1410
 
1411
  switch ($link_detail->type) {
1412
  case '404_automaticaly':
1413
- wp_send_json(array('status' => true, 'type' => '404_automaticaly', 'status_text' => $status_text, 'new_link' => esc_url($_POST['new_link'])));
1414
  break;
1415
  case 'comment_content_image':
1416
  $comment = get_comment($link_detail->source_id);
1417
  if (!empty($comment)) {
1418
  $old_value = $comment->comment_content;
1419
- $edit_result = MetaSeo_Broken_Link_Table::edit_linkimg($old_value, $_POST['new_link'], $link_detail->link_url);
1420
  $my_comment = array(
1421
  'comment_ID' => $link_detail->source_id,
1422
  'comment_content' => $edit_result['content']
@@ -1430,7 +1489,7 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1430
  $post = get_post($link_detail->source_id);
1431
  if (!empty($post)) {
1432
  $old_value = $post->post_content;
1433
- $edit_result = MetaSeo_Broken_Link_Table::edit_linkimg($old_value, $_POST['new_link'], $link_detail->link_url);
1434
  $my_post = array(
1435
  'ID' => $link_detail->source_id,
1436
  'post_content' => $edit_result['content']
@@ -1445,11 +1504,11 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1445
  $comment = get_comment($link_detail->source_id);
1446
  if (!empty($comment)) {
1447
  $old_value = $comment->comment_content;
1448
- if (isset($_POST['data_type']) && $_POST['data_type'] == 'multi' && $_POST['new_text'] == '') {
1449
- $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $_POST['new_link'], $link_detail->link_url);
1450
  $new_text = '';
1451
  } else {
1452
- $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $_POST['new_link'], $link_detail->link_url, $_POST['new_text']);
1453
  $new_text = strip_tags($edit_result['link_text']);
1454
  }
1455
 
@@ -1468,11 +1527,11 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1468
  $post = get_post($link_detail->source_id);
1469
  if (!empty($post)) {
1470
  $old_value = $post->post_content;
1471
- if (isset($_POST['data_type']) && $_POST['data_type'] == 'multi' && $_POST['new_text'] == '') {
1472
- $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $_POST['new_link'], $link_detail->link_url);
1473
  $new_text = '';
1474
  } else {
1475
- $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $_POST['new_link'], $link_detail->link_url, $_POST['new_text']);
1476
  $new_text = strip_tags($edit_result['link_text']);
1477
  }
1478
 
@@ -1487,8 +1546,12 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1487
 
1488
  break;
1489
  case 'comment':
1490
- wp_update_comment(array('comment_ID' => $link_detail->source_id, 'comment_author_url' => $_POST['new_link']));
1491
- wp_send_json(array('status' => true, 'type' => 'orther', 'status_text' => $status_text, 'new_link' => $_POST['new_link']));
 
 
 
 
1492
  break;
1493
  }
1494
  }
@@ -1574,6 +1637,9 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1574
  wp_update_comment(array('comment_ID' => $link_detail->source_id, 'comment_author_url' => ''));
1575
  wp_send_json(true);
1576
  break;
 
 
 
1577
  }
1578
  }
1579
  wp_send_json(false);
@@ -1957,7 +2023,12 @@ class MetaSeo_Broken_Link_Table extends WP_List_Table {
1957
  $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE id=%d", array($linkId));
1958
  $link = $wpdb->get_row($sql);
1959
  if (!empty($link)) {
1960
- $status = MetaSeo_Broken_Link_Table::get_urlstatus(($link->link_url));
 
 
 
 
 
1961
  $status_text = MetaSeo_Broken_Link_Table::wpms_get_status_text($status);
1962
 
1963
  if ($link->type == '404_automaticaly') {
69
  <?php
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  /**
73
  * Get a list of columns. The format is:
74
  * 'internal-name' => 'Title'
190
  }
191
 
192
  if (!empty($_REQUEST['sl_broken']) && $_REQUEST['sl_broken'] != 'all') {
193
+ if ($_REQUEST['sl_broken'] == 'custom_redirect_url') {
194
+ $where[] = "link_url_redirect !=''";
195
+ } else if ($_REQUEST['sl_broken'] == 'valid_links') {
196
  $where[] = "broken_internal = 0 AND broken_indexed = 0";
197
  } elseif ($_REQUEST['sl_broken'] == 'internal_broken_links') {
198
  $where[] = "broken_internal = 1";
291
  * Displays the search box.
292
  */
293
  function search_box1() {
294
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)) {
295
+ require_once (WPMETASEO_ADDON_PLUGIN_DIR . 'inc/page/custom_redirect_form.php');
296
+ }
297
  if (empty($_REQUEST['txtkeyword']) && !$this->has_items())
298
  return;
299
  $txtkeyword = (!empty($_REQUEST['txtkeyword'])) ? urldecode(stripslashes($_REQUEST['txtkeyword'])) : "";
307
  echo '<input type="hidden" name="detached" value="' . esc_attr($_REQUEST['detached']) . '" />';
308
  ?>
309
  <p class="search-box">
 
310
  <input type="search" id="image-search-input" name="txtkeyword" value="<?php echo esc_attr(stripslashes($txtkeyword)); ?>" />
311
  <?php submit_button('Search URL', 'button', 'search', false, array('id' => 'search-submit')); ?>
312
  </p>
337
 
338
  /* Add fillter broken */
339
  function broken_fillter($name) {
340
+ $brokens = array(
341
+ 'valid_links' => __('Valid links', 'wp-meta-seo'),
342
+ 'automaticaly_indexed' => __('404 automaticaly indexed', 'wp-meta-seo'),
343
+ 'internal_broken_links' => __('Internal broken links', 'wp-meta-seo')
344
+ );
345
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)){
346
+ $brokens['custom_redirect_url'] = __('Custom redirect URL', 'wp-meta-seo');
347
+ }
348
  $curent_broken = isset($_REQUEST['sl_broken']) ? $_REQUEST['sl_broken'] : 'all';
349
  ?>
350
  <label for="filter-by-broken" class="screen-reader-text"><?php _e('Filter by broken', 'wp-meta-seo'); ?></label>
366
 
367
  /* Add fillter type */
368
  function type_fillter($name) {
369
+ $types = array('url' => __('URL','wp-meta-seo') , 'image' => __('Image','wp-meta-seo'), 'other' => __('Other','wp-meta-seo'));
370
  $curent_type = isset($_REQUEST['sltype']) ? $_REQUEST['sltype'] : 'all';
371
  ?>
372
  <label for="filter-by-type" class="screen-reader-text"><?php _e('Filter by type', 'wp-meta-seo'); ?></label>
385
 
386
  <?php
387
  submit_button(__('Filter'), 'button', 'filter_type_action', false, array('id' => 'broken-submit'));
388
+ echo '<div style="float:left;padding-left: 5px;"><div class="wpms_process" data-w="0"></div>';
389
  echo '<div data-comment_paged="1" data-paged="1" class="button wpms_scan_link">' . __('Index internal broken links', 'wp-meta-seo') . '</div></div>';
390
  echo '<span class="spinner"></span>';
391
  }
422
  if (!empty($records)) {
423
  foreach ($records as $rec) {
424
  $i++;
425
+ echo '<tr id="record_' . $i . '" data-linkid="'.$rec->id.'" data-link="' . $i . '" data-post_id="' . $rec->source_id . '">';
426
  foreach ($columns as $column_name => $column_display_name) {
427
 
428
  $class = sprintf('class="%1$s column-%1$s"', $column_name);
443
  }
444
  echo '<td class="wpms_link_html" colspan="3">';
445
  echo '<input type="hidden" class="wpms_link_text" value="' . esc_attr($rec->link_text) . '">';
446
+ if ($rec->type == 'add_custom') {
447
+ echo '<a class="link_html" target="_blank" href="' . esc_url(site_url() . '/' . $rec->link_url) . '">' . $value_url . '</a>';
448
+ if($rec->link_url_redirect != ''){
449
+ echo ' to ';
450
+ echo '<a class="link_html" target="_blank" href="' . esc_url($rec->link_url_redirect) . '">' . str_replace(site_url(),'',$rec->link_url_redirect) . '</a>';
451
+ }
452
+ }else{
453
+ echo '<a class="link_html" target="_blank" href="' . esc_url($value_url) . '">' . $value_url . '</a>';
454
+ }
455
+
456
  $row_action = array(
457
+ 'edit' => '<a class="wpms_action_link wpms-edit-button" title="'.__('Edit redirect','wp-meta-seo').'"><div class="wpms_icon_action"><i class="material-icons">mode_edit</i></div><span>' . __('Redirect', 'wp-meta-seo') . '</span></a>',
458
+ 'delete' => '<a class="wpms_action_link submitdelete wpms-unlink-button" data-link_id="' . $rec->id . '" data-type="' . $rec->type . '" data-source_id="' . $rec->source_id . '" title="' . __('Remove redirect', 'wp-meta-seo') . '"><div class="wpms_icon_action"><i class="material-icons">delete_forever</i></div><span>' . __('Remove link', 'wp-meta-seo') . '</span></a>',
459
+ '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="' . __('Check redirect or link', 'wp-meta-seo') . '"><div class="wpms_icon_action"><i class="material-icons">loop</i></div><span>' . __('Recheck', 'wp-meta-seo') . '</span></a>'
460
  );
461
  echo $this->row_actions($row_action, false);
462
  if (!empty($rec->source_id)) {
505
  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>';
506
  }
507
  } else {
508
+ if($rec->type != 'add_custom'){
509
+ 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>';
510
+ }else{
511
+ ?>
512
+ <p class="wpms-input-text-wrap">
513
+ <span class="title">
514
+ <?php _e('Status', 'wp-meta-seo') ?>
515
+ </span>
516
+ <select name="custom_redirect_status" class="custom_redirect_status">
517
+ <option value="301" <?php selected($rec->meta_title,301) ?>>301</option>
518
+ <option value="302" <?php selected($rec->meta_title,302) ?>>302</option>
519
+ <option value="307" <?php selected($rec->meta_title,307) ?>>307</option>
520
+ </select>
521
+ </p>
522
+ <?php
523
+ }
524
  }
525
  ?>
526
 
527
+ <p class="wpms-input-text-wrap"><span class="title"><?php _e('URL', 'wp-meta-seo'); ?></span><input <?php echo ($rec->type == '404_automaticaly') ? 'readonly' : '' ?> type="text" name="link_url" class="wpms-link-url-field" value="<?php echo esc_attr($value_url); ?>" /></p>
528
+ <p class="wpms-input-text-wrap">
529
+ <span class="title"><?php _e('Redirect', 'wp-meta-seo'); ?></span>
530
+ <input type="text" name="link_url_redirect" class="wpms-link-redirect-field" value="<?php echo esc_attr($rec->link_url_redirect); ?>" />
531
+ <span class="wlink-btn"><i class="mce-ico mce-i-link link-btn" id="link-btn"></i></span>
532
+ </p>
533
  </label>
534
 
535
  <div class="submit wpms-inline-editor-buttons">
536
  <input type="button" class="button-secondary cancel alignleft wpms-cancel-button" value="<?php echo esc_attr(__('Cancel', 'wp-meta-seo')); ?>" />
537
+ <input type="button" data-type="<?php echo $rec->type ?>" data-link_id="<?php echo $rec->id ?>" data-source_id="<?php echo $rec->source_id ?>" class="button-primary save alignright wpms-update-link-button" value="<?php echo esc_attr(__('Add custom redirect', 'wp-meta-seo')); ?>" />
538
  </div>
539
  </div>
540
  <?php
548
  break;
549
  case 'col_status':
550
  echo '<td colspan="3" class="col_status">';
 
551
  if (strpos($rec->status_text, '200') !== false) {
552
  echo '<i class="material-icons wpms_ok metaseo_help_status" alt="Link is OK">done</i>';
553
  } elseif (strpos($rec->status_text, '301') !== false) {
593
  $source = get_comment($rec->source_id);
594
  if (!empty($source)) {
595
  $row_action = array(
596
+ 'edit' => '<a target="_blank" href="' . get_edit_comment_link($rec->source_id) . '" title="'.__('Edit this item','wp-meta-seo').'">'.__('Edit','wp-meta-seo').'</a>',
597
+ 'view' => '<a target="_blank" href="' . get_comment_link($rec->source_id) . '" title="View &#8220;test&#8221;" rel="permalink">'.__('View','wp-meta-seo').'</a>'
598
  );
599
 
600
  if ($rec->type == 'comment') {
608
  $source = get_post($rec->source_id);
609
  if (!empty($source)) {
610
  $row_action = array(
611
+ 'edit' => '<a target="_blank" href="' . get_edit_post_link($rec->source_id) . '" title="'.__('Edit this item','wp-meta-seo').'">'.__('Edit','wp-meta-seo').'</a>',
612
  'view' => '<a target="_blank" href="' . get_post_permalink($rec->source_id) . '" title="View &#8220;test&#8221;" rel="permalink">View</a>'
613
  );
614
 
622
  echo $source_inner;
623
  echo $this->row_actions($row_action, false);
624
  } else {
625
+ if($rec->type == 'add_custom' || $rec->type == 'add_rule'){
626
+ echo '<a><i title="'.__('Custom redirect','wp-meta-seo').'" class="wpms_outgoing material-icons">call_missed_outgoing</i></a>';
627
+ }else{
628
+ echo '<a>'.__('Source Not Found','wp-meta-seo').'</a>';
629
+ }
630
  }
631
  echo '</td>';
632
  break;
992
  $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'))
993
  );
994
  }
995
+
996
+ update_option('wpms_last_update_post',time());
997
  }
998
 
999
  /*
1059
  );
1060
  }
1061
  }
1062
+
1063
+ update_option('wpms_last_update_post',time());
1064
  }
1065
 
1066
  /*
1220
  wp_send_json(array('status' => false, 'type' => 'limit_post', 'paged' => $_POST['paged'], 'percent' => $percent_post * count($results)));
1221
  }
1222
  }
1223
+
1224
+ $link_settings = array(
1225
+ "enable" => 0,
1226
+ "numberFrequency" => 1,
1227
+ "showlinkFrequency" => "month"
1228
+ );
1229
+
1230
+ $linksettings = get_option('wpms_link_settings');
1231
+ if (is_array($linksettings)) {
1232
+ $link_settings = array_merge($link_settings, $linksettings);
1233
+ }
1234
+
1235
+ $link_settings['wpms_lastRun_scanlink'] = time();
1236
+ update_option('wpms_link_settings', $link_settings);
1237
  wp_send_json(array('status' => true));
1238
  }
1239
 
1297
  */
1298
  public static function wpms_check_internal_link($link, $siteUrl, $value) {
1299
  $info_link = parse_url($link);
1300
+ if(empty($info_link['host'])){
1301
+ $value['internal'] = 0;
1302
+ return $value;
1303
+ }
1304
+
1305
  $info_site_url = parse_url($siteUrl);
1306
  $domain_link = $info_link['host'] . $info_link['path'] . '/';
1307
  $domain_site = $info_site_url['host'] . $info_site_url['path'] . '/';
1372
  }
1373
  return $status_text;
1374
  }
1375
+
1376
+ /*
1377
+ * Add custom redirect
1378
+ */
1379
+ public static function wpms_add_custom_redirect() {
1380
+ do_action('wpms_add_custom_redirect');
1381
+ wp_send_json(array('status' => true , 'message' => __('Done!','wp-meta-seo')));
1382
+ }
1383
 
1384
  /*
1385
  * Update link
1392
  $link_detail = $wpdb->get_row($sql);
1393
  if (empty($link_detail))
1394
  wp_send_json(false);
1395
+ $new_link = stripslashes($_POST['new_link']);
1396
+ $link_redirect = stripslashes($_POST['link_redirect']);
1397
+ if(isset($_POST['new_text'])){
1398
+ $new_text = stripcslashes($_POST['new_text']);
1399
+ }else{
1400
+ $new_text = '';
1401
+ }
1402
+
1403
+ if($link_redirect != ''){
1404
+ $status = 'HTTP/1.1 200 OK';
1405
+ }else{
1406
+ $status = MetaSeo_Broken_Link_Table::get_urlstatus($new_link);
1407
+ }
1408
+
1409
  $status_text = MetaSeo_Broken_Link_Table::wpms_get_status_text($status);
1410
  $status_type = MetaSeo_Broken_Link_Table::get_urlstatus_type($status);
 
1411
  if ($link_detail->type != '404_automaticaly') {
1412
+ $value = array('link_url' => $new_link,
1413
  'link_final_url' => '',
1414
  'link_url_redirect' => '',
1415
+ 'link_text' => stripcslashes($new_text),
1416
  'status_code' => $status,
1417
  'status_text' => $status_text,
1418
  'broken_indexed' => 0,
1420
  'warning' => 0,
1421
  'dismissed' => 0,
1422
  );
1423
+ if (strpos($new_link, 'mailto:') !== false) {
1424
+ $value['link_final_url'] = $new_link;
1425
  } else {
1426
+ if (!preg_match("~^(?:f|ht)tps?://~i", $new_link)) {
1427
  $perlink = get_option('permalink_structure');
1428
  if (empty($perlink)) {
1429
+ $value['link_final_url'] = get_site_url() . '/' . $new_link;
1430
  } else {
1431
  if (!empty($link_detail->source_id)) {
1432
+ $value['link_final_url'] = get_permalink($link_detail->source_id) . $new_link;
1433
  } else {
1434
+ $value['link_final_url'] = $perlink . '/' . $new_link;
1435
  }
1436
  }
1437
  } else {
1438
+ $value['link_final_url'] = $new_link;
1439
  }
1440
  }
1441
 
1442
+ if (!empty($link_redirect))
1443
+ $value['link_url_redirect'] = $link_redirect;
1444
  if (isset($status_type) && $status_type != 'ok') {
1445
  $value[$status_type] = 1;
1446
  }
1447
  } else {
1448
+ $status = MetaSeo_Broken_Link_Table::get_urlstatus($link_redirect);
1449
  $status_text = MetaSeo_Broken_Link_Table::wpms_get_status_text($status);
1450
 
1451
  $value = array(
1452
+ 'link_url_redirect' => stripslashes($link_redirect),
1453
  'status_code' => $status,
1454
  'status_text' => $status_text,
1455
  'broken_indexed' => 1
1456
  );
1457
  }
1458
 
1459
+ if($link_detail->type == 'add_custom'){
1460
+ $value['meta_title'] = $_POST['status_redirect'];
1461
+ }
1462
+
1463
  $site_url = get_site_url();
1464
+ $value = MetaSeo_Broken_Link_Table::wpms_check_internal_link($new_link, $site_url, $value);
1465
 
1466
  $wpdb->update(
1467
  $wpdb->prefix . 'wpms_links', $value, array('id' => $_POST['link_id'])
1469
 
1470
  switch ($link_detail->type) {
1471
  case '404_automaticaly':
1472
+ wp_send_json(array('status' => true, 'type' => '404_automaticaly', 'status_text' => $status_text, 'new_link' => esc_url($new_link)));
1473
  break;
1474
  case 'comment_content_image':
1475
  $comment = get_comment($link_detail->source_id);
1476
  if (!empty($comment)) {
1477
  $old_value = $comment->comment_content;
1478
+ $edit_result = MetaSeo_Broken_Link_Table::edit_linkimg($old_value, $new_link, $link_detail->link_url);
1479
  $my_comment = array(
1480
  'comment_ID' => $link_detail->source_id,
1481
  'comment_content' => $edit_result['content']
1489
  $post = get_post($link_detail->source_id);
1490
  if (!empty($post)) {
1491
  $old_value = $post->post_content;
1492
+ $edit_result = MetaSeo_Broken_Link_Table::edit_linkimg($old_value, $new_link, $link_detail->link_url);
1493
  $my_post = array(
1494
  'ID' => $link_detail->source_id,
1495
  'post_content' => $edit_result['content']
1504
  $comment = get_comment($link_detail->source_id);
1505
  if (!empty($comment)) {
1506
  $old_value = $comment->comment_content;
1507
+ if (isset($_POST['data_type']) && $_POST['data_type'] == 'multi' && $new_text == '') {
1508
+ $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $new_link, $link_detail->link_url);
1509
  $new_text = '';
1510
  } else {
1511
+ $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $new_link, $link_detail->link_url, $new_text);
1512
  $new_text = strip_tags($edit_result['link_text']);
1513
  }
1514
 
1527
  $post = get_post($link_detail->source_id);
1528
  if (!empty($post)) {
1529
  $old_value = $post->post_content;
1530
+ if (isset($_POST['data_type']) && $_POST['data_type'] == 'multi' && $new_text == '') {
1531
+ $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $new_link, $link_detail->link_url);
1532
  $new_text = '';
1533
  } else {
1534
+ $edit_result = MetaSeo_Broken_Link_Table::wpms_edit_linkhtml($old_value, $new_link, $link_detail->link_url, $new_text);
1535
  $new_text = strip_tags($edit_result['link_text']);
1536
  }
1537
 
1546
 
1547
  break;
1548
  case 'comment':
1549
+ wp_update_comment(array('comment_ID' => $link_detail->source_id, 'comment_author_url' => $new_link));
1550
+ wp_send_json(array('status' => true, 'type' => 'orther', 'status_text' => $status_text, 'new_link' => $new_link));
1551
+ break;
1552
+
1553
+ case 'add_custom':
1554
+ wp_send_json(array('status' => true, 'type' => 'orther', 'status_text' => $status_text, 'new_link' => $new_link));
1555
  break;
1556
  }
1557
  }
1637
  wp_update_comment(array('comment_ID' => $link_detail->source_id, 'comment_author_url' => ''));
1638
  wp_send_json(true);
1639
  break;
1640
+ case 'add_custom':
1641
+ wp_send_json(true);
1642
+ break;
1643
  }
1644
  }
1645
  wp_send_json(false);
2023
  $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE id=%d", array($linkId));
2024
  $link = $wpdb->get_row($sql);
2025
  if (!empty($link)) {
2026
+ if($link->link_url_redirect != ''){
2027
+ $status = 'HTTP/1.1 200 OK';
2028
+ }else{
2029
+ $status = MetaSeo_Broken_Link_Table::get_urlstatus(($link->link_url));
2030
+ }
2031
+
2032
  $status_text = MetaSeo_Broken_Link_Table::wpms_get_status_text($status);
2033
 
2034
  if ($link->type == '404_automaticaly') {
inc/class.metaseo-content-list-table.php CHANGED
@@ -173,7 +173,7 @@ class MetaSeo_Content_List_Table extends WP_List_Table {
173
  /**
174
  * Get a list of all registered post type objects.
175
  */
176
- function wpmf_get_post_type(){
177
  global $wpdb;
178
 
179
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
@@ -194,7 +194,7 @@ class MetaSeo_Content_List_Table extends WP_List_Table {
194
  */
195
  function prepare_items() {
196
  global $wpdb, $_wp_column_headers;
197
- $this->post_types = $this->wpmf_get_post_type();
198
  $screen = get_current_screen();
199
 
200
  $where = array();
@@ -214,7 +214,6 @@ class MetaSeo_Content_List_Table extends WP_List_Table {
214
  $where[] = "post_type IN ($post_type)";
215
 
216
  $states = get_post_stati(array('show_in_admin_all_list' => true));
217
- $states['trash'] = 'trash';
218
  $all_states = "'" . implode("', '", $states) . "'";
219
 
220
  if (empty($_REQUEST['post_status'])) {
173
  /**
174
  * Get a list of all registered post type objects.
175
  */
176
+ function wpms_get_post_type(){
177
  global $wpdb;
178
 
179
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
194
  */
195
  function prepare_items() {
196
  global $wpdb, $_wp_column_headers;
197
+ $this->post_types = $this->wpms_get_post_type();
198
  $screen = get_current_screen();
199
 
200
  $where = array();
214
  $where[] = "post_type IN ($post_type)";
215
 
216
  $states = get_post_stati(array('show_in_admin_all_list' => true));
 
217
  $all_states = "'" . implode("', '", $states) . "'";
218
 
219
  if (empty($_REQUEST['post_status'])) {
inc/class.metaseo-dashboard.php CHANGED
@@ -18,7 +18,7 @@ class MetaSeo_Dashboard {
18
  public static $mpermalink = 50;
19
  public static $mlink_complete = 0;
20
  public static $mcount_link = 0;
21
-
22
  /*
23
  * Get image optimize
24
  */
@@ -30,8 +30,8 @@ class MetaSeo_Dashboard {
30
  $imgs_metas_are_good = array();
31
  $meta_keys = array('alt', 'title');
32
  $response = array(
33
- 'imgs_statis' => array(0, 0),
34
- 'imgs_metas_statis' => array(0, 0),
35
  );
36
  foreach ($meta_keys as $meta_key) {
37
  $imgs_metas_are_good[$meta_key] = 0;
@@ -39,7 +39,7 @@ class MetaSeo_Dashboard {
39
  }
40
 
41
  $post_types = MetaSeo_Content_List_Table::get_post_types();
42
- $query = "SELECT `ID`, `post_title`, `post_content`, `post_type`, `post_date`
43
  FROM $wpdb->posts
44
  WHERE `post_type` IN ($post_types)
45
  AND `post_content` <> ''
@@ -100,10 +100,24 @@ class MetaSeo_Dashboard {
100
  }
101
 
102
  //Report analytic of images optimization
 
103
  $response['imgs_statis'][0] = $imgs_are_good;
104
  $response['imgs_statis'][1] = $imgs;
105
- $response['imgs_metas_statis'][0] = ceil(($imgs_metas_are_good['alt'] + $imgs_metas_are_good['title']) / 2);
106
  $response['imgs_metas_statis'][1] = $imgs;
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
 
109
  return $response;
@@ -197,78 +211,205 @@ class MetaSeo_Dashboard {
197
  curl_multi_close($mh);
198
  return $contents;
199
  }
200
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  /*
202
- * Return params meta title filled , meta description filled , link_meta , permalink_setting for dashboard
203
  */
204
- function evolutive_dashboard() {
 
205
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
206
  if (!empty($post_types['attachment']))
207
  unset($post_types['attachment']);
208
- $results = array('permalink_setting' => 50, 'metatitle_filled' => array(0, array(0, 0)), 'metadesc_filled' => array(0, array(0, 0)), 'new_content' => array(0, array(0, 0)), 'link_meta' => array(0, array(0, 0)));
209
  $args = array(
210
  'posts_per_page' => -1,
211
- 'post_type' => $post_types,
212
- 'suppress_filters' => true
 
 
 
 
 
 
 
213
  );
214
- $mposts = get_posts($args);
215
- if (empty($mposts)) {
216
- return $results;
217
- } else {
218
- foreach ($mposts as $post) {
219
  $meta_analysis = get_post_meta($post->ID, 'wpms_validate_analysis', true);
220
  if (empty($meta_analysis))
221
  $meta_analysis = array();
222
 
223
  $meta_title = get_post_meta($post->ID, '_metaseo_metatitle', true);
224
- $meta_desc = get_post_meta($post->ID, '_metaseo_metadesc', true);
225
  if (($meta_title != '' && strlen($meta_title) <= self::$meta_title_length ) || (!empty($meta_analysis) && !empty($meta_analysis['metatitle']))) {
226
- self::$metatitle_filled++;
227
  }
 
228
 
229
- if (($meta_desc != '' && strlen($meta_desc) <= self::$meta_desc_length ) || (!empty($meta_analysis) && !empty($meta_analysis['metadesc']))) {
230
- self::$metadesc_filled++;
231
- }
232
 
233
- // get link meta
234
-
235
- $dom = new DOMDocument;
236
- libxml_use_internal_errors(true);
237
- if (isset($post->post_content) && $post->post_content != '') {
238
- if ($dom->loadHTML($post->post_content)) {
239
- $tags = $dom->getElementsByTagName('a');
240
- foreach ($tags as $tag) {
241
- self::$mcount_link++;
242
- $link_title = $tag->getAttribute('title');
243
- if (isset($link_title) && $link_title != '') {
244
- self::$mlink_complete++;
245
- }
246
- }
247
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  }
249
  }
250
 
251
- if (self::$mcount_link == 0) {
252
- $link_percent = 100;
253
- } else {
254
- $link_percent = ceil(self::$mlink_complete / self::$mcount_link * 100);
255
- }
256
 
257
- $results['metatitle_filled'] = array(ceil(self::$metatitle_filled / (count($mposts)) * 100), array(self::$metatitle_filled, count($mposts)));
258
- $results['metadesc_filled'] = array(ceil(self::$metadesc_filled / (count($mposts)) * 100), array(self::$metadesc_filled, count($mposts)));
259
- $results['link_meta'] = array($link_percent, array(self::$mlink_complete, self::$mcount_link));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  }
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  $permalink_structure = get_option('permalink_structure');
263
  if (strpos($permalink_structure, 'postname') == false && strpos($permalink_structure, 'category') == false) {
264
- self::$mpermalink = 0;
265
  } else if (strpos($permalink_structure, 'postname') == true && strpos($permalink_structure, 'category') == true) {
266
- self::$mpermalink = 100;
267
  } else if (strpos($permalink_structure, 'postname') == true || strpos($permalink_structure, 'category') == true) {
268
- self::$mpermalink = 50;
269
  }
 
 
270
 
271
- $results['permalink_setting'] = self::$mpermalink;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  $newcontent_args = array(
273
  'date_query' => array(
274
  array(
@@ -282,19 +423,31 @@ class MetaSeo_Dashboard {
282
 
283
  $newcontent = new WP_Query($newcontent_args);
284
 
285
- if (count($newcontent->get_posts()) >= 4) {
286
  $count_new = 100;
287
  } else {
288
- $count_new = ceil(count($newcontent->get_posts()) / 4 * 100);
289
  }
290
- $results['new_content'] = array($count_new, array(count($newcontent->get_posts()), count($mposts)));
291
  return $results;
292
  }
 
 
 
 
 
 
 
 
 
 
 
 
293
 
294
  /*
295
  * Return count link 404 , count link 404 is redirected , percent
296
  */
297
- function get_404_link() {
298
  global $wpdb;
299
  $sql = $wpdb->prepare("SELECT COUNT(*) FROM " . $wpdb->prefix . "wpms_links WHERE (broken_internal=%d OR broken_indexed=%d) ", array(1, 1));
300
  $count_404 = $wpdb->get_var($sql);
@@ -312,7 +465,7 @@ class MetaSeo_Dashboard {
312
  /*
313
  * Return count image is optimized
314
  */
315
- public function wpmf_getImages_optimizer() {
316
  global $wpdb;
317
  $query = 'SELECT distinct file FROM ' . $wpdb->prefix . 'wpio_images';
318
  $files = $wpdb->get_results($query);
@@ -328,12 +481,12 @@ class MetaSeo_Dashboard {
328
  /*
329
  * Get count image
330
  */
331
- public function wpmf_getImages_count() {
332
  $wpio_settings = get_option('_wpio_settings');
333
  $include_folders = $wpio_settings['wpio_api_include'];
334
  $allowedPath = explode(',', $include_folders);
335
  $images = array();
336
- $image_optimize = $this->wpmf_getImages_optimizer();
337
 
338
  $allowed_ext = array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'pdf');
339
  $min_size = (int) $wpio_settings['wpio_api_minfilesize'] * 1024;
@@ -358,4 +511,222 @@ class MetaSeo_Dashboard {
358
  return array('image_optimize' => $image_optimize, 'count_image' => $count_image, 'percent' => $precent);
359
  }
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  }
18
  public static $mpermalink = 50;
19
  public static $mlink_complete = 0;
20
  public static $mcount_link = 0;
21
+
22
  /*
23
  * Get image optimize
24
  */
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;
39
  }
40
 
41
  $post_types = MetaSeo_Content_List_Table::get_post_types();
42
+ $query = "SELECT `ID`,`post_content`
43
  FROM $wpdb->posts
44
  WHERE `post_type` IN ($post_types)
45
  AND `post_content` <> ''
100
  }
101
 
102
  //Report analytic of images optimization
103
+ $imgs_metas = ceil(($imgs_metas_are_good['alt'] + $imgs_metas_are_good['title']) / 2);
104
  $response['imgs_statis'][0] = $imgs_are_good;
105
  $response['imgs_statis'][1] = $imgs;
106
+ $response['imgs_metas_statis'][0] = $imgs_metas;
107
  $response['imgs_metas_statis'][1] = $imgs;
108
+
109
+ if (!empty($imgs)) {
110
+ $percent_iresizing = ceil($imgs_are_good / $imgs * 100);
111
+ } else {
112
+ $percent_iresizing = 100;
113
+ }
114
+ $response['imgs_statis'][2] = $percent_iresizing;
115
+ if (!empty($imgs)) {
116
+ $percent_imeta = ceil($imgs_metas / $imgs * 100);
117
+ } else {
118
+ $percent_imeta = 100;
119
+ }
120
+ $response['imgs_metas_statis'][2] = $percent_imeta;
121
  }
122
 
123
  return $response;
211
  curl_multi_close($mh);
212
  return $contents;
213
  }
214
+
215
+ /**
216
+ * update option dashboard
217
+ */
218
+ public static function update_dashboard($name){
219
+ $options_dashboard = get_option('options_dashboard');
220
+ MetaSeo_Dashboard::_wpms_update_option_dash($options_dashboard,$name);
221
+ $options_dashboard = get_option('options_dashboard');
222
+ $results = $options_dashboard[$name];
223
+ return $results;
224
+ }
225
+
226
+ /**
227
+ * get Count posts
228
+ */
229
+ public static function getCountPost(){
230
+ global $wpdb;
231
+ $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
232
+ $post_types = "'" . implode("', '", $post_types) . "'";
233
+ $states = get_post_stati(array('show_in_admin_all_list' => true));
234
+ $states['trash'] = 'trash';
235
+ $all_states = "'" . implode("', '", $states) . "'";
236
+ $total_posts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status IN ($all_states) AND post_type IN ($post_types)");
237
+ return $total_posts;
238
+ }
239
+
240
  /*
241
+ * get params meta title filled for dashboard
242
  */
243
+ public static function wpms_metatitle(){
244
+ $total_posts = MetaSeo_Dashboard::getCountPost();
245
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
246
  if (!empty($post_types['attachment']))
247
  unset($post_types['attachment']);
248
+ $results = array(0, array(0, (int)$total_posts));
249
  $args = array(
250
  'posts_per_page' => -1,
251
+ 'post_type' => $post_types,
252
+ 'meta_key' => '_metaseo_metatitle',
253
+ 'meta_query' => array(
254
+ array(
255
+ 'key' => '_metaseo_metatitle',
256
+ 'value' => '',
257
+ 'compare' => '!=',
258
+ ),
259
+ ),
260
  );
261
+ $query = new WP_Query( $args );
262
+ $posts = $query->get_posts();
263
+ $metatitle_filled = 0;
264
+ if (!empty($posts)) {
265
+ foreach ($posts as $post) {
266
  $meta_analysis = get_post_meta($post->ID, 'wpms_validate_analysis', true);
267
  if (empty($meta_analysis))
268
  $meta_analysis = array();
269
 
270
  $meta_title = get_post_meta($post->ID, '_metaseo_metatitle', true);
 
271
  if (($meta_title != '' && strlen($meta_title) <= self::$meta_title_length ) || (!empty($meta_analysis) && !empty($meta_analysis['metatitle']))) {
272
+ $metatitle_filled++;
273
  }
274
+ }
275
 
276
+ $results = array(ceil($metatitle_filled / $total_posts * 100), array($metatitle_filled, (int)$total_posts));
277
+ }
 
278
 
279
+ return $results;
280
+ }
281
+
282
+ /*
283
+ * get html meta title filled for dashboard
284
+ */
285
+ public static function wpms_dash_metatitle(){
286
+ $results = MetaSeo_Dashboard::update_dashboard('metatitle');
287
+ ob_start();
288
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/meta_title.php';
289
+ $html = ob_get_contents();
290
+ ob_end_clean();
291
+ wp_send_json($html);
292
+ }
293
+
294
+ /*
295
+ * get params meta description filled for dashboard
296
+ */
297
+ public static function wpms_metadesc(){
298
+ $total_posts = MetaSeo_Dashboard::getCountPost();
299
+ $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
300
+ if (!empty($post_types['attachment']))
301
+ unset($post_types['attachment']);
302
+ $results = array(0, array(0, $total_posts));
303
+ $args = array(
304
+ 'posts_per_page' => -1,
305
+ 'post_type' => $post_types,
306
+ 'meta_key' => '_metaseo_metadesc',
307
+ 'meta_query' => array(
308
+ array(
309
+ 'key' => '_metaseo_metadesc',
310
+ 'value' => '',
311
+ 'compare' => '!=',
312
+ ),
313
+ ),
314
+ );
315
+ $query = new WP_Query( $args );
316
+ $posts = $query->get_posts();
317
+ $metadesc_filled = 0;
318
+ if (!empty($posts)) {
319
+ foreach ($posts as $post) {
320
+ $meta_analysis = get_post_meta($post->ID, 'wpms_validate_analysis', true);
321
+ if (empty($meta_analysis))
322
+ $meta_analysis = array();
323
+
324
+ $meta_desc = get_post_meta($post->ID, '_metaseo_metadesc', true);
325
+ if (($meta_desc != '' && strlen($meta_desc) <= self::$meta_desc_length ) || (!empty($meta_analysis) && !empty($meta_analysis['metadesc']))) {
326
+ $metadesc_filled++;
327
  }
328
  }
329
 
330
+ $results = array(ceil($metadesc_filled / $total_posts * 100), array($metadesc_filled, $total_posts));
331
+ }
332
+
333
+ return $results;
334
+ }
335
 
336
+ /*
337
+ * Return html description filled for dashboard
338
+ */
339
+ public static function wpms_dash_metadesc(){
340
+ $results = MetaSeo_Dashboard::update_dashboard('metadesc');
341
+ ob_start();
342
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/meta_desc.php';
343
+ $html = ob_get_contents();
344
+ ob_end_clean();
345
+ wp_send_json($html);
346
+ }
347
+
348
+ /*
349
+ * Return link_meta for dashboard
350
+ */
351
+ public static function wpms_linkmeta(){
352
+ global $wpdb;
353
+ $mcount_link = 0;
354
+ $mlink_complete = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."wpms_links WHERE meta_title !=''");
355
+ $mcount_link = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."wpms_links WHERE type !='404_automaticaly'");
356
+
357
+ if ($mcount_link == 0) {
358
+ $link_percent = 100;
359
+ } else {
360
+ $link_percent = ceil($mlink_complete / $mcount_link * 100);
361
  }
362
 
363
+ $results = array($link_percent, array($mlink_complete, $mcount_link));
364
+ return $results;
365
+ }
366
+
367
+
368
+ /*
369
+ * Return html link_meta for dashboard
370
+ */
371
+ public static function wpms_dash_linkmeta(){
372
+ $results = MetaSeo_Dashboard::wpms_linkmeta();
373
+ ob_start();
374
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/link_meta.php';
375
+ $html = ob_get_contents();
376
+ ob_end_clean();
377
+ wp_send_json($html);
378
+ }
379
+
380
+ /*
381
+ * Return permalink for dashboard
382
+ */
383
+ public static function wpms_permalink(){
384
+ $permalink = 50;
385
  $permalink_structure = get_option('permalink_structure');
386
  if (strpos($permalink_structure, 'postname') == false && strpos($permalink_structure, 'category') == false) {
387
+ $permalink = 0;
388
  } else if (strpos($permalink_structure, 'postname') == true && strpos($permalink_structure, 'category') == true) {
389
+ $permalink = 100;
390
  } else if (strpos($permalink_structure, 'postname') == true || strpos($permalink_structure, 'category') == true) {
391
+ $permalink = 50;
392
  }
393
+ return $permalink;
394
+ }
395
 
396
+ /*
397
+ * Return html permalink for dashboard
398
+ */
399
+ public static function wpms_dash_permalink(){
400
+ $permalink = MetaSeo_Dashboard::wpms_permalink();
401
+ ob_start();
402
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/permalink.php';
403
+ $html = ob_get_contents();
404
+ ob_end_clean();
405
+ wp_send_json($html);
406
+ }
407
+
408
+ /*
409
+ * Return count new content updated for dashboard
410
+ */
411
+ public static function wpms_newcontent(){
412
+ $total_posts = MetaSeo_Dashboard::getCountPost();
413
  $newcontent_args = array(
414
  'date_query' => array(
415
  array(
423
 
424
  $newcontent = new WP_Query($newcontent_args);
425
 
426
+ if (count($newcontent->get_posts()) >= $total_posts) {
427
  $count_new = 100;
428
  } else {
429
+ $count_new = ceil(count($newcontent->get_posts()) / $total_posts * 100);
430
  }
431
+ $results = array($count_new, array(count($newcontent->get_posts()), $total_posts));
432
  return $results;
433
  }
434
+
435
+ /*
436
+ * Return html new content updated for dashboard
437
+ */
438
+ public static function wpms_dash_newcontent(){
439
+ $results = MetaSeo_Dashboard::update_dashboard('newcontent');
440
+ ob_start();
441
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/new_content.php';
442
+ $html = ob_get_contents();
443
+ ob_end_clean();
444
+ wp_send_json($html);
445
+ }
446
 
447
  /*
448
  * Return count link 404 , count link 404 is redirected , percent
449
  */
450
+ public static function get_404_link() {
451
  global $wpdb;
452
  $sql = $wpdb->prepare("SELECT COUNT(*) FROM " . $wpdb->prefix . "wpms_links WHERE (broken_internal=%d OR broken_indexed=%d) ", array(1, 1));
453
  $count_404 = $wpdb->get_var($sql);
465
  /*
466
  * Return count image is optimized
467
  */
468
+ public function wpms_getImages_optimizer() {
469
  global $wpdb;
470
  $query = 'SELECT distinct file FROM ' . $wpdb->prefix . 'wpio_images';
471
  $files = $wpdb->get_results($query);
481
  /*
482
  * Get count image
483
  */
484
+ public function wpms_getImages_count() {
485
  $wpio_settings = get_option('_wpio_settings');
486
  $include_folders = $wpio_settings['wpio_api_include'];
487
  $allowedPath = explode(',', $include_folders);
488
  $images = array();
489
+ $image_optimize = $this->wpms_getImages_optimizer();
490
 
491
  $allowed_ext = array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'pdf');
492
  $min_size = (int) $wpio_settings['wpio_api_minfilesize'] * 1024;
511
  return array('image_optimize' => $image_optimize, 'count_image' => $count_image, 'percent' => $precent);
512
  }
513
 
514
+ /**
515
+ * get meta data dashboard
516
+ */
517
+ public static function getMetaDataDashBoard($name){
518
+ switch ($name){
519
+ case 'metatitle':
520
+ $results = MetaSeo_Dashboard::wpms_metatitle();
521
+ break;
522
+ case 'metadesc':
523
+ $results = MetaSeo_Dashboard::wpms_metadesc();
524
+ break;
525
+ case 'newcontent':
526
+ $results = MetaSeo_Dashboard::wpms_newcontent();
527
+ break;
528
+ case 'image_meta':
529
+ $results = MetaSeo_Dashboard::moptimizationChecking();
530
+ break;
531
+ }
532
+
533
+ return $results;
534
+ }
535
+
536
+ /**
537
+ * update time dashboard update
538
+ */
539
+ public static function _wpms_dash_last_update($name){
540
+ if($name == 'metadesc'){
541
+ update_option('_wpms_dash_last_update',time());
542
+ }
543
+ }
544
+
545
+ /**
546
+ * update option dashboard
547
+ */
548
+ public static function _wpms_update_option_dash($options_dashboard,$name){
549
+ if(!empty($options_dashboard) && is_array($options_dashboard)){
550
+ if (empty($options_dashboard[$name])) {
551
+ $results = MetaSeo_Dashboard::getMetaDataDashBoard($name);
552
+ $options_dashboard[$name] = $results;
553
+ update_option('options_dashboard',$options_dashboard);
554
+ MetaSeo_Dashboard::_wpms_dash_last_update($name);
555
+ }else{
556
+ $option_last_update_post = get_option('wpms_last_update_post');
557
+ $option_last_dash_update = get_option('_wpms_dash_last_update');
558
+ if(!empty($option_last_update_post) && $option_last_update_post > $option_last_dash_update){
559
+ $results = MetaSeo_Dashboard::getMetaDataDashBoard($name);
560
+ $options_dashboard[$name] = $results;
561
+ update_option('options_dashboard',$options_dashboard);
562
+ MetaSeo_Dashboard::_wpms_dash_last_update($name);
563
+ }
564
+ }
565
+ }else{
566
+ $results = MetaSeo_Dashboard::getMetaDataDashBoard($name);
567
+ $options_dashboard[$name] = $results;
568
+ update_option('options_dashboard',$options_dashboard);
569
+ MetaSeo_Dashboard::_wpms_dash_last_update($name);
570
+ }
571
+ }
572
+
573
+
574
+
575
+ public static function wpms_dash_imgsmeta() {
576
+ global $wpdb;
577
+ $imgs = 0;
578
+ $imgs_metas = array('alt' => 0, 'title' => 0);
579
+ $imgs_are_good = 0;
580
+ $imgs_metas_are_good = array();
581
+ $meta_keys = array('alt', 'title');
582
+ $response = array(
583
+ 'imgs_statis' => array(0, 0 ,100),
584
+ 'imgs_metas_statis' => array(0, 0 ,100),
585
+ );
586
+
587
+ $options_dashboard = get_option('options_dashboard');
588
+ $option_last_update_post = get_option('wpms_last_update_post');
589
+ $option_last_dash_update = get_option('_wpms_dash_last_update');
590
+ if(!empty($options_dashboard) && is_array($options_dashboard) && !empty($options_dashboard['image_meta']) && $option_last_update_post < $option_last_dash_update){
591
+ $results = $options_dashboard['image_meta'];
592
+ ob_start();
593
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/imgsresize.php';
594
+ $html_imgresize = ob_get_contents();
595
+ ob_end_clean();
596
+
597
+ ob_start();
598
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/imgsmeta.php';
599
+ $html_imgsmeta = ob_get_contents();
600
+ ob_end_clean();
601
+ wp_send_json(array('status' => true ,'html_imgresize' => $html_imgresize , 'html_imgsmeta' => $html_imgsmeta));
602
+ }
603
+
604
+ foreach ($meta_keys as $meta_key) {
605
+ $imgs_metas_are_good[$meta_key] = 0;
606
+ $imgs_metas_are_not_good[$meta_key] = 0;
607
+ }
608
+
609
+ $limit = 50;
610
+ $offset = ($_POST['page']-1)*$limit;
611
+ $post_types = MetaSeo_Content_List_Table::get_post_types();
612
+ $query = "SELECT `ID`,`post_content`
613
+ FROM $wpdb->posts
614
+ WHERE `post_type` IN ($post_types)
615
+ AND `post_content` <> ''
616
+ AND `post_content` LIKE '%<img%>%'
617
+ ORDER BY ID LIMIT $limit OFFSET $offset";
618
+
619
+ $posts = $wpdb->get_results($query);
620
+ if (count($posts) > 0) {
621
+ $doc = new DOMDocument();
622
+ libxml_use_internal_errors(true);
623
+ $upload_dir = wp_upload_dir();
624
+
625
+ foreach ($posts as $post) {
626
+ $meta_analysis = get_post_meta($post->ID, 'wpms_validate_analysis', true);
627
+ if (empty($meta_analysis))
628
+ $meta_analysis = array();
629
+ $dom = $doc->loadHTML($post->post_content);
630
+ $tags = $doc->getElementsByTagName('img');
631
+ foreach ($tags as $tag) {
632
+ $img_src = $tag->getAttribute('src');
633
+
634
+ if (!preg_match('/\.(jpg|png|gif)$/i', $img_src, $matches)) {
635
+ continue;
636
+ }
637
+
638
+ $img_path = str_replace($upload_dir['baseurl'], $upload_dir['basedir'], $img_src);
639
+ if (!file_exists($img_path)) {
640
+ continue;
641
+ }
642
+
643
+ $width = $tag->getAttribute('width');
644
+ $height = $tag->getAttribute('height');
645
+ if (list($real_width, $real_height) = @getimagesize($img_path)) {
646
+ $ratio_origin = $real_width / $real_height;
647
+ //Check if img tag is missing with/height attribute value or not
648
+ if (!$width && !$height) {
649
+ $width = $real_width;
650
+ $height = $real_height;
651
+ } elseif ($width && !$height) {
652
+ $height = $width * (1 / $ratio_origin);
653
+ } elseif ($height && !$width) {
654
+ $width = $height * ($ratio_origin);
655
+ }
656
+
657
+ if (($real_width <= $width && $real_height <= $height) || (!empty($meta_analysis) && !empty($meta_analysis['imgresize']))) {
658
+ $imgs_are_good++;
659
+ }
660
+ foreach ($meta_keys as $meta_key) {
661
+
662
+ if (trim($tag->getAttribute($meta_key)) || (!empty($meta_analysis) && !empty($meta_analysis['imgalt']))) {
663
+ $imgs_metas_are_good[$meta_key] ++;
664
+ }
665
+ }
666
+ }
667
+
668
+ $imgs++;
669
+ }
670
+ }
671
+
672
+ //Report analytic of images optimization
673
+ $c_imgs_metas = ceil(($imgs_metas_are_good['alt'] + $imgs_metas_are_good['title']) / 2);
674
+ $response['imgs_statis'][0] = $imgs_are_good + (int)$_POST['imgs_statis'];
675
+ $response['imgs_statis'][1] = $imgs + (int)$_POST['imgs_count'];
676
+ $response['imgs_metas_statis'][0] = $c_imgs_metas + (int)$_POST['imgs_metas_statis'];
677
+ $response['imgs_metas_statis'][1] = $imgs + (int)$_POST['imgs_count'];
678
+ $response['imgs_count'] = $imgs + (int)$_POST['imgs_count'];
679
+ $response['page'] = (int)$_POST['page'];
680
+ }else{
681
+ if (!empty($_POST['imgs_count'])) {
682
+ $percent_iresizing = ceil($_POST['imgs_statis'] / $_POST['imgs_count'] * 100);
683
+ } else {
684
+ $percent_iresizing = 100;
685
+ }
686
+ $response['imgs_statis'][2] = $percent_iresizing;
687
+ if (!empty($_POST['imgs_count'])) {
688
+ $percent_imeta = ceil($_POST['imgs_metas_statis'] / $_POST['imgs_count'] * 100);
689
+ } else {
690
+ $percent_imeta = 100;
691
+ }
692
+
693
+ $response['imgs_metas_statis'][2] = $percent_imeta;
694
+ $options_dashboard['image_meta'] = array(
695
+ 'imgs_statis' => array($_POST['imgs_statis'],$_POST['imgs_count'],$percent_iresizing),
696
+ 'imgs_metas_statis' => array($_POST['imgs_metas_statis'],$_POST['imgs_count'],$percent_imeta)
697
+ );
698
+
699
+ if(!empty($options_dashboard) && is_array($options_dashboard)){
700
+ if (empty($options_dashboard['image_meta'])) {
701
+ update_option('options_dashboard',$options_dashboard);
702
+ MetaSeo_Dashboard::_wpms_dash_last_update('image_meta');
703
+ }else{
704
+ $option_last_update_post = get_option('wpms_last_update_post');
705
+ $option_last_dash_update = get_option('_wpms_dash_last_update');
706
+ if((!empty($option_last_update_post) && $option_last_update_post > $option_last_dash_update) || empty($option_last_update_post)){
707
+ update_option('options_dashboard',$options_dashboard);
708
+ MetaSeo_Dashboard::_wpms_dash_last_update('image_meta');
709
+ }
710
+ }
711
+ }else{
712
+ update_option('options_dashboard',$options_dashboard);
713
+ MetaSeo_Dashboard::_wpms_dash_last_update('image_meta');
714
+ }
715
+
716
+ $options_dashboard = get_option('options_dashboard');
717
+ $results = $options_dashboard['image_meta'];
718
+ ob_start();
719
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/imgsresize.php';
720
+ $html_imgresize = ob_get_contents();
721
+ ob_end_clean();
722
+
723
+ ob_start();
724
+ require_once WPMETASEO_PLUGIN_DIR . 'inc/pages/dashboard/imgsmeta.php';
725
+ $html_imgsmeta = ob_get_contents();
726
+ ob_end_clean();
727
+ wp_send_json(array('status' => true ,'html_imgresize' => $html_imgresize , 'html_imgsmeta' => $html_imgsmeta));
728
+ }
729
+
730
+ wp_send_json($response);
731
+ }
732
  }
inc/class.metaseo-image-list-table.php CHANGED
@@ -266,7 +266,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
266
  /**
267
  * Get months
268
  */
269
- function wpmf_get_months(){
270
  global $wpdb;
271
  $where = " AND ((post_mime_type='image/jpeg') OR (post_mime_type='image/jpg') OR (post_mime_type='image/png') OR (post_mime_type='image/gif')) ";
272
  $months = $wpdb->get_results($wpdb->prepare("
@@ -286,7 +286,7 @@ class MetaSeo_Image_List_Table extends WP_List_Table {
286
  */
287
  function prepare_items() {
288
  global $wpdb, $_wp_column_headers;
289
- $this->months = $this->wpmf_get_months();
290
  $screen = get_current_screen();
291
 
292
  $where = array();
266
  /**
267
  * Get months
268
  */
269
+ function wpms_get_months(){
270
  global $wpdb;
271
  $where = " AND ((post_mime_type='image/jpeg') OR (post_mime_type='image/jpg') OR (post_mime_type='image/png') OR (post_mime_type='image/gif')) ";
272
  $months = $wpdb->get_results($wpdb->prepare("
286
  */
287
  function prepare_items() {
288
  global $wpdb, $_wp_column_headers;
289
+ $this->months = $this->wpms_get_months();
290
  $screen = get_current_screen();
291
 
292
  $where = array();
inc/class.metaseo-link-list-table.php CHANGED
@@ -264,7 +264,7 @@ class MetaSeo_Link_List_Table extends WP_List_Table {
264
  /**
265
  * Get months
266
  */
267
- function wpmf_get_months(){
268
  global $wpdb;
269
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
270
  if (!empty($post_types['attachment']))
@@ -287,7 +287,7 @@ class MetaSeo_Link_List_Table extends WP_List_Table {
287
  */
288
  function prepare_items() {
289
  global $wpdb, $_wp_column_headers;
290
- $this->months = $this->wpmf_get_months();
291
 
292
  $where = array('1=1');
293
 
264
  /**
265
  * Get months
266
  */
267
+ function wpms_get_months(){
268
  global $wpdb;
269
  $post_types = get_post_types(array('public' => true, 'exclude_from_search' => false));
270
  if (!empty($post_types['attachment']))
287
  */
288
  function prepare_items() {
289
  global $wpdb, $_wp_column_headers;
290
+ $this->months = $this->wpms_get_months();
291
 
292
  $where = array('1=1');
293
 
inc/class.metaseo-metabox.php CHANGED
@@ -516,11 +516,17 @@ class WPMSEO_Metabox extends WPMSEO_Meta {
516
  $pageurl = get_permalink($post->ID);
517
  $info = pathinfo($pageurl);
518
 
519
- if ($info['filename'] == sanitize_title($post->post_title) || (!empty($meta_analysis) && !empty($meta_analysis['pageurl']))) {
 
520
  $output = $this->metaseo_create_field('pageurl', $tooltip_page['page_url'], 'done', __('Page url matches with page title', 'wp-meta-seo'), 1);
521
  $this->perc_score++;
522
- } else {
523
- $output = $this->metaseo_create_field('pageurl', $tooltip_page['page_url'], 'warning', __('Page url matches with page title', 'wp-meta-seo'), 0);
 
 
 
 
 
524
  }
525
 
526
  return $output;
516
  $pageurl = get_permalink($post->ID);
517
  $info = pathinfo($pageurl);
518
 
519
+ $page_on_front = get_option('page_on_front');
520
+ if(!empty($page_on_front) && $page_on_front == $post->ID){
521
  $output = $this->metaseo_create_field('pageurl', $tooltip_page['page_url'], 'done', __('Page url matches with page title', 'wp-meta-seo'), 1);
522
  $this->perc_score++;
523
+ }else{
524
+ if ($info['filename'] == sanitize_title($post->post_title) || (!empty($meta_analysis) && !empty($meta_analysis['pageurl']))) {
525
+ $output = $this->metaseo_create_field('pageurl', $tooltip_page['page_url'], 'done', __('Page url matches with page title', 'wp-meta-seo'), 1);
526
+ $this->perc_score++;
527
+ } else {
528
+ $output = $this->metaseo_create_field('pageurl', $tooltip_page['page_url'], 'warning', __('Page url matches with page title', 'wp-meta-seo'), 0);
529
+ }
530
  }
531
 
532
  return $output;
inc/class.metaseo-sitemap.php CHANGED
@@ -27,6 +27,17 @@ class MetaSeo_Sitemap {
27
  "wpms_sitemap_pages" => array(),
28
  );
29
 
 
 
 
 
 
 
 
 
 
 
 
30
  if (is_multisite()) {
31
  $home_url = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "_", str_replace('http://', '', str_replace('https://', '', site_url())));
32
  $this->settings_sitemap['wpms_sitemap_link'] = site_url() . '/wpms-sitemap_' . $home_url . '.xml';
@@ -55,7 +66,7 @@ class MetaSeo_Sitemap {
55
  add_action('wp_ajax_wpms_regenerate_sitemaps', array($this, 'wpms_regenerate_sitemaps'));
56
  add_action('wp_ajax_wpms_save_sitemap_settings', array($this, 'wpms_save_sitemap_settings'));
57
  }
58
-
59
  /* load metaseo script and style front-end */
60
  public function site_metaseo_sitemap_scripts() {
61
  global $post;
@@ -71,7 +82,11 @@ class MetaSeo_Sitemap {
71
 
72
  /* Localize a script */
73
  public function wpms_localize_script() {
74
- $arrays = array('wpms_display_column_menus' => $this->settings_sitemap['wpms_display_column_menus']);
 
 
 
 
75
  return $arrays;
76
  }
77
 
@@ -81,6 +96,7 @@ class MetaSeo_Sitemap {
81
  if (!empty($current_screen) && $current_screen->base != 'wp-meta-seo_page_metaseo_google_sitemap')
82
  return;
83
  wp_enqueue_script('metaseositemap', plugins_url('js/metaseo_sitemap.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
 
84
  wp_enqueue_script('jpage-js', plugins_url('js/jPages.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
85
  wp_enqueue_style('metaseositemapstyle', plugins_url('css/metaseo_sitemap.css', dirname(__FILE__)), array(), WPMSEO_VERSION);
86
  wp_enqueue_style('jpage-css', plugins_url('css/jPages.css', dirname(__FILE__)), array(), WPMSEO_VERSION);
@@ -88,6 +104,18 @@ class MetaSeo_Sitemap {
88
  wp_enqueue_script('jquery-qtip', plugins_url('js/jquery.qtip.min.js', dirname(__FILE__)), array('jquery'), '2.2.1', true);
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  /* Add a new field to a section of a sitemap settings page */
92
  public function metaseo_field_settings_sitemap() {
93
  register_setting('MetaSEO Sitemap', '_metaseo_settings_sitemap');
@@ -395,7 +423,74 @@ class MetaSeo_Sitemap {
395
  }
396
  }
397
  }
398
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  // add pages
400
  $res = $this->wpms_get_pages_sitemap();
401
  if (!empty($res)) {
@@ -588,12 +683,13 @@ class MetaSeo_Sitemap {
588
  $query = new WP_Query($args);
589
  $postsTest = $query->get_posts();
590
  if (!empty($postsTest)) {
591
- $checkSitemap = 'post_types-' . $post_type . '-not_in_sitemap';
592
  if (( in_array($post_type, array('post', 'page', 'attachment')))) {
593
  continue;
594
  }
 
595
  $postType = get_post_type_object($post_type);
596
  $postTypeLink = get_post_type_archive_link($postType->name);
 
597
  $html .= '<div id="sitemap_' . str_replace(' ', '', strtolower($postType->labels->name)) . '">';
598
  if (!empty($postTypeLink)) {
599
  $html .= '<h3><a href="' . $postTypeLink . '">' . $postType->labels->name . '</a></h3>';
@@ -688,8 +784,79 @@ class MetaSeo_Sitemap {
688
  }
689
  }
690
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
691
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
 
 
 
 
 
 
 
 
693
 
694
  $ids_menu = array(0);
695
  $check_menu = array();
@@ -878,28 +1045,76 @@ class MetaSeo_Sitemap {
878
  $pages = $query->get_posts();
879
  return $pages;
880
  }
881
-
 
 
 
 
 
 
 
 
 
882
  /* get posts by category */
883
  public function wpms_get_posts() {
884
  $posts = array();
885
  $taxo = 'category';
886
  $categorys = get_categories(array('hide_empty' => false, 'taxonomy' => $taxo));
887
-
888
  foreach ($categorys as $cat) {
889
- $args = array(
890
- 'posts_per_page' => -1,
891
- 'tax_query' => array(
892
- array(
893
- 'taxonomy' => $taxo,
894
- 'field' => 'slug',
895
- 'terms' => $cat->slug,
896
- ),
897
- ),
898
- );
899
- $query = new WP_Query($args);
900
- $results = $query->get_posts();
901
  if (!empty($results)) {
902
- $posts[$cat->cat_name . '||' . $cat->cat_ID . '||' . $taxo . '||' . $cat->slug] = $results;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
903
  }
904
  }
905
 
@@ -1171,6 +1386,9 @@ class MetaSeo_Sitemap {
1171
  wp_send_json(array('status' => false, 'message' => $error));
1172
  }
1173
  }
 
 
 
1174
  wp_send_json(array('status' => true, 'message' => 'success'));
1175
  }
1176
 
@@ -1223,6 +1441,17 @@ class MetaSeo_Sitemap {
1223
  "wpms_category_link" => array()
1224
  );
1225
 
 
 
 
 
 
 
 
 
 
 
 
1226
  $wpms_display_column_menus = json_decode(stripslashes($_POST['wpms_display_column_menus']),true);
1227
  if (!empty($wpms_display_column_menus)) {
1228
  $settings_sitemap['wpms_display_column_menus'] = $wpms_display_column_menus;
@@ -1242,6 +1471,15 @@ class MetaSeo_Sitemap {
1242
  "wpms_sitemap_menus" => array()
1243
  );
1244
 
 
 
 
 
 
 
 
 
 
1245
  foreach ($lists_selected as $k => $v) {
1246
  if (isset($_POST[$k]) && $_POST[$k] != '{}') {
1247
  $values = json_decode(stripslashes($_POST[$k]),true);
27
  "wpms_sitemap_pages" => array(),
28
  );
29
 
30
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)) {
31
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false, '_builtin' => false));
32
+ if (!empty($custom_post_types)) {
33
+ foreach ($custom_post_types as $post_type => $label) {
34
+ $this->settings_sitemap['wpms_display_column_' . $post_type] = 1;
35
+ $this->settings_sitemap['wpms_public_name_' . $post_type] = "";
36
+ $this->settings_sitemap['wpms_sitemap_' . $post_type] = array();
37
+ }
38
+ }
39
+ }
40
+
41
  if (is_multisite()) {
42
  $home_url = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "_", str_replace('http://', '', str_replace('https://', '', site_url())));
43
  $this->settings_sitemap['wpms_sitemap_link'] = site_url() . '/wpms-sitemap_' . $home_url . '.xml';
66
  add_action('wp_ajax_wpms_regenerate_sitemaps', array($this, 'wpms_regenerate_sitemaps'));
67
  add_action('wp_ajax_wpms_save_sitemap_settings', array($this, 'wpms_save_sitemap_settings'));
68
  }
69
+
70
  /* load metaseo script and style front-end */
71
  public function site_metaseo_sitemap_scripts() {
72
  global $post;
82
 
83
  /* Localize a script */
84
  public function wpms_localize_script() {
85
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false ,'_builtin' => false));
86
+ $arrays = array(
87
+ 'wpms_display_column_menus' => $this->settings_sitemap['wpms_display_column_menus'],
88
+ 'post_type' => $custom_post_types
89
+ );
90
  return $arrays;
91
  }
92
 
96
  if (!empty($current_screen) && $current_screen->base != 'wp-meta-seo_page_metaseo_google_sitemap')
97
  return;
98
  wp_enqueue_script('metaseositemap', plugins_url('js/metaseo_sitemap.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
99
+ wp_localize_script('metaseositemap', 'wpmseositemap', $this->meta_seo_localize_script());
100
  wp_enqueue_script('jpage-js', plugins_url('js/jPages.js', dirname(__FILE__)), array('jquery'), WPMSEO_VERSION, true);
101
  wp_enqueue_style('metaseositemapstyle', plugins_url('css/metaseo_sitemap.css', dirname(__FILE__)), array(), WPMSEO_VERSION);
102
  wp_enqueue_style('jpage-css', plugins_url('css/jPages.css', dirname(__FILE__)), array(), WPMSEO_VERSION);
104
  wp_enqueue_script('jquery-qtip', plugins_url('js/jquery.qtip.min.js', dirname(__FILE__)), array('jquery'), '2.2.1', true);
105
  }
106
 
107
+ /**
108
+ * Localize a script.
109
+ *
110
+ * Works only if the script has already been added.
111
+ */
112
+ public function meta_seo_localize_script(){
113
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false ,'_builtin' => false));
114
+ return array(
115
+ 'post_type' => $custom_post_types
116
+ );
117
+ }
118
+
119
  /* Add a new field to a section of a sitemap settings page */
120
  public function metaseo_field_settings_sitemap() {
121
  register_setting('MetaSEO Sitemap', '_metaseo_settings_sitemap');
423
  }
424
  }
425
  }
426
+
427
+ // add custom post type
428
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)){
429
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false ,'_builtin' => false));
430
+ if(!empty($custom_post_types)) {
431
+ foreach ($custom_post_types as $post_type => $label) {
432
+ $ids = array(0);
433
+ $settings_sitemap = get_option('_metaseo_settings_sitemap');
434
+ if (!empty($settings_sitemap['wpms_sitemap_'.$post_type])) {
435
+ foreach ((array) $settings_sitemap['wpms_sitemap_'.$post_type] as $k => $v) {
436
+ if (!empty($v['post_id'])) {
437
+ $ids[] = $v['post_id'];
438
+ }
439
+ }
440
+ }
441
+
442
+ $args = array(
443
+ 'posts_per_page' => -1,
444
+ 'post_type' => $post_type,
445
+ 'post__in' => $ids,
446
+ 'post_status' => 'any'
447
+ );
448
+ $query = new WP_Query($args);
449
+ $posts = $query->get_posts();
450
+ if (!empty($posts)) {
451
+ foreach ($posts as $val) {
452
+ $permalink = get_permalink($val->ID);
453
+ if (!in_array($permalink, $list_links)) {
454
+ $list_links[] = $permalink;
455
+ $gglstmp_url = $gglstmp_urlset->appendChild($xml->createElement('url'));
456
+ $loc = $gglstmp_url->appendChild($xml->createElement('loc'));
457
+ $loc->appendChild($xml->createTextNode($permalink));
458
+ $lastmod = $gglstmp_url->appendChild($xml->createElement('lastmod'));
459
+ $now = $val->post_modified;
460
+ $date = date('Y-m-d\TH:i:sP', strtotime($now));
461
+ $lastmod->appendChild($xml->createTextNode($date));
462
+ $changefreq = $gglstmp_url->appendChild($xml->createElement('changefreq'));
463
+ if (empty($this->settings_sitemap['wpms_check_firstsave'])) {
464
+ $changefreq->appendChild($xml->createTextNode('monthly'));
465
+ } else {
466
+ if(empty($this->settings_sitemap['wpms_sitemap_'.$post_type][$val->ID]['frequency'])){
467
+ $postfrequency = 'monthly';
468
+ }else{
469
+ $postfrequency = $this->settings_sitemap['wpms_sitemap_'.$post_type][$val->ID]['frequency'];
470
+ }
471
+ $changefreq->appendChild($xml->createTextNode($postfrequency));
472
+ }
473
+
474
+ $priority = $gglstmp_url->appendChild($xml->createElement('priority'));
475
+ if (empty($this->settings_sitemap['wpms_check_firstsave'])) {
476
+ $priority->appendChild($xml->createTextNode('1.0'));
477
+ } else {
478
+ if(empty($this->settings_sitemap['wpms_sitemap_'.$post_type][$val->ID]['priority'])){
479
+ $postpriority = '1.0';
480
+ }else{
481
+ $postpriority = $this->settings_sitemap['wpms_sitemap_'.$post_type][$val->ID]['priority'];
482
+ }
483
+ $priority->appendChild($xml->createTextNode($postpriority));
484
+ }
485
+ }
486
+ }
487
+ }
488
+
489
+ }
490
+ }
491
+ }
492
+ // ========================================
493
+
494
  // add pages
495
  $res = $this->wpms_get_pages_sitemap();
496
  if (!empty($res)) {
683
  $query = new WP_Query($args);
684
  $postsTest = $query->get_posts();
685
  if (!empty($postsTest)) {
 
686
  if (( in_array($post_type, array('post', 'page', 'attachment')))) {
687
  continue;
688
  }
689
+
690
  $postType = get_post_type_object($post_type);
691
  $postTypeLink = get_post_type_archive_link($postType->name);
692
+ var_dump(str_replace(' ', '', strtolower($postType->labels->name)));
693
  $html .= '<div id="sitemap_' . str_replace(' ', '', strtolower($postType->labels->name)) . '">';
694
  if (!empty($postTypeLink)) {
695
  $html .= '<h3><a href="' . $postTypeLink . '">' . $postType->labels->name . '</a></h3>';
784
  }
785
  }
786
  }
787
+ // custom post type
788
+ if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
789
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false, '_builtin' => false));
790
+ if (!empty($custom_post_types)) {
791
+ foreach ($custom_post_types as $post_type => $label) {
792
+ if ($i == (int)$this->settings_sitemap['wpms_display_column_' . $post_type]) {
793
+ //=====================================================================================
794
+ if(isset($this->settings_sitemap['wpms_public_name_'.$post_type]) && $this->settings_sitemap['wpms_public_name_'.$post_type] != ''){
795
+ $postTitle = $this->settings_sitemap['wpms_public_name_'.$post_type];
796
+ }else{
797
+ $postTitle = get_post_type_object($post_type);
798
+ $postTitle = $postTitle->label;
799
+ }
800
 
801
+ $html .= '<div id="sitemap_posts" class="wpms_sitemap_posts"><h4>';
802
+ $html .= $postTitle;
803
+ $html .= '</h4><ul>';
804
+
805
+ global $wpdb;
806
+ $taxonomy_objects = get_object_taxonomies($post_type, 'names');
807
+ $ids = array(0);
808
+ if (!empty($this->settings_sitemap['wpms_sitemap_' . $post_type])) {
809
+ foreach ((array)$this->settings_sitemap['wpms_sitemap_' . $post_type] as $k => $v) {
810
+ if (!empty($v['post_id'])) {
811
+ $ids[] = $k;
812
+ }
813
+ }
814
+ }
815
+ foreach ($taxonomy_objects as $taxo) {
816
+
817
+ $categorys = get_categories(array('hide_empty' => false, 'taxonomy' => $taxo));
818
+ foreach ($categorys as $cat) {
819
+
820
+ $sql = "SELECT p.ID as ID,p.post_title as post_title
821
+ FROM $wpdb->posts AS p
822
+ INNER JOIN $wpdb->term_relationships AS tr ON (p.ID = tr.object_id)
823
+ INNER JOIN $wpdb->term_taxonomy AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id)
824
+ INNER JOIN $wpdb->terms AS t ON (t.term_id = tt.term_id)
825
+ WHERE p.post_status = 'publish'
826
+ AND p.post_type = '$post_type'
827
+ AND tt.taxonomy = '$taxo' AND t.slug='$cat->slug'
828
+ ORDER BY p.post_date DESC";
829
+ $results = $wpdb->get_results($sql);
830
+ if (!empty($results)) {
831
+ if (in_array($cat->cat_ID, $this->settings_sitemap['wpms_category_link'])) {
832
+ $cat_link = "<a href='" . esc_url(get_term_link($cat)) . "'>" . $cat->cat_name . "</a>";
833
+ } else {
834
+ $cat_link = $cat->cat_name;
835
+ }
836
+ $html .= "<li class='wpms_li_cate wpms_li_cate'><div class='cat_name'>$cat_link</div>";
837
+
838
+ if (!empty($this->settings_sitemap['wpms_sitemap_' . $post_type])) {
839
+ $html .= "<ul>";
840
+ foreach ($results as $p) {
841
+ if (isset($this->settings_sitemap['wpms_sitemap_' . $post_type][$cat->cat_ID . '-' . $p->ID])) {
842
+ $html .= '<li><a href="' . get_permalink($p->ID) . '">' . $p->post_title . '</a></li>';
843
+ }
844
+ }
845
+ $html .= "</ul>";
846
+ }
847
+ $html .= "</li>";
848
+ }
849
+ }
850
+ }
851
+ $html .= '</ul></div>';
852
 
853
+ //======================================================================================
854
+ }
855
+ }
856
+ }
857
+
858
+ }
859
+ // ====================
860
 
861
  $ids_menu = array(0);
862
  $check_menu = array();
1045
  $pages = $query->get_posts();
1046
  return $pages;
1047
  }
1048
+
1049
+
1050
+ /* get pages */
1051
+ public function wpms_get_pages() {
1052
+ global $wpdb;
1053
+ $sql = "SELECT ID,post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'page' ORDER BY post_date DESC";
1054
+ $pages = $wpdb->get_results($sql);
1055
+ return $pages;
1056
+ }
1057
+
1058
  /* get posts by category */
1059
  public function wpms_get_posts() {
1060
  $posts = array();
1061
  $taxo = 'category';
1062
  $categorys = get_categories(array('hide_empty' => false, 'taxonomy' => $taxo));
1063
+ global $wpdb;
1064
  foreach ($categorys as $cat) {
1065
+ $sql = $wpdb->prepare("SELECT p.ID as ID,p.post_title as post_title
1066
+ FROM $wpdb->posts AS p
1067
+ INNER JOIN $wpdb->term_relationships AS tr ON (p.ID = tr.object_id)
1068
+ INNER JOIN $wpdb->term_taxonomy AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id)
1069
+ INNER JOIN $wpdb->terms AS t ON (t.term_id = tt.term_id)
1070
+ WHERE p.post_status = 'publish'
1071
+ AND p.post_type = 'post'
1072
+ AND tt.taxonomy = %s AND t.slug=%s
1073
+ ORDER BY p.post_date DESC",array($taxo,$cat->slug));
1074
+ $results = $wpdb->get_results($sql);
 
 
1075
  if (!empty($results)) {
1076
+ $obj = new StdClass();
1077
+ $obj->cat_name = $cat->cat_name;
1078
+ $obj->cat_ID = $cat->cat_ID;
1079
+ $obj->taxo = $taxo;
1080
+ $obj->slug = $cat->slug;
1081
+ $obj->results = $results;
1082
+ $posts[] = $obj;
1083
+ }
1084
+ }
1085
+
1086
+ return $posts;
1087
+ }
1088
+
1089
+ /* get posts by category */
1090
+ public function wpms_get_posts_custom($post_type) {
1091
+ $posts = array();
1092
+ $taxonomy_objects = get_object_taxonomies($post_type, 'names' );
1093
+ foreach ($taxonomy_objects as $taxo){
1094
+ $categorys = get_categories(array('hide_empty' => false, 'taxonomy' => $taxo));
1095
+ global $wpdb;
1096
+
1097
+ foreach ($categorys as $cat) {
1098
+ $sql = $wpdb->prepare("SELECT p.ID as ID,p.post_title as post_title
1099
+ FROM $wpdb->posts AS p
1100
+ INNER JOIN $wpdb->term_relationships AS tr ON (p.ID = tr.object_id)
1101
+ INNER JOIN $wpdb->term_taxonomy AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id)
1102
+ INNER JOIN $wpdb->terms AS t ON (t.term_id = tt.term_id)
1103
+ WHERE p.post_status = 'publish'
1104
+ AND p.post_type = %s
1105
+ AND tt.taxonomy = %s AND t.slug=%s
1106
+ ORDER BY p.post_date DESC",array($post_type,$taxo,$cat->slug));
1107
+ $results = $wpdb->get_results($sql);
1108
+
1109
+ if (!empty($results)) {
1110
+ $obj = new StdClass();
1111
+ $obj->cat_name = $cat->cat_name;
1112
+ $obj->cat_ID = $cat->cat_ID;
1113
+ $obj->taxo = $taxo;
1114
+ $obj->slug = $cat->slug;
1115
+ $obj->results = $results;
1116
+ $posts[] = $obj;
1117
+ }
1118
  }
1119
  }
1120
 
1386
  wp_send_json(array('status' => false, 'message' => $error));
1387
  }
1388
  }
1389
+
1390
+ // Don't ping if blog is not public.
1391
+ do_action('wpms_submit_sitemap');
1392
  wp_send_json(array('status' => true, 'message' => 'success'));
1393
  }
1394
 
1441
  "wpms_category_link" => array()
1442
  );
1443
 
1444
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)) {
1445
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false, '_builtin' => false));
1446
+ if (!empty($custom_post_types)) {
1447
+ foreach ($custom_post_types as $post_type => $label) {
1448
+ $lists['wpms_display_column_' . $post_type] = 1;
1449
+ $lists['wpms_public_name_' . $post_type] = "";
1450
+ $lists['wpms_sitemap_' . $post_type] = array();
1451
+ }
1452
+ }
1453
+ }
1454
+
1455
  $wpms_display_column_menus = json_decode(stripslashes($_POST['wpms_display_column_menus']),true);
1456
  if (!empty($wpms_display_column_menus)) {
1457
  $settings_sitemap['wpms_display_column_menus'] = $wpms_display_column_menus;
1471
  "wpms_sitemap_menus" => array()
1472
  );
1473
 
1474
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)){
1475
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false ,'_builtin' => false));
1476
+ if(!empty($custom_post_types)) {
1477
+ foreach ($custom_post_types as $post_type => $label) {
1478
+ $lists_selected["wpms_sitemap_".$post_type] = array();
1479
+ }
1480
+ }
1481
+ }
1482
+
1483
  foreach ($lists_selected as $k => $v) {
1484
  if (isset($_POST[$k]) && $_POST[$k] != '{}') {
1485
  $values = json_decode(stripslashes($_POST[$k]),true);
inc/google_analytics/tracking/code-classic.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly
3
  if ( ! defined( 'ABSPATH' ) )
4
  exit();
1
  <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ * Modified by Joomunited
9
+ */
10
+
11
  // Exit if accessed directly
12
  if ( ! defined( 'ABSPATH' ) )
13
  exit();
inc/google_analytics/tracking/code-universal.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly
3
  if ( ! defined( 'ABSPATH' ) )
4
  exit();
1
  <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ * Modified by Joomunited
9
+ */
10
+
11
  // Exit if accessed directly
12
  if ( ! defined( 'ABSPATH' ) )
13
  exit();
inc/google_analytics/tracking/events-classic.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly
3
  if ( ! defined( 'ABSPATH' ) )
4
  exit();
1
  <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ * Modified by Joomunited
9
+ */
10
+
11
  // Exit if accessed directly
12
  if ( ! defined( 'ABSPATH' ) )
13
  exit();
inc/google_analytics/tracking/events-universal.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly
3
  if ( ! defined( 'ABSPATH' ) )
4
  exit();
1
  <?php
2
+ /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ * Modified by Joomunited
9
+ */
10
+
11
  // Exit if accessed directly
12
  if ( ! defined( 'ABSPATH' ) )
13
  exit();
inc/google_analytics/wpmsgapi.php CHANGED
@@ -1,8 +1,15 @@
1
  <?php
2
  /**
3
- * Class manage your Google Analytics data
 
 
 
 
 
4
  */
5
 
 
 
6
  if (!defined('ABSPATH'))
7
  exit();
8
 
1
  <?php
2
  /**
3
+ * Author: Alin Marcu
4
+ * Author URI: https://deconf.com
5
+ * Copyright 2013 Alin Marcu
6
+ * License: GPLv2 or later
7
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ * Modified by Joomunited
9
  */
10
 
11
+ // Exit if accessed directly
12
+
13
  if (!defined('ABSPATH'))
14
  exit();
15
 
inc/google_analytics/wpmstools.php CHANGED
@@ -1,9 +1,16 @@
1
  <?php
2
 
3
  /**
4
- * Class manage your Google Analytics data
 
 
 
 
 
5
  */
6
 
 
 
7
  if (!defined('ABSPATH'))
8
  exit();
9
 
1
  <?php
2
 
3
  /**
4
+ * Author: Alin Marcu
5
+ * Author URI: https://deconf.com
6
+ * Copyright 2013 Alin Marcu
7
+ * License: GPLv2 or later
8
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+ * Modified by Joomunited
10
  */
11
 
12
+ // Exit if accessed directly
13
+
14
  if (!defined('ABSPATH'))
15
  exit();
16
 
inc/pages/dashboard.php CHANGED
@@ -5,180 +5,167 @@ if (!class_exists('MetaSeo_Dashboard')) {
5
 
6
  wp_enqueue_style('m-style-qtip');
7
  wp_enqueue_script('jquery-qtip');
8
-
9
  $site_name = preg_replace('/(^(http|https):\/\/[w]*\.*)/', '', get_site_url());
10
  $pieces = explode("/", $site_name);
11
  $url = 'http://www.alexa.com/siteinfo/' . $pieces[0];
12
  $dashboard = new MetaSeo_Dashboard();
13
- $results = $dashboard->evolutive_dashboard();
14
  $link_errors = $dashboard->get_404_link();
15
- $results_image = $dashboard->moptimizationChecking();
16
- if (!empty($results_image['imgs_statis'][1])) {
17
- $percent_iresizing = ceil($results_image['imgs_statis'][0] / $results_image['imgs_statis'][1] * 100);
18
- } else {
19
- $percent_iresizing = 100;
20
- }
21
-
22
- if (!empty($results_image['imgs_metas_statis'][1])) {
23
- $percent_imeta = ceil($results_image['imgs_metas_statis'][0] / $results_image['imgs_metas_statis'][1] * 100);
24
- } else {
25
- $percent_imeta = 100;
26
- }
27
-
28
  $plugin_imgRecycle_file = 'imagerecycle-pdf-image-compression/wp-image-recycle.php';
29
  ?>
30
  <h1 style="text-align: center;"><?php _e('WP Meta SEO dashboard', 'wp-meta-seo') ?></h1>
31
  <div class="dashboard">
32
  <div class="col-md-9">
33
  <div class="row panel-statistics">
34
- <div class="col-sm-6 metaseo_tool" alt="<?php _e('It’s better using a permalink structure that is adding in your URL the category name and content title. This parameter can be changed in Settings > Permalinks WordPress menu. Tag recommended is %category%/%postname%', 'wp-meta-seo') ?>">
35
  <div class="panel panel-updates">
36
  <div class="panel-body">
37
  <div class="row">
38
  <div class="col-xs-7 col-lg-8">
39
  <h4 class="panel-title text-success"><?php _e('Permalinks settings', 'wp-meta-seo') ?></h4>
40
- <h3><?php echo $results['permalink_setting'] . '%' ?></h3>
41
  <div class="progress">
42
- <div style="width: <?php echo $results['permalink_setting'] . '%' ?>" aria-valuemax="100" aria-valuemin="0" aria-valuenow="<?php echo $results['permalink_setting'] ?>" role="progressbar" class="progress-bar progress-bar-success">
43
- <span class="sr-only"><?php echo $results['permalink_setting'] . '%' ?> Complete (success)</span>
44
  </div>
45
  </div>
46
- <p><?php _e('Optimized at', 'wp-meta-seo') ?>: <?php echo $results['permalink_setting'] . '%' ?></p>
47
  </div>
48
  <div class="col-xs-5 col-lg-4 text-right">
49
- <input type="text" value="<?php echo $results['permalink_setting'] ?>" class="dial-success">
50
  </div>
51
  </div>
52
  </div>
53
  </div>
54
  </div>
55
 
56
- <div class="col-sm-6 metaseo_tool-000" alt="<?php _e('Meta titles are displayed in search engine results as a page title. It’s a good thing for SEO to have some custom and attractive ones. Be sure to fill at least the met information on your most popular pages', 'wp-meta-seo') ?>">
57
  <div class="panel panel-danger-full panel-updates">
58
  <div class="panel-body">
59
  <div class="row">
60
  <div class="col-xs-7 col-lg-8">
61
  <h4 class="panel-title text-warning"><?php _e('Meta Title', 'wp-meta-seo') ?></h4>
62
- <h3><?php echo $results['metatitle_filled'][0] . '%' ?></h3>
63
  <div class="progress">
64
- <div style="width: <?php echo $results['metatitle_filled'][0] . '%' ?>" aria-valuemax="100" aria-valuemin="0" aria-valuenow="<?php echo $results['metatitle_filled'][0] ?>" role="progressbar" class="progress-bar progress-bar-warning">
65
- <span class="sr-only"><?php echo $results['metatitle_filled'][0] . '%' ?> Complete (success)</span>
66
  </div>
67
  </div>
68
- <p><?php _e('Meta title filled', 'wp-meta-seo') ?>: <?php echo $results['metatitle_filled'][1][0] . '/' . $results['metatitle_filled'][1][1] ?></p>
69
  </div>
70
  <div class="col-xs-5 col-lg-4 text-right">
71
- <input type="text" value="<?php echo $results['metatitle_filled'][0] ?>" class="dial-warning">
72
  </div>
73
  </div>
74
  </div>
75
  </div>
76
  </div>
77
 
78
- <div class="col-sm-6 metaseo_tool-000" alt="<?php _e('Meta descriptions are displayed in search engine results as a page description. It’s a good thing for SEO to have some custom and attractive ones. Be sure to fill at least the meta information on your most popular pages.', 'wp-meta-seo') ?>">
79
  <div class="panel panel-success-full panel-updates">
80
  <div class="panel-body">
81
  <div class="row">
82
  <div class="col-xs-7 col-lg-8">
83
  <h4 class="panel-title text-success"><?php _e('Meta Description', 'wp-meta-seo') ?></h4>
84
- <h3><?php echo $results['metadesc_filled'][0] . '%' ?></h3>
85
  <div class="progress">
86
- <div style="width: <?php echo $results['metadesc_filled'][0] . '%' ?>" aria-valuemax="100" aria-valuemin="0" aria-valuenow="<?php echo $results['metadesc_filled'][0] ?>" role="progressbar" class="progress-bar progress-bar-info">
87
- <span class="sr-only"><?php echo $results['metadesc_filled'][0] . '%' ?> Complete (success)</span>
88
  </div>
89
  </div>
90
- <p><?php _e('Meta description filled', 'wp-meta-seo') ?>: <?php echo $results['metadesc_filled'][1][0] . '/' . $results['metadesc_filled'][1][1] ?></p>
91
  </div>
92
  <div class="col-xs-5 col-lg-4 text-right">
93
- <input type="text" value="<?php echo $results['metadesc_filled'][0] ?>" class="dial-info">
94
  </div>
95
  </div>
96
  </div>
97
  </div>
 
98
  </div>
99
 
100
- <div class="col-sm-6 metaseo_tool" alt="<?php _e('Display image at its natural size, do not use HTML resize. It happens usually when you use handles to resize an image. You have a bulk edition tool to fix that.', 'wp-meta-seo') ?>">
101
  <div class="panel panel-updates">
102
  <div class="panel-body">
103
  <div class="row">
104
  <div class="col-xs-7 col-lg-8">
105
  <h4 class="panel-title text-danger"><?php _e('HTML image resizing', 'wp-meta-seo') ?></h4>
106
- <h3><?php echo $percent_iresizing . '%' ?></h3>
107
  <div class="progress">
108
- <div style="width: <?php echo $percent_iresizing . '%' ?>" aria-valuemax="100" aria-valuemin="0" aria-valuenow="<?php echo $percent_iresizing ?>" role="progressbar" class="progress-bar progress-bar-danger">
109
- <span class="sr-only"><?php echo $percent_iresizing . '%' ?> Complete (success)</span>
110
  </div>
111
  </div>
112
- <p><?php _e('Wrong resized images', 'wp-meta-seo') ?>: <?php echo $results_image['imgs_statis'][0] . '/' . $results_image['imgs_statis'][1] ?></p>
113
  </div>
114
  <div class="col-xs-5 col-lg-4 text-right">
115
- <input type="text" value="<?php echo $percent_iresizing ?>" class="dial-danger">
116
  </div>
117
  </div>
118
  </div>
119
  </div>
120
  </div>
121
 
122
- <div class="col-sm-6 metaseo_tool" alt="<?php _e('We recommend to use both alt text and image title. The main advantage is that it helps search engines discover your images and display them in image search results. Plus, these tags improve the accessibility of your site and give more information about your images. Use our bulk image tool to quickly check and fix that.', 'wp-meta-seo') ?>">
123
  <div class="panel panel-updates">
124
  <div class="panel-body">
125
  <div class="row">
126
  <div class="col-xs-7 col-lg-8">
127
  <h4 class="panel-title text-success"><?php _e('Image title/alt', 'wp-meta-seo') ?></h4>
128
- <h3><?php echo $percent_imeta . '%' ?></h3>
129
  <div class="progress">
130
- <div style="width: <?php echo $percent_imeta . '%' ?>" aria-valuemax="100" aria-valuemin="0" aria-valuenow="<?php echo $percent_imeta ?>" role="progressbar" class="progress-bar progress-bar-success">
131
- <span class="sr-only"><?php echo $percent_imeta . '%' ?> Complete (success)</span>
132
  </div>
133
  </div>
134
- <p><?php _e('Image data filled (in content)', 'wp-meta-seo') ?>: <?php echo $results_image['imgs_metas_statis'][0] . '/' . $results_image['imgs_metas_statis'][1] ?></p>
135
  </div>
136
  <div class="col-xs-5 col-lg-4 text-right">
137
- <input type="text" value="<?php echo $percent_imeta ?>" class="dial-success">
138
  </div>
139
  </div>
140
  </div>
141
  </div>
142
  </div>
143
 
144
- <div class="col-sm-6 metaseo_tool-000" alt="<?php _e('It is highly recommended to update or add new content on your website quite frequently. At least 3 updated or new content per month would be great :)', 'wp-meta-seo') ?>">
145
  <div class="panel panel-danger-full panel-updates">
146
  <div class="panel-body">
147
  <div class="row">
148
  <div class="col-xs-7 col-lg-8">
149
  <h4 class="panel-title text-warning"><?php _e('New or updated content', 'wp-meta-seo') ?></h4>
150
- <h3><?php echo $results['new_content'][0] . '%' ?></h3>
151
  <div class="progress">
152
- <div style="width: <?php echo $results['new_content'][0] . '%' ?>" aria-valuemax="100" aria-valuemin="0" aria-valuenow="<?php echo $results['new_content'][0] ?>" role="progressbar" class="progress-bar progress-bar-warning">
153
- <span class="sr-only"><?php echo $results['new_content'][0] . '%' ?> Complete (success)</span>
154
  </div>
155
  </div>
156
- <p><?php _e('Latest month new or updated content', 'wp-meta-seo') ?>: <?php echo $results['new_content'][1][0] ?></p>
157
  </div>
158
  <div class="col-xs-5 col-lg-4 text-right">
159
- <input type="text" value="<?php echo $results['new_content'][0] ?>" class="dial-warning">
160
  </div>
161
  </div>
162
  </div>
163
  </div>
164
  </div>
165
 
166
- <div class="col-sm-6 metaseo_tool-000" alt="<?php _e('The link title attribute does not have any SEO value for links. BUT links titles can influence click behavior for users, which may indirectly affect your SEO performance', 'wp-meta-seo') ?>">
167
  <div class="panel panel-danger-full panel-updates">
168
  <div class="panel-body">
169
  <div class="row">
170
  <div class="col-xs-7 col-lg-8">
171
  <h4 class="panel-title text-warning"><?php _e('Link titles', 'wp-meta-seo') ?></h4>
172
- <h3><?php echo $results['link_meta'][0] . '%' ?></h3>
173
  <div class="progress">
174
- <div style="width: <?php echo $results['link_meta'][0] . '%' ?>" aria-valuemax="100" aria-valuemin="0" aria-valuenow="<?php echo $results['link_meta'][0] ?>" role="progressbar" class="progress-bar progress-bar-warning">
175
- <span class="sr-only"><?php echo $results['link_meta'][0] . '%' ?> Complete (success)</span>
176
  </div>
177
  </div>
178
- <p><?php _e('Links title completed', 'wp-meta-seo') ?>: <?php echo $results['link_meta'][1][0] . '/' . $results['link_meta'][1][1]; ?></p>
179
  </div>
180
  <div class="col-xs-5 col-lg-4 text-right">
181
- <input type="text" value="<?php echo $results['link_meta'][0] ?>" class="dial-warning">
182
  </div>
183
  </div>
184
  </div>
@@ -235,7 +222,7 @@ $plugin_imgRecycle_file = 'imagerecycle-pdf-image-compression/wp-image-recycle.p
235
  </div>
236
 
237
  <?php else: ?>
238
- <?php $optimizer_results = $dashboard->wpmf_getImages_count(); ?>
239
  <div class="col-sm-6 metaseo_tool" alt="<?php _e('Images represent around 60% of a web page weight. An image compression reduce the image size by up to 70% while preserving the same visual quality. Small loading time is great for SEO!', 'wp-meta-seo') ?>">
240
  <div class="panel panel-updates">
241
  <div class="panel-body">
5
 
6
  wp_enqueue_style('m-style-qtip');
7
  wp_enqueue_script('jquery-qtip');
 
8
  $site_name = preg_replace('/(^(http|https):\/\/[w]*\.*)/', '', get_site_url());
9
  $pieces = explode("/", $site_name);
10
  $url = 'http://www.alexa.com/siteinfo/' . $pieces[0];
11
  $dashboard = new MetaSeo_Dashboard();
12
+ $options_dashboard = get_option('options_dashboard');
13
  $link_errors = $dashboard->get_404_link();
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  $plugin_imgRecycle_file = 'imagerecycle-pdf-image-compression/wp-image-recycle.php';
15
  ?>
16
  <h1 style="text-align: center;"><?php _e('WP Meta SEO dashboard', 'wp-meta-seo') ?></h1>
17
  <div class="dashboard">
18
  <div class="col-md-9">
19
  <div class="row panel-statistics">
20
+ <div class="col-sm-6 metaseo_tool wpms_dash_permalink" alt="<?php _e('It’s better using a permalink structure that is adding in your URL the category name and content title. This parameter can be changed in Settings > Permalinks WordPress menu. Tag recommended is %category%/%postname%', 'wp-meta-seo') ?>">
21
  <div class="panel panel-updates">
22
  <div class="panel-body">
23
  <div class="row">
24
  <div class="col-xs-7 col-lg-8">
25
  <h4 class="panel-title text-success"><?php _e('Permalinks settings', 'wp-meta-seo') ?></h4>
26
+ <h3>50%</h3>
27
  <div class="progress">
28
+ <div style="width: 50%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="50" role="progressbar" class="progress-bar progress-bar-success">
29
+ <span class="sr-only">50% Complete (success)</span>
30
  </div>
31
  </div>
32
+ <p><?php _e('Optimized at', 'wp-meta-seo') ?>: 50%</p>
33
  </div>
34
  <div class="col-xs-5 col-lg-4 text-right">
35
+ <input type="text" value="50" class="dial-success">
36
  </div>
37
  </div>
38
  </div>
39
  </div>
40
  </div>
41
 
42
+ <div class="col-sm-6 metaseo_tool-000 wpms_dash_metatitle" alt="<?php _e('Meta titles are displayed in search engine results as a page title. It’s a good thing for SEO to have some custom and attractive ones. Be sure to fill at least the met information on your most popular pages', 'wp-meta-seo') ?>">
43
  <div class="panel panel-danger-full panel-updates">
44
  <div class="panel-body">
45
  <div class="row">
46
  <div class="col-xs-7 col-lg-8">
47
  <h4 class="panel-title text-warning"><?php _e('Meta Title', 'wp-meta-seo') ?></h4>
48
+ <h3>0%</h3>
49
  <div class="progress">
50
+ <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" class="progress-bar progress-bar-warning">
51
+ <span class="sr-only">0% Complete (success)</span>
52
  </div>
53
  </div>
54
+ <p><?php _e('Meta title filled', 'wp-meta-seo') ?>: <?php _e('Loading...','wp-meta-seo-addon') ?></p>
55
  </div>
56
  <div class="col-xs-5 col-lg-4 text-right">
57
+ <input type="text" value="0" class="dial-warning">
58
  </div>
59
  </div>
60
  </div>
61
  </div>
62
  </div>
63
 
64
+ <div class="col-sm-6 metaseo_tool-000 wpms_dash_metadesc" alt="<?php _e('Meta descriptions are displayed in search engine results as a page description. It’s a good thing for SEO to have some custom and attractive ones. Be sure to fill at least the meta information on your most popular pages.', 'wp-meta-seo') ?>">
65
  <div class="panel panel-success-full panel-updates">
66
  <div class="panel-body">
67
  <div class="row">
68
  <div class="col-xs-7 col-lg-8">
69
  <h4 class="panel-title text-success"><?php _e('Meta Description', 'wp-meta-seo') ?></h4>
70
+ <h3>0%</h3>
71
  <div class="progress">
72
+ <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" class="progress-bar progress-bar-info">
73
+ <span class="sr-only">0% Complete (success)</span>
74
  </div>
75
  </div>
76
+ <p><?php _e('Meta description filled', 'wp-meta-seo') ?>: <?php _e('Loading...','wp-meta-seo-addon') ?></p>
77
  </div>
78
  <div class="col-xs-5 col-lg-4 text-right">
79
+ <input type="text" value="0" class="dial-info">
80
  </div>
81
  </div>
82
  </div>
83
  </div>
84
+
85
  </div>
86
 
87
+ <div class="col-sm-6 metaseo_tool wpms_dash_imgsresize" alt="<?php _e('Display image at its natural size, do not use HTML resize. It happens usually when you use handles to resize an image. You have a bulk edition tool to fix that.', 'wp-meta-seo') ?>">
88
  <div class="panel panel-updates">
89
  <div class="panel-body">
90
  <div class="row">
91
  <div class="col-xs-7 col-lg-8">
92
  <h4 class="panel-title text-danger"><?php _e('HTML image resizing', 'wp-meta-seo') ?></h4>
93
+ <h3>0%</h3>
94
  <div class="progress">
95
+ <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" class="progress-bar progress-bar-danger">
96
+ <span class="sr-only">0% Complete (success)</span>
97
  </div>
98
  </div>
99
+ <p><?php _e('Wrong resized images', 'wp-meta-seo') ?>: <?php _e('Loading...','wp-meta-seo-addon') ?></p>
100
  </div>
101
  <div class="col-xs-5 col-lg-4 text-right">
102
+ <input type="text" value="0" class="dial-danger">
103
  </div>
104
  </div>
105
  </div>
106
  </div>
107
  </div>
108
 
109
+ <div class="col-sm-6 metaseo_tool wpms_dash_imgsmeta" alt="<?php _e('We recommend to use both alt text and image title. The main advantage is that it helps search engines discover your images and display them in image search results. Plus, these tags improve the accessibility of your site and give more information about your images. Use our bulk image tool to quickly check and fix that.', 'wp-meta-seo') ?>">
110
  <div class="panel panel-updates">
111
  <div class="panel-body">
112
  <div class="row">
113
  <div class="col-xs-7 col-lg-8">
114
  <h4 class="panel-title text-success"><?php _e('Image title/alt', 'wp-meta-seo') ?></h4>
115
+ <h3>0%</h3>
116
  <div class="progress">
117
+ <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" class="progress-bar progress-bar-success">
118
+ <span class="sr-only">0% Complete (success)</span>
119
  </div>
120
  </div>
121
+ <p><?php _e('Image data filled (in content)', 'wp-meta-seo') ?>: <?php _e('Loading...','wp-meta-seo-addon') ?></p>
122
  </div>
123
  <div class="col-xs-5 col-lg-4 text-right">
124
+ <input type="text" value="0" class="dial-success">
125
  </div>
126
  </div>
127
  </div>
128
  </div>
129
  </div>
130
 
131
+ <div class="col-sm-6 metaseo_tool-000 wpms_dash_newcontent" alt="<?php _e('It is highly recommended to update or add new content on your website quite frequently. At least 3 updated or new content per month would be great :)', 'wp-meta-seo') ?>">
132
  <div class="panel panel-danger-full panel-updates">
133
  <div class="panel-body">
134
  <div class="row">
135
  <div class="col-xs-7 col-lg-8">
136
  <h4 class="panel-title text-warning"><?php _e('New or updated content', 'wp-meta-seo') ?></h4>
137
+ <h3>0%</h3>
138
  <div class="progress">
139
+ <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" class="progress-bar progress-bar-warning">
140
+ <span class="sr-only">0% Complete (success)</span>
141
  </div>
142
  </div>
143
+ <p><?php _e('Latest month new or updated content', 'wp-meta-seo') ?>: <?php _e('Loading...','wp-meta-seo-addon') ?></p>
144
  </div>
145
  <div class="col-xs-5 col-lg-4 text-right">
146
+ <input type="text" value="0" class="dial-warning">
147
  </div>
148
  </div>
149
  </div>
150
  </div>
151
  </div>
152
 
153
+ <div class="col-sm-6 metaseo_tool-000 wpms_dash_linkmeta" alt="<?php _e('The link title attribute does not have any SEO value for links. BUT links titles can influence click behavior for users, which may indirectly affect your SEO performance', 'wp-meta-seo') ?>">
154
  <div class="panel panel-danger-full panel-updates">
155
  <div class="panel-body">
156
  <div class="row">
157
  <div class="col-xs-7 col-lg-8">
158
  <h4 class="panel-title text-warning"><?php _e('Link titles', 'wp-meta-seo') ?></h4>
159
+ <h3>0%</h3>
160
  <div class="progress">
161
+ <div style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" class="progress-bar progress-bar-warning">
162
+ <span class="sr-only">0% Complete (success)</span>
163
  </div>
164
  </div>
165
+ <p><?php _e('Links title completed', 'wp-meta-seo') ?>: <?php _e('Loading...','wp-meta-seo-addon') ?></p>
166
  </div>
167
  <div class="col-xs-5 col-lg-4 text-right">
168
+ <input type="text" value="0" class="dial-warning">
169
  </div>
170
  </div>
171
  </div>
222
  </div>
223
 
224
  <?php else: ?>
225
+ <?php $optimizer_results = $dashboard->wpms_getImages_count(); ?>
226
  <div class="col-sm-6 metaseo_tool" alt="<?php _e('Images represent around 60% of a web page weight. An image compression reduce the image size by up to 70% while preserving the same visual quality. Small loading time is great for SEO!', 'wp-meta-seo') ?>">
227
  <div class="panel panel-updates">
228
  <div class="panel-body">
inc/pages/dashboard/imgsmeta.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('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" aria-valuemin="0" aria-valuenow="<?php echo $results['imgs_metas_statis'][2] ?>" role="progressbar" class="progress-bar progress-bar-success">
9
+ <span class="sr-only"><?php echo $results['imgs_metas_statis'][2] . '%' ?> Complete (success)</span>
10
+ </div>
11
+ </div>
12
+ <p><?php _e('Image data filled (in content)', 'wp-meta-seo') ?>: <?php echo $results['imgs_metas_statis'][0] . '/' . $results['imgs_metas_statis'][1] ?></p>
13
+ </div>
14
+ <div class="col-xs-5 col-lg-4 text-right">
15
+ <input type="text" value="<?php echo $results['imgs_metas_statis'][2] ?>" class="dial-success">
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
inc/pages/dashboard/imgsresize.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('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" aria-valuemin="0" aria-valuenow="<?php echo $results['imgs_statis'][2] ?>" role="progressbar" class="progress-bar progress-bar-danger">
9
+ <span class="sr-only"><?php echo $results['imgs_statis'][2] . '%' ?> Complete (success)</span>
10
+ </div>
11
+ </div>
12
+ <p><?php _e('Wrong resized images', 'wp-meta-seo') ?>: <?php echo $results['imgs_statis'][0] . '/' . $results['imgs_statis'][1] ?></p>
13
+ </div>
14
+ <div class="col-xs-5 col-lg-4 text-right">
15
+ <input type="text" value="<?php echo $results['imgs_statis'][2] ?>" class="dial-danger">
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
inc/pages/dashboard/link_meta.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('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" aria-valuenow="<?php echo $results[0] ?>" role="progressbar" class="progress-bar progress-bar-warning">
9
+ <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
10
+ </div>
11
+ </div>
12
+ <p><?php _e('Links title completed', 'wp-meta-seo') ?>: <?php echo $results[1][0] . '/' . $results[1][1]; ?></p>
13
+ </div>
14
+ <div class="col-xs-5 col-lg-4 text-right">
15
+ <input type="text" value="<?php echo $results[0] ?>" class="dial-warning">
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
inc/pages/dashboard/meta_desc.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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" aria-valuenow="<?php echo $results[0] ?>" role="progressbar" class="progress-bar progress-bar-info">
9
+ <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
10
+ </div>
11
+ </div>
12
+ <p><?php _e('Meta description filled', 'wp-meta-seo') ?>: <?php echo $results[1][0] . '/' . $results[1][1] ?></p>
13
+ </div>
14
+ <div class="col-xs-5 col-lg-4 text-right">
15
+ <input type="text" value="<?php echo $results[0] ?>" class="dial-info">
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
inc/pages/dashboard/meta_title.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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" aria-valuenow="<?php echo $results[0] ?>" role="progressbar" class="progress-bar progress-bar-warning">
9
+ <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
10
+ </div>
11
+ </div>
12
+ <p><?php _e('Meta title filled', 'wp-meta-seo') ?>: <?php echo $results[1][0] . '/' . $results[1][1] ?></p>
13
+ </div>
14
+ <div class="col-xs-5 col-lg-4 text-right">
15
+ <input type="text" value="<?php echo $results[0] ?>" class="dial-warning">
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
inc/pages/dashboard/new_content.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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('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" aria-valuenow="<?php echo $results[0] ?>" role="progressbar" class="progress-bar progress-bar-warning">
9
+ <span class="sr-only"><?php echo $results[0] . '%' ?> Complete (success)</span>
10
+ </div>
11
+ </div>
12
+ <p><?php _e('Latest month new or updated content', 'wp-meta-seo') ?>: <?php echo $results[1][0] ?></p>
13
+ </div>
14
+ <div class="col-xs-5 col-lg-4 text-right">
15
+ <input type="text" value="<?php echo $results[0] ?>" class="dial-warning">
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
inc/pages/dashboard/permalink.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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" aria-valuenow="<?php echo $permalink ?>" role="progressbar" class="progress-bar progress-bar-success">
9
+ <span class="sr-only"><?php echo $permalink . '%' ?> Complete (success)</span>
10
+ </div>
11
+ </div>
12
+ <p><?php _e('Optimized at', 'wp-meta-seo') ?>: <?php echo $permalink . '%' ?></p>
13
+ </div>
14
+ <div class="col-xs-5 col-lg-4 text-right">
15
+ <input type="text" value="<?php echo $permalink ?>" class="dial-success">
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
inc/pages/metaseo-broken-link.php CHANGED
@@ -2,6 +2,8 @@
2
  if (!class_exists('MetaSeo_Broken_Link_Table')) {
3
  require_once( WPMETASEO_PLUGIN_DIR . '/inc/class.metaseo-broken-link-table.php' );
4
  }
 
 
5
  wp_enqueue_style('metaseo-google-icon');
6
  wp_enqueue_style('m-style-qtip');
7
  wp_enqueue_script('jquery-qtip');
@@ -20,13 +22,15 @@ if (!empty($_REQUEST['_wp_http_referer'])) {
20
  <div id="icon-edit-pages" class="icon32 icon32-posts-page"></div>
21
 
22
  <?php echo '<h1>' . __('404 & Redirects', 'wp-meta-seo') . '</h1>'; ?>
 
23
  <form id="wp-seo-meta-form" action="" method="post">
 
24
  <?php $metaseo_list_table->search_box1(); ?>
25
 
26
  <?php $metaseo_list_table->display(); ?>
27
  </form>
28
 
29
  </div>
30
- <?php
31
  wp_enqueue_script('wpms-broken-link');
32
  ?>
2
  if (!class_exists('MetaSeo_Broken_Link_Table')) {
3
  require_once( WPMETASEO_PLUGIN_DIR . '/inc/class.metaseo-broken-link-table.php' );
4
  }
5
+ wp_enqueue_script('wplink');
6
+ wp_enqueue_style( 'editor-buttons' );
7
  wp_enqueue_style('metaseo-google-icon');
8
  wp_enqueue_style('m-style-qtip');
9
  wp_enqueue_script('jquery-qtip');
22
  <div id="icon-edit-pages" class="icon32 icon32-posts-page"></div>
23
 
24
  <?php echo '<h1>' . __('404 & Redirects', 'wp-meta-seo') . '</h1>'; ?>
25
+
26
  <form id="wp-seo-meta-form" action="" method="post">
27
+
28
  <?php $metaseo_list_table->search_box1(); ?>
29
 
30
  <?php $metaseo_list_table->display(); ?>
31
  </form>
32
 
33
  </div>
34
+ <?php
35
  wp_enqueue_script('wpms-broken-link');
36
  ?>
inc/pages/settings.php CHANGED
@@ -16,6 +16,13 @@ if (is_array($wpms_settings_404)) {
16
  <div class="wpms-tabs">
17
  <div class="wpms-tab-header active" data-label="wpms-global"><?php _e('Global', 'wp-meta-seo') ?></div>
18
  <div class="wpms-tab-header" data-label="wpms-redirection"><?php _e('Redirections and 404', 'wp-meta-seo') ?></div>
 
 
 
 
 
 
 
19
  </div>
20
  </div>
21
  <div class="wpms_content_settings">
@@ -59,10 +66,21 @@ if (is_array($wpms_settings_404)) {
59
  </tr>
60
  </tbody>
61
  </table>
 
 
 
 
 
62
  <div class="button wpms_save_settings404"><?php _e('Save', 'wp-meta-seo') ?></div>
63
  <span class="message_saved"><?php _e('Saved', 'wp-meta-seo') ?></span>
64
  </div>
65
 
 
 
 
 
 
 
66
  </div>
67
  </div>
68
  <script type="text/javascript">
@@ -102,6 +120,13 @@ if (is_array($wpms_settings_404)) {
102
  var home_redirected = $('.wpms_redirect_homepage').val();
103
  var type_404 = $('.wpms_type_404').val();
104
  var page_redirected = $('.wpms_page_redirected').val();
 
 
 
 
 
 
 
105
  $.ajax({
106
  url: ajaxurl,
107
  method: 'POST',
@@ -110,7 +135,10 @@ if (is_array($wpms_settings_404)) {
110
  'action': 'wpms_save_settings404',
111
  'wpms_redirect[wpms_redirect_homepage]': home_redirected,
112
  'wpms_redirect[wpms_type_404]': type_404,
113
- 'wpms_redirect[wpms_page_redirected]': page_redirected
 
 
 
114
  },
115
  success: function (res) {
116
  if (res == true) {
@@ -122,6 +150,37 @@ if (is_array($wpms_settings_404)) {
122
  });
123
  });
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  $('.wpms_type_404').on('change', function () {
126
  var type_404 = $(this).val();
127
  if (type_404 == 'wp-meta-seo-page' || type_404 == 'none') {
16
  <div class="wpms-tabs">
17
  <div class="wpms-tab-header active" data-label="wpms-global"><?php _e('Global', 'wp-meta-seo') ?></div>
18
  <div class="wpms-tab-header" data-label="wpms-redirection"><?php _e('Redirections and 404', 'wp-meta-seo') ?></div>
19
+ <?php
20
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)):
21
+ ?>
22
+ <div class="wpms-tab-header" data-label="wpms-email"><?php _e('Send Email', 'wp-meta-seo') ?></div>
23
+ <?php
24
+ endif;
25
+ ?>
26
  </div>
27
  </div>
28
  <div class="wpms_content_settings">
66
  </tr>
67
  </tbody>
68
  </table>
69
+ <?php
70
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)){
71
+ echo $link_settings_html;
72
+ }
73
+ ?>
74
  <div class="button wpms_save_settings404"><?php _e('Save', 'wp-meta-seo') ?></div>
75
  <span class="message_saved"><?php _e('Saved', 'wp-meta-seo') ?></span>
76
  </div>
77
 
78
+ <?php
79
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)){
80
+ echo $html_tabemail;
81
+ }
82
+ ?>
83
+
84
  </div>
85
  </div>
86
  <script type="text/javascript">
120
  var home_redirected = $('.wpms_redirect_homepage').val();
121
  var type_404 = $('.wpms_type_404').val();
122
  var page_redirected = $('.wpms_page_redirected').val();
123
+
124
+ if($('#scanlinkenable').is(":checked")){
125
+ var enable = 1;
126
+ }else{
127
+ var enable = 0;
128
+ }
129
+
130
  $.ajax({
131
  url: ajaxurl,
132
  method: 'POST',
135
  'action': 'wpms_save_settings404',
136
  'wpms_redirect[wpms_redirect_homepage]': home_redirected,
137
  'wpms_redirect[wpms_type_404]': type_404,
138
+ 'wpms_redirect[wpms_page_redirected]': page_redirected,
139
+ 'enable' : enable,
140
+ 'numberFrequency' : $('#numberFrequency').val(),
141
+ 'showlinkFrequency' : $('#showlinkFrequency').val()
142
  },
143
  success: function (res) {
144
  if (res == true) {
150
  });
151
  });
152
 
153
+ $('.wpms_save_settingemail').on('click', function () {
154
+ if($('#showSmtpenable').is(":checked")){
155
+ var enable = 1;
156
+ }else{
157
+ var enable = 0;
158
+ }
159
+ $this = $(this);
160
+ $.ajax({
161
+ url: ajaxurl,
162
+ method: 'POST',
163
+ dataType: 'json',
164
+ data: {
165
+ action : 'wpms_save_settingemail',
166
+ enable : enable,
167
+ host : $('#showSmtpHost').val(),
168
+ type_encryption : $('[name="wpms_email_settings[type_encryption]"]:checked').val(),
169
+ port : $('#showSmtpPort').val(),
170
+ autentication : $('[name="wpms_email_settings[autentication]"]:checked').val(),
171
+ username : $('#showSmtpUser').val(),
172
+ password : $('#showSmtpPass').val(),
173
+ },
174
+ success: function (res) {
175
+ if (res == true) {
176
+ $this.closest('.content-box').find('.message_saved').fadeIn(10).delay(2000).fadeOut(2000);
177
+ } else {
178
+ alert('Save errors !')
179
+ }
180
+ }
181
+ });
182
+ });
183
+
184
  $('.wpms_type_404').on('change', function () {
185
  var type_404 = $(this).val();
186
  if (type_404 == 'wp-meta-seo-page' || type_404 == 'none') {
inc/pages/sitemaps/metaseo-google-sitemap.php CHANGED
@@ -1,5 +1,6 @@
1
  <div class="wrap wpms_wrap">
2
  <?php
 
3
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/sitemap_menus.php' );
4
  ?>
5
  <form method="post" id="wpms_xmap_form" action="">
@@ -11,7 +12,21 @@
11
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_menu.php' );
12
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_posts.php' );
13
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_pages.php' );
 
 
 
 
 
 
 
 
 
 
 
14
  echo '<div class="div_wpms_save_sitemaps"><input type="button" class="button button-primary wpms_save_create_sitemaps" value="' . __('Regenerate and save sitemaps', 'wp-meta-seo') . '"><span class="spinner spinner_save_sitemaps"></span></div>';
 
 
 
15
  ?>
16
  </form>
17
  </div>
1
  <div class="wrap wpms_wrap">
2
  <?php
3
+ $custom_post_types = get_post_types(array('public' => true, 'exclude_from_search' => false ,'_builtin' => false));
4
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/sitemap_menus.php' );
5
  ?>
6
  <form method="post" id="wpms_xmap_form" action="">
12
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_menu.php' );
13
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_posts.php' );
14
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_pages.php' );
15
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)) {
16
+ if (!empty($custom_post_types)) {
17
+ foreach ($custom_post_types as $post_type => $label) {
18
+ ob_start();
19
+ require(WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_posts_custom.php');
20
+ $html = ob_get_contents();
21
+ ob_end_clean();
22
+ echo $html;
23
+ }
24
+ }
25
+ }
26
  echo '<div class="div_wpms_save_sitemaps"><input type="button" class="button button-primary wpms_save_create_sitemaps" value="' . __('Regenerate and save sitemaps', 'wp-meta-seo') . '"><span class="spinner spinner_save_sitemaps"></span></div>';
27
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)){
28
+ echo '<p class="description">'.__("Sitemap automatic submission to Google Search Console on save, ","wp-meta-seo-addon").'<a href="'.admin_url('admin.php?page=metaseo_console&tab=settings').'">'.__("requires authentication","wp-meta-seo-addon").'</a></p>';
29
+ }
30
  ?>
31
  </form>
32
  </div>
inc/pages/sitemaps/metaseo-source_pages.php CHANGED
@@ -25,7 +25,7 @@
25
  <div id="wrap_sitemap_option_pages" class="wrap_sitemap_option">
26
  <h3><?php _e('Pages', 'wp-meta-seo') ?></h3>
27
  <?php
28
- $pages = get_pages();
29
  foreach ($pages as $page) {
30
  if(empty($metaseo_sitemap->settings_sitemap['wpms_sitemap_pages'][$page->ID]['frequency'])){
31
  $pagefrequency = 'monthly';
25
  <div id="wrap_sitemap_option_pages" class="wrap_sitemap_option">
26
  <h3><?php _e('Pages', 'wp-meta-seo') ?></h3>
27
  <?php
28
+ $pages = $metaseo_sitemap->wpms_get_pages();
29
  foreach ($pages as $page) {
30
  if(empty($metaseo_sitemap->settings_sitemap['wpms_sitemap_pages'][$page->ID]['frequency'])){
31
  $pagefrequency = 'monthly';
inc/pages/sitemaps/metaseo-source_posts.php CHANGED
@@ -28,23 +28,22 @@
28
  $check = array();
29
  $desclink_category_add = __('Add link to category name' , 'wp-meta-seo');
30
  $desclink_category_remove = __('Remove link to category name' , 'wp-meta-seo');
31
- foreach ($posts as $key => $post) {
32
- $keys = explode('||', $key);
33
- if(!in_array($keys[2], $check)){
34
- $check[] = $keys[2];
35
- echo '<div class="wpms_row"><h1>' . $keys[2] . '</h1></div>';
36
  }
37
 
38
- if(in_array($keys[1], $metaseo_sitemap->settings_sitemap['wpms_category_link'])){
39
- echo '<div class="wpms_row"><h3><input for="'.$desclink_category_remove.'" type="checkbox" checked class="sitemap_addlink_categories" value="'.$keys[1].'">' . $keys[0] . '</h3></div>';
40
  }else{
41
- echo '<div class="wpms_row"><h3><input for="'.$desclink_category_add.'" type="checkbox" class="sitemap_addlink_categories" value="'.$keys[1].'">' . $keys[0] . '</h3></div>';
42
  }
43
 
44
- echo '<div class="wpms_row wpms_row_check_all_posts"><input type="checkbox" class="sitemap_check_all_posts_categories" data-category="'.$keys[2].$keys[3].'">'.__('Select all' , 'wp-meta-seo').'</div>';
45
- foreach ($post as $p) {
46
- $category = get_the_terms($p, $keys[2]);
47
- if($category[0]->term_id == $keys[1]){
48
  if(empty($metaseo_sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['frequency'])){
49
  $postfrequency = 'monthly';
50
  }else{
@@ -58,14 +57,18 @@
58
  $select_priority = $metaseo_sitemap->wpms_view_select_priority('priority_posts_'.$p->ID,'_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][priority]', $postpriority);
59
  $select_frequency = $metaseo_sitemap->wpms_view_select_frequency('frequency_posts_'.$p->ID,'_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][frequency]', $postfrequency);
60
  echo '<div class="wpms_row">';
61
- echo '<div style="float:left;line-height:30px">';
62
  if (isset($metaseo_sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id']) && $metaseo_sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id'] == $p->ID) {
63
- echo '<input class="cb_sitemaps_posts wpms_xmap_posts '.$keys[2].$keys[3].'" name="_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][post_id]" checked type="checkbox" value="' . $p->ID . '">';
64
  } else {
65
- echo '<input class="cb_sitemaps_posts wpms_xmap_posts '.$keys[2].$keys[3].'" name="_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][post_id]" type="checkbox" value="' . $p->ID . '">';
 
 
 
 
 
66
  }
67
 
68
- echo $p->post_title;
69
  echo '</div>';
70
  echo '<div style="margin-left:200px">' . $select_priority . $select_frequency . '</div>';
71
  echo '</div>';
28
  $check = array();
29
  $desclink_category_add = __('Add link to category name' , 'wp-meta-seo');
30
  $desclink_category_remove = __('Remove link to category name' , 'wp-meta-seo');
31
+ foreach ($posts as $post) {
32
+ if(!in_array($post->taxo, $check)){
33
+ $check[] = $post->taxo;
34
+ echo '<div class="wpms_row"><h1>' . $post->taxo . '</h1></div>';
 
35
  }
36
 
37
+ if(in_array($post->cat_ID, $metaseo_sitemap->settings_sitemap['wpms_category_link'])){
38
+ echo '<div class="wpms_row"><h3><input for="'.$desclink_category_remove.'" type="checkbox" checked class="sitemap_addlink_categories" value="'.$post->cat_ID.'">' . $post->cat_name . '</h3></div>';
39
  }else{
40
+ echo '<div class="wpms_row"><h3><input for="'.$desclink_category_add.'" type="checkbox" class="sitemap_addlink_categories" value="'.$post->cat_ID.'">' . $post->cat_name . '</h3></div>';
41
  }
42
 
43
+ echo '<div class="wpms_row wpms_row_check_all_posts"><input type="checkbox" class="sitemap_check_all_posts_categories" data-category="'.$post->taxo.$post->slug.'">'.__('Select all' , 'wp-meta-seo').'</div>';
44
+ foreach ($post->results as $p) {
45
+ $category = get_the_terms($p, $post->taxo);
46
+ if($category[0]->term_id == $post->cat_ID){
47
  if(empty($metaseo_sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['frequency'])){
48
  $postfrequency = 'monthly';
49
  }else{
57
  $select_priority = $metaseo_sitemap->wpms_view_select_priority('priority_posts_'.$p->ID,'_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][priority]', $postpriority);
58
  $select_frequency = $metaseo_sitemap->wpms_view_select_frequency('frequency_posts_'.$p->ID,'_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][frequency]', $postfrequency);
59
  echo '<div class="wpms_row">';
60
+ echo '<div style="float:left;line-height:30px;min-width: 300px;">';
61
  if (isset($metaseo_sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id']) && $metaseo_sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id'] == $p->ID) {
62
+ echo '<input class="cb_sitemaps_posts wpms_xmap_posts '.$post->taxo.$post->slug.'" name="_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][post_id]" checked type="checkbox" value="' . $p->ID . '">';
63
  } else {
64
+ echo '<input class="cb_sitemaps_posts wpms_xmap_posts '.$post->taxo.$post->slug.'" name="_metaseo_settings_sitemap[wpms_sitemap_posts][' . $p->ID . '][post_id]" type="checkbox" value="' . $p->ID . '">';
65
+ }
66
+ if(strlen($p->post_title) > 30){
67
+ echo substr($p->post_title,0,30);
68
+ }else{
69
+ echo $p->post_title;
70
  }
71
 
 
72
  echo '</div>';
73
  echo '<div style="margin-left:200px">' . $select_priority . $select_frequency . '</div>';
74
  echo '</div>';
inc/pages/sitemaps/metaseo-source_posts_custom.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wpms_source wpms_source_<?php echo $post_type ?>" style="display: none">
2
+ <div class="div_sitemap_check_all">
3
+ <input type="checkbox" class="sitemap_check_all" data-type="<?php echo $post_type ?>"><?php _e('Check all posts', 'wp-meta-seo'); ?>
4
+ </div>
5
+
6
+ <div class="div_sitemap_check_all">
7
+ <input type="checkbox" class="sitemap_check_all_posts_in_page" data-type="<?php echo $post_type ?>"><?php _e('Check all posts in current page', 'wp-meta-seo'); ?>
8
+ </div>
9
+
10
+ <div class="div_sitemap_check_all" style="font-weight: bold;">
11
+ <?php _e('Public name' , 'wp-meta-seo'); ?>
12
+ <input type="text" class="public_name_<?php echo $post_type ?>" value="<?php echo $metaseo_sitemap->settings_sitemap['wpms_public_name_'.$post_type] ?>">
13
+ </div>
14
+
15
+ <div class="div_sitemap_check_all" style="font-weight: bold;">
16
+ <?php _e('Display in column' , 'wp-meta-seo'); ?>
17
+ <select class="wpms_display_column wpms_display_column_<?php echo $post_type ?>">
18
+ <?php
19
+ for($i = 1 ; $i <= $metaseo_sitemap->settings_sitemap['wpms_html_sitemap_column'] ; $i++){
20
+ echo '<option '.(selected($metaseo_sitemap->settings_sitemap['wpms_display_column_'.$post_type], $i)).' value="'.$i.'">'.$metaseo_sitemap->columns[$i].'</option>';
21
+ }
22
+ ?>
23
+ </select>
24
+ </div>
25
+ <div id="wrap_sitemap_option_<?php echo $post_type ?>" class="wrap_sitemap_option">
26
+ <?php
27
+ $posts = $metaseo_sitemap->wpms_get_posts_custom($post_type);
28
+ foreach ($posts as $post) {
29
+ if(!in_array($post->taxo, $check)){
30
+ $check[] = $post->taxo;
31
+ if($post->taxo == 'product_type'){
32
+ echo '<div class="wpms_row"><h1>'.__('Products','wp-meta-seo').'</h1></div>';
33
+ }elseif($post->taxo == 'product_cat'){
34
+ echo '<div class="wpms_row"><h1>'.__('Products categories','wp-meta-seo').'</h1></div>';
35
+ }else{
36
+ echo '<div class="wpms_row"><h1>' . $post->taxo . '</h1></div>';
37
+ }
38
+ }
39
+
40
+ if(in_array($post->cat_ID, $metaseo_sitemap->settings_sitemap['wpms_category_link'])){
41
+ echo '<div class="wpms_row"><h3><input for="'.$desclink_category_remove.'" type="checkbox" checked class="sitemap_addlink_categories" value="'.$post->cat_ID.'">' . $post->cat_name . '</h3></div>';
42
+ }else{
43
+ echo '<div class="wpms_row"><h3><input for="'.$desclink_category_add.'" type="checkbox" class="sitemap_addlink_categories" value="'.$post->cat_ID.'">' . $post->cat_name . '</h3></div>';
44
+ }
45
+
46
+ echo '<div class="wpms_row wpms_row_check_all_posts"><input type="checkbox" class="sitemap_check_all_posts_categories" data-category="'.$post->taxo.$post->slug.'">'.__('Select all' , 'wp-meta-seo').'</div>';
47
+ foreach ($post->results as $p) {
48
+ $category = get_the_terms($p, $post->taxo);
49
+ if($category[0]->term_id == $post->cat_ID){
50
+ if(empty($metaseo_sitemap->settings_sitemap['wpms_sitemap_'.$post_type][$post->cat_ID.'-'.$p->ID]['frequency'])){
51
+ $postfrequency = 'monthly';
52
+ }else{
53
+ $postfrequency = $metaseo_sitemap->settings_sitemap['wpms_sitemap_'.$post_type][$post->cat_ID.'-'.$p->ID]['frequency'];
54
+ }
55
+ if(empty($metaseo_sitemap->settings_sitemap['wpms_sitemap_'.$post_type][$post->cat_ID.'-'.$p->ID]['priority'])){
56
+ $postpriority = '1.0';
57
+ }else{
58
+ $postpriority = $metaseo_sitemap->settings_sitemap['wpms_sitemap_'.$post_type][$post->cat_ID.'-'.$p->ID]['priority'];
59
+ }
60
+ $select_priority = $metaseo_sitemap->wpms_view_select_priority('priority_'.$post_type.'_'.$p->ID,'_metaseo_settings_sitemap[wpms_sitemap_'.$post_type.'][' . $post->cat_ID . '-' . $p->ID . '][priority]', $postpriority);
61
+ $select_frequency = $metaseo_sitemap->wpms_view_select_frequency('frequency_'.$post_type.'_'.$p->ID,'_metaseo_settings_sitemap[wpms_sitemap_'.$post_type.'][' . $post->cat_ID . '-' .$p->ID . '][frequency]', $postfrequency);
62
+ echo '<div class="wpms_row">';
63
+ echo '<div style="float:left;line-height:30px">';
64
+ if (isset($metaseo_sitemap->settings_sitemap['wpms_sitemap_'.$post_type][$post->cat_ID . '-' . $p->ID]['post_id']) && $metaseo_sitemap->settings_sitemap['wpms_sitemap_'.$post_type][$post->cat_ID . '-' .$p->ID]['post_id'] == $p->ID) {
65
+ echo '<input class="cb_sitemaps_'.$post_type.' wpms_xmap_'.$post_type.' '.$post->taxo.$post->slug.'" name="_metaseo_settings_sitemap[wpms_sitemap_'.$post_type.'][' . $post->cat_ID . '-' .$p->ID . '][post_id]" checked type="checkbox" value="' . $p->ID . '" data-category="'.$post->cat_ID.'">';
66
+ } else {
67
+ echo '<input class="cb_sitemaps_'.$post_type.' wpms_xmap_'.$post_type.' '.$post->taxo.$post->slug.'" name="_metaseo_settings_sitemap[wpms_sitemap_'.$post_type.'][' . $post->cat_ID . '-' .$p->ID . '][post_id]" type="checkbox" value="' . $p->ID . '" data-category="'.$post->cat_ID.'">';
68
+ }
69
+
70
+ echo $p->post_title;
71
+ echo '</div>';
72
+ echo '<div style="margin-left:200px">' . $select_priority . $select_frequency . '</div>';
73
+ echo '</div>';
74
+ }
75
+ }
76
+ }
77
+
78
+
79
+
80
+
81
+ ?>
82
+ </div>
83
+ <div class="holder holder_<?php echo $post_type ?>"></div>
84
+ </div>
inc/pages/sitemaps/sitemap_menus.php CHANGED
@@ -4,4 +4,13 @@
4
  <div class="nav-tab" data-tab="menu"><?php _e('Source: menu','wp-meta-seo') ?></div>
5
  <div class="nav-tab" data-tab="posts"><?php _e('Source: posts','wp-meta-seo') ?></div>
6
  <div class="nav-tab" data-tab="pages"><?php _e('Source: pages','wp-meta-seo') ?></div>
 
 
 
 
 
 
 
 
 
7
  </h2>
4
  <div class="nav-tab" data-tab="menu"><?php _e('Source: menu','wp-meta-seo') ?></div>
5
  <div class="nav-tab" data-tab="posts"><?php _e('Source: posts','wp-meta-seo') ?></div>
6
  <div class="nav-tab" data-tab="pages"><?php _e('Source: pages','wp-meta-seo') ?></div>
7
+ <?php
8
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)) {
9
+ if (!empty($custom_post_types)) {
10
+ foreach ($custom_post_types as $post_type => $label) {
11
+ echo '<div class="nav-tab" data-tab="' . $post_type . '">' . ucfirst($label) . '</div>';
12
+ }
13
+ }
14
+ }
15
+ ?>
16
  </h2>
js/dashboard.js CHANGED
@@ -1,38 +1,180 @@
1
  jQuery(document).ready(function ($) {
2
  'use strict';
 
3
  // Knob
4
- $('.dial-success').knob({
5
- readOnly: true,
6
- width: '70px',
7
- bgColor: '#E7E9EE',
8
- fgColor: '#259CAB',
9
- inputColor: '#262B36'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  });
11
 
12
- $('.dial-danger').knob({
13
- readOnly: true,
14
- width: '70px',
15
- bgColor: '#E7E9EE',
16
- fgColor: '#259CAB',
17
- inputColor: '#262B36'
18
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- $('.dial-info').knob({
21
- readOnly: true,
22
- width: '70px',
23
- bgColor: '#259CAB',
24
- fgColor: '#fff',
25
- inputColor: '#fff'
26
- });
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- $('.dial-warning').knob({
29
- readOnly: true,
30
- width: '70px',
31
- bgColor: '#259CAB',
32
- fgColor: '#fff',
33
- inputColor: '#fff'
34
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
 
 
 
 
 
 
 
 
 
36
  jQuery('.metaseo_tool').qtip({
37
  content: {
38
  attr: 'alt'
1
  jQuery(document).ready(function ($) {
2
  'use strict';
3
+ var wpms_dash = 0;
4
  // Knob
5
+ $.ajax({
6
+ url: ajaxurl,
7
+ method: 'POST',
8
+ dataType: 'json',
9
+ data: {
10
+ action: 'wpms_dash_permalink',
11
+ },
12
+ success: function (res) {
13
+ $('.wpms_dash_permalink').html(null);
14
+ $('.wpms_dash_permalink').html(res);
15
+ $('.dial-success').knob({
16
+ readOnly: true,
17
+ width: '70px',
18
+ bgColor: '#E7E9EE',
19
+ fgColor: '#259CAB',
20
+ inputColor: '#262B36'
21
+ });
22
+ wpms_dash++;
23
+ if(wpms_dash == 1){
24
+ wpms_dash_newcontent();
25
+ }
26
+ }
27
  });
28
 
29
+ function wpms_dash_newcontent(){
30
+ $.ajax({
31
+ url: ajaxurl,
32
+ method: 'POST',
33
+ dataType: 'json',
34
+ data: {
35
+ action: 'wpms_dash_newcontent',
36
+ },
37
+ success: function (res) {
38
+ $('.wpms_dash_newcontent').html(null);
39
+ $('.wpms_dash_newcontent').html(res);
40
+ $('.dial-warning').knob({
41
+ readOnly: true,
42
+ width: '70px',
43
+ bgColor: '#259CAB',
44
+ fgColor: '#fff',
45
+ inputColor: '#fff'
46
+ });
47
+ wpms_dash++;
48
+ if(wpms_dash == 2){
49
+ wpms_dash_linkmeta();
50
+ }
51
+ }
52
+ });
53
+ }
54
 
55
+ function wpms_dash_linkmeta(){
56
+ $.ajax({
57
+ url: ajaxurl,
58
+ method: 'POST',
59
+ dataType: 'json',
60
+ data: {
61
+ action: 'wpms_dash_linkmeta',
62
+ },
63
+ success: function (res) {
64
+ $('.wpms_dash_linkmeta').html(null);
65
+ $('.wpms_dash_linkmeta').html(res);
66
+ wpms_knob();
67
+ wpms_dash++;
68
+ if(wpms_dash == 3){
69
+ wpms_dash_metatitle();
70
+ }
71
+ }
72
+ });
73
+ }
74
 
75
+ function wpms_dash_metatitle(){
76
+ $.ajax({
77
+ url: ajaxurl,
78
+ method: 'POST',
79
+ dataType: 'json',
80
+ data: {
81
+ action: 'wpms_dash_metatitle',
82
+ },
83
+ success: function (res) {
84
+ $('.wpms_dash_metatitle').html(null);
85
+ $('.wpms_dash_metatitle').html(res);
86
+ wpms_knob();
87
+ wpms_dash++;
88
+ if(wpms_dash == 4){
89
+ wpms_dash_imagemeta(1,0,0,0);
90
+ }
91
+ }
92
+ });
93
+ }
94
+
95
+ function wpms_dash_imagemeta(page,imgs_statis,imgs_meta,imgs_count){
96
+ $.ajax({
97
+ url: ajaxurl,
98
+ method: 'POST',
99
+ dataType: 'json',
100
+ data: {
101
+ action: 'wpms_dash_imgsmeta',
102
+ page : page,
103
+ imgs_statis : imgs_statis,
104
+ imgs_metas_statis : imgs_meta,
105
+ imgs_count : imgs_count
106
+ },
107
+ success: function (res) {
108
+ if(typeof res.status == "undefined"){
109
+ wpms_dash_imagemeta(page+1 , res.imgs_statis[0] , res.imgs_metas_statis[0] , res.imgs_count);
110
+ }else{
111
+ $('.wpms_dash_imgsresize').html(null);
112
+ $('.wpms_dash_imgsresize').html(res.html_imgresize);
113
+
114
+ $('.wpms_dash_imgsmeta').html(null);
115
+ $('.wpms_dash_imgsmeta').html(res.html_imgsmeta);
116
+ wpms_knob();
117
+
118
+ wpms_dash++;
119
+ if(wpms_dash == 5){
120
+ wpms_dash_metadesc();
121
+ }
122
+ }
123
+ }
124
+ });
125
+ }
126
+
127
+ function wpms_dash_metadesc(){
128
+ $.ajax({
129
+ url: ajaxurl,
130
+ method: 'POST',
131
+ dataType: 'json',
132
+ data: {
133
+ action: 'wpms_dash_metadesc',
134
+ },
135
+ success: function (res) {
136
+ $('.wpms_dash_metadesc').html(null);
137
+ $('.wpms_dash_metadesc').html(res);
138
+ wpms_knob();
139
+ }
140
+ });
141
+ }
142
+
143
+
144
+ function wpms_knob(){
145
+ $('.dial-success').knob({
146
+ readOnly: true,
147
+ width: '70px',
148
+ bgColor: '#E7E9EE',
149
+ fgColor: '#259CAB',
150
+ inputColor: '#262B36'
151
+ });
152
+
153
+ $('.dial-danger').knob({
154
+ readOnly: true,
155
+ width: '70px',
156
+ bgColor: '#E7E9EE',
157
+ fgColor: '#259CAB',
158
+ inputColor: '#262B36'
159
+ });
160
+
161
+ $('.dial-info').knob({
162
+ readOnly: true,
163
+ width: '70px',
164
+ bgColor: '#259CAB',
165
+ fgColor: '#fff',
166
+ inputColor: '#fff'
167
+ });
168
 
169
+ $('.dial-warning').knob({
170
+ readOnly: true,
171
+ width: '70px',
172
+ bgColor: '#259CAB',
173
+ fgColor: '#fff',
174
+ inputColor: '#fff'
175
+ });
176
+ }
177
+ wpms_knob();
178
  jQuery('.metaseo_tool').qtip({
179
  content: {
180
  attr: 'alt'
js/metaseo_admin.js CHANGED
@@ -187,39 +187,39 @@ function wpms_scan_link($this) {
187
  if (res.status == false) {
188
 
189
  if (res.type == 'limit') {
190
- var wpmf_process = jQuery('.wpmf_process').data('w');
191
- var wpmf_process_new = parseFloat(wpmf_process) + parseFloat(res.percent);
192
- if (wpmf_process_new > 100)
193
- wpmf_process_new = 100;
194
- jQuery('.wpmf_process').data('w', wpmf_process_new);
195
- jQuery('.wpmf_process').css('width', wpmf_process_new + '%').show();
196
  $this.click();
197
  } else if (res.type == 'limit_comment_content') {
198
- var wpmf_process = jQuery('.wpmf_process').data('w');
199
- if (wpmf_process < 33.33)
200
- wpmf_process = 33.33;
201
- var wpmf_process_new = parseFloat(wpmf_process) + parseFloat(res.percent);
202
- if (wpmf_process_new > 100)
203
- wpmf_process_new = 100;
204
- jQuery('.wpmf_process').data('w', wpmf_process_new);
205
- jQuery('.wpmf_process').css('width', wpmf_process_new + '%').show();
206
  $this.data('comment_paged', parseInt(res.paged) + 1);
207
  $this.click();
208
  } else {
209
- var wpmf_process = jQuery('.wpmf_process').data('w');
210
- if (wpmf_process < 66.66)
211
- wpmf_process = 66.66;
212
- var wpmf_process_new = parseFloat(wpmf_process) + parseFloat(res.percent);
213
- if (wpmf_process_new > 100)
214
- wpmf_process_new = 100;
215
- jQuery('.wpmf_process').data('w', wpmf_process_new);
216
- jQuery('.wpmf_process').css('width', wpmf_process_new + '%').show();
217
  $this.data('paged', parseInt(res.paged) + 1);
218
  $this.click();
219
  }
220
  } else {
221
- jQuery('.wpmf_process').data('w', 100);
222
- jQuery('.wpmf_process').css('width', '100%');
223
  jQuery('#wp-seo-meta-form .spinner').hide();
224
  if ($this.hasClass('page_link_meta')) {
225
  jQuery('.spinner_apply_follow').hide();
@@ -901,7 +901,6 @@ jQuery(document).ready(function ($) {
901
  var savedInfo = $(this).parent().find('span.saved-info');
902
  var iname = validateiName($(this).val());
903
  var msg = iname.msg;
904
- console.log(iname);
905
  if (iname.name.length > 0) {
906
  if (!checkspecial(this)) {
907
  msg = 'Should not special char';
187
  if (res.status == false) {
188
 
189
  if (res.type == 'limit') {
190
+ var wpms_process = jQuery('.wpms_process').data('w');
191
+ var wpms_process_new = parseFloat(wpms_process) + parseFloat(res.percent);
192
+ if (wpms_process_new > 100)
193
+ wpms_process_new = 100;
194
+ jQuery('.wpms_process').data('w', wpms_process_new);
195
+ jQuery('.wpms_process').css('width', wpms_process_new + '%').show();
196
  $this.click();
197
  } else if (res.type == 'limit_comment_content') {
198
+ var wpms_process = jQuery('.wpms_process').data('w');
199
+ if (wpms_process < 33.33)
200
+ wpms_process = 33.33;
201
+ var wpms_process_new = parseFloat(wpms_process) + parseFloat(res.percent);
202
+ if (wpms_process_new > 100)
203
+ wpms_process_new = 100;
204
+ jQuery('.wpms_process').data('w', wpms_process_new);
205
+ jQuery('.wpms_process').css('width', wpms_process_new + '%').show();
206
  $this.data('comment_paged', parseInt(res.paged) + 1);
207
  $this.click();
208
  } else {
209
+ var wpms_process = jQuery('.wpms_process').data('w');
210
+ if (wpms_process < 66.66)
211
+ wpms_process = 66.66;
212
+ var wpms_process_new = parseFloat(wpms_process) + parseFloat(res.percent);
213
+ if (wpms_process_new > 100)
214
+ wpms_process_new = 100;
215
+ jQuery('.wpms_process').data('w', wpms_process_new);
216
+ jQuery('.wpms_process').css('width', wpms_process_new + '%').show();
217
  $this.data('paged', parseInt(res.paged) + 1);
218
  $this.click();
219
  }
220
  } else {
221
+ jQuery('.wpms_process').data('w', 100);
222
+ jQuery('.wpms_process').css('width', '100%');
223
  jQuery('#wp-seo-meta-form .spinner').hide();
224
  if ($this.hasClass('page_link_meta')) {
225
  jQuery('.spinner_apply_follow').hide();
901
  var savedInfo = $(this).parent().find('span.saved-info');
902
  var iname = validateiName($(this).val());
903
  var msg = iname.msg;
 
904
  if (iname.name.length > 0) {
905
  if (!checkspecial(this)) {
906
  msg = 'Should not special char';
js/metaseo_sitemap.js CHANGED
@@ -10,6 +10,17 @@
10
  perPage: 100,
11
  delay: 20
12
  });
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  /*
15
  * Paging list pages in sitemap settings
@@ -54,6 +65,20 @@
54
  wpms_save_create_sitemaps = function () {
55
  $('.spinner_save_sitemaps').css({'visibility': 'visible'}).show();
56
  var posts = {}, pages = {}, menus = {}, taxonomies = [], columns_menu = {}, wpms_category_link = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  $(".wpms_xmap_posts").each(function (i, v) {
58
  if ($(v).is(':checked')) {
59
  var id = $(v).val();
@@ -116,30 +141,38 @@
116
  columns_menu[menu_id] = $(v).val()
117
  });
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  $.ajax({
120
  url: ajaxurl,
121
  method: 'POST',
122
  dataType: 'json',
123
- data: {
124
- action: 'wpms_save_sitemap_settings',
125
- wpms_sitemap_posts: JSON.stringify(posts),
126
- wpms_sitemap_pages: JSON.stringify(pages),
127
- wpms_sitemap_menus: JSON.stringify(menus),
128
- wpms_html_sitemap_page: $('#wpms_html_sitemap_page').val(),
129
- wpms_html_sitemap_column: $('#wpms_html_sitemap_column').val(),
130
- wpms_html_sitemap_position: $('#wpms_html_sitemap_position').val(),
131
- wpms_check_firstsave: $('#wpms_check_firstsave').val(),
132
- wpms_sitemap_author: wpms_sitemap_author,
133
- wpms_sitemap_root: wpms_sitemap_root,
134
- wpms_sitemap_add: wpms_sitemap_add,
135
- wpms_category_link: wpms_category_link,
136
- wpms_sitemap_taxonomies: taxonomies,
137
- wpms_public_name_posts: $('.public_name_posts').val(),
138
- wpms_public_name_pages: $('.public_name_pages').val(),
139
- wpms_display_column_menus: JSON.stringify(columns_menu),
140
- wpms_display_column_posts: $('.wpms_display_column_posts').val(),
141
- wpms_display_column_pages: $('.wpms_display_column_pages').val()
142
- },
143
  success: function (res) {
144
  wpms_regen_sitemaps();
145
  }
10
  perPage: 100,
11
  delay: 20
12
  });
13
+
14
+ $.each(wpmseositemap.post_type,function(i,v){
15
+ $(".holder_"+v).jPages({
16
+ containerID: "wrap_sitemap_option_"+v,
17
+ previous: "←",
18
+ next: "→",
19
+ perPage: 100,
20
+ delay: 20
21
+ });
22
+ });
23
+
24
 
25
  /*
26
  * Paging list pages in sitemap settings
65
  wpms_save_create_sitemaps = function () {
66
  $('.spinner_save_sitemaps').css({'visibility': 'visible'}).show();
67
  var posts = {}, pages = {}, menus = {}, taxonomies = [], columns_menu = {}, wpms_category_link = [];
68
+ var custom_post_type = {};
69
+ $.each(wpmseositemap.post_type,function(i,post_type){
70
+ custom_post_type[post_type] = {};
71
+ $(".wpms_xmap_"+post_type).each(function (i, v) {
72
+ if ($(v).is(':checked')) {
73
+ var id = $(v).val();
74
+ var cat_id = $(v).data('category');
75
+ var priority = $('#priority_'+post_type+'_' + id).val();
76
+ var frequency = $('#frequency_'+post_type+'_' + id).val();
77
+ custom_post_type[post_type][cat_id + '-' + id] = {'post_id': id, 'priority': priority, 'frequency': frequency};
78
+ }
79
+ });
80
+ });
81
+
82
  $(".wpms_xmap_posts").each(function (i, v) {
83
  if ($(v).is(':checked')) {
84
  var id = $(v).val();
141
  columns_menu[menu_id] = $(v).val()
142
  });
143
 
144
+ var datas = {
145
+ action: 'wpms_save_sitemap_settings',
146
+ wpms_sitemap_posts: JSON.stringify(posts),
147
+ wpms_sitemap_pages: JSON.stringify(pages),
148
+ wpms_sitemap_menus: JSON.stringify(menus),
149
+ wpms_html_sitemap_page: $('#wpms_html_sitemap_page').val(),
150
+ wpms_html_sitemap_column: $('#wpms_html_sitemap_column').val(),
151
+ wpms_html_sitemap_position: $('#wpms_html_sitemap_position').val(),
152
+ wpms_check_firstsave: $('#wpms_check_firstsave').val(),
153
+ wpms_sitemap_author: wpms_sitemap_author,
154
+ wpms_sitemap_root: wpms_sitemap_root,
155
+ wpms_sitemap_add: wpms_sitemap_add,
156
+ wpms_category_link: wpms_category_link,
157
+ wpms_sitemap_taxonomies: taxonomies,
158
+ wpms_public_name_posts: $('.public_name_posts').val(),
159
+ wpms_public_name_pages: $('.public_name_pages').val(),
160
+ wpms_display_column_menus: JSON.stringify(columns_menu),
161
+ wpms_display_column_posts: $('.wpms_display_column_posts').val(),
162
+ wpms_display_column_pages: $('.wpms_display_column_pages').val()
163
+ };
164
+
165
+ $.each(wpmseositemap.post_type,function(i,post_type){
166
+ datas['wpms_sitemap_'+post_type] = JSON.stringify(custom_post_type[post_type]);
167
+ datas['wpms_display_column_'+post_type] = $('.wpms_display_column_'+post_type).val();
168
+ datas['wpms_public_name_'+post_type] = $('.public_name_'+post_type).val();
169
+ });
170
+
171
  $.ajax({
172
  url: ajaxurl,
173
  method: 'POST',
174
  dataType: 'json',
175
+ data: datas,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  success: function (res) {
177
  wpms_regen_sitemaps();
178
  }
js/site-jPages.js CHANGED
@@ -11,7 +11,17 @@
11
  perPage: 50,
12
  delay: 20
13
  });
14
-
 
 
 
 
 
 
 
 
 
 
15
  /*
16
  * Paging list posts
17
  */
11
  perPage: 50,
12
  delay: 20
13
  });
14
+
15
+ $.each(wpms_avarible.post_type,function(i,v){
16
+ $(".holder_sitemaps_"+v).jPages({
17
+ containerID: "sitemap_"+v,
18
+ previous: "←",
19
+ next: "→",
20
+ perPage: 50,
21
+ delay: 20
22
+ });
23
+ });
24
+
25
  /*
26
  * Paging list posts
27
  */
js/wpms-broken-link.js CHANGED
@@ -1,220 +1,298 @@
1
  jQuery(document).ready(function ($) {
2
- var correctedURL;
3
- $('.wpms-link-url-field').on('keyup', function () {
4
- var url = $.trim($(this).val());
5
- if (url && correctedURL !== url && !/^(?:[a-z]+:|#|\?|\.|\/)/.test(url)) {
6
- $(this).val('http://' + url);
7
- correctedURL = url;
8
- }
9
- });
10
-
11
- /*
12
- * Scan all link in posts , pages and comments
13
- */
14
- $('.wpms_scan_link').on('click', function () {
15
- var $this = $(this);
16
- wpms_scan_link($this);
17
- });
18
 
19
- $('.wpms_flush_link').on('click', function () {
20
- var $this = $(this);
21
- var flush_val = $('#filter-by-flush').val();
22
- if (flush_val != 'none') {
23
- $('#wp-seo-meta-form .spinner').css('visibility', 'visible').show();
24
- $.ajax({
25
- url: ajaxurl,
26
- method: 'POST',
27
- dataType: 'json',
28
- data: {
29
- 'action': 'wpms_flush_link',
30
- 'type': $('#filter-by-flush').val()
31
- },
32
- success: function (res) {
33
- $('#wp-seo-meta-form .spinner').hide();
34
- window.location.assign(document.URL);
35
- }
36
- });
37
- }
38
- });
39
 
40
- /*
41
- * Edit a link
42
- */
43
- $('.wpms-edit-button').on('click', function () {
44
- $(this).closest('td').find('.wpms-inline-editor-content').show();
45
- });
46
-
47
- /*
48
- * Cancel edit link
49
- */
50
- $('.wpms-cancel-button').on('click', function () {
51
- $(this).closest('td').find('.wpms-inline-editor-content').hide();
52
- });
53
-
54
- /*
55
- * Update a link
56
- */
57
- $('.wpms-update-link-button').on('click', function () {
58
- var $this = $(this);
59
- var link_id = $this.data('link_id');
60
- var new_link = $this.closest('td').find('.wpms-link-url-field').val();
61
- var new_text = $this.closest('td').find('.wpms-link-text-field').val();
62
- var link_redirect = $this.closest('td').find('.wpms-link-redirect-field').val();
63
- var data_type = $this.closest('td').find('.wpms-link-text-field').data('type');
64
- if (new_link == '') {
65
- alert('Error: Link URL must not be empty');
66
- } else {
67
- wpms_update_link($this, link_id, new_link, new_text, link_redirect, data_type);
68
- }
69
- });
70
-
71
- /*
72
- * Remove link
73
- */
74
- $('.wpms-unlink-button').on('click', function () {
75
- var $this = $(this);
76
- var link_id = $this.data('link_id');
77
- wpms_unlink($this, link_id);
78
- });
79
-
80
- /*
81
- * Recheck link
82
- */
83
- $('.wpms-recheck-button').on('click', function () {
84
- var $this = $(this);
85
- var link_id = $this.data('link_id');
86
- wpms_recheck_link($this, link_id);
87
- });
88
-
89
- /*
90
- * Do recheck link
91
- */
92
- function wpms_recheck_link($this, link_id) {
93
- var oldColor = $this.closest('tr').css('background-color');
94
- $this.closest('tr').css({'background-color': "rgba(0, 115, 170, 0.1)"});
95
  $.ajax({
96
  url: ajaxurl,
97
  method: 'POST',
98
  dataType: 'json',
99
  data: {
100
- 'action': 'wpms_recheck_link',
101
- 'link_id': link_id,
102
  },
103
  success: function (res) {
104
- if (res.status) {
105
- var status = res.status_text;
106
- if (status.indexOf('404') != -1 || status == 'Server Not Found') {
107
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_warning metaseo_help_status" alt="404 error, not found">warning</i>');
108
- } else if (status.indexOf('200') != -1) {
109
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Link is OK">done</i>');
110
- } else if (status.indexOf('301') != -1) {
111
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Permanent redirect">done</i>');
112
- } else if (status.indexOf('302') != -1) {
113
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Moved temporarily">done</i>');
114
- } else {
115
- $this.closest('tr').find('.col_status').html(res.status_text);
116
- }
117
- wpms_tooltip();
118
- $this.closest('tr').css({'background-color': oldColor});
119
- }
120
  }
121
  });
122
  }
 
123
 
124
- /*
125
- * Do remove link
126
- */
127
- function wpms_unlink($this, link_id) {
128
- $this.closest('tr').css({'background-color': "rgba(0, 115, 170, 0.1)"});
129
- $.ajax({
130
- url: ajaxurl,
131
- method: 'POST',
132
- dataType: 'json',
133
- data: {
134
- 'action': 'wpms_unlink',
135
- 'link_id': link_id,
136
- },
137
- success: function (res) {
138
- if (res) {
139
- $this.closest('tr').remove();
140
- }
141
- }
142
- });
143
  }
144
 
145
- /*
146
- * Do update link
147
- */
148
- function wpms_update_link($this, link_id, new_link, new_text, link_redirect, data_type) {
 
 
 
 
 
 
 
 
149
  $.ajax({
150
  url: ajaxurl,
151
  method: 'POST',
152
  dataType: 'json',
153
  data: {
154
- 'action': 'wpms_update_link',
155
- 'link_id': link_id,
156
  'new_link': new_link,
157
  'new_text': new_text,
158
  'link_redirect': link_redirect,
159
- 'data_type': data_type
 
160
  },
161
  success: function (res) {
162
- if (res.status) {
163
- $this.closest('td').find('.wpms-inline-editor-content').hide();
164
- //if(res.type != '404_automaticaly'){
165
- $this.closest('td').find('.link_html').html(res.new_link).attr('href', res.new_link);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  $this.closest('tr').find('.col_status').html(res.status_text);
 
 
 
 
 
 
 
167
 
168
- var status = res.status_text;
169
- if (status.indexOf('404') != -1 || status == 'Server Not Found') {
170
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_warning metaseo_help_status" alt="404 error, not found">warning</i>');
171
- } else if (status.indexOf('200') != -1) {
172
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Link is OK">done</i>');
173
- } else if (status.indexOf('301') != -1) {
174
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Permanent redirect">done</i>');
175
- } else if (status.indexOf('302') != -1) {
176
- $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Moved temporarily">done</i>');
177
- } else {
178
- $this.closest('tr').find('.col_status').html(res.status_text);
179
- }
180
- wpms_tooltip();
181
- //}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
- if (res.type == 'url') {
184
- if (res.new_text != '') {
185
- $this.closest('tr').find('.link_text').html(new_text);
186
- }
187
  }
188
  }
189
  }
190
- });
191
- }
192
-
193
- /*
194
- * Opem qtip
195
- */
196
- function wpms_tooltip() {
197
- jQuery('.metaseo_help_status').qtip({
198
- content: {
199
- attr: 'alt'
200
- },
201
- position: {
202
- my: 'bottom left',
203
- at: 'top center'
204
- },
205
- style: {
206
- tip: {
207
- corner: true
208
- },
209
- classes: 'metaseo-qtip qtip-rounded'
210
  },
211
- show: 'hover',
212
- hide: {
213
- fixed: true,
214
- delay: 500
215
- }
 
 
216
 
217
- });
218
- }
219
- wpms_tooltip();
220
- });
 
1
  jQuery(document).ready(function ($) {
2
+ var broken_linkId = 0;
3
+ var correctedURL;
4
+ $('.wpms-link-url-field,.custom_redirect_url_redirect').on('keyup', function () {
5
+ var url = $.trim($(this).val());
6
+ if (url && correctedURL !== url && !/^(?:[a-z]+:|#|\?|\.|\/)/.test(url)) {
7
+ $(this).val('http://' + url);
8
+ correctedURL = url;
9
+ }
10
+ });
 
 
 
 
 
 
 
11
 
12
+ /*
13
+ * Scan all link in posts , pages and comments
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 () {
21
+ var $this = $(this);
22
+ var flush_val = $('#filter-by-flush').val();
23
+ if (flush_val != 'none') {
24
+ $('#wp-seo-meta-form .spinner').css('visibility', 'visible').show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  $.ajax({
26
  url: ajaxurl,
27
  method: 'POST',
28
  dataType: 'json',
29
  data: {
30
+ 'action': 'wpms_flush_link',
31
+ 'type': $('#filter-by-flush').val()
32
  },
33
  success: function (res) {
34
+ $('#wp-seo-meta-form .spinner').hide();
35
+ window.location.assign(document.URL);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
  });
38
  }
39
+ });
40
 
41
+ // show , hide custom redirect form
42
+ $('.wpms_add_custom_redirect').on('click', function () {
43
+ $('.wpms_add_custom_redirect').removeClass('active');
44
+ $(this).addClass('active');
45
+ if ($('.custom_redirect_editor_content').hasClass('show')) {
46
+ $('.custom_redirect_editor_content').removeClass('show');
47
+ } else {
48
+ $('.custom_redirect_editor_content').addClass('show');
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
 
51
+ });
52
+
53
+ $('.btn_add_redirect').on('click', function () {
54
+ var new_link = $('.custom_redirect_url').val();
55
+ var status_link = $('.custom_redirect_status').val();
56
+ var new_text = '(None)';
57
+ var link_redirect = $('.custom_redirect_url_redirect').val();
58
+ var type = $('.wpms_add_custom_redirect.active').data('type');
59
+
60
+ if (new_link == '') {
61
+ alert('Error: Link URL must not be empty');
62
+ } else {
63
  $.ajax({
64
  url: ajaxurl,
65
  method: 'POST',
66
  dataType: 'json',
67
  data: {
68
+ 'action': 'wpms_add_custom_redirect',
 
69
  'new_link': new_link,
70
  'new_text': new_text,
71
  'link_redirect': link_redirect,
72
+ 'status_link_redirect': status_link,
73
+ 'type' : type
74
  },
75
  success: function (res) {
76
+ if (res.status == false) {
77
+ alert(res.message);
78
+ } else {
79
+ window.location.assign(document.URL);
80
+ }
81
+ }
82
+ });
83
+ }
84
+ });
85
+
86
+ $('.wpms-inline-editor-content #link-btn').on('click', function () {
87
+ broken_linkId = $(this).closest('tr').data('linkid');
88
+ if (typeof wpLink != "undefined") {
89
+ wpLink.open('link-btn');
90
+ /* Bind to open link editor! */
91
+ $('#wp-link-backdrop').show();
92
+ $('#wp-link-wrap').show();
93
+ $('#url-field,#wp-link-url').closest('div').find('span').html('Link To');
94
+ $('#link-title-field').closest('div').hide();
95
+ $('.wp-link-text-field').hide();
96
+
97
+ $('#url-field,#wp-link-url').val($('.compat-field-wpms_gallery_custom_image_link input.text').val());
98
+ if ($('.compat-field-gallery_link_target select').val() == '_blank') {
99
+ $('#link-target-checkbox,#wp-link-target').prop('checked', true);
100
+ } else {
101
+ $('#link-target-checkbox,#wp-link-target').prop('checked', false);
102
+ }
103
+ }
104
+ });
105
+
106
+ $('#wp-link-submit').on('click', function () {
107
+ var broken_link = $('#wp-link-url').val();
108
+ $('.metaseo_images tr[data-linkid="'+ broken_linkId +'"]').find('.wpms-link-redirect-field').val(broken_link);
109
+ });
110
+
111
+ /*
112
+ * Edit a link
113
+ */
114
+ $('.wpms-edit-button').on('click', function () {
115
+ $(this).closest('td').find('.wpms-inline-editor-content').show();
116
+ });
117
+
118
+ /*
119
+ * Cancel edit link
120
+ */
121
+ $('.wpms-cancel-button').on('click', function () {
122
+ $(this).closest('td').find('.wpms-inline-editor-content').hide();
123
+ });
124
+
125
+ $('.custom_redirect_editor_content .wpms-cancel-button').on('click', function () {
126
+ $('.custom_redirect_editor_content').removeClass('show');
127
+ });
128
+
129
+ /*
130
+ * Update a link
131
+ */
132
+ $('.wpms-update-link-button').on('click', function () {
133
+ var $this = $(this);
134
+ var link_id = $this.data('link_id');
135
+ var new_link = $this.closest('td').find('.wpms-link-url-field').val();
136
+ var status_redirect = $this.closest('td').find('.custom_redirect_status').val();
137
+ var new_text = $this.closest('td').find('.wpms-link-text-field').val();
138
+ var link_redirect = $this.closest('td').find('.wpms-link-redirect-field').val();
139
+ var data_type = $this.closest('td').find('.wpms-link-text-field').data('type');
140
+ if (new_link == '') {
141
+ alert('Error: Link URL must not be empty');
142
+ } else {
143
+ wpms_update_link($this, link_id, new_link, new_text, link_redirect, data_type,status_redirect);
144
+ }
145
+ });
146
+
147
+ /*
148
+ * Remove link
149
+ */
150
+ $('.wpms-unlink-button').on('click', function () {
151
+ var $this = $(this);
152
+ var link_id = $this.data('link_id');
153
+ wpms_unlink($this, link_id);
154
+ });
155
+
156
+ /*
157
+ * Recheck link
158
+ */
159
+ $('.wpms-recheck-button').on('click', function () {
160
+ var $this = $(this);
161
+ var link_id = $this.data('link_id');
162
+ wpms_recheck_link($this, link_id);
163
+ });
164
+
165
+ /*
166
+ * Do recheck link
167
+ */
168
+ function wpms_recheck_link($this, link_id) {
169
+ var oldColor = $this.closest('tr').css('background-color');
170
+ $this.closest('tr').css({'background-color': "rgba(0, 115, 170, 0.1)"});
171
+ $.ajax({
172
+ url: ajaxurl,
173
+ method: 'POST',
174
+ dataType: 'json',
175
+ data: {
176
+ 'action': 'wpms_recheck_link',
177
+ 'link_id': link_id,
178
+ },
179
+ success: function (res) {
180
+ if (res.status) {
181
+ var status = res.status_text;
182
+ if (status.indexOf('404') != -1 || status == 'Server Not Found') {
183
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_warning metaseo_help_status" alt="404 error, not found">warning</i>');
184
+ } else if (status.indexOf('200') != -1) {
185
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Link is OK">done</i>');
186
+ } else if (status.indexOf('301') != -1) {
187
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Permanent redirect">done</i>');
188
+ } else if (status.indexOf('302') != -1) {
189
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Moved temporarily">done</i>');
190
+ } else {
191
  $this.closest('tr').find('.col_status').html(res.status_text);
192
+ }
193
+ wpms_tooltip();
194
+ $this.closest('tr').css({'background-color': oldColor});
195
+ }
196
+ }
197
+ });
198
+ }
199
 
200
+ /*
201
+ * Do remove link
202
+ */
203
+ function wpms_unlink($this, link_id) {
204
+ $this.closest('tr').css({'background-color': "rgba(0, 115, 170, 0.1)"});
205
+ $.ajax({
206
+ url: ajaxurl,
207
+ method: 'POST',
208
+ dataType: 'json',
209
+ data: {
210
+ 'action': 'wpms_unlink',
211
+ 'link_id': link_id,
212
+ },
213
+ success: function (res) {
214
+ if (res) {
215
+ $this.closest('tr').remove();
216
+ }
217
+ }
218
+ });
219
+ }
220
+
221
+ /*
222
+ * Do update link
223
+ */
224
+ function wpms_update_link($this, link_id, new_link, new_text, link_redirect, data_type,status_redirect) {
225
+ $.ajax({
226
+ url: ajaxurl,
227
+ method: 'POST',
228
+ dataType: 'json',
229
+ data: {
230
+ 'action': 'wpms_update_link',
231
+ 'link_id': link_id,
232
+ 'new_link': new_link,
233
+ 'new_text': new_text,
234
+ 'link_redirect': link_redirect,
235
+ 'data_type': data_type,
236
+ 'status_redirect': status_redirect
237
+ },
238
+ success: function (res) {
239
+ if (res.status) {
240
+ $this.closest('td').find('.wpms-inline-editor-content').hide();
241
+ //if(res.type != '404_automaticaly'){
242
+ $this.closest('td').find('.link_html').html(res.new_link).attr('href', res.new_link);
243
+ $this.closest('tr').find('.col_status').html(res.status_text);
244
+
245
+ var status = res.status_text;
246
+ if (status.indexOf('404') != -1 || status == 'Server Not Found') {
247
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_warning metaseo_help_status" alt="404 error, not found">warning</i>');
248
+ } else if (status.indexOf('200') != -1) {
249
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Link is OK">done</i>');
250
+ } else if (status.indexOf('301') != -1) {
251
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Permanent redirect">done</i>');
252
+ } else if (status.indexOf('302') != -1) {
253
+ $this.closest('tr').find('.col_status').html('<i class="material-icons wpms_ok metaseo_help_status" alt="Moved temporarily">done</i>');
254
+ } else {
255
+ $this.closest('tr').find('.col_status').html(res.status_text);
256
+ }
257
+ wpms_tooltip();
258
+ //}
259
 
260
+ if (res.type == 'url') {
261
+ if (res.new_text != '') {
262
+ $this.closest('tr').find('.link_text').html(new_text);
 
263
  }
264
  }
265
  }
266
+ }
267
+ });
268
+ }
269
+
270
+ /*
271
+ * Open qtip
272
+ */
273
+ function wpms_tooltip() {
274
+ jQuery('.metaseo_help_status').qtip({
275
+ content: {
276
+ attr: 'alt'
277
+ },
278
+ position: {
279
+ my: 'bottom left',
280
+ at: 'top center'
281
+ },
282
+ style: {
283
+ tip: {
284
+ corner: true
 
285
  },
286
+ classes: 'metaseo-qtip qtip-rounded'
287
+ },
288
+ show: 'hover',
289
+ hide: {
290
+ fixed: true,
291
+ delay: 500
292
+ }
293
 
294
+ });
295
+ }
296
+
297
+ wpms_tooltip();
298
+ });
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.7.0
6
- Stable tag: 3.2.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -42,6 +42,7 @@ WP Meta SEO gives you the control over all your meta content and images. Bulk SE
42
  Editing meta information on an existing website can be veeeery long, open each post, edit, close it, open again and almost nobody was doing it. Especially if you need to edit content + image meta.
43
  WP Meta SEO is going to list all posts, pages, custom post types and all images. Type your meta content and fix image size and everything is AJAX saved.
44
  Plus, a bulk copy feature is available to save tons of time in your SEO optimization process:
 
45
  * Content title to All meta titles (optional meta keywords)
46
  * Image name to Image title
47
  * Image name to Image alt
@@ -253,6 +254,10 @@ It could be! if you have a lot of pages that need to be indexed with no specific
253
 
254
  == Changelog ==
255
 
 
 
 
 
256
  = 3.2.3 =
257
  * Fix image resize list does not refresh
258
  * Fix meta image text replaced by image information
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.7.1
6
+ Stable tag: 3.2.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
42
  Editing meta information on an existing website can be veeeery long, open each post, edit, close it, open again and almost nobody was doing it. Especially if you need to edit content + image meta.
43
  WP Meta SEO is going to list all posts, pages, custom post types and all images. Type your meta content and fix image size and everything is AJAX saved.
44
  Plus, a bulk copy feature is available to save tons of time in your SEO optimization process:
45
+
46
  * Content title to All meta titles (optional meta keywords)
47
  * Image name to Image title
48
  * Image name to Image alt
254
 
255
  == Changelog ==
256
 
257
+ = 3.2.4 =
258
+ * WP Meta SEO Addon compatibility
259
+ * Fix conflict with DIVI layout injector plugin
260
+
261
  = 3.2.3 =
262
  * Fix image resize list does not refresh
263
  * Fix meta image text replaced by image information
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.2.3
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
@@ -46,7 +46,7 @@ if (!defined('URL'))
46
  define('URL', get_site_url());
47
 
48
  if (!defined('WPMSEO_VERSION')) {
49
- define('WPMSEO_VERSION', '3.2.2');
50
  }
51
 
52
  if (!defined('WPMS_CLIENTID')) {
@@ -60,6 +60,10 @@ if (!defined('WPMS_CLIENTSECRET')) {
60
  if (!defined('WPMSEO_FILE'))
61
  define('WPMSEO_FILE', __FILE__);
62
 
 
 
 
 
63
  register_activation_hook(__FILE__, array('WpMetaSeo', 'plugin_activation'));
64
 
65
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/class.wp-metaseo.php' );
@@ -87,7 +91,12 @@ if (is_admin()) {
87
 
88
  } else {
89
  /******** Check again and modify title, meta title, meta description before output ********/
90
- add_action('template_redirect', 'buffer_start');
 
 
 
 
 
91
  add_action('wp_head', 'buffer_end');
92
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-front_end.php' );
93
  $GLOBALS['metaseo_front'] = new MetaSeo_Front;
@@ -518,10 +527,10 @@ add_action('template_redirect', 'wpms_template_redirect');
518
  * Redirect 404 url and insert url to database
519
  */
520
  function wpms_template_redirect() {
 
521
  if (is_404()) {
522
  if (isset($_SERVER['REQUEST_URI']))
523
  $url = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
524
- global $wpdb;
525
  $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE (link_url=%s OR link_url=%s)", array($url, esc_url($url)));
526
  $check = $wpdb->get_results($sql);
527
  if (count($check) == 0) {
@@ -536,7 +545,7 @@ function wpms_template_redirect() {
536
  'warning' => 0,
537
  'dismissed' => 0
538
  );
539
-
540
  $wpdb->insert($wpdb->prefix . 'wpms_links', $insert);
541
  } else {
542
  // update url
@@ -548,8 +557,15 @@ function wpms_template_redirect() {
548
  $wpdb->update(
549
  $wpdb->prefix . 'wpms_links', $value, array('id' => $links_broken->id), array('%d'), array('%d')
550
  );
 
551
  if (($url == $links_broken->link_url || esc_url($url) == $links_broken->link_url) && $links_broken->link_url_redirect != '') {
552
- wp_redirect(($links_broken->link_url_redirect));
 
 
 
 
 
 
553
  exit();
554
  }
555
  }
@@ -594,6 +610,32 @@ function wpms_template_redirect() {
594
  }
595
  }
596
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
597
  }
598
 
599
 
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.2.4
8
  * Text Domain: wp-meta-seo
9
  * Domain Path: /languages
10
  * Author: JoomUnited
46
  define('URL', get_site_url());
47
 
48
  if (!defined('WPMSEO_VERSION')) {
49
+ define('WPMSEO_VERSION', '3.2.4');
50
  }
51
 
52
  if (!defined('WPMS_CLIENTID')) {
60
  if (!defined('WPMSEO_FILE'))
61
  define('WPMSEO_FILE', __FILE__);
62
 
63
+ if (!defined('WPMSEO_ADDON_FILENAME')) {
64
+ define('WPMSEO_ADDON_FILENAME', 'wp-meta-seo-addon/wp-meta-seo-addon.php');
65
+ }
66
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
67
  register_activation_hook(__FILE__, array('WpMetaSeo', 'plugin_activation'));
68
 
69
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/class.wp-metaseo.php' );
91
 
92
  } else {
93
  /******** Check again and modify title, meta title, meta description before output ********/
94
+ if(is_plugin_active('divi_layout_injector/divi_layout_injector.php')){
95
+ add_action('get_header', 'buffer_start');
96
+ }else{
97
+ add_action('template_redirect', 'buffer_start');
98
+ }
99
+
100
  add_action('wp_head', 'buffer_end');
101
  require_once( WPMETASEO_PLUGIN_DIR . 'inc/class.metaseo-front_end.php' );
102
  $GLOBALS['metaseo_front'] = new MetaSeo_Front;
527
  * Redirect 404 url and insert url to database
528
  */
529
  function wpms_template_redirect() {
530
+ global $wpdb;
531
  if (is_404()) {
532
  if (isset($_SERVER['REQUEST_URI']))
533
  $url = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
 
534
  $sql = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wpms_links WHERE (link_url=%s OR link_url=%s)", array($url, esc_url($url)));
535
  $check = $wpdb->get_results($sql);
536
  if (count($check) == 0) {
545
  'warning' => 0,
546
  'dismissed' => 0
547
  );
548
+
549
  $wpdb->insert($wpdb->prefix . 'wpms_links', $insert);
550
  } else {
551
  // update url
557
  $wpdb->update(
558
  $wpdb->prefix . 'wpms_links', $value, array('id' => $links_broken->id), array('%d'), array('%d')
559
  );
560
+
561
  if (($url == $links_broken->link_url || esc_url($url) == $links_broken->link_url) && $links_broken->link_url_redirect != '') {
562
+ if($links_broken->type == 'add_custom'){
563
+ $status_redirect = $links_broken->meta_title;
564
+ }else{
565
+ $status_redirect = 302;
566
+ }
567
+ if(empty($status_redirect)) $status_redirect = 302;
568
+ wp_redirect($links_broken->link_url_redirect,$status_redirect);
569
  exit();
570
  }
571
  }
610
  }
611
  }
612
  }
613
+
614
+ // redirect by rule
615
+ if(is_plugin_active(WPMSEO_ADDON_FILENAME)){
616
+ $url = $_SERVER['REQUEST_URI'];
617
+ $matches = false;
618
+ $all_links = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "wpms_links");
619
+ $target = '';
620
+ $status_redirect = 302;
621
+ foreach ($all_links as $link){
622
+ $link->link_url = str_replace('/*','/(.*)',$link->link_url);
623
+ if ((@preg_match( '@'.str_replace( '@', '\\@', $link->link_url ).'@', $url, $matches ) > 0) || (@preg_match( '@'.str_replace( '@', '\\@', $link->link_url ).'@', urldecode( $url ), $matches ) > 0) ) { // Check if our match wants this URL
624
+ $target = $link->link_url_redirect;
625
+ if($link->type == 'add_custom'){
626
+ $status_redirect = $link->meta_title;
627
+ }
628
+ break;
629
+ }
630
+ }
631
+
632
+ if(!empty($target)){
633
+ if(empty($status_redirect)) $status_redirect = 302;
634
+ wp_redirect($target,$status_redirect);
635
+ exit();
636
+ }
637
+ }
638
+
639
  }
640
 
641