Version Description
- NEW Edit homepage with universal SEO metabox
- INFO Disable Universal SEO metabox by default (will not affect users who already have version 5.0 of SEOPress)
- INFO Add an option to disable the universal SEO metabox from the configuration wizard
- INFO Strengthening security (thanks to Wordfence)
- FIX Add schema notification
- FIX Pixel counter for title and meta description
- FIX Notice: Undefined index: bestRating wp-seopress-pro/src/JsonSchemas/Review.php
- FIX WordPress < 5.0 compatibility (is_block_editor() error)
- FIX PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in wp-seopress/src/Actions/Admin/ModuleMetabox.php:44
- FIX Warning: Undefined variable $sp_seo_admin_menu in wp-seopress-pro/inc/admin/admin.php on line 134 (Multisite only)
Download this release
Release Info
Developer | rainbowgeek |
Plugin | SEOPress |
Version | 5.0.4 |
Comparing to | |
See all releases |
Code changes from version 5.0.3 to 5.0.4
- assets/js/seopress-media-uploader.js +68 -48
- inc/admin/admin-dyn-variables-helper.php +1 -1
- inc/admin/admin.php +58 -2
- inc/admin/ajax.php +7 -7
- inc/admin/callbacks/Advanced.php +9 -1
- inc/admin/callbacks/Social.php +4 -2
- inc/admin/callbacks/Titles.php +1 -1
- inc/admin/metaboxes/admin-metaboxes-content-analysis-form.php +4 -11
- inc/admin/metaboxes/admin-metaboxes-form.php +11 -18
- inc/admin/sanitize/Sanitize.php +99 -93
- inc/admin/settings/Main.php +0 -51
- inc/admin/wizard/admin-wizard.php +25 -0
- public/metaboxe.js +116 -21
- readme.txt +13 -1
- seopress-functions.php +22 -0
- seopress.php +2 -2
- src/Actions/Admin/ModuleMetabox.php +10 -5
- src/Actions/Api/ContentAnalysis.php +12 -1
- src/Actions/Api/Metas/RedirectionSettings.php +10 -1
- src/Actions/Api/Metas/RobotSettings.php +10 -1
- src/Actions/Api/Metas/SocialSettings.php +10 -1
- src/Actions/Api/TargetKeywords.php +4 -0
- src/Actions/Api/TitleDescriptionMeta.php +5 -2
- src/Actions/Options/Init.php +1 -0
- src/Helpers/ContentAnalysis.php +2 -2
- src/Services/ContentAnalysis/DomFilterContent.php +2 -2
- src/Services/ContentAnalysis/GetContent.php +12 -12
- src/Services/ContentAnalysis/GetContent/{InboundLinks.php → InternalLinks.php} +1 -1
- src/Services/EnqueueModuleMetabox.php +41 -1
- src/Services/Options/AdvancedOption.php +21 -1
- vendor/composer/InstalledVersions.php +2 -2
- vendor/composer/installed.php +2 -2
assets/js/seopress-media-uploader.js
CHANGED
@@ -1,51 +1,71 @@
|
|
1 |
-
jQuery(document).ready(function($){
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
"#seopress_social_fb_img"
|
24 |
-
]
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
var mediaUploader;
|
3 |
+
$(".button.seopress_social_facebook_img_cpt").click(function (e) {
|
4 |
+
e.preventDefault();
|
5 |
|
6 |
+
var url_field = $(this).parent().find("input[type=text]");
|
7 |
+
// Extend the wp.media object
|
8 |
+
mediaUploader = wp.media.frames.file_frame = wp.media({
|
9 |
+
multiple: false,
|
10 |
+
});
|
11 |
|
12 |
+
// When a file is selected, grab the URL and set it as the text field's value
|
13 |
+
mediaUploader.on("select", function () {
|
14 |
+
attachment = mediaUploader
|
15 |
+
.state()
|
16 |
+
.get("selection")
|
17 |
+
.first()
|
18 |
+
.toJSON();
|
19 |
+
$(url_field).val(attachment.url);
|
20 |
+
});
|
21 |
+
// Open the uploader dialog
|
22 |
+
mediaUploader.open();
|
23 |
+
});
|
|
|
|
|
24 |
|
25 |
+
const array = [
|
26 |
+
"#seopress_social_knowledge_img",
|
27 |
+
"#seopress_social_twitter_img",
|
28 |
+
"#seopress_social_fb_img",
|
29 |
+
];
|
30 |
+
|
31 |
+
array.forEach(function (item) {
|
32 |
+
var mediaUploader;
|
33 |
+
$(item + "_upload").click(function (e) {
|
34 |
+
e.preventDefault();
|
35 |
+
// If the uploader object has already been created, reopen the dialog
|
36 |
+
if (mediaUploader) {
|
37 |
+
mediaUploader.open();
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
// Extend the wp.media object
|
41 |
+
mediaUploader = wp.media.frames.file_frame = wp.media({
|
42 |
+
multiple: false,
|
43 |
+
});
|
44 |
+
|
45 |
+
// When a file is selected, grab the URL and set it as the text field's value
|
46 |
+
mediaUploader.on("select", function () {
|
47 |
+
attachment = mediaUploader
|
48 |
+
.state()
|
49 |
+
.get("selection")
|
50 |
+
.first()
|
51 |
+
.toJSON();
|
52 |
+
$(item + "_meta").val(attachment.url);
|
53 |
+
if (
|
54 |
+
item == "#seopress_social_fb_img" &&
|
55 |
+
typeof sp_social_img != "undefined"
|
56 |
+
) {
|
57 |
+
sp_social_img("fb");
|
58 |
+
}
|
59 |
+
if (
|
60 |
+
item == "#seopress_social_twitter_img" &&
|
61 |
+
typeof sp_social_img != "undefined"
|
62 |
+
) {
|
63 |
+
sp_social_img("twitter");
|
64 |
+
}
|
65 |
+
});
|
66 |
+
|
67 |
+
// Open the uploader dialog
|
68 |
+
mediaUploader.open();
|
69 |
+
});
|
70 |
+
});
|
71 |
+
});
|
inc/admin/admin-dyn-variables-helper.php
CHANGED
@@ -63,7 +63,7 @@ function seopress_get_dyn_variables()
|
|
63 |
*/
|
64 |
function seopress_render_dyn_variables($classes)
|
65 |
{
|
66 |
-
$html = sprintf('<button type="button" class="
|
67 |
if (! empty(seopress_get_dyn_variables())) {
|
68 |
$html .= '<div class="sp-wrap-tag-variables-list"><ul class="sp-tag-variables-list">';
|
69 |
foreach (seopress_get_dyn_variables() as $key => $value) {
|
63 |
*/
|
64 |
function seopress_render_dyn_variables($classes)
|
65 |
{
|
66 |
+
$html = sprintf('<button type="button" class="'.seopress_btn_secondary_classes().' seopress-tag-single-all seopress-tag-dropdown %s"><span class="dashicons dashicons-arrow-down-alt2"></span></button>', $classes);
|
67 |
if (! empty(seopress_get_dyn_variables())) {
|
68 |
$html .= '<div class="sp-wrap-tag-variables-list"><ul class="sp-tag-variables-list">';
|
69 |
foreach (seopress_get_dyn_variables() as $key => $value) {
|
inc/admin/admin.php
CHANGED
@@ -22,7 +22,6 @@ class seopress_options
|
|
22 |
add_action('admin_init', [$this, 'page_init']);
|
23 |
add_action('admin_init', [$this, 'seopress_feature_save'], 30);
|
24 |
add_action('admin_init', [$this, 'seopress_feature_title'], 20);
|
25 |
-
add_action('admin_init', [$this, 'sanitize'], 20);
|
26 |
add_action('admin_init', [$this, 'load_sections'], 30);
|
27 |
add_action('admin_init', [$this, 'load_callbacks'], 40);
|
28 |
}
|
@@ -158,7 +157,55 @@ class seopress_options
|
|
158 |
|
159 |
public function page_init()
|
160 |
{
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
require_once dirname(__FILE__) . '/settings/Titles.php';
|
163 |
require_once dirname(__FILE__) . '/settings/Sitemaps.php';
|
164 |
require_once dirname(__FILE__) . '/settings/Social.php';
|
@@ -170,7 +217,16 @@ class seopress_options
|
|
170 |
|
171 |
public function sanitize($input)
|
172 |
{
|
|
|
173 |
require_once dirname(__FILE__) . '/sanitize/Sanitize.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
|
176 |
public function load_sections()
|
22 |
add_action('admin_init', [$this, 'page_init']);
|
23 |
add_action('admin_init', [$this, 'seopress_feature_save'], 30);
|
24 |
add_action('admin_init', [$this, 'seopress_feature_title'], 20);
|
|
|
25 |
add_action('admin_init', [$this, 'load_sections'], 30);
|
26 |
add_action('admin_init', [$this, 'load_callbacks'], 40);
|
27 |
}
|
157 |
|
158 |
public function page_init()
|
159 |
{
|
160 |
+
|
161 |
+
register_setting(
|
162 |
+
'seopress_option_group', // Option group
|
163 |
+
'seopress_option_name', // Option name
|
164 |
+
[$this, 'sanitize'] // Sanitize
|
165 |
+
);
|
166 |
+
|
167 |
+
register_setting(
|
168 |
+
'seopress_titles_option_group', // Option group
|
169 |
+
'seopress_titles_option_name', // Option name
|
170 |
+
[$this, 'sanitize'] // Sanitize
|
171 |
+
);
|
172 |
+
|
173 |
+
register_setting(
|
174 |
+
'seopress_xml_sitemap_option_group', // Option group
|
175 |
+
'seopress_xml_sitemap_option_name', // Option name
|
176 |
+
[$this, 'sanitize'] // Sanitize
|
177 |
+
);
|
178 |
+
|
179 |
+
register_setting(
|
180 |
+
'seopress_social_option_group', // Option group
|
181 |
+
'seopress_social_option_name', // Option name
|
182 |
+
[$this, 'sanitize'] // Sanitize
|
183 |
+
);
|
184 |
+
|
185 |
+
register_setting(
|
186 |
+
'seopress_google_analytics_option_group', // Option group
|
187 |
+
'seopress_google_analytics_option_name', // Option name
|
188 |
+
[$this, 'sanitize'] // Sanitize
|
189 |
+
);
|
190 |
+
|
191 |
+
register_setting(
|
192 |
+
'seopress_advanced_option_group', // Option group
|
193 |
+
'seopress_advanced_option_name', // Option name
|
194 |
+
[$this, 'sanitize'] // Sanitize
|
195 |
+
);
|
196 |
+
|
197 |
+
register_setting(
|
198 |
+
'seopress_tools_option_group', // Option group
|
199 |
+
'seopress_tools_option_name', // Option name
|
200 |
+
[$this, 'sanitize'] // Sanitize
|
201 |
+
);
|
202 |
+
|
203 |
+
register_setting(
|
204 |
+
'seopress_import_export_option_group', // Option group
|
205 |
+
'seopress_import_export_option_name', // Option name
|
206 |
+
[$this, 'sanitize'] // Sanitize
|
207 |
+
);
|
208 |
+
|
209 |
require_once dirname(__FILE__) . '/settings/Titles.php';
|
210 |
require_once dirname(__FILE__) . '/settings/Sitemaps.php';
|
211 |
require_once dirname(__FILE__) . '/settings/Social.php';
|
217 |
|
218 |
public function sanitize($input)
|
219 |
{
|
220 |
+
|
221 |
require_once dirname(__FILE__) . '/sanitize/Sanitize.php';
|
222 |
+
|
223 |
+
if(isset($_POST['option_page']) && $_POST['option_page'] === 'seopress_advanced_option_group'){
|
224 |
+
if(!isset($input['seopress_advanced_appearance_universal_metabox_disable'])){
|
225 |
+
$input['seopress_advanced_appearance_universal_metabox_disable'] = '';
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
return seopress_sanitize_options_fields($input);
|
230 |
}
|
231 |
|
232 |
public function load_sections()
|
inc/admin/ajax.php
CHANGED
@@ -482,20 +482,20 @@ function seopress_do_real_preview()
|
|
482 |
}
|
483 |
}
|
484 |
|
485 |
-
//
|
486 |
$permalink = get_permalink((int) $seopress_get_the_id);
|
487 |
$args = [
|
488 |
's' => $permalink,
|
489 |
'post_type' => 'any',
|
490 |
];
|
491 |
-
$
|
492 |
|
493 |
-
if ($
|
494 |
-
$data['
|
495 |
|
496 |
-
while ($
|
497 |
-
$
|
498 |
-
$data['
|
499 |
}
|
500 |
}
|
501 |
wp_reset_postdata();
|
482 |
}
|
483 |
}
|
484 |
|
485 |
+
//Internal links
|
486 |
$permalink = get_permalink((int) $seopress_get_the_id);
|
487 |
$args = [
|
488 |
's' => $permalink,
|
489 |
'post_type' => 'any',
|
490 |
];
|
491 |
+
$internal_links = new WP_Query($args);
|
492 |
|
493 |
+
if ($internal_links->have_posts()) {
|
494 |
+
$data['internal_links']['count'] = $internal_links->found_posts;
|
495 |
|
496 |
+
while ($internal_links->have_posts()) {
|
497 |
+
$internal_links->the_post();
|
498 |
+
$data['internal_links']['links'][get_the_ID()] = [get_the_permalink() => get_the_title()];
|
499 |
}
|
500 |
}
|
501 |
wp_reset_postdata();
|
inc/admin/callbacks/Advanced.php
CHANGED
@@ -396,7 +396,15 @@ function seopress_advanced_appearance_universal_metabox_callback() {
|
|
396 |
function seopress_advanced_appearance_universal_metabox_disable_callback() {
|
397 |
$options = get_option('seopress_advanced_option_name');
|
398 |
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
|
401 |
<label for="seopress_advanced_appearance_universal_metabox_disable">
|
402 |
<input id="seopress_advanced_appearance_universal_metabox_disable"
|
396 |
function seopress_advanced_appearance_universal_metabox_disable_callback() {
|
397 |
$options = get_option('seopress_advanced_option_name');
|
398 |
|
399 |
+
if(!$options){
|
400 |
+
$check = "1";
|
401 |
+
}
|
402 |
+
else{
|
403 |
+
$check = isset($options['seopress_advanced_appearance_universal_metabox_disable']) && $options['seopress_advanced_appearance_universal_metabox_disable'] === '1' ? true : false;
|
404 |
+
}
|
405 |
+
|
406 |
+
|
407 |
+
?>
|
408 |
|
409 |
<label for="seopress_advanced_appearance_universal_metabox_disable">
|
410 |
<input id="seopress_advanced_appearance_universal_metabox_disable"
|
inc/admin/callbacks/Social.php
CHANGED
@@ -363,9 +363,11 @@ function seopress_social_facebook_img_cpt_callback()
|
|
363 |
placeholder="<?php esc_html_e('Select your default thumbnail', 'wp-seopress'); ?>" />
|
364 |
|
365 |
<input
|
366 |
-
id="
|
367 |
-
class="seopress_social_facebook_img_cpt btn btnSecondary"
|
|
|
368 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
|
|
369 |
</p>
|
370 |
|
371 |
<?php if (isset($options['seopress_social_facebook_img_cpt'][$seopress_cpt_key]['url'])) {
|
363 |
placeholder="<?php esc_html_e('Select your default thumbnail', 'wp-seopress'); ?>" />
|
364 |
|
365 |
<input
|
366 |
+
id="seopress_social_facebook_img_upload"
|
367 |
+
class="seopress_social_facebook_img_cpt btn btnSecondary"
|
368 |
+
type="button"
|
369 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
370 |
+
|
371 |
</p>
|
372 |
|
373 |
<?php if (isset($options['seopress_social_facebook_img_cpt'][$seopress_cpt_key]['url'])) {
|
inc/admin/callbacks/Titles.php
CHANGED
@@ -655,7 +655,7 @@ function seopress_titles_tax_titles_callback()
|
|
655 |
<div class=" wrap-tags">
|
656 |
<span
|
657 |
id="seopress-tag-tax-title-<?php echo $seopress_tax_key; ?>"
|
658 |
-
data-tag="%%_category_title%%" class="tag-title">
|
659 |
<span class="dashicons dashicons-plus-alt2"></span>
|
660 |
<?php _e('Category Title', 'wp-seopress'); ?>
|
661 |
</span>
|
655 |
<div class=" wrap-tags">
|
656 |
<span
|
657 |
id="seopress-tag-tax-title-<?php echo $seopress_tax_key; ?>"
|
658 |
+
data-tag="%%_category_title%%" class="btn btnSecondary tag-title">
|
659 |
<span class="dashicons dashicons-plus-alt2"></span>
|
660 |
<?php _e('Category Title', 'wp-seopress'); ?>
|
661 |
</span>
|
inc/admin/metaboxes/admin-metaboxes-content-analysis-form.php
CHANGED
@@ -4,13 +4,6 @@ defined('ABSPATH') or exit('Please don’t call the plugin directly. Thanks
|
|
4 |
|
5 |
$data_attr = seopress_metaboxes_init();
|
6 |
|
7 |
-
//Classic Editor compatibility
|
8 |
-
if (function_exists('get_current_screen') && true === get_current_screen()->is_block_editor()) {
|
9 |
-
$btn_classes_secondary = 'components-button is-secondary';
|
10 |
-
} else {
|
11 |
-
$btn_classes_secondary = 'button button-secondary';
|
12 |
-
}
|
13 |
-
|
14 |
?>
|
15 |
|
16 |
<div class="wrap-seopress-analysis"
|
@@ -41,19 +34,19 @@ if (function_exists('get_current_screen') && true === get_current_screen()->is_b
|
|
41 |
value="<?php esc_attr_e($seopress_analysis_target_kw); ?>" />
|
42 |
</p>
|
43 |
<?php if (empty($seopress_analysis_data)) { ?>
|
44 |
-
<button id="seopress_launch_analysis" type="button" class="<?php echo
|
45 |
data_id="<?php echo get_the_ID(); ?>"
|
46 |
data_post_type="<?php echo get_current_screen()->post_type; ?>"><?php _e('Analyze my content', 'wp-seopress'); ?></button>
|
47 |
<?php } else { ?>
|
48 |
<button id="seopress_launch_analysis" type="button"
|
49 |
-
class="<?php echo
|
50 |
data_id="<?php echo get_the_ID(); ?>"
|
51 |
data_post_type="<?php echo get_current_screen()->post_type; ?>"><?php _e('Refresh analysis', 'wp-seopress'); ?></button>
|
52 |
<?php }
|
53 |
|
54 |
if (is_plugin_active('wp-seopress-insights/seopress-insights.php')) { ?>
|
55 |
<button id="seopress_add_to_insights" type="button"
|
56 |
-
class="<?php echo
|
57 |
data_id="<?php echo get_the_ID(); ?>"
|
58 |
data_post_type="<?php echo get_current_screen()->post_type; ?>">
|
59 |
<?php _e('Track with Insights', 'wp-seopress'); ?>
|
@@ -78,7 +71,7 @@ if (function_exists('get_current_screen') && true === get_current_screen()->is_b
|
|
78 |
<span class="description"><?php _e('Click on a suggestion below to add it as a target keyword.', 'wp-seopress'); ?></span>
|
79 |
</p>
|
80 |
<button id="seopress_get_suggestions" type="button"
|
81 |
-
class="<?php echo
|
82 |
<?php _e('Get suggestions!', 'wp-seopress'); ?>
|
83 |
</button>
|
84 |
|
4 |
|
5 |
$data_attr = seopress_metaboxes_init();
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
?>
|
8 |
|
9 |
<div class="wrap-seopress-analysis"
|
34 |
value="<?php esc_attr_e($seopress_analysis_target_kw); ?>" />
|
35 |
</p>
|
36 |
<?php if (empty($seopress_analysis_data)) { ?>
|
37 |
+
<button id="seopress_launch_analysis" type="button" class="<?php echo seopress_btn_secondary_classes(); ?>"
|
38 |
data_id="<?php echo get_the_ID(); ?>"
|
39 |
data_post_type="<?php echo get_current_screen()->post_type; ?>"><?php _e('Analyze my content', 'wp-seopress'); ?></button>
|
40 |
<?php } else { ?>
|
41 |
<button id="seopress_launch_analysis" type="button"
|
42 |
+
class="<?php echo seopress_btn_secondary_classes(); ?>"
|
43 |
data_id="<?php echo get_the_ID(); ?>"
|
44 |
data_post_type="<?php echo get_current_screen()->post_type; ?>"><?php _e('Refresh analysis', 'wp-seopress'); ?></button>
|
45 |
<?php }
|
46 |
|
47 |
if (is_plugin_active('wp-seopress-insights/seopress-insights.php')) { ?>
|
48 |
<button id="seopress_add_to_insights" type="button"
|
49 |
+
class="<?php echo seopress_btn_secondary_classes(); ?>"
|
50 |
data_id="<?php echo get_the_ID(); ?>"
|
51 |
data_post_type="<?php echo get_current_screen()->post_type; ?>">
|
52 |
<?php _e('Track with Insights', 'wp-seopress'); ?>
|
71 |
<span class="description"><?php _e('Click on a suggestion below to add it as a target keyword.', 'wp-seopress'); ?></span>
|
72 |
</p>
|
73 |
<button id="seopress_get_suggestions" type="button"
|
74 |
+
class="<?php echo seopress_btn_secondary_classes(); ?>">
|
75 |
<?php _e('Get suggestions!', 'wp-seopress'); ?>
|
76 |
</button>
|
77 |
|
inc/admin/metaboxes/admin-metaboxes-form.php
CHANGED
@@ -14,13 +14,6 @@ $data_attr = [];
|
|
14 |
$data_attr['data_tax'] = '';
|
15 |
$data_attr['termId'] = '';
|
16 |
|
17 |
-
//Classic Editor compatibility
|
18 |
-
if (function_exists('get_current_screen') && true === get_current_screen()->is_block_editor()) {
|
19 |
-
$btn_classes_secondary = 'components-button is-secondary';
|
20 |
-
} else {
|
21 |
-
$btn_classes_secondary = 'button button-secondary';
|
22 |
-
}
|
23 |
-
|
24 |
if ('post-new.php' == $pagenow || 'post.php' == $pagenow) {
|
25 |
$data_attr['current_id'] = get_the_id();
|
26 |
$data_attr['origin'] = 'post';
|
@@ -131,15 +124,15 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
131 |
|
132 |
<div class="wrap-tags">
|
133 |
<?php if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
134 |
-
<button type="button" class="<?php echo
|
135 |
class="dashicons dashicons-plus-alt2"></span><?php _e('Term Title', 'wp-seopress'); ?></button>
|
136 |
<?php } else { ?>
|
137 |
-
<button type="button" class="<?php echo
|
138 |
class="dashicons dashicons-plus-alt2"></span><?php _e('Post Title', 'wp-seopress'); ?></button>
|
139 |
<?php } ?>
|
140 |
-
<button type="button" class="<?php echo
|
141 |
<span class="dashicons dashicons-plus-alt2"></span><?php _e('Site Title', 'wp-seopress'); ?></button>
|
142 |
-
<button type="button" class="<?php echo
|
143 |
class="dashicons dashicons-plus-alt2"></span><?php _e('Separator', 'wp-seopress'); ?></button>
|
144 |
|
145 |
<?php echo seopress_render_dyn_variables('tag-title'); ?>
|
@@ -169,11 +162,11 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
169 |
</div>
|
170 |
<div class="wrap-tags">
|
171 |
<?php if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
172 |
-
<button type="button" class="<?php echo
|
173 |
<span class="dashicons dashicons-plus-alt2"></span><?php _e('Category / term description', 'wp-seopress'); ?>
|
174 |
</button>
|
175 |
<?php } else { ?>
|
176 |
-
<button type="button" class="<?php echo
|
177 |
<span class="dashicons dashicons-plus-alt2"></span><?php _e('Post Excerpt', 'wp-seopress'); ?>
|
178 |
</button>
|
179 |
<?php }
|
@@ -420,7 +413,7 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
420 |
</p>
|
421 |
<p>
|
422 |
<input id="seopress_social_fb_img_upload"
|
423 |
-
class="<?php echo
|
424 |
type="button"
|
425 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
426 |
</p>
|
@@ -535,7 +528,7 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
535 |
</p>
|
536 |
<p>
|
537 |
<input id="seopress_social_twitter_img_upload"
|
538 |
-
class="<?php echo
|
539 |
type="button"
|
540 |
aria-label="<?php _e('Twitter Thumbnail', 'wp-seopress'); ?>"
|
541 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
@@ -684,7 +677,7 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
684 |
} ?>
|
685 |
<a href="<?php echo $href; ?>"
|
686 |
id="seopress_redirections_value_default"
|
687 |
-
class="<?php echo
|
688 |
target="_blank">
|
689 |
<?php _e('Test your URL', 'wp-seopress'); ?>
|
690 |
</a>
|
@@ -830,7 +823,7 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
830 |
|
831 |
|
832 |
<input
|
833 |
-
class="<?php echo
|
834 |
type="button"
|
835 |
aria-label="<?php _e('Video Thumbnail', 'wp-seopress'); ?>"
|
836 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
@@ -920,7 +913,7 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
920 |
</div>
|
921 |
<p>
|
922 |
<a href="#" id="add-video"
|
923 |
-
class="add-video <?php echo
|
924 |
<?php _e('Add video', 'wp-seopress'); ?>
|
925 |
</a>
|
926 |
</p>
|
14 |
$data_attr['data_tax'] = '';
|
15 |
$data_attr['termId'] = '';
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
if ('post-new.php' == $pagenow || 'post.php' == $pagenow) {
|
18 |
$data_attr['current_id'] = get_the_id();
|
19 |
$data_attr['origin'] = 'post';
|
124 |
|
125 |
<div class="wrap-tags">
|
126 |
<?php if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
127 |
+
<button type="button" class="<?php echo seopress_btn_secondary_classes(); ?> tag-title" id="seopress-tag-single-title" data-tag="%%term_title%%"><span
|
128 |
class="dashicons dashicons-plus-alt2"></span><?php _e('Term Title', 'wp-seopress'); ?></button>
|
129 |
<?php } else { ?>
|
130 |
+
<button type="button" class="<?php echo seopress_btn_secondary_classes(); ?> tag-title" id="seopress-tag-single-title" data-tag="%%post_title%%"><span
|
131 |
class="dashicons dashicons-plus-alt2"></span><?php _e('Post Title', 'wp-seopress'); ?></button>
|
132 |
<?php } ?>
|
133 |
+
<button type="button" class="<?php echo seopress_btn_secondary_classes(); ?> tag-title" id="seopress-tag-single-site-title" data-tag="%%sitetitle%%">
|
134 |
<span class="dashicons dashicons-plus-alt2"></span><?php _e('Site Title', 'wp-seopress'); ?></button>
|
135 |
+
<button type="button" class="<?php echo seopress_btn_secondary_classes(); ?> tag-title" id="seopress-tag-single-sep" data-tag="%%sep%%"><span
|
136 |
class="dashicons dashicons-plus-alt2"></span><?php _e('Separator', 'wp-seopress'); ?></button>
|
137 |
|
138 |
<?php echo seopress_render_dyn_variables('tag-title'); ?>
|
162 |
</div>
|
163 |
<div class="wrap-tags">
|
164 |
<?php if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
165 |
+
<button type="button" class="<?php echo seopress_btn_secondary_classes(); ?> tag-title" id="seopress-tag-single-excerpt" data-tag="%%_category_description%%">
|
166 |
<span class="dashicons dashicons-plus-alt2"></span><?php _e('Category / term description', 'wp-seopress'); ?>
|
167 |
</button>
|
168 |
<?php } else { ?>
|
169 |
+
<button type="button" class="<?php echo seopress_btn_secondary_classes(); ?> tag-title" id="seopress-tag-single-excerpt" data-tag="%%post_excerpt%%">
|
170 |
<span class="dashicons dashicons-plus-alt2"></span><?php _e('Post Excerpt', 'wp-seopress'); ?>
|
171 |
</button>
|
172 |
<?php }
|
413 |
</p>
|
414 |
<p>
|
415 |
<input id="seopress_social_fb_img_upload"
|
416 |
+
class="<?php echo seopress_btn_secondary_classes(); ?>"
|
417 |
type="button"
|
418 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
419 |
</p>
|
528 |
</p>
|
529 |
<p>
|
530 |
<input id="seopress_social_twitter_img_upload"
|
531 |
+
class="<?php echo seopress_btn_secondary_classes(); ?>"
|
532 |
type="button"
|
533 |
aria-label="<?php _e('Twitter Thumbnail', 'wp-seopress'); ?>"
|
534 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
677 |
} ?>
|
678 |
<a href="<?php echo $href; ?>"
|
679 |
id="seopress_redirections_value_default"
|
680 |
+
class="<?php echo seopress_btn_secondary_classes(); ?>"
|
681 |
target="_blank">
|
682 |
<?php _e('Test your URL', 'wp-seopress'); ?>
|
683 |
</a>
|
823 |
|
824 |
|
825 |
<input
|
826 |
+
class="<?php echo seopress_btn_secondary_classes(); ?> seopress_video_thumbnail_upload seopress_media_upload"
|
827 |
type="button"
|
828 |
aria-label="<?php _e('Video Thumbnail', 'wp-seopress'); ?>"
|
829 |
value="<?php _e('Upload an Image', 'wp-seopress'); ?>" />
|
913 |
</div>
|
914 |
<p>
|
915 |
<a href="#" id="add-video"
|
916 |
+
class="add-video <?php echo seopress_btn_secondary_classes(); ?>">
|
917 |
<?php _e('Add video', 'wp-seopress'); ?>
|
918 |
</a>
|
919 |
</p>
|
inc/admin/sanitize/Sanitize.php
CHANGED
@@ -2,107 +2,113 @@
|
|
2 |
|
3 |
defined('ABSPATH') or exit('Please don’t call the plugin directly. Thanks :)');
|
4 |
|
5 |
-
$
|
6 |
-
'seopress_titles_home_site_title',
|
7 |
-
'seopress_titles_home_site_desc',
|
8 |
-
'seopress_titles_archives_author_title',
|
9 |
-
'seopress_titles_archives_author_desc',
|
10 |
-
'seopress_titles_archives_date_title',
|
11 |
-
'seopress_titles_archives_date_desc',
|
12 |
-
'seopress_titles_archives_search_title',
|
13 |
-
'seopress_titles_archives_search_desc',
|
14 |
-
'seopress_titles_archives_404_title',
|
15 |
-
'seopress_titles_archives_404_desc',
|
16 |
-
'seopress_xml_sitemap_html_exclude',
|
17 |
-
'seopress_social_knowledge_name',
|
18 |
-
'seopress_social_knowledge_img',
|
19 |
-
'seopress_social_knowledge_phone',
|
20 |
-
'seopress_social_accounts_facebook',
|
21 |
-
'seopress_social_accounts_twitter',
|
22 |
-
'seopress_social_accounts_pinterest',
|
23 |
-
'seopress_social_accounts_instagram',
|
24 |
-
'seopress_social_accounts_youtube',
|
25 |
-
'seopress_social_accounts_linkedin',
|
26 |
-
'seopress_social_facebook_link_ownership_id',
|
27 |
-
'seopress_social_facebook_admin_id',
|
28 |
-
'seopress_social_facebook_app_id',
|
29 |
-
'seopress_google_analytics_ua',
|
30 |
-
'seopress_google_analytics_ga4',
|
31 |
-
'seopress_google_analytics_download_tracking',
|
32 |
-
'seopress_google_analytics_opt_out_msg',
|
33 |
-
'seopress_google_analytics_opt_out_msg_ok',
|
34 |
-
'seopress_google_analytics_opt_out_msg_close',
|
35 |
-
'seopress_google_analytics_opt_out_msg_edit',
|
36 |
-
'seopress_google_analytics_other_tracking',
|
37 |
-
'seopress_google_analytics_other_tracking_body',
|
38 |
-
'seopress_google_analytics_optimize',
|
39 |
-
'seopress_google_analytics_ads',
|
40 |
-
'seopress_google_analytics_cross_domain',
|
41 |
-
'seopress_google_analytics_matomo_id',
|
42 |
-
'seopress_google_analytics_matomo_site_id',
|
43 |
-
'seopress_google_analytics_matomo_cross_domain_sites',
|
44 |
-
'seopress_google_analytics_cb_backdrop_bg',
|
45 |
-
'seopress_google_analytics_cb_exp_date',
|
46 |
-
'seopress_google_analytics_cb_bg',
|
47 |
-
'seopress_google_analytics_cb_txt_col',
|
48 |
-
'seopress_google_analytics_cb_lk_col',
|
49 |
-
'seopress_google_analytics_cb_btn_bg',
|
50 |
-
'seopress_google_analytics_cb_btn_col',
|
51 |
-
'seopress_google_analytics_cb_btn_bg_hov',
|
52 |
-
'seopress_google_analytics_cb_btn_col_hov',
|
53 |
-
'seopress_google_analytics_cb_btn_sec_bg',
|
54 |
-
'seopress_google_analytics_cb_btn_sec_col',
|
55 |
-
'seopress_google_analytics_cb_btn_sec_bg_hov',
|
56 |
-
'seopress_google_analytics_cb_btn_sec_col_hov',
|
57 |
-
'seopress_google_analytics_cb_width',
|
58 |
-
];
|
59 |
|
60 |
-
$
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
$
|
65 |
-
|
66 |
-
|
67 |
-
'seopress_advanced_advanced_pinterest',
|
68 |
-
'seopress_advanced_advanced_yandex',
|
69 |
-
];
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
'a' => [
|
78 |
-
'href' => [],
|
79 |
-
'target' => [],
|
80 |
-
],
|
81 |
-
];
|
82 |
-
$input[$value] = wp_kses($input[$value], $args);
|
83 |
-
} elseif (( ! empty($input['seopress_google_analytics_other_tracking']) && 'seopress_google_analytics_other_tracking' == $value) || ( ! empty($input['seopress_google_analytics_other_tracking_body']) && 'seopress_google_analytics_other_tracking_body' == $value) || ( ! empty($input['seopress_google_analytics_other_tracking_footer']) && 'seopress_google_analytics_other_tracking_footer' == $value)) {
|
84 |
-
$input[$value] = $input[$value]; //No sanitization for this field
|
85 |
-
} elseif ( ! empty($input[$value])) {
|
86 |
-
$input[$value] = sanitize_text_field($input[$value]);
|
87 |
-
}
|
88 |
-
}
|
89 |
|
90 |
-
foreach ($
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
-
}
|
95 |
|
96 |
-
foreach ($
|
97 |
-
|
98 |
-
if (preg_match('#content=\'([^"]+)\'#', $input[$value], $m)) {
|
99 |
-
$input[$value] = esc_attr($m[1]);
|
100 |
-
} elseif (preg_match('#content="([^"]+)"#', $input[$value], $m)) {
|
101 |
-
$input[$value] = esc_attr($m[1]);
|
102 |
-
} else {
|
103 |
$input[$value] = esc_attr($input[$value]);
|
104 |
}
|
105 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
|
108 |
-
return $input;
|
2 |
|
3 |
defined('ABSPATH') or exit('Please don’t call the plugin directly. Thanks :)');
|
4 |
|
5 |
+
function seopress_sanitize_options_fields($input){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
$seopress_sanitize_fields = [
|
8 |
+
'seopress_titles_home_site_title',
|
9 |
+
'seopress_titles_home_site_desc',
|
10 |
+
'seopress_titles_archives_author_title',
|
11 |
+
'seopress_titles_archives_author_desc',
|
12 |
+
'seopress_titles_archives_date_title',
|
13 |
+
'seopress_titles_archives_date_desc',
|
14 |
+
'seopress_titles_archives_search_title',
|
15 |
+
'seopress_titles_archives_search_desc',
|
16 |
+
'seopress_titles_archives_404_title',
|
17 |
+
'seopress_titles_archives_404_desc',
|
18 |
+
'seopress_xml_sitemap_html_exclude',
|
19 |
+
'seopress_social_knowledge_name',
|
20 |
+
'seopress_social_knowledge_img',
|
21 |
+
'seopress_social_knowledge_phone',
|
22 |
+
'seopress_social_accounts_facebook',
|
23 |
+
'seopress_social_accounts_twitter',
|
24 |
+
'seopress_social_accounts_pinterest',
|
25 |
+
'seopress_social_accounts_instagram',
|
26 |
+
'seopress_social_accounts_youtube',
|
27 |
+
'seopress_social_accounts_linkedin',
|
28 |
+
'seopress_social_facebook_link_ownership_id',
|
29 |
+
'seopress_social_facebook_admin_id',
|
30 |
+
'seopress_social_facebook_app_id',
|
31 |
+
'seopress_google_analytics_ua',
|
32 |
+
'seopress_google_analytics_ga4',
|
33 |
+
'seopress_google_analytics_download_tracking',
|
34 |
+
'seopress_google_analytics_opt_out_msg',
|
35 |
+
'seopress_google_analytics_opt_out_msg_ok',
|
36 |
+
'seopress_google_analytics_opt_out_msg_close',
|
37 |
+
'seopress_google_analytics_opt_out_msg_edit',
|
38 |
+
'seopress_google_analytics_other_tracking',
|
39 |
+
'seopress_google_analytics_other_tracking_body',
|
40 |
+
'seopress_google_analytics_optimize',
|
41 |
+
'seopress_google_analytics_ads',
|
42 |
+
'seopress_google_analytics_cross_domain',
|
43 |
+
'seopress_google_analytics_matomo_id',
|
44 |
+
'seopress_google_analytics_matomo_site_id',
|
45 |
+
'seopress_google_analytics_matomo_cross_domain_sites',
|
46 |
+
'seopress_google_analytics_cb_backdrop_bg',
|
47 |
+
'seopress_google_analytics_cb_exp_date',
|
48 |
+
'seopress_google_analytics_cb_bg',
|
49 |
+
'seopress_google_analytics_cb_txt_col',
|
50 |
+
'seopress_google_analytics_cb_lk_col',
|
51 |
+
'seopress_google_analytics_cb_btn_bg',
|
52 |
+
'seopress_google_analytics_cb_btn_col',
|
53 |
+
'seopress_google_analytics_cb_btn_bg_hov',
|
54 |
+
'seopress_google_analytics_cb_btn_col_hov',
|
55 |
+
'seopress_google_analytics_cb_btn_sec_bg',
|
56 |
+
'seopress_google_analytics_cb_btn_sec_col',
|
57 |
+
'seopress_google_analytics_cb_btn_sec_bg_hov',
|
58 |
+
'seopress_google_analytics_cb_btn_sec_col_hov',
|
59 |
+
'seopress_google_analytics_cb_width',
|
60 |
+
];
|
61 |
|
62 |
+
$seopress_esc_attr = [
|
63 |
+
'seopress_titles_sep',
|
64 |
+
];
|
|
|
|
|
|
|
65 |
|
66 |
+
$seopress_sanitize_site_verification = [
|
67 |
+
'seopress_advanced_advanced_google',
|
68 |
+
'seopress_advanced_advanced_bing',
|
69 |
+
'seopress_advanced_advanced_pinterest',
|
70 |
+
'seopress_advanced_advanced_yandex',
|
71 |
+
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
+
foreach ($seopress_sanitize_fields as $value) {
|
74 |
+
if ( ! empty($input['seopress_google_analytics_opt_out_msg']) && 'seopress_google_analytics_opt_out_msg' == $value) {
|
75 |
+
$args = [
|
76 |
+
'strong' => [],
|
77 |
+
'em' => [],
|
78 |
+
'br' => [],
|
79 |
+
'a' => [
|
80 |
+
'href' => [],
|
81 |
+
'target' => [],
|
82 |
+
],
|
83 |
+
];
|
84 |
+
$input[$value] = wp_kses($input[$value], $args);
|
85 |
+
} elseif (( ! empty($input['seopress_google_analytics_other_tracking']) && 'seopress_google_analytics_other_tracking' == $value) || ( ! empty($input['seopress_google_analytics_other_tracking_body']) && 'seopress_google_analytics_other_tracking_body' == $value) || ( ! empty($input['seopress_google_analytics_other_tracking_footer']) && 'seopress_google_analytics_other_tracking_footer' == $value)) {
|
86 |
+
$input[$value] = $input[$value]; //No sanitization for this field
|
87 |
+
} elseif ( ! empty($input[$value])) {
|
88 |
+
$input[$value] = sanitize_text_field($input[$value]);
|
89 |
+
}
|
90 |
}
|
|
|
91 |
|
92 |
+
foreach ($seopress_esc_attr as $value) {
|
93 |
+
if ( ! empty($input[$value])) {
|
|
|
|
|
|
|
|
|
|
|
94 |
$input[$value] = esc_attr($input[$value]);
|
95 |
}
|
96 |
}
|
97 |
+
|
98 |
+
foreach ($seopress_sanitize_site_verification as $value) {
|
99 |
+
if ( ! empty($input[$value])) {
|
100 |
+
if (preg_match('#content=\'([^"]+)\'#', $input[$value], $m)) {
|
101 |
+
$input[$value] = esc_attr($m[1]);
|
102 |
+
} elseif (preg_match('#content="([^"]+)"#', $input[$value], $m)) {
|
103 |
+
$input[$value] = esc_attr($m[1]);
|
104 |
+
} else {
|
105 |
+
$input[$value] = esc_attr($input[$value]);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
+
return $input;
|
112 |
+
|
113 |
}
|
114 |
|
|
inc/admin/settings/Main.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
defined('ABSPATH') or exit('Please don’t call the plugin directly. Thanks :)');
|
4 |
-
|
5 |
-
register_setting(
|
6 |
-
'seopress_option_group', // Option group
|
7 |
-
'seopress_option_name', // Option name
|
8 |
-
'sanitize' // Sanitize
|
9 |
-
);
|
10 |
-
|
11 |
-
register_setting(
|
12 |
-
'seopress_titles_option_group', // Option group
|
13 |
-
'seopress_titles_option_name', // Option name
|
14 |
-
'sanitize' // Sanitize
|
15 |
-
);
|
16 |
-
|
17 |
-
register_setting(
|
18 |
-
'seopress_xml_sitemap_option_group', // Option group
|
19 |
-
'seopress_xml_sitemap_option_name', // Option name
|
20 |
-
'sanitize' // Sanitize
|
21 |
-
);
|
22 |
-
|
23 |
-
register_setting(
|
24 |
-
'seopress_social_option_group', // Option group
|
25 |
-
'seopress_social_option_name', // Option name
|
26 |
-
'sanitize' // Sanitize
|
27 |
-
);
|
28 |
-
|
29 |
-
register_setting(
|
30 |
-
'seopress_google_analytics_option_group', // Option group
|
31 |
-
'seopress_google_analytics_option_name', // Option name
|
32 |
-
'sanitize' // Sanitize
|
33 |
-
);
|
34 |
-
|
35 |
-
register_setting(
|
36 |
-
'seopress_advanced_option_group', // Option group
|
37 |
-
'seopress_advanced_option_name', // Option name
|
38 |
-
'sanitize' // Sanitize
|
39 |
-
);
|
40 |
-
|
41 |
-
register_setting(
|
42 |
-
'seopress_tools_option_group', // Option group
|
43 |
-
'seopress_tools_option_name', // Option name
|
44 |
-
'sanitize' // Sanitize
|
45 |
-
);
|
46 |
-
|
47 |
-
register_setting(
|
48 |
-
'seopress_import_export_option_group', // Option group
|
49 |
-
'seopress_import_export_option_name', // Option name
|
50 |
-
'sanitize' // Sanitize
|
51 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/admin/wizard/admin-wizard.php
CHANGED
@@ -746,6 +746,7 @@ class SEOPRESS_Admin_Setup_Wizard {
|
|
746 |
$category_url = isset($seopress_advanced_option['seopress_advanced_advanced_category_url']);
|
747 |
$product_category_url = isset($seopress_advanced_option['seopress_advanced_advanced_product_cat_url']);
|
748 |
$meta_title = isset($seopress_advanced_option['seopress_advanced_appearance_title_col']);
|
|
|
749 |
$meta_desc = isset($seopress_advanced_option['seopress_advanced_appearance_meta_desc_col']);
|
750 |
$robots_noindex = isset($seopress_advanced_option['seopress_advanced_appearance_noindex_col']);
|
751 |
$robots_nofollow = isset($seopress_advanced_option['seopress_advanced_appearance_nofollow_col']);
|
@@ -828,6 +829,28 @@ class SEOPRESS_Admin_Setup_Wizard {
|
|
828 |
</li>
|
829 |
</ul>
|
830 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
831 |
<h2>
|
832 |
<?php _e('Choose which SEO columns to display in post types list:', 'wp-seopress'); ?>
|
833 |
</h2>
|
@@ -923,6 +946,8 @@ class SEOPRESS_Admin_Setup_Wizard {
|
|
923 |
$seopress_advanced_option['seopress_advanced_advanced_attachments_file'] = isset($_POST['attachments_file']) ? esc_attr(wp_unslash($_POST['attachments_file'])) : null;
|
924 |
$seopress_advanced_option['seopress_advanced_advanced_category_url'] = isset($_POST['category_url']) ? esc_attr(wp_unslash($_POST['category_url'])) : null;
|
925 |
|
|
|
|
|
926 |
$seopress_advanced_option['seopress_advanced_appearance_title_col'] = isset($_POST['meta_title']) ? esc_attr(wp_unslash($_POST['meta_title'])) : null;
|
927 |
$seopress_advanced_option['seopress_advanced_appearance_meta_desc_col'] = isset($_POST['meta_desc']) ? esc_attr(wp_unslash($_POST['meta_desc'])) : null;
|
928 |
|
746 |
$category_url = isset($seopress_advanced_option['seopress_advanced_advanced_category_url']);
|
747 |
$product_category_url = isset($seopress_advanced_option['seopress_advanced_advanced_product_cat_url']);
|
748 |
$meta_title = isset($seopress_advanced_option['seopress_advanced_appearance_title_col']);
|
749 |
+
$universal_seo_metabox = isset($seopress_advanced_option['seopress_advanced_appearance_universal_metabox_disable']);
|
750 |
$meta_desc = isset($seopress_advanced_option['seopress_advanced_appearance_meta_desc_col']);
|
751 |
$robots_noindex = isset($seopress_advanced_option['seopress_advanced_appearance_noindex_col']);
|
752 |
$robots_nofollow = isset($seopress_advanced_option['seopress_advanced_appearance_nofollow_col']);
|
829 |
</li>
|
830 |
</ul>
|
831 |
|
832 |
+
<h2>
|
833 |
+
<?php _e('Universal SEO metabox', 'wp-seopress'); ?>
|
834 |
+
</h2>
|
835 |
+
|
836 |
+
<ul class="seopress-wizard-services">
|
837 |
+
<li class="description">
|
838 |
+
<?php _e('Edit your SEO metadata from your page or theme builder. Default: <strong>Enabled</strong>.', 'wp-seopress'); ?>
|
839 |
+
</li>
|
840 |
+
<!-- Show meta title -->
|
841 |
+
<li class="seopress-wizard-service-item checkbox">
|
842 |
+
<label for="universal_seo_metabox">
|
843 |
+
<input id="universal_seo_metabox" name="universal_seo_metabox" type="checkbox" class="location-input" <?php if ('1' == $universal_seo_metabox) {
|
844 |
+
echo 'checked="yes"';
|
845 |
+
} ?> value="1"/>
|
846 |
+
<?php _e('No, I prefer to use the good old one SEO metabox', 'wp-seopress'); ?>
|
847 |
+
</label>
|
848 |
+
</li>
|
849 |
+
<li class="description">
|
850 |
+
<?php _e('You can change this setting at anytime from SEO, Advanced settings page, Appearance tab.', 'wp-seopress'); ?>
|
851 |
+
</li>
|
852 |
+
</ul>
|
853 |
+
|
854 |
<h2>
|
855 |
<?php _e('Choose which SEO columns to display in post types list:', 'wp-seopress'); ?>
|
856 |
</h2>
|
946 |
$seopress_advanced_option['seopress_advanced_advanced_attachments_file'] = isset($_POST['attachments_file']) ? esc_attr(wp_unslash($_POST['attachments_file'])) : null;
|
947 |
$seopress_advanced_option['seopress_advanced_advanced_category_url'] = isset($_POST['category_url']) ? esc_attr(wp_unslash($_POST['category_url'])) : null;
|
948 |
|
949 |
+
$seopress_advanced_option['seopress_advanced_appearance_universal_metabox_disable'] = isset($_POST['universal_seo_metabox']) ? esc_attr(wp_unslash($_POST['universal_seo_metabox'])) : null;
|
950 |
+
|
951 |
$seopress_advanced_option['seopress_advanced_appearance_title_col'] = isset($_POST['meta_title']) ? esc_attr(wp_unslash($_POST['meta_title'])) : null;
|
952 |
$seopress_advanced_option['seopress_advanced_appearance_meta_desc_col'] = isset($_POST['meta_desc']) ? esc_attr(wp_unslash($_POST['meta_desc'])) : null;
|
953 |
|
public/metaboxe.js
CHANGED
@@ -18416,15 +18416,19 @@ var ADVANCED = "ADVANCED";
|
|
18416 |
var SOCIAL = "SOCIAL";
|
18417 |
var REDIRECTION = "REDIRECTION";
|
18418 |
var OVERVIEW = "OVERVIEW";
|
|
|
|
|
18419 |
var __ = wp.i18n.__;
|
18420 |
var getTabs = function getTabs() {
|
18421 |
return [{
|
18422 |
key: TITLE_DESCRIPTION_META,
|
18423 |
title: __("Titles & Metas", "wp-seopress"),
|
|
|
18424 |
default_sub_tab: TITLE_SETTINGS
|
18425 |
}, {
|
18426 |
key: CONTENT_ANALYSIS,
|
18427 |
title: __("Content Analysis", "wp-seopress"),
|
|
|
18428 |
default_sub_tab: OVERVIEW
|
18429 |
}];
|
18430 |
};
|
@@ -18456,6 +18460,8 @@ var getSubTabs = function getSubTabs() {
|
|
18456 |
|
18457 |
|
18458 |
|
|
|
|
|
18459 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
18460 |
|
18461 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -18523,7 +18529,61 @@ var MetaboxContext_MetaboxContextProvider = function MetaboxContextProvider(_ref
|
|
18523 |
isGutenberg = _useState4[0],
|
18524 |
setIsGutenberg = _useState4[1];
|
18525 |
|
18526 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18527 |
_useState6 = _slicedToArray(_useState5, 2),
|
18528 |
tab = _useState6[0],
|
18529 |
setTab = _useState6[1];
|
@@ -27738,7 +27798,7 @@ var RecommendedLimit_RecommendedLimit = function RecommendedLimit(_ref) {
|
|
27738 |
style: {
|
27739 |
width: "".concat(percent, "%")
|
27740 |
}
|
27741 |
-
}, percent, "%"), /*#__PURE__*/react_default.a.createElement(ProgressInformation, null, children));
|
27742 |
};
|
27743 |
|
27744 |
/* harmony default export */ var components_RecommendedLimit = (RecommendedLimit_RecommendedLimit);
|
@@ -27805,7 +27865,7 @@ var TitleDescriptionPreviewContext_TitleDescriptionPreviewContextProvider = func
|
|
27805 |
};
|
27806 |
// CONCATENATED MODULE: ./app/react/helpers/getPercentPixelValue.js
|
27807 |
var getPercentPixelValue = function getPercentPixelValue(pixelValue, maximum) {
|
27808 |
-
return
|
27809 |
};
|
27810 |
// CONCATENATED MODULE: ./app/react/helpers/getPixelValue.js
|
27811 |
var getPixelValue = function getPixelValue(value) {
|
@@ -37287,16 +37347,16 @@ var images_Component = function Component(_ref) {
|
|
37287 |
severity: images_getSeverity,
|
37288 |
component: images_Component
|
37289 |
});
|
37290 |
-
// CONCATENATED MODULE: ./app/react/services/content-analysis/
|
37291 |
|
37292 |
|
37293 |
|
37294 |
|
37295 |
-
var
|
37296 |
-
var
|
37297 |
|
37298 |
-
var
|
37299 |
-
var items = get_default()(data, [
|
37300 |
|
37301 |
if (isEmpty_default()(items)) {
|
37302 |
return "medium";
|
@@ -37305,18 +37365,18 @@ var inboundLinks_getSeverity = function getSeverity(data, options) {
|
|
37305 |
return "good";
|
37306 |
};
|
37307 |
|
37308 |
-
var
|
37309 |
var data = _ref.data,
|
37310 |
_ref$options = _ref.options,
|
37311 |
options = _ref$options === void 0 ? {} : _ref$options;
|
37312 |
|
37313 |
-
var items = get_default()(data, [
|
37314 |
|
37315 |
-
return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, null, /*#__PURE__*/react_default.a.createElement("p", null,
|
37316 |
className: "sp-dashicons-not"
|
37317 |
-
}),
|
37318 |
return /*#__PURE__*/react_default.a.createElement("li", {
|
37319 |
-
key: "
|
37320 |
}, /*#__PURE__*/react_default.a.createElement("span", {
|
37321 |
className: "dashicons dashicons-minus"
|
37322 |
}), /*#__PURE__*/react_default.a.createElement("a", {
|
@@ -37331,11 +37391,11 @@ var inboundLinks_Component = function Component(_ref) {
|
|
37331 |
}))));
|
37332 |
};
|
37333 |
|
37334 |
-
/* harmony default export */ var
|
37335 |
-
key:
|
37336 |
-
title:
|
37337 |
-
severity:
|
37338 |
-
component:
|
37339 |
});
|
37340 |
// CONCATENATED MODULE: ./app/react/services/content-analysis/metaDescription.js
|
37341 |
|
@@ -38200,7 +38260,7 @@ var oldPost_Component = function Component(_ref) {
|
|
38200 |
// CONCATENATED MODULE: ./app/react/services/content-analysis/index.js
|
38201 |
|
38202 |
|
38203 |
-
function
|
38204 |
|
38205 |
function content_analysis_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return content_analysis_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return content_analysis_arrayLikeToArray(o, minLen); }
|
38206 |
|
@@ -38223,7 +38283,7 @@ function content_analysis_arrayLikeToArray(arr, len) { if (len == null || len >
|
|
38223 |
|
38224 |
|
38225 |
var content_analysis_getContentAnalysis = function getContentAnalysis() {
|
38226 |
-
return [wordsCounter, canonicalUrl, content_analysis_heading, content_analysis_metaTitle, content_analysis_metaDescription, socialTags, metaRobots, content_analysis_schemas, content_analysis_images, noFollowLinks, outboundLinks,
|
38227 |
};
|
38228 |
|
38229 |
var content_analysis_getContentAnalysisBySeverity = function getContentAnalysisBySeverity(contents, args) {
|
@@ -38234,7 +38294,7 @@ var content_analysis_getContentAnalysisBySeverity = function getContentAnalysisB
|
|
38234 |
var getFullSeverity = function getFullSeverity(contents, args) {
|
38235 |
var fullSeverity = "good";
|
38236 |
|
38237 |
-
var _iterator =
|
38238 |
_step;
|
38239 |
|
38240 |
try {
|
@@ -39156,6 +39216,10 @@ var filter_default = /*#__PURE__*/__webpack_require__.n(filter);
|
|
39156 |
// CONCATENATED MODULE: ./app/react/layout/Tabs/index.js
|
39157 |
|
39158 |
|
|
|
|
|
|
|
|
|
39159 |
function Tabs_slicedToArray(arr, i) { return Tabs_arrayWithHoles(arr) || Tabs_iterableToArrayLimit(arr, i) || Tabs_unsupportedIterableToArray(arr, i) || Tabs_nonIterableRest(); }
|
39160 |
|
39161 |
function Tabs_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -39211,11 +39275,42 @@ var Tabs_Tabs = function Tabs(_ref3) {
|
|
39211 |
}
|
39212 |
};
|
39213 |
|
|
|
|
|
|
|
|
|
39214 |
return /*#__PURE__*/react_default.a.createElement(SCTabContainer, null, getTabs().map(function (tab, keyParent) {
|
39215 |
var subTabs = filter_default()(getSubTabs(), {
|
39216 |
parent: tab.key
|
39217 |
});
|
39218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39219 |
return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, {
|
39220 |
key: tab.key
|
39221 |
}, /*#__PURE__*/react_default.a.createElement(SCTab, {
|
18416 |
var SOCIAL = "SOCIAL";
|
18417 |
var REDIRECTION = "REDIRECTION";
|
18418 |
var OVERVIEW = "OVERVIEW";
|
18419 |
+
var ROLE_GLOBAL = "GLOBAL";
|
18420 |
+
var ROLE_CONTENT_ANALYSIS = "CONTENT_ANALYSIS";
|
18421 |
var __ = wp.i18n.__;
|
18422 |
var getTabs = function getTabs() {
|
18423 |
return [{
|
18424 |
key: TITLE_DESCRIPTION_META,
|
18425 |
title: __("Titles & Metas", "wp-seopress"),
|
18426 |
+
type_role: ROLE_GLOBAL,
|
18427 |
default_sub_tab: TITLE_SETTINGS
|
18428 |
}, {
|
18429 |
key: CONTENT_ANALYSIS,
|
18430 |
title: __("Content Analysis", "wp-seopress"),
|
18431 |
+
type_role: ROLE_CONTENT_ANALYSIS,
|
18432 |
default_sub_tab: OVERVIEW
|
18433 |
}];
|
18434 |
};
|
18460 |
|
18461 |
|
18462 |
|
18463 |
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
18464 |
+
|
18465 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
18466 |
|
18467 |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
18529 |
isGutenberg = _useState4[0],
|
18530 |
setIsGutenberg = _useState4[1];
|
18531 |
|
18532 |
+
var getTabDefault = function getTabDefault() {
|
18533 |
+
var currentUserRoles = get_default()(SEOPRESS_DATA, "USER_ROLES", null);
|
18534 |
+
|
18535 |
+
var rolesMetabox = get_default()(SEOPRESS_DATA, "ROLES_BLOCKED", {});
|
18536 |
+
|
18537 |
+
var tabs = getTabs();
|
18538 |
+
|
18539 |
+
var _iterator = _createForOfIteratorHelper(tabs),
|
18540 |
+
_step;
|
18541 |
+
|
18542 |
+
try {
|
18543 |
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
18544 |
+
var _tab = _step.value;
|
18545 |
+
|
18546 |
+
var typeRole = get_default()(_tab, "type_role", null);
|
18547 |
+
|
18548 |
+
var currentRoleTab = get_default()(rolesMetabox, [typeRole], null);
|
18549 |
+
|
18550 |
+
var isBlocked = false;
|
18551 |
+
|
18552 |
+
var _iterator2 = _createForOfIteratorHelper(currentUserRoles),
|
18553 |
+
_step2;
|
18554 |
+
|
18555 |
+
try {
|
18556 |
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
18557 |
+
var userRole = _step2.value;
|
18558 |
+
|
18559 |
+
if (!isNil_default()(currentRoleTab) && !isNil_default()(get_default()(currentRoleTab, userRole, null))) {
|
18560 |
+
isBlocked = true;
|
18561 |
+
}
|
18562 |
+
}
|
18563 |
+
} catch (err) {
|
18564 |
+
_iterator2.e(err);
|
18565 |
+
} finally {
|
18566 |
+
_iterator2.f();
|
18567 |
+
}
|
18568 |
+
|
18569 |
+
if (isBlocked) {
|
18570 |
+
continue;
|
18571 |
+
}
|
18572 |
+
|
18573 |
+
return _tab.key;
|
18574 |
+
}
|
18575 |
+
} catch (err) {
|
18576 |
+
_iterator.e(err);
|
18577 |
+
} finally {
|
18578 |
+
_iterator.f();
|
18579 |
+
}
|
18580 |
+
|
18581 |
+
return find_default()(getTabs(), {
|
18582 |
+
key: TITLE_DESCRIPTION_META
|
18583 |
+
}).key;
|
18584 |
+
};
|
18585 |
+
|
18586 |
+
var _useState5 = Object(react["useState"])(getTabDefault()),
|
18587 |
_useState6 = _slicedToArray(_useState5, 2),
|
18588 |
tab = _useState6[0],
|
18589 |
setTab = _useState6[1];
|
27798 |
style: {
|
27799 |
width: "".concat(percent, "%")
|
27800 |
}
|
27801 |
+
}, percent.toFixed(1), "%"), /*#__PURE__*/react_default.a.createElement(ProgressInformation, null, children));
|
27802 |
};
|
27803 |
|
27804 |
/* harmony default export */ var components_RecommendedLimit = (RecommendedLimit_RecommendedLimit);
|
27865 |
};
|
27866 |
// CONCATENATED MODULE: ./app/react/helpers/getPercentPixelValue.js
|
27867 |
var getPercentPixelValue = function getPercentPixelValue(pixelValue, maximum) {
|
27868 |
+
return pixelValue * 100 / maximum;
|
27869 |
};
|
27870 |
// CONCATENATED MODULE: ./app/react/helpers/getPixelValue.js
|
27871 |
var getPixelValue = function getPixelValue(value) {
|
37347 |
severity: images_getSeverity,
|
37348 |
component: images_Component
|
37349 |
});
|
37350 |
+
// CONCATENATED MODULE: ./app/react/services/content-analysis/internalLinks.js
|
37351 |
|
37352 |
|
37353 |
|
37354 |
|
37355 |
+
var internalLinks_ = wp.i18n.__;
|
37356 |
+
var internalLinks_KEY = "internal_links";
|
37357 |
|
37358 |
+
var internalLinks_getSeverity = function getSeverity(data, options) {
|
37359 |
+
var items = get_default()(data, [internalLinks_KEY, "value"], []);
|
37360 |
|
37361 |
if (isEmpty_default()(items)) {
|
37362 |
return "medium";
|
37365 |
return "good";
|
37366 |
};
|
37367 |
|
37368 |
+
var internalLinks_Component = function Component(_ref) {
|
37369 |
var data = _ref.data,
|
37370 |
_ref$options = _ref.options,
|
37371 |
options = _ref$options === void 0 ? {} : _ref$options;
|
37372 |
|
37373 |
+
var items = get_default()(data, [internalLinks_KEY, "value"], []);
|
37374 |
|
37375 |
+
return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, null, /*#__PURE__*/react_default.a.createElement("p", null, internalLinks_("Internal links are important for SEO and user experience. Always try to link your content together, with quality link anchors.")), isEmpty_default()(items) && /*#__PURE__*/react_default.a.createElement("p", null, /*#__PURE__*/react_default.a.createElement(NoAlt, {
|
37376 |
className: "sp-dashicons-not"
|
37377 |
+
}), internalLinks_("This page doesn't have any internal links from other content. Links from archive pages are not considered internal links due to lack of context.", "wp-seopress")), !isEmpty_default()(items) && /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, null, /*#__PURE__*/react_default.a.createElement("p", null, internalLinks_("We found ".concat(items.length, " internal links in your page. Below, the list:"), "wp-seopress")), /*#__PURE__*/react_default.a.createElement("ul", null, items.map(function (item, key) {
|
37378 |
return /*#__PURE__*/react_default.a.createElement("li", {
|
37379 |
+
key: "internal_".concat(key)
|
37380 |
}, /*#__PURE__*/react_default.a.createElement("span", {
|
37381 |
className: "dashicons dashicons-minus"
|
37382 |
}), /*#__PURE__*/react_default.a.createElement("a", {
|
37391 |
}))));
|
37392 |
};
|
37393 |
|
37394 |
+
/* harmony default export */ var internalLinks = ({
|
37395 |
+
key: internalLinks_KEY,
|
37396 |
+
title: internalLinks_("Internal Links", "wp-seopress"),
|
37397 |
+
severity: internalLinks_getSeverity,
|
37398 |
+
component: internalLinks_Component
|
37399 |
});
|
37400 |
// CONCATENATED MODULE: ./app/react/services/content-analysis/metaDescription.js
|
37401 |
|
38260 |
// CONCATENATED MODULE: ./app/react/services/content-analysis/index.js
|
38261 |
|
38262 |
|
38263 |
+
function content_analysis_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = content_analysis_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
38264 |
|
38265 |
function content_analysis_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return content_analysis_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return content_analysis_arrayLikeToArray(o, minLen); }
|
38266 |
|
38283 |
|
38284 |
|
38285 |
var content_analysis_getContentAnalysis = function getContentAnalysis() {
|
38286 |
+
return [wordsCounter, canonicalUrl, content_analysis_heading, content_analysis_metaTitle, content_analysis_metaDescription, socialTags, metaRobots, content_analysis_schemas, content_analysis_images, noFollowLinks, outboundLinks, internalLinks, keywordsPermalink, keywordsDensity, oldPost];
|
38287 |
};
|
38288 |
|
38289 |
var content_analysis_getContentAnalysisBySeverity = function getContentAnalysisBySeverity(contents, args) {
|
38294 |
var getFullSeverity = function getFullSeverity(contents, args) {
|
38295 |
var fullSeverity = "good";
|
38296 |
|
38297 |
+
var _iterator = content_analysis_createForOfIteratorHelper(contents),
|
38298 |
_step;
|
38299 |
|
38300 |
try {
|
39216 |
// CONCATENATED MODULE: ./app/react/layout/Tabs/index.js
|
39217 |
|
39218 |
|
39219 |
+
|
39220 |
+
|
39221 |
+
function Tabs_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = Tabs_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
39222 |
+
|
39223 |
function Tabs_slicedToArray(arr, i) { return Tabs_arrayWithHoles(arr) || Tabs_iterableToArrayLimit(arr, i) || Tabs_unsupportedIterableToArray(arr, i) || Tabs_nonIterableRest(); }
|
39224 |
|
39225 |
function Tabs_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
39275 |
}
|
39276 |
};
|
39277 |
|
39278 |
+
var currentUserRoles = get_default()(SEOPRESS_DATA, "USER_ROLES", []);
|
39279 |
+
|
39280 |
+
var rolesMetabox = get_default()(SEOPRESS_DATA, "ROLES_BLOCKED", {});
|
39281 |
+
|
39282 |
return /*#__PURE__*/react_default.a.createElement(SCTabContainer, null, getTabs().map(function (tab, keyParent) {
|
39283 |
var subTabs = filter_default()(getSubTabs(), {
|
39284 |
parent: tab.key
|
39285 |
});
|
39286 |
|
39287 |
+
var typeRole = get_default()(tab, "type_role", null);
|
39288 |
+
|
39289 |
+
var currentRoleTab = get_default()(rolesMetabox, [typeRole], null);
|
39290 |
+
|
39291 |
+
var isBlocked = false;
|
39292 |
+
|
39293 |
+
var _iterator = Tabs_createForOfIteratorHelper(currentUserRoles),
|
39294 |
+
_step;
|
39295 |
+
|
39296 |
+
try {
|
39297 |
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
39298 |
+
var userRole = _step.value;
|
39299 |
+
|
39300 |
+
if (!isNil_default()(currentRoleTab) && get_default()(currentRoleTab, userRole, "") === "1") {
|
39301 |
+
isBlocked = true;
|
39302 |
+
}
|
39303 |
+
}
|
39304 |
+
} catch (err) {
|
39305 |
+
_iterator.e(err);
|
39306 |
+
} finally {
|
39307 |
+
_iterator.f();
|
39308 |
+
}
|
39309 |
+
|
39310 |
+
if (isBlocked) {
|
39311 |
+
return null;
|
39312 |
+
}
|
39313 |
+
|
39314 |
return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, {
|
39315 |
key: tab.key
|
39316 |
}, /*#__PURE__*/react_default.a.createElement(SCTab, {
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: SEO, XML sitemap, meta title, open graph, content analysis, knowledge grap
|
|
6 |
Requires at least: 4.7+
|
7 |
Tested up to: 5.8
|
8 |
Requires PHP: 5.6
|
9 |
-
Stable tag: 5.0.
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -331,6 +331,17 @@ You're theme is probably using a deprecated function to handle the title. <a hre
|
|
331 |
9. Schemas metabox
|
332 |
|
333 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
= 5.0.3 =
|
335 |
* FIX Fatal error: Uncaught Error: Call to undefined function seopress_render_dyn_variables() if "Hide help icons and SEOPress documentation links" (White Label) is enabled
|
336 |
* FIX Some CSS
|
@@ -338,6 +349,7 @@ You're theme is probably using a deprecated function to handle the title. <a hre
|
|
338 |
* NEW Allow user to drag and drop the beacon
|
339 |
* INFO Allow users with edit_posts capability to use the universal SEO metabox in frontend
|
340 |
* FIX Fatal error: Uncaught TypeError: method_exists() in some cases
|
|
|
341 |
= 5.0.1 =
|
342 |
* NEW Option to disable the universal SEO metabox from SEO, Advanced, Appearance tab
|
343 |
* INFO Improve a11y
|
6 |
Requires at least: 4.7+
|
7 |
Tested up to: 5.8
|
8 |
Requires PHP: 5.6
|
9 |
+
Stable tag: 5.0.4
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
331 |
9. Schemas metabox
|
332 |
|
333 |
== Changelog ==
|
334 |
+
= 5.0.4 =
|
335 |
+
* NEW Edit homepage with universal SEO metabox
|
336 |
+
* INFO Disable Universal SEO metabox by default (will not affect users who already have version 5.0 of SEOPress)
|
337 |
+
* INFO Add an option to disable the universal SEO metabox from the configuration wizard
|
338 |
+
* INFO Strengthening security (thanks to Wordfence)
|
339 |
+
* FIX Add schema notification
|
340 |
+
* FIX Pixel counter for title and meta description
|
341 |
+
* FIX Notice: Undefined index: bestRating wp-seopress-pro/src/JsonSchemas/Review.php
|
342 |
+
* FIX WordPress < 5.0 compatibility (is_block_editor() error)
|
343 |
+
* FIX PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in wp-seopress/src/Actions/Admin/ModuleMetabox.php:44
|
344 |
+
* FIX Warning: Undefined variable $sp_seo_admin_menu in wp-seopress-pro/inc/admin/admin.php on line 134 (Multisite only)
|
345 |
= 5.0.3 =
|
346 |
* FIX Fatal error: Uncaught Error: Call to undefined function seopress_render_dyn_variables() if "Hide help icons and SEOPress documentation links" (White Label) is enabled
|
347 |
* FIX Some CSS
|
349 |
* NEW Allow user to drag and drop the beacon
|
350 |
* INFO Allow users with edit_posts capability to use the universal SEO metabox in frontend
|
351 |
* FIX Fatal error: Uncaught TypeError: method_exists() in some cases
|
352 |
+
* FIX Fatal error: Uncaught Error: Call to undefined function seopress_feature_save() (WP multisite only)
|
353 |
= 5.0.1 =
|
354 |
* NEW Option to disable the universal SEO metabox from SEO, Advanced, Appearance tab
|
355 |
* INFO Improve a11y
|
seopress-functions.php
CHANGED
@@ -741,3 +741,25 @@ function sp_submit_button($value ='', $classes = 'btn btnPrimary', $type = 'subm
|
|
741 |
|
742 |
echo $html;
|
743 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
741 |
|
742 |
echo $html;
|
743 |
}
|
744 |
+
|
745 |
+
/**
|
746 |
+
* Generate HTML buttons classes
|
747 |
+
*
|
748 |
+
* @since 5.0
|
749 |
+
*
|
750 |
+
* @author Benjamin Denis
|
751 |
+
* @return
|
752 |
+
*/
|
753 |
+
function seopress_btn_secondary_classes() {
|
754 |
+
//Classic Editor compatibility
|
755 |
+
global $pagenow;
|
756 |
+
if (function_exists('get_current_screen') && method_exists(get_current_screen(), 'is_block_editor') && true === get_current_screen()->is_block_editor()) {
|
757 |
+
$btn_classes_secondary = 'components-button is-secondary';
|
758 |
+
} elseif (isset($pagenow) && ($pagenow === 'term.php' || $pagenow === 'post.php') ) {
|
759 |
+
$btn_classes_secondary = 'button button-secondary';
|
760 |
+
} else {
|
761 |
+
$btn_classes_secondary = 'btn btnSecondary';
|
762 |
+
}
|
763 |
+
|
764 |
+
return $btn_classes_secondary;
|
765 |
+
}
|
seopress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: SEOPress
|
|
4 |
Plugin URI: https://www.seopress.org/
|
5 |
Description: One of the best SEO plugins for WordPress.
|
6 |
Author: SEOPress
|
7 |
-
Version: 5.0.
|
8 |
Author URI: https://www.seopress.org/
|
9 |
License: GPLv2
|
10 |
Text Domain: wp-seopress
|
@@ -55,7 +55,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
|
|
55 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
56 |
//Define
|
57 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58 |
-
define('SEOPRESS_VERSION', '5.0.
|
59 |
define('SEOPRESS_AUTHOR', 'Benjamin Denis');
|
60 |
define('SEOPRESS_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
|
61 |
define('SEOPRESS_PLUGIN_DIR_URL', plugin_dir_url(__FILE__));
|
4 |
Plugin URI: https://www.seopress.org/
|
5 |
Description: One of the best SEO plugins for WordPress.
|
6 |
Author: SEOPress
|
7 |
+
Version: 5.0.4
|
8 |
Author URI: https://www.seopress.org/
|
9 |
License: GPLv2
|
10 |
Text Domain: wp-seopress
|
55 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
56 |
//Define
|
57 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58 |
+
define('SEOPRESS_VERSION', '5.0.4');
|
59 |
define('SEOPRESS_AUTHOR', 'Benjamin Denis');
|
60 |
define('SEOPRESS_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
|
61 |
define('SEOPRESS_PLUGIN_DIR_URL', plugin_dir_url(__FILE__));
|
src/Actions/Admin/ModuleMetabox.php
CHANGED
@@ -41,9 +41,8 @@ class ModuleMetabox implements ExecuteHooks
|
|
41 |
$isGutenberg = false;
|
42 |
if(function_exists('get_current_screen')){
|
43 |
$currentScreen = get_current_screen();
|
44 |
-
if(method_exists($currentScreen,'is_block_editor')){
|
45 |
$isGutenberg = true === get_current_screen()->is_block_editor();
|
46 |
-
|
47 |
}
|
48 |
}
|
49 |
|
@@ -75,6 +74,9 @@ class ModuleMetabox implements ExecuteHooks
|
|
75 |
$country_code = 'US';
|
76 |
}
|
77 |
|
|
|
|
|
|
|
78 |
|
79 |
$args = array_merge([
|
80 |
'SEOPRESS_URL_DIST' => SEOPRESS_URL_DIST,
|
@@ -92,6 +94,11 @@ class ModuleMetabox implements ExecuteHooks
|
|
92 |
'LOCALE' => $locale,
|
93 |
'COUNTRY_CODE' => $country_code,
|
94 |
],
|
|
|
|
|
|
|
|
|
|
|
95 |
'FAVICON' => get_site_icon_url(32),
|
96 |
'BEACON_SVG' => apply_filters('seopress_beacon_svg', SEOPRESS_URL_ASSETS.'/img/beacon.svg'),
|
97 |
], $argsLocalize);
|
@@ -110,9 +117,7 @@ class ModuleMetabox implements ExecuteHooks
|
|
110 |
*/
|
111 |
public function enqueueFrontend()
|
112 |
{
|
113 |
-
|
114 |
-
$this->enqueueModule(['POST_ID' => get_the_ID()]);
|
115 |
-
}
|
116 |
}
|
117 |
|
118 |
/**
|
41 |
$isGutenberg = false;
|
42 |
if(function_exists('get_current_screen')){
|
43 |
$currentScreen = get_current_screen();
|
44 |
+
if($currentScreen && method_exists($currentScreen,'is_block_editor')){
|
45 |
$isGutenberg = true === get_current_screen()->is_block_editor();
|
|
|
46 |
}
|
47 |
}
|
48 |
|
74 |
$country_code = 'US';
|
75 |
}
|
76 |
|
77 |
+
$settingsAdvanced = seopress_get_service('AdvancedOption');
|
78 |
+
$user = wp_get_current_user();
|
79 |
+
$roles = ( array ) $user->roles;
|
80 |
|
81 |
$args = array_merge([
|
82 |
'SEOPRESS_URL_DIST' => SEOPRESS_URL_DIST,
|
94 |
'LOCALE' => $locale,
|
95 |
'COUNTRY_CODE' => $country_code,
|
96 |
],
|
97 |
+
'USER_ROLES' => array_values($roles),
|
98 |
+
'ROLES_BLOCKED' => [
|
99 |
+
'GLOBAL' => $settingsAdvanced->getSecurityMetaboxRole(),
|
100 |
+
'CONTENT_ANALYSIS' => $settingsAdvanced->getSecurityMetaboxRoleContentAnalysis()
|
101 |
+
],
|
102 |
'FAVICON' => get_site_icon_url(32),
|
103 |
'BEACON_SVG' => apply_filters('seopress_beacon_svg', SEOPRESS_URL_ASSETS.'/img/beacon.svg'),
|
104 |
], $argsLocalize);
|
117 |
*/
|
118 |
public function enqueueFrontend()
|
119 |
{
|
120 |
+
$this->enqueueModule(['POST_ID' => get_the_ID()]);
|
|
|
|
|
121 |
}
|
122 |
|
123 |
/**
|
src/Actions/Api/ContentAnalysis.php
CHANGED
@@ -46,7 +46,18 @@ class ContentAnalysis implements ExecuteHooks
|
|
46 |
},
|
47 |
],
|
48 |
],
|
49 |
-
'permission_callback' =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
]);
|
51 |
}
|
52 |
|
46 |
},
|
47 |
],
|
48 |
],
|
49 |
+
'permission_callback' => function ($request) {
|
50 |
+
$nonce = $request->get_header('x-wp-nonce');
|
51 |
+
if ( ! wp_verify_nonce($nonce, 'wp_rest')) {
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
if(!current_user_can('edit_posts')){
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
|
59 |
+
return true;
|
60 |
+
},
|
61 |
]);
|
62 |
}
|
63 |
|
src/Actions/Api/Metas/RedirectionSettings.php
CHANGED
@@ -49,6 +49,10 @@ class RedirectionSettings implements ExecuteHooks {
|
|
49 |
return false;
|
50 |
}
|
51 |
|
|
|
|
|
|
|
|
|
52 |
return true;
|
53 |
},
|
54 |
]);
|
@@ -69,7 +73,12 @@ class RedirectionSettings implements ExecuteHooks {
|
|
69 |
continue;
|
70 |
}
|
71 |
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
|
75 |
return new \WP_REST_Response([
|
49 |
return false;
|
50 |
}
|
51 |
|
52 |
+
if(!current_user_can('edit_posts')){
|
53 |
+
return false;
|
54 |
+
}
|
55 |
+
|
56 |
return true;
|
57 |
},
|
58 |
]);
|
73 |
continue;
|
74 |
}
|
75 |
|
76 |
+
$item = $params[$value['key']];
|
77 |
+
if(in_array($value['type'], ['input', 'textarea'])){
|
78 |
+
$item = esc_html($item);
|
79 |
+
}
|
80 |
+
|
81 |
+
update_post_meta($id, $value['key'], $item);
|
82 |
}
|
83 |
|
84 |
return new \WP_REST_Response([
|
src/Actions/Api/Metas/RobotSettings.php
CHANGED
@@ -52,6 +52,10 @@ class RobotSettings implements ExecuteHooks
|
|
52 |
return false;
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
55 |
return true;
|
56 |
},
|
57 |
]);
|
@@ -72,7 +76,12 @@ class RobotSettings implements ExecuteHooks
|
|
72 |
if (! isset($params[$value['key']])) {
|
73 |
continue;
|
74 |
}
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
|
78 |
return new \WP_REST_Response([
|
52 |
return false;
|
53 |
}
|
54 |
|
55 |
+
if(!current_user_can('edit_posts')){
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
|
59 |
return true;
|
60 |
},
|
61 |
]);
|
76 |
if (! isset($params[$value['key']])) {
|
77 |
continue;
|
78 |
}
|
79 |
+
$item = $params[$value['key']];
|
80 |
+
if(in_array($value['type'], ['input', 'textarea'])){
|
81 |
+
$item = esc_html($item);
|
82 |
+
}
|
83 |
+
|
84 |
+
update_post_meta($id, $value['key'], $item);
|
85 |
}
|
86 |
|
87 |
return new \WP_REST_Response([
|
src/Actions/Api/Metas/SocialSettings.php
CHANGED
@@ -49,6 +49,10 @@ class SocialSettings implements ExecuteHooks {
|
|
49 |
return false;
|
50 |
}
|
51 |
|
|
|
|
|
|
|
|
|
52 |
return true;
|
53 |
},
|
54 |
]);
|
@@ -69,7 +73,12 @@ class SocialSettings implements ExecuteHooks {
|
|
69 |
continue;
|
70 |
}
|
71 |
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
|
75 |
return new \WP_REST_Response([
|
49 |
return false;
|
50 |
}
|
51 |
|
52 |
+
if(!current_user_can('edit_posts')){
|
53 |
+
return false;
|
54 |
+
}
|
55 |
+
|
56 |
return true;
|
57 |
},
|
58 |
]);
|
73 |
continue;
|
74 |
}
|
75 |
|
76 |
+
$item = $params[$value['key']];
|
77 |
+
if(in_array($value['type'], ['input', 'textarea'])){
|
78 |
+
$item = esc_html($item);
|
79 |
+
}
|
80 |
+
|
81 |
+
update_post_meta($id, $value['key'], $item);
|
82 |
}
|
83 |
|
84 |
return new \WP_REST_Response([
|
src/Actions/Api/TargetKeywords.php
CHANGED
@@ -51,6 +51,10 @@ class TargetKeywords implements ExecuteHooks
|
|
51 |
return false;
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
54 |
return true;
|
55 |
},
|
56 |
]);
|
51 |
return false;
|
52 |
}
|
53 |
|
54 |
+
if(!current_user_can('edit_posts')){
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
|
58 |
return true;
|
59 |
},
|
60 |
]);
|
src/Actions/Api/TitleDescriptionMeta.php
CHANGED
@@ -48,6 +48,10 @@ class TitleDescriptionMeta implements ExecuteHooks {
|
|
48 |
return false;
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
51 |
return true;
|
52 |
},
|
53 |
]);
|
@@ -84,8 +88,7 @@ class TitleDescriptionMeta implements ExecuteHooks {
|
|
84 |
if ( ! isset($params[$key])) {
|
85 |
continue;
|
86 |
}
|
87 |
-
|
88 |
-
update_post_meta($id, $value, $params[$key]);
|
89 |
}
|
90 |
|
91 |
return new \WP_REST_Response([
|
48 |
return false;
|
49 |
}
|
50 |
|
51 |
+
if(!current_user_can('edit_posts')){
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
return true;
|
56 |
},
|
57 |
]);
|
88 |
if ( ! isset($params[$key])) {
|
89 |
continue;
|
90 |
}
|
91 |
+
update_post_meta($id, $value, esc_html($params[$key]));
|
|
|
92 |
}
|
93 |
|
94 |
return new \WP_REST_Response([
|
src/Actions/Options/Init.php
CHANGED
@@ -55,6 +55,7 @@ class Init implements ActivationHook
|
|
55 |
'seopress_advanced_appearance_score_col' => '1',
|
56 |
'seopress_advanced_appearance_noindex_col' => '1',
|
57 |
'seopress_advanced_appearance_nofollow_col' => '1',
|
|
|
58 |
];
|
59 |
|
60 |
//Check if the value is an array (important!)
|
55 |
'seopress_advanced_appearance_score_col' => '1',
|
56 |
'seopress_advanced_appearance_noindex_col' => '1',
|
57 |
'seopress_advanced_appearance_nofollow_col' => '1',
|
58 |
+
'seopress_advanced_appearance_universal_metabox_disable' => '1',
|
59 |
];
|
60 |
|
61 |
//Check if the value is an array (important!)
|
src/Helpers/ContentAnalysis.php
CHANGED
@@ -79,8 +79,8 @@ abstract class ContentAnalysis {
|
|
79 |
'impact' => 'good',
|
80 |
'desc' => null,
|
81 |
],
|
82 |
-
'
|
83 |
-
'title' => __('
|
84 |
'impact' => 'good',
|
85 |
'desc' => null,
|
86 |
],
|
79 |
'impact' => 'good',
|
80 |
'desc' => null,
|
81 |
],
|
82 |
+
'internal_links'=> [
|
83 |
+
'title' => __('Internal Links', 'wp-seopress'),
|
84 |
'impact' => 'good',
|
85 |
'desc' => null,
|
86 |
],
|
src/Services/ContentAnalysis/DomFilterContent.php
CHANGED
@@ -121,8 +121,8 @@ class DomFilterContent
|
|
121 |
'class' => '\SEOPress\Services\ContentAnalysis\GetContent\OutboundLinks',
|
122 |
'value' => '',
|
123 |
],
|
124 |
-
'
|
125 |
-
'class' => '\SEOPress\Services\ContentAnalysis\GetContent\
|
126 |
'value' => '',
|
127 |
'options' => [
|
128 |
'id' => $id,
|
121 |
'class' => '\SEOPress\Services\ContentAnalysis\GetContent\OutboundLinks',
|
122 |
'value' => '',
|
123 |
],
|
124 |
+
'internal_links' => [
|
125 |
+
'class' => '\SEOPress\Services\ContentAnalysis\GetContent\InternalLinks',
|
126 |
'value' => '',
|
127 |
'options' => [
|
128 |
'id' => $id,
|
src/Services/ContentAnalysis/GetContent.php
CHANGED
@@ -816,17 +816,17 @@ class GetContent
|
|
816 |
*
|
817 |
* @return array
|
818 |
*/
|
819 |
-
protected function
|
820 |
{
|
821 |
-
$desc = '<p>' . __('
|
822 |
-
if (! empty($data['
|
823 |
-
$count = $data['
|
824 |
|
825 |
-
$desc .= '<p>' . sprintf(__('We found %s
|
826 |
|
827 |
-
if (! empty($data['
|
828 |
$desc .= '<ul>';
|
829 |
-
foreach ($data['
|
830 |
foreach ($permalink as $href => $link) {
|
831 |
$desc .= '<li><span class="dashicons dashicons-minus"></span><a href="' . $href . '" target="_blank">' . $link . '</a>
|
832 |
<a class="nounderline" href="' . get_edit_post_link($id) . '" title="' . sprintf(__('edit %s', 'wp-seopress'), esc_html(get_the_title($id))) . '"><span class="dashicons dashicons-edit-large"></span></a></li>';
|
@@ -835,10 +835,10 @@ class GetContent
|
|
835 |
$desc .= '</ul>';
|
836 |
}
|
837 |
} else {
|
838 |
-
$analyzes['
|
839 |
-
$desc .= '<p><span class="dashicons dashicons-no-alt"></span>' . __('This page doesn\'t have any
|
840 |
}
|
841 |
-
$analyzes['
|
842 |
|
843 |
return $analyzes;
|
844 |
}
|
@@ -925,8 +925,8 @@ class GetContent
|
|
925 |
//Outbound links
|
926 |
$analyzes = $this->analyzeOutboundLinks($analyzes, $data, $post);
|
927 |
|
928 |
-
//
|
929 |
-
$analyzes = $this->
|
930 |
|
931 |
$analyzes = $this->analyzeCanonical($analyzes, $data, $post);
|
932 |
|
816 |
*
|
817 |
* @return array
|
818 |
*/
|
819 |
+
protected function analyzeInternalLinks($analyzes, $data, $post)
|
820 |
{
|
821 |
+
$desc = '<p>' . __('Internal links are important for SEO and user experience. Always try to link your content together, with quality link anchors.') . '</p>';
|
822 |
+
if (! empty($data['internal_links']['count'])) {
|
823 |
+
$count = $data['internal_links']['count'];
|
824 |
|
825 |
+
$desc .= '<p>' . sprintf(__('We found %s internal links to this page.', 'wp-seopress'), $count) . '</p>';
|
826 |
|
827 |
+
if (! empty($data['internal_links']['links'])) {
|
828 |
$desc .= '<ul>';
|
829 |
+
foreach ($data['internal_links']['links'] as $id => $permalink) {
|
830 |
foreach ($permalink as $href => $link) {
|
831 |
$desc .= '<li><span class="dashicons dashicons-minus"></span><a href="' . $href . '" target="_blank">' . $link . '</a>
|
832 |
<a class="nounderline" href="' . get_edit_post_link($id) . '" title="' . sprintf(__('edit %s', 'wp-seopress'), esc_html(get_the_title($id))) . '"><span class="dashicons dashicons-edit-large"></span></a></li>';
|
835 |
$desc .= '</ul>';
|
836 |
}
|
837 |
} else {
|
838 |
+
$analyzes['internal_links']['impact'] = 'medium';
|
839 |
+
$desc .= '<p><span class="dashicons dashicons-no-alt"></span>' . __('This page doesn\'t have any internal links from other content. Links from archive pages are not considered internal links due to lack of context.', 'wp-seopress') . '</p>';
|
840 |
}
|
841 |
+
$analyzes['internal_links']['desc'] = $desc;
|
842 |
|
843 |
return $analyzes;
|
844 |
}
|
925 |
//Outbound links
|
926 |
$analyzes = $this->analyzeOutboundLinks($analyzes, $data, $post);
|
927 |
|
928 |
+
//internal links
|
929 |
+
$analyzes = $this->analyzeInternalLinks($analyzes, $data, $post);
|
930 |
|
931 |
$analyzes = $this->analyzeCanonical($analyzes, $data, $post);
|
932 |
|
src/Services/ContentAnalysis/GetContent/{InboundLinks.php → InternalLinks.php}
RENAMED
@@ -4,7 +4,7 @@ namespace SEOPress\Services\ContentAnalysis\GetContent;
|
|
4 |
|
5 |
defined('ABSPATH') or exit('Cheatin’ uh?');
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public function getDataByXPath($xpath, $options)
|
10 |
{
|
4 |
|
5 |
defined('ABSPATH') or exit('Cheatin’ uh?');
|
6 |
|
7 |
+
class InternalLinks
|
8 |
{
|
9 |
public function getDataByXPath($xpath, $options)
|
10 |
{
|
src/Services/EnqueueModuleMetabox.php
CHANGED
@@ -28,10 +28,20 @@ class EnqueueModuleMetabox
|
|
28 |
$response = false;
|
29 |
}
|
30 |
|
31 |
-
|
|
|
32 |
$response = false;
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
if (function_exists('get_current_screen')) {
|
36 |
$currentScreen = \get_current_screen();
|
37 |
|
@@ -48,6 +58,36 @@ class EnqueueModuleMetabox
|
|
48 |
$response = false;
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
return apply_filters('seopress_can_enqueue_universal_metabox', $response);
|
52 |
}
|
53 |
}
|
28 |
$response = false;
|
29 |
}
|
30 |
|
31 |
+
|
32 |
+
if(!is_singular()){
|
33 |
$response = false;
|
34 |
}
|
35 |
|
36 |
+
if(get_the_ID() === (int) get_option('page_on_front')){
|
37 |
+
$response = true;
|
38 |
+
}
|
39 |
+
|
40 |
+
if(get_the_ID() === (int) get_option('page_for_posts')){
|
41 |
+
$response = true;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
if (function_exists('get_current_screen')) {
|
46 |
$currentScreen = \get_current_screen();
|
47 |
|
58 |
$response = false;
|
59 |
}
|
60 |
|
61 |
+
if(!current_user_can('edit_posts')){
|
62 |
+
$response = false;
|
63 |
+
}
|
64 |
+
|
65 |
+
$settingsAdvanced = seopress_get_service('AdvancedOption');
|
66 |
+
$rolesTabs = [
|
67 |
+
"GLOBAL" => $settingsAdvanced->getSecurityMetaboxRole(),
|
68 |
+
"CONTENT_ANALYSIS" => $settingsAdvanced->getSecurityMetaboxRoleContentAnalysis(),
|
69 |
+
];
|
70 |
+
|
71 |
+
|
72 |
+
$user = wp_get_current_user();
|
73 |
+
$roles = ( array ) $user->roles;
|
74 |
+
$counterCanEdit = 0;
|
75 |
+
|
76 |
+
foreach ($rolesTabs as $key => $roleTab) {
|
77 |
+
if($roleTab === null){
|
78 |
+
continue;
|
79 |
+
}
|
80 |
+
|
81 |
+
$diff = array_diff($roles, array_keys($roleTab));
|
82 |
+
if(count($diff) !== count($roles)){
|
83 |
+
$counterCanEdit++;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
if($counterCanEdit >= 2){
|
88 |
+
$response = false;
|
89 |
+
}
|
90 |
+
|
91 |
return apply_filters('seopress_can_enqueue_universal_metabox', $response);
|
92 |
}
|
93 |
}
|
src/Services/Options/AdvancedOption.php
CHANGED
@@ -55,6 +55,26 @@ class AdvancedOption
|
|
55 |
* @return string
|
56 |
*/
|
57 |
public function getDisableUniversalMetaboxGutenberg(){
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
}
|
55 |
* @return string
|
56 |
*/
|
57 |
public function getDisableUniversalMetaboxGutenberg(){
|
58 |
+
$data = $this->getOption();
|
59 |
+
|
60 |
+
if(!isset($data['seopress_advanced_appearance_universal_metabox_disable'])){
|
61 |
+
return true;
|
62 |
+
}
|
63 |
+
|
64 |
+
return $data['seopress_advanced_appearance_universal_metabox_disable'] === '1';
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @since 5.0.3
|
69 |
+
*/
|
70 |
+
public function getSecurityMetaboxRole(){
|
71 |
+
return $this->searchOptionByKey('seopress_advanced_security_metaboxe_role');
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @since 5.0.3
|
76 |
+
*/
|
77 |
+
public function getSecurityMetaboxRoleContentAnalysis(){
|
78 |
+
return $this->searchOptionByKey('seopress_advanced_security_metaboxe_ca_role');
|
79 |
}
|
80 |
}
|
vendor/composer/InstalledVersions.php
CHANGED
@@ -29,7 +29,7 @@ private static $installed = array (
|
|
29 |
'aliases' =>
|
30 |
array (
|
31 |
),
|
32 |
-
'reference' => '
|
33 |
'name' => 'wp-seopress/wp-seopress',
|
34 |
),
|
35 |
'versions' =>
|
@@ -41,7 +41,7 @@ private static $installed = array (
|
|
41 |
'aliases' =>
|
42 |
array (
|
43 |
),
|
44 |
-
'reference' => '
|
45 |
),
|
46 |
),
|
47 |
);
|
29 |
'aliases' =>
|
30 |
array (
|
31 |
),
|
32 |
+
'reference' => '030203609fb4dd31cc83afbaa1a4e796b9450eee',
|
33 |
'name' => 'wp-seopress/wp-seopress',
|
34 |
),
|
35 |
'versions' =>
|
41 |
'aliases' =>
|
42 |
array (
|
43 |
),
|
44 |
+
'reference' => '030203609fb4dd31cc83afbaa1a4e796b9450eee',
|
45 |
),
|
46 |
),
|
47 |
);
|
vendor/composer/installed.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
'aliases' =>
|
7 |
array (
|
8 |
),
|
9 |
-
'reference' => '
|
10 |
'name' => 'wp-seopress/wp-seopress',
|
11 |
),
|
12 |
'versions' =>
|
@@ -18,7 +18,7 @@
|
|
18 |
'aliases' =>
|
19 |
array (
|
20 |
),
|
21 |
-
'reference' => '
|
22 |
),
|
23 |
),
|
24 |
);
|
6 |
'aliases' =>
|
7 |
array (
|
8 |
),
|
9 |
+
'reference' => '030203609fb4dd31cc83afbaa1a4e796b9450eee',
|
10 |
'name' => 'wp-seopress/wp-seopress',
|
11 |
),
|
12 |
'versions' =>
|
18 |
'aliases' =>
|
19 |
array (
|
20 |
),
|
21 |
+
'reference' => '030203609fb4dd31cc83afbaa1a4e796b9450eee',
|
22 |
),
|
23 |
),
|
24 |
);
|