SEOPress - Version 4.1.1

Version Description

  • NEW Add "Text alignment" option for cookie bar
  • INFO Improved cookie bar design
  • FIX Redirections capabilities
  • FIX Elementor compatibility
  • FIX Fatal error with PHP <
Download this release

Release Info

Developer rainbowgeek
Plugin Icon 128x128 SEOPress
Version 4.1.1
Comparing to
See all releases

Code changes from version 4.1 to 4.1.1

inc/admin/admin.php CHANGED
@@ -2122,6 +2122,14 @@ class seopress_options
2122
  'seopress_setting_section_google_analytics_gdpr' // Section
2123
  );
2124
 
 
 
 
 
 
 
 
 
2125
  add_settings_field(
2126
  'seopress_google_analytics_cb_width', // ID
2127
  __("Cookie bar width","wp-seopress"), // Title
@@ -5096,6 +5104,29 @@ class seopress_options
5096
  }
5097
  }
5098
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5099
  public function seopress_google_analytics_cb_width_callback()
5100
  {
5101
  $check = isset($this->options['seopress_google_analytics_cb_width']) ? $this->options['seopress_google_analytics_cb_width'] : NULL;
2122
  'seopress_setting_section_google_analytics_gdpr' // Section
2123
  );
2124
 
2125
+ add_settings_field(
2126
+ 'seopress_google_analytics_cb_txt_align', // ID
2127
+ __("Text alignment","wp-seopress"), // Title
2128
+ array( $this, 'seopress_google_analytics_cb_txt_align_callback' ), // Callback
2129
+ 'seopress-settings-admin-google-analytics-gdpr', // Page
2130
+ 'seopress_setting_section_google_analytics_gdpr' // Section
2131
+ );
2132
+
2133
  add_settings_field(
2134
  'seopress_google_analytics_cb_width', // ID
2135
  __("Cookie bar width","wp-seopress"), // Title
5104
  }
5105
  }
5106
 
5107
+ public function seopress_google_analytics_cb_txt_align_callback()
5108
+ {
5109
+ $options = get_option( 'seopress_google_analytics_option_name' );
5110
+
5111
+ $selected = isset($options['seopress_google_analytics_cb_txt_align']) ? $options['seopress_google_analytics_cb_txt_align'] : 'center';
5112
+
5113
+ echo '<select id="seopress_google_analytics_cb_txt_align" name="seopress_google_analytics_option_name[seopress_google_analytics_cb_txt_align]">';
5114
+ echo ' <option ';
5115
+ if ('left' == $selected) echo 'selected="selected"';
5116
+ echo ' value="left">'. __("Left","wp-seopress") .'</option>';
5117
+ echo ' <option ';
5118
+ if ('center' == $selected) echo 'selected="selected"';
5119
+ echo ' value="center">'. __("Center (default)","wp-seopress") .'</option>';
5120
+ echo ' <option ';
5121
+ if ('top' == $selected) echo 'selected="selected"';
5122
+ echo ' value="right">'. __("Right","wp-seopress") .'</option>';
5123
+ echo '</select>';
5124
+
5125
+ if (isset($this->options['seopress_google_analytics_cb_txt_align'])) {
5126
+ esc_attr( $this->options['seopress_google_analytics_cb_txt_align']);
5127
+ }
5128
+ }
5129
+
5130
  public function seopress_google_analytics_cb_width_callback()
5131
  {
5132
  $check = isset($this->options['seopress_google_analytics_cb_width']) ? $this->options['seopress_google_analytics_cb_width'] : NULL;
inc/admin/adminbar.php CHANGED
@@ -65,7 +65,7 @@ function seopress_admin_bar_links() {
65
  ));
66
 
67
  //noindex/nofollow per CPT
68
- if (function_exists('get_current_screen') && get_current_screen()->post_type !='') {
69
  $robots = '';
70
 
71
  $options = get_option( 'seopress_titles_option_name' );
65
  ));
66
 
67
  //noindex/nofollow per CPT
