ACF Content Analysis for Yoast SEO - Version 2.4.0

Version Description

Released June 4th, 2020

Enhancements:

  • Add support for ACF blocks. Props to TimVevida.

Other:

  • Fixes a couple of typos in the code documentation. Props to akkspros.
  • Deprecates Yoast_ACF_Analysis_Facade::get_filter_name(). Use hard-coded hook names instead.
  • Deprecates the yoast-acf-analysis/configfilter hook in favor of theYoast\WP\ACF\config` hook.
  • Deprecates the yoast-acf-analysis/headlines filter hook in favor of the Yoast\WP\ACF\headlines hook.
  • Deprecates the yoast-acf-analysis/blacklist_type filter hook in favor of the Yoast\WP\ACF\blacklist_type hook.
  • Deprecates the yoast-acf-analysis/blacklist_name filter hook in favor of the Yoast\WP\ACF\blacklist_name hook.
  • Deprecates the yoast-acf-analysis/scraper_config filter hook in favor of the Yoast\WP\ACF\scraper_config hook.
  • Deprecates the yoast-acf-analysis/refresh_rate filter hook in favor of the Yoast\WP\ACF\refresh_rate hook.
  • Deprecates the yoast-acf-analysis/field_selectors filter hook in favor of the Yoast\WP\ACF\field_selectors hook.
  • Deprecates the yoast-acf-analysis/field_order filter hook in favor of the Yoast\WP\ACF\field_order hook.
Download this release

Release Info

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

Code changes from version 2.3.0 to 2.4.0

Files changed (43) hide show
  1. .eslintrc +0 -12
  2. .phpcs.xml.dist +59 -27
  3. inc/ac-yoast-seo-acf-content-analysis.php +73 -32
  4. inc/assets.php +4 -6
  5. inc/configuration/configuration.php +122 -29
  6. inc/configuration/string-store.php +2 -2
  7. inc/dependencies/dependency-acf.php +1 -1
  8. inc/dependencies/dependency-interface.php +1 -1
  9. inc/dependencies/dependency-yoast-seo.php +3 -3
  10. inc/facade.php +4 -1
  11. inc/registry.php +1 -1
  12. inc/requirements.php +2 -2
  13. js/src/collect/collect-v5.js +31 -9
  14. js/src/replacevars.js +1 -1
  15. js/src/scraper-store.js +2 -0
  16. js/src/scraper/scraper.block_preview.js +19 -0
  17. js/yoast-acf-analysis.js +64 -19
  18. phpunit.xml.dist +0 -21
  19. readme.txt +29 -8
  20. tests/js/system/data/test-data-loader-functions.php +1 -1
  21. tests/php/unit/Configuration/configuration-test.php +85 -79
  22. tests/php/unit/Configuration/string-store-test.php +24 -9
  23. tests/php/unit/Dependencies/acf-dependency-test.php +12 -8
  24. tests/php/unit/Dependencies/yoast-seo-dependency-test.php +17 -13
  25. tests/php/unit/Doubles/failing-dependency.php +6 -4
  26. tests/php/unit/Doubles/passing-dependency.php +6 -4
  27. tests/php/unit/assets-test.php +13 -9
  28. tests/php/unit/main-test.php +15 -7
  29. tests/php/unit/registry-test.php +19 -11
  30. tests/php/unit/requirements-test.php +22 -10
  31. vendor/autoload.php +1 -1
  32. vendor/autoload_52.php +0 -7
  33. vendor/composer/ClassLoader52.php +0 -271
  34. vendor/composer/autoload_classmap.php +5 -2
  35. vendor/composer/autoload_namespaces.php +0 -1
  36. vendor/composer/autoload_real.php +7 -4
  37. vendor/composer/autoload_real_52.php +0 -44
  38. vendor/composer/autoload_static.php +9 -17
  39. vendor/xrstf/composer-php52/LICENSE +0 -19
  40. vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php +0 -346
  41. vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php +0 -271
  42. vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php +0 -39
  43. yoast-acf-analysis.php +1 -5
.eslintrc DELETED
@@ -1,12 +0,0 @@
1
- extends: yoast
2
-
3
- rules:
4
- complexity: [1, 6]
5
- camelcase: 1
6
- brace-style: 2
7
- max-len: 1
8
- max-statements: 1
9
- valid-jsdoc: 2
10
- global-require: 1
11
- strict: 1
12
- keyword-spacing: 2
 
 
 
 
 
 
 
 
 
 
 
 
.phpcs.xml.dist CHANGED
@@ -14,9 +14,6 @@
14
 
15
  <file>.</file>
16
 
17
- <exclude-pattern>vendor/*</exclude-pattern>
18
- <exclude-pattern>node_modules/*</exclude-pattern>
19
- <exclude-pattern>languages/*</exclude-pattern>
20
  <exclude-pattern>tests/js/system/data/acf*\.php$</exclude-pattern><!-- Code exported from ACF. -->
21
  <exclude-pattern>tests/php/unit/Dependencies/acf\.php$</exclude-pattern><!-- ACF mock class. -->
22
 
@@ -29,7 +26,7 @@
29
  <!-- Strip the filepaths down to the relevant bit. -->
30
  <arg name="basepath" value="./"/>
31
 
32
- <!-- Check up to 8 files simultanously. -->
33
  <arg name="parallel" value="8"/>
34
 
35
 
@@ -39,7 +36,15 @@
39
  #############################################################################
40
  -->
41
 
42
- <rule ref="Yoast"/>
 
 
 
 
 
 
 
 
43
 
44
 
45
  <!--
@@ -48,9 +53,6 @@
48
  #############################################################################
49
  -->
50
 
51
- <!-- Set the minimum supported WP version. This is used by several sniffs. -->
52
- <config name="minimum_supported_wp_version" value="4.6"/>
53
-
54
  <!-- Verify that all gettext calls use the correct text domain. -->
55
  <rule ref="WordPress.WP.I18n">
56
  <properties>
@@ -63,37 +65,28 @@
63
  <rule ref="Yoast.Files.FileName">
64
  <properties>
65
  <!-- Don't trigger on the main file as renaming it would deactivate the plugin. -->
66
- <property name="exclude" type="array">
67
  <element value="yoast-acf-analysis.php"/>
68
  </property>
69
 
70
  <!-- Remove the following prefixes from the names of object structures. -->
71
- <property name="prefixes" type="array">
72
  <element value="Yoast_ACF_Analysis"/>
 
73
  </property>
74
  </properties>
75
  </rule>
76
 
77
- <!-- Verify that everything in the global namespace is prefixed with a plugin specific prefix. -->
78
- <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
79
  <properties>
80
- <!-- Provide the prefixes to look for. -->
81
- <property name="prefixes" type="array">
82
- <!-- Temporarily allowed until the prefixes are fixed. -->
83
- <element value="AC_Yoast"/>
84
- <element value="AC_SEO"/>
85
- <element value="ysacf"/>
86
- <!-- These are the new prefixes which all code should comply with in the future. -->
87
- <element value="yoast_acf"/>
88
- <element value="Yoast\WP\ACF"/>
89
  </property>
90
- </properties>
91
- </rule>
92
 
93
- <!-- Allow additional word delimiters for hook names. -->
94
- <rule ref="WordPress.NamingConventions.ValidHookName">
95
- <properties>
96
- <property name="additionalWordDelimiters" value="/"/>
97
  </properties>
98
  </rule>
99
 
@@ -107,4 +100,43 @@
107
  </properties>
108
  </rule>
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  </ruleset>
14
 
15
  <file>.</file>
16
 
 
 
 
17
  <exclude-pattern>tests/js/system/data/acf*\.php$</exclude-pattern><!-- Code exported from ACF. -->
18
  <exclude-pattern>tests/php/unit/Dependencies/acf\.php$</exclude-pattern><!-- ACF mock class. -->
19
 
26
  <!-- Strip the filepaths down to the relevant bit. -->
27
  <arg name="basepath" value="./"/>
28
 
29
+ <!-- Check up to 8 files simultaneously. -->
30
  <arg name="parallel" value="8"/>
31
 
32
 
36
  #############################################################################
37
  -->
38
 
39
+ <rule ref="Yoast">
40
+ <properties>
41
+ <!-- Provide the plugin specific prefixes for all naming related sniffs. -->
42
+ <property name="prefixes" type="array">
43
+ <element value="Yoast\WP\ACF"/>
44
+ <element value="yoast_acf"/>
45
+ </property>
46
+ </properties>
47
+ </rule>
48
 
49
 
50
  <!--
53
  #############################################################################
54
  -->
55
 
 
 
 
56
  <!-- Verify that all gettext calls use the correct text domain. -->
57
  <rule ref="WordPress.WP.I18n">
58
  <properties>
65
  <rule ref="Yoast.Files.FileName">
66
  <properties>
67
  <!-- Don't trigger on the main file as renaming it would deactivate the plugin. -->
68
+ <property name="excluded_files_strict_check" type="array">
69
  <element value="yoast-acf-analysis.php"/>
70
  </property>
71
 
72
  <!-- Remove the following prefixes from the names of object structures. -->
73
+ <property name="oo_prefixes" type="array">
74
  <element value="Yoast_ACF_Analysis"/>
75
+ <element value="yoast_acf"/>
76
  </property>
77
  </properties>
78
  </rule>
79
 
80
+ <rule ref="Yoast.NamingConventions.NamespaceName">
 
81
  <properties>
82
+ <!-- Treat the "tests/php/unit" directory as a project root for path to namespace translations. -->
83
+ <property name="src_directory" type="array">
84
+ <element value="tests/php/unit"/>
 
 
 
 
 
 
85
  </property>
 
 
86
 
87
+ <property name="prefixes" type="array" extend="true">
88
+ <element value="Yoast\WP\ACF\Tests"/>
89
+ </property>
 
90
  </properties>
91
  </rule>
92
 
100
  </properties>
101
  </rule>
102
 
103
+
104
+ <!--
105
+ #############################################################################
106
+ SELECTIVE EXCLUSIONS
107
+ Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.
108
+ #############################################################################
109
+ -->
110
+
111
+ <!-- Valid usage: For testing purposes, some non-prefixed globals are being created. -->
112
+ <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
113
+ <exclude-pattern>/integration-tests/bootstrap\.php$</exclude-pattern>
114
+ <exclude-pattern>/tests/bootstrap\.php$</exclude-pattern>
115
+ </rule>
116
+
117
+
118
+ <!--
119
+ #############################################################################
120
+ TEMPORARY ADJUSTMENTS
121
+ Adjustments which should be removed once the associated issue has been resolved.
122
+ #############################################################################
123
+ -->
124
+
125
+ <!-- Until all prefixes are fixed, some exceptions are allowed to the PrefixAllGlobals sniff. -->
126
+ <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
127
+ <properties>
128
+ <property name="prefixes" type="array" extend="true">
129
+ <element value="AC_Yoast"/>
130
+ <element value="AC_SEO"/>
131
+ </property>
132
+ </properties>
133
+ </rule>
134
+
135
+ <!-- Namespaced test classes imported via a use statement are not yet correctly excluded
136
+ by WPCS. This will most likely be fixed once PHPCS 3.5.0 has been released and
137
+ WPCS has upgraded to that version. -->
138
+ <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound">
139
+ <exclude-pattern>/tests/php/unit/Dependencies/yoast-seo-dependency-test\.php$</exclude-pattern>
140
+ </rule>
141
+
142
  </ruleset>
inc/ac-yoast-seo-acf-content-analysis.php CHANGED
@@ -18,7 +18,7 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
18
  * @return void
19
  */
20
  public function init() {
21
- add_action( 'admin_init', array( $this, 'admin_init' ) );
22
  }
23
 
24
  /**
@@ -53,7 +53,7 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
53
 
54
  $configuration = $registry->get( 'config' );
55
 
56
- if ( null !== $configuration && $configuration instanceof Yoast_ACF_Analysis_Configuration ) {
57
  return;
58
  }
59
 
@@ -71,11 +71,32 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
71
  *
72
  * @see Yoast_ACF_Analysis_Configuration
73
  *
74
- * @since 2.0.0
 
75
  *
76
  * @param Yoast_ACF_Analysis_Configuration $configuration Plugin configuration instance
77
  */
78
- $custom_configuration = apply_filters( Yoast_ACF_Analysis_Facade::get_filter_name( 'config' ), $configuration );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  if ( $custom_configuration instanceof Yoast_ACF_Analysis_Configuration ) {
80
  $configuration = $custom_configuration;
81
  }
@@ -90,8 +111,8 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
90
  */
91
  protected function register_config_filters() {
92
  add_filter(
93
- Yoast_ACF_Analysis_Facade::get_filter_name( 'scraper_config' ),
94
- array( $this, 'filter_scraper_config' )
95
  );
96
  }
97
 
@@ -100,32 +121,52 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
100
  *
101
  * @param array $scraper_config The scraper configuration.
102
  *
103
- * @return array The enhanched scraper config.
104
  */
105
  public function filter_scraper_config( $scraper_config ) {
106
- $scraper_config['text'] = array(
107
- /**
108
- * Filters which ACF text fields are to be treated as a headline by the text scraper.
109
- *
110
- * The array has the ACF field key as the array key and the value should be an integer from 1 to 6
111
- * that corresponds to the 6 possible HTML tags <h1> to <h6>.
112
- *
113
- * So this is how to make the field with the key "field_591eb45f2be86" a <h3>:
114
- *
115
- * $headlines_config = array(
116
- * 'field_591eb45f2be86' => 3
117
- * );
118
- *
119
- * @since 2.0.0
120
- *
121
- * @param array $headlines_config {
122
- * @type string $field_name Name of the ACF field
123
- * @type int $headline_level Headline level 1 to 6
124
- * }
125
- */
126
- 'headlines' => apply_filters( Yoast_ACF_Analysis_Facade::get_filter_name( 'headlines' ), array() ),
127
  );
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  return $scraper_config;
130
  }
131
 
@@ -137,7 +178,7 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
137
  protected function get_field_selectors() {
138
  $field_selectors = new Yoast_ACF_Analysis_String_Store();
139
 
140
- $default_field_selectors = array(
141
  // Text.
142
  'input[type=text][id^=acf]',
143
 
@@ -158,7 +199,7 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
158
 
159
  // Taxonomy.
160
  '.acf-taxonomy-field',
161
- );
162
 
163
  foreach ( $default_field_selectors as $field_selector ) {
164
  $field_selectors->add( $field_selector );
@@ -176,7 +217,7 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
176
 
177
  $blacklist = new Yoast_ACF_Analysis_String_Store();
178
 
179
- $default_blacklist = array(
180
  'number',
181
  'password',
182
 
@@ -200,7 +241,7 @@ class AC_Yoast_SEO_ACF_Content_Analysis {
200
  'repeater',
201
  'flexible_content',
202
  'group',
203
- );
204
 
205
  foreach ( $default_blacklist as $type ) {
206
  $blacklist->add( $type );
18
  * @return void
19
  */
20
  public function init() {
21
+ add_action( 'admin_init', [ $this, 'admin_init' ] );
22
  }
23
 
24
  /**
53
 
54
  $configuration = $registry->get( 'config' );
55
 
56
+ if ( $configuration !== null && $configuration instanceof Yoast_ACF_Analysis_Configuration ) {
57
  return;
58
  }
59
 
71
  *
72
  * @see Yoast_ACF_Analysis_Configuration
73
  *
74
+ * @since 2.0.0
75
+ * @deprecated 2.4.0. Use the {@see 'Yoast\WP\ACF\config'} filter instead.
76
  *
77
  * @param Yoast_ACF_Analysis_Configuration $configuration Plugin configuration instance
78
  */
79
+ $custom_configuration = apply_filters_deprecated(
80
+ 'yoast-acf-analysis/config',
81
+ [ $configuration ],
82
+ 'YoastSEO ACF 2.4.0',
83
+ 'Yoast\WP\ACF\config'
84
+ );
85
+
86
+ /**
87
+ * Filters the plugin configuration instance.
88
+ *
89
+ * You can replace the whole plugin configuration with a custom instance.
90
+ * Only use this as a last resort as there are multiple more specific filters in the default configuration.
91
+ *
92
+ * @see Yoast_ACF_Analysis_Configuration
93
+ *
94
+ * @since 2.4.0
95
+ *
96
+ * @param Yoast_ACF_Analysis_Configuration $configuration Plugin configuration instance
97
+ */
98
+ $custom_configuration = apply_filters( 'Yoast\WP\ACF\config', $custom_configuration );
99
+
100
  if ( $custom_configuration instanceof Yoast_ACF_Analysis_Configuration ) {
101
  $configuration = $custom_configuration;
102
  }
111
  */
112
  protected function register_config_filters() {
113
  add_filter(
114
+ 'Yoast\WP\ACF\scraper_config',
115
+ [ $this, 'filter_scraper_config' ]
116
  );
117
  }
118
 
121
  *
122
  * @param array $scraper_config The scraper configuration.
123
  *
124
+ * @return array The enhanced scraper config.
125
  */
126
  public function filter_scraper_config( $scraper_config ) {
127
+ /**
128
+ * Filters which ACF text fields are to be treated as a headline by the text scraper.
129
+ *
130
+ * @since 2.0.0
131
+ * @deprecated 2.4.0. Use the {@see 'Yoast\WP\ACF\headlines'} filter instead.
132
+ *
133
+ * @param array $headlines_config {
134
+ * @type string $field_name Name of the ACF field
135
+ * @type int $headline_level Headline level 1 to 6
136
+ * }
137
+ */
138
+ $headline = apply_filters_deprecated(
139
+ 'yoast-acf-analysis/headlines',
140
+ [ [] ],
141
+ 'YoastSEO ACF 2.4.0',
142
+ 'Yoast\WP\ACF\headlines'
 
 
 
 
 
143
  );
144
 
145
+ /**
146
+ * Filters which ACF text fields are to be treated as a headline by the text scraper.
147
+ *
148
+ * The array has the ACF field key as the array key and the value should be an integer from 1 to 6
149
+ * that corresponds to the 6 possible HTML tags <h1> to <h6>.
150
+ *
151
+ * So this is how to make the field with the key "field_591eb45f2be86" a <h3>:
152
+ *
153
+ * $headlines_config = array(
154
+ * 'field_591eb45f2be86' => 3
155
+ * );
156
+ *
157
+ * @since 2.4.0
158
+ *
159
+ * @param array $headlines_config {
160
+ * @type string $field_name Name of the ACF field
161
+ * @type int $headline_level Headline level 1 to 6
162
+ * }
163
+ */
164
+ $headline = apply_filters( 'Yoast\WP\ACF\headlines', $headline );
165
+
166
+ $scraper_config['text'] = [
167
+ 'headlines' => $headline,
168
+ ];
169
+
170
  return $scraper_config;
171
  }
172
 
178
  protected function get_field_selectors() {
179
  $field_selectors = new Yoast_ACF_Analysis_String_Store();
180
 
181
+ $default_field_selectors = [
182
  // Text.
183
  'input[type=text][id^=acf]',
184
 
199
 
200
  // Taxonomy.
201
  '.acf-taxonomy-field',
202
+ ];
203
 
204
  foreach ( $default_field_selectors as $field_selector ) {
205
  $field_selectors->add( $field_selector );
217
 
218
  $blacklist = new Yoast_ACF_Analysis_String_Store();
219
 
220
+ $default_blacklist = [
221
  'number',
222
  'password',
223
 
241
  'repeater',
242
  'flexible_content',
243
  'group',
244
+ ];
245
 
246
  foreach ( $default_blacklist as $type ) {
247
  $blacklist->add( $type );
inc/assets.php CHANGED
@@ -23,19 +23,17 @@ class Yoast_ACF_Analysis_Assets {
23
  public function init() {
24
  $this->plugin_data = get_plugin_data( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE );
25
 
26
- add_filter( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 11 );
27
  }
28
 
29
  /**
30
  * Enqueue JavaScript file to feed data to Yoast Content Analyses.
31
  */
32
  public function enqueue_scripts() {
33
- global $pagenow;
34
-
35
  /**
36
  * Yoast ACF plugin configuration.
37
  *
38
- * @var \Yoast_ACF_Analysis_Configuration
39
  */
40
  $config = Yoast_ACF_Analysis_Facade::get_registry()->get( 'config' );
41
 
@@ -44,7 +42,7 @@ class Yoast_ACF_Analysis_Assets {
44
  wp_enqueue_script(
45
  'yoast-acf-analysis-post',
46
  plugins_url( '/js/yoast-acf-analysis.js', AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ),
47
- array( 'jquery', WPSEO_Admin_Asset_Manager::PREFIX . 'post-scraper', 'underscore' ),
48
  $this->plugin_data['Version'],
49
  true
50
  );
@@ -57,7 +55,7 @@ class Yoast_ACF_Analysis_Assets {
57
  wp_enqueue_script(
58
  'yoast-acf-analysis-term',
59
  plugins_url( '/js/yoast-acf-analysis.js', AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ),
60
- array( 'jquery', WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper' ),
61
  $this->plugin_data['Version'],
62
  true
63
  );
23
  public function init() {
24
  $this->plugin_data = get_plugin_data( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE );
25
 
26
+ add_filter( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ], 11 );
27
  }
28
 
29
  /**
30
  * Enqueue JavaScript file to feed data to Yoast Content Analyses.
31
  */
32
  public function enqueue_scripts() {
 
 
33
  /**
34
  * Yoast ACF plugin configuration.
35
  *
36
+ * @var Yoast_ACF_Analysis_Configuration
37
  */
38
  $config = Yoast_ACF_Analysis_Facade::get_registry()->get( 'config' );
39
 
42
  wp_enqueue_script(
43
  'yoast-acf-analysis-post',
44
  plugins_url( '/js/yoast-acf-analysis.js', AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ),
45
+ [ 'jquery', WPSEO_Admin_Asset_Manager::PREFIX . 'post-scraper', 'underscore' ],
46
  $this->plugin_data['Version'],
47
  true
48
  );
55
  wp_enqueue_script(
56
  'yoast-acf-analysis-term',
57
  plugins_url( '/js/yoast-acf-analysis.js', AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ),
58
+ [ 'jquery', WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper' ],
59
  $this->plugin_data['Version'],
60
  true
61
  );
inc/configuration/configuration.php CHANGED
@@ -43,7 +43,7 @@ class Yoast_ACF_Analysis_Configuration {
43
  *
44
  * @var array
45
  */
46
- protected $scraper_config = array();
47
 
48
  /**
49
  * Yoast_ACF_Analysis_Configuration constructor.
@@ -74,7 +74,7 @@ class Yoast_ACF_Analysis_Configuration {
74
  }
75
 
76
  // Fall back on filter use.
77
- // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- ACF hook.
78
  return apply_filters( 'acf/get_info', 'version' );
79
  }
80
 
@@ -85,19 +85,34 @@ class Yoast_ACF_Analysis_Configuration {
85
  */
86
  public function get_blacklist_type() {
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  /**
89
  * Filters the fields to ignore based on field type.
90
  *
91
  * You can add or remove field types to be analysed.
92
  * Be aware that when adding types this will only have an effect if there is a scraper for the type.
93
  *
94
- * @since 2.0.0
95
  *
96
  * @param Yoast_ACF_Analysis_String_Store $blacklist_type Store instance of ignored field types
97
  */
98
  $blacklist_type = apply_filters(
99
- Yoast_ACF_Analysis_Facade::get_filter_name( 'blacklist_type' ),
100
- $this->blacklist_type
101
  );
102
 
103
  if ( $blacklist_type instanceof Yoast_ACF_Analysis_String_Store ) {
@@ -117,16 +132,16 @@ class Yoast_ACF_Analysis_Configuration {
117
  /**
118
  * Filters the fields to ignore based on field name.
119
  *
120
- * You can add or remove fields to be analysed based on the field name.
121
- *
122
- * @since 1.0.0
123
- * @deprecated 2.0.0 Use the {@see 'yoast-acf-analysis/blacklist_name'} filter instead.
124
  *
125
  * @param array $legacy_names Array with field names
126
  */
127
- $legacy_names = apply_filters(
128
  'ysacf_exclude_fields',
129
- array()
 
 
130
  );
131
 
132
  if ( is_array( $legacy_names ) && ! empty( $legacy_names ) ) {
@@ -135,18 +150,33 @@ class Yoast_ACF_Analysis_Configuration {
135
  }
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  /**
139
  * Filters the fields to ignore based on field name.
140
  *
141
  * You can add or remove fields to be analysed based on the field name.
142
  *
143
- * @since 2.0.0
144
  *
145
  * @param Yoast_ACF_Analysis_String_Store $blacklist_name Store instance of ignored field names
146
  */
147
  $blacklist_name = apply_filters(
148
- Yoast_ACF_Analysis_Facade::get_filter_name( 'blacklist_name' ),
149
- $this->blacklist_name
150
  );
151
 
152
  if ( $blacklist_name instanceof Yoast_ACF_Analysis_String_Store ) {
@@ -171,26 +201,41 @@ class Yoast_ACF_Analysis_Configuration {
171
  * @return array The scraper configuration.
172
  */
173
  public function get_scraper_config() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  /**
175
  * Filters the scraper configuration.
176
  *
177
  * This nested array holds configuration specific to certain scrapers (for specific field types)
178
- * Before using this filter see if there isn't a more specific one like {@see yoast-acf-analysis/headlines}.
179
  *
180
- * @since 2.0.0
181
  *
182
  * @param array $scraper_config Nested array of scraper configuration
183
  */
184
  $scraper_config = apply_filters(
185
- Yoast_ACF_Analysis_Facade::get_filter_name( 'scraper_config' ),
186
- $this->scraper_config
187
  );
188
 
189
  if ( is_array( $scraper_config ) ) {
190
  return $scraper_config;
191
  }
192
 
193
- return array();
194
  }
195
 
196
  /**
@@ -199,6 +244,21 @@ class Yoast_ACF_Analysis_Configuration {
199
  * @return int The number of milliseconds between scrape runs.
200
  */
201
  public function get_refresh_rate() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  /**
203
  * Refresh rate for changes to ACF fields
204
  *
@@ -206,11 +266,11 @@ class Yoast_ACF_Analysis_Configuration {
206
  * By default it will only report changes to Yoast SEO after no changes have happened for 1000 milliseconds.
207
  * This filter allows to change this to any value above 200 milliseconds.
208
  *
209
- * @since 2.0.0
210
  *
211
  * @param int $refresh_rate Refresh rates in milliseconds
212
  */
213
- $refresh_rate = apply_filters( Yoast_ACF_Analysis_Facade::get_filter_name( 'refresh_rate' ), $this->refresh_rate );
214
  $refresh_rate = intval( $refresh_rate, 10 );
215
 
216
  // Make sure the refresh rate is not too low, this will introduce problems in the browser of the user.
@@ -223,23 +283,38 @@ class Yoast_ACF_Analysis_Configuration {
223
  * @return Yoast_ACF_Analysis_String_Store Field selectors store.
224
  */
225
  public function get_field_selectors() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  /**
227
  * Filters the CSS selectors that are used to find the fields when using ACF4.
228
  *
229
  * This is an advanced filter that should rarely if ever be used, especially because it only affects ACF4.
230
  * If you want to exclude certain fields by type or name there are the more specific filters
231
- * {@see 'yoast-acf-analysis/blacklist_type'} and {@see 'yoast-acf-analysis/blacklist_name'} for these.
232
  *
233
  * @see get_blacklist_type()
234
  * @see get_blacklist_name()
235
  *
236
- * @since 2.0.0
237
  *
238
  * @param Yoast_ACF_Analysis_String_Store $field_selectors Field selector store instance
239
  */
240
  $field_selectors = apply_filters(
241
- Yoast_ACF_Analysis_Facade::get_filter_name( 'field_selectors' ),
242
- $this->field_selectors
243
  );
244
 
245
  if ( $field_selectors instanceof Yoast_ACF_Analysis_String_Store ) {
@@ -255,6 +330,24 @@ class Yoast_ACF_Analysis_Configuration {
255
  * @return array The field order configuration.
256
  */
257
  public function get_field_order() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  /**
259
  * Filters the order of the ACF fields relative to the post_content.
260
  *
@@ -267,14 +360,14 @@ class Yoast_ACF_Analysis_Configuration {
267
  * 'field_591eb45f2be86' => -1
268
  * );
269
  *
270
- * @since 2.2.0
271
  *
272
  * @param array $order_config {
273
  * @type string $field_name Name of the ACF field
274
  * @type int $order Integer
275
  * }
276
  */
277
- return apply_filters( Yoast_ACF_Analysis_Facade::get_filter_name( 'field_order' ), array() );
278
  }
279
 
280
  /**
@@ -283,7 +376,7 @@ class Yoast_ACF_Analysis_Configuration {
283
  * @return array
284
  */
285
  public function to_array() {
286
- return array(
287
  'pluginName' => Yoast_ACF_Analysis_Facade::get_plugin_name(),
288
  'acfVersion' => $this->get_acf_version(),
289
  'scraper' => $this->get_scraper_config(),
@@ -293,6 +386,6 @@ class Yoast_ACF_Analysis_Configuration {
293
  'fieldSelectors' => $this->get_field_selectors()->to_array(),
294
  'fieldOrder' => $this->get_field_order(),
295
  'debug' => $this->is_debug(),
296
- );
297
  }
298
  }
43
  *
44
  * @var array
45
  */
46
+ protected $scraper_config = [];
47
 
48
  /**
49
  * Yoast_ACF_Analysis_Configuration constructor.
74
  }
75
 
76
  // Fall back on filter use.
77
+ // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- ACF hook.
78
  return apply_filters( 'acf/get_info', 'version' );
79
  }
80
 
85
  */
86
  public function get_blacklist_type() {
87
 
88
+ /**
89
+ * Filters the fields to ignore based on field type.
90
+ *
91
+ * @since 2.0.0
92
+ * @deprecated 2.4.0. Use the {@see 'Yoast\WP\ACF\blacklist_type'} filter instead.
93
+ *
94
+ * @param Yoast_ACF_Analysis_String_Store $blacklist_type Store instance of ignored field types
95
+ */
96
+ $blacklist_type = apply_filters_deprecated(
97
+ 'yoast-acf-analysis/blacklist_type',
98
+ [ $this->blacklist_type ],
99
+ 'YoastSEO ACF 2.4.0',
100
+ 'Yoast\WP\ACF\blacklist_type'
101
+ );
102
+
103
  /**
104
  * Filters the fields to ignore based on field type.
105
  *
106
  * You can add or remove field types to be analysed.
107
  * Be aware that when adding types this will only have an effect if there is a scraper for the type.
108
  *
109
+ * @since 2.4.0
110
  *
111
  * @param Yoast_ACF_Analysis_String_Store $blacklist_type Store instance of ignored field types
112
  */
113
  $blacklist_type = apply_filters(
114
+ 'Yoast\WP\ACF\blacklist_type',
115
+ $blacklist_type
116
  );
117
 
118
  if ( $blacklist_type instanceof Yoast_ACF_Analysis_String_Store ) {
132
  /**
133
  * Filters the fields to ignore based on field name.
134
  *
135
+ * @since 1.0.0
136
+ * @deprecated 2.0.0 Use the {@see 'Yoast\WP\ACF\blacklist_name'} filter instead.
 
 
137
  *
138
  * @param array $legacy_names Array with field names
139
  */
140
+ $legacy_names = apply_filters_deprecated(
141
  'ysacf_exclude_fields',
142
+ [ [] ],
143
+ 'YoastSEO ACF 2.0.0',
144
+ 'Yoast\WP\ACF\blacklist_name'
145
  );
146
 
147
  if ( is_array( $legacy_names ) && ! empty( $legacy_names ) ) {
150
  }
151
  }
152
 
153
+ /**
154
+ * Filters the fields to ignore based on field name.
155
+ *
156
+ * @since 2.0.0
157
+ * @deprecated 2.4.0 Use the {@see 'Yoast\WP\ACF\blacklist_name'} filter instead.
158
+ *
159
+ * @param Yoast_ACF_Analysis_String_Store $blacklist_name Store instance of ignored field names
160
+ */
161
+ $blacklist_name = apply_filters_deprecated(
162
+ 'yoast-acf-analysis/blacklist_name',
163
+ [ $this->blacklist_name ],
164
+ 'YoastSEO ACF 2.4.0',
165
+ 'Yoast\WP\ACF\blacklist_name'
166
+ );
167
+
168
  /**
169
  * Filters the fields to ignore based on field name.
170
  *
171
  * You can add or remove fields to be analysed based on the field name.
172
  *
173
+ * @since 2.4.0
174
  *
175
  * @param Yoast_ACF_Analysis_String_Store $blacklist_name Store instance of ignored field names
176
  */
177
  $blacklist_name = apply_filters(
178
+ 'Yoast\WP\ACF\blacklist_name',
179
+ $blacklist_name
180
  );
181
 
182
  if ( $blacklist_name instanceof Yoast_ACF_Analysis_String_Store ) {
201
  * @return array The scraper configuration.
202
  */
203
  public function get_scraper_config() {
204
+ /**
205
+ * Filters the scraper configuration.
206
+ *
207
+ * @since 2.0.0
208
+ * @deprecated 2.4.0 Use the {@see 'Yoast\WP\ACF\scraper_config'} filter instead.
209
+ *
210
+ * @param array $scraper_config Nested array of scraper configuration
211
+ */
212
+ $scraper_config = apply_filters_deprecated(
213
+ 'yoast-acf-analysis/scraper_config',
214
+ [ $this->scraper_config ],
215
+ 'YoastSEO ACF 2.4.0',
216
+ 'Yoast\WP\ACF\scraper_config'
217
+ );
218
+
219
  /**
220
  * Filters the scraper configuration.
221
  *
222
  * This nested array holds configuration specific to certain scrapers (for specific field types)
223
+ * Before using this filter see if there isn't a more specific one like {@see 'Yoast\WP\ACF\headlines'}.
224
  *
225
+ * @since 2.4.0
226
  *
227
  * @param array $scraper_config Nested array of scraper configuration
228
  */
229
  $scraper_config = apply_filters(
230
+ 'Yoast\WP\ACF\scraper_config',
231
+ $scraper_config
232
  );
233
 
234
  if ( is_array( $scraper_config ) ) {
235
  return $scraper_config;
236
  }
237
 
238
+ return [];
239
  }
240
 
241
  /**
244
  * @return int The number of milliseconds between scrape runs.
245
  */
246
  public function get_refresh_rate() {
247
+ /**
248
+ * Refresh rate for changes to ACF fields
249
+ *
250
+ * @since 2.0.0
251
+ * @deprecated 2.4.0 Use the {@see 'Yoast\WP\ACF\refresh_rate'} filter instead.
252
+ *
253
+ * @param int $refresh_rate Refresh rates in milliseconds
254
+ */
255
+ $refresh_rate = apply_filters_deprecated(
256
+ 'yoast-acf-analysis/refresh_rate',
257
+ [ $this->refresh_rate ],
258
+ 'YoastSEO ACF 2.4.0',
259
+ 'Yoast\WP\ACF\refresh_rate'
260
+ );
261
+
262
  /**
263
  * Refresh rate for changes to ACF fields
264
  *
266
  * By default it will only report changes to Yoast SEO after no changes have happened for 1000 milliseconds.
267
  * This filter allows to change this to any value above 200 milliseconds.
268
  *
269
+ * @since 2.4.0
270
  *
271
  * @param int $refresh_rate Refresh rates in milliseconds
272
  */
273
+ $refresh_rate = apply_filters( 'Yoast\WP\ACF\refresh_rate', $refresh_rate );
274
  $refresh_rate = intval( $refresh_rate, 10 );
275
 
276
  // Make sure the refresh rate is not too low, this will introduce problems in the browser of the user.
283
  * @return Yoast_ACF_Analysis_String_Store Field selectors store.
284
  */
285
  public function get_field_selectors() {
286
+ /**
287
+ * Filters the CSS selectors that are used to find the fields when using ACF4.
288
+ *
289
+ * @since 2.0.0
290
+ * @deprecated 2.4.0 Use the {@see 'Yoast\WP\ACF\field_selectors'} filter instead.
291
+ *
292
+ * @param Yoast_ACF_Analysis_String_Store $field_selectors Field selector store instance
293
+ */
294
+ $field_selectors = apply_filters_deprecated(
295
+ 'yoast-acf-analysis/field_selectors',
296
+ [ $this->field_selectors ],
297
+ 'YoastSEO ACF 2.4.0',
298
+ 'Yoast\WP\ACF\field_selectors'
299
+ );
300
+
301
  /**
302
  * Filters the CSS selectors that are used to find the fields when using ACF4.
303
  *
304
  * This is an advanced filter that should rarely if ever be used, especially because it only affects ACF4.
305
  * If you want to exclude certain fields by type or name there are the more specific filters
306
+ * {@see 'Yoast\WP\ACF\blacklist_type'} and {@see 'Yoast\WP\ACF\blacklist_name'} for these.
307
  *
308
  * @see get_blacklist_type()
309
  * @see get_blacklist_name()
310
  *
311
+ * @since 2.4.0
312
  *
313
  * @param Yoast_ACF_Analysis_String_Store $field_selectors Field selector store instance
314
  */
315
  $field_selectors = apply_filters(
316
+ 'Yoast\WP\ACF\field_selectors',
317
+ $field_selectors
318
  );
319
 
320
  if ( $field_selectors instanceof Yoast_ACF_Analysis_String_Store ) {
330
  * @return array The field order configuration.
331
  */
332
  public function get_field_order() {
333
+ /**
334
+ * Filters the order of the ACF fields relative to the post_content.
335
+ *
336
+ * @since 2.2.0
337
+ * @deprecated 2.4.0 Use the {@see 'Yoast\WP\ACF\field_order'} filter instead.
338
+ *
339
+ * @param array $order_config {
340
+ * @type string $field_name Name of the ACF field
341
+ * @type int $order Integer
342
+ * }
343
+ */
344
+ $field_order = apply_filters_deprecated(
345
+ 'yoast-acf-analysis/field_order',
346
+ [ [] ],
347
+ 'YoastSEO ACF 2.4.0',
348
+ 'Yoast\WP\ACF\field_order'
349
+ );
350
+
351
  /**
352
  * Filters the order of the ACF fields relative to the post_content.
353
  *
360
  * 'field_591eb45f2be86' => -1
361
  * );
362
  *
363
+ * @since 2.4.0
364
  *
365
  * @param array $order_config {
366
  * @type string $field_name Name of the ACF field
367
  * @type int $order Integer
368
  * }
369
  */
370
+ return apply_filters( 'Yoast\WP\ACF\field_order', $field_order );
371
  }
372
 
373
  /**
376
  * @return array
377
  */
378
  public function to_array() {
379
+ return [
380
  'pluginName' => Yoast_ACF_Analysis_Facade::get_plugin_name(),
381
  'acfVersion' => $this->get_acf_version(),
382
  'scraper' => $this->get_scraper_config(),
386
  'fieldSelectors' => $this->get_field_selectors()->to_array(),
387
  'fieldOrder' => $this->get_field_order(),
388
  'debug' => $this->is_debug(),
389
+ ];
390
  }
391
  }
inc/configuration/string-store.php CHANGED
@@ -17,7 +17,7 @@ class Yoast_ACF_Analysis_String_Store {
17
  *
18
  * @var array
19
  */
20
- protected $items = array();
21
 
22
  /**
23
  * Adds an item to the store.
@@ -55,7 +55,7 @@ class Yoast_ACF_Analysis_String_Store {
55
  return false;
56
  }
57
 
58
- $items = array_diff( $this->items, array( $item ) );
59
  $this->items = array_values( $items );
60
  sort( $this->items );
61
 
17
  *
18
  * @var array
19
  */
20
+ protected $items = [];
21
 
22
  /**
23
  * Adds an item to the store.
55
  return false;
56
  }
57
 
58
+ $items = array_diff( $this->items, [ $item ] );
59
  $this->items = array_values( $items );
60
  sort( $this->items );
61
 
inc/dependencies/dependency-acf.php CHANGED
@@ -27,7 +27,7 @@ final class Yoast_ACF_Analysis_Dependency_ACF implements Yoast_ACF_Analysis_Depe
27
  * Registers the notification to show when the conditions are not met.
28
  */
29
  public function register_notifications() {
30
- add_action( 'admin_notices', array( $this, 'message_plugin_not_activated' ) );
31
  }
32
 
33
  /**
27
  * Registers the notification to show when the conditions are not met.
28
  */
29
  public function register_notifications() {
30
+ add_action( 'admin_notices', [ $this, 'message_plugin_not_activated' ] );
31
  }
32
 
33
  /**
inc/dependencies/dependency-interface.php CHANGED
@@ -18,7 +18,7 @@ interface Yoast_ACF_Analysis_Dependency {
18
  public function is_met();
19
 
20
  /**
21
- * Registers the notifications to communicate the depedency is not met.
22
  *
23
  * @return void
24
  */
18
  public function is_met();
19
 
20
  /**
21
+ * Registers the notifications to communicate the dependency is not met.
22
  *
23
  * @return void
24
  */
inc/dependencies/dependency-yoast-seo.php CHANGED
@@ -34,12 +34,12 @@ final class Yoast_ACF_Analysis_Dependency_Yoast_SEO implements Yoast_ACF_Analysi
34
  */
35
  public function register_notifications() {
36
  if ( ! defined( 'WPSEO_VERSION' ) ) {
37
- add_action( 'admin_notices', array( $this, 'message_plugin_not_activated' ) );
38
  return;
39
  }
40
 
41
  if ( ! $this->has_required_version() ) {
42
- add_action( 'admin_notices', array( $this, 'message_minimum_version' ) );
43
  }
44
  }
45
 
@@ -91,6 +91,6 @@ final class Yoast_ACF_Analysis_Dependency_Yoast_SEO implements Yoast_ACF_Analysi
91
  * @return bool
92
  */
93
  private function has_required_version() {
94
- return -1 !== version_compare( $this->get_major_version( WPSEO_VERSION ), self::MINIMAL_REQUIRED_VERSION );
95
  }
96
  }
34
  */
35
  public function register_notifications() {
36
  if ( ! defined( 'WPSEO_VERSION' ) ) {
37
+ add_action( 'admin_notices', [ $this, 'message_plugin_not_activated' ] );
38
  return;
39
  }
40
 
41
  if ( ! $this->has_required_version() ) {
42
+ add_action( 'admin_notices', [ $this, 'message_minimum_version' ] );
43
  }
44
  }
45
 
91
  * @return bool
92
  */
93
  private function has_required_version() {
94
+ return version_compare( $this->get_major_version( WPSEO_VERSION ), self::MINIMAL_REQUIRED_VERSION, '>=' );
95
  }
96
  }
inc/facade.php CHANGED
@@ -27,7 +27,7 @@ class Yoast_ACF_Analysis_Facade {
27
  public static function get_registry() {
28
  static $registry = null;
29
 
30
- if ( null === $registry ) {
31
  $registry = new Yoast_ACF_Analysis_Registry();
32
  }
33
 
@@ -37,6 +37,9 @@ class Yoast_ACF_Analysis_Facade {
37
  /**
38
  * Wraps the notification with an unique identifier.
39
  *
 
 
 
40
  * @param string $filter_name Filter to wrap.
41
  *
42
  * @return string Full filter name to use.
27
  public static function get_registry() {
28
  static $registry = null;
29
 
30
+ if ( $registry === null ) {
31
  $registry = new Yoast_ACF_Analysis_Registry();
32
  }
33
 
37
  /**
38
  * Wraps the notification with an unique identifier.
39
  *
40
+ * @deprecated 2.4.0 Use hard-coded filter names instead.
41
+ * @codeCoverageIgnore
42
+ *
43
  * @param string $filter_name Filter to wrap.
44
  *
45
  * @return string Full filter name to use.
inc/registry.php CHANGED
@@ -15,7 +15,7 @@ class Yoast_ACF_Analysis_Registry {
15
  *
16
  * @var array
17
  */
18
- private $storage = array();
19
 
20
  /**
21
  * Adds an item to the registry.
15
  *
16
  * @var array
17
  */
18
+ private $storage = [];
19
 
20
  /**
21
  * Adds an item to the registry.
inc/requirements.php CHANGED
@@ -15,7 +15,7 @@ class Yoast_ACF_Analysis_Requirements {
15
  *
16
  * @var Yoast_ACF_Analysis_Dependency[]
17
  */
18
- protected $dependencies = array();
19
 
20
  /**
21
  * Adds a dependency.
@@ -27,7 +27,7 @@ class Yoast_ACF_Analysis_Requirements {
27
  }
28
 
29
  /**
30
- * Checks if all depedencies are met.
31
  *
32
  * @return bool True if all requirements are met.
33
  */
15
  *
16
  * @var Yoast_ACF_Analysis_Dependency[]
17
  */
18
+ protected $dependencies = [];
19
 
20
  /**
21
  * Adds a dependency.
27
  }
28
 
29
  /**
30
+ * Checks if all dependencies are met.
31
  *
32
  * @return bool True if all requirements are met.
33
  */
js/src/collect/collect-v5.js CHANGED
@@ -1,4 +1,4 @@
1
- /* global _, acf, jQuery */
2
 
3
  module.exports = function() {
4
  var outerFieldsName = [
@@ -10,21 +10,43 @@ module.exports = function() {
10
  var innerFields = [];
11
  var outerFields = [];
12
 
13
- var fields = _.map( acf.get_fields(), function( field ) {
14
- var field_data = jQuery.extend( true, {}, acf.get_data( jQuery( field ) ) );
15
- field_data.$el = jQuery( field );
16
- field_data.post_meta_key = field_data.name;
 
 
 
17
 
18
  // Collect nested and parent
19
- if ( outerFieldsName.indexOf( field_data.type ) === -1 ) {
20
- innerFields.push( field_data );
21
  } else {
22
- outerFields.push( field_data );
23
  }
24
 
25
- return field_data;
26
  } );
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  if ( outerFields.length === 0 ) {
29
  return fields;
30
  }
1
+ /* global _, acf, jQuery, wp */
2
 
3
  module.exports = function() {
4
  var outerFieldsName = [
10
  var innerFields = [];
11
  var outerFields = [];
12
 
13
+ // Return only fields in metabox areas (either below or side) or
14
+ // ACF block fields in the content (not in the sidebar, to prevent duplicates)
15
+ var parentContainer = jQuery( ".metabox-location-normal, .metabox-location-side, .acf-block-component.acf-block-body" );
16
+ var fields = _.map( acf.get_fields( false, parentContainer ), function( field ) {
17
+ var fieldData = jQuery.extend( true, {}, acf.get_data( jQuery( field ) ) );
18
+ fieldData.$el = jQuery( field );
19
+ fieldData.post_meta_key = fieldData.name;
20
 
21
  // Collect nested and parent
22
+ if ( outerFieldsName.indexOf( fieldData.type ) === -1 ) {
23
+ innerFields.push( fieldData );
24
  } else {
25
+ outerFields.push( fieldData );
26
  }
27
 
28
+ return fieldData;
29
  } );
30
 
31
+ // Add ACF block previews, they are not returned by acf.get_fields()
32
+ var blocks = wp.data.select( "core/block-editor" ).getBlocks();
33
+ var blockFields = _.map(
34
+ _.filter( blocks, function( block ) {
35
+ return block.name.startsWith( "acf/" ) && block.attributes.mode === "preview";
36
+ } ),
37
+ function( block ) {
38
+ var fieldData = {
39
+ $el: jQuery( `[data-block="${block.clientId}"] .acf-block-preview` ),
40
+ key: block.attributes.id,
41
+ type: "block_preview",
42
+ name: block.name,
43
+ post_meta_key: block.name,
44
+ };
45
+ innerFields.push( fieldData );
46
+ return fieldData;
47
+ } );
48
+ fields = _.union( fields, blockFields );
49
+
50
  if ( outerFields.length === 0 ) {
51
  return fields;
52
  }
js/src/replacevars.js CHANGED
@@ -4,7 +4,7 @@ var config = require( "./config/config.js" );
4
 
5
  var ReplaceVar = YoastReplaceVarPlugin.ReplaceVar;
6
 
7
- var supportedTypes = [ "email", "text", "textarea", "url", "wysiwyg" ];
8
 
9
  var replaceVars = {};
10
 
4
 
5
  var ReplaceVar = YoastReplaceVarPlugin.ReplaceVar;
6
 
7
+ var supportedTypes = [ "email", "text", "textarea", "url", "wysiwyg", "block_preview" ];
8
 
9
  var replaceVars = {};
10
 
js/src/scraper-store.js CHANGED
@@ -13,6 +13,8 @@ var scraperObjects = {
13
  // TODO: Add oembed handler
14
  image: require( "./scraper/scraper.image.js" ),
15
  gallery: require( "./scraper/scraper.gallery.js" ),
 
 
16
 
17
  // Choice
18
  // TODO: select, checkbox, radio
13
  // TODO: Add oembed handler
14
  image: require( "./scraper/scraper.image.js" ),
15
  gallery: require( "./scraper/scraper.gallery.js" ),
16
+ // ACF blocks preview
17
+ block_preview: require( "./scraper/scraper.block_preview.js" ),
18
 
19
  // Choice
20
  // TODO: select, checkbox, radio
js/src/scraper/scraper.block_preview.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global _ */
2
+
3
+ var Scraper = function() {};
4
+
5
+ Scraper.prototype.scrape = function( fields ) {
6
+ fields = _.map( fields, function( field ) {
7
+ if ( field.type !== "block_preview" ) {
8
+ return field;
9
+ }
10
+
11
+ field.content = field.$el.html();
12
+
13
+ return field;
14
+ } );
15
+
16
+ return fields;
17
+ };
18
+
19
+ module.exports = Scraper;
js/yoast-acf-analysis.js CHANGED
@@ -214,7 +214,7 @@ fields.each( function() {
214
  module.exports = field_data;
215
 
216
  },{"./../config/config.js":7}],5:[function(require,module,exports){
217
- /* global _, acf, jQuery */
218
 
219
  module.exports = function() {
220
  var outerFieldsName = [
@@ -226,21 +226,43 @@ module.exports = function() {
226
  var innerFields = [];
227
  var outerFields = [];
228
 
229
- var fields = _.map( acf.get_fields(), function( field ) {
230
- var field_data = jQuery.extend( true, {}, acf.get_data( jQuery( field ) ) );
231
- field_data.$el = jQuery( field );
232
- field_data.post_meta_key = field_data.name;
 
 
 
233
 
234
  // Collect nested and parent
235
- if ( outerFieldsName.indexOf( field_data.type ) === -1 ) {
236
- innerFields.push( field_data );
237
  } else {
238
- outerFields.push( field_data );
239
  }
240
 
241
- return field_data;
242
  } );
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  if ( outerFields.length === 0 ) {
245
  return fields;
246
  }
@@ -399,7 +421,7 @@ var config = require( "./config/config.js" );
399
 
400
  var ReplaceVar = YoastReplaceVarPlugin.ReplaceVar;
401
 
402
- var supportedTypes = [ "email", "text", "textarea", "url", "wysiwyg" ];
403
 
404
  var replaceVars = {};
405
 
@@ -465,6 +487,8 @@ var scraperObjects = {
465
  // TODO: Add oembed handler
466
  image: require( "./scraper/scraper.image.js" ),
467
  gallery: require( "./scraper/scraper.gallery.js" ),
 
 
468
 
469
  // Choice
470
  // TODO: select, checkbox, radio
@@ -545,7 +569,28 @@ module.exports = {
545
  getScraper: getScraper,
546
  };
547
 
548
- },{"./config/config.js":7,"./scraper/scraper.email.js":12,"./scraper/scraper.gallery.js":13,"./scraper/scraper.image.js":14,"./scraper/scraper.link.js":15,"./scraper/scraper.taxonomy.js":16,"./scraper/scraper.text.js":17,"./scraper/scraper.textarea.js":18,"./scraper/scraper.url.js":19,"./scraper/scraper.wysiwyg.js":20}],12:[function(require,module,exports){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  /* global _ */
550
 
551
  var Scraper = function() {};
@@ -566,7 +611,7 @@ Scraper.prototype.scrape = function( fields ) {
566
 
567
  module.exports = Scraper;
568
 
569
- },{}],13:[function(require,module,exports){
570
  /* global _, jQuery */
571
 
572
  var attachmentCache = require( "./../cache/cache.attachments.js" );
@@ -608,7 +653,7 @@ Scraper.prototype.scrape = function( fields ) {
608
 
609
  module.exports = Scraper;
610
 
611
- },{"./../cache/cache.attachments.js":2}],14:[function(require,module,exports){
612
  /* global _ */
613
 
614
  var attachmentCache = require( "./../cache/cache.attachments.js" );
@@ -646,7 +691,7 @@ Scraper.prototype.scrape = function( fields ) {
646
 
647
  module.exports = Scraper;
648
 
649
- },{"./../cache/cache.attachments.js":2}],15:[function(require,module,exports){
650
  /* global _ */
651
  require( "./../scraper-store.js" );
652
 
@@ -681,7 +726,7 @@ Scraper.prototype.scrape = function( fields ) {
681
 
682
  module.exports = Scraper;
683
 
684
- },{"./../scraper-store.js":11}],16:[function(require,module,exports){
685
  /* global _, acf */
686
 
687
  var Scraper = function() {};
@@ -737,7 +782,7 @@ Scraper.prototype.scrape = function( fields ) {
737
 
738
  module.exports = Scraper;
739
 
740
- },{}],17:[function(require,module,exports){
741
  /* global _ */
742
 
743
  var config = require( "./../config/config.js" );
@@ -792,7 +837,7 @@ Scraper.prototype.isHeadline = function( field ) {
792
 
793
  module.exports = Scraper;
794
 
795
- },{"./../config/config.js":7}],18:[function(require,module,exports){
796
  /* global _ */
797
 
798
  var Scraper = function() {};
@@ -813,7 +858,7 @@ Scraper.prototype.scrape = function( fields ) {
813
 
814
  module.exports = Scraper;
815
 
816
- },{}],19:[function(require,module,exports){
817
  /* global _ */
818
 
819
  var Scraper = function() {};
@@ -836,7 +881,7 @@ Scraper.prototype.scrape = function( fields ) {
836
 
837
  module.exports = Scraper;
838
 
839
- },{}],20:[function(require,module,exports){
840
  /* global tinyMCE, _ */
841
 
842
  var Scraper = function() {};
214
  module.exports = field_data;
215
 
216
  },{"./../config/config.js":7}],5:[function(require,module,exports){
217
+ /* global _, acf, jQuery, wp */
218
 
219
  module.exports = function() {
220
  var outerFieldsName = [
226
  var innerFields = [];
227
  var outerFields = [];
228
 
229
+ // Return only fields in metabox areas (either below or side) or
230
+ // ACF block fields in the content (not in the sidebar, to prevent duplicates)
231
+ var parentContainer = jQuery( ".metabox-location-normal, .metabox-location-side, .acf-block-component.acf-block-body" );
232
+ var fields = _.map( acf.get_fields( false, parentContainer ), function( field ) {
233
+ var fieldData = jQuery.extend( true, {}, acf.get_data( jQuery( field ) ) );
234
+ fieldData.$el = jQuery( field );
235
+ fieldData.post_meta_key = fieldData.name;
236
 
237
  // Collect nested and parent
238
+ if ( outerFieldsName.indexOf( fieldData.type ) === -1 ) {
239
+ innerFields.push( fieldData );
240
  } else {
241
+ outerFields.push( fieldData );
242
  }
243
 
244
+ return fieldData;
245
  } );
246
 
247
+ // Add ACF block previews, they are not returned by acf.get_fields()
248
+ var blocks = wp.data.select( "core/block-editor" ).getBlocks();
249
+ var blockFields = _.map(
250
+ _.filter( blocks, function( block ) {
251
+ return block.name.startsWith( "acf/" ) && block.attributes.mode === "preview";
252
+ } ),
253
+ function( block ) {
254
+ var fieldData = {
255
+ $el: jQuery( `[data-block="${block.clientId}"] .acf-block-preview` ),
256
+ key: block.attributes.id,
257
+ type: "block_preview",
258
+ name: block.name,
259
+ post_meta_key: block.name,
260
+ };
261
+ innerFields.push( fieldData );
262
+ return fieldData;
263
+ } );
264
+ fields = _.union( fields, blockFields );
265
+
266
  if ( outerFields.length === 0 ) {
267
  return fields;
268
  }
421
 
422
  var ReplaceVar = YoastReplaceVarPlugin.ReplaceVar;
423
 
424
+ var supportedTypes = [ "email", "text", "textarea", "url", "wysiwyg", "block_preview" ];
425
 
426
  var replaceVars = {};
427
 
487
  // TODO: Add oembed handler
488
  image: require( "./scraper/scraper.image.js" ),
489
  gallery: require( "./scraper/scraper.gallery.js" ),
490
+ // ACF blocks preview
491
+ block_preview: require( "./scraper/scraper.block_preview.js" ),
492
 
493
  // Choice
494
  // TODO: select, checkbox, radio
569
  getScraper: getScraper,
570
  };
571
 
572
+ },{"./config/config.js":7,"./scraper/scraper.block_preview.js":12,"./scraper/scraper.email.js":13,"./scraper/scraper.gallery.js":14,"./scraper/scraper.image.js":15,"./scraper/scraper.link.js":16,"./scraper/scraper.taxonomy.js":17,"./scraper/scraper.text.js":18,"./scraper/scraper.textarea.js":19,"./scraper/scraper.url.js":20,"./scraper/scraper.wysiwyg.js":21}],12:[function(require,module,exports){
573
+ /* global _ */
574
+
575
+ var Scraper = function() {};
576
+
577
+ Scraper.prototype.scrape = function( fields ) {
578
+ fields = _.map( fields, function( field ) {
579
+ if ( field.type !== "block_preview" ) {
580
+ return field;
581
+ }
582
+
583
+ field.content = field.$el.html();
584
+
585
+ return field;
586
+ } );
587
+
588
+ return fields;
589
+ };
590
+
591
+ module.exports = Scraper;
592
+
593
+ },{}],13:[function(require,module,exports){
594
  /* global _ */
595
 
596
  var Scraper = function() {};
611
 
612
  module.exports = Scraper;
613
 
614
+ },{}],14:[function(require,module,exports){
615
  /* global _, jQuery */
616
 
617
  var attachmentCache = require( "./../cache/cache.attachments.js" );
653
 
654
  module.exports = Scraper;
655
 
656
+ },{"./../cache/cache.attachments.js":2}],15:[function(require,module,exports){
657
  /* global _ */
658
 
659
  var attachmentCache = require( "./../cache/cache.attachments.js" );
691
 
692
  module.exports = Scraper;
693
 
694
+ },{"./../cache/cache.attachments.js":2}],16:[function(require,module,exports){
695
  /* global _ */
696
  require( "./../scraper-store.js" );
697
 
726
 
727
  module.exports = Scraper;
728
 
729
+ },{"./../scraper-store.js":11}],17:[function(require,module,exports){
730
  /* global _, acf */
731
 
732
  var Scraper = function() {};
782
 
783
  module.exports = Scraper;
784
 
785
+ },{}],18:[function(require,module,exports){
786
  /* global _ */
787
 
788
  var config = require( "./../config/config.js" );
837
 
838
  module.exports = Scraper;
839
 
840
+ },{"./../config/config.js":7}],19:[function(require,module,exports){
841
  /* global _ */
842
 
843
  var Scraper = function() {};
858
 
859
  module.exports = Scraper;
860
 
861
+ },{}],20:[function(require,module,exports){
862
  /* global _ */
863
 
864
  var Scraper = function() {};
881
 
882
  module.exports = Scraper;
883
 
884
+ },{}],21:[function(require,module,exports){
885
  /* global tinyMCE, _ */
886
 
887
  var Scraper = function() {};
phpunit.xml.dist DELETED
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
- xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
4
- backupGlobals="false"
5
- beStrictAboutCoversAnnotation="true"
6
- beStrictAboutOutputDuringTests="true"
7
- beStrictAboutTestsThatDoNotTestAnything="true"
8
- beStrictAboutTodoAnnotatedTests="true"
9
- verbose="true">
10
- <testsuites>
11
- <testsuite name="unit">
12
- <directory suffix="test.php">tests/php/unit</directory>
13
- </testsuite>
14
- </testsuites>
15
-
16
- <filter>
17
- <whitelist>
18
- <directory suffix=".php">inc/</directory>
19
- </whitelist>
20
- </filter>
21
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === ACF Content Analysis for Yoast SEO ===
2
  Contributors: yoast, angrycreative, kraftner, marcusforsberg, viktorfroberg, joostdevalk, atimmer, jipmoors, theorboman
3
  Tags: Yoast, SEO, ACF, Advanced Custom Fields, analysis, Search Engine Optimization
4
- Requires at least: 4.9
5
- Tested up to: 5.2
6
  License: GPLv3
7
  License URI: http://www.gnu.org/licenses/gpl.html
8
- Stable tag: 2.3.0
9
- Requires PHP: 5.2.4
10
 
11
  WordPress plugin that adds the content of all ACF fields to the Yoast SEO score analysis.
12
 
@@ -27,13 +27,13 @@ Previously called Yoast ACF Analysis.
27
  == Filters ==
28
 
29
  = Remove specific field from scoring =
30
- `add_filter( 'yoast-acf-analysis/blacklist_name', function ( $blacklist_name ) {
31
  $blacklist_name->add( 'my-field-name' );
32
  return $blacklist_name;
33
  });`
34
 
35
  = Remove field type from scoring =
36
- `add_filter( 'yoast-acf-analysis/blacklist_type', function ( $blacklist_type ) {
37
  // text, image etc
38
  $blacklist_type->add( 'text' );
39
  $blacklist_type->add( 'image' );
@@ -41,20 +41,41 @@ Previously called Yoast ACF Analysis.
41
  });`
42
 
43
  = Define custom field a specific heading value =
44
- `add_filter( 'yoast-acf-analysis/headlines', function ( $headlines ) {
45
  // value from 1-6, 1=h1, 6=h6
46
  $headlines['field_591eb45f2be86'] = 3;
47
  return $headlines;
48
  });`
49
 
50
  = Change refresh rate =
51
- `add_filter( 'yoast-acf-analysis/refresh_rate', function () {
52
  // Refresh rates in milliseconds
53
  return 1000;
54
  });`
55
 
56
  == Changelog ==
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  = 2.3.0 =
59
 
60
  Released May 15th, 2019
1
  === ACF Content Analysis for Yoast SEO ===
2
  Contributors: yoast, angrycreative, kraftner, marcusforsberg, viktorfroberg, joostdevalk, atimmer, jipmoors, theorboman
3
  Tags: Yoast, SEO, ACF, Advanced Custom Fields, analysis, Search Engine Optimization
4
+ Requires at least: 5.2
5
+ Tested up to: 5.4.1
6
  License: GPLv3
7
  License URI: http://www.gnu.org/licenses/gpl.html
8
+ Stable tag: 2.4.0
9
+ Requires PHP: 5.6.20
10
 
11
  WordPress plugin that adds the content of all ACF fields to the Yoast SEO score analysis.
12
 
27
  == Filters ==
28
 
29
  = Remove specific field from scoring =
30
+ `add_filter( 'Yoast\WP\ACF\blacklist_name', function ( $blacklist_name ) {
31
  $blacklist_name->add( 'my-field-name' );
32
  return $blacklist_name;
33
  });`
34
 
35
  = Remove field type from scoring =
36
+ `add_filter( 'Yoast\WP\ACF\blacklist_type', function ( $blacklist_type ) {
37
  // text, image etc
38
  $blacklist_type->add( 'text' );
39
  $blacklist_type->add( 'image' );
41
  });`
42
 
43
  = Define custom field a specific heading value =
44
+ `add_filter( 'Yoast\WP\ACF\headlines', function ( $headlines ) {
45
  // value from 1-6, 1=h1, 6=h6
46
  $headlines['field_591eb45f2be86'] = 3;
47
  return $headlines;
48
  });`
49
 
50
  = Change refresh rate =
51
+ `add_filter( 'Yoast\WP\ACF\refresh_rate', function () {
52
  // Refresh rates in milliseconds
53
  return 1000;
54
  });`
55
 
56
  == Changelog ==
57
 
58
+ = 2.4.0 =
59
+
60
+ Released June 4th, 2020
61
+
62
+ Enhancements:
63
+
64
+ * Add support for ACF blocks. Props to [TimVevida](https://github.com/TimVevida).
65
+
66
+ Other:
67
+
68
+ * Fixes a couple of typos in the code documentation. Props to [akkspros](https://github.com/akkspros).
69
+ * Deprecates `Yoast_ACF_Analysis_Facade::get_filter_name()`. Use hard-coded hook names instead.
70
+ * Deprecates the yoast-acf-analysis/config` filter hook in favor of the `Yoast\WP\ACF\config` hook.
71
+ * Deprecates the `yoast-acf-analysis/headlines` filter hook in favor of the `Yoast\WP\ACF\headlines` hook.
72
+ * Deprecates the `yoast-acf-analysis/blacklist_type` filter hook in favor of the `Yoast\WP\ACF\blacklist_type` hook.
73
+ * Deprecates the `yoast-acf-analysis/blacklist_name` filter hook in favor of the `Yoast\WP\ACF\blacklist_name` hook.
74
+ * Deprecates the `yoast-acf-analysis/scraper_config` filter hook in favor of the `Yoast\WP\ACF\scraper_config` hook.
75
+ * Deprecates the `yoast-acf-analysis/refresh_rate` filter hook in favor of the `Yoast\WP\ACF\refresh_rate` hook.
76
+ * Deprecates the `yoast-acf-analysis/field_selectors` filter hook in favor of the `Yoast\WP\ACF\field_selectors` hook.
77
+ * Deprecates the `yoast-acf-analysis/field_order` filter hook in favor of the `Yoast\WP\ACF\field_order` hook.
78
+
79
  = 2.3.0 =
