ACF Content Analysis for Yoast SEO - Version 1.2.3

Version Description

  • Fix PHP warnings.
  • Works with WordPress 4.5
Download this release

Release Info

Developer ViktorFroberg
Plugin Icon 128x128 ACF Content Analysis for Yoast SEO
Version 1.2.3
Comparing to
See all releases

Code changes from version 1.2.2 to 1.2.3

Files changed (2) hide show
  1. readme.txt +7 -3
  2. yoast-seo-acf-content-analysis.php +34 -38
readme.txt CHANGED
@@ -2,12 +2,12 @@
2
  Contributors: ViktorFroberg, marol87, pekz0r, angrycreative
3
  Tags: Angry Creative, Yoast SEO, Yoast, SEO, ACF, Advanced Custom Fields
4
  Requires at least: 4.0
5
- Tested up to: 4.4.2
6
- Stable tag: 1.2.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- This plugin ensures that Yoast SEO analysize all ACF content including Flexible Content and Repeaters.
11
  Requires version 3.0 or later of Yoast SEO plugin.
12
 
13
  == Description ==
@@ -36,6 +36,10 @@ add_filter('ysacf_exclude_fields', function(){
36
 
37
  == Changelog ==
38
 
 
 
 
 
39
  = 1.2.2 =
40
  * Fix warning for undefined index
41
  * Fix support for multisite
2
  Contributors: ViktorFroberg, marol87, pekz0r, angrycreative
3
  Tags: Angry Creative, Yoast SEO, Yoast, SEO, ACF, Advanced Custom Fields
4
  Requires at least: 4.0
5
+ Tested up to: 4.5
6
+ Stable tag: 1.2.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Ensure that Yoast SEO analysize all ACF content including Flexible Content and Repeaters.
11
  Requires version 3.0 or later of Yoast SEO plugin.
12
 
13
  == Description ==
36
 
37
  == Changelog ==
38
 
39
+ = 1.2.3 =
40
+ * Fix PHP warnings.
41
+ * Works with WordPress 4.5
42
+
43
  = 1.2.2 =
44
  * Fix warning for undefined index
45
  * Fix support for multisite
yoast-seo-acf-content-analysis.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: ACF-Content Analysis for Yoast SEO
4
  Plugin URI: http://angrycreative.se
5
- Description: This plugin ensures that Yoast SEO analysize all ACF content including Flexible Content and Repeaters
6
- Version: 1.2.2
7
  Author: ViktorFroberg, marol87, pekz0r, angrycreative
8
  Author URI: http://angrycreative.se
9
  License: GPL
@@ -28,7 +28,7 @@ class AC_Yoast_SEO_ACF_Content_Analysis
28
  * @since 0.1.0
29
  * @var string
30
  */
31
- const VERSION = '1.2.2';
32
  /**
33
  * Unique identifier for the plugin.
34
  * This value is used as the text domain when internationalizing strings of text. It should
@@ -81,49 +81,45 @@ class AC_Yoast_SEO_ACF_Content_Analysis
81
 
82
  function get_field_data($fields) {
83
 
84
- $values = $this->get_values( $fields );
85
  $data = '';
86
-
87
- foreach($fields as $key =>$item) {
88
-
89
- if(in_array($key, $this->get_excluded_fields()) ){
90
- continue;
91
- } else {
92
- switch(gettype($item)) {
93
- case 'string':
94
- $data = $data.' '.$item;
95
- break;
96
-
97
- case 'array':
98
- if(isset($item['sizes']['thumbnail'])) {
99
- // put all images in img tags for scoring.
100
- $alt = '';
101
- if(isset($item['alt'])) {
102
- $alt = $item['alt'];
 
 
 
 
 
 
 
 
 
103
  }
104
- $title = '';
105
- if(isset($item['title'])) {
106
- $title = $item['title'];
107
- }
108
- $data = $data.' <img src="'.$item['sizes']['thumbnail'] . '" alt="' . $alt .'" title="' . $title . '"/>';
109
- } else {
110
-
111
- $data = $data.' '.$this->get_field_data($item);
112
- }
113
-
114
- break;
115
  }
116
- }
117
  }
118
 
 
119
  return $data;
120
  }
121
 
122
- function get_values($array) {
123
- $value_array = array_values($array);
124
- return $value_array;
125
- }
126
-
127
  function ajax_get_fields() {
128
 
129
  $pid = filter_input(INPUT_POST, 'postId', FILTER_SANITIZE_STRING);
2
  /*
3
  Plugin Name: ACF-Content Analysis for Yoast SEO
4
  Plugin URI: http://angrycreative.se
5
+ Description: Ensure that Yoast SEO analysize all ACF content including Flexible Content and Repeaters.
6
+ Version: 1.2.3
7
  Author: ViktorFroberg, marol87, pekz0r, angrycreative
8
  Author URI: http://angrycreative.se
9
  License: GPL
28
  * @since 0.1.0
29
  * @var string
30
  */
31
+ const VERSION = '1.2.3';
32
  /**
33
  * Unique identifier for the plugin.
34
  * This value is used as the text domain when internationalizing strings of text. It should
81
 
82
  function get_field_data($fields) {
83
 
 
84
  $data = '';
85
+ if($fields) {
86
+ foreach($fields as $key =>$item) {
87
+
88
+ if(in_array($key, $this->get_excluded_fields()) ){
89
+ continue;
90
+ } else {
91
+ switch(gettype($item)) {
92
+ case 'string':
93
+ $data = $data.' '.$item;
94
+ break;
95
+
96
+ case 'array':
97
+ if(isset($item['sizes']['thumbnail'])) {
98
+ // put all images in img tags for scoring.
99
+ $alt = '';
100
+ if(isset($item['alt'])) {
101
+ $alt = $item['alt'];
102
+ }
103
+ $title = '';
104
+ if(isset($item['title'])) {
105
+ $title = $item['title'];
106
+ }
107
+ $data = $data.' <img src="'.$item['sizes']['thumbnail'] . '" alt="' . $alt .'" title="' . $title . '"/>';
108
+ } else {
109
+
110
+ $data = $data.' '.$this->get_field_data($item);
111
  }
112
+
113
+ break;
114
+ }
 
 
 
 
 
 
 
 
115
  }
116
+ }
117
  }
118
 
119
+
120
  return $data;
121
  }
122
 
 
 
 
 
 
123
  function ajax_get_fields() {
124
 
125
  $pid = filter_input(INPUT_POST, 'postId', FILTER_SANITIZE_STRING);