68
+ if (function_exists('get_current_screen') && get_current_screen() != NULL) {
69
  $robots = '';
70
 
71
  $options = get_option( 'seopress_titles_option_name' );
inc/admin/page-builders/elementor/inc/admin/class-document-settings-section.php CHANGED
@@ -646,6 +646,10 @@ class Document_Settings_Section {
646
  * @return void
647
  */
648
  public function on_seopress_meta_save( $post_id ) {
 
 
 
 
649
  $meta = get_post_meta( $post_id );
650
 
651
  $seopress_meta = array_filter(
@@ -668,12 +672,14 @@ class Document_Settings_Section {
668
 
669
  $seo_data['settings'] = $settings;
670
 
671
- if ( ! class_exists( '\Elementor\Core\Settings\Manager' ) ) {
672
- return;
673
- }
674
-
675
  $page_settings_manager = \Elementor\Core\Settings\Manager::get_settings_managers( 'page' );
 
676
  $page_settings_manager->save_settings( $settings, $post_id );
 
677
  }
678
 
679
  public function get_allowed_meta_keys() {
646
  * @return void
647
  */
648
  public function on_seopress_meta_save( $post_id ) {
649
+ if ( ! class_exists( '\Elementor\Core\Settings\Manager' ) ) {
650
+ return;
651
+ }
652
+
653
  $meta = get_post_meta( $post_id );
654
 
655
  $seopress_meta = array_filter(
672
 
673
  $seo_data['settings'] = $settings;
674
 
675
+ $page_settings = get_metadata( 'post', $post_id, \Elementor\Core\Settings\Page\Manager::META_KEY, true);
676
+ $settings = array_merge( $page_settings, $settings );
677
+
678
+ remove_action( 'seopress/page-builders/elementor/save_meta', [ $this, 'on_seopress_meta_save' ], 99 );
679
  $page_settings_manager = \Elementor\Core\Settings\Manager::get_settings_managers( 'page' );
680
+ $page_settings_manager->ajax_before_save_settings( $settings, $post_id );
681
  $page_settings_manager->save_settings( $settings, $post_id );
682
+ add_action( 'seopress/page-builders/elementor/save_meta', [ $this, 'on_seopress_meta_save' ], 99 );
683
  }
684
 
685
  public function get_allowed_meta_keys() {
inc/functions/options-google-analytics.php CHANGED
@@ -193,6 +193,17 @@ if (seopress_google_analytics_disable_option() =='1' && ( (empty($_COOKIE["seopr
193
  }
194
  }
195
 
 
 
 
 
 
 
 
 
 
 
 
196
  function seopress_cookies_user_consent_html() {
197
  if (seopress_google_analytics_opt_out_msg_option() !='') {
198
  $msg = seopress_google_analytics_opt_out_msg_option();
@@ -237,7 +248,7 @@ if (seopress_google_analytics_disable_option() =='1' && ( (empty($_COOKIE["seopr
237
  }
238
 
239
  function seopress_cookies_user_consent_styles(){
240
- $styles = '<style>.seopress-user-consent {left: 50%;transform: translate(-50%, -50%);position: fixed;z-index: 8000;padding: 30px;text-align: center;display: flex;justify-content: center;border: 1px solid #CCC;box-shadow: 0 0 10px rgb(204 204 204 / 0.5);border-radius: 5px;flex-wrap: wrap;max-width:100%;';
241
 
242
  //Width
243
  if (seopress_google_analytics_cb_width_option() !='') {
@@ -258,10 +269,22 @@ if (seopress_google_analytics_disable_option() =='1' && ( (empty($_COOKIE["seopr
258
  //Position
259
  if (seopress_google_analytics_cb_pos_option() ==='top') {
260
  $styles .= 'top:0;';
 
261
  } elseif(seopress_google_analytics_cb_pos_option() ==='center') {
262
  $styles .= 'top:45%;';
 
263
  } else {
264
  $styles .= 'bottom:0;';
 
 
 
 
 
 
 
 
 
 
265
  }
266
 
267
  //Background color
@@ -271,14 +294,14 @@ if (seopress_google_analytics_disable_option() =='1' && ( (empty($_COOKIE["seopr
271
  $styles .= 'background:#F1F1F1;';
272
  }
273
 
274
- $styles .='}.seopress-user-consent p {margin: 0;font-size: 0.8em;justify-content: space-around;display: flex;flex-wrap: wrap;width: 100%;';
275
 
276
  //Text color
277
  if (seopress_google_analytics_cb_txt_col_option() !='') {
278
  $styles .= 'color:'.seopress_google_analytics_cb_txt_col_option().';';
279
  }
280
 
281
- $styles .='}.seopress-user-consent p:first-child {margin-bottom:20px} .seopress-user-consent button {vertical-align: middle;margin: 0;width: 50%;font-size: 14px;';
282
 
283
  //Btn background color
284
  if (seopress_google_analytics_cb_btn_bg_option() !='') {
193
  }
194
  }
195
 
196
+ function seopress_google_analytics_cb_txt_align_option() {
197
+ $seopress_google_analytics_cb_txt_align_option = get_option("seopress_google_analytics_option_name");
198
+ if ( ! empty ( $seopress_google_analytics_cb_txt_align_option ) ) {
199
+ foreach ($seopress_google_analytics_cb_txt_align_option as $key => $seopress_google_analytics_cb_txt_align_value)
200
+ $options[$key] = $seopress_google_analytics_cb_txt_align_value;
201
+ if (isset($seopress_google_analytics_cb_txt_align_option['seopress_google_analytics_cb_txt_align'])) {
202
+ return $seopress_google_analytics_cb_txt_align_option['seopress_google_analytics_cb_txt_align'];
203
+ }
204
+ }
205
+ }
206
+
207
  function seopress_cookies_user_consent_html() {
208
  if (seopress_google_analytics_opt_out_msg_option() !='') {
209
  $msg = seopress_google_analytics_opt_out_msg_option();
248
  }
249
 
250
  function seopress_cookies_user_consent_styles(){
251
+ $styles = '<style>.seopress-user-consent {left: 50%;position: fixed;z-index: 8000;padding: 20px;display: block;border: 1px solid #CCC;max-width:100%;';
252
 
253
  //Width
254
  if (seopress_google_analytics_cb_width_option() !='') {
269
  //Position
270
  if (seopress_google_analytics_cb_pos_option() ==='top') {
271
  $styles .= 'top:0;';
272
+ $styles .= 'transform: translate(-50%, 0%);';
273
  } elseif(seopress_google_analytics_cb_pos_option() ==='center') {
274
  $styles .= 'top:45%;';
275
+ $styles .= 'transform: translate(-50%, -50%);';
276
  } else {
277
  $styles .= 'bottom:0;';
278
+ $styles .= 'transform: translate(-50%, 0);';
279
+ }
280
+
281
+ //Text alignment
282
+ if (seopress_google_analytics_cb_txt_align_option() ==='left') {
283
+ $styles .= 'text-align:left;';
284
+ } elseif(seopress_google_analytics_cb_pos_option() ==='right') {
285
+ $styles .= 'text-align:right;';
286
+ } else {
287
+ $styles .= 'text-align:center;';
288
  }
289
 
290
  //Background color
294
  $styles .= 'background:#F1F1F1;';
295
  }
296
 
297
+ $styles .='}.seopress-user-consent p:first-child {margin-bottom:20px}.seopress-user-consent p {margin: 0;font-size: 0.8em;align-self: center;';
298
 
299
  //Text color
300
  if (seopress_google_analytics_cb_txt_col_option() !='') {
301
  $styles .= 'color:'.seopress_google_analytics_cb_txt_col_option().';';
302
  }
303
 
304
+ $styles .='}.seopress-user-consent button {vertical-align: middle;margin: 0;font-size: 14px;';
305
 
306
  //Btn background color
307
  if (seopress_google_analytics_cb_btn_bg_option() !='') {
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.5
8
  Requires PHP: 5.6
9
- Stable tag: 4.1
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -308,6 +308,13 @@ You're theme is probably using a deprecated function to handle the title. <a hre
308
  8. Installation Wizard
309
 
310
  == Changelog ==
 
 
 
 
 
 
 
311
  = 4.1 =
312
  * NEW Add FAQ schema to Toggle / Accordion widgets with Elementor (PRO) 🎉
313
  * NEW Dropdown for meta title / meta description to quickly add dynamic variables! 🎉
6
  Requires at least: 4.7+
7
  Tested up to: 5.5
8
  Requires PHP: 5.6
9
+ Stable tag: 4.1.1
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
308
  8. Installation Wizard
309
 
310
  == Changelog ==
311
+ = 4.1.1 =
312
+ * NEW Add "Text alignment" option for cookie bar
313
+ * INFO Improved cookie bar design
314
+ * FIX Redirections capabilities
315
+ * FIX Elementor compatibility
316
+ * FIX Fatal error with PHP <= 7.3
317
+ * FIX Notice: Trying to get property 'post_type' of non-object in /wp-content/plugins/wp-seopress/inc/admin/adminbar.php on line 68
318
  = 4.1 =
319
  * NEW Add FAQ schema to Toggle / Accordion widgets with Elementor (PRO) 🎉
320
  * NEW Dropdown for meta title / meta description to quickly add dynamic variables! 🎉
seopress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: One of the best SEO plugins for WordPress.
6
- Version: 4.1
7
  Author: SEOPress
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
@@ -55,7 +55,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
  //Define
57
  ///////////////////////////////////////////////////////////////////////////////////////////////////
58
- define( 'SEOPRESS_VERSION', '4.1' );
59
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
60
 
61
  ///////////////////////////////////////////////////////////////////////////////////////////////////
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: One of the best SEO plugins for WordPress.
6
+ Version: 4.1.1
7
  Author: SEOPress
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
  //Define
57
  ///////////////////////////////////////////////////////////////////////////////////////////////////
58
+ define( 'SEOPRESS_VERSION', '4.1.1' );
59
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
60
 
61
  ///////////////////////////////////////////////////////////////////////////////////////////////////