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

Yoast / wordpress-seo / 6987097851

25 Nov 2023 04:49AM UTC coverage: 49.206% (-0.1%) from 49.302%
6987097851

push

github

web-flow
Merge pull request #20878 from Yoast/JRF/ghactions-minor-tweak

GH Actions: update a few links in inline comments

15305 of 31104 relevant lines covered (49.21%)

4.03 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
                'publishing_principles_id',
65
                'ownership_funding_info_id',
66
                'actionable_feedback_policy_id',
67
                'corrections_policy_id',
68
                'ethics_policy_id',
69
                'diversity_policy_id',
70
                'diversity_staffing_report_id',
71
        ];
72

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

240
        /**
241
         * Returns the collection data.
242
         *
243
         * @return array The collection data.
244
         */
245
        public function get() {
×
246
                /**
247
                 * Filter: 'wpseo_tracking_settings_include_list' - Allow filtering the settings included in tracking.
248
                 *
249
                 * @api string $include_list the list with included setting names.
250
                 */
251
                $this->include_list = apply_filters( 'wpseo_tracking_settings_include_list', $this->include_list );
×
252

253
                $options = WPSEO_Options::get_all();
×
254
                // Returns the settings of which the keys intersect with the values of the include list.
255
                $options = array_intersect_key( $options, array_flip( $this->include_list ) );
×
256

257
                return [
258
                        'settings' => $this->anonymize_settings( $options ),
×
259
                ];
260
        }
261

262
        /**
263
         * Anonimizes the WPSEO_Options array by replacing all $anonymous_settings values to 'used'.
264
         *
265
         * @param array $settings The settings.
266
         *
267
         * @return array The anonymized settings.
268
         */
269
        private function anonymize_settings( $settings ) {
×
270
                foreach ( $this->anonymous_settings as $setting ) {
×
271
                        if ( ! empty( $settings[ $setting ] ) ) {
×
272
                                $settings[ $setting ] = 'used';
×
273
                        }
274
                }
275

276
                return $settings;
×
277
        }
278
}
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

© 2025 Coveralls, Inc