80
 
81
  Released May 15th, 2019
tests/js/system/data/test-data-loader-functions.php CHANGED
@@ -15,7 +15,7 @@ if ( function_exists( 'add_action' ) ) {
15
  */
16
  function yoast_acf_analysis_test_data_loader() {
17
 
18
- if ( ! defined( 'AC_YOAST_ACF_ANALYSIS_ENVIRONMENT' ) || 'development' !== AC_YOAST_ACF_ANALYSIS_ENVIRONMENT ) {
19
  return;
20
  }
21
 
15
  */
16
  function yoast_acf_analysis_test_data_loader() {
17
 
18
+ if ( ! defined( 'AC_YOAST_ACF_ANALYSIS_ENVIRONMENT' ) || AC_YOAST_ACF_ANALYSIS_ENVIRONMENT !== 'development' ) {
19
  return;
20
  }
21
 
tests/php/unit/Configuration/configuration-test.php CHANGED
@@ -1,15 +1,21 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Configuration;
4
 
5
  use Brain\Monkey;
6
  use Brain\Monkey\Filters;
7
  use Brain\Monkey\Functions;
 
 
 
 
8
 
9
  /**
10
- * Class Configuration_Test
 
 
11
  */
12
- class Configuration_Test extends \PHPUnit_Framework_TestCase {
13
 
14
  /**
15
  * Sets up test fixtures.
@@ -38,15 +44,15 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
38
  */
39
  public function testEmpty() {
40
 
41
- $configuration = new \Yoast_ACF_Analysis_Configuration(
42
- new \Yoast_ACF_Analysis_String_Store(),
43
- new \Yoast_ACF_Analysis_String_Store(),
44
- new \Yoast_ACF_Analysis_String_Store()
45
  );
46
 
47
  $this->assertSame(
48
  [
49
- 'pluginName' => \Yoast_ACF_Analysis_Facade::get_plugin_name(),
50
  'acfVersion' => 'version',
51
  'scraper' => [],
52
  'refreshRate' => 1000,
@@ -59,7 +65,7 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
59
  $configuration->to_array()
60
  );
61
 
62
- $this->assertEquals( Filters\applied( 'acf/get_info' ), 1 );
63
  }
64
 
65
  /**
@@ -71,14 +77,14 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
71
  $acf_version = '5.0.0';
72
  Functions\when( 'acf_get_setting' )->justReturn( $acf_version );
73
 
74
- $configuration = new \Yoast_ACF_Analysis_Configuration(
75
- new \Yoast_ACF_Analysis_String_Store(),
76
- new \Yoast_ACF_Analysis_String_Store(),
77
- new \Yoast_ACF_Analysis_String_Store()
78
  );
79
  $config = $configuration->to_array();
80
 
81
- $this->assertEquals( $acf_version, $config['acfVersion'] );
82
  }
83
 
84
  /**
@@ -88,17 +94,17 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
88
  */
89
  public function testBlacklistTypeFilter() {
90
 
91
- $blacklist_type = new \Yoast_ACF_Analysis_String_Store();
92
 
93
- $configuration = new \Yoast_ACF_Analysis_Configuration(
94
  $blacklist_type,
95
- new \Yoast_ACF_Analysis_String_Store(),
96
- new \Yoast_ACF_Analysis_String_Store()
97
  );
98
 
99
- $blacklist_type2 = new \Yoast_ACF_Analysis_String_Store();
100
 
101
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'blacklist_type' ) )
102
  ->once()
103
  ->with( $blacklist_type )
104
  ->andReturn( $blacklist_type2 );
@@ -113,15 +119,15 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
113
  */
114
  public function testBlacklistTypeFilterInvalid() {
115
 
116
- $store = new \Yoast_ACF_Analysis_String_Store();
117
 
118
- $configuration = new \Yoast_ACF_Analysis_Configuration(
119
  $store,
120
- new \Yoast_ACF_Analysis_String_Store(),
121
- new \Yoast_ACF_Analysis_String_Store()
122
  );
123
 
124
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'blacklist_type' ) )
125
  ->once()
126
  ->with( $store )
127
  ->andReturn( '' );
@@ -136,17 +142,17 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
136
  */
137
  public function testBlacklistNameFilter() {
138
 
139
- $blacklist_name = new \Yoast_ACF_Analysis_String_Store();
140
 
141
- $configuration = new \Yoast_ACF_Analysis_Configuration(
142
- new \Yoast_ACF_Analysis_String_Store(),
143
  $blacklist_name,
144
- new \Yoast_ACF_Analysis_String_Store()
145
  );
146
 
147
- $blacklist_name2 = new \Yoast_ACF_Analysis_String_Store();
148
 
149
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'blacklist_name' ) )
150
  ->once()
151
  ->with( $blacklist_name )
152
  ->andReturn( $blacklist_name2 );
@@ -161,12 +167,12 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
161
  */
162
  public function testLegacyBlackistNameFilter() {
163
 
164
- $blacklist_name = new \Yoast_ACF_Analysis_String_Store();
165
 
166
- $configuration = new \Yoast_ACF_Analysis_Configuration(
167
- new \Yoast_ACF_Analysis_String_Store(),
168
  $blacklist_name,
169
- new \Yoast_ACF_Analysis_String_Store()
170
  );
171
 
172
  Filters\expectApplied( 'ysacf_exclude_fields' )
@@ -200,12 +206,12 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
200
  */
201
  public function testLegacyBlackistNameFilterInvalid() {
202
 
203
- $blacklist_name = new \Yoast_ACF_Analysis_String_Store();
204
 
205
- $configuration = new \Yoast_ACF_Analysis_Configuration(
206
- new \Yoast_ACF_Analysis_String_Store(),
207
  $blacklist_name,
208
- new \Yoast_ACF_Analysis_String_Store()
209
  );
210
 
211
  Filters\expectApplied( 'ysacf_exclude_fields' )
@@ -230,15 +236,15 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
230
  */
231
  public function testBlacklistNameFilterInvalid() {
232
 
233
- $store = new \Yoast_ACF_Analysis_String_Store();
234
 
235
- $configuration = new \Yoast_ACF_Analysis_Configuration(
236
- new \Yoast_ACF_Analysis_String_Store(),
237
  $store,
238
- new \Yoast_ACF_Analysis_String_Store()
239
  );
240
 
241
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'blacklist_name' ) )
242
  ->once()
243
  ->with( $store )
244
  ->andReturn( '' );
@@ -252,18 +258,18 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
252
  * @return void
253
  */
254
  public function testScraperConfigFilter() {
255
- $config = array();
256
- $blacklist = new \Yoast_ACF_Analysis_String_Store();
257
 
258
- $configuration = new \Yoast_ACF_Analysis_Configuration(
259
  $blacklist,
260
- new \Yoast_ACF_Analysis_String_Store(),
261
- new \Yoast_ACF_Analysis_String_Store()
262
  );
263
 
264
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'scraper_config' ) )
265
  ->once()
266
- ->with( array() )
267
  ->andReturn( $config );
268
 
269
  $this->assertSame( $config, $configuration->get_scraper_config() );
@@ -275,20 +281,20 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
275
  * @return void
276
  */
277
  public function testInvalidScraperConfigFilter() {
278
- $blacklist = new \Yoast_ACF_Analysis_String_Store();
279
 
280
- $configuration = new \Yoast_ACF_Analysis_Configuration(
281
  $blacklist,
282
- new \Yoast_ACF_Analysis_String_Store(),
283
- new \Yoast_ACF_Analysis_String_Store()
284
  );
285
 
286
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'scraper_config' ) )
287
  ->once()
288
- ->with( array() )
289
  ->andReturn( '' );
290
 
291
- $this->assertSame( array(), $configuration->get_scraper_config() );
292
  }
