PluginProbe ʕ •ᴥ•ʔ
Independent Analytics – WordPress Analytics Plugin / 1.18
Independent Analytics – WordPress Analytics Plugin v1.18
2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 1.19.1 1.2 1.20.0 1.21.0 1.22.0 1.22.1 1.23.0 1.23.1 1.24.0 1.24.1 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.28.1 1.28.2 1.28.3 1.29.0 1.3 1.30.0 1.30.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0.0 2.0.1 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.10 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.13.1 2.13.2 2.13.5 2.13.6 2.14.0 2.14.1 2.14.2 2.14.4 2.14.6 2.14.7 2.14.8 2.14.9 2.2.0 2.2.1 2.3.1 2.3.2 2.4.2 2.4.3 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.1 2.7.2 2.7.3 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7
independent-analytics / IAWP / known_referrers.php
independent-analytics / IAWP Last commit date
Migrations 3 years ago ajax 3 years ago models 3 years ago queries 3 years ago sql 3 years ago tables 3 years ago utils 3 years ago campaign_builder.php 3 years ago capability_manager.php 3 years ago chart.php 3 years ago chart_geo.php 3 years ago chart_svg.php 3 years ago current_resource.php 3 years ago dashboard_options.php 3 years ago dashboard_widget.php 3 years ago email_reports.php 3 years ago filters.php 3 years ago freemius.php 3 years ago geo_database.php 3 years ago geo_database_download_job.php 3 years ago health_check.php 3 years ago independent_analytics.php 3 years ago known_referrers.php 3 years ago pdf.php 3 years ago query.php 3 years ago quick_stats.php 3 years ago real_time.php 3 years ago rest_api.php 3 years ago settings.php 3 years ago track_resource_changes.php 3 years ago view_counter.php 3 years ago
known_referrers.php
552 lines
1 <?php
2
3 namespace IAWP;
4
5 class Known_Referrers
6 {
7 private static $referrers = [
8 [
9 'name' => 'Google',
10 'type' => 'Search',
11 'domains' => [
12 'www.google.com',
13 'mail.google.com',
14 'www.google.ad',
15 'www.google.ae',
16 'www.google.com.af',
17 'www.google.com.ag',
18 'www.google.com.ai',
19 'www.google.al',
20 'www.google.am',
21 'www.google.co.ao',
22 'www.google.com.ar',
23 'www.google.as',
24 'www.google.at',
25 'www.google.com.au',
26 'www.google.az',
27 'www.google.ba',
28 'www.google.com.bd',
29 'www.google.be',
30 'www.google.bf',
31 'www.google.bg',
32 'www.google.com.bh',
33 'www.google.bi',
34 'www.google.bj',
35 'www.google.com.bn',
36 'www.google.com.bo',
37 'www.google.com.br',
38 'www.google.bs',
39 'www.google.bt',
40 'www.google.co.bw',
41 'www.google.by',
42 'www.google.com.bz',
43 'www.google.ca',
44 'www.google.cd',
45 'www.google.cf',
46 'www.google.cg',
47 'www.google.ch',
48 'www.google.ci',
49 'www.google.co.ck',
50 'www.google.cl',
51 'www.google.cm',
52 'www.google.cn',
53 'www.google.com.co',
54 'www.google.co.cr',
55 'www.google.com.cu',
56 'www.google.cv',
57 'www.google.com.cy',
58 'www.google.cz',
59 'www.google.de',
60 'www.google.dj',
61 'www.google.dk',
62 'www.google.dm',
63 'www.google.com.do',
64 'www.google.dz',
65 'www.google.com.ec',
66 'www.google.ee',
67 'www.google.com.eg',
68 'www.google.es',
69 'www.google.com.et',
70 'www.google.fi',
71 'www.google.com.fj',
72 'www.google.fm',
73 'www.google.fr',
74 'www.google.ga',
75 'www.google.ge',
76 'www.google.gg',
77 'www.google.com.gh',
78 'www.google.com.gi',
79 'www.google.gl',
80 'www.google.gm',
81 'www.google.gr',
82 'www.google.com.gt',
83 'www.google.gy',
84 'www.google.com.hk',
85 'www.google.hn',
86 'www.google.hr',
87 'www.google.ht',
88 'www.google.hu',
89 'www.google.co.id',
90 'www.google.ie',
91 'www.google.co.il',
92 'www.google.im',
93 'www.google.co.in',
94 'www.google.iq',
95 'www.google.is',
96 'www.google.it',
97 'www.google.je',
98 'www.google.com.jm',
99 'www.google.jo',
100 'www.google.co.jp',
101 'www.google.co.ke',
102 'www.google.com.kh',
103 'www.google.ki',
104 'www.google.kg',
105 'www.google.co.kr',
106 'www.google.com.kw',
107 'www.google.kz',
108 'www.google.la',
109 'www.google.com.lb',
110 'www.google.li',
111 'www.google.lk',
112 'www.google.co.ls',
113 'www.google.lt',
114 'www.google.lu',
115 'www.google.lv',
116 'www.google.com.ly',
117 'www.google.co.ma',
118 'www.google.md',
119 'www.google.me',
120 'www.google.mg',
121 'www.google.mk',
122 'www.google.ml',
123 'www.google.com.mm',
124 'www.google.mn',
125 'www.google.ms',
126 'www.google.com.mt',
127 'www.google.mu',
128 'www.google.mv',
129 'www.google.mw',
130 'www.google.com.mx',
131 'www.google.com.my',
132 'www.google.co.mz',
133 'www.google.com.na',
134 'www.google.com.ng',
135 'www.google.com.ni',
136 'www.google.ne',
137 'www.google.nl',
138 'www.google.no',
139 'www.google.com.np',
140 'www.google.nr',
141 'www.google.nu',
142 'www.google.co.nz',
143 'www.google.com.om',
144 'www.google.com.pa',
145 'www.google.com.pe',
146 'www.google.com.pg',
147 'www.google.com.ph',
148 'www.google.com.pk',
149 'www.google.pl',
150 'www.google.pn',
151 'www.google.com.pr',
152 'www.google.ps',
153 'www.google.pt',
154 'www.google.com.py',
155 'www.google.com.qa',
156 'www.google.ro',
157 'www.google.ru',
158 'www.google.rw',
159 'www.google.com.sa',
160 'www.google.com.sb',
161 'www.google.sc',
162 'www.google.se',
163 'www.google.com.sg',
164 'www.google.sh',
165 'www.google.si',
166 'www.google.sk',
167 'www.google.com.sl',
168 'www.google.sn',
169 'www.google.so',
170 'www.google.sm',
171 'www.google.sr',
172 'www.google.st',
173 'www.google.com.sv',
174 'www.google.td',
175 'www.google.tg',
176 'www.google.co.th',
177 'www.google.com.tj',
178 'www.google.tl',
179 'www.google.tm',
180 'www.google.tn',
181 'www.google.to',
182 'www.google.com.tr',
183 'www.google.tt',
184 'www.google.com.tw',
185 'www.google.co.tz',
186 'www.google.com.ua',
187 'www.google.co.ug',
188 'www.google.co.uk',
189 'www.google.com.uy',
190 'www.google.co.uz',
191 'www.google.com.vc',
192 'www.google.co.ve',
193 'www.google.vg',
194 'www.google.co.vi',
195 'www.google.com.vn',
196 'www.google.vu',
197 'www.google.ws',
198 'www.google.rs',
199 'www.google.co.za',
200 'www.google.co.zm',
201 'www.google.co.zw',
202 'www.google.cat',
203 'com.google.android.gm',
204 ],
205 ],
206 [
207 'name' => 'Yahoo',
208 'type' => 'Search',
209 'domains' => [
210 'search.yahoo.com',
211 'at.search.yahoo.com',
212 'be.search.yahoo.com',
213 'br.search.yahoo.com',
214 'ca.search.yahoo.com',
215 'ch.search.yahoo.com',
216 'de.search.yahoo.com',
217 'es.search.yahoo.com',
218 'espanol.search.yahoo.com',
219 'fi.search.yahoo.com',
220 'fr.search.yahoo.com',
221 'gr.search.yahoo.com',
222 'hk.search.yahoo.com',
223 'id.search.yahoo.com',
224 'ie.search.yahoo.com',
225 'il.search.yahoo.com',
226 'in.search.yahoo.com',
227 'it.search.yahoo.com',
228 'malaysia.search.yahoo.com',
229 'nl.search.yahoo.com',
230 'no.search.yahoo.com',
231 'ph.search.yahoo.com',
232 'pl.search.yahoo.com',
233 'qc.search.yahoo.com',
234 'r.search.yahoo.com',
235 'ro.search.yahoo.com',
236 'ru.search.yahoo.com',
237 'se.search.yahoo.com',
238 'sg.search.yahoo.com',
239 'tr.search.yahoo.com',
240 'tw.search.yahoo.com',
241 'ua.search.yahoo.com',
242 'uk.search.yahoo.com',
243 'vn.search.yahoo.com',
244 'za.search.yahoo.com',
245 'uk.search.yahoo.com',
246 ],
247 ],
248 [
249 'name' => 'Bing',
250 'type' => 'Search',
251 'domains' => [
252 'www.bing.com',
253 ],
254 ],
255 [
256 'name' => 'Yandex',
257 'type' => 'Search',
258 'domains' => [
259 'yandex.com',
260 'yandex.ru',
261 'yandex.ua',
262 'yandex.by',
263 'yandex.kz',
264 'yandex.uz',
265 'yandex.com.tr',
266 'yandex.fr',
267 'yandex.az',
268 'yandex.com.ge',
269 'yandex.com.am',
270 'yandex.co.il',
271 'yandex.lv',
272 'yandex.lt',
273 'yandex.ee',
274 'yandex.md',
275 'yandex.tm',
276 'yandex.tj',
277 ],
278 ],
279 [
280 'name' => 'DuckDuckGo',
281 'type' => 'Search',
282 'domains' => ['duckduckgo.com'],
283 ],
284 [
285 'name' => 'Ecosia',
286 'type' => 'Search',
287 'domains' => ['www.ecosia.org'],
288 ],
289 [
290 'name' => 'Qwant',
291 'type' => 'Search',
292 'domains' => ['www.qwant.com'],
293 ],
294 [
295 'name' => 'AlohaFind',
296 'type' => 'Search',
297 'domains' => ['alohafind.com'],
298 ],
299 [
300 'name' => 'Brave',
301 'type' => 'Search',
302 'domains' => ['search.brave.com'],
303 ],
304 [
305 'name' => 'Presearch',
306 'type' => 'Search',
307 'domains' => ['presearch.com'],
308 ],
309 [
310 'name' => 'Twitter',
311 'type' => 'Social',
312 'domains' => [
313 'twitter.com',
314 't.co',
315 ],
316 ],
317 [
318 'name' => 'Facebook',
319 'type' => 'Social',
320 'domains' => [
321 'www.facebook.com',
322 'm.facebook.com',
323 'lm.facebook.com',
324 'l.facebook.com',
325 ],
326 ],
327 [
328 'name' => 'Instagram',
329 'type' => 'Social',
330 'domains' => ['www.instagram.com'],
331 ],
332 [
333 'name' => 'TikTok',
334 'type' => 'Social',
335 'domains' => ['www.tiktok.com'],
336 ],
337 [
338 'name' => 'LinkedIn',
339 'type' => 'Social',
340 'domains' => [
341 'www.linkedin.com',
342 'com.linkedin.android',
343 ],
344 ],
345 [
346 'name' => 'Pinterest',
347 'type' => 'Social',
348 'domains' => ['www.pinterest.com'],
349 ],
350 [
351 'name' => 'YouTube',
352 'type' => 'Social',
353 'domains' => ['www.youtube.com'],
354 ],
355 [
356 'name' => 'ArtStation',
357 'type' => 'Social',
358 'domains' => ['www.artstation.com'],
359 ],
360 [
361 'name' => 'Bandcamp',
362 'type' => 'Social',
363 'domains' => ['bandcamp.com'],
364 ],
365 [
366 'name' => 'Behance',
367 'type' => 'Social',
368 'domains' => ['www.behance.net'],
369 ],
370 [
371 'name' => 'Bitbucket',
372 'type' => 'Social',
373 'domains' => ['bitbucket.org'],
374 ],
375 [
376 'name' => 'CodePen',
377 'type' => 'Social',
378 'domains' => ['codepen.io'],
379 ],
380 [
381 'name' => 'DeviantArt',
382 'type' => 'Social',
383 'domains' => ['www.deviantart.com'],
384 ],
385 [
386 'name' => 'Discord',
387 'type' => 'Social',
388 'domains' => ['discord.com'],
389 ],
390 [
391 'name' => 'Dribble',
392 'type' => 'Social',
393 'domains' => ['dribbble.com'],
394 ],
395 [
396 'name' => 'Flickr',
397 'type' => 'Social',
398 'domains' => ['flickr.com'],
399 ],
400 [
401 'name' => 'GitHub',
402 'type' => 'Social',
403 'domains' => ['gist.github.com', 'github.com'],
404 ],
405 [
406 'name' => 'Goodreads',
407 'type' => 'Social',
408 'domains' => ['www.goodreads.com'],
409 ],
410 [
411 'name' => 'Hacker News',
412 'type' => 'Social',
413 'domains' => ['news.ycombinator.com'],
414 ],
415 [
416 'name' => 'Meetup',
417 'type' => 'Social',
418 'domains' => ['www.meetup.com'],
419 ],
420 [
421 'name' => 'Mixcloud',
422 'type' => 'Social',
423 'domains' => ['www.mixcloud.com'],
424 ],
425 [
426 'name' => 'Patreon',
427 'type' => 'Social',
428 'domains' => ['www.patreon.com'],
429 ],
430 [
431 'name' => 'Quora',
432 'type' => 'Social',
433 'domains' => ['bn.quora.com', 'www.quora.com'],
434 ],
435 [
436 'name' => 'Tencent QQ',
437 'type' => 'Social',
438 'domains' => ['www.qq.com'],
439 ],
440 [
441 'name' => 'Ravelry',
442 'type' => 'Social',
443 'domains' => ['www.ravelry.com'],
444 ],
445 [
446 'name' => 'Reddit',
447 'type' => 'Social',
448 'domains' => ['out.reddit.com', 'www.reddit.com'],
449 ],
450 [
451 'name' => 'Slack',
452 'type' => 'Social',
453 'domains' => ['slack.com'],
454 ],
455 [
456 'name' => 'SlideShare',
457 'type' => 'Social',
458 'domains' => ['www.slideshare.net'],
459 ],
460 [
461 'name' => 'Snapchat',
462 'type' => 'Social',
463 'domains' => ['www.snapchat.com'],
464 ],
465 [
466 'name' => 'SoundCloud',
467 'type' => 'Social',
468 'domains' => ['soundcloud.com'],
469 ],
470 [
471 'name' => 'Stack Overflow',
472 'type' => 'Social',
473 'domains' => ['stackoverflow.com'],
474 ],
475 [
476 'name' => 'StumbleUpon',
477 'type' => 'Social',
478 'domains' => ['www.stumbleupon.com'],
479 ],
480 [
481 'name' => 'Telegram',
482 'type' => 'Social',
483 'domains' => ['telegram.org'],
484 ],
485 [
486 'name' => 'Weibo',
487 'type' => 'Social',
488 'domains' => ['weibo.com'],
489 ],
490 [
491 'name' => 'Tumblr',
492 'type' => 'Social',
493 'domains' => ['www.tumblr.com'],
494 ],
495 [
496 'name' => 'Twitch',
497 'type' => 'Social',
498 'domains' => ['www.twitch.tv'],
499 ],
500 [
501 'name' => 'Vimeo',
502 'type' => 'Social',
503 'domains' => ['vimeo.com'],
504 ],
505 [
506 'name' => 'WeChat',
507 'type' => 'Social',
508 'domains' => ['www.wechat.com'],
509 ],
510 [
511 'name' => 'WhatsApp',
512 'type' => 'Social',
513 'domains' => ['www.whatsapp.com'],
514 ],
515 [
516 'name' => 'Udemy',
517 'type' => 'Social',
518 'domains' => ['www.udemy.com'],
519 ],
520 [
521 'name' => '500px',
522 'type' => 'Social',
523 'domains' => ['500px.com'],
524 ],
525 ];
526
527 public static function referrers(): array
528 {
529 return self::$referrers;
530 }
531
532 public static function update_known_referrers_database()
533 {
534 global $wpdb;
535
536 $referrer_groups_table = Query::get_table_name(Query::REFERRER_GROUPS);
537 $known_referrers = self::referrers();
538
539 // Upsert predefined groups
540 foreach ($known_referrers as $group) {
541 foreach ($group['domains'] as $domain) {
542 $existing_domain = $wpdb->get_row($wpdb->prepare("SELECT * FROM $referrer_groups_table WHERE name = %s AND domain = %s AND domain_to_match = %s AND type = %s", $group['name'], $group['domains'][0], $domain, $group['type']));
543 $domain_not_found = is_null($existing_domain);
544
545 if ($domain_not_found) {
546 $wpdb->insert($referrer_groups_table, ['name' => $group['name'], 'domain' => $group['domains'][0], 'domain_to_match' => $domain, 'type' => $group['type']]);
547 }
548 }
549 }
550 }
551 }
552