Version Description
- Add : Compatible of the SEO checker and ACF fields
- Add : Change meta title and meta description length
- Fix : Conflict image alt info and Elementor builder
- Fix : Default image and priority of meta
- Fix : Conflict with other SEO plugin (WooCommerce Multivendor plugin)
- Fix : Save new term in product category
Download this release
Release Info
Developer | JoomUnited |
Plugin | WP Meta SEO |
Version | 4.0.4 |
Comparing to | |
See all releases |
Code changes from version 4.0.3 to 4.0.4
- assets/css/main.css +4 -0
- assets/js/metaseo_admin.js +3 -3
- assets/js/wp-metaseo-metabox.js +1 -1
- inc/class.metaseo-admin.php +151 -15
- inc/class.metaseo-broken-link-table.php +11 -5
- inc/class.metaseo-content-list-table.php +16 -16
- inc/class.metaseo-dashboard.php +2 -2
- inc/class.metaseo-image-list-table.php +22 -11
- inc/class.metaseo-link-list-table.php +10 -10
- inc/class.metaseo-meta.php +2 -2
- inc/class.metaseo-metabox.php +3 -3
- inc/class.metaseo-opengraph.php +1 -0
- inc/class.metaseo-sitemap.php +9 -41
- inc/google_analytics/tracking/code-universal.php +2 -2
- inc/install-wizard/content/viewGoogleAnalytics.php +1 -1
- inc/install-wizard/content/viewMetaInfos.php +1 -1
- inc/install-wizard/content/viewSocial.php +1 -1
- inc/install-wizard/install-wizard.php +2 -1
- inc/pages/content-meta.php +1 -1
- inc/pages/dashboard.php +12 -6
- inc/pages/google-analytics/menu.php +2 -2
- inc/pages/image-meta.php +1 -1
- inc/pages/link-meta.php +1 -1
- inc/pages/metaseo-broken-link.php +1 -1
- inc/pages/settings.php +17 -17
- inc/pages/settings/image_compression.php +8 -8
- inc/pages/settings/redirections_404.php +3 -3
- inc/pages/sitemaps/metaseo-google-sitemap.php +1 -0
- inc/pages/sitemaps/metaseo-source_menu.php +2 -2
- inc/pages/sitemaps/metaseo-source_pages.php +21 -21
- inc/pages/sitemaps/metaseo-source_posts.php +21 -21
- inc/pages/sitemaps/sitemap_menus.php +2 -2
- languages/wp-meta-seo-en_US.mo +0 -0
- readme.txt +10 -2
- wp-meta-seo.php +7 -6
assets/css/main.css
CHANGED
@@ -752,4 +752,8 @@
|
|
752 |
.wp-meta-seo_page_metaseo_settings .ju-settings-option {
|
753 |
width: 100%;
|
754 |
}
|
|
|
|
|
|
|
|
|
755 |
}
|
752 |
.wp-meta-seo_page_metaseo_settings .ju-settings-option {
|
753 |
width: 100%;
|
754 |
}
|
755 |
+
}
|
756 |
+
|
757 |
+
.tablenav .tablenav-pages .material-icons{
|
758 |
+
vertical-align: middle;
|
759 |
}
|
assets/js/metaseo_admin.js
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
* To change this template file, choose Tools | Templates
|
4 |
* and open the template in the editor.
|
5 |
*/
|
6 |
-
var title_max_len =
|
7 |
-
var desc_max_len =
|
8 |
var keywords_max_len = 256;
|
9 |
var metaseoValueHolder = {};
|
10 |
|
@@ -59,7 +59,7 @@ function metaseo_titlelength(metatitle_id, updateSnippet) {
|
|
59 |
jQuery('#' + counter_id).text(title_max_len - title.length);
|
60 |
if (title.length >= title_max_len) {
|
61 |
jQuery('#' + counter_id).removeClass('word-74B6FC').addClass('word-exceed');//#FEFB04
|
62 |
-
} else if (title.length <=
|
63 |
jQuery('#' + counter_id).removeClass('word-exceed').addClass('word-74B6FC');//#74B6FC
|
64 |
} else {
|
65 |
jQuery('#' + counter_id).removeClass('word-exceed word-74B6FC');
|
3 |
* To change this template file, choose Tools | Templates
|
4 |
* and open the template in the editor.
|
5 |
*/
|
6 |
+
var title_max_len = 60;
|
7 |
+
var desc_max_len = 158;
|
8 |
var keywords_max_len = 256;
|
9 |
var metaseoValueHolder = {};
|
10 |
|
59 |
jQuery('#' + counter_id).text(title_max_len - title.length);
|
60 |
if (title.length >= title_max_len) {
|
61 |
jQuery('#' + counter_id).removeClass('word-74B6FC').addClass('word-exceed');//#FEFB04
|
62 |
+
} else if (title.length <= 50) {
|
63 |
jQuery('#' + counter_id).removeClass('word-exceed').addClass('word-74B6FC');//#74B6FC
|
64 |
} else {
|
65 |
jQuery('#' + counter_id).removeClass('word-exceed word-74B6FC');
|
assets/js/wp-metaseo-metabox.js
CHANGED
@@ -251,7 +251,7 @@ function metaseo_status_length(len, id, number) {
|
|
251 |
var check = 0;
|
252 |
var mclass = '';
|
253 |
if (id === '#metaseo_wpmseo_title-length') {
|
254 |
-
num =
|
255 |
check = wpmseoMetaboxL10n.wpmseo_meta_title_length - len;
|
256 |
mclass = 'word-74B6FC';
|
257 |
} else if (id === '#metaseo_wpmseo_desc-length') {
|
251 |
var check = 0;
|
252 |
var mclass = '';
|
253 |
if (id === '#metaseo_wpmseo_title-length') {
|
254 |
+
num = 50;
|
255 |
check = wpmseoMetaboxL10n.wpmseo_meta_title_length - len;
|
256 |
mclass = 'word-74B6FC';
|
257 |
} else if (id === '#metaseo_wpmseo_desc-length') {
|
inc/class.metaseo-admin.php
CHANGED
@@ -20,13 +20,13 @@ class MetaSeoAdmin
|
|
20 |
*
|
21 |
* @var integer
|
22 |
*/
|
23 |
-
public static $desc_length =
|
24 |
/**
|
25 |
* Max length meta title
|
26 |
*
|
27 |
* @var integer
|
28 |
*/
|
29 |
-
public static $title_length =
|
30 |
/**
|
31 |
* Google client
|
32 |
*
|
@@ -283,8 +283,8 @@ class MetaSeoAdmin
|
|
283 |
public function saveCategoryMeta($term_id)
|
284 |
{
|
285 |
global $pagenow;
|
286 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
287 |
-
if ($pagenow === 'edit-tags.php' || (isset($_POST['action'], $_POST['screen']) && $_POST['action'] === 'add-tag' && $_POST['screen'] === 'edit-category')) {
|
288 |
if (empty($_POST['wpms_nonce'])
|
289 |
|| !wp_verify_nonce($_POST['wpms_nonce'], 'wpms_nonce')) {
|
290 |
die();
|
@@ -762,7 +762,7 @@ class MetaSeoAdmin
|
|
762 |
// Disable all admin notice for page belong to plugin
|
763 |
add_action('admin_print_scripts', function () {
|
764 |
global $wp_filter;
|
765 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
766 |
if ((!empty($_GET['page']) && in_array($_GET['page'], array('wpms-setup', 'metaseo_settings','metaseo_console')))) {
|
767 |
if (is_user_admin()) {
|
768 |
if (isset($wp_filter['user_admin_notices'])) {
|
@@ -779,7 +779,7 @@ class MetaSeoAdmin
|
|
779 |
|
780 |
// Setup wizard redirect
|
781 |
if (is_null(get_option('_wpmf_activation_redirect', null)) && is_null(get_option('wpms_version', null))) {
|
782 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
783 |
if ((!empty($_GET['page']) && in_array($_GET['page'], array('wpms-setup')))) {
|
784 |
return;
|
785 |
}
|
@@ -796,9 +796,9 @@ class MetaSeoAdmin
|
|
796 |
*/
|
797 |
public function install()
|
798 |
{
|
799 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
800 |
if (!empty($_GET['page'])) {
|
801 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
802 |
switch ($_GET['page']) {
|
803 |
case 'wpms-setup':
|
804 |
require_once WPMETASEO_PLUGIN_DIR . '/inc/install-wizard/install-wizard.php';
|
@@ -859,6 +859,137 @@ class MetaSeoAdmin
|
|
859 |
return $content;
|
860 |
}
|
861 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
/**
|
863 |
* Ajax load page analysis
|
864 |
*
|
@@ -910,18 +1041,14 @@ class MetaSeoAdmin
|
|
910 |
add_shortcode('mk_fancy_title', 'vc_do_shortcode');
|
911 |
}
|
912 |
|
913 |
-
$content = apply_filters(
|
914 |
-
'the_content',
|
915 |
-
'<div>' . html_entity_decode(stripcslashes($content)) . '</div>',
|
916 |
-
$post_id
|
917 |
-
);
|
918 |
-
|
919 |
$content = apply_filters(
|
920 |
'wpms_the_content',
|
921 |
'<div>' . html_entity_decode(stripcslashes($_POST['datas']['content'])) . '</div>',
|
922 |
$_POST['datas']['post_id']
|
923 |
);
|
924 |
|
|
|
|
|
925 |
if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['heading_title'])) {
|
926 |
$output .= $this->createFieldAnalysis(
|
927 |
'heading_title',
|
@@ -2192,6 +2319,15 @@ class MetaSeoAdmin
|
|
2192 |
array(),
|
2193 |
WPMSEO_VERSION
|
2194 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2195 |
}
|
2196 |
|
2197 |
if ($current_screen->base === 'wp-meta-seo_page_metaseo_better_ranking') {
|
@@ -2751,7 +2887,7 @@ class MetaSeoAdmin
|
|
2751 |
public function loadPage()
|
2752 |
{
|
2753 |
if (isset($_GET['page'])) {
|
2754 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
2755 |
switch ($_GET['page']) {
|
2756 |
case 'metaseo_google_analytics':
|
2757 |
echo "<div class='error wpms_msg_ublock'><p>";
|
20 |
*
|
21 |
* @var integer
|
22 |
*/
|
23 |
+
public static $desc_length = 158;
|
24 |
/**
|
25 |
* Max length meta title
|
26 |
*
|
27 |
* @var integer
|
28 |
*/
|
29 |
+
public static $title_length = 60;
|
30 |
/**
|
31 |
* Google client
|
32 |
*
|
283 |
public function saveCategoryMeta($term_id)
|
284 |
{
|
285 |
global $pagenow;
|
286 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce used in next lines
|
287 |
+
if ($pagenow === 'edit-tags.php' || (isset($_POST['action'], $_POST['screen']) && $_POST['action'] === 'add-tag' && ($_POST['screen'] === 'edit-category' || $_POST['screen'] === 'edit-product_cat'))) {
|
288 |
if (empty($_POST['wpms_nonce'])
|
289 |
|| !wp_verify_nonce($_POST['wpms_nonce'], 'wpms_nonce')) {
|
290 |
die();
|
762 |
// Disable all admin notice for page belong to plugin
|
763 |
add_action('admin_print_scripts', function () {
|
764 |
global $wp_filter;
|
765 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
766 |
if ((!empty($_GET['page']) && in_array($_GET['page'], array('wpms-setup', 'metaseo_settings','metaseo_console')))) {
|
767 |
if (is_user_admin()) {
|
768 |
if (isset($wp_filter['user_admin_notices'])) {
|
779 |
|
780 |
// Setup wizard redirect
|
781 |
if (is_null(get_option('_wpmf_activation_redirect', null)) && is_null(get_option('wpms_version', null))) {
|
782 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View request, no action
|
783 |
if ((!empty($_GET['page']) && in_array($_GET['page'], array('wpms-setup')))) {
|
784 |
return;
|
785 |
}
|
796 |
*/
|
797 |
public function install()
|
798 |
{
|
799 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View request, no action
|
800 |
if (!empty($_GET['page'])) {
|
801 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View request, no action
|
802 |
switch ($_GET['page']) {
|
803 |
case 'wpms-setup':
|
804 |
require_once WPMETASEO_PLUGIN_DIR . '/inc/install-wizard/install-wizard.php';
|
859 |
return $content;
|
860 |
}
|
861 |
|
862 |
+
/**
|
863 |
+
* Get all the values of an array
|
864 |
+
*
|
865 |
+
* @param array $array List array to get value
|
866 |
+
*
|
867 |
+
* @return array|string
|
868 |
+
*/
|
869 |
+
public function getValues($array)
|
870 |
+
{
|
871 |
+
if (is_array($array)) {
|
872 |
+
$array = array_values($array);
|
873 |
+
}
|
874 |
+
|
875 |
+
return $array;
|
876 |
+
}
|
877 |
+
|
878 |
+
/**
|
879 |
+
* Check strpos with list array
|
880 |
+
*
|
881 |
+
* @param string $haystack String to compare
|
882 |
+
* @param array $needle List array need compare
|
883 |
+
* @param integer $offset Offset value
|
884 |
+
*
|
885 |
+
* @return boolean
|
886 |
+
*/
|
887 |
+
public function strPosArray($haystack, $needle, $offset = 0)
|
888 |
+
{
|
889 |
+
if (!is_array($needle)) {
|
890 |
+
$needle = array($needle);
|
891 |
+
}
|
892 |
+
foreach ($needle as $query) {
|
893 |
+
// stop on first true result
|
894 |
+
if (strpos($haystack, $query, $offset) !== false) {
|
895 |
+
return true;
|
896 |
+
}
|
897 |
+
}
|
898 |
+
return false;
|
899 |
+
}
|
900 |
+
|
901 |
+
/**
|
902 |
+
* Recursion to get specific value of file
|
903 |
+
*
|
904 |
+
* @param array $fields List specific value of field
|
905 |
+
*
|
906 |
+
* @return string
|
907 |
+
*/
|
908 |
+
public function getACFData($fields)
|
909 |
+
{
|
910 |
+
$values = $this->getValues($fields);
|
911 |
+
$data = '';
|
912 |
+
|
913 |
+
if (is_array($values)) {
|
914 |
+
foreach ($values as $item) {
|
915 |
+
switch (gettype($item)) {
|
916 |
+
case 'array':
|
917 |
+
$data .= $this->getACFData($item);
|
918 |
+
break;
|
919 |
+
case 'string':
|
920 |
+
// Check link
|
921 |
+
if (filter_var($item, FILTER_VALIDATE_URL)) {
|
922 |
+
$checkImageLink = $this->strPosArray($item, array('.jpg', '.png', '.jpeg', 'svg', 'gif'));
|
923 |
+
if (!$checkImageLink) {
|
924 |
+
$item = '<a href="' . $item . '">' . $item . '</a>';
|
925 |
+
}
|
926 |
+
}
|
927 |
+
$data .= ' ' . $item;
|
928 |
+
break;
|
929 |
+
}
|
930 |
+
}
|
931 |
+
}
|
932 |
+
if (is_string($values)) {
|
933 |
+
$data .= ' '. $values;
|
934 |
+
}
|
935 |
+
return $data;
|
936 |
+
}
|
937 |
+
|
938 |
+
/**
|
939 |
+
* Inject ACF field to content
|
940 |
+
*
|
941 |
+
* @param string $content Post content
|
942 |
+
* @param integer $post_id Post ID
|
943 |
+
*
|
944 |
+
* @return string
|
945 |
+
*/
|
946 |
+
public function injectAcfField($content, $post_id)
|
947 |
+
{
|
948 |
+
if (class_exists('ACF')) {
|
949 |
+
$fields = get_field_objects($post_id);
|
950 |
+
|
951 |
+
if (!empty($fields)) {
|
952 |
+
$inject = '';
|
953 |
+
foreach ($fields as $name => $field) {
|
954 |
+
if ($field['type'] === 'image') {
|
955 |
+
$size = $field['preview_size'];
|
956 |
+
if (is_array($field['value'])) {
|
957 |
+
$caption = $field['value']['caption'];
|
958 |
+
// Get image link if field is array
|
959 |
+
if ($caption) {
|
960 |
+
$inject .= '<div class="wp-caption">';
|
961 |
+
}
|
962 |
+
$inject = '<a href="'.$field['value']['url'].'" title="'.$field['value']['title'].'">';
|
963 |
+
$inject .= '<img src="'.$field['value']['sizes'][ $size ].'" alt="'.$field['value']['alt'].'" width="'.$field['value']['sizes'][ $size . '-width' ].'" height="'.$field['value']['sizes'][ $size . '-height' ].'" />';
|
964 |
+
$inject .= '</a>';
|
965 |
+
if ($caption) {
|
966 |
+
$inject .= '<p class="wp-caption-text">'. $caption.'</p>';
|
967 |
+
}
|
968 |
+
$inject .= '</div>';
|
969 |
+
} elseif (is_string($field['value'])) {
|
970 |
+
$inject = '<img src="'.$field['value'].'" />';
|
971 |
+
} else {
|
972 |
+
$inject = wp_get_attachment_image($field['value'], $size);
|
973 |
+
}
|
974 |
+
} elseif ($field['type'] === 'link') {
|
975 |
+
// Get link if field is array
|
976 |
+
if (is_array($field['value'])) {
|
977 |
+
$inject = '<a class="link-url" href="'.$field['value']['url'].'" target="'.($field['value']['target'] ? $field['value']['target'] : '_self').'">'.esc_html($field['value']['title']).'</a>';
|
978 |
+
} else {
|
979 |
+
$inject = '<a class="link-url" href="'.$field['value'].'">'.esc_html($field['value']).'</a>';
|
980 |
+
}
|
981 |
+
} else {
|
982 |
+
$inject = $this->getACFData($field['value']);
|
983 |
+
}
|
984 |
+
|
985 |
+
$content .= ' '.$inject;
|
986 |
+
}
|
987 |
+
}
|
988 |
+
}
|
989 |
+
|
990 |
+
return $content;
|
991 |
+
}
|
992 |
+
|
993 |
/**
|
994 |
* Ajax load page analysis
|
995 |
*
|
1041 |
add_shortcode('mk_fancy_title', 'vc_do_shortcode');
|
1042 |
}
|
1043 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1044 |
$content = apply_filters(
|
1045 |
'wpms_the_content',
|
1046 |
'<div>' . html_entity_decode(stripcslashes($_POST['datas']['content'])) . '</div>',
|
1047 |
$_POST['datas']['post_id']
|
1048 |
);
|
1049 |
|
1050 |
+
$content = $this->injectAcfField($content, $_POST['datas']['post_id']);
|
1051 |
+
|
1052 |
if (isset($_POST['datas']['first_load']) && !empty($meta_analysis) && !empty($meta_analysis['heading_title'])) {
|
1053 |
$output .= $this->createFieldAnalysis(
|
1054 |
'heading_title',
|
2319 |
array(),
|
2320 |
WPMSEO_VERSION
|
2321 |
);
|
2322 |
+
|
2323 |
+
if (class_exists('MetaSeoAddonAdmin')) {
|
2324 |
+
wp_enqueue_style(
|
2325 |
+
'msaddon-style-dashboard',
|
2326 |
+
WPMETASEO_ADDON_PLUGIN_URL . 'assets/css/dashboard.css',
|
2327 |
+
array(),
|
2328 |
+
WPMSEO_ADDON_VERSION
|
2329 |
+
);
|
2330 |
+
}
|
2331 |
}
|
2332 |
|
2333 |
if ($current_screen->base === 'wp-meta-seo_page_metaseo_better_ranking') {
|
2887 |
public function loadPage()
|
2888 |
{
|
2889 |
if (isset($_GET['page'])) {
|
2890 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
2891 |
switch ($_GET['page']) {
|
2892 |
case 'metaseo_google_analytics':
|
2893 |
echo "<div class='error wpms_msg_ublock'><p>";
|
inc/class.metaseo-broken-link-table.php
CHANGED
@@ -290,7 +290,7 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
|
|
290 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
291 |
$current_url = remove_query_arg('paged', $current_url);
|
292 |
|
293 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
294 |
if (isset($_GET['orderby'])) {
|
295 |
$current_orderby = $_GET['orderby'];
|
296 |
} else {
|
@@ -369,7 +369,7 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
|
|
369 |
{
|
370 |
global $wpdb;
|
371 |
$where = array('1=1');
|
372 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
373 |
$where[] = "type IN ('url', 'comment', '404_automaticaly', 'add_custom')";
|
374 |
$where_or = array();
|
375 |
if (!empty($_REQUEST['sl_broken'])) {
|
@@ -491,7 +491,7 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
|
|
491 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
|
492 |
require_once(WPMETASEO_ADDON_PLUGIN_DIR . 'inc/page/custom_redirect_form.php');
|
493 |
}
|
494 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
495 |
$txtkeyword = (!empty($_REQUEST['txtkeyword'])) ? urldecode(stripslashes($_REQUEST['txtkeyword'])) : '';
|
496 |
if (!empty($_REQUEST['orderby'])) {
|
497 |
echo '<input type="hidden" name="orderby" value="' . esc_attr($_REQUEST['orderby']) . '" />';
|
@@ -541,7 +541,7 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
|
|
541 |
}
|
542 |
$brokens['valid_links'] = esc_html__('Valid links', 'wp-meta-seo');
|
543 |
$brokens['not_yet_redirect'] = esc_html__('Not yet redirected', 'wp-meta-seo');
|
544 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
545 |
if (empty($_REQUEST['sl_broken'])) {
|
546 |
$selected = array('automaticaly_indexed', 'internal_broken_links', 'not_yet_redirect');
|
547 |
} else {
|
@@ -992,7 +992,7 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
|
|
992 |
{
|
993 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
994 |
$redirect = false;
|
995 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
996 |
if (isset($_POST['txtkeyword'])) {
|
997 |
$current_url = add_query_arg(
|
998 |
array(
|
@@ -1423,6 +1423,12 @@ class MetaSeoBrokenLinkTable extends WP_List_Table
|
|
1423 |
global $wpdb;
|
1424 |
$post = $post_after;
|
1425 |
$linkscontent = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
1426 |
if ($post->post_excerpt !== 'metaseo_404_page') {
|
1427 |
if ($post->post_status === 'publish') {
|
1428 |
if (isset($post->post_content) && $post->post_content !== '') {
|
290 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
291 |
$current_url = remove_query_arg('paged', $current_url);
|
292 |
|
293 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
294 |
if (isset($_GET['orderby'])) {
|
295 |
$current_orderby = $_GET['orderby'];
|
296 |
} else {
|
369 |
{
|
370 |
global $wpdb;
|
371 |
$where = array('1=1');
|
372 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
373 |
$where[] = "type IN ('url', 'comment', '404_automaticaly', 'add_custom')";
|
374 |
$where_or = array();
|
375 |
if (!empty($_REQUEST['sl_broken'])) {
|
491 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
|
492 |
require_once(WPMETASEO_ADDON_PLUGIN_DIR . 'inc/page/custom_redirect_form.php');
|
493 |
}
|
494 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
495 |
$txtkeyword = (!empty($_REQUEST['txtkeyword'])) ? urldecode(stripslashes($_REQUEST['txtkeyword'])) : '';
|
496 |
if (!empty($_REQUEST['orderby'])) {
|
497 |
echo '<input type="hidden" name="orderby" value="' . esc_attr($_REQUEST['orderby']) . '" />';
|
541 |
}
|
542 |
$brokens['valid_links'] = esc_html__('Valid links', 'wp-meta-seo');
|
543 |
$brokens['not_yet_redirect'] = esc_html__('Not yet redirected', 'wp-meta-seo');
|
544 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
545 |
if (empty($_REQUEST['sl_broken'])) {
|
546 |
$selected = array('automaticaly_indexed', 'internal_broken_links', 'not_yet_redirect');
|
547 |
} else {
|
992 |
{
|
993 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
994 |
$redirect = false;
|
995 |
+
// phpcs:disable WordPress.Security.NonceVerification.Missing -- No action, nonce is not required
|
996 |
if (isset($_POST['txtkeyword'])) {
|
997 |
$current_url = add_query_arg(
|
998 |
array(
|
1423 |
global $wpdb;
|
1424 |
$post = $post_after;
|
1425 |
$linkscontent = array();
|
1426 |
+
|
1427 |
+
if (isset($post->post_content)) {
|
1428 |
+
$seoClass = new MetaSeoAdmin();
|
1429 |
+
$post->post_content = $seoClass->injectAcfField($post->post_content, $post->ID);
|
1430 |
+
}
|
1431 |
+
|
1432 |
if ($post->post_excerpt !== 'metaseo_404_page') {
|
1433 |
if ($post->post_status === 'publish') {
|
1434 |
if (isset($post->post_content) && $post->post_content !== '') {
|
inc/class.metaseo-content-list-table.php
CHANGED
@@ -44,7 +44,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
44 |
|
45 |
<input type="hidden" name="page" value="metaseo_content_meta"/>
|
46 |
<input type="hidden" name="page" value="metaseo_content_meta"/>
|
47 |
-
<?php // phpcs:disable WordPress.Security.NonceVerification.
|
48 |
?>
|
49 |
<?php if (!empty($_REQUEST['post_status'])) : ?>
|
50 |
<input type="hidden" name="post_status" value="<?php echo esc_attr($_REQUEST['post_status']); ?>"/>
|
@@ -226,7 +226,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
226 |
*/
|
227 |
public function searchBox($text, $input_id)
|
228 |
{
|
229 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
230 |
if (empty($_REQUEST['s']) && !$this->has_items()) {
|
231 |
return;
|
232 |
}
|
@@ -268,7 +268,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
268 |
protected function extra_tablenav($which) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps -- extends from WP_List_Table class
|
269 |
{
|
270 |
echo '<div class="alignleft actions">';
|
271 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
272 |
$selected = !empty($_REQUEST['post_type_filter']) ? $_REQUEST['post_type_filter'] : - 1;
|
273 |
|
274 |
$options = '<option value="-1">Show All Post Types</option>';
|
@@ -283,7 +283,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
283 |
);
|
284 |
}
|
285 |
|
286 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
287 |
$selected_duplicate = !empty($_REQUEST['wpms_duplicate_meta']) ? $_REQUEST['wpms_duplicate_meta'] : 'none';
|
288 |
$options_dups = array(
|
289 |
'none' => esc_html__('All meta information', 'wp-meta-seo'),
|
@@ -306,7 +306,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
306 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)
|
307 |
&& (is_plugin_active('sitepress-multilingual-cms/sitepress.php')
|
308 |
|| is_plugin_active('polylang/polylang.php'))) {
|
309 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
310 |
$lang = !empty($_REQUEST['wpms_lang_list']) ? $_REQUEST['wpms_lang_list'] : '0';
|
311 |
$sl_lang = apply_filters('wpms_get_languagesList', '', $lang);
|
312 |
// phpcs:ignore WordPress.Security.EscapeOutput -- Content escaped in the method MetaSeoAddonAdmin::listLanguageSelect
|
@@ -403,7 +403,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
403 |
{
|
404 |
global $wpdb;
|
405 |
$this->post_types = $this->getPostTypes();
|
406 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
407 |
$post_type = isset($_REQUEST['post_type_filter']) ? $_REQUEST['post_type_filter'] : '';
|
408 |
if ($post_type === '-1') {
|
409 |
$post_type = '';
|
@@ -428,7 +428,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
428 |
$where = array();
|
429 |
$where[] = 'post_type IN (\'' . $post_type . '\')';
|
430 |
$where[] = 'post_status IN (\'' . $all_states . '\')';
|
431 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
432 |
$keyword = !empty($_GET['s']) ? $_GET['s'] : '';
|
433 |
if (isset($keyword) && $keyword !== '') {
|
434 |
$where[] = $wpdb->prepare('(post_title LIKE %s OR mt.meta_value LIKE %s OR md.meta_value LIKE %s)', array(
|
@@ -439,9 +439,9 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
439 |
}
|
440 |
|
441 |
//Order By block
|
442 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
443 |
$orderby = !empty($_GET['orderby']) ? ($_GET['orderby']) : 'post_title';
|
444 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
445 |
$order = !empty($_GET['order']) ? ($_GET['order']) : 'asc';
|
446 |
|
447 |
$sortable = $this->get_sortable_columns();
|
@@ -462,7 +462,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
462 |
$orderStr = ' ORDER BY ' . esc_sql($orderStr) . ' ';
|
463 |
}
|
464 |
|
465 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
466 |
if (isset($_GET['wpms_duplicate_meta']) && $_GET['wpms_duplicate_meta'] !== 'none') {
|
467 |
if ($_GET['wpms_duplicate_meta'] === 'duplicate_title') {
|
468 |
$where[] = 'mt.meta_key = "_metaseo_metatitle" AND mt.meta_value IN (SELECT DISTINCT meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key="_metaseo_metatitle" AND meta_value != "" GROUP BY meta_value HAVING COUNT(*) >= 2)';
|
@@ -488,7 +488,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
488 |
. ' LEFT JOIN (SELECT * FROM ' . $wpdb->postmeta . ' WHERE meta_key = "_metaseo_metakeywords") mk ON mk.post_id = p.ID';
|
489 |
// query post by lang with polylang plugin
|
490 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME) && is_plugin_active('polylang/polylang.php')) {
|
491 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
492 |
if (isset($_GET['wpms_lang_list']) && $_GET['wpms_lang_list'] !== '0') {
|
493 |
$query .= $wpdb->prepare(' INNER JOIN (SELECT * FROM ' . $wpdb->term_relationships . ' as ml
|
494 |
INNER JOIN (SELECT * FROM ' . $wpdb->terms . ' WHERE slug = %s)
|
@@ -499,7 +499,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
499 |
|
500 |
// query post by lang with WPML plugin
|
501 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME) && is_plugin_active('sitepress-multilingual-cms/sitepress.php')) {
|
502 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
503 |
if (isset($_GET['wpms_lang_list']) && $_GET['wpms_lang_list'] !== '0') {
|
504 |
$query .= $wpdb->prepare(' INNER JOIN (SELECT * FROM ' . $wpdb->prefix . 'icl_translations
|
505 |
WHERE element_type LIKE %s AND language_code = %s) t
|
@@ -510,7 +510,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
510 |
|
511 |
$query .= ' WHERE ' . implode(' AND ', $where) . $orderStr;
|
512 |
|
513 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
514 |
if (!empty($_REQUEST['metaseo_posts_per_page'])) {
|
515 |
$_per_page = intval($_REQUEST['metaseo_posts_per_page']);
|
516 |
} else {
|
@@ -532,7 +532,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
532 |
add_user_meta(get_current_user_id(), 'metaseo_posts_per_page', $per_page);
|
533 |
}
|
534 |
|
535 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
536 |
$paged = !empty($_GET['paged']) ? $_GET['paged'] : '';
|
537 |
if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
|
538 |
$paged = 1;
|
@@ -570,7 +570,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
570 |
$records = $this->items;
|
571 |
$i = 0;
|
572 |
$alternate = '';
|
573 |
-
$url = preg_replace('/(http|https):\/\/[w]*[.]?/', '', network_site_url('/'));
|
574 |
|
575 |
list($columns, $hidden) = $this->get_column_info();
|
576 |
|
@@ -765,7 +765,7 @@ class MetaSeoContentListTable extends WP_List_Table
|
|
765 |
{
|
766 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
767 |
$redirect = false;
|
768 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
769 |
if (isset($_POST['post_type_filter'])) {
|
770 |
$current_url = add_query_arg(array('post_type_filter' => $_POST['post_type_filter']), $current_url);
|
771 |
$redirect = true;
|
44 |
|
45 |
<input type="hidden" name="page" value="metaseo_content_meta"/>
|
46 |
<input type="hidden" name="page" value="metaseo_content_meta"/>
|
47 |
+
<?php // phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
48 |
?>
|
49 |
<?php if (!empty($_REQUEST['post_status'])) : ?>
|
50 |
<input type="hidden" name="post_status" value="<?php echo esc_attr($_REQUEST['post_status']); ?>"/>
|
226 |
*/
|
227 |
public function searchBox($text, $input_id)
|
228 |
{
|
229 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
230 |
if (empty($_REQUEST['s']) && !$this->has_items()) {
|
231 |
return;
|
232 |
}
|
268 |
protected function extra_tablenav($which) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps -- extends from WP_List_Table class
|
269 |
{
|
270 |
echo '<div class="alignleft actions">';
|
271 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
272 |
$selected = !empty($_REQUEST['post_type_filter']) ? $_REQUEST['post_type_filter'] : - 1;
|
273 |
|
274 |
$options = '<option value="-1">Show All Post Types</option>';
|
283 |
);
|
284 |
}
|
285 |
|
286 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
287 |
$selected_duplicate = !empty($_REQUEST['wpms_duplicate_meta']) ? $_REQUEST['wpms_duplicate_meta'] : 'none';
|
288 |
$options_dups = array(
|
289 |
'none' => esc_html__('All meta information', 'wp-meta-seo'),
|
306 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)
|
307 |
&& (is_plugin_active('sitepress-multilingual-cms/sitepress.php')
|
308 |
|| is_plugin_active('polylang/polylang.php'))) {
|
309 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
310 |
$lang = !empty($_REQUEST['wpms_lang_list']) ? $_REQUEST['wpms_lang_list'] : '0';
|
311 |
$sl_lang = apply_filters('wpms_get_languagesList', '', $lang);
|
312 |
// phpcs:ignore WordPress.Security.EscapeOutput -- Content escaped in the method MetaSeoAddonAdmin::listLanguageSelect
|
403 |
{
|
404 |
global $wpdb;
|
405 |
$this->post_types = $this->getPostTypes();
|
406 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
407 |
$post_type = isset($_REQUEST['post_type_filter']) ? $_REQUEST['post_type_filter'] : '';
|
408 |
if ($post_type === '-1') {
|
409 |
$post_type = '';
|
428 |
$where = array();
|
429 |
$where[] = 'post_type IN (\'' . $post_type . '\')';
|
430 |
$where[] = 'post_status IN (\'' . $all_states . '\')';
|
431 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
432 |
$keyword = !empty($_GET['s']) ? $_GET['s'] : '';
|
433 |
if (isset($keyword) && $keyword !== '') {
|
434 |
$where[] = $wpdb->prepare('(post_title LIKE %s OR mt.meta_value LIKE %s OR md.meta_value LIKE %s)', array(
|
439 |
}
|
440 |
|
441 |
//Order By block
|
442 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
443 |
$orderby = !empty($_GET['orderby']) ? ($_GET['orderby']) : 'post_title';
|
444 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
445 |
$order = !empty($_GET['order']) ? ($_GET['order']) : 'asc';
|
446 |
|
447 |
$sortable = $this->get_sortable_columns();
|
462 |
$orderStr = ' ORDER BY ' . esc_sql($orderStr) . ' ';
|
463 |
}
|
464 |
|
465 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
466 |
if (isset($_GET['wpms_duplicate_meta']) && $_GET['wpms_duplicate_meta'] !== 'none') {
|
467 |
if ($_GET['wpms_duplicate_meta'] === 'duplicate_title') {
|
468 |
$where[] = 'mt.meta_key = "_metaseo_metatitle" AND mt.meta_value IN (SELECT DISTINCT meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key="_metaseo_metatitle" AND meta_value != "" GROUP BY meta_value HAVING COUNT(*) >= 2)';
|
488 |
. ' LEFT JOIN (SELECT * FROM ' . $wpdb->postmeta . ' WHERE meta_key = "_metaseo_metakeywords") mk ON mk.post_id = p.ID';
|
489 |
// query post by lang with polylang plugin
|
490 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME) && is_plugin_active('polylang/polylang.php')) {
|
491 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
492 |
if (isset($_GET['wpms_lang_list']) && $_GET['wpms_lang_list'] !== '0') {
|
493 |
$query .= $wpdb->prepare(' INNER JOIN (SELECT * FROM ' . $wpdb->term_relationships . ' as ml
|
494 |
INNER JOIN (SELECT * FROM ' . $wpdb->terms . ' WHERE slug = %s)
|
499 |
|
500 |
// query post by lang with WPML plugin
|
501 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME) && is_plugin_active('sitepress-multilingual-cms/sitepress.php')) {
|
502 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
503 |
if (isset($_GET['wpms_lang_list']) && $_GET['wpms_lang_list'] !== '0') {
|
504 |
$query .= $wpdb->prepare(' INNER JOIN (SELECT * FROM ' . $wpdb->prefix . 'icl_translations
|
505 |
WHERE element_type LIKE %s AND language_code = %s) t
|
510 |
|
511 |
$query .= ' WHERE ' . implode(' AND ', $where) . $orderStr;
|
512 |
|
513 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
514 |
if (!empty($_REQUEST['metaseo_posts_per_page'])) {
|
515 |
$_per_page = intval($_REQUEST['metaseo_posts_per_page']);
|
516 |
} else {
|
532 |
add_user_meta(get_current_user_id(), 'metaseo_posts_per_page', $per_page);
|
533 |
}
|
534 |
|
535 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
536 |
$paged = !empty($_GET['paged']) ? $_GET['paged'] : '';
|
537 |
if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
|
538 |
$paged = 1;
|
570 |
$records = $this->items;
|
571 |
$i = 0;
|
572 |
$alternate = '';
|
573 |
+
$url = preg_replace('/(http|https):\/\/([w]*[.])?/', '', network_site_url('/'));
|
574 |
|
575 |
list($columns, $hidden) = $this->get_column_info();
|
576 |
|
765 |
{
|
766 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
767 |
$redirect = false;
|
768 |
+
// phpcs:disable WordPress.Security.NonceVerification.Missing -- No action, nonce is not required
|
769 |
if (isset($_POST['post_type_filter'])) {
|
770 |
$current_url = add_query_arg(array('post_type_filter' => $_POST['post_type_filter']), $current_url);
|
771 |
$redirect = true;
|
inc/class.metaseo-dashboard.php
CHANGED
@@ -13,13 +13,13 @@ class MetaSeoDashboard
|
|
13 |
*
|
14 |
* @var integer
|
15 |
*/
|
16 |
-
public static $meta_title_length =
|
17 |
/**
|
18 |
* Max length meta description
|
19 |
*
|
20 |
* @var integer
|
21 |
*/
|
22 |
-
public static $meta_desc_length =
|
23 |
|
24 |
/**
|
25 |
* Get image optimize
|
13 |
*
|
14 |
* @var integer
|
15 |
*/
|
16 |
+
public static $meta_title_length = 60;
|
17 |
/**
|
18 |
* Max length meta description
|
19 |
*
|
20 |
* @var integer
|
21 |
*/
|
22 |
+
public static $meta_desc_length = 158;
|
23 |
|
24 |
/**
|
25 |
* Get image optimize
|
inc/class.metaseo-image-list-table.php
CHANGED
@@ -55,7 +55,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
55 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)
|
56 |
&& (is_plugin_active('sitepress-multilingual-cms/sitepress.php')
|
57 |
|| is_plugin_active('polylang/polylang.php'))) {
|
58 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
59 |
$lang = !empty($_REQUEST['wpms_lang_list']) ? $_REQUEST['wpms_lang_list'] : '0';
|
60 |
$sl_lang = apply_filters('wpms_get_languagesList', '', $lang);
|
61 |
// phpcs:ignore WordPress.Security.EscapeOutput -- Content escaped in the method MetaSeoAddonAdmin::listLanguageSelect
|
@@ -95,7 +95,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
95 |
<?php endif ?>
|
96 |
|
97 |
<input type="hidden" name="page" value="metaseo_image_meta"/>
|
98 |
-
<?php // phpcs:disable WordPress.Security.NonceVerification.
|
99 |
?>
|
100 |
<?php if (!empty($_REQUEST['post_status'])) : ?>
|
101 |
<input type="hidden" name="post_status" value="<?php echo esc_attr($_REQUEST['post_status']); ?>"/>
|
@@ -310,7 +310,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
310 |
list($columns, $hidden, $sortable) = $this->get_column_info();
|
311 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
312 |
$current_url = remove_query_arg('paged', $current_url);
|
313 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
314 |
if (isset($_GET['orderby'])) {
|
315 |
$current_orderby = $_GET['orderby'];
|
316 |
} else {
|
@@ -416,7 +416,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
416 |
global $wpdb;
|
417 |
$this->months = $this->getMonths();
|
418 |
$where = array();
|
419 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
420 |
$where[] = ' post_type="attachment" AND ((post_mime_type="image/jpeg") OR (post_mime_type="image/jpg")
|
421 |
OR (post_mime_type="image/png") OR (post_mime_type="image/gif")) ';
|
422 |
if (!empty($_REQUEST['search'])) {
|
@@ -507,7 +507,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
507 |
add_user_meta(get_current_user_id(), 'metaseo_imgs_per_page', $per_page);
|
508 |
}
|
509 |
|
510 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
511 |
$paged = !empty($_GET['paged']) ? ($_GET['paged']) : '';
|
512 |
|
513 |
if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
|
@@ -533,7 +533,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
533 |
$this->_column_headers = array($columns, $hidden, $sortable);
|
534 |
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Variable has been prepare
|
535 |
$this->items = $wpdb->get_results($query);
|
536 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
537 |
if (isset($_GET['slmeta']) && ($_GET['slmeta'] === 'missing_information' || $_GET['slmeta'] === 'resizeimages')) {
|
538 |
foreach ($this->items as $item) {
|
539 |
$item->alt = get_post_meta($item->ID, '_wp_attachment_image_alt', true);
|
@@ -548,7 +548,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
548 |
*/
|
549 |
public function searchBox1()
|
550 |
{
|
551 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
552 |
if (empty($_REQUEST['txtkeyword']) && !$this->has_items()) {
|
553 |
return;
|
554 |
}
|
@@ -595,7 +595,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
595 |
return;
|
596 |
}
|
597 |
|
598 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
599 |
$m = isset($_REQUEST['sldate']) ? $_REQUEST['sldate'] : 0;
|
600 |
?>
|
601 |
<label for="filter-by-date"
|
@@ -636,7 +636,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
636 |
*/
|
637 |
public function metaFilter($name)
|
638 |
{
|
639 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
640 |
$m = isset($_REQUEST['slmeta']) ? $_REQUEST['slmeta'] : 0;
|
641 |
?>
|
642 |
<label>
|
@@ -1178,7 +1178,7 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
1178 |
{
|
1179 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
1180 |
$redirect = false;
|
1181 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
1182 |
if (isset($_POST['txtkeyword'])) {
|
1183 |
$current_url = add_query_arg(
|
1184 |
array(
|
@@ -1772,6 +1772,10 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
1772 |
$response->updated = true;
|
1773 |
$response->msg = esc_html__('Image name was changed', 'wp-meta-seo');
|
1774 |
} else {
|
|
|
|
|
|
|
|
|
1775 |
$response->iname = $old_name;
|
1776 |
$response->msg = esc_html__('There is a problem when update image name', 'wp-meta-seo');
|
1777 |
}
|
@@ -1824,7 +1828,8 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
1824 |
//Update new value for meta info of this image in wp_postmeta
|
1825 |
$meta[$post_id]['meta'][$meta_order]['type'][$meta_type] = wpmsUtf8($meta_value);
|
1826 |
update_post_meta($img_post_id, $meta_key, $meta);
|
1827 |
-
|
|
|
1828 |
//Then we must update this meta info in the appropriate post content
|
1829 |
$post = get_post($post_id);
|
1830 |
if (!$post) {
|
@@ -1869,12 +1874,18 @@ class MetaSeoImageListTable extends WP_List_Table
|
|
1869 |
|
1870 |
remove_action('post_updated', array('MetaSeoBrokenLinkTable', 'updatePost'));
|
1871 |
|
|
|
|
|
1872 |
//Update content of this post.
|
1873 |
if (!wp_update_post(array('ID' => $post->ID, 'post_content' => $post_content))) {
|
1874 |
$response->msg = esc_html__('The post haven\'t been updated, please check again!', 'wp-meta-seo');
|
1875 |
} else {
|
1876 |
// compatible with elementor plugin (alt tag not display on frontend)
|
1877 |
delete_post_meta($post->ID, '_elementor_edit_mode');
|
|
|
|
|
|
|
|
|
1878 |
update_option('wpms_last_update_post', time());
|
1879 |
$response->updated = true;
|
1880 |
$response->msg = ucfirst($meta_type) . esc_html__(' was saved', 'wp-meta-seo');
|
55 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)
|
56 |
&& (is_plugin_active('sitepress-multilingual-cms/sitepress.php')
|
57 |
|| is_plugin_active('polylang/polylang.php'))) {
|
58 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
59 |
$lang = !empty($_REQUEST['wpms_lang_list']) ? $_REQUEST['wpms_lang_list'] : '0';
|
60 |
$sl_lang = apply_filters('wpms_get_languagesList', '', $lang);
|
61 |
// phpcs:ignore WordPress.Security.EscapeOutput -- Content escaped in the method MetaSeoAddonAdmin::listLanguageSelect
|
95 |
<?php endif ?>
|
96 |
|
97 |
<input type="hidden" name="page" value="metaseo_image_meta"/>
|
98 |
+
<?php // phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
99 |
?>
|
100 |
<?php if (!empty($_REQUEST['post_status'])) : ?>
|
101 |
<input type="hidden" name="post_status" value="<?php echo esc_attr($_REQUEST['post_status']); ?>"/>
|
310 |
list($columns, $hidden, $sortable) = $this->get_column_info();
|
311 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
312 |
$current_url = remove_query_arg('paged', $current_url);
|
313 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
314 |
if (isset($_GET['orderby'])) {
|
315 |
$current_orderby = $_GET['orderby'];
|
316 |
} else {
|
416 |
global $wpdb;
|
417 |
$this->months = $this->getMonths();
|
418 |
$where = array();
|
419 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
420 |
$where[] = ' post_type="attachment" AND ((post_mime_type="image/jpeg") OR (post_mime_type="image/jpg")
|
421 |
OR (post_mime_type="image/png") OR (post_mime_type="image/gif")) ';
|
422 |
if (!empty($_REQUEST['search'])) {
|
507 |
add_user_meta(get_current_user_id(), 'metaseo_imgs_per_page', $per_page);
|
508 |
}
|
509 |
|
510 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
511 |
$paged = !empty($_GET['paged']) ? ($_GET['paged']) : '';
|
512 |
|
513 |
if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
|
533 |
$this->_column_headers = array($columns, $hidden, $sortable);
|
534 |
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Variable has been prepare
|
535 |
$this->items = $wpdb->get_results($query);
|
536 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
537 |
if (isset($_GET['slmeta']) && ($_GET['slmeta'] === 'missing_information' || $_GET['slmeta'] === 'resizeimages')) {
|
538 |
foreach ($this->items as $item) {
|
539 |
$item->alt = get_post_meta($item->ID, '_wp_attachment_image_alt', true);
|
548 |
*/
|
549 |
public function searchBox1()
|
550 |
{
|
551 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
552 |
if (empty($_REQUEST['txtkeyword']) && !$this->has_items()) {
|
553 |
return;
|
554 |
}
|
595 |
return;
|
596 |
}
|
597 |
|
598 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
599 |
$m = isset($_REQUEST['sldate']) ? $_REQUEST['sldate'] : 0;
|
600 |
?>
|
601 |
<label for="filter-by-date"
|
636 |
*/
|
637 |
public function metaFilter($name)
|
638 |
{
|
639 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
640 |
$m = isset($_REQUEST['slmeta']) ? $_REQUEST['slmeta'] : 0;
|
641 |
?>
|
642 |
<label>
|
1178 |
{
|
1179 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
1180 |
$redirect = false;
|
1181 |
+
// phpcs:disable WordPress.Security.NonceVerification.Missing -- No action, nonce is not required
|
1182 |
if (isset($_POST['txtkeyword'])) {
|
1183 |
$current_url = add_query_arg(
|
1184 |
array(
|
1772 |
$response->updated = true;
|
1773 |
$response->msg = esc_html__('Image name was changed', 'wp-meta-seo');
|
1774 |
} else {
|
1775 |
+
//Revert image if false
|
1776 |
+
if (!file_exists($upload_dir . '/' . $linkold)) {
|
1777 |
+
rename($upload_dir . '/' . $newFileName, $upload_dir . '/' . $linkold);
|
1778 |
+
}
|
1779 |
$response->iname = $old_name;
|
1780 |
$response->msg = esc_html__('There is a problem when update image name', 'wp-meta-seo');
|
1781 |
}
|
1828 |
//Update new value for meta info of this image in wp_postmeta
|
1829 |
$meta[$post_id]['meta'][$meta_order]['type'][$meta_type] = wpmsUtf8($meta_value);
|
1830 |
update_post_meta($img_post_id, $meta_key, $meta);
|
1831 |
+
//Update alt in light box
|
1832 |
+
update_post_meta($img_post_id, '_wp_attachment_image_alt', wpmsUtf8($meta_value));
|
1833 |
//Then we must update this meta info in the appropriate post content
|
1834 |
$post = get_post($post_id);
|
1835 |
if (!$post) {
|
1874 |
|
1875 |
remove_action('post_updated', array('MetaSeoBrokenLinkTable', 'updatePost'));
|
1876 |
|
1877 |
+
$is_elementor_edit = (! !get_post_meta($post->ID, '_elementor_edit_mode', true));
|
1878 |
+
|
1879 |
//Update content of this post.
|
1880 |
if (!wp_update_post(array('ID' => $post->ID, 'post_content' => $post_content))) {
|
1881 |
$response->msg = esc_html__('The post haven\'t been updated, please check again!', 'wp-meta-seo');
|
1882 |
} else {
|
1883 |
// compatible with elementor plugin (alt tag not display on frontend)
|
1884 |
delete_post_meta($post->ID, '_elementor_edit_mode');
|
1885 |
+
// Fix elementor change when edit alt image
|
1886 |
+
if ($is_elementor_edit) {
|
1887 |
+
update_post_meta($post->ID, '_elementor_edit_mode', 'builder');
|
1888 |
+
}
|
1889 |
update_option('wpms_last_update_post', time());
|
1890 |
$response->updated = true;
|
1891 |
$response->msg = ucfirst($meta_type) . esc_html__(' was saved', 'wp-meta-seo');
|
inc/class.metaseo-link-list-table.php
CHANGED
@@ -68,7 +68,7 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
68 |
<?php endif ?>
|
69 |
|
70 |
<input type="hidden" name="page" value="metaseo_image_meta"/>
|
71 |
-
<?php // phpcs:disable WordPress.Security.NonceVerification.
|
72 |
?>
|
73 |
<?php if (!empty($_REQUEST['post_status'])) : ?>
|
74 |
<input type="hidden" name="post_status" value="<?php echo esc_attr($_REQUEST['post_status']); ?>"/>
|
@@ -286,15 +286,15 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
286 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
287 |
$current_url = remove_query_arg('paged', $current_url);
|
288 |
|
289 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
290 |
if (isset($_GET['orderby'])) {
|
291 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
292 |
$current_orderby = $_GET['orderby'];
|
293 |
} else {
|
294 |
$current_orderby = '';
|
295 |
}
|
296 |
|
297 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
298 |
if (isset($_GET['order']) && 'desc' === $_GET['order']) {
|
299 |
$current_order = 'desc';
|
300 |
} else {
|
@@ -394,7 +394,7 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
394 |
$this->months = $this->getMonths();
|
395 |
|
396 |
$where = array('1=1');
|
397 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
398 |
$keyword = !empty($_GET['txtkeyword']) ? $_GET['txtkeyword'] : '';
|
399 |
if (isset($keyword) && $keyword !== '') {
|
400 |
$where[] .= $wpdb->prepare('(link_text LIKE %s OR link_url LIKE %s)', array(
|
@@ -437,7 +437,7 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
437 |
add_user_meta(get_current_user_id(), 'metaseo_broken_link_per_page', $per_page);
|
438 |
}
|
439 |
|
440 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
441 |
$paged = !empty($_GET['paged']) ? $_GET['paged'] : '';
|
442 |
if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
|
443 |
$paged = 1;
|
@@ -493,7 +493,7 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
493 |
*/
|
494 |
public function searchBox1()
|
495 |
{
|
496 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
497 |
if (empty($_REQUEST['txtkeyword']) && !$this->has_items()) {
|
498 |
return;
|
499 |
}
|
@@ -547,7 +547,7 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
547 |
*/
|
548 |
public function sourceFilter()
|
549 |
{
|
550 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
551 |
$link_source = isset($_GET['metaseo_link_source']) ? $_GET['metaseo_link_source'] : 0;
|
552 |
?>
|
553 |
<label>
|
@@ -581,7 +581,7 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
581 |
if (!$month_count || (1 === (int) $month_count && 0 === (int) $this->months[0]->month)) {
|
582 |
return;
|
583 |
}
|
584 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
585 |
$m = isset($_REQUEST['sldate']) ? $_REQUEST['sldate'] : 0;
|
586 |
?>
|
587 |
<label for="filter-by-date"
|
@@ -709,7 +709,7 @@ class MetaSeoLinkListTable extends WP_List_Table
|
|
709 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
710 |
$redirect = false;
|
711 |
|
712 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
713 |
if (isset($_POST['txtkeyword'])) {
|
714 |
$current_url = add_query_arg(
|
715 |
array(
|
68 |
<?php endif ?>
|
69 |
|
70 |
<input type="hidden" name="page" value="metaseo_image_meta"/>
|
71 |
+
<?php // phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
72 |
?>
|
73 |
<?php if (!empty($_REQUEST['post_status'])) : ?>
|
74 |
<input type="hidden" name="post_status" value="<?php echo esc_attr($_REQUEST['post_status']); ?>"/>
|
286 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
287 |
$current_url = remove_query_arg('paged', $current_url);
|
288 |
|
289 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
290 |
if (isset($_GET['orderby'])) {
|
291 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
292 |
$current_orderby = $_GET['orderby'];
|
293 |
} else {
|
294 |
$current_orderby = '';
|
295 |
}
|
296 |
|
297 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
298 |
if (isset($_GET['order']) && 'desc' === $_GET['order']) {
|
299 |
$current_order = 'desc';
|
300 |
} else {
|
394 |
$this->months = $this->getMonths();
|
395 |
|
396 |
$where = array('1=1');
|
397 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
398 |
$keyword = !empty($_GET['txtkeyword']) ? $_GET['txtkeyword'] : '';
|
399 |
if (isset($keyword) && $keyword !== '') {
|
400 |
$where[] .= $wpdb->prepare('(link_text LIKE %s OR link_url LIKE %s)', array(
|
437 |
add_user_meta(get_current_user_id(), 'metaseo_broken_link_per_page', $per_page);
|
438 |
}
|
439 |
|
440 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
441 |
$paged = !empty($_GET['paged']) ? $_GET['paged'] : '';
|
442 |
if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
|
443 |
$paged = 1;
|
493 |
*/
|
494 |
public function searchBox1()
|
495 |
{
|
496 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
497 |
if (empty($_REQUEST['txtkeyword']) && !$this->has_items()) {
|
498 |
return;
|
499 |
}
|
547 |
*/
|
548 |
public function sourceFilter()
|
549 |
{
|
550 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
551 |
$link_source = isset($_GET['metaseo_link_source']) ? $_GET['metaseo_link_source'] : 0;
|
552 |
?>
|
553 |
<label>
|
581 |
if (!$month_count || (1 === (int) $month_count && 0 === (int) $this->months[0]->month)) {
|
582 |
return;
|
583 |
}
|
584 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
585 |
$m = isset($_REQUEST['sldate']) ? $_REQUEST['sldate'] : 0;
|
586 |
?>
|
587 |
<label for="filter-by-date"
|
709 |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
710 |
$redirect = false;
|
711 |
|
712 |
+
// phpcs:disable WordPress.Security.NonceVerification.Missing -- No action, nonce is not required
|
713 |
if (isset($_POST['txtkeyword'])) {
|
714 |
$current_url = add_query_arg(
|
715 |
array(
|
inc/class.metaseo-meta.php
CHANGED
@@ -26,13 +26,13 @@ class WPMSEOMeta
|
|
26 |
*
|
27 |
* @var integer
|
28 |
*/
|
29 |
-
public static $meta_length =
|
30 |
/**
|
31 |
* Meta title max length
|
32 |
*
|
33 |
* @var integer
|
34 |
*/
|
35 |
-
public static $meta_title_length =
|
36 |
/**
|
37 |
* Meta keywords max length
|
38 |
*
|
26 |
*
|
27 |
* @var integer
|
28 |
*/
|
29 |
+
public static $meta_length = 158;
|
30 |
/**
|
31 |
* Meta title max length
|
32 |
*
|
33 |
* @var integer
|
34 |
*/
|
35 |
+
public static $meta_title_length = 60;
|
36 |
/**
|
37 |
* Meta keywords max length
|
38 |
*
|
inc/class.metaseo-metabox.php
CHANGED
@@ -140,7 +140,7 @@ class WPMSEOMetabox extends WPMSEOMeta
|
|
140 |
);
|
141 |
self::$meta_fields['general']['title']['help'] = esc_attr__('This is the title of your content that may be displayed
|
142 |
in search engine results (meta title). By default it’s the content title (page title, post title…).
|
143 |
-
|
144 |
|
145 |
$settings = get_option('_metaseo_settings');
|
146 |
if (isset($settings['metaseo_showkeywords']) && (int) $settings['metaseo_showkeywords'] === 1) {
|
@@ -162,7 +162,7 @@ class WPMSEOMetabox extends WPMSEOMeta
|
|
162 |
self::$meta_fields['general']['desc']['help'] = esc_attr__('The description of your content that may be displayed
|
163 |
in search engine results aka meta description.
|
164 |
By default search engine take an excerpt from your content (depending on the search query).
|
165 |
-
|
166 |
|
167 |
self::$meta_fields['social']['facebook']['opengraph-title']['title'] = esc_html__('Facebook Title', 'wp-meta-seo');
|
168 |
self::$meta_fields['social']['facebook']['opengraph-title']['description'] = esc_html__('Custom title to display when
|
@@ -742,7 +742,7 @@ class WPMSEOMetabox extends WPMSEOMeta
|
|
742 |
*/
|
743 |
private function getMetaboxPost()
|
744 |
{
|
745 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
746 |
if (isset($_GET['post'])) {
|
747 |
$post_id = (int) $_GET['post'];
|
748 |
$post = get_post($post_id);
|
140 |
);
|
141 |
self::$meta_fields['general']['title']['help'] = esc_attr__('This is the title of your content that may be displayed
|
142 |
in search engine results (meta title). By default it’s the content title (page title, post title…).
|
143 |
+
60 characters max allowed.', 'wp-meta-seo');
|
144 |
|
145 |
$settings = get_option('_metaseo_settings');
|
146 |
if (isset($settings['metaseo_showkeywords']) && (int) $settings['metaseo_showkeywords'] === 1) {
|
162 |
self::$meta_fields['general']['desc']['help'] = esc_attr__('The description of your content that may be displayed
|
163 |
in search engine results aka meta description.
|
164 |
By default search engine take an excerpt from your content (depending on the search query).
|
165 |
+
158 characters max allowed.', 'wp-meta-seo');
|
166 |
|
167 |
self::$meta_fields['social']['facebook']['opengraph-title']['title'] = esc_html__('Facebook Title', 'wp-meta-seo');
|
168 |
self::$meta_fields['social']['facebook']['opengraph-title']['description'] = esc_html__('Custom title to display when
|
742 |
*/
|
743 |
private function getMetaboxPost()
|
744 |
{
|
745 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
746 |
if (isset($_GET['post'])) {
|
747 |
$post_id = (int) $_GET['post'];
|
748 |
$post = get_post($post_id);
|
inc/class.metaseo-opengraph.php
CHANGED
@@ -283,6 +283,7 @@ class MetaSeoOpenGraph
|
|
283 |
$meta_fbimage = get_post_meta($id, '_metaseo_metaopengraph-image', true);
|
284 |
|
285 |
$default_image = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'single-post-thumbnail');
|
|
|
286 |
if (empty($meta_twimage) && isset($default_image[0])) {
|
287 |
$meta_twimage = $default_image[0];
|
288 |
}
|
283 |
$meta_fbimage = get_post_meta($id, '_metaseo_metaopengraph-image', true);
|
284 |
|
285 |
$default_image = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'single-post-thumbnail');
|
286 |
+
|
287 |
if (empty($meta_twimage) && isset($default_image[0])) {
|
288 |
$meta_twimage = $default_image[0];
|
289 |
}
|
inc/class.metaseo-sitemap.php
CHANGED
@@ -1864,51 +1864,19 @@ ORDER BY p.post_date DESC LIMIT 10', array('publish', 'post', $taxo, $cat->slug)
|
|
1864 |
{
|
1865 |
global $wpdb;
|
1866 |
$posts = array();
|
1867 |
-
if ($post_type === 'product') {
|
1868 |
-
$taxonomy_objects = array('product_cat');
|
1869 |
-
} else {
|
1870 |
-
$taxonomy_objects = get_object_taxonomies($post_type, 'names');
|
1871 |
-
}
|
1872 |
-
|
1873 |
-
if (!empty($taxonomy_objects)) {
|
1874 |
-
foreach ($taxonomy_objects as $taxo) {
|
1875 |
-
$categorys = get_categories(array('hide_empty' => true, 'taxonomy' => $taxo));
|
1876 |
-
foreach ($categorys as $cat) {
|
1877 |
-
$results = $wpdb->get_results($wpdb->prepare('SELECT p.ID as ID,p.post_title as post_title
|
1878 |
-
FROM ' . $wpdb->posts . ' AS p
|
1879 |
-
INNER JOIN ' . $wpdb->term_relationships . ' AS tr ON (p.ID = tr.object_id)
|
1880 |
-
INNER JOIN ' . $wpdb->term_taxonomy . ' AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id)
|
1881 |
-
INNER JOIN ' . $wpdb->terms . ' AS t ON (t.term_id = tt.term_id)
|
1882 |
-
WHERE p.post_status = %s
|
1883 |
-
AND p.post_type = %s
|
1884 |
-
AND tt.taxonomy = %s AND t.slug=%s
|
1885 |
-
ORDER BY p.post_date DESC', array('publish', $post_type, $taxo, $cat->slug)));
|
1886 |
|
1887 |
-
|
1888 |
-
$obj = new StdClass();
|
1889 |
-
$obj->cat_name = $cat->cat_name;
|
1890 |
-
$obj->cat_ID = $cat->cat_ID;
|
1891 |
-
$obj->taxo = $taxo;
|
1892 |
-
$obj->slug = $cat->slug;
|
1893 |
-
$obj->results = $results;
|
1894 |
-
$posts[] = $obj;
|
1895 |
-
}
|
1896 |
-
}
|
1897 |
-
}
|
1898 |
-
} else {
|
1899 |
-
$results = $wpdb->get_results($wpdb->prepare('SELECT p.ID as ID,p.post_title as post_title
|
1900 |
FROM ' . $wpdb->posts . ' AS p
|
1901 |
WHERE p.post_status = "publish" AND p.post_type = %s
|
1902 |
ORDER BY p.post_date DESC', array($post_type)));
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
}
|
1912 |
}
|
1913 |
|
1914 |
return $posts;
|
1864 |
{
|
1865 |
global $wpdb;
|
1866 |
$posts = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1867 |
|
1868 |
+
$results = $wpdb->get_results($wpdb->prepare('SELECT p.ID as ID,p.post_title as post_title
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1869 |
FROM ' . $wpdb->posts . ' AS p
|
1870 |
WHERE p.post_status = "publish" AND p.post_type = %s
|
1871 |
ORDER BY p.post_date DESC', array($post_type)));
|
1872 |
+
if (!empty($results)) {
|
1873 |
+
$obj = new StdClass();
|
1874 |
+
$obj->cat_name = '';
|
1875 |
+
$obj->cat_ID = '';
|
1876 |
+
$obj->taxo = '';
|
1877 |
+
$obj->slug = '';
|
1878 |
+
$obj->results = $results;
|
1879 |
+
$posts[] = $obj;
|
|
|
1880 |
}
|
1881 |
|
1882 |
return $posts;
|
inc/google_analytics/tracking/code-universal.php
CHANGED
@@ -99,8 +99,8 @@ $profile = WpmsGaTools::getSelectedProfile($google_alanytics['profile_list'], $g
|
|
99 |
$post_tags_list = '';
|
100 |
$post_tags_array = get_the_tags($post->ID);
|
101 |
if ($post_tags_array) {
|
102 |
-
foreach ($post_tags_array as $
|
103 |
-
$post_tags_list .= $
|
104 |
}
|
105 |
}
|
106 |
$post_tags_list = rtrim($post_tags_list, ', ');
|
99 |
$post_tags_list = '';
|
100 |
$post_tags_array = get_the_tags($post->ID);
|
101 |
if ($post_tags_array) {
|
102 |
+
foreach ($post_tags_array as $posttag) {
|
103 |
+
$post_tags_list .= $posttag->name . ', ';
|
104 |
}
|
105 |
}
|
106 |
$post_tags_list = rtrim($post_tags_list, ', ');
|
inc/install-wizard/content/viewGoogleAnalytics.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* Prohibit direct script loading */
|
3 |
defined('ABSPATH') || die('No direct script access allowed!');
|
4 |
$wizard = new WpmsInstallWizard();
|
5 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
6 |
$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
|
7 |
$next_link = $wizard->getNextLink($step);
|
8 |
|
2 |
/* Prohibit direct script loading */
|
3 |
defined('ABSPATH') || die('No direct script access allowed!');
|
4 |
$wizard = new WpmsInstallWizard();
|
5 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View request, no action
|
6 |
$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
|
7 |
$next_link = $wizard->getNextLink($step);
|
8 |
|
inc/install-wizard/content/viewMetaInfos.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* Prohibit direct script loading */
|
3 |
defined('ABSPATH') || die('No direct script access allowed!');
|
4 |
$wizard = new WpmsInstallWizard();
|
5 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
6 |
$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
|
7 |
$next_link = $wizard->getNextLink($step);
|
8 |
?>
|
2 |
/* Prohibit direct script loading */
|
3 |
defined('ABSPATH') || die('No direct script access allowed!');
|
4 |
$wizard = new WpmsInstallWizard();
|
5 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View request, no action
|
6 |
$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
|
7 |
$next_link = $wizard->getNextLink($step);
|
8 |
?>
|
inc/install-wizard/content/viewSocial.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* Prohibit direct script loading */
|
3 |
defined('ABSPATH') || die('No direct script access allowed!');
|
4 |
$wizard = new WpmsInstallWizard();
|
5 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
6 |
$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
|
7 |
$next_link = $wizard->getNextLink($step);
|
8 |
?>
|
2 |
/* Prohibit direct script loading */
|
3 |
defined('ABSPATH') || die('No direct script access allowed!');
|
4 |
$wizard = new WpmsInstallWizard();
|
5 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View request, no action
|
6 |
$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
|
7 |
$next_link = $wizard->getNextLink($step);
|
8 |
?>
|
inc/install-wizard/install-wizard.php
CHANGED
@@ -68,7 +68,7 @@ class WpmsInstallWizard
|
|
68 |
*/
|
69 |
public function runWizard()
|
70 |
{
|
71 |
-
// phpcs:disable WordPress.Security.NonceVerification.
|
72 |
wp_enqueue_style(
|
73 |
'wpms-material-icons',
|
74 |
'https://fonts.googleapis.com/icon?family=Material+Icons'
|
@@ -93,6 +93,7 @@ class WpmsInstallWizard
|
|
93 |
$this->current_step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps));
|
94 |
|
95 |
// Save action
|
|
|
96 |
if (!empty($_POST['wpms_save_step']) && isset($this->steps[$this->current_step]['action'])) {
|
97 |
call_user_func(array('WpmsHandlerWizard', $this->steps[$this->current_step]['action']), $this->current_step);
|
98 |
}
|
68 |
*/
|
69 |
public function runWizard()
|
70 |
{
|
71 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- View request, no action
|
72 |
wp_enqueue_style(
|
73 |
'wpms-material-icons',
|
74 |
'https://fonts.googleapis.com/icon?family=Material+Icons'
|
93 |
$this->current_step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps));
|
94 |
|
95 |
// Save action
|
96 |
+
// phpcs:disable WordPress.Security.NonceVerification.Missing -- View request, no action
|
97 |
if (!empty($_POST['wpms_save_step']) && isset($this->steps[$this->current_step]['action'])) {
|
98 |
call_user_func(array('WpmsHandlerWizard', $this->steps[$this->current_step]['action']), $this->current_step);
|
99 |
}
|
inc/pages/content-meta.php
CHANGED
@@ -10,7 +10,7 @@ $metaseo_list_table = new MetaSeoContentListTable();
|
|
10 |
$metaseo_list_table->processAction();
|
11 |
$metaseo_list_table->prepare_items();
|
12 |
|
13 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
14 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
15 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
16 |
exit;
|
10 |
$metaseo_list_table->processAction();
|
11 |
$metaseo_list_table->prepare_items();
|
12 |
|
13 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
14 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
15 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
16 |
exit;
|
inc/pages/dashboard.php
CHANGED
@@ -99,6 +99,12 @@ if (isset($server_check['host']) && $server_check['host'] === 'localhost') {
|
|
99 |
$web_screenshot = $upload_dir['baseurl'] . '/wpms-web-screenshot.jpg';
|
100 |
}
|
101 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
?>
|
103 |
<div class="dashboard">
|
104 |
<h1 class="top_h1"><?php esc_html_e('SEO DASHBOARD', 'wp-meta-seo') ?></h1>
|
@@ -333,7 +339,7 @@ if (isset($server_check['host']) && $server_check['host'] === 'localhost') {
|
|
333 |
<div class="wpms_row_full">
|
334 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('Google search console', 'wp-meta-seo'); ?></label>
|
335 |
<div class="right-checkbox">
|
336 |
-
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php
|
337 |
</div>
|
338 |
</div>
|
339 |
<p class="description p-d-20"><?php esc_html_e('Connect WP Meta SEO and the Google Search Console to get Google keywords recommendation while writing your content!', 'wp-meta-seo'); ?></p>
|
@@ -348,7 +354,7 @@ if (isset($server_check['host']) && $server_check['host'] === 'localhost') {
|
|
348 |
<div class="wpms_row_full">
|
349 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('404 Automatic Index', 'wp-meta-seo'); ?></label>
|
350 |
<div class="right-checkbox">
|
351 |
-
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php
|
352 |
</div>
|
353 |
</div>
|
354 |
<p class="description p-d-20"><?php esc_html_e('Activate the 404 error automatic index to record all internal and external 404 errors along with hits, source, text...', 'wp-meta-seo'); ?></p>
|
@@ -363,7 +369,7 @@ if (isset($server_check['host']) && $server_check['host'] === 'localhost') {
|
|
363 |
<div class="wpms_row_full">
|
364 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('Google local business', 'wp-meta-seo'); ?></label>
|
365 |
<div class="right-checkbox">
|
366 |
-
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php
|
367 |
</div>
|
368 |
</div>
|
369 |
<p class="description p-d-20"><?php esc_html_e('Google My Business is a free and easy-to-use tool for businesses and organizations to manage their online presence across Google, including Search and Maps.', 'wp-meta-seo'); ?></p>
|
@@ -378,7 +384,7 @@ if (isset($server_check['host']) && $server_check['host'] === 'localhost') {
|
|
378 |
<div class="wpms_row_full">
|
379 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('WOOCOMERCE', 'wp-meta-seo'); ?></label>
|
380 |
<div class="right-checkbox">
|
381 |
-
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php
|
382 |
</div>
|
383 |
</div>
|
384 |
<p class="description p-d-20"><?php esc_html_e('Edit the meta information for the WooCommerce products category listing', 'wp-meta-seo'); ?></p>
|
@@ -393,7 +399,7 @@ if (isset($server_check['host']) && $server_check['host'] === 'localhost') {
|
|
393 |
<div class="wpms_row_full">
|
394 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('POLYLANG', 'wp-meta-seo'); ?></label>
|
395 |
<div class="right-checkbox">
|
396 |
-
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php
|
397 |
</div>
|
398 |
</div>
|
399 |
<p class="description p-d-20"><?php esc_html_e('Polylang multilingual plugin optimized. Filter your content by language in the meta and image bulk edition. Generate sitemap by Polylang languages', 'wp-meta-seo'); ?></p>
|
@@ -408,7 +414,7 @@ if (isset($server_check['host']) && $server_check['host'] === 'localhost') {
|
|
408 |
<div class="wpms_row_full">
|
409 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('WPML', 'wp-meta-seo'); ?></label>
|
410 |
<div class="right-checkbox">
|
411 |
-
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php
|
412 |
</div>
|
413 |
</div>
|
414 |
<p class="description p-d-20"><?php esc_html_e('WPML multilingual plugin optimized. Filter your content by language in the meta and image bulk edition. Generate sitemap by WPML languages', 'wp-meta-seo'); ?></p>
|
99 |
$web_screenshot = $upload_dir['baseurl'] . '/wpms-web-screenshot.jpg';
|
100 |
}
|
101 |
}
|
102 |
+
|
103 |
+
if (class_exists('MetaSeoAddonAdmin')) {
|
104 |
+
$badge = __('Pro addon installed', 'wp-meta-seo');
|
105 |
+
} else {
|
106 |
+
$badge = __('Pro addon feature', 'wp-meta-seo');
|
107 |
+
}
|
108 |
?>
|
109 |
<div class="dashboard">
|
110 |
<h1 class="top_h1"><?php esc_html_e('SEO DASHBOARD', 'wp-meta-seo') ?></h1>
|
339 |
<div class="wpms_row_full">
|
340 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('Google search console', 'wp-meta-seo'); ?></label>
|
341 |
<div class="right-checkbox">
|
342 |
+
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php echo esc_html($badge); ?></a></div>
|
343 |
</div>
|
344 |
</div>
|
345 |
<p class="description p-d-20"><?php esc_html_e('Connect WP Meta SEO and the Google Search Console to get Google keywords recommendation while writing your content!', 'wp-meta-seo'); ?></p>
|
354 |
<div class="wpms_row_full">
|
355 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('404 Automatic Index', 'wp-meta-seo'); ?></label>
|
356 |
<div class="right-checkbox">
|
357 |
+
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php echo esc_html($badge); ?></a></div>
|
358 |
</div>
|
359 |
</div>
|
360 |
<p class="description p-d-20"><?php esc_html_e('Activate the 404 error automatic index to record all internal and external 404 errors along with hits, source, text...', 'wp-meta-seo'); ?></p>
|
369 |
<div class="wpms_row_full">
|
370 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('Google local business', 'wp-meta-seo'); ?></label>
|
371 |
<div class="right-checkbox">
|
372 |
+
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php echo esc_html($badge); ?></a></div>
|
373 |
</div>
|
374 |
</div>
|
375 |
<p class="description p-d-20"><?php esc_html_e('Google My Business is a free and easy-to-use tool for businesses and organizations to manage their online presence across Google, including Search and Maps.', 'wp-meta-seo'); ?></p>
|
384 |
<div class="wpms_row_full">
|
385 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('WOOCOMERCE', 'wp-meta-seo'); ?></label>
|
386 |
<div class="right-checkbox">
|
387 |
+
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php echo esc_html($badge); ?></a></div>
|
388 |
</div>
|
389 |
</div>
|
390 |
<p class="description p-d-20"><?php esc_html_e('Edit the meta information for the WooCommerce products category listing', 'wp-meta-seo'); ?></p>
|
399 |
<div class="wpms_row_full">
|
400 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('POLYLANG', 'wp-meta-seo'); ?></label>
|
401 |
<div class="right-checkbox">
|
402 |
+
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php echo esc_html($badge); ?></a></div>
|
403 |
</div>
|
404 |
</div>
|
405 |
<p class="description p-d-20"><?php esc_html_e('Polylang multilingual plugin optimized. Filter your content by language in the meta and image bulk edition. Generate sitemap by Polylang languages', 'wp-meta-seo'); ?></p>
|
414 |
<div class="wpms_row_full">
|
415 |
<label class="ju-setting-label label-dash-widgets"><?php esc_html_e('WPML', 'wp-meta-seo'); ?></label>
|
416 |
<div class="right-checkbox">
|
417 |
+
<div class="panel-addon"><a href="https://www.joomunited.com/wordpress-products/wp-meta-seo" target="_blank"><?php echo esc_html($badge); ?></a></div>
|
418 |
</div>
|
419 |
</div>
|
420 |
<p class="description p-d-20"><?php esc_html_e('WPML multilingual plugin optimized. Filter your content by language in the meta and image bulk edition. Generate sitemap by WPML languages', 'wp-meta-seo'); ?></p>
|
inc/pages/google-analytics/menu.php
CHANGED
@@ -5,7 +5,7 @@ if (!empty($this->google_alanytics)) :
|
|
5 |
|
6 |
<li class="tab wpmstab col" style="min-width: 240px">
|
7 |
<?php
|
8 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
9 |
if (empty($_GET['view'])) {
|
10 |
?>
|
11 |
<a href="<?php echo esc_url(admin_url('admin.php?page=metaseo_google_analytics')) ?>" class="active">
|
@@ -25,7 +25,7 @@ if (!empty($this->google_alanytics)) :
|
|
25 |
|
26 |
<li class="tab wpmstab col">
|
27 |
<?php
|
28 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
29 |
if (isset($_GET['view']) && $_GET['view'] === 'wpmsga_trackcode') {
|
30 |
?>
|
31 |
<a href="<?php echo esc_url(admin_url('admin.php?page=metaseo_google_analytics&view=wpmsga_trackcode')) ?>" class="active">
|
5 |
|
6 |
<li class="tab wpmstab col" style="min-width: 240px">
|
7 |
<?php
|
8 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
9 |
if (empty($_GET['view'])) {
|
10 |
?>
|
11 |
<a href="<?php echo esc_url(admin_url('admin.php?page=metaseo_google_analytics')) ?>" class="active">
|
25 |
|
26 |
<li class="tab wpmstab col">
|
27 |
<?php
|
28 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
29 |
if (isset($_GET['view']) && $_GET['view'] === 'wpmsga_trackcode') {
|
30 |
?>
|
31 |
<a href="<?php echo esc_url(admin_url('admin.php?page=metaseo_google_analytics&view=wpmsga_trackcode')) ?>" class="active">
|
inc/pages/image-meta.php
CHANGED
@@ -13,7 +13,7 @@ $metaseo_list_table = new MetaSeoImageListTable();
|
|
13 |
$metaseo_list_table->processAction();
|
14 |
$metaseo_list_table->prepare_items();
|
15 |
|
16 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
17 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
18 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
19 |
exit;
|
13 |
$metaseo_list_table->processAction();
|
14 |
$metaseo_list_table->prepare_items();
|
15 |
|
16 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
17 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
18 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
19 |
exit;
|
inc/pages/link-meta.php
CHANGED
@@ -10,7 +10,7 @@ $metaseo_list_table = new MetaSeoLinkListTable();
|
|
10 |
$metaseo_list_table->processAction();
|
11 |
$metaseo_list_table->prepare_items();
|
12 |
|
13 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
14 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
15 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
16 |
exit;
|
10 |
$metaseo_list_table->processAction();
|
11 |
$metaseo_list_table->prepare_items();
|
12 |
|
13 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
14 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
15 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
16 |
exit;
|
inc/pages/metaseo-broken-link.php
CHANGED
@@ -16,7 +16,7 @@ $metaseo_list_table->processAction();
|
|
16 |
$metaseo_list_table->prepare_items();
|
17 |
$a = json_encode($metaseo_list_table->items);
|
18 |
|
19 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
20 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
21 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
22 |
exit;
|
16 |
$metaseo_list_table->prepare_items();
|
17 |
$a = json_encode($metaseo_list_table->items);
|
18 |
|
19 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
|
20 |
if (!empty($_REQUEST['_wp_http_referer'])) {
|
21 |
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
|
22 |
exit;
|
inc/pages/settings.php
CHANGED
@@ -121,16 +121,16 @@ $setting_switch_fields = array(
|
|
121 |
>
|
122 |
</div>
|
123 |
<ul class="ju-tabs tabs ju-menu-tabs">
|
124 |
-
<?php foreach ($tabs_data as $
|
125 |
-
<li class="tab" data-tab-title="<?php echo esc_attr($
|
126 |
-
<a href="#<?php echo esc_attr($
|
127 |
-
class="link-tab white-text waves-effect waves-light <?php echo (empty($
|
128 |
>
|
129 |
-
<i class="material-icons menu-tab-icon"><?php echo esc_html($
|
130 |
<span class="tab-title"
|
131 |
-
title="<?php echo esc_attr($
|
132 |
<?php
|
133 |
-
if ($
|
134 |
if (version_compare(PHP_VERSION, '7.2.0', '<') || !in_array('curl', get_loaded_extensions()) || !extension_loaded('libxml')) {
|
135 |
echo '<i class="material-icons system-checkbox material-icons-menu-alert" style="float: right;vertical-align: text-bottom;">info</i>';
|
136 |
}
|
@@ -145,15 +145,15 @@ $setting_switch_fields = array(
|
|
145 |
<div class="ju-right-panel">
|
146 |
<div class="ju-content-wrapper">
|
147 |
<div id="profiles-container">
|
148 |
-
<?php foreach ($tabs_data as $
|
149 |
-
<div class="ju-content-wrapper" id="<?php echo esc_attr($
|
150 |
<?php
|
151 |
-
if (!empty($
|
152 |
?>
|
153 |
<div class="ju-top-tabs-wrapper">
|
154 |
<ul class="tabs ju-top-tabs">
|
155 |
<?php
|
156 |
-
foreach ($
|
157 |
?>
|
158 |
|
159 |
<li class="tab">
|
@@ -171,15 +171,15 @@ $setting_switch_fields = array(
|
|
171 |
<?php
|
172 |
endif;
|
173 |
?>
|
174 |
-
<?php if ($
|
175 |
<div class="wpms_width_100 top_bar">
|
176 |
-
<h1><?php echo esc_html($
|
177 |
</div>
|
178 |
<?php endif; ?>
|
179 |
|
180 |
<?php
|
181 |
-
// phpcs:ignore WordPress.Security.NonceVerification.
|
182 |
-
if (isset($_POST['btn_wpms_save']) && $
|
183 |
?>
|
184 |
<div class="wpms_width_100 top_bar saved_infos">
|
185 |
<?php
|
@@ -189,7 +189,7 @@ $setting_switch_fields = array(
|
|
189 |
<?php
|
190 |
}
|
191 |
?>
|
192 |
-
<?php include_once(WPMETASEO_PLUGIN_DIR . '/inc/pages/settings/' . $
|
193 |
</div>
|
194 |
<?php endforeach; ?>
|
195 |
|
@@ -202,7 +202,7 @@ $setting_switch_fields = array(
|
|
202 |
<script type="text/javascript">
|
203 |
jQuery(document).ready(function ($) {
|
204 |
<?php
|
205 |
-
// phpcs:disable Generic.WhiteSpace.ScopeIndent.Incorrect, Generic.WhiteSpace.ScopeIndent.IncorrectExact, WordPress.Security.NonceVerification.
|
206 |
if (!empty($_POST['wpmf_hash'])) :
|
207 |
?>
|
208 |
$('.ju-top-tabs .link-tab[href="#<?php echo esc_html($_POST['wpmf_hash']) ?>"]').click();
|
121 |
>
|
122 |
</div>
|
123 |
<ul class="ju-tabs tabs ju-menu-tabs">
|
124 |
+
<?php foreach ($tabs_data as $value) : ?>
|
125 |
+
<li class="tab" data-tab-title="<?php echo esc_attr($value['title']) ?>">
|
126 |
+
<a href="#<?php echo esc_attr($value['id']) ?>"
|
127 |
+
class="link-tab white-text waves-effect waves-light <?php echo (empty($value['sub_tabs'])) ? 'no-submenus' : 'with-submenus' ?>"
|
128 |
>
|
129 |
+
<i class="material-icons menu-tab-icon"><?php echo esc_html($value['icon']) ?></i>
|
130 |
<span class="tab-title"
|
131 |
+
title="<?php echo esc_attr($value['title']) ?>"><?php echo esc_html($value['title']) ?></span>
|
132 |
<?php
|
133 |
+
if ($value['id'] === 'system_check') {
|
134 |
if (version_compare(PHP_VERSION, '7.2.0', '<') || !in_array('curl', get_loaded_extensions()) || !extension_loaded('libxml')) {
|
135 |
echo '<i class="material-icons system-checkbox material-icons-menu-alert" style="float: right;vertical-align: text-bottom;">info</i>';
|
136 |
}
|
145 |
<div class="ju-right-panel">
|
146 |
<div class="ju-content-wrapper">
|
147 |
<div id="profiles-container">
|
148 |
+
<?php foreach ($tabs_data as $value) : ?>
|
149 |
+
<div class="ju-content-wrapper" id="<?php echo esc_attr($value['id']) ?>" style="display: none">
|
150 |
<?php
|
151 |
+
if (!empty($value['sub_tabs'])) :
|
152 |
?>
|
153 |
<div class="ju-top-tabs-wrapper">
|
154 |
<ul class="tabs ju-top-tabs">
|
155 |
<?php
|
156 |
+
foreach ($value['sub_tabs'] as $tab_id => $tab_label) :
|
157 |
?>
|
158 |
|
159 |
<li class="tab">
|
171 |
<?php
|
172 |
endif;
|
173 |
?>
|
174 |
+
<?php if ($value['id'] !== 'image_compression' && $value['id'] !== 'cloud') : ?>
|
175 |
<div class="wpms_width_100 top_bar">
|
176 |
+
<h1><?php echo esc_html($value['title']) . ' ' . esc_html__('Settings', 'wp-meta-seo') ?></h1>
|
177 |
</div>
|
178 |
<?php endif; ?>
|
179 |
|
180 |
<?php
|
181 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- View request, no action
|
182 |
+
if (isset($_POST['btn_wpms_save']) && $value['id'] !== 'cloud') {
|
183 |
?>
|
184 |
<div class="wpms_width_100 top_bar saved_infos">
|
185 |
<?php
|
189 |
<?php
|
190 |
}
|
191 |
?>
|
192 |
+
<?php include_once(WPMETASEO_PLUGIN_DIR . '/inc/pages/settings/' . $value['id'] . '.php'); ?>
|
193 |
</div>
|
194 |
<?php endforeach; ?>
|
195 |
|
202 |
<script type="text/javascript">
|
203 |
jQuery(document).ready(function ($) {
|
204 |
<?php
|
205 |
+
// phpcs:disable Generic.WhiteSpace.ScopeIndent.Incorrect, Generic.WhiteSpace.ScopeIndent.IncorrectExact, WordPress.Security.NonceVerification.Missing -- View request, no action
|
206 |
if (!empty($_POST['wpmf_hash'])) :
|
207 |
?>
|
208 |
$('.ju-top-tabs .link-tab[href="#<?php echo esc_html($_POST['wpmf_hash']) ?>"]').click();
|
inc/pages/settings/image_compression.php
CHANGED
@@ -29,8 +29,8 @@ if (isset($_GET['action'])) {
|
|
29 |
include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
|
30 |
|
31 |
$plugin = isset($_REQUEST['plugin']) ? trim($_REQUEST['plugin']) : '';
|
32 |
-
$
|
33 |
-
if ('install-plugin' === $
|
34 |
/**
|
35 |
* Filter check capability of current user to install plugin
|
36 |
*
|
@@ -71,19 +71,19 @@ if (isset($_GET['action'])) {
|
|
71 |
wp_die($api);
|
72 |
}
|
73 |
|
74 |
-
$
|
75 |
-
$
|
76 |
-
$
|
77 |
-
$
|
78 |
$nonce = 'install-plugin_' . $plugin;
|
79 |
$url = 'update.php?action=install-plugin&plugin=' . urlencode($plugin);
|
80 |
if (isset($_GET['from'])) {
|
81 |
$url .= '&from=' . urlencode(stripslashes($_GET['from']));
|
82 |
}
|
83 |
|
84 |
-
$upgrader = new Plugin_Upgrader(new Plugin_Installer_Skin(compact('
|
85 |
$upgrader->install($api->download_link);
|
86 |
-
} elseif ('activate' === $
|
87 |
/**
|
88 |
* Filter check capability of current user to active plugin
|
89 |
*
|
29 |
include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
|
30 |
|
31 |
$plugin = isset($_REQUEST['plugin']) ? trim($_REQUEST['plugin']) : '';
|
32 |
+
$request_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
|
33 |
+
if ('install-plugin' === $request_action) {
|
34 |
/**
|
35 |
* Filter check capability of current user to install plugin
|
36 |
*
|
71 |
wp_die($api);
|
72 |
}
|
73 |
|
74 |
+
$plugin_title = __('Plugin Install', 'wp-meta-seo');
|
75 |
+
$plugin_parent_file = 'plugins.php';
|
76 |
+
$plugin_submenu_file = 'plugin-install.php';
|
77 |
+
$plugin_title = sprintf(__('Installing Plugin: %s', 'wp-meta-seo'), $api->name . ' ' . $api->version);
|
78 |
$nonce = 'install-plugin_' . $plugin;
|
79 |
$url = 'update.php?action=install-plugin&plugin=' . urlencode($plugin);
|
80 |
if (isset($_GET['from'])) {
|
81 |
$url .= '&from=' . urlencode(stripslashes($_GET['from']));
|
82 |
}
|
83 |
|
84 |
+
$upgrader = new Plugin_Upgrader(new Plugin_Installer_Skin(compact('plugin_title', 'url', 'nonce', 'plugin', 'api')));
|
85 |
$upgrader->install($api->download_link);
|
86 |
+
} elseif ('activate' === $request_action) {
|
87 |
/**
|
88 |
* Filter check capability of current user to active plugin
|
89 |
*
|
inc/pages/settings/redirections_404.php
CHANGED
@@ -59,9 +59,9 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
59 |
<select name="wpms_redirect[wpms_page_redirected]"
|
60 |
class="wpms_page_redirected" <?php echo esc_attr($disable) ?>>
|
61 |
<option value="none"><?php esc_html_e('— Select —', 'wp-meta-seo') ?></option>
|
62 |
-
<?php foreach ($posts as $
|
63 |
-
<option <?php selected($defaul_settings_404['wpms_page_redirected'], $
|
64 |
-
value="<?php echo esc_attr($
|
65 |
<?php endforeach; ?>
|
66 |
</select>
|
67 |
</label>
|
59 |
<select name="wpms_redirect[wpms_page_redirected]"
|
60 |
class="wpms_page_redirected" <?php echo esc_attr($disable) ?>>
|
61 |
<option value="none"><?php esc_html_e('— Select —', 'wp-meta-seo') ?></option>
|
62 |
+
<?php foreach ($posts as $value) : ?>
|
63 |
+
<option <?php selected($defaul_settings_404['wpms_page_redirected'], $value->ID) ?>
|
64 |
+
value="<?php echo esc_attr($value->ID) ?>"><?php echo esc_html($value->post_title) ?></option>
|
65 |
<?php endforeach; ?>
|
66 |
</select>
|
67 |
</label>
|
inc/pages/sitemaps/metaseo-google-sitemap.php
CHANGED
@@ -68,6 +68,7 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
68 |
require_once(WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_pages.php');
|
69 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
|
70 |
if (!empty($custom_post_types)) {
|
|
|
71 |
foreach ($custom_post_types as $post_type => $label) {
|
72 |
ob_start();
|
73 |
require(WPMETASEO_ADDON_PLUGIN_DIR . 'inc/page/sitemaps/posts_custom.php');
|
68 |
require_once(WPMETASEO_PLUGIN_DIR . 'inc/pages/sitemaps/metaseo-source_pages.php');
|
69 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
|
70 |
if (!empty($custom_post_types)) {
|
71 |
+
//phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- No impact on assignment
|
72 |
foreach ($custom_post_types as $post_type => $label) {
|
73 |
ob_start();
|
74 |
require(WPMETASEO_ADDON_PLUGIN_DIR . 'inc/page/sitemaps/posts_custom.php');
|
inc/pages/sitemaps/metaseo-source_menu.php
CHANGED
@@ -47,8 +47,8 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
47 |
</div>
|
48 |
|
49 |
<?php
|
50 |
-
foreach ($terms as $
|
51 |
-
$sitemap->viewMenus($
|
52 |
}
|
53 |
echo '<input name="_metaseo_settings_sitemap[wpms_check_firstsave]" type="hidden" value="1">';
|
54 |
}
|
47 |
</div>
|
48 |
|
49 |
<?php
|
50 |
+
foreach ($terms as $value) {
|
51 |
+
$sitemap->viewMenus($value);
|
52 |
}
|
53 |
echo '<input name="_metaseo_settings_sitemap[wpms_check_firstsave]" type="hidden" value="1">';
|
54 |
}
|
inc/pages/sitemaps/metaseo-source_pages.php
CHANGED
@@ -96,51 +96,51 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
96 |
|
97 |
<div id="wrap_sitemap_option_pages" class="wrap_sitemap_option">
|
98 |
<?php
|
99 |
-
$
|
100 |
-
foreach ($
|
101 |
-
if (empty($sitemap->settings_sitemap['wpms_sitemap_pages'][$
|
102 |
$pagefrequency = 'monthly';
|
103 |
} else {
|
104 |
-
$pagefrequency = $sitemap->settings_sitemap['wpms_sitemap_pages'][$
|
105 |
}
|
106 |
-
if (empty($sitemap->settings_sitemap['wpms_sitemap_pages'][$
|
107 |
$pagepriority = '1.0';
|
108 |
} else {
|
109 |
-
$pagepriority = $sitemap->settings_sitemap['wpms_sitemap_pages'][$
|
110 |
}
|
111 |
$slpr = $sitemap->viewPriority(
|
112 |
-
'priority_pages_' . $
|
113 |
-
'_metaseo_settings_sitemap[wpms_sitemap_pages][' . $
|
114 |
$pagepriority
|
115 |
);
|
116 |
$slfr = $sitemap->viewFrequency(
|
117 |
-
'frequency_pages_' . $
|
118 |
-
'_metaseo_settings_sitemap[wpms_sitemap_pages][' . $
|
119 |
$pagefrequency
|
120 |
);
|
121 |
-
$permalink = get_permalink($
|
122 |
echo '<div class="wpms_row wpms_row_record">';
|
123 |
echo '<div style="line-height:30px">';
|
124 |
-
if (isset($sitemap->settings_sitemap['wpms_sitemap_pages'][$
|
125 |
-
&& (int) $sitemap->settings_sitemap['wpms_sitemap_pages'][$
|
126 |
echo '<input class="wpms_sitemap_input_link checked"
|
127 |
type="hidden" data-type="page" value="' . esc_attr($permalink) . '">';
|
128 |
echo '<div class="pure-checkbox">';
|
129 |
echo '<input class="cb_sitemaps_pages wpms_xmap_pages"
|
130 |
-
id="' . esc_attr('wpms_sitemap_pages_' . $
|
131 |
-
name="' . esc_attr('_metaseo_settings_sitemap[wpms_sitemap_pages][' . $
|
132 |
-
value="' . esc_attr($
|
133 |
-
echo '<label for="' . esc_attr('wpms_sitemap_pages_' . $
|
134 |
echo '</div>';
|
135 |
} else {
|
136 |
echo '<input class="wpms_sitemap_input_link" type="hidden"
|
137 |
data-type="page" value="' . esc_attr($permalink) . '">';
|
138 |
echo '<div class="pure-checkbox">';
|
139 |
echo '<input class="cb_sitemaps_pages wpms_xmap_pages"
|
140 |
-
id="' . esc_attr('wpms_sitemap_pages_' . $
|
141 |
-
name="' . esc_attr('_metaseo_settings_sitemap[wpms_sitemap_pages][' . $
|
142 |
-
value="' . esc_attr($
|
143 |
-
echo '<label for="' . esc_attr('wpms_sitemap_pages_' . $
|
144 |
echo '</div>';
|
145 |
}
|
146 |
// phpcs:ignore WordPress.Security.EscapeOutput -- Content escaped in the method MetaSeoSitemap::viewPriority and MetaSeoSitemap::viewFrequency
|
96 |
|
97 |
<div id="wrap_sitemap_option_pages" class="wrap_sitemap_option">
|
98 |
<?php
|
99 |
+
$listpages = $sitemap->getPages();
|
100 |
+
foreach ($listpages as $value) {
|
101 |
+
if (empty($sitemap->settings_sitemap['wpms_sitemap_pages'][$value->ID]['frequency'])) {
|
102 |
$pagefrequency = 'monthly';
|
103 |
} else {
|
104 |
+
$pagefrequency = $sitemap->settings_sitemap['wpms_sitemap_pages'][$value->ID]['frequency'];
|
105 |
}
|
106 |
+
if (empty($sitemap->settings_sitemap['wpms_sitemap_pages'][$value->ID]['priority'])) {
|
107 |
$pagepriority = '1.0';
|
108 |
} else {
|
109 |
+
$pagepriority = $sitemap->settings_sitemap['wpms_sitemap_pages'][$value->ID]['priority'];
|
110 |
}
|
111 |
$slpr = $sitemap->viewPriority(
|
112 |
+
'priority_pages_' . $value->ID,
|
113 |
+
'_metaseo_settings_sitemap[wpms_sitemap_pages][' . $value->ID . '][priority]',
|
114 |
$pagepriority
|
115 |
);
|
116 |
$slfr = $sitemap->viewFrequency(
|
117 |
+
'frequency_pages_' . $value->ID,
|
118 |
+
'_metaseo_settings_sitemap[wpms_sitemap_pages][' . $value->ID . '][frequency]',
|
119 |
$pagefrequency
|
120 |
);
|
121 |
+
$permalink = get_permalink($value->ID);
|
122 |
echo '<div class="wpms_row wpms_row_record">';
|
123 |
echo '<div style="line-height:30px">';
|
124 |
+
if (isset($sitemap->settings_sitemap['wpms_sitemap_pages'][$value->ID]['post_id'])
|
125 |
+
&& (int) $sitemap->settings_sitemap['wpms_sitemap_pages'][$value->ID]['post_id'] === (int) $value->ID) {
|
126 |
echo '<input class="wpms_sitemap_input_link checked"
|
127 |
type="hidden" data-type="page" value="' . esc_attr($permalink) . '">';
|
128 |
echo '<div class="pure-checkbox">';
|
129 |
echo '<input class="cb_sitemaps_pages wpms_xmap_pages"
|
130 |
+
id="' . esc_attr('wpms_sitemap_pages_' . $value->ID) . '" type="checkbox"
|
131 |
+
name="' . esc_attr('_metaseo_settings_sitemap[wpms_sitemap_pages][' . $value->ID . '][post_id]') . '"
|
132 |
+
value="' . esc_attr($value->ID) . '" checked>';
|
133 |
+
echo '<label for="' . esc_attr('wpms_sitemap_pages_' . $value->ID) . '" class="wpms-text ju-setting-label">' . esc_html($value->post_title) . '</label>';
|
134 |
echo '</div>';
|
135 |
} else {
|
136 |
echo '<input class="wpms_sitemap_input_link" type="hidden"
|
137 |
data-type="page" value="' . esc_attr($permalink) . '">';
|
138 |
echo '<div class="pure-checkbox">';
|
139 |
echo '<input class="cb_sitemaps_pages wpms_xmap_pages"
|
140 |
+
id="' . esc_attr('wpms_sitemap_pages_' . $value->ID) . '" type="checkbox"
|
141 |
+
name="' . esc_attr('_metaseo_settings_sitemap[wpms_sitemap_pages][' . $value->ID . '][post_id]') . '"
|
142 |
+
value="' . esc_attr($value->ID) . '">';
|
143 |
+
echo '<label for="' . esc_attr('wpms_sitemap_pages_' . $value->ID) . '" class="wpms-text ju-setting-label">' . esc_html($value->post_title) . '</label>';
|
144 |
echo '</div>';
|
145 |
}
|
146 |
// phpcs:ignore WordPress.Security.EscapeOutput -- Content escaped in the method MetaSeoSitemap::viewPriority and MetaSeoSitemap::viewFrequency
|
inc/pages/sitemaps/metaseo-source_posts.php
CHANGED
@@ -99,16 +99,16 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
99 |
|
100 |
<div id="wrap_sitemap_option_posts" class="wrap_sitemap_option">
|
101 |
<?php
|
102 |
-
$
|
103 |
$check = array();
|
104 |
$desclink_category_add = esc_html__('Add link to category name', 'wp-meta-seo');
|
105 |
$desclink_category_remove = esc_html__('Remove link to category name', 'wp-meta-seo');
|
106 |
-
foreach ($
|
107 |
-
if (!in_array($
|
108 |
-
$check[] = $
|
109 |
}
|
110 |
|
111 |
-
if (in_array($
|
112 |
$checked = 'checked';
|
113 |
} else {
|
114 |
$checked = '';
|
@@ -118,14 +118,14 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
118 |
<div class="ju-settings-option wpms_row">
|
119 |
<div class="wpms_row_full">
|
120 |
<label class="ju-setting-label text wpms-uppercase">
|
121 |
-
<?php echo esc_html($
|
122 |
</label>
|
123 |
<div class="ju-switch-button">
|
124 |
<label class="switch">
|
125 |
<input class="sitemap_addlink_categories"
|
126 |
-
id="<?php echo esc_attr('sitemap_addlink_categories_' . $
|
127 |
type="checkbox"
|
128 |
-
value="<?php echo esc_attr($
|
129 |
<span class="slider round"></span>
|
130 |
</label>
|
131 |
</div>
|
@@ -139,8 +139,8 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
139 |
</label>
|
140 |
<div class="ju-switch-button">
|
141 |
<label class="switch">
|
142 |
-
<input data-category="<?php echo esc_attr($
|
143 |
-
class="xm_cb_all" id="<?php echo esc_attr($
|
144 |
type="checkbox">
|
145 |
<span class="slider round"></span>
|
146 |
</label>
|
@@ -150,9 +150,9 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
150 |
</div>
|
151 |
<?php
|
152 |
|
153 |
-
foreach ($
|
154 |
-
$category = get_the_terms($p, $
|
155 |
-
if ((int) $category[0]->term_id === (int) $
|
156 |
if (empty($sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['frequency'])) {
|
157 |
$postfrequency = 'monthly';
|
158 |
} else {
|
@@ -177,28 +177,28 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
177 |
echo '<div class="wpms_row wpms_row_record">';
|
178 |
echo '<div style="float:left;line-height:30px;min-width: 300px;">';
|
179 |
if (strlen($p->post_title) > 30) {
|
180 |
-
$
|
181 |
} else {
|
182 |
-
$
|
183 |
}
|
184 |
if (isset($sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id'])
|
185 |
&& (int) $sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id'] === (int) $p->ID) {
|
186 |
echo '<input class="wpms_sitemap_input_link checked"
|
187 |
type="hidden" data-type="post" value="' . esc_attr($permalink) . '">';
|
188 |
echo '<div class="pure-checkbox">';
|
189 |
-
echo '<input class="' . esc_attr('cb_sitemaps_posts wpms_xmap_posts ' . $
|
190 |
id="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" type="checkbox"
|
191 |
name="_metaseo_settings_sitemap[wpms_sitemap_posts]" value="' . esc_attr($p->ID) . '" checked>';
|
192 |
-
echo '<label for="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" class="wpms-text">' . esc_html($
|
193 |
echo '</div>';
|
194 |
} else {
|
195 |
echo '<input class="wpms_sitemap_input_link" type="hidden"
|
196 |
data-type="post" value="' . esc_attr($permalink) . '">';
|
197 |
echo '<div class="pure-checkbox">';
|
198 |
-
echo '<input class="' . esc_attr('cb_sitemaps_posts wpms_xmap_posts ' . $
|
199 |
id="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" type="checkbox"
|
200 |
name="_metaseo_settings_sitemap[wpms_sitemap_posts]" value="' . esc_attr($p->ID) . '">';
|
201 |
-
echo '<label for="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" class="wpms-text">' . esc_html($
|
202 |
echo '</div>';
|
203 |
}
|
204 |
|
@@ -209,8 +209,8 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
209 |
}
|
210 |
}
|
211 |
|
212 |
-
if ($
|
213 |
-
echo '<a href="#open-popup-posts-list" class="open-popup-posts-list ju-button wpms-small-btn wpms_left m-t-10 see-more-posts" data-slug="' . esc_attr($
|
214 |
}
|
215 |
}
|
216 |
?>
|
99 |
|
100 |
<div id="wrap_sitemap_option_posts" class="wrap_sitemap_option">
|
101 |
<?php
|
102 |
+
$listposts = $sitemap->getPosts();
|
103 |
$check = array();
|
104 |
$desclink_category_add = esc_html__('Add link to category name', 'wp-meta-seo');
|
105 |
$desclink_category_remove = esc_html__('Remove link to category name', 'wp-meta-seo');
|
106 |
+
foreach ($listposts as $value) {
|
107 |
+
if (!in_array($value->taxo, $check)) {
|
108 |
+
$check[] = $value->taxo;
|
109 |
}
|
110 |
|
111 |
+
if (in_array($value->cat_ID, $sitemap->settings_sitemap['wpms_category_link'])) {
|
112 |
$checked = 'checked';
|
113 |
} else {
|
114 |
$checked = '';
|
118 |
<div class="ju-settings-option wpms_row">
|
119 |
<div class="wpms_row_full">
|
120 |
<label class="ju-setting-label text wpms-uppercase">
|
121 |
+
<?php echo esc_html($value->cat_name) ?>
|
122 |
</label>
|
123 |
<div class="ju-switch-button">
|
124 |
<label class="switch">
|
125 |
<input class="sitemap_addlink_categories"
|
126 |
+
id="<?php echo esc_attr('sitemap_addlink_categories_' . $value->cat_ID) ?>"
|
127 |
type="checkbox"
|
128 |
+
value="<?php echo esc_attr($value->cat_ID) ?>" <?php echo esc_html($checked) ?>>
|
129 |
<span class="slider round"></span>
|
130 |
</label>
|
131 |
</div>
|
139 |
</label>
|
140 |
<div class="ju-switch-button">
|
141 |
<label class="switch">
|
142 |
+
<input data-category="<?php echo esc_attr($value->taxo . $value->slug) ?>"
|
143 |
+
class="xm_cb_all" id="<?php echo esc_attr($value->taxo . $value->slug) ?>"
|
144 |
type="checkbox">
|
145 |
<span class="slider round"></span>
|
146 |
</label>
|
150 |
</div>
|
151 |
<?php
|
152 |
|
153 |
+
foreach ($value->results as $p) {
|
154 |
+
$category = get_the_terms($p, $value->taxo);
|
155 |
+
if ((int) $category[0]->term_id === (int) $value->cat_ID) {
|
156 |
if (empty($sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['frequency'])) {
|
157 |
$postfrequency = 'monthly';
|
158 |
} else {
|
177 |
echo '<div class="wpms_row wpms_row_record">';
|
178 |
echo '<div style="float:left;line-height:30px;min-width: 300px;">';
|
179 |
if (strlen($p->post_title) > 30) {
|
180 |
+
$ptitle = substr($p->post_title, 0, 30);
|
181 |
} else {
|
182 |
+
$ptitle = $p->post_title;
|
183 |
}
|
184 |
if (isset($sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id'])
|
185 |
&& (int) $sitemap->settings_sitemap['wpms_sitemap_posts'][$p->ID]['post_id'] === (int) $p->ID) {
|
186 |
echo '<input class="wpms_sitemap_input_link checked"
|
187 |
type="hidden" data-type="post" value="' . esc_attr($permalink) . '">';
|
188 |
echo '<div class="pure-checkbox">';
|
189 |
+
echo '<input class="' . esc_attr('cb_sitemaps_posts wpms_xmap_posts ' . $value->taxo . $value->slug) . '"
|
190 |
id="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" type="checkbox"
|
191 |
name="_metaseo_settings_sitemap[wpms_sitemap_posts]" value="' . esc_attr($p->ID) . '" checked>';
|
192 |
+
echo '<label for="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" class="wpms-text">' . esc_html($ptitle) . '</label>';
|
193 |
echo '</div>';
|
194 |
} else {
|
195 |
echo '<input class="wpms_sitemap_input_link" type="hidden"
|
196 |
data-type="post" value="' . esc_attr($permalink) . '">';
|
197 |
echo '<div class="pure-checkbox">';
|
198 |
+
echo '<input class="' . esc_attr('cb_sitemaps_posts wpms_xmap_posts ' . $value->taxo . $value->slug) . '"
|
199 |
id="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" type="checkbox"
|
200 |
name="_metaseo_settings_sitemap[wpms_sitemap_posts]" value="' . esc_attr($p->ID) . '">';
|
201 |
+
echo '<label for="' . esc_attr('wpms_sitemap_posts_' . $p->ID) . '" class="wpms-text">' . esc_html($ptitle) . '</label>';
|
202 |
echo '</div>';
|
203 |
}
|
204 |
|
209 |
}
|
210 |
}
|
211 |
|
212 |
+
if ($value->count_posts > 10) {
|
213 |
+
echo '<a href="#open-popup-posts-list" class="open-popup-posts-list ju-button wpms-small-btn wpms_left m-t-10 see-more-posts" data-slug="' . esc_attr($value->slug) . '" data-category="' . esc_attr($value->cat_ID) . '"><i class="material-icons wpms-middle">arrow_right_alt</i><label>' . esc_html__('See more posts in this category', 'wp-meta-seo') . '</label></a>';
|
214 |
}
|
215 |
}
|
216 |
?>
|
inc/pages/sitemaps/sitemap_menus.php
CHANGED
@@ -24,9 +24,9 @@ defined('ABSPATH') || die('No direct script access allowed!');
|
|
24 |
<?php
|
25 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
|
26 |
if (!empty($custom_post_types)) {
|
27 |
-
foreach ($custom_post_types as $
|
28 |
echo '<li class="tab wpmstab col">';
|
29 |
-
echo '<a href="' . esc_attr('#menu_source_' . $
|
30 |
echo '</li>';
|
31 |
}
|
32 |
}
|
24 |
<?php
|
25 |
if (is_plugin_active(WPMSEO_ADDON_FILENAME)) {
|
26 |
if (!empty($custom_post_types)) {
|
27 |
+
foreach ($custom_post_types as $key => $label) {
|
28 |
echo '<li class="tab wpmstab col">';
|
29 |
+
echo '<a href="' . esc_attr('#menu_source_' . $key) . '">' . esc_html(ucfirst($label)) . '</a>';
|
30 |
echo '</li>';
|
31 |
}
|
32 |
}
|
languages/wp-meta-seo-en_US.mo
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: JoomUnited
|
3 |
Tags: google, webmaster tools, keywords, meta, meta description, meta keywords, meta title, robots meta, search engine optimization, seo, wordpress seo, yahoo, image optimization, image resize, custom post seo, redirect, redirection, 301, broken link
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 4.0.
|
7 |
Requires PHP: 5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -277,6 +277,14 @@ Yes WP Meta SEO is compatible with Gutenberg editor since 3.7 version.
|
|
277 |
|
278 |
== Changelog ==
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
= 4.0.3 =
|
281 |
* Fix : XML Sitemap cannot be parsed in google console
|
282 |
* Fix : Resize images and check on dashboard
|
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: 5.1.1
|
6 |
+
Stable tag: 4.0.4
|
7 |
Requires PHP: 5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
277 |
|
278 |
== Changelog ==
|
279 |
|
280 |
+
= 4.0.4 =
|
281 |
+
* Add : Compatible of the SEO checker and ACF fields
|
282 |
+
* Add : Change meta title and meta description length
|
283 |
+
* Fix : Conflict image alt info and Elementor builder
|
284 |
+
* Fix : Default image and priority of meta
|
285 |
+
* Fix : Conflict with other SEO plugin (WooCommerce Multivendor plugin)
|
286 |
+
* Fix : Save new term in product category
|
287 |
+
|
288 |
= 4.0.3 =
|
289 |
* Fix : XML Sitemap cannot be parsed in google console
|
290 |
* Fix : Resize images and check on dashboard
|
wp-meta-seo.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: WP Meta SEO
|
5 |
* Plugin URI: http://www.joomunited.com/wordpress-products/wp-meta-seo
|
6 |
* Description: WP Meta SEO is a plugin for WordPress to fill meta for content, images and main SEO info in a single view.
|
7 |
-
* Version: 4.0.
|
8 |
* Text Domain: wp-meta-seo
|
9 |
* Domain Path: /languages
|
10 |
* Author: JoomUnited
|
@@ -121,7 +121,7 @@ if (!defined('WPMSEO_VERSION')) {
|
|
121 |
/**
|
122 |
* Plugin version
|
123 |
*/
|
124 |
-
define('WPMSEO_VERSION', '4.0.
|
125 |
}
|
126 |
|
127 |
if (!defined('WPMS_CLIENTID')) {
|
@@ -142,14 +142,14 @@ if (!defined('MPMSCAT_TITLE_LENGTH')) {
|
|
142 |
/**
|
143 |
* Default meta title length
|
144 |
*/
|
145 |
-
define('MPMSCAT_TITLE_LENGTH',
|
146 |
}
|
147 |
|
148 |
if (!defined('MPMSCAT_DESC_LENGTH')) {
|
149 |
/**
|
150 |
* Default meta description length
|
151 |
*/
|
152 |
-
define('MPMSCAT_DESC_LENGTH',
|
153 |
}
|
154 |
|
155 |
if (!defined('MPMSCAT_KEYWORDS_LENGTH')) {
|
@@ -616,7 +616,7 @@ if (is_admin()) {
|
|
616 |
}
|
617 |
}
|
618 |
|
619 |
-
add_action('wp_head', 'wpmshead',
|
620 |
/**
|
621 |
* WPMS frontend head
|
622 |
*
|
@@ -636,7 +636,7 @@ if (is_admin()) {
|
|
636 |
do_action('wpmsseo_head');
|
637 |
|
638 |
if (!empty($old_wp_query)) {
|
639 |
-
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.
|
640 |
$GLOBALS['wp_query'] = $old_wp_query;
|
641 |
unset($old_wp_query);
|
642 |
}
|
@@ -708,6 +708,7 @@ if (is_admin()) {
|
|
708 |
} else {
|
709 |
$meta_title = get_metadata('term', $term->term_id, 'wpms_category_metatitle', true);
|
710 |
}
|
|
|
711 |
}
|
712 |
return esc_html($meta_title);
|
713 |
}
|
4 |
* Plugin Name: WP Meta SEO
|
5 |
* Plugin URI: http://www.joomunited.com/wordpress-products/wp-meta-seo
|
6 |
* Description: WP Meta SEO is a plugin for WordPress to fill meta for content, images and main SEO info in a single view.
|
7 |
+
* Version: 4.0.4
|
8 |
* Text Domain: wp-meta-seo
|
9 |
* Domain Path: /languages
|
10 |
* Author: JoomUnited
|
121 |
/**
|
122 |
* Plugin version
|
123 |
*/
|
124 |
+
define('WPMSEO_VERSION', '4.0.4');
|
125 |
}
|
126 |
|
127 |
if (!defined('WPMS_CLIENTID')) {
|
142 |
/**
|
143 |
* Default meta title length
|
144 |
*/
|
145 |
+
define('MPMSCAT_TITLE_LENGTH', 60);
|
146 |
}
|
147 |
|
148 |
if (!defined('MPMSCAT_DESC_LENGTH')) {
|
149 |
/**
|
150 |
* Default meta description length
|
151 |
*/
|
152 |
+
define('MPMSCAT_DESC_LENGTH', 158);
|
153 |
}
|
154 |
|
155 |
if (!defined('MPMSCAT_KEYWORDS_LENGTH')) {
|
616 |
}
|
617 |
}
|
618 |
|
619 |
+
add_action('wp_head', 'wpmshead', 30);
|
620 |
/**
|
621 |
* WPMS frontend head
|
622 |
*
|
636 |
do_action('wpmsseo_head');
|
637 |
|
638 |
if (!empty($old_wp_query)) {
|
639 |
+
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- This combines all the output on the frontend
|
640 |
$GLOBALS['wp_query'] = $old_wp_query;
|
641 |
unset($old_wp_query);
|
642 |
}
|
708 |
} else {
|
709 |
$meta_title = get_metadata('term', $term->term_id, 'wpms_category_metatitle', true);
|
710 |
}
|
711 |
+
$meta_title = $opengraph->replaceSnippet($meta_title, null);
|
712 |
}
|
713 |
return esc_html($meta_title);
|
714 |
}
|