293
 
294
  /**
@@ -297,15 +303,15 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
297
  * @return void
298
  */
299
  public function testRefreshRateFilter() {
300
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'refresh_rate' ) )
301
  ->once()
302
  ->with( 1000 )
303
  ->andReturn( 9999 );
304
 
305
- $configuration = new \Yoast_ACF_Analysis_Configuration(
306
- new \Yoast_ACF_Analysis_String_Store(),
307
- new \Yoast_ACF_Analysis_String_Store(),
308
- new \Yoast_ACF_Analysis_String_Store()
309
  );
310
 
311
  $this->assertSame( 9999, $configuration->get_refresh_rate() );
@@ -317,15 +323,15 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
317
  * @return void
318
  */
319
  public function testRefreshRateMinimumValueFilter() {
320
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'refresh_rate' ) )
321
  ->once()
322
  ->with( 1000 )
323
  ->andReturn( 1 );
324
 
325
- $configuration = new \Yoast_ACF_Analysis_Configuration(
326
- new \Yoast_ACF_Analysis_String_Store(),
327
- new \Yoast_ACF_Analysis_String_Store(),
328
- new \Yoast_ACF_Analysis_String_Store()
329
  );
330
 
331
  $this->assertSame( 200, $configuration->get_refresh_rate() );
@@ -337,16 +343,16 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
337
  * @return void
338
  */
339
  public function testFieldSelectorsFilter() {
340
- $custom_store = new \Yoast_ACF_Analysis_String_Store();
341
- $field_selector = new \Yoast_ACF_Analysis_String_Store();
342
 
343
- $configuration = new \Yoast_ACF_Analysis_Configuration(
344
- new \Yoast_ACF_Analysis_String_Store(),
345
- new \Yoast_ACF_Analysis_String_Store(),
346
  $field_selector
347
  );
348
 
349
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'field_selectors' ) )
350
  ->once()
351
  ->with( $field_selector )
352
  ->andReturn( $custom_store );
@@ -361,15 +367,15 @@ class Configuration_Test extends \PHPUnit_Framework_TestCase {
361
  */
362
  public function testFieldSelectorsFilterInvalid() {
363
 
364
- $store = new \Yoast_ACF_Analysis_String_Store();
365
 
366
- $configuration = new \Yoast_ACF_Analysis_Configuration(
367
- new \Yoast_ACF_Analysis_String_Store(),
368
- new \Yoast_ACF_Analysis_String_Store(),
369
  $store
370
  );
371
 
372
- Filters\expectApplied( \Yoast_ACF_Analysis_Facade::get_filter_name( 'field_selectors' ) )
373
  ->once()
374
  ->with( $store )
375
  ->andReturn( '' );
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests\Configuration;
4
 
5
  use Brain\Monkey;
6
  use Brain\Monkey\Filters;
7
  use Brain\Monkey\Functions;
8
+ use PHPUnit\Framework\TestCase;
9
+ use Yoast_ACF_Analysis_Configuration;
10
+ use Yoast_ACF_Analysis_String_Store;
11
+ use Yoast_ACF_Analysis_Facade;
12
 
13
  /**
14
+ * Class Configuration_Test.
15
+ *
16
+ * @covers Yoast_ACF_Analysis_Configuration
17
  */
18
+ class Configuration_Test extends TestCase {
19
 
20
  /**
21
  * Sets up test fixtures.
44
  */
45
  public function testEmpty() {
46
 
47
+ $configuration = new Yoast_ACF_Analysis_Configuration(
48
+ new Yoast_ACF_Analysis_String_Store(),
49
+ new Yoast_ACF_Analysis_String_Store(),
50
+ new Yoast_ACF_Analysis_String_Store()
51
  );
52
 
53
  $this->assertSame(
54
  [
55
+ 'pluginName' => Yoast_ACF_Analysis_Facade::get_plugin_name(),
56
  'acfVersion' => 'version',
57
  'scraper' => [],
58
  'refreshRate' => 1000,
65
  $configuration->to_array()
66
  );
67
 
68
+ $this->assertSame( Filters\applied( 'acf/get_info' ), 1 );
69
  }
70
 
71
  /**
77
  $acf_version = '5.0.0';
78
  Functions\when( 'acf_get_setting' )->justReturn( $acf_version );
79
 
80
+ $configuration = new Yoast_ACF_Analysis_Configuration(
81
+ new Yoast_ACF_Analysis_String_Store(),
82
+ new Yoast_ACF_Analysis_String_Store(),
83
+ new Yoast_ACF_Analysis_String_Store()
84
  );
85
  $config = $configuration->to_array();
86
 
87
+ $this->assertSame( $acf_version, $config['acfVersion'] );
88
  }
89
 
90
  /**
94
  */
95
  public function testBlacklistTypeFilter() {
96
 
97
+ $blacklist_type = new Yoast_ACF_Analysis_String_Store();
98
 
99
+ $configuration = new Yoast_ACF_Analysis_Configuration(
100
  $blacklist_type,
101
+ new Yoast_ACF_Analysis_String_Store(),
102
+ new Yoast_ACF_Analysis_String_Store()
103
  );
104
 
105
+ $blacklist_type2 = new Yoast_ACF_Analysis_String_Store();
106
 
107
+ Filters\expectApplied( 'Yoast\WP\ACF\blacklist_type' )
108
  ->once()
109
  ->with( $blacklist_type )
110
  ->andReturn( $blacklist_type2 );
119
  */
120
  public function testBlacklistTypeFilterInvalid() {
121
 
122
+ $store = new Yoast_ACF_Analysis_String_Store();
123
 
124
+ $configuration = new Yoast_ACF_Analysis_Configuration(
125
  $store,
126
+ new Yoast_ACF_Analysis_String_Store(),
127
+ new Yoast_ACF_Analysis_String_Store()
128
  );
129
 
130
+ Filters\expectApplied( 'Yoast\WP\ACF\blacklist_type' )
131
  ->once()
132
  ->with( $store )
133
  ->andReturn( '' );
142
  */
143
  public function testBlacklistNameFilter() {
144
 
145
+ $blacklist_name = new Yoast_ACF_Analysis_String_Store();
146
 
147
+ $configuration = new Yoast_ACF_Analysis_Configuration(
148
+ new Yoast_ACF_Analysis_String_Store(),
149
  $blacklist_name,
150
+ new Yoast_ACF_Analysis_String_Store()
151
  );
152
 
153
+ $blacklist_name2 = new Yoast_ACF_Analysis_String_Store();
154
 
155
+ Filters\expectApplied( 'Yoast\WP\ACF\blacklist_name' )
156
  ->once()
157
  ->with( $blacklist_name )
158
  ->andReturn( $blacklist_name2 );
167
  */
168
  public function testLegacyBlackistNameFilter() {
169
 
170
+ $blacklist_name = new Yoast_ACF_Analysis_String_Store();
171
 
172
+ $configuration = new Yoast_ACF_Analysis_Configuration(
173
+ new Yoast_ACF_Analysis_String_Store(),
174
  $blacklist_name,
175
+ new Yoast_ACF_Analysis_String_Store()
176
  );
177
 
178
  Filters\expectApplied( 'ysacf_exclude_fields' )
206
  */
207
  public function testLegacyBlackistNameFilterInvalid() {
208
 
209
+ $blacklist_name = new Yoast_ACF_Analysis_String_Store();
210
 
211
+ $configuration = new Yoast_ACF_Analysis_Configuration(
212
+ new Yoast_ACF_Analysis_String_Store(),
213
  $blacklist_name,
214
+ new Yoast_ACF_Analysis_String_Store()
215
  );
216
 
217
  Filters\expectApplied( 'ysacf_exclude_fields' )
236
  */
237
  public function testBlacklistNameFilterInvalid() {
238
 
239
+ $store = new Yoast_ACF_Analysis_String_Store();
240
 
241
+ $configuration = new Yoast_ACF_Analysis_Configuration(
242
+ new Yoast_ACF_Analysis_String_Store(),
243
  $store,
244
+ new Yoast_ACF_Analysis_String_Store()
245
  );
246
 
247
+ Filters\expectApplied( 'Yoast\WP\ACF\blacklist_name' )
248
  ->once()
249
  ->with( $store )
250
  ->andReturn( '' );
258
  * @return void
259
  */
260
  public function testScraperConfigFilter() {
261
+ $config = [];
262
+ $blacklist = new Yoast_ACF_Analysis_String_Store();
263
 
264
+ $configuration = new Yoast_ACF_Analysis_Configuration(
265
  $blacklist,
266
+ new Yoast_ACF_Analysis_String_Store(),
267
+ new Yoast_ACF_Analysis_String_Store()
268
  );
269
 
270
+ Filters\expectApplied( 'Yoast\WP\ACF\scraper_config' )
271
  ->once()
272
+ ->with( [] )
273
  ->andReturn( $config );
274
 
275
  $this->assertSame( $config, $configuration->get_scraper_config() );
281
  * @return void
282
  */
283
  public function testInvalidScraperConfigFilter() {
284
+ $blacklist = new Yoast_ACF_Analysis_String_Store();
285
 
286
+ $configuration = new Yoast_ACF_Analysis_Configuration(
287
  $blacklist,
288
+ new Yoast_ACF_Analysis_String_Store(),
289
+ new Yoast_ACF_Analysis_String_Store()
290
  );
291
 
292
+ Filters\expectApplied( 'Yoast\WP\ACF\scraper_config' )
293
  ->once()
294
+ ->with( [] )
295
  ->andReturn( '' );
296
 
297
+ $this->assertSame( [], $configuration->get_scraper_config() );
298
  }
299
 
300
  /**
303
  * @return void
304
  */
305
  public function testRefreshRateFilter() {
306
+ Filters\expectApplied( 'Yoast\WP\ACF\refresh_rate' )
307
  ->once()
308
  ->with( 1000 )
309
  ->andReturn( 9999 );
310
 
311
+ $configuration = new Yoast_ACF_Analysis_Configuration(
312
+ new Yoast_ACF_Analysis_String_Store(),
313
+ new Yoast_ACF_Analysis_String_Store(),
314
+ new Yoast_ACF_Analysis_String_Store()
315
  );
316
 
317
  $this->assertSame( 9999, $configuration->get_refresh_rate() );
323
  * @return void
324
  */
325
  public function testRefreshRateMinimumValueFilter() {
326
+ Filters\expectApplied( 'Yoast\WP\ACF\refresh_rate' )
327
  ->once()
328
  ->with( 1000 )
329
  ->andReturn( 1 );
330
 
331
+ $configuration = new Yoast_ACF_Analysis_Configuration(
332
+ new Yoast_ACF_Analysis_String_Store(),
333
+ new Yoast_ACF_Analysis_String_Store(),
334
+ new Yoast_ACF_Analysis_String_Store()
335
  );
336
 
337
  $this->assertSame( 200, $configuration->get_refresh_rate() );
343
  * @return void
344
  */
345
  public function testFieldSelectorsFilter() {
346
+ $custom_store = new Yoast_ACF_Analysis_String_Store();
347
+ $field_selector = new Yoast_ACF_Analysis_String_Store();
348
 
349
+ $configuration = new Yoast_ACF_Analysis_Configuration(
350
+ new Yoast_ACF_Analysis_String_Store(),
351
+ new Yoast_ACF_Analysis_String_Store(),
352
  $field_selector
353
  );
354
 
355
+ Filters\expectApplied( 'Yoast\WP\ACF\field_selectors' )
356
  ->once()
357
  ->with( $field_selector )
358
  ->andReturn( $custom_store );
367
  */
368
  public function testFieldSelectorsFilterInvalid() {
369
 
370
+ $store = new Yoast_ACF_Analysis_String_Store();
371
 
372
+ $configuration = new Yoast_ACF_Analysis_Configuration(
373
+ new Yoast_ACF_Analysis_String_Store(),
374
+ new Yoast_ACF_Analysis_String_Store(),
375
  $store
376
  );
377
 
378
+ Filters\expectApplied( 'Yoast\WP\ACF\field_selectors' )
379
  ->once()
380
  ->with( $store )
381
  ->andReturn( '' );
tests/php/unit/Configuration/string-store-test.php CHANGED
@@ -1,19 +1,24 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Configuration;
 
 
 
4
 
5
  /**
6
- * Class String_Store_Test
 
 
7
  */
8
- class String_Store_Test extends \PHPUnit_Framework_TestCase {
9
 
10
  /**
11
  * Gets the blacklist string store.
12
  *
13
- * @return \Yoast_ACF_Analysis_String_Store The blacklist string store.
14
  */
15
  protected function getStore() {
16
- return new \Yoast_ACF_Analysis_String_Store();
17
  }
18
 
19
  /**
@@ -22,8 +27,11 @@ class String_Store_Test extends \PHPUnit_Framework_TestCase {
22
  * @return void
23
  */
24
  public function testEmpty() {
25
- $store = $this->getStore();
26
- $this->assertEmpty( $store->to_array() );
 
 
 
27
  }
28
 
29
  /**
@@ -101,7 +109,11 @@ class String_Store_Test extends \PHPUnit_Framework_TestCase {
101
  $store = $this->getStore();
102
 
103
  $this->assertFalse( $store->add( 999 ) );
104
- $this->assertEmpty( $store->to_array() );
 
 
 
 
105
  }
106
 
107
  /**
@@ -127,7 +139,10 @@ class String_Store_Test extends \PHPUnit_Framework_TestCase {
127
 
128
  $store->remove( $type_b );
129
 
130
- $this->assertEmpty( $store->to_array() );
 
 
 
131
  }
132
 
133
  /**
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests\Configuration;
4
+
5
+ use PHPUnit\Framework\TestCase;
6
+ use Yoast_ACF_Analysis_String_Store;
7
 
8
  /**
9
+ * Class String_Store_Test.
10
+ *
11
+ * @covers \Yoast_ACF_Analysis_String_Store
12
  */
13
+ class String_Store_Test extends TestCase {
14
 
15
  /**
16
  * Gets the blacklist string store.
17
  *
18
+ * @return Yoast_ACF_Analysis_String_Store The blacklist string store.
19
  */
20
  protected function getStore() {
21
+ return new Yoast_ACF_Analysis_String_Store();
22
  }
23
 
24
  /**
27
  * @return void
28
  */
29
  public function testEmpty() {
30
+ $store = $this->getStore();
31
+ $result = $store->to_array();
32
+
33
+ $this->assertInternalType( 'array', $result );
34
+ $this->assertEmpty( $result );
35
  }
36
 
37
  /**
109
  $store = $this->getStore();
110
 
111
  $this->assertFalse( $store->add( 999 ) );
112
+
113
+ $result = $store->to_array();
114
+
115
+ $this->assertInternalType( 'array', $result );
116
+ $this->assertEmpty( $result );
117
  }
118
 
119
  /**
139
 
140
  $store->remove( $type_b );
141
 
142
+ $result = $store->to_array();
143
+
144
+ $this->assertInternalType( 'array', $result );
145
+ $this->assertEmpty( $result );
146
  }
147
 
148
  /**
tests/php/unit/Dependencies/acf-dependency-test.php CHANGED
@@ -1,13 +1,17 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Dependencies;
4
 
5
  use Brain\Monkey;
 
 
6
 
7
  /**
8
- * Class ACF_Dependency_Test
 
 
9
  */
10
- class ACF_Dependency_Test extends \PHPUnit_Framework_TestCase {
11
 
12
  /**
13
  * Sets up test fixtures.
@@ -35,7 +39,7 @@ class ACF_Dependency_Test extends \PHPUnit_Framework_TestCase {
35
  * @return void
36
  */
37
  public function testNoACFClassExists() {
38
- $testee = new \Yoast_ACF_Analysis_Dependency_ACF();
39
 
40
  $this->assertFalse( $testee->is_met() );
41
  }
@@ -46,9 +50,9 @@ class ACF_Dependency_Test extends \PHPUnit_Framework_TestCase {
46
  * @return void
47
  */
48
  public function testACFClassExists() {
49
- $testee = new \Yoast_ACF_Analysis_Dependency_ACF();
50
 
51
- require_once __DIR__ . DIRECTORY_SEPARATOR . 'acf.php';
52
 
53
  $this->assertTrue( $testee->is_met() );
54
  }
@@ -59,9 +63,9 @@ class ACF_Dependency_Test extends \PHPUnit_Framework_TestCase {
59
  * @return void
60
  */
61
  public function testAdminNotice() {
62
- $testee = new \Yoast_ACF_Analysis_Dependency_ACF();
63
  $testee->register_notifications();
64
 
65
- $this->assertTrue( has_action( 'admin_notices', array( $testee, 'message_plugin_not_activated' ) ) );
66
  }
67
  }
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests\Dependencies;
4
 
5
  use Brain\Monkey;
6
+ use PHPUnit\Framework\TestCase;
7
+ use Yoast_ACF_Analysis_Dependency_ACF;
8
 
9
  /**
10
+ * Class ACF_Dependency_Test.
11
+ *
12
+ * @covers Yoast_ACF_Analysis_Dependency_ACF
13
  */
14
+ class ACF_Dependency_Test extends TestCase {
15
 
16
  /**
17
  * Sets up test fixtures.
39
  * @return void
40
  */
41
  public function testNoACFClassExists() {
42
+ $testee = new Yoast_ACF_Analysis_Dependency_ACF();
43
 
44
  $this->assertFalse( $testee->is_met() );
45
  }
50
  * @return void
51
  */
52
  public function testACFClassExists() {
53
+ $testee = new Yoast_ACF_Analysis_Dependency_ACF();
54
 
55
+ require_once __DIR__ . \DIRECTORY_SEPARATOR . 'acf.php';
56
 
57
  $this->assertTrue( $testee->is_met() );
58
  }
63
  * @return void
64
  */
65
  public function testAdminNotice() {
66
+ $testee = new Yoast_ACF_Analysis_Dependency_ACF();
67
  $testee->register_notifications();
68
 
69
+ $this->assertTrue( \has_action( 'admin_notices', [ $testee, 'message_plugin_not_activated' ] ) );
70
  }
71
  }
tests/php/unit/Dependencies/yoast-seo-dependency-test.php CHANGED
@@ -1,13 +1,17 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Dependencies;
4
 
5
  use Brain\Monkey;
 
 
6
 
7
  /**
8
- * Class Yoast_SEO_Dependency_Test*
 
 
9
  */
10
- class Yoast_SEO_Dependency_Test extends \PHPUnit_Framework_TestCase {
11
 
12
  /**
13
  * Whether or not to preserve the global state.
@@ -49,7 +53,7 @@ class Yoast_SEO_Dependency_Test extends \PHPUnit_Framework_TestCase {
49
  * @return void
50
  */
51
  public function testFail() {
52
- $testee = new \Yoast_ACF_Analysis_Dependency_Yoast_SEO();
53
 
54
  $this->assertFalse( $testee->is_met() );
55
  }
@@ -60,9 +64,9 @@ class Yoast_SEO_Dependency_Test extends \PHPUnit_Framework_TestCase {
60
  * @return void
61
  */
62
  public function testPass() {
63
- define( 'WPSEO_VERSION', '4.0.0' );
64
 
65
- $testee = new \Yoast_ACF_Analysis_Dependency_Yoast_SEO();
66
  $this->assertTrue( $testee->is_met() );
67
  }
68
 
@@ -72,9 +76,9 @@ class Yoast_SEO_Dependency_Test extends \PHPUnit_Framework_TestCase {
72
  * @return void
73
  */
74
  public function testOldVersion() {
75
- define( 'WPSEO_VERSION', '2.0.0' );
76
 
77
- $testee = new \Yoast_ACF_Analysis_Dependency_Yoast_SEO();
78
  $this->assertFalse( $testee->is_met() );
79
  }
80
 
@@ -84,10 +88,10 @@ class Yoast_SEO_Dependency_Test extends \PHPUnit_Framework_TestCase {
84
  * @return void
85
  */
86
  public function testAdminNotice() {
87
- $testee = new \Yoast_ACF_Analysis_Dependency_Yoast_SEO();
88
  $testee->register_notifications();
89
 
90
- $this->assertTrue( has_action( 'admin_notices', array( $testee, 'message_plugin_not_activated' ) ) );
91
  }
92
 
93
  /**
@@ -96,11 +100,11 @@ class Yoast_SEO_Dependency_Test extends \PHPUnit_Framework_TestCase {
96
  * @return void
97
  */
98
  public function testAdminNoticeMinimumVersion() {
99
- define( 'WPSEO_VERSION', '2.0.0' );
100
 
101
- $testee = new \Yoast_ACF_Analysis_Dependency_Yoast_SEO();
102
  $testee->register_notifications();
103
 
104
- $this->assertTrue( has_action( 'admin_notices', array( $testee, 'message_minimum_version' ) ) );
105
  }
106
  }
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests\Dependencies;
4
 
5
  use Brain\Monkey;
6
+ use PHPUnit\Framework\TestCase;
7
+ use Yoast_ACF_Analysis_Dependency_Yoast_SEO;
8
 
9
  /**
10
+ * Class Yoast_SEO_Dependency_Test.
11
+ *
12
+ * @covers Yoast_ACF_Analysis_Dependency_Yoast_SEO
13
  */
14
+ class Yoast_SEO_Dependency_Test extends TestCase {
15
 
16
  /**
17
  * Whether or not to preserve the global state.
53
  * @return void
54
  */
55
  public function testFail() {
56
+ $testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
57
 
58
  $this->assertFalse( $testee->is_met() );
59
  }
64
  * @return void
65
  */
66
  public function testPass() {
67
+ \define( 'WPSEO_VERSION', '4.0.0' );
68
 
69
+ $testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
70
  $this->assertTrue( $testee->is_met() );
71
  }
72
 
76
  * @return void
77
  */
78
  public function testOldVersion() {
79
+ \define( 'WPSEO_VERSION', '2.0.0' );
80
 
81
+ $testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
82
  $this->assertFalse( $testee->is_met() );
83
  }
84
 
88
  * @return void
89
  */
90
  public function testAdminNotice() {
91
+ $testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
92
  $testee->register_notifications();
93
 
94
+ $this->assertTrue( \has_action( 'admin_notices', [ $testee, 'message_plugin_not_activated' ] ) );
95
  }
96
 
97
  /**
100
  * @return void
101
  */
102
  public function testAdminNoticeMinimumVersion() {
103
+ \define( 'WPSEO_VERSION', '2.0.0' );
104
 
105
+ $testee = new Yoast_ACF_Analysis_Dependency_Yoast_SEO();
106
  $testee->register_notifications();
107
 
108
+ $this->assertTrue( \has_action( 'admin_notices', [ $testee, 'message_minimum_version' ] ) );
109
  }
110
  }
tests/php/unit/Doubles/failing-dependency.php CHANGED
@@ -1,11 +1,13 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Doubles;
 
 
4
 
5
  /**
6
- * Class Failing_Dependency
7
  */
8
- class Failing_Dependency implements \Yoast_ACF_Analysis_Dependency {
9
 
10
  /**
11
  * Checks if this dependency is met.
@@ -17,7 +19,7 @@ class Failing_Dependency implements \Yoast_ACF_Analysis_Dependency {
17
  }
18
 
19
  /**
20
- * Registers the notifications to communicate the depedency is not met.
21
  *
22
  * @return void
23
  */
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests\Doubles;
4
+
5
+ use Yoast_ACF_Analysis_Dependency;
6
 
7
  /**
8
+ * Class Failing_Dependency.
9
  */
10
+ class Failing_Dependency implements Yoast_ACF_Analysis_Dependency {
11
 
12
  /**
13
  * Checks if this dependency is met.
19
  }
20
 
21
  /**
22
+ * Registers the notifications to communicate the dependency is not met.
23
  *
24
  * @return void
25
  */
tests/php/unit/Doubles/passing-dependency.php CHANGED
@@ -1,11 +1,13 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Doubles;
 
 
4
 
5
  /**
6
- * Class Passing_Dependency
7
  */
8
- class Passing_Dependency implements \Yoast_ACF_Analysis_Dependency {
9
 
10
  /**
11
  * Checks if this dependency is met.
@@ -17,7 +19,7 @@ class Passing_Dependency implements \Yoast_ACF_Analysis_Dependency {
17
  }
18
 
19
  /**
20
- * Registers the notifications to communicate the depedency is not met.
21
  *
22
  * @return void
23
  */
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests\Doubles;
4
+
5
+ use Yoast_ACF_Analysis_Dependency;
6
 
7
  /**
8
+ * Class Passing_Dependency.
9
  */
10
+ class Passing_Dependency implements Yoast_ACF_Analysis_Dependency {
11
 
12
  /**
13
  * Checks if this dependency is met.
19
  }
20
 
21
  /**
22
+ * Registers the notifications to communicate the dependency is not met.
23
  *
24
  * @return void
25
  */
tests/php/unit/assets-test.php CHANGED
@@ -1,14 +1,18 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Assets;
4
 
5
  use Brain\Monkey;
6
  use Brain\Monkey\Functions;
 
 
7
 
8
  /**
9
- * Class Assets_Test
 
 
10
  */
11
- class Assets_Test extends \PHPUnit_Framework_TestCase {
12
 
13
  /**
14
  * Whether or not to preserve the global state.
@@ -50,19 +54,19 @@ class Assets_Test extends \PHPUnit_Framework_TestCase {
50
  * @return void
51
  */
52
  public function testInitHook() {
53
- define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_FILE', '/directory/file' );
54
  Functions\expect( 'get_plugin_data' )
55
  ->once()
56
- ->with( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE )
57
  ->andReturn(
58
- array(
59
  'Version' => '2.0.0',
60
- )
61
  );
62
 
63
- $testee = new \Yoast_ACF_Analysis_Assets();
64
  $testee->init();
65
 
66
- $this->assertTrue( has_filter( 'admin_enqueue_scripts', array( $testee, 'enqueue_scripts' ) ) );
67
  }
68
  }
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests;
4
 
5
  use Brain\Monkey;
6
  use Brain\Monkey\Functions;
7
+ use PHPUnit\Framework\TestCase;
8
+ use Yoast_ACF_Analysis_Assets;
9
 
10
  /**
11
+ * Class Assets_Test.
12
+ *
13
+ * @covers Yoast_ACF_Analysis_Assets
14
  */
15
+ class Assets_Test extends TestCase {
16
 
17
  /**
18
  * Whether or not to preserve the global state.
54
  * @return void
55
  */
56
  public function testInitHook() {
57
+ \define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_FILE', '/directory/file' );
58
  Functions\expect( 'get_plugin_data' )
59
  ->once()
60
+ ->with( \AC_SEO_ACF_ANALYSIS_PLUGIN_FILE )
61
  ->andReturn(
62
+ [
63
  'Version' => '2.0.0',
64
+ ]
65
  );
66
 
67
+ $testee = new Yoast_ACF_Analysis_Assets();
68
  $testee->init();
69
 
70
+ $this->assertTrue( \has_filter( 'admin_enqueue_scripts', [ $testee, 'enqueue_scripts' ] ) );
71
  }
72
  }
tests/php/unit/main-test.php CHANGED
@@ -1,13 +1,17 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests;
4
 
5
  use Brain\Monkey;
 
 
 
 
6
 
7
  /**
8
- * Class Main_Test
9
  */
10
- class Main_Test extends \PHPUnit_Framework_TestCase {
11
 
12
  /**
13
  * Sets up test fixtures.
@@ -32,17 +36,21 @@ class Main_Test extends \PHPUnit_Framework_TestCase {
32
  /**
33
  * Tests invalid configurations.
34
  *
 
 
35
  * @return void
36
  */
37
  public function testInvalidConfig() {
38
- $registry = \Yoast_ACF_Analysis_Facade::get_registry();
39
 
40
  $registry->add( 'config', 'Invalid Config' );
41
 
42
- $testee = new \AC_Yoast_SEO_ACF_Content_Analysis();
43
  $testee->boot();
44
 
45
- $this->assertNotSame( 'Invalid Config', $registry->get( 'config' ) );
46
- $this->assertInstanceOf( \Yoast_ACF_Analysis_Configuration::class, $registry->get( 'config' ) );
 
 
47
  }
48
  }
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests;
4
 
5
  use Brain\Monkey;
6
+ use PHPUnit\Framework\TestCase;
7
+ use Yoast_ACF_Analysis_Facade;
8
+ use AC_Yoast_SEO_ACF_Content_Analysis;
9
+ use Yoast_ACF_Analysis_Configuration;
10
 
11
  /**
12
+ * Class Main_Test.
13
  */
14
+ class Main_Test extends TestCase {
15
 
16
  /**
17
  * Sets up test fixtures.
36
  /**
37
  * Tests invalid configurations.
38
  *
39
+ * @covers Yoast_ACF_Analysis_Configuration
40
+ *
41
  * @return void
42
  */
43
  public function testInvalidConfig() {
44
+ $registry = Yoast_ACF_Analysis_Facade::get_registry();
45
 
46
  $registry->add( 'config', 'Invalid Config' );
47
 
48
+ $testee = new AC_Yoast_SEO_ACF_Content_Analysis();
49
  $testee->boot();
50
 
51
+ $result = $registry->get( 'config' );
52
+
53
+ $this->assertNotSame( 'Invalid Config', $result );
54
+ $this->assertInstanceOf( Yoast_ACF_Analysis_Configuration::class, $result );
55
  }
56
  }
tests/php/unit/registry-test.php CHANGED
@@ -1,11 +1,19 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Configuration;
 
 
 
 
 
 
4
 
5
  /**
6
- * Class Registry_Test
 
 
7
  */
8
- class Registry_Test extends \PHPUnit_Framework_TestCase {
9
 
10
  /**
11
  * Tests that the singleton instance is properly set and that every call to the registry, is the same instance.
@@ -16,17 +24,17 @@ class Registry_Test extends \PHPUnit_Framework_TestCase {
16
  */
17
  public function testSingleton() {
18
 
19
- $first = \Yoast_ACF_Analysis_Facade::get_registry();
20
- $second = \Yoast_ACF_Analysis_Facade::get_registry();
21
 
22
  $this->assertSame( $first, $second );
23
 
24
  $first->add(
25
  'id',
26
- new \Yoast_ACF_Analysis_Configuration(
27
- new \Yoast_ACF_Analysis_String_Store(),
28
- new \Yoast_ACF_Analysis_String_Store(),
29
- new \Yoast_ACF_Analysis_String_Store()
30
  )
31
  );
32
 
@@ -34,7 +42,7 @@ class Registry_Test extends \PHPUnit_Framework_TestCase {
34
  }
35
 
36
  /**
37
- * Tests that adding a non-existing item to the registy, succeeds and that the item can be found based on its ID.
38
  *
39
  * @return void
40
  */
@@ -43,7 +51,7 @@ class Registry_Test extends \PHPUnit_Framework_TestCase {
43
  $id = 'add';
44
  $content = 'something';
45
 
46
- $registry = new \Yoast_ACF_Analysis_Registry();
47
 
48
  $this->assertNull( $registry->get( $id ) );
49
 
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests;
4
+
5
+ use PHPUnit\Framework\TestCase;
6
+ use Yoast_ACF_Analysis_Facade;
7
+ use Yoast_ACF_Analysis_Configuration;
8
+ use Yoast_ACF_Analysis_String_Store;
9
+ use Yoast_ACF_Analysis_Registry;
10
 
11
  /**
12
+ * Class Registry_Test.
13
+ *
14
+ * @covers Yoast_ACF_Analysis_Registry
15
  */
16
+ class Registry_Test extends TestCase {
17
 
18
  /**
19
  * Tests that the singleton instance is properly set and that every call to the registry, is the same instance.
24
  */
25
  public function testSingleton() {
26
 
27
+ $first = Yoast_ACF_Analysis_Facade::get_registry();
28
+ $second = Yoast_ACF_Analysis_Facade::get_registry();
29
 
30
  $this->assertSame( $first, $second );
31
 
32
  $first->add(
33
  'id',
34
+ new Yoast_ACF_Analysis_Configuration(
35
+ new Yoast_ACF_Analysis_String_Store(),
36
+ new Yoast_ACF_Analysis_String_Store(),
37
+ new Yoast_ACF_Analysis_String_Store()
38
  )
39
  );
40
 
42
  }
43
 
44
  /**
45
+ * Tests that adding a non-existing item to the registry, succeeds and that the item can be found based on its ID.
46
  *
47
  * @return void
48
  */
51
  $id = 'add';
52
  $content = 'something';
53
 
54
+ $registry = new Yoast_ACF_Analysis_Registry();
55
 
56
  $this->assertNull( $registry->get( $id ) );
57
 
tests/php/unit/requirements-test.php CHANGED
@@ -1,17 +1,18 @@
1
  <?php
2
 
3
- namespace Yoast\AcfAnalysis\Tests\Configuration;
4
 
5
  use Brain\Monkey;
6
  use Brain\Monkey\Functions;
7
- use Brain\Monkey\Filters;
8
- use Yoast\AcfAnalysis\Tests\Doubles\Passing_Dependency;
9
- use Yoast\AcfAnalysis\Tests\Doubles\Failing_Dependency;
 
10
 
11
  /**
12
- * Class Requirements_Test
13
  */
14
- class Requirements_Test extends \PHPUnit_Framework_TestCase {
15
 
16
  /**
17
  * Sets up test fixtures.
@@ -34,20 +35,25 @@ class Requirements_Test extends \PHPUnit_Framework_TestCase {
34
  /**
35
  * Tests the situation where there are no dependencies.
36
  *
 
 
37
  * @return void
38
  */
39
  public function testNoDependencies() {
40
- $testee = new \Yoast_ACF_Analysis_Requirements();
41
  $this->assertTrue( $testee->are_met() );
42
  }
43
 
44
  /**
45
  * Tests that requirements are met when a valid dependency is added.
46
  *
 
 
 
47
  * @return void
48
  */
49
  public function testPassingDependency() {
50
- $testee = new \Yoast_ACF_Analysis_Requirements();
51
  $testee->add_dependency( new Passing_Dependency() );
52
 
53
  $this->assertTrue( $testee->are_met() );
@@ -56,10 +62,13 @@ class Requirements_Test extends \PHPUnit_Framework_TestCase {
56
  /**
57
  * Tests that requirements are not met when an invalid dependency is added.
58
  *
 
 
 
59
  * @return void
60
  */
61
  public function testFailingDependency() {
62
- $testee = new \Yoast_ACF_Analysis_Requirements();
63
  $testee->add_dependency( new Failing_Dependency() );
64
 
65
  $this->assertFalse( $testee->are_met() );
@@ -68,10 +77,13 @@ class Requirements_Test extends \PHPUnit_Framework_TestCase {
68
  /**
69
  * Tests that requirements are not met when a mix of valid and invalid dependencies are added.
70
  *
 
 
 
71
  * @return void
72
  */
73
  public function testMixedDependencies() {
74
- $testee = new \Yoast_ACF_Analysis_Requirements();
75
  $testee->add_dependency( new Failing_Dependency() );
76
  $testee->add_dependency( new Passing_Dependency() );
77
 
1
  <?php
2
 
3
+ namespace Yoast\WP\ACF\Tests;
4
 
5
  use Brain\Monkey;
6
  use Brain\Monkey\Functions;
7
+ use PHPUnit\Framework\TestCase;
8
+ use Yoast_ACF_Analysis_Requirements;
9
+ use Yoast\WP\ACF\Tests\Doubles\Passing_Dependency;
10
+ use Yoast\WP\ACF\Tests\Doubles\Failing_Dependency;
11
 
12
  /**
13
+ * Class Requirements_Test.
14
  */
15
+ class Requirements_Test extends TestCase {
16
 
17
  /**
18
  * Sets up test fixtures.
35
  /**
36
  * Tests the situation where there are no dependencies.
37
  *
38
+ * @covers Yoast_ACF_Analysis_Requirements::are_met
39
+ *
40
  * @return void
41
  */
42
  public function testNoDependencies() {
43
+ $testee = new Yoast_ACF_Analysis_Requirements();
44
  $this->assertTrue( $testee->are_met() );
45
  }
46
 
47
  /**
48
  * Tests that requirements are met when a valid dependency is added.
49
  *
50
+ * @covers Yoast_ACF_Analysis_Requirements::add_dependency
51
+ * @covers Yoast_ACF_Analysis_Requirements::are_met
52
+ *
53
  * @return void
54
  */
55
  public function testPassingDependency() {
56
+ $testee = new Yoast_ACF_Analysis_Requirements();
57
  $testee->add_dependency( new Passing_Dependency() );
58
 
59
  $this->assertTrue( $testee->are_met() );
62
  /**
63
  * Tests that requirements are not met when an invalid dependency is added.
64
  *
65
+ * @covers Yoast_ACF_Analysis_Requirements::add_dependency
66
+ * @covers Yoast_ACF_Analysis_Requirements::are_met
67
+ *
68
  * @return void
69
  */
70
  public function testFailingDependency() {
71
+ $testee = new Yoast_ACF_Analysis_Requirements();
72
  $testee->add_dependency( new Failing_Dependency() );
73
 
74
  $this->assertFalse( $testee->are_met() );
77
  /**
78
  * Tests that requirements are not met when a mix of valid and invalid dependencies are added.
79
  *
80
+ * @covers Yoast_ACF_Analysis_Requirements::add_dependency
81
+ * @covers Yoast_ACF_Analysis_Requirements::are_met
82
+ *
83
  * @return void
84
  */
85
  public function testMixedDependencies() {
86
+ $testee = new Yoast_ACF_Analysis_Requirements();
87
  $testee->add_dependency( new Failing_Dependency() );
88
  $testee->add_dependency( new Passing_Dependency() );
89
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit8dadf3d19c2db1d3f2ea2bc13cbfc71b::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInite2ed7c365b1421d3105e6d30613b84b4::getLoader();
vendor/autoload_52.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload_52.php generated by xrstf/composer-php52
4
-
5
- require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
-
7
- return ComposerAutoloaderInit3fdf1c700b157b1db194137c8afafe66::getLoader();
 
 
 
 
 
 
 
vendor/composer/ClassLoader52.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Fabien Potencier <fabien@symfony.com>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- class xrstf_Composer52_ClassLoader {
20
- private $prefixes = array();
21
- private $fallbackDirs = array();
22
- private $useIncludePath = false;
23
- private $classMap = array();
24
- private $classMapAuthoratative = false;
25
- private $allowUnderscore = false;
26
-
27
- /**
28
- * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
- */
30
- public function setAllowUnderscore($flag) {
31
- $this->allowUnderscore = (boolean) $flag;
32
- }
33
-
34
- /**
35
- * @return array
36
- */
37
- public function getPrefixes() {
38
- return $this->prefixes;
39
- }
40
-
41
- /**
42
- * Turns off searching the prefix and fallback directories for classes
43
- * that have not been registered with the class map.
44
- *
45
- * @param bool $classMapAuthoratative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoratative) {
48
- $this->classMapAuthoratative = $classMapAuthoratative;
49
- }
50
-
51
- /**
52
- * Should class lookup fail if not found in the current class map?
53
- *
54
- * @return bool
55
- */
56
- public function getClassMapAuthoratative() {
57
- return $this->classMapAuthoratative;
58
- }
59
-
60
- /**
61
- * @return array
62
- */
63
- public function getFallbackDirs() {
64
- return $this->fallbackDirs;
65
- }
66
-
67
- /**
68
- * @return array
69
- */
70
- public function getClassMap() {
71
- return $this->classMap;
72
- }
73
-
74
- /**
75
- * @param array $classMap class to filename map
76
- */
77
- public function addClassMap(array $classMap) {
78
- if ($this->classMap) {
79
- $this->classMap = array_merge($this->classMap, $classMap);
80
- }
81
- else {
82
- $this->classMap = $classMap;
83
- }
84
- }
85
-
86
- /**
87
- * Registers a set of classes, merging with any others previously set.
88
- *
89
- * @param string $prefix the classes prefix
90
- * @param array|string $paths the location(s) of the classes
91
- * @param bool $prepend prepend the location(s)
92
- */
93
- public function add($prefix, $paths, $prepend = false) {
94
- if (!$prefix) {
95
- if ($prepend) {
96
- $this->fallbackDirs = array_merge(
97
- (array) $paths,
98
- $this->fallbackDirs
99
- );
100
- }
101
- else {
102
- $this->fallbackDirs = array_merge(
103
- $this->fallbackDirs,
104
- (array) $paths
105
- );
106
- }
107
-
108
- return;
109
- }
110
-
111
- if (!isset($this->prefixes[$prefix])) {
112
- $this->prefixes[$prefix] = (array) $paths;
113
- return;
114
- }
115
-
116
- if ($prepend) {
117
- $this->prefixes[$prefix] = array_merge(
118
- (array) $paths,
119
- $this->prefixes[$prefix]
120
- );
121
- }
122
- else {
123
- $this->prefixes[$prefix] = array_merge(
124
- $this->prefixes[$prefix],
125
- (array) $paths
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Registers a set of classes, replacing any others previously set.
132
- *
133
- * @param string $prefix the classes prefix
134
- * @param array|string $paths the location(s) of the classes
135
- */
136
- public function set($prefix, $paths) {
137
- if (!$prefix) {
138
- $this->fallbackDirs = (array) $paths;
139
- return;
140
- }
141
-
142
- $this->prefixes[$prefix] = (array) $paths;
143
- }
144
-
145
- /**
146
- * Turns on searching the include path for class files.
147
- *
148
- * @param bool $useIncludePath
149
- */
150
- public function setUseIncludePath($useIncludePath) {
151
- $this->useIncludePath = $useIncludePath;
152
- }
153
-
154
- /**
155
- * Can be used to check if the autoloader uses the include path to check
156
- * for classes.
157
- *
158
- * @return bool
159
- */
160
- public function getUseIncludePath() {
161
- return $this->useIncludePath;
162
- }
163
-
164
- /**
165
- * Registers this instance as an autoloader.
166
- */
167
- public function register() {
168
- spl_autoload_register(array($this, 'loadClass'), true);
169
- }
170
-
171
- /**
172
- * Unregisters this instance as an autoloader.
173
- */
174
- public function unregister() {
175
- spl_autoload_unregister(array($this, 'loadClass'));
176
- }
177
-
178
- /**
179
- * Loads the given class or interface.
180
- *
181
- * @param string $class the name of the class
182
- * @return bool|null true, if loaded
183
- */
184
- public function loadClass($class) {
185
- if ($file = $this->findFile($class)) {
186
- include $file;
187
- return true;
188
- }
189
- }
190
-
191
- /**
192
- * Finds the path to the file where the class is defined.
193
- *
194
- * @param string $class the name of the class
195
- * @return string|null the path, if found
196
- */
197
- public function findFile($class) {
198
- if ('\\' === $class[0]) {
199
- $class = substr($class, 1);
200
- }
201
-
202
- if (isset($this->classMap[$class])) {
203
- return $this->classMap[$class];
204
- }
205
- elseif ($this->classMapAuthoratative) {
206
- return false;
207
- }
208
-
209
- $classPath = $this->getClassPath($class);
210
-
211
- foreach ($this->prefixes as $prefix => $dirs) {
212
- if (0 === strpos($class, $prefix)) {
213
- foreach ($dirs as $dir) {
214
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
- return $dir.DIRECTORY_SEPARATOR.$classPath;
216
- }
217
- }
218
- }
219
- }
220
-
221
- foreach ($this->fallbackDirs as $dir) {
222
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
- return $dir.DIRECTORY_SEPARATOR.$classPath;
224
- }
225
- }
226
-
227
- if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
- return $file;
229
- }
230
-
231
- return $this->classMap[$class] = false;
232
- }
233
-
234
- private function getClassPath($class) {
235
- if (false !== $pos = strrpos($class, '\\')) {
236
- // namespaced class name
237
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
- $className = substr($class, $pos + 1);
239
- }
240
- else {
241
- // PEAR-like class name
242
- $classPath = null;
243
- $className = $class;
244
- }
245
-
246
- $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
-
248
- // restore the prefix
249
- if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
- $className[0] = '_';
251
- }
252
-
253
- $classPath .= $className.'.php';
254
-
255
- return $classPath;
256
- }
257
-
258
- public static function resolveIncludePath($classPath) {
259
- $paths = explode(PATH_SEPARATOR, get_include_path());
260
-
261
- foreach ($paths as $path) {
262
- $path = rtrim($path, '/\\');
263
-
264
- if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
- return $file;
266
- }
267
- }
268
-
269
- return false;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_classmap.php CHANGED
@@ -17,6 +17,7 @@ return array(
17
  'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
18
  'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
19
  'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
 
20
  'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
21
  'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
22
  'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
@@ -50,11 +51,13 @@ return array(
50
  'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
51
  'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
52
  'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
 
53
  'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
54
  'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
55
  'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
56
  'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
57
  'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
 
58
  'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
59
  'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
60
  'Composer\\Installers\\OntoWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
@@ -70,6 +73,7 @@ return array(
70
  'Composer\\Installers\\PortoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
71
  'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
72
  'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
 
73
  'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
74
  'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
75
  'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
@@ -77,6 +81,7 @@ return array(
77
  'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
78
  'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
79
  'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
 
80
  'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
81
  'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
82
  'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
@@ -101,6 +106,4 @@ return array(
101
  'Yoast_ACF_Analysis_Registry' => $baseDir . '/inc/registry.php',
102
  'Yoast_ACF_Analysis_Requirements' => $baseDir . '/inc/requirements.php',
103
  'Yoast_ACF_Analysis_String_Store' => $baseDir . '/inc/configuration/string-store.php',
104
- 'xrstf\\Composer52\\AutoloadGenerator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php',
105
- 'xrstf\\Composer52\\Generator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php',
106
  );
17
  'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
18
  'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
19
  'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
20
+ 'Composer\\Installers\\CiviCrmInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
21
  'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
22
  'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
23
  'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
51
  'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
52
  'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
53
  'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
54
+ 'Composer\\Installers\\MajimaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
55
  'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
56
  'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
57
  'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
58
  'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
59
  'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
60
+ 'Composer\\Installers\\ModxInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
61
  'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
62
  'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
63
  'Composer\\Installers\\OntoWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
73
  'Composer\\Installers\\PortoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
74
  'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
75
  'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
76
+ 'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
77
  'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
78
  'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
79
  'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
81
  'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
82
  'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
83
  'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
84
+ 'Composer\\Installers\\SiteDirectInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
85
  'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
86
  'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
87
  'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
106
  'Yoast_ACF_Analysis_Registry' => $baseDir . '/inc/registry.php',
107
  'Yoast_ACF_Analysis_Requirements' => $baseDir . '/inc/requirements.php',
108
  'Yoast_ACF_Analysis_String_Store' => $baseDir . '/inc/configuration/string-store.php',
 
 
109
  );
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,5 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
10
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
6
  {
7
  private static $loader;
8
 
@@ -13,21 +13,24 @@ class ComposerAutoloaderInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
13
  }
14
  }
15
 
 
 
 
16
  public static function getLoader()
17
  {
18
  if (null !== self::$loader) {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit8dadf3d19c2db1d3f2ea2bc13cbfc71b', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit8dadf3d19c2db1d3f2ea2bc13cbfc71b', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInite2ed7c365b1421d3105e6d30613b84b4
6
  {
7
  private static $loader;
8
 
13
  }
14
  }
15
 
16
+ /**
17
+ * @return \Composer\Autoload\ClassLoader
18
+ */
19
  public static function getLoader()
20
  {
21
  if (null !== self::$loader) {
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInite2ed7c365b1421d3105e6d30613b84b4', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInite2ed7c365b1421d3105e6d30613b84b4', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInite2ed7c365b1421d3105e6d30613b84b4::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_real_52.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
- // autoload_real_52.php generated by xrstf/composer-php52
4
-
5
- class ComposerAutoloaderInit3fdf1c700b157b1db194137c8afafe66 {
6
- private static $loader;
7
-
8
- public static function loadClassLoader($class) {
9
- if ('xrstf_Composer52_ClassLoader' === $class) {
10
- require dirname(__FILE__).'/ClassLoader52.php';
11
- }
12
- }
13
-
14
- /**
15
- * @return xrstf_Composer52_ClassLoader
16
- */
17
- public static function getLoader() {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInit3fdf1c700b157b1db194137c8afafe66', 'loadClassLoader'), true /*, true */);
23
- self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit3fdf1c700b157b1db194137c8afafe66', 'loadClassLoader'));
25
-
26
- $vendorDir = dirname(dirname(__FILE__));
27
- $baseDir = dirname($vendorDir);
28
- $dir = dirname(__FILE__);
29
-
30
- $map = require $dir.'/autoload_namespaces.php';
31
- foreach ($map as $namespace => $path) {
32
- $loader->add($namespace, $path);
33
- }
34
-
35
- $classMap = require $dir.'/autoload_classmap.php';
36
- if ($classMap) {
37
- $loader->addClassMap($classMap);
38
- }
39
-
40
- $loader->register(true);
41
-
42
- return $loader;
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
@@ -20,16 +20,6 @@ class ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
20
  ),
21
  );
22
 
23
- public static $prefixesPsr0 = array (
24
- 'x' =>
25
- array (
26
- 'xrstf\\Composer52' =>
27
- array (
28
- 0 => __DIR__ . '/..' . '/xrstf/composer-php52/lib',
29
- ),
30
- ),
31
- );
32
-
33
  public static $classMap = array (
34
  'AC_Yoast_SEO_ACF_Content_Analysis' => __DIR__ . '/../..' . '/inc/ac-yoast-seo-acf-content-analysis.php',
35
  'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
@@ -42,6 +32,7 @@ class ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
42
  'Composer\\Installers\\BonefishInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
43
  'Composer\\Installers\\CakePHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
44
  'Composer\\Installers\\ChefInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
 
45
  'Composer\\Installers\\ClanCatsFrameworkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
46
  'Composer\\Installers\\CockpitInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
47
  'Composer\\Installers\\CodeIgniterInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
@@ -75,11 +66,13 @@ class ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
75
  'Composer\\Installers\\MODULEWorkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
76
  'Composer\\Installers\\MODXEvoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
77
  'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
 
78
  'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
79
  'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
80
  'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
81
  'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
82
  'Composer\\Installers\\MicroweberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
 
83
  'Composer\\Installers\\MoodleInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
84
  'Composer\\Installers\\OctoberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
85
  'Composer\\Installers\\OntoWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
@@ -95,6 +88,7 @@ class ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
95
  'Composer\\Installers\\PortoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
96
  'Composer\\Installers\\PrestashopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
97
  'Composer\\Installers\\PuppetInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
 
98
  'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
99
  'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
100
  'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
@@ -102,6 +96,7 @@ class ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
102
  'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
103
  'Composer\\Installers\\ShopwareInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
104
  'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
 
105
  'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
106
  'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
107
  'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
@@ -126,17 +121,14 @@ class ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b
126
  'Yoast_ACF_Analysis_Registry' => __DIR__ . '/../..' . '/inc/registry.php',
127
  'Yoast_ACF_Analysis_Requirements' => __DIR__ . '/../..' . '/inc/requirements.php',
128
  'Yoast_ACF_Analysis_String_Store' => __DIR__ . '/../..' . '/inc/configuration/string-store.php',
129
- 'xrstf\\Composer52\\AutoloadGenerator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php',
130
- 'xrstf\\Composer52\\Generator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php',
131
  );
132
 
133
  public static function getInitializer(ClassLoader $loader)
134
  {
135
  return \Closure::bind(function () use ($loader) {
136
- $loader->prefixLengthsPsr4 = ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b::$prefixLengthsPsr4;
137
- $loader->prefixDirsPsr4 = ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b::$prefixDirsPsr4;
138
- $loader->prefixesPsr0 = ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b::$prefixesPsr0;
139
- $loader->classMap = ComposerStaticInit8dadf3d19c2db1d3f2ea2bc13cbfc71b::$classMap;
140
 
141
  }, null, ClassLoader::class);
142
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInite2ed7c365b1421d3105e6d30613b84b4
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'C' =>
20
  ),
21
  );
22
 
 
 
 
 
 
 
 
 
 
 
23
  public static $classMap = array (
24
  'AC_Yoast_SEO_ACF_Content_Analysis' => __DIR__ . '/../..' . '/inc/ac-yoast-seo-acf-content-analysis.php',
25
  'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
32
  'Composer\\Installers\\BonefishInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
33
  'Composer\\Installers\\CakePHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
34
  'Composer\\Installers\\ChefInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
35
+ 'Composer\\Installers\\CiviCrmInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
36
  'Composer\\Installers\\ClanCatsFrameworkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
37
  'Composer\\Installers\\CockpitInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
38
  'Composer\\Installers\\CodeIgniterInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
66
  'Composer\\Installers\\MODULEWorkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
67
  'Composer\\Installers\\MODXEvoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
68
  'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
69
+ 'Composer\\Installers\\MajimaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
70
  'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
71
  'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
72
  'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
73
  'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
74
  'Composer\\Installers\\MicroweberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
75
+ 'Composer\\Installers\\ModxInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
76
  'Composer\\Installers\\MoodleInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
77
  'Composer\\Installers\\OctoberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
78
  'Composer\\Installers\\OntoWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
88
  'Composer\\Installers\\PortoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
89
  'Composer\\Installers\\PrestashopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
90
  'Composer\\Installers\\PuppetInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
91
+ 'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
92
  'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
93
  'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
94
  'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
96
  'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
97
  'Composer\\Installers\\ShopwareInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
98
  'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
99
+ 'Composer\\Installers\\SiteDirectInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
100
  'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
101
  'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
102
  'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
121
  'Yoast_ACF_Analysis_Registry' => __DIR__ . '/../..' . '/inc/registry.php',
122
  'Yoast_ACF_Analysis_Requirements' => __DIR__ . '/../..' . '/inc/requirements.php',
123
  'Yoast_ACF_Analysis_String_Store' => __DIR__ . '/../..' . '/inc/configuration/string-store.php',
 
 
124
  );
125
 
126
  public static function getInitializer(ClassLoader $loader)
127
  {
128
  return \Closure::bind(function () use ($loader) {
129
+ $loader->prefixLengthsPsr4 = ComposerStaticInite2ed7c365b1421d3105e6d30613b84b4::$prefixLengthsPsr4;
130
+ $loader->prefixDirsPsr4 = ComposerStaticInite2ed7c365b1421d3105e6d30613b84b4::$prefixDirsPsr4;
131
+ $loader->classMap = ComposerStaticInite2ed7c365b1421d3105e6d30613b84b4::$classMap;
 
132
 
133
  }, null, ClassLoader::class);
134
  }
vendor/xrstf/composer-php52/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2013 Christoph Mewes
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php DELETED
@@ -1,346 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Igor Wiedler <igor@wiedler.ch>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- namespace xrstf\Composer52;
20
-
21
- use Composer\Autoload\AutoloadGenerator as BaseGenerator;
22
- use Composer\Autoload\ClassMapGenerator;
23
- use Composer\Config;
24
- use Composer\Installer\InstallationManager;
25
- use Composer\Package\AliasPackage;
26
- use Composer\Package\PackageInterface;
27
- use Composer\Repository\InstalledRepositoryInterface;
28
- use Composer\Util\Filesystem;
29
-
30
- class AutoloadGenerator extends BaseGenerator {
31
-
32
- /**
33
- * @var bool
34
- */
35
- private $classMapAuthoritative = false;
36
-
37
- public function __construct() {
38
- // do nothing (but keep this constructor so we can build an instance without the need for an event dispatcher)
39
- }
40
-
41
- /**
42
- * Whether or not generated autoloader considers the class map
43
- * authoritative.
44
- *
45
- * @param bool $classMapAuthoritative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoritative)
48
- {
49
- $this->classMapAuthoritative = (boolean) $classMapAuthoritative;
50
- }
51
-
52
- public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') {
53
- if ($this->classMapAuthoritative) {
54
- // Force scanPsr0Packages when classmap is authoritative
55
- $scanPsr0Packages = true;
56
- }
57
-
58
- $filesystem = new Filesystem();
59
- $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
60
-
61
- $cwd = getcwd();
62
- $basePath = $filesystem->normalizePath($cwd);
63
- $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
64
- $targetDir = $vendorPath.'/'.$targetDir;
65
- $filesystem->ensureDirectoryExists($targetDir);
66
-
67
- $useGlobalIncludePath = (bool) $config->get('use-include-path');
68
- $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
69
- $classMapAuthoritative = $config->get('classmap-authoritative');
70
-
71
- $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
72
- $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
73
-
74
- $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
75
- $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
76
-
77
- // add 5.2 compat
78
- $vendorPathCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
79
- $vendorPathToTargetDirCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathToTargetDirCode);
80
-
81
- $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
82
- $autoloads = $this->parseAutoloads($packageMap, $mainPackage);
83
-
84
- // add custom psr-0 autoloading if the root package has a target dir
85
- $targetDirLoader = null;
86
- $mainAutoload = $mainPackage->getAutoload();
87
- if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
88
- $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
89
- $prefixes = implode(', ', array_map(function ($prefix) {
90
- return var_export($prefix, true);
91
- }, array_keys($mainAutoload['psr-0'])));
92
-
93
- $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
94
-
95
- $targetDirLoader = <<<EOF
96
-
97
- public static function autoload(\$class) {
98
- \$dir = $baseDirFromTargetDirCode.'/';
99
- \$prefixes = array($prefixes);
100
-
101
- foreach (\$prefixes as \$prefix) {
102
- if (0 !== strpos(\$class, \$prefix)) {
103
- continue;
104
- }
105
-
106
- \$path = explode(DIRECTORY_SEPARATOR, self::getClassPath(\$class));
107
- \$path = \$dir.implode('/', array_slice(\$path, $levels));
108
-
109
- if (!\$path = self::resolveIncludePath(\$path)) {
110
- return false;
111
- }
112
-
113
- require \$path;
114
- return true;
115
- }
116
- }
117
-
118
- EOF;
119
- }
120
-
121
- $filesCode = "";
122
- $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
123
- foreach ($autoloads['files'] as $functionFile) {
124
- // don't include file if it is using PHP 5.3+ syntax
125
- // https://bitbucket.org/xrstf/composer-php52/issue/4
126
- if ($this->isPHP53($functionFile)) {
127
- $filesCode .= '// require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile)."; // disabled because of PHP 5.3 syntax\n";
128
- }
129
- else {
130
- $filesCode .= ' require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile).";\n";
131
- }
132
- }
133
-
134
- if (!$suffix) {
135
- $suffix = md5(uniqid('', true));
136
- }
137
-
138
- $includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode);
139
-
140
- file_put_contents($vendorPath.'/autoload_52.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
141
- file_put_contents($targetDir.'/autoload_real_52.php', $this->getAutoloadRealFile(true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader));
142
-
143
- // use stream_copy_to_stream instead of copy
144
- // to work around https://bugs.php.net/bug.php?id=64634
145
- $sourceLoader = fopen(__DIR__.'/ClassLoader.php', 'r');
146
- $targetLoader = fopen($targetDir.'/ClassLoader52.php', 'w+');
147
- stream_copy_to_stream($sourceLoader, $targetLoader);
148
- fclose($sourceLoader);
149
- fclose($targetLoader);
150
- unset($sourceLoader, $targetLoader);
151
- }
152
-
153
- protected function isPHP53($file) {
154
- $tokens = token_get_all(file_get_contents($file));
155
- $php53 = array(T_DIR, T_GOTO, T_NAMESPACE, T_NS_C, T_NS_SEPARATOR, T_USE);
156
-
157
- // PHP 5.4+
158
- if (defined('T_TRAIT')) {
159
- $php53[] = T_TRAIT;
160
- $php53[] = T_TRAIT_C;
161
- $php53[] = T_TRAIT_C;
162
- }
163
-
164
- // PHP 5.5+
165
- if (defined('T_FINALLY')) {
166
- $php53[] = T_FINALLY;
167
- $php53[] = T_YIELD;
168
- }
169
-
170
- foreach ($tokens as $token) {
171
- if (is_array($token) && in_array($token[0], $php53)) {
172
- return true;
173
- }
174
- }
175
-
176
- return false;
177
- }
178
-
179
- protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) {
180
- $includePaths = array();
181
-
182
- foreach ($packageMap as $item) {
183
- list($package, $installPath) = $item;
184
-
185
- if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
186
- $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
187
- }
188
-
189
- foreach ($package->getIncludePaths() as $includePath) {
190
- $includePath = trim($includePath, '/');
191
- $includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
192
- }
193
- }
194
-
195
- if (!$includePaths) {
196
- return;
197
- }
198
-
199
- $includePathsFile = <<<EOF
200
- <?php
201
-
202
- // include_paths_52.php generated by xrstf/composer-php52
203
-
204
- \$vendorDir = $vendorPathCode;
205
- \$baseDir = $appBaseDirCode;
206
-
207
- return array(
208
-
209
- EOF;
210
-
211
- foreach ($includePaths as $path) {
212
- $includePathsFile .= "\t" . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
213
- }
214
-
215
- return $includePathsFile . ");\n";
216
- }
217
-
218
- protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) {
219
- return <<<AUTOLOAD
220
- <?php
221
-
222
- // autoload_52.php generated by xrstf/composer-php52
223
-
224
- require_once $vendorPathToTargetDirCode.'/autoload_real_52.php';
225
-
226
- return ComposerAutoloaderInit$suffix::getLoader();
227
-
228
- AUTOLOAD;
229
- }
230
-
231
- protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion = 70000) {
232
- // TODO the class ComposerAutoloaderInit should be revert to a closure
233
- // when APC has been fixed:
234
- // - https://github.com/composer/composer/issues/959
235
- // - https://bugs.php.net/bug.php?id=52144
236
- // - https://bugs.php.net/bug.php?id=61576
237
- // - https://bugs.php.net/bug.php?id=59298
238
-
239
- if ($filesCode) {
240
- $filesCode = "\n\n".rtrim($filesCode);
241
- }
242
-
243
- $file = <<<HEADER
244
- <?php
245
-
246
- // autoload_real_52.php generated by xrstf/composer-php52
247
-
248
- class ComposerAutoloaderInit$suffix {
249
- private static \$loader;
250
-
251
- public static function loadClassLoader(\$class) {
252
- if ('xrstf_Composer52_ClassLoader' === \$class) {
253
- require dirname(__FILE__).'/ClassLoader52.php';
254
- }
255
- }
256
-
257
- /**
258
- * @return xrstf_Composer52_ClassLoader
259
- */
260
- public static function getLoader() {
261
- if (null !== self::\$loader) {
262
- return self::\$loader;
263
- }
264
-
265
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true /*, true */);
266
- self::\$loader = \$loader = new xrstf_Composer52_ClassLoader();
267
- spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
268
-
269
- \$vendorDir = $vendorPathCode;
270
- \$baseDir = $appBaseDirCode;
271
- \$dir = dirname(__FILE__);
272
-
273
-
274
- HEADER;
275
-
276
- if ($useIncludePath) {
277
- $file .= <<<'INCLUDE_PATH'
278
- $includePaths = require $dir.'/include_paths.php';
279
- array_push($includePaths, get_include_path());
280
- set_include_path(implode(PATH_SEPARATOR, $includePaths));
281
-
282
-
283
- INCLUDE_PATH;
284
- }
285
-
286
- $file .= <<<'PSR0'
287
- $map = require $dir.'/autoload_namespaces.php';
288
- foreach ($map as $namespace => $path) {
289
- $loader->add($namespace, $path);
290
- }
291
-
292
-
293
- PSR0;
294
-
295
- if ($useClassMap) {
296
- $file .= <<<'CLASSMAP'
297
- $classMap = require $dir.'/autoload_classmap.php';
298
- if ($classMap) {
299
- $loader->addClassMap($classMap);
300
- }
301
-
302
-
303
- CLASSMAP;
304
- }
305
-
306
- if ($this->classMapAuthoritative) {
307
- $file .= <<<'CLASSMAPAUTHORITATIVE'
308
- $loader->setClassMapAuthoritative(true);
309
-
310
- CLASSMAPAUTHORITATIVE;
311
- }
312
-
313
- if ($useGlobalIncludePath) {
314
- $file .= <<<'INCLUDEPATH'
315
- $loader->setUseIncludePath(true);
316
-
317
-
318
- INCLUDEPATH;
319
- }
320
-
321
- if ($targetDirLoader) {
322
- $file .= <<<REGISTER_AUTOLOAD
323
- spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true);
324
-
325
-
326
- REGISTER_AUTOLOAD;
327
-
328
- }
329
-
330
- $file .= <<<METHOD_FOOTER
331
- \$loader->register($prependAutoloader);{$filesCode}
332
-
333
- return \$loader;
334
- }
335
-
336
- METHOD_FOOTER;
337
-
338
- $file .= $targetDirLoader;
339
-
340
- return $file . <<<FOOTER
341
- }
342
-
343
- FOOTER;
344
-
345
- }
346
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * --------------------------------------------------------------------------
11
- *
12
- * 99% of this is copied as-is from the original Composer source code and is
13
- * released under MIT license as well. Copyright goes to:
14
- *
15
- * - Fabien Potencier <fabien@symfony.com>
16
- * - Jordi Boggiano <j.boggiano@seld.be>
17
- */
18
-
19
- class xrstf_Composer52_ClassLoader {
20
- private $prefixes = array();
21
- private $fallbackDirs = array();
22
- private $useIncludePath = false;
23
- private $classMap = array();
24
- private $classMapAuthoratative = false;
25
- private $allowUnderscore = false;
26
-
27
- /**
28
- * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
- */
30
- public function setAllowUnderscore($flag) {
31
- $this->allowUnderscore = (boolean) $flag;
32
- }
33
-
34
- /**
35
- * @return array
36
- */
37
- public function getPrefixes() {
38
- return $this->prefixes;
39
- }
40
-
41
- /**
42
- * Turns off searching the prefix and fallback directories for classes
43
- * that have not been registered with the class map.
44
- *
45
- * @param bool $classMapAuthoratative
46
- */
47
- public function setClassMapAuthoritative($classMapAuthoratative) {
48
- $this->classMapAuthoratative = $classMapAuthoratative;
49
- }
50
-
51
- /**
52
- * Should class lookup fail if not found in the current class map?
53
- *
54
- * @return bool
55
- */
56
- public function getClassMapAuthoratative() {
57
- return $this->classMapAuthoratative;
58
- }
59
-
60
- /**
61
- * @return array
62
- */
63
- public function getFallbackDirs() {
64
- return $this->fallbackDirs;
65
- }
66
-
67
- /**
68
- * @return array
69
- */
70
- public function getClassMap() {
71
- return $this->classMap;
72
- }
73
-
74
- /**
75
- * @param array $classMap class to filename map
76
- */
77
- public function addClassMap(array $classMap) {
78
- if ($this->classMap) {
79
- $this->classMap = array_merge($this->classMap, $classMap);
80
- }
81
- else {
82
- $this->classMap = $classMap;
83
- }
84
- }
85
-
86
- /**
87
- * Registers a set of classes, merging with any others previously set.
88
- *
89
- * @param string $prefix the classes prefix
90
- * @param array|string $paths the location(s) of the classes
91
- * @param bool $prepend prepend the location(s)
92
- */
93
- public function add($prefix, $paths, $prepend = false) {
94
- if (!$prefix) {
95
- if ($prepend) {
96
- $this->fallbackDirs = array_merge(
97
- (array) $paths,
98
- $this->fallbackDirs
99
- );
100
- }
101
- else {
102
- $this->fallbackDirs = array_merge(
103
- $this->fallbackDirs,
104
- (array) $paths
105
- );
106
- }
107
-
108
- return;
109
- }
110
-
111
- if (!isset($this->prefixes[$prefix])) {
112
- $this->prefixes[$prefix] = (array) $paths;
113
- return;
114
- }
115
-
116
- if ($prepend) {
117
- $this->prefixes[$prefix] = array_merge(
118
- (array) $paths,
119
- $this->prefixes[$prefix]
120
- );
121
- }
122
- else {
123
- $this->prefixes[$prefix] = array_merge(
124
- $this->prefixes[$prefix],
125
- (array) $paths
126
- );
127
- }
128
- }
129
-
130
- /**
131
- * Registers a set of classes, replacing any others previously set.
132
- *
133
- * @param string $prefix the classes prefix
134
- * @param array|string $paths the location(s) of the classes
135
- */
136
- public function set($prefix, $paths) {
137
- if (!$prefix) {
138
- $this->fallbackDirs = (array) $paths;
139
- return;
140
- }
141
-
142
- $this->prefixes[$prefix] = (array) $paths;
143
- }
144
-
145
- /**
146
- * Turns on searching the include path for class files.
147
- *
148
- * @param bool $useIncludePath
149
- */
150
- public function setUseIncludePath($useIncludePath) {
151
- $this->useIncludePath = $useIncludePath;
152
- }
153
-
154
- /**
155
- * Can be used to check if the autoloader uses the include path to check
156
- * for classes.
157
- *
158
- * @return bool
159
- */
160
- public function getUseIncludePath() {
161
- return $this->useIncludePath;
162
- }
163
-
164
- /**
165
- * Registers this instance as an autoloader.
166
- */
167
- public function register() {
168
- spl_autoload_register(array($this, 'loadClass'), true);
169
- }
170
-
171
- /**
172
- * Unregisters this instance as an autoloader.
173
- */
174
- public function unregister() {
175
- spl_autoload_unregister(array($this, 'loadClass'));
176
- }
177
-
178
- /**
179
- * Loads the given class or interface.
180
- *
181
- * @param string $class the name of the class
182
- * @return bool|null true, if loaded
183
- */
184
- public function loadClass($class) {
185
- if ($file = $this->findFile($class)) {
186
- include $file;
187
- return true;
188
- }
189
- }
190
-
191
- /**
192
- * Finds the path to the file where the class is defined.
193
- *
194
- * @param string $class the name of the class
195
- * @return string|null the path, if found
196
- */
197
- public function findFile($class) {
198
- if ('\\' === $class[0]) {
199
- $class = substr($class, 1);
200
- }
201
-
202
- if (isset($this->classMap[$class])) {
203
- return $this->classMap[$class];
204
- }
205
- elseif ($this->classMapAuthoratative) {
206
- return false;
207
- }
208
-
209
- $classPath = $this->getClassPath($class);
210
-
211
- foreach ($this->prefixes as $prefix => $dirs) {
212
- if (0 === strpos($class, $prefix)) {
213
- foreach ($dirs as $dir) {
214
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
- return $dir.DIRECTORY_SEPARATOR.$classPath;
216
- }
217
- }
218
- }
219
- }
220
-
221
- foreach ($this->fallbackDirs as $dir) {
222
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
- return $dir.DIRECTORY_SEPARATOR.$classPath;
224
- }
225
- }
226
-
227
- if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
- return $file;
229
- }
230
-
231
- return $this->classMap[$class] = false;
232
- }
233
-
234
- private function getClassPath($class) {
235
- if (false !== $pos = strrpos($class, '\\')) {
236
- // namespaced class name
237
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
- $className = substr($class, $pos + 1);
239
- }
240
- else {
241
- // PEAR-like class name
242
- $classPath = null;
243
- $className = $class;
244
- }
245
-
246
- $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
-
248
- // restore the prefix
249
- if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
- $className[0] = '_';
251
- }
252
-
253
- $classPath .= $className.'.php';
254
-
255
- return $classPath;
256
- }
257
-
258
- public static function resolveIncludePath($classPath) {
259
- $paths = explode(PATH_SEPARATOR, get_include_path());
260
-
261
- foreach ($paths as $path) {
262
- $path = rtrim($path, '/\\');
263
-
264
- if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
- return $file;
266
- }
267
- }
268
-
269
- return false;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
- *
5
- * This file is released under the terms of the MIT license. You can find the
6
- * complete text in the attached LICENSE file or online at:
7
- *
8
- * http://www.opensource.org/licenses/mit-license.php
9
- */
10
-
11
- namespace xrstf\Composer52;
12
-
13
- use Composer\Repository\CompositeRepository;
14
- use Composer\Script\Event;
15
-
16
- class Generator {
17
- public static function onPostInstallCmd(Event $event) {
18
- $composer = $event->getComposer();
19
- $installationManager = $composer->getInstallationManager();
20
- $repoManager = $composer->getRepositoryManager();
21
- $localRepo = $repoManager->getLocalRepository();
22
- $package = $composer->getPackage();
23
- $config = $composer->getConfig();
24
-
25
- // We can't gain access to the Command's input object, so we have to look
26
- // for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works
27
- // (always returns an empty array), nor does Symfony's Console Input, as
28
- // it expects a full definition of the current command line and we can't
29
- // provide that.
30
-
31
- $args = $_SERVER['argv'];
32
- $optimize = in_array('-o', $args) || in_array('--optimize-autoloader', $args) || in_array('--optimize', $args);
33
-
34
- $suffix = $config->get('autoloader-suffix');
35
-
36
- $generator = new AutoloadGenerator();
37
- $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix);
38
- }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
yoast-acf-analysis.php CHANGED
@@ -8,7 +8,7 @@
8
  * Plugin Name: ACF Content Analysis for Yoast SEO
9
  * Plugin URI: https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
10
  * Description: Ensure that Yoast SEO analyzes all Advanced Custom Fields 4 and 5 content including Flexible Content and Repeaters.
11
- * Version: 2.3.0
12
  * Author: Thomas Kräftner, ViktorFroberg, marol87, pekz0r, angrycreative, Team Yoast
13
  * Author URI: http://angrycreative.se
14
  * License: GPL v3
@@ -30,10 +30,6 @@ if ( ! defined( 'AC_SEO_ACF_ANALYSIS_PLUGIN_PATH' ) ) {
30
 
31
  $yoast_acf_autoload_file = '/vendor/autoload.php';
32
 
33
- if ( version_compare( PHP_VERSION, '5.3.2', '<' ) ) {
34
- $yoast_acf_autoload_file = '/vendor/autoload_52.php';
35
- }
36
-
37
  if ( is_file( AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file ) ) {
38
  require AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file;
39
  }
8
  * Plugin Name: ACF Content Analysis for Yoast SEO
9
  * Plugin URI: https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
10
  * Description: Ensure that Yoast SEO analyzes all Advanced Custom Fields 4 and 5 content including Flexible Content and Repeaters.
11
+ * Version: 2.4.0
12
  * Author: Thomas Kräftner, ViktorFroberg, marol87, pekz0r, angrycreative, Team Yoast
13
  * Author URI: http://angrycreative.se
14
  * License: GPL v3
30
 
31
  $yoast_acf_autoload_file = '/vendor/autoload.php';
32
 
 
 
 
 
33
  if ( is_file( AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file ) ) {
34
  require AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file;
35
  }