Version Description
- FIX Enable by default trailing slash in options
Download this release
Release Info
Developer | rainbowgeek |
Plugin | SEOPress |
Version | 1.8.2 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.8.2
- assets/js/seopress-dashboard.js +20 -0
- inc/admin/admin.php +28 -2
- inc/functions/options-social.php +2 -2
- inc/functions/options-titles-metas.php +2 -2
- inc/functions/options.php +2 -2
- readme.txt +1 -1
- seopress.php +2 -2
assets/js/seopress-dashboard.js
CHANGED
@@ -19,6 +19,26 @@ jQuery(document).ready(function(){
|
|
19 |
jQuery( '#seopress-notice-save' ).delay(3500).fadeOut();
|
20 |
},
|
21 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
});
|
23 |
//**Posts per page
|
24 |
jQuery('#notice-posts-number').on('click', function() {
|
19 |
jQuery( '#seopress-notice-save' ).delay(3500).fadeOut();
|
20 |
},
|
21 |
});
|
22 |
+
});
|
23 |
+
//**Trailingslash
|
24 |
+
jQuery('#notice-trailingslash').on('click', function() {
|
25 |
+
jQuery('#notice-trailingslash').attr('data-notice', jQuery('#notice-trailingslash').attr('data-notice') == '1' ? '0' : '1');
|
26 |
+
jQuery.ajax({
|
27 |
+
method : 'POST',
|
28 |
+
url : seopressAjaxHideNotices.seopress_hide_notices,
|
29 |
+
_ajax_nonce: seopressAjaxHideNotices.seopress_nonce,
|
30 |
+
data : {
|
31 |
+
action: 'seopress_hide_notices',
|
32 |
+
notice: 'notice-trailingslash',
|
33 |
+
notice_value: jQuery('#notice-trailingslash').attr('data-notice'),
|
34 |
+
},
|
35 |
+
success : function( data ) {
|
36 |
+
jQuery( '#seopress-notice-save' ).css('display', 'block');
|
37 |
+
jQuery( '#seopress-notice-save .html' ).html('Notice successfully removed');
|
38 |
+
jQuery( '#notice-trailingslash-alert' ).fadeOut();
|
39 |
+
jQuery( '#seopress-notice-save' ).delay(3500).fadeOut();
|
40 |
+
},
|
41 |
+
});
|
42 |
});
|
43 |
//**Posts per page
|
44 |
jQuery('#notice-posts-number').on('click', function() {
|
inc/admin/admin.php
CHANGED
@@ -854,6 +854,32 @@ class seopress_options
|
|
854 |
<?php }
|
855 |
}
|
856 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
857 |
<?php if (seopress_xml_sitemap_general_enable_option() !='1') { ?>
|
858 |
<div class="seopress-alert">
|
859 |
<p>
|
@@ -2121,7 +2147,7 @@ class seopress_options
|
|
2121 |
|
2122 |
add_settings_field(
|
2123 |
'seopress_advanced_advanced_trailingslash', // ID
|
2124 |
-
__("
|
2125 |
array( $this, 'seopress_advanced_advanced_trailingslash_callback' ), // Callback
|
2126 |
'seopress-settings-admin-advanced-advanced', // Page
|
2127 |
'seopress_setting_section_advanced_advanced' // Section
|
@@ -4144,7 +4170,7 @@ class seopress_options
|
|
4144 |
if ('1' == $check) echo 'checked="yes"';
|
4145 |
echo ' value="1"/>';
|
4146 |
|
4147 |
-
echo '<label for="seopress_advanced_advanced_trailingslash">'. __( '
|
4148 |
|
4149 |
if (isset($this->options['seopress_advanced_advanced_trailingslash'])) {
|
4150 |
esc_attr( $this->options['seopress_advanced_advanced_trailingslash']);
|
854 |
<?php }
|
855 |
}
|
856 |
?>
|
857 |
+
<?php
|
858 |
+
function seopress_get_hidden_notices_trailingslash_option() {
|
859 |
+
$seopress_get_hidden_notices_trailingslash_option = get_option("seopress_notices");
|
860 |
+
if ( ! empty ( $seopress_get_hidden_notices_trailingslash_option ) ) {
|
861 |
+
foreach ($seopress_get_hidden_notices_trailingslash_option as $key => $seopress_get_hidden_notices_trailingslash_value)
|
862 |
+
$options[$key] = $seopress_get_hidden_notices_trailingslash_value;
|
863 |
+
if (isset($seopress_get_hidden_notices_trailingslash_option['notice-trailingslash'])) {
|
864 |
+
return $seopress_get_hidden_notices_trailingslash_option['notice-trailingslash'];
|
865 |
+
}
|
866 |
+
}
|
867 |
+
}
|
868 |
+
|
869 |
+
if(seopress_get_hidden_notices_trailingslash_option() =='1') {
|
870 |
+
//do nothing
|
871 |
+
} else { ?>
|
872 |
+
<div id="notice-trailingslash-alert" class="seopress-alert deleteable">
|
873 |
+
<p>
|
874 |
+
<span class="dashicons dashicons-warning"></span>
|
875 |
+
<?php _e('Disable trailing slash for metas <br>if your pemarlink structure doesn\'t have a trailing slash','wp-seopress'); ?>
|
876 |
+
<span class="impact medium"><?php _e('Huge impact','wp-seopress'); ?></span>
|
877 |
+
</p>
|
878 |
+
<a class="button-primary" href="<?php echo admin_url( 'admin.php?page=seopress-advanced' ); ?>"><?php _e('Manage','wp-seopress'); ?></a>
|
879 |
+
<span name="notice-trailingslash" id="notice-trailingslash" class="dashicons dashicons-trash remove-notice" data-notice="notice-trailingslash"></span>
|
880 |
+
</div>
|
881 |
+
<?php }
|
882 |
+
?>
|
883 |
<?php if (seopress_xml_sitemap_general_enable_option() !='1') { ?>
|
884 |
<div class="seopress-alert">
|
885 |
<p>
|
2147 |
|
2148 |
add_settings_field(
|
2149 |
'seopress_advanced_advanced_trailingslash', // ID
|
2150 |
+
__("Disable trailing slash for metas","wp-seopress"), // Title
|
2151 |
array( $this, 'seopress_advanced_advanced_trailingslash_callback' ), // Callback
|
2152 |
'seopress-settings-admin-advanced-advanced', // Page
|
2153 |
'seopress_setting_section_advanced_advanced' // Section
|
4170 |
if ('1' == $check) echo 'checked="yes"';
|
4171 |
echo ' value="1"/>';
|
4172 |
|
4173 |
+
echo '<label for="seopress_advanced_advanced_trailingslash">'. __( 'Disable trailing slash for metas', 'wp-seopress' ) .'</label><span class="dashicons dashicons-info" title="'.__('You must check this box if the structure of your permalinks contains a slash at the end (eg: /%postname%/)','wp-seopress').'"></span>';
|
4174 |
|
4175 |
if (isset($this->options['seopress_advanced_advanced_trailingslash'])) {
|
4176 |
esc_attr( $this->options['seopress_advanced_advanced_trailingslash']);
|
inc/functions/options-social.php
CHANGED
@@ -340,9 +340,9 @@ function seopress_social_facebook_og_url_hook() {
|
|
340 |
|
341 |
global $wp;
|
342 |
if (seopress_advanced_advanced_trailingslash_option()) {
|
343 |
-
$current_url = trailingslashit(home_url(add_query_arg(array(), $wp->request)));
|
344 |
-
} else {
|
345 |
$current_url = home_url(add_query_arg(array(), $wp->request));
|
|
|
|
|
346 |
}
|
347 |
|
348 |
if (is_search()) {
|
340 |
|
341 |
global $wp;
|
342 |
if (seopress_advanced_advanced_trailingslash_option()) {
|
|
|
|
|
343 |
$current_url = home_url(add_query_arg(array(), $wp->request));
|
344 |
+
} else {
|
345 |
+
$current_url = trailingslashit(home_url(add_query_arg(array(), $wp->request)));
|
346 |
}
|
347 |
|
348 |
if (is_search()) {
|
inc/functions/options-titles-metas.php
CHANGED
@@ -921,9 +921,9 @@ if (seopress_titles_canonical_post_option()) {
|
|
921 |
function seopress_titles_canonical_hook() {
|
922 |
global $wp;
|
923 |
if (seopress_advanced_advanced_trailingslash_option()) {
|
924 |
-
$current_url = trailingslashit(home_url(add_query_arg(array(), $wp->request)));
|
925 |
-
} else {
|
926 |
$current_url = home_url(add_query_arg(array(), $wp->request));
|
|
|
|
|
927 |
}
|
928 |
if (is_search()) {
|
929 |
$seopress_titles_canonical = '<link rel="canonical" href="'.get_home_url().'/search/'.get_search_query().'" />';
|
921 |
function seopress_titles_canonical_hook() {
|
922 |
global $wp;
|
923 |
if (seopress_advanced_advanced_trailingslash_option()) {
|
|
|
|
|
924 |
$current_url = home_url(add_query_arg(array(), $wp->request));
|
925 |
+
} else {
|
926 |
+
$current_url = trailingslashit(home_url(add_query_arg(array(), $wp->request)));
|
927 |
}
|
928 |
if (is_search()) {
|
929 |
$seopress_titles_canonical = '<link rel="canonical" href="'.get_home_url().'/search/'.get_search_query().'" />';
|
inc/functions/options.php
CHANGED
@@ -133,9 +133,9 @@ if (seopress_get_toggle_advanced_option() =='1') {
|
|
133 |
global $wp;
|
134 |
|
135 |
if (seopress_advanced_advanced_trailingslash_option()) {
|
136 |
-
$current_url = trailingslashit(home_url(add_query_arg(array(), $wp->request)));
|
137 |
-
} else {
|
138 |
$current_url = home_url(add_query_arg(array(), $wp->request));
|
|
|
|
|
139 |
}
|
140 |
|
141 |
$category_base = get_option( 'category_base' );
|
133 |
global $wp;
|
134 |
|
135 |
if (seopress_advanced_advanced_trailingslash_option()) {
|
|
|
|
|
136 |
$current_url = home_url(add_query_arg(array(), $wp->request));
|
137 |
+
} else {
|
138 |
+
$current_url = trailingslashit(home_url(add_query_arg(array(), $wp->request)));
|
139 |
}
|
140 |
|
141 |
$category_base = get_option( 'category_base' );
|
readme.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
=== WordPress SEO Plugin, SEOPress ===
|
1 |
+
=== WordPress SEO Plugin, SEOPress ===
|
seopress.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: SEOPress
|
5 |
Plugin URI: https://www.seopress.org/
|
6 |
Description: The best SEO plugin.
|
7 |
-
Version: 1.8.
|
8 |
Author: Benjamin DENIS
|
9 |
Author URI: https://www.seopress.org/
|
10 |
License: GPLv2
|
@@ -56,7 +56,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
|
|
56 |
//Define
|
57 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58 |
|
59 |
-
define( 'SEOPRESS_VERSION', '1.8.
|
60 |
define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
|
61 |
|
62 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
4 |
Plugin Name: SEOPress
|
5 |
Plugin URI: https://www.seopress.org/
|
6 |
Description: The best SEO plugin.
|
7 |
+
Version: 1.8.2
|
8 |
Author: Benjamin DENIS
|
9 |
Author URI: https://www.seopress.org/
|
10 |
License: GPLv2
|
56 |
//Define
|
57 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58 |
|
59 |
+
define( 'SEOPRESS_VERSION', '1.8.2' );
|
60 |
define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
|
61 |
|
62 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|