SEOPress - Version 3.3.11.2

Version Description

  • FIX Content Analysis for non UTF-8 characters
  • FIX H1 count for Content Analysis
  • FIX Content Analysis for Images and links detection
Download this release

Release Info

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

Code changes from version 3.3.11.1 to 3.3.11.2

inc/admin/admin-metaboxes-content-analysis-form.php CHANGED
@@ -95,14 +95,7 @@ if ( is_plugin_active( 'wp-seopress-pro/seopress-pro.php' ) ) {
95
  if (!empty($seopress_analysis_data['0']['h1']['matches'])) {
96
  echo '<h3>'.__('H1 (Heading 1)','wp-seopress').'</h3>';
97
 
98
- if (!empty($seopress_analysis_data['0']['h1']['nomatches'])) {
99
- $h1nomatches = count($seopress_analysis_data['0']['h1']['nomatches']);
100
- } else {
101
- $h1nomatches = 0;
102
- }
103
-
104
- $count = count($seopress_analysis_data['0']['h1']['matches']);
105
- $count = $count + $h1nomatches;
106
 
107
  $target_kws_h1 = $seopress_analysis_data['0']['h1']['matches'];
108
 
95
  if (!empty($seopress_analysis_data['0']['h1']['matches'])) {
96
  echo '<h3>'.__('H1 (Heading 1)','wp-seopress').'</h3>';
97
 
98
+ $count = $seopress_analysis_data['0']['h1']['nomatches']['count'];
 
 
 
 
 
 
 
99
 
100
  $target_kws_h1 = $seopress_analysis_data['0']['h1']['matches'];
101
 
inc/admin/ajax.php CHANGED
@@ -7,7 +7,7 @@ defined( 'ABSPATH' ) or die( 'Please don&rsquo;t call the plugin directly. Thank
7
  function seopress_do_real_preview() {
8
  check_ajax_referer( 'seopress_real_preview_nonce', $_GET['_ajax_nonce'], true );
9
 
10
- if (current_user_can('edit_posts') && is_admin()) {
11
 
12
  //Get cookies
13
  if (isset($_COOKIE)) {
@@ -76,7 +76,7 @@ function seopress_do_real_preview() {
76
  $data['title'] = $cookies;
77
 
78
  if ($seopress_origin =='post') { //Default: post type
79
- $response = wp_remote_get(get_preview_post_link((int)$seopress_get_the_id), $args);
80
  } else { //Term taxonomy
81
  $response = wp_remote_get(get_term_link((int)$seopress_get_the_id, $seopress_tax_name), $args);
82
  }
@@ -114,7 +114,7 @@ function seopress_do_real_preview() {
114
  if (!empty($meta_description)) {
115
  foreach ($meta_description as $meta_desc) {
116
  foreach ($seopress_analysis_target_kw as $kw) {
117
- if (preg_match_all('#\b('.$kw.')\b#iu', utf8_decode($meta_desc->nodeValue), $m)) {
118
  $data['meta_description']['matches'][$kw][] = $m[0];
119
  }
120
  }
@@ -166,12 +166,11 @@ function seopress_do_real_preview() {
166
  //h1
167
  $h1 = $xpath->query("//h1");
168
  if (!empty($h1)) {
 
169
  foreach ($h1 as $heading1) {
170
  foreach ($seopress_analysis_target_kw as $kw) {
171
- if (preg_match_all('#\b('.$kw.')\b#iu', utf8_decode($heading1->nodeValue), $m)) {
172
  $data['h1']['matches'][$kw][] = $m[0];
173
- } else {
174
- $data['h1']['nomatches'][$kw][] = $m[0];
175
  }
176
  }
177
  }
@@ -182,7 +181,7 @@ function seopress_do_real_preview() {
182
  if (!empty($h2)) {
183
  foreach ($h2 as $heading2) {
184
  foreach ($seopress_analysis_target_kw as $kw) {
185
- if (preg_match_all('#\b('.$kw.')\b#iu', utf8_decode($heading2->nodeValue), $m)) {
186
  $data['h2']['matches'][$kw][] = $m[0];
187
  }
188
  }
@@ -194,7 +193,7 @@ function seopress_do_real_preview() {
194
  if (!empty($h3)) {
195
  foreach ($h3 as $heading3) {
196
  foreach ($seopress_analysis_target_kw as $kw) {
197
- if (preg_match_all('#\b('.$kw.')\b#iu', utf8_decode($heading3->nodeValue), $m)) {
198
  $data['h3']['matches'][$kw][] = $m[0];
199
  }
200
  }
7
  function seopress_do_real_preview() {
8
  check_ajax_referer( 'seopress_real_preview_nonce', $_GET['_ajax_nonce'], true );
9
 
10
+ if (current_user_can('edit_posts') && is_admin()) {
11
 
12
  //Get cookies
13
  if (isset($_COOKIE)) {
76
  $data['title'] = $cookies;
77
 
78
  if ($seopress_origin =='post') { //Default: post type
79
+ $response = wp_remote_get(get_preview_post_link((int)$seopress_get_the_id,array('no_admin_bar' => 1)), $args);
80
  } else { //Term taxonomy
81
  $response = wp_remote_get(get_term_link((int)$seopress_get_the_id, $seopress_tax_name), $args);
82
  }
114
  if (!empty($meta_description)) {
115
  foreach ($meta_description as $meta_desc) {
116
  foreach ($seopress_analysis_target_kw as $kw) {
117
+ if (preg_match_all('#\b('.$kw.')\b#iu', $meta_desc->nodeValue, $m)) {
118
  $data['meta_description']['matches'][$kw][] = $m[0];
119
  }
120
  }
166
  //h1
167
  $h1 = $xpath->query("//h1");
168
  if (!empty($h1)) {
169
+ $data['h1']['nomatches']['count'] = count($h1);
170
  foreach ($h1 as $heading1) {
171
  foreach ($seopress_analysis_target_kw as $kw) {
172
+ if (preg_match_all('#\b('.$kw.')\b#iu', $heading1->nodeValue, $m)) {
173
  $data['h1']['matches'][$kw][] = $m[0];
 
 
174
  }
175
  }
176
  }
181
  if (!empty($h2)) {
182
  foreach ($h2 as $heading2) {
183
  foreach ($seopress_analysis_target_kw as $kw) {
184
+ if (preg_match_all('#\b('.$kw.')\b#iu', $heading2->nodeValue, $m)) {
185
  $data['h2']['matches'][$kw][] = $m[0];
186
  }
187
  }
193
  if (!empty($h3)) {
194
  foreach ($h3 as $heading3) {
195
  foreach ($seopress_analysis_target_kw as $kw) {
196
+ if (preg_match_all('#\b('.$kw.')\b#iu', $heading3->nodeValue, $m)) {
197
  $data['h3']['matches'][$kw][] = $m[0];
198
  }
199
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: SEO, XML sitemap, meta title, open graph, content analysis, knowledge grap
6
  Requires at least: 4.4+
7
  Tested up to: 5.1
8
  Requires PHP: 5.4
9
- Stable tag: 3.3.11.1
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -162,8 +162,13 @@ Subscribe on <a href="https://www.seopress.org/" target="_blank">seopress.org</a
162
  44. Structured Data Types metaboxe in post, page, custom post type (PRO)
163
 
164
  == Changelog ==
 
 
 
 
165
  = 3.3.11.1 =
166
  * FIX SSL verification for Content Analysis / Snippet Preview!
 
167
  = 3.3.11 =
168
  * NEW Add seopress_category_rewrite_rules hook to filter rewrite rules for category taxonomy
169
  * INFO Content analysis is now working with draft / pending review / published posts
6
  Requires at least: 4.4+
7
  Tested up to: 5.1
8
  Requires PHP: 5.4
9
+ Stable tag: 3.3.11.2
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
162
  44. Structured Data Types metaboxe in post, page, custom post type (PRO)
163
 
164
  == Changelog ==
165
+ = 3.3.11.2 =
166
+ * FIX Content Analysis for non UTF-8 characters
167
+ * FIX H1 count for Content Analysis
168
+ * FIX Content Analysis for Images and links detection
169
  = 3.3.11.1 =
170
  * FIX SSL verification for Content Analysis / Snippet Preview!
171
+ * FIX a problem with cookies that prevented the generation of Snippet Preview / Content Analysis
172
  = 3.3.11 =
173
  * NEW Add seopress_category_rewrite_rules hook to filter rewrite rules for category taxonomy
174
  * INFO Content analysis is now working with draft / pending review / published posts
seopress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: The best plugin for SEO.
6
- Version: 3.3.11.1
7
  Author: Benjamin Denis
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
@@ -53,7 +53,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
53
  ///////////////////////////////////////////////////////////////////////////////////////////////////
54
  //Define
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
- define( 'SEOPRESS_VERSION', '3.3.11.1' );
57
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
58
 
59
  ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -571,6 +571,16 @@ if (seopress_xml_sitemap_general_enable_option() =='1' && seopress_get_toggle_xm
571
  }
572
  }
573
 
 
 
 
 
 
 
 
 
 
 
574
  ///////////////////////////////////////////////////////////////////////////////////////////////////
575
  // Test abolute URLs (return true if absolute)
576
  ///////////////////////////////////////////////////////////////////////////////////////////////////
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: The best plugin for SEO.
6
+ Version: 3.3.11.2
7
  Author: Benjamin Denis
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
53
  ///////////////////////////////////////////////////////////////////////////////////////////////////
54
  //Define
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
+ define( 'SEOPRESS_VERSION', '3.3.11.2' );
57
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
58
 
59
  ///////////////////////////////////////////////////////////////////////////////////////////////////
571
  }
572
  }
573
 
574
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
575
+ // Remove Admin Bar with Content Analysis
576
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
577
+ function seopress_remove_admin_bar() {
578
+ if (isset($_GET['no_admin_bar']) && $_GET['no_admin_bar'] == 1) {
579
+ add_filter('show_admin_bar', '__return_false');
580
+ }
581
+ }
582
+ add_action('plugins_loaded', 'seopress_remove_admin_bar');
583
+
584
  ///////////////////////////////////////////////////////////////////////////////////////////////////
585
  // Test abolute URLs (return true if absolute)
586
  ///////////////////////////////////////////////////////////////////////////////////////////////////