• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 5118024680

pending completion
5118024680

push

github

mykola
Merge branch 'feature/html-parser' of github.com:Yoast/wordpress-seo into feature/html-parser

9582 of 23984 relevant lines covered (39.95%)

3.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/admin/tracking/class-tracking-settings-data.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin\Tracking
6
 */
7

8
/**
9
 * Collects anonymized settings data.
10
 */
11
class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
12

13
        /**
14
         * The options that need to be anonymized before they can be sent elsewhere.
15
         *
16
         * @var array All of the option_names which need to be
17
         * anonymized before they can be sent elsewhere.
18
         */
19
        private $anonymous_settings = [
20
                'baiduverify',
21
                'googleverify',
22
                'msverify',
23
                'yandexverify',
24
                'myyoast-oauth',
25
                'website_name',
26
                'alternate_website_name',
27
                'company_logo',
28
                'company_name',
29
                'company_alternate_name',
30
                'person_name',
31
                'person_logo',
32
                'person_logo_id',
33
                'company_logo_id',
34
                'facebook_site',
35
                'instagram_url',
36
                'linkedin_url',
37
                'myspace_url',
38
                'og_default_image',
39
                'og_default_image_id',
40
                'og_frontpage_title',
41
                'og_frontpage_desc',
42
                'og_frontpage_image',
43
                'og_frontpage_image_id',
44
                'open_graph_frontpage_title',
45
                'open_graph_frontpage_desc',
46
                'open_graph_frontpage_image',
47
                'open_graph_frontpage_image_id',
48
                'other_social_urls',
49
                'mastodon_url',
50
                'pinterest_url',
51
                'pinterestverify',
52
                'twitter_site',
53
                'youtube_url',
54
                'wikipedia_url',
55
                'semrush_tokens',
56
                'zapier_api_key',
57
                'wincher_tokens',
58
                'wincher_website_id',
59
                'least_readability_ignore_list',
60
                'least_seo_score_ignore_list',
61
                'most_linked_ignore_list',
62
                'least_linked_ignore_list',
63
                'indexables_page_reading_list',
64
        ];
65

66
        /**
67
         * The options we want to track.
68
         *
69
         * @var array The option_names for the options we want to track.
70
         */
71
        private $include_list = [
72
                'ms_defaults_set',
73
                'version',
74
                'disableadvanced_meta',
75
                'ryte_indexability',
76
                'baiduverify',
77
                'googleverify',
78
                'msverify',
79
                'yandexverify',
80
                'site_type',
81
                'has_multiple_authors',
82
                'environment_type',
83
                'content_analysis_active',
84
                'keyword_analysis_active',
85
                'inclusive_language_analysis_active',
86
                'enable_admin_bar_menu',
87
                'enable_cornerstone_content',
88
                'enable_xml_sitemap',
89
                'enable_text_link_counter',
90
                'show_onboarding_notice',
91
                'first_activated_on',
92
                'myyoast-oauth',
93
                'dynamic_permalinks',
94
                'website_name',
95
                'alternate_website_name',
96
                'company_logo',
97
                'company_name',
98
                'company_or_person',
99
                'person_name',
100
                'forcerewritetitle',
101
                'separator',
102
                'title-home-wpseo',
103
                'title-author-wpseo',
104
                'title-archive-wpseo',
105
                'title-search-wpseo',
106
                'title-404-wpseo',
107
                'metadesc-home-wpseo',
108
                'metadesc-author-wpseo',
109
                'metadesc-archive-wpseo',
110
                'rssbefore',
111
                'rssafter',
112
                'noindex-author-wpseo',
113
                'noindex-author-noposts-wpseo',
114
                'noindex-archive-wpseo',
115
                'disable-author',
116
                'disable-date',
117
                'disable-post_format',
118
                'disable-attachment',
119
                'breadcrumbs-404crumb',
120
                'breadcrumbs-display-blog-page',
121
                'breadcrumbs-boldlast',
122
                'breadcrumbs-archiveprefix',
123
                'breadcrumbs-enable',
124
                'breadcrumbs-home',
125
                'breadcrumbs-prefix',
126
                'breadcrumbs-searchprefix',
127
                'breadcrumbs-sep',
128
                'person_logo',
129
                'person_logo_id',
130
                'company_logo_id',
131
                'company_or_person_user_id',
132
                'stripcategorybase',
133
                'noindex-post',
134
                'display-metabox-pt-post',
135
                'noindex-page',
136
                'display-metabox-pt-page',
137
                'noindex-attachment',
138
                'display-metabox-pt-attachment',
139
                'display-metabox-tax-category',
140
                'noindex-tax-category',
141
                'display-metabox-tax-post_tag',
142
                'noindex-tax-post_tag',
143
                'display-metabox-tax-post_format',
144
                'noindex-tax-post_format',
145
                'taxonomy-category-ptparent',
146
                'taxonomy-post_tag-ptparent',
147
                'taxonomy-post_format-ptparent',
148
                'breadcrumbs-blog-remove',
149
                'hideeditbox-post',
150
                'hideeditbox-page',
151
                'hideeditbox-attachment',
152
                'hideeditbox-tax-category',
153
                'hideeditbox-tax-post_tag',
154
                'hideeditbox-tax-post_format',
155
                'facebook_site',
156
                'instagram_url',
157
                'linkedin_url',
158
                'myspace_url',
159
                'og_default_image',
160
                'og_default_image_id',
161
                'og_frontpage_title',
162
                'og_frontpage_desc',
163
                'og_frontpage_image',
164
                'og_frontpage_image_id',
165
                'open_graph_frontpage_title',
166
                'open_graph_frontpage_desc',
167
                'open_graph_frontpage_image',
168
                'open_graph_frontpage_image_id',
169
                'opengraph',
170
                'pinterest_url',
171
                'pinterestverify',
172
                'twitter',
173
                'twitter_site',
174
                'twitter_card_type',
175
                'youtube_url',
176
                'wikipedia_url',
177
                'mastodon_url',
178
                'indexables_indexing_completed',
179
                'semrush_integration_active',
180
                'semrush_tokens',
181
                'semrush_country_code',
182
                'enable_enhanced_slack_sharing',
183
                'zapier_integration_active',
184
                'zapier_api_key',
185
                'enable_metabox_insights',
186
                'enable_link_suggestions',
187
                'enable_index_now',
188
                'workouts',
189
                'wincher_integration_active',
190
                'wincher_tokens',
191
                'wincher_website_id',
192
                'wincher_automatically_add_keyphrases',
193
                'first_time_install',
194
                'other_social_urls',
195
                'remove_feed_global',
196
                'remove_feed_global_comments',
197
                'remove_feed_post_comments',
198
                'remove_feed_authors',
199
                'remove_feed_categories',
200
                'remove_feed_tags',
201
                'remove_feed_custom_taxonomies',
202
                'remove_feed_post_types',
203
                'remove_feed_search',
204
                'remove_atom_rdf_feeds',
205
                'remove_shortlinks',
206
                'remove_rest_api_links',
207
                'remove_rsd_wlw_links',
208
                'remove_oembed_links',
209
                'remove_generator',
210
                'remove_emoji_scripts',
211
                'remove_powered_by_header',
212
                'remove_pingback_header',
213
                'clean_campaign_tracking_urls',
214
                'clean_permalinks',
215
                'clean_permalinks_extra_variables',
216
                'search_cleanup',
217
                'search_cleanup_emoji',
218
                'search_cleanup_patterns',
219
                'search_character_limit',
220
                'redirect_search_pretty_urls',
221
                'wordproof_integration_active',
222
                'indexables_overview_state',
223
                'deny_search_crawling',
224
                'deny_wp_json_crawling',
225
                'deny_adsbot_crawling',
226
                'last_known_no_unindexed',
227
        ];
228

229
        /**
230
         * Returns the collection data.
231
         *
232
         * @return array The collection data.
233
         */
234
        public function get() {
235
                /**
236
                 * Filter: 'wpseo_tracking_settings_include_list' - Allow filtering the settings included in tracking.
237
                 *
238
                 * @api string $include_list the list with included setting names.
239
                 */
240
                $this->include_list = apply_filters( 'wpseo_tracking_settings_include_list', $this->include_list );
×
241

242
                $options = WPSEO_Options::get_all();
×
243
                // Returns the settings of which the keys intersect with the values of the include list.
244
                $options = array_intersect_key( $options, array_flip( $this->include_list ) );
×
245

246
                return [
×
247
                        'settings' => $this->anonymize_settings( $options ),
×
248
                ];
×
249
        }
250

251
        /**
252
         * Anonimizes the WPSEO_Options array by replacing all $anonymous_settings values to 'used'.
253
         *
254
         * @param array $settings The settings.
255
         *
256
         * @return array The anonymized settings.
257
         */
258
        private function anonymize_settings( $settings ) {
259
                foreach ( $this->anonymous_settings as $setting ) {
×
260
                        if ( ! empty( $settings[ $setting ] ) ) {
×
261
                                $settings[ $setting ] = 'used';
×
262
                        }
263
                }
264

265
                return $settings;
×
266
        }
267
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc