Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2036 / 2036
100.00% covered (success)
100.00%
9 / 9
CRAP
n/a
0 / 0
visitors_geoip_requirements
100.00% covered (success)
100.00%
25 / 25
100.00% covered (success)
100.00%
1 / 1
4
visitors_geoip_install
100.00% covered (success)
100.00%
46 / 46
100.00% covered (success)
100.00%
1 / 1
5
visitors_geoip_uninstall
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
visitors_geoip_update_8215
100.00% covered (success)
100.00%
62 / 62
100.00% covered (success)
100.00%
1 / 1
1
visitors_geoip_update_8217
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
3
visitors_geoip_update_8220
100.00% covered (success)
100.00%
1861 / 1861
100.00% covered (success)
100.00%
1 / 1
3
visitors_geoip_update_8222
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
3
visitors_geoip_update_8228
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
visitors_geoip_update_8229
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * @file
5 * Install/uninstall visitors geoip module.
6 */
7
8use Drupal\Core\Datetime\DrupalDateTime;
9
10/**
11 * Implements hook_requirements().
12 */
13function visitors_geoip_requirements($phase) {
14  $requirements = [];
15  switch ($phase) {
16
17    case 'runtime':
18      $service = \Drupal::service('visitors_geoip.lookup');
19      $meta = $service->metadata();
20      $requirements['visitors_geoip'] = [
21        'title' => t('Visitors GeoIP'),
22        'value' => '',
23      ];
24      if (!is_null($meta)) {
25        $requirements['visitors_geoip']['value'] .= t(
26          'Type: @database_type build: @buildEpoch',
27          [
28            '@database_type' => $meta->databaseType,
29            '@buildEpoch' => DrupalDateTime::createFromTimestamp($meta->buildEpoch),
30          ]
31        );
32        $requirements['visitors_geoip']['severity'] = REQUIREMENT_OK;
33      }
34      $has_extension = $service->hasExtension();
35      if (!$has_extension) {
36        $requirements['visitors_geoip']['value'] .= ' ' . t(
37          'The @extension_geoip PHP extension is not installed.',
38          ['@extension_geoip' => 'maxminddb']
39        );
40        $requirements['visitors_geoip']['severity'] = REQUIREMENT_WARNING;
41      }
42      break;
43  }
44  return $requirements;
45}
46
47/**
48 * Implements hook_install().
49 */
50function visitors_geoip_install() {
51  $schema = \Drupal::database()->schema();
52  $table = 'visitors';
53  if (!$schema->fieldExists($table, 'location_region')) {
54    $schema->addField(
55      'visitors',
56      'location_region',
57      [
58        'type' => 'varchar',
59        'length' => 128,
60        'not null' => TRUE,
61        'default' => '',
62      ]
63    );
64  }
65  if (!$schema->fieldExists($table, 'location_city')) {
66    $schema->addField(
67      'visitors',
68      'location_city',
69      [
70        'type' => 'varchar',
71        'length' => 128,
72        'not null' => TRUE,
73        'default' => '',
74      ]
75    );
76  }
77  if (!$schema->fieldExists($table, 'location_latitude')) {
78    $schema->addField(
79      'visitors',
80      'location_latitude',
81      [
82        'type' => 'numeric',
83        'precision' => 13,
84        'scale' => 10,
85        'default' => NULL,
86      ]
87    );
88  }
89  if (!$schema->fieldExists($table, 'location_longitude')) {
90    $schema->addField(
91      'visitors',
92      'location_longitude',
93      [
94        'type' => 'numeric',
95        'precision' => 13,
96        'scale' => 10,
97        'default' => NULL,
98      ]
99    );
100  }
101
102}
103
104/**
105 * Implements hook_uninstall().
106 */
107function visitors_geoip_uninstall() {
108  $table = 'visitors';
109  $schema = \Drupal::database()->schema();
110  $schema->dropField($table, 'location_region');
111  $schema->dropField($table, 'location_city');
112  $schema->dropField($table, 'location_latitude');
113  $schema->dropField($table, 'location_longitude');
114}
115
116/**
117 * GeoIP2 compatibility.
118 */
119function visitors_geoip_update_8215() {
120  $schema = \Drupal::database()->schema();
121  $schema->dropField('visitors', 'visitors_country_code3');
122  $schema->dropField('visitors', 'visitors_dma_code');
123  $schema->changeField('visitors', 'visitors_continent_code', 'location_continent_code', [
124    'type' => 'varchar',
125    'length' => 2,
126    'not null' => TRUE,
127    'default' => '',
128  ]
129  );
130  $schema->changeField('visitors', 'visitors_country_code', 'location_country_code', [
131    'type' => 'varchar',
132    'length' => 2,
133    'not null' => TRUE,
134    'default' => '',
135  ]
136  );
137  $schema->changeField('visitors', 'visitors_country_name', 'location_country_name', [
138    'type' => 'varchar',
139    'length' => 128,
140    'not null' => TRUE,
141    'default' => '',
142  ]
143  );
144  $schema->changeField('visitors', 'visitors_region', 'location_region', [
145    'type' => 'varchar',
146    'length' => 128,
147    'not null' => TRUE,
148    'default' => '',
149  ]
150  );
151  $schema->changeField('visitors', 'visitors_city', 'location_city', [
152    'type' => 'varchar',
153    'length' => 128,
154    'not null' => TRUE,
155    'default' => '',
156  ]
157  );
158  $schema->changeField('visitors', 'visitors_postal', 'location_postal', [
159    'type' => 'varchar',
160    'length' => 128,
161    'not null' => TRUE,
162    'default' => '',
163  ]
164  );
165  $schema->changeField('visitors', 'visitors_latitude', 'location_latitude', [
166    'type' => 'numeric',
167    'precision' => 13,
168    'scale' => 10,
169    'default' => NULL,
170  ]);
171  $schema->changeField('visitors', 'visitors_longitude', 'location_longitude', [
172    'type' => 'numeric',
173    'precision' => 13,
174    'scale' => 10,
175    'default' => NULL,
176  ]);
177  $schema->changeField('visitors', 'visitors_area_code', 'location_area_code', [
178    'type' => 'int',
179    'unsigned' => TRUE,
180    'default' => NULL,
181  ]);
182}
183
184/**
185 * GeoIP2 compatibility.
186 */
187function visitors_geoip_update_8217() {
188  $settings = \Drupal::service('config.factory')
189    ->getEditable('visitors_geoip.settings');
190  $settings->set('license', '');
191  $geoip_path = $settings->get('geoip_path');
192  if ($geoip_path == '') {
193    $settings->set('geoip_path', '../');
194  }
195  if (strpos($geoip_path, '.mmdb') !== FALSE) {
196    // Make the setting the directory, not the file.
197    $directory = \Drupal::service('file_system')->dirname($geoip_path);
198    $settings->set('geoip_path', $directory);
199  }
200  $settings->save();
201}
202
203/**
204 * Removes 'location_country_name' field.
205 */
206function visitors_geoip_update_8220() {
207  $table = 'visitors';
208  $schema = \Drupal::database()->schema();
209  if ($schema->fieldExists($table, 'location_country_name')) {
210    $schema->dropField($table, 'location_country_name');
211  }
212  if ($schema->fieldExists($table, 'location_postal')) {
213    $schema->changeField(
214      $table,
215      'location_postal',
216      'location_postal',
217      [
218        'type' => 'varchar',
219        'length' => 128,
220        'not null' => FALSE,
221        'default' => NULL,
222      ]
223    );
224  }
225  $visitors_geoip_view = [
226    'langcode' => 'en',
227    'status' => TRUE,
228    'dependencies' => [
229      'module' => [
230        0 => 'visitors',
231      ],
232      'enforced' => [
233        'module' => [
234          0 => 'visitors_geoip',
235        ],
236      ],
237    ],
238    'id' => 'visitors_geoip',
239    'label' => 'Visitors GeoIP',
240    'module' => 'views',
241    'description' => 'Region and City location reports.',
242    'tag' => '',
243    'base_table' => 'visitors',
244    'base_field' => '',
245    'display' => [
246      'default' => [
247        'id' => 'default',
248        'display_title' => 'Default',
249        'display_plugin' => 'default',
250        'position' => 0,
251        'display_options' => [
252          'fields' => [
253            'visitor_id' => [
254              'id' => 'visitor_id',
255              'table' => 'visitors',
256              'field' => 'visitor_id',
257              'relationship' => 'none',
258              'group_type' => 'count_distinct',
259              'admin_label' => '',
260              'plugin_id' => 'standard',
261              'label' => 'Unique visitors',
262              'exclude' => FALSE,
263              'alter' => [
264                'alter_text' => FALSE,
265                'text' => '',
266                'make_link' => FALSE,
267                'path' => '',
268                'absolute' => FALSE,
269                'external' => FALSE,
270                'replace_spaces' => FALSE,
271                'path_case' => 'none',
272                'trim_whitespace' => FALSE,
273                'alt' => '',
274                'rel' => '',
275                'link_class' => '',
276                'prefix' => '',
277                'suffix' => '',
278                'target' => '',
279                'nl2br' => FALSE,
280                'max_length' => 0,
281                'word_boundary' => TRUE,
282                'ellipsis' => TRUE,
283                'more_link' => FALSE,
284                'more_link_text' => '',
285                'more_link_path' => '',
286                'strip_tags' => FALSE,
287                'trim' => FALSE,
288                'preserve_tags' => '',
289                'html' => FALSE,
290              ],
291              'element_type' => '',
292              'element_class' => '',
293              'element_label_type' => '',
294              'element_label_class' => '',
295              'element_label_colon' => TRUE,
296              'element_wrapper_type' => '',
297              'element_wrapper_class' => '',
298              'element_default_classes' => TRUE,
299              'empty' => '',
300              'hide_empty' => FALSE,
301              'empty_zero' => FALSE,
302              'hide_alter_empty' => TRUE,
303              'set_precision' => FALSE,
304              'precision' => 0,
305              'decimal' => '.',
306              'separator' => ',',
307              'format_plural' => 0,
308              'format_plural_string' => '1
309  \x03
310  @count',
311              'prefix' => '',
312              'suffix' => '',
313            ],
314          ],
315          'pager' => [
316            'type' => 'mini',
317            'options' => [
318              'offset' => 0,
319              'items_per_page' => 10,
320              'total_pages' => NULL,
321              'id' => 0,
322              'tags' => [
323                'next' => '››',
324                'previous' => '‹‹',
325              ],
326              'expose' => [
327                'items_per_page' => FALSE,
328                'items_per_page_label' => 'Items per page',
329                'items_per_page_options' => '5, 10, 25, 50',
330                'items_per_page_options_all' => FALSE,
331                'items_per_page_options_all_label' => '- All -',
332                'offset' => FALSE,
333                'offset_label' => 'Offset',
334              ],
335            ],
336          ],
337          'exposed_form' => [
338            'type' => 'basic',
339            'options' => [
340              'submit_button' => 'Apply',
341              'reset_button' => FALSE,
342              'reset_button_label' => 'Reset',
343              'exposed_sorts_label' => 'Sort by',
344              'expose_sort_order' => TRUE,
345              'sort_asc_label' => 'Asc',
346              'sort_desc_label' => 'Desc',
347            ],
348          ],
349          'access' => [
350            'type' => 'none',
351            'options' => [],
352          ],
353          'cache' => [
354            'type' => 'tag',
355            'options' => [],
356          ],
357          'empty' => [],
358          'sorts' => [],
359          'arguments' => [],
360          'filters' => [
361            'bot' => [
362              'id' => 'bot',
363              'table' => 'visitors',
364              'field' => 'bot',
365              'relationship' => 'none',
366              'group_type' => 'group',
367              'admin_label' => '',
368              'plugin_id' => 'boolean',
369              'operator' => '!=',
370              'value' => '1',
371              'group' => 1,
372              'exposed' => FALSE,
373              'expose' => [
374                'operator_id' => '',
375                'label' => '',
376                'description' => '',
377                'use_operator' => FALSE,
378                'operator' => '',
379                'operator_limit_selection' => FALSE,
380                'operator_list' => [],
381                'identifier' => '',
382                'required' => FALSE,
383                'remember' => FALSE,
384                'multiple' => FALSE,
385                'remember_roles' => [
386                  'authenticated' => 'authenticated',
387                ],
388              ],
389              'is_grouped' => FALSE,
390              'group_info' => [
391                'label' => '',
392                'description' => '',
393                'identifier' => '',
394                'optional' => TRUE,
395                'widget' => 'select',
396                'multiple' => FALSE,
397                'remember' => FALSE,
398                'default_group' => 'All',
399                'default_group_multiple' => [],
400                'group_items' => [],
401              ],
402            ],
403            'visitors_date_time' => [
404              'id' => 'visitors_date_time',
405              'table' => 'visitors',
406              'field' => 'visitors_date_time',
407              'relationship' => 'none',
408              'group_type' => 'group',
409              'admin_label' => '',
410              'plugin_id' => 'visitors_date',
411              'operator' => 'between',
412              'value' => [
413                'min' => 'to',
414                'max' => 'from',
415                'value' => '',
416                'type' => 'global',
417              ],
418              'group' => 1,
419              'exposed' => FALSE,
420              'expose' => [
421                'operator_id' => '',
422                'label' => '',
423                'description' => '',
424                'use_operator' => FALSE,
425                'operator' => '',
426                'operator_limit_selection' => FALSE,
427                'operator_list' => [],
428                'identifier' => '',
429                'required' => FALSE,
430                'remember' => FALSE,
431                'multiple' => FALSE,
432                'remember_roles' => [
433                  'authenticated' => 'authenticated',
434                ],
435                'min_placeholder' => '',
436                'max_placeholder' => '',
437                'placeholder' => '',
438              ],
439              'is_grouped' => FALSE,
440              'group_info' => [
441                'label' => '',
442                'description' => '',
443                'identifier' => '',
444                'optional' => TRUE,
445                'widget' => 'select',
446                'multiple' => FALSE,
447                'remember' => FALSE,
448                'default_group' => 'All',
449                'default_group_multiple' => [],
450                'group_items' => [],
451              ],
452            ],
453          ],
454          'style' => [
455            'type' => 'table',
456            'options' => [
457              'grouping' => [],
458              'row_class' => '',
459              'default_row_class' => TRUE,
460              'columns' => [
461                'visitors_id' => 'visitors_id',
462                'visitors_url' => 'visitors_url',
463                'visitors_date_time' => 'visitors_date_time',
464                'visitor_id' => 'visitor_id',
465                'nothing' => 'nothing',
466              ],
467              'default' => '-1',
468              'info' => [
469                'visitors_id' => [
470                  'sortable' => FALSE,
471                  'default_sort_order' => 'asc',
472                  'align' => '',
473                  'separator' => '',
474                  'empty_column' => FALSE,
475                  'responsive' => '',
476                ],
477                'visitors_url' => [
478                  'sortable' => FALSE,
479                  'default_sort_order' => 'asc',
480                  'align' => '',
481                  'separator' => '',
482                  'empty_column' => FALSE,
483                  'responsive' => '',
484                ],
485                'visitors_date_time' => [
486                  'sortable' => FALSE,
487                  'default_sort_order' => 'asc',
488                  'align' => '',
489                  'separator' => '',
490                  'empty_column' => FALSE,
491                  'responsive' => '',
492                ],
493                'visitor_id' => [
494                  'sortable' => FALSE,
495                  'default_sort_order' => 'desc',
496                  'align' => '',
497                  'separator' => '',
498                  'empty_column' => FALSE,
499                  'responsive' => '',
500                ],
501                'nothing' => [
502                  'align' => '',
503                  'separator' => '',
504                  'empty_column' => FALSE,
505                  'responsive' => '',
506                ],
507              ],
508              'override' => TRUE,
509              'sticky' => FALSE,
510              'summary' => '',
511              'empty_table' => FALSE,
512              'caption' => '',
513              'description' => '',
514            ],
515          ],
516          'row' => [
517            'type' => 'fields',
518            'options' => [
519              'default_field_elements' => TRUE,
520              'inline' => [],
521              'separator' => '',
522              'hide_empty' => FALSE,
523            ],
524          ],
525          'query' => [
526            'type' => 'views_query',
527            'options' => [
528              'query_comment' => '',
529              'disable_sql_rewrite' => FALSE,
530              'distinct' => FALSE,
531              'replica' => FALSE,
532              'query_tags' => [],
533            ],
534          ],
535          'relationships' => [],
536          'group_by' => TRUE,
537          'header' => [],
538          'footer' => [],
539          'display_extenders' => [],
540        ],
541        'cache_metadata' => [
542          'max-age' => -1,
543          'contexts' => [
544            0 => 'languages:language_interface',
545            1 => 'url.query_args',
546          ],
547          'tags' => [],
548        ],
549      ],
550      'city_table' => [
551        'id' => 'city_table',
552        'display_title' => 'City',
553        'display_plugin' => 'embed',
554        'position' => 3,
555        'display_options' => [
556          'fields' => [
557            'location_country_2' => [
558              'id' => 'location_country_2',
559              'table' => 'visitors',
560              'field' => 'location_country',
561              'relationship' => 'none',
562              'group_type' => 'group',
563              'admin_label' => '',
564              'plugin_id' => 'visitors_country',
565              'label' => 'Abbreviation',
566              'exclude' => TRUE,
567              'alter' => [
568                'alter_text' => TRUE,
569                'text' => '{{ location_country_2|lower }}',
570                'make_link' => FALSE,
571                'path' => '',
572                'absolute' => FALSE,
573                'external' => FALSE,
574                'replace_spaces' => FALSE,
575                'path_case' => 'none',
576                'trim_whitespace' => FALSE,
577                'alt' => '',
578                'rel' => '',
579                'link_class' => '',
580                'prefix' => '',
581                'suffix' => '',
582                'target' => '',
583                'nl2br' => FALSE,
584                'max_length' => 0,
585                'word_boundary' => TRUE,
586                'ellipsis' => TRUE,
587                'more_link' => FALSE,
588                'more_link_text' => '',
589                'more_link_path' => '',
590                'strip_tags' => FALSE,
591                'trim' => FALSE,
592                'preserve_tags' => '',
593                'html' => FALSE,
594              ],
595              'element_type' => '',
596              'element_class' => '',
597              'element_label_type' => '',
598              'element_label_class' => '',
599              'element_label_colon' => TRUE,
600              'element_wrapper_type' => '',
601              'element_wrapper_class' => '',
602              'element_default_classes' => TRUE,
603              'empty' => '',
604              'hide_empty' => FALSE,
605              'empty_zero' => FALSE,
606              'hide_alter_empty' => TRUE,
607              'icon' => FALSE,
608              'text' => FALSE,
609              'abbreviation' => TRUE,
610            ],
611            'location_region' => [
612              'id' => 'location_region',
613              'table' => 'visitors',
614              'field' => 'location_region',
615              'relationship' => 'none',
616              'group_type' => 'group',
617              'admin_label' => '',
618              'plugin_id' => 'standard',
619              'label' => 'Region url',
620              'exclude' => TRUE,
621              'alter' => [
622                'alter_text' => FALSE,
623                'text' => '',
624                'make_link' => FALSE,
625                'path' => '',
626                'absolute' => FALSE,
627                'external' => FALSE,
628                'replace_spaces' => FALSE,
629                'path_case' => 'none',
630                'trim_whitespace' => FALSE,
631                'alt' => '',
632                'rel' => '',
633                'link_class' => '',
634                'prefix' => '',
635                'suffix' => '',
636                'target' => '',
637                'nl2br' => FALSE,
638                'max_length' => 0,
639                'word_boundary' => TRUE,
640                'ellipsis' => TRUE,
641                'more_link' => FALSE,
642                'more_link_text' => '',
643                'more_link_path' => '',
644                'strip_tags' => FALSE,
645                'trim' => FALSE,
646                'preserve_tags' => '',
647                'html' => FALSE,
648              ],
649              'element_type' => '',
650              'element_class' => '',
651              'element_label_type' => '',
652              'element_label_class' => '',
653              'element_label_colon' => TRUE,
654              'element_wrapper_type' => '',
655              'element_wrapper_class' => '',
656              'element_default_classes' => TRUE,
657              'empty' => '_none',
658              'hide_empty' => FALSE,
659              'empty_zero' => FALSE,
660              'hide_alter_empty' => TRUE,
661            ],
662            'location_city_1' => [
663              'id' => 'location_city_1',
664              'table' => 'visitors',
665              'field' => 'location_city',
666              'relationship' => 'none',
667              'group_type' => 'group',
668              'admin_label' => '',
669              'plugin_id' => 'standard',
670              'label' => 'City url',
671              'exclude' => TRUE,
672              'alter' => [
673                'alter_text' => FALSE,
674                'text' => '',
675                'make_link' => FALSE,
676                'path' => '',
677                'absolute' => FALSE,
678                'external' => FALSE,
679                'replace_spaces' => FALSE,
680                'path_case' => 'none',
681                'trim_whitespace' => FALSE,
682                'alt' => '',
683                'rel' => '',
684                'link_class' => '',
685                'prefix' => '',
686                'suffix' => '',
687                'target' => '',
688                'nl2br' => FALSE,
689                'max_length' => 0,
690                'word_boundary' => TRUE,
691                'ellipsis' => TRUE,
692                'more_link' => FALSE,
693                'more_link_text' => '',
694                'more_link_path' => '',
695                'strip_tags' => FALSE,
696                'trim' => FALSE,
697                'preserve_tags' => '',
698                'html' => FALSE,
699              ],
700              'element_type' => '',
701              'element_class' => '',
702              'element_label_type' => '',
703              'element_label_class' => '',
704              'element_label_colon' => TRUE,
705              'element_wrapper_type' => '',
706              'element_wrapper_class' => '',
707              'element_default_classes' => TRUE,
708              'empty' => '_none',
709              'hide_empty' => FALSE,
710              'empty_zero' => FALSE,
711              'hide_alter_empty' => TRUE,
712            ],
713            'location_city' => [
714              'id' => 'location_city',
715              'table' => 'visitors',
716              'field' => 'location_city',
717              'relationship' => 'none',
718              'group_type' => 'group',
719              'admin_label' => '',
720              'plugin_id' => 'standard',
721              'label' => 'City',
722              'exclude' => TRUE,
723              'alter' => [
724                'alter_text' => FALSE,
725                'text' => '',
726                'make_link' => FALSE,
727                'path' => '',
728                'absolute' => FALSE,
729                'external' => FALSE,
730                'replace_spaces' => FALSE,
731                'path_case' => 'none',
732                'trim_whitespace' => FALSE,
733                'alt' => '',
734                'rel' => '',
735                'link_class' => '',
736                'prefix' => '',
737                'suffix' => '',
738                'target' => '',
739                'nl2br' => FALSE,
740                'max_length' => 0,
741                'word_boundary' => TRUE,
742                'ellipsis' => TRUE,
743                'more_link' => FALSE,
744                'more_link_text' => '',
745                'more_link_path' => '',
746                'strip_tags' => FALSE,
747                'trim' => FALSE,
748                'preserve_tags' => '',
749                'html' => FALSE,
750              ],
751              'element_type' => '',
752              'element_class' => '',
753              'element_label_type' => '',
754              'element_label_class' => '',
755              'element_label_colon' => TRUE,
756              'element_wrapper_type' => '',
757              'element_wrapper_class' => '',
758              'element_default_classes' => TRUE,
759              'empty' => 'Unknown',
760              'hide_empty' => FALSE,
761              'empty_zero' => FALSE,
762              'hide_alter_empty' => TRUE,
763            ],
764            'location_country' => [
765              'id' => 'location_country',
766              'table' => 'visitors',
767              'field' => 'location_country',
768              'relationship' => 'none',
769              'group_type' => 'group',
770              'admin_label' => '',
771              'plugin_id' => 'visitors_country',
772              'label' => 'Country',
773              'exclude' => TRUE,
774              'alter' => [
775                'alter_text' => FALSE,
776                'text' => '',
777                'make_link' => FALSE,
778                'path' => '',
779                'absolute' => FALSE,
780                'external' => FALSE,
781                'replace_spaces' => FALSE,
782                'path_case' => 'none',
783                'trim_whitespace' => FALSE,
784                'alt' => '',
785                'rel' => '',
786                'link_class' => '',
787                'prefix' => '',
788                'suffix' => '',
789                'target' => '',
790                'nl2br' => FALSE,
791                'max_length' => 0,
792                'word_boundary' => TRUE,
793                'ellipsis' => TRUE,
794                'more_link' => FALSE,
795                'more_link_text' => '',
796                'more_link_path' => '',
797                'strip_tags' => FALSE,
798                'trim' => FALSE,
799                'preserve_tags' => '',
800                'html' => FALSE,
801              ],
802              'element_type' => '',
803              'element_class' => '',
804              'element_label_type' => '',
805              'element_label_class' => '',
806              'element_label_colon' => TRUE,
807              'element_wrapper_type' => '',
808              'element_wrapper_class' => '',
809              'element_default_classes' => TRUE,
810              'empty' => '',
811              'hide_empty' => FALSE,
812              'empty_zero' => FALSE,
813              'hide_alter_empty' => TRUE,
814              'icon' => TRUE,
815              'text' => FALSE,
816            ],
817            'location_country_1' => [
818              'id' => 'location_country_1',
819              'table' => 'visitors',
820              'field' => 'location_country',
821              'relationship' => 'none',
822              'group_type' => 'group',
823              'admin_label' => '',
824              'plugin_id' => 'visitors_country',
825              'label' => 'City',
826              'exclude' => FALSE,
827              'alter' => [
828                'alter_text' => TRUE,
829                'text' => '{{ location_country }} {{ location_city }}, {{ location_country_1 }}',
830                'make_link' => TRUE,
831                'path' => 'internal:/visitors/location/city/{{ location_country_2 }}/{{ location_region }}/{{ location_city_1 }}',
832                'absolute' => FALSE,
833                'external' => FALSE,
834                'replace_spaces' => FALSE,
835                'path_case' => 'none',
836                'trim_whitespace' => FALSE,
837                'alt' => '',
838                'rel' => '',
839                'link_class' => '',
840                'prefix' => '',
841                'suffix' => '',
842                'target' => '',
843                'nl2br' => FALSE,
844                'max_length' => 0,
845                'word_boundary' => TRUE,
846                'ellipsis' => TRUE,
847                'more_link' => FALSE,
848                'more_link_text' => '',
849                'more_link_path' => '',
850                'strip_tags' => FALSE,
851                'trim' => FALSE,
852                'preserve_tags' => '',
853                'html' => FALSE,
854              ],
855              'element_type' => '',
856              'element_class' => '',
857              'element_label_type' => '',
858              'element_label_class' => '',
859              'element_label_colon' => TRUE,
860              'element_wrapper_type' => '',
861              'element_wrapper_class' => '',
862              'element_default_classes' => TRUE,
863              'empty' => '',
864              'hide_empty' => FALSE,
865              'empty_zero' => FALSE,
866              'hide_alter_empty' => TRUE,
867              'icon' => FALSE,
868              'text' => TRUE,
869              'abbreviation' => FALSE,
870            ],
871            'visitor_id' => [
872              'id' => 'visitor_id',
873              'table' => 'visitors',
874              'field' => 'visitor_id',
875              'relationship' => 'none',
876              'group_type' => 'count_distinct',
877              'admin_label' => '',
878              'plugin_id' => 'standard',
879              'label' => 'Unique visitors',
880              'exclude' => FALSE,
881              'alter' => [
882                'alter_text' => FALSE,
883                'text' => '',
884                'make_link' => FALSE,
885                'path' => '',
886                'absolute' => FALSE,
887                'external' => FALSE,
888                'replace_spaces' => FALSE,
889                'path_case' => 'none',
890                'trim_whitespace' => FALSE,
891                'alt' => '',
892                'rel' => '',
893                'link_class' => '',
894                'prefix' => '',
895                'suffix' => '',
896                'target' => '',
897                'nl2br' => FALSE,
898                'max_length' => 0,
899                'word_boundary' => TRUE,
900                'ellipsis' => TRUE,
901                'more_link' => FALSE,
902                'more_link_text' => '',
903                'more_link_path' => '',
904                'strip_tags' => FALSE,
905                'trim' => FALSE,
906                'preserve_tags' => '',
907                'html' => FALSE,
908              ],
909              'element_type' => '',
910              'element_class' => '',
911              'element_label_type' => '',
912              'element_label_class' => '',
913              'element_label_colon' => TRUE,
914              'element_wrapper_type' => '',
915              'element_wrapper_class' => '',
916              'element_default_classes' => TRUE,
917              'empty' => '',
918              'hide_empty' => FALSE,
919              'empty_zero' => FALSE,
920              'hide_alter_empty' => TRUE,
921              'set_precision' => FALSE,
922              'precision' => 0,
923              'decimal' => '.',
924              'separator' => ',',
925              'format_plural' => 0,
926              'format_plural_string' => '1
927  \x03
928  @count',
929              'prefix' => '',
930              'suffix' => '',
931            ],
932          ],
933          'arguments' => [
934            'location_country' => [
935              'id' => 'location_country',
936              'table' => 'visitors',
937              'field' => 'location_country',
938              'relationship' => 'none',
939              'group_type' => 'group',
940              'admin_label' => '',
941              'plugin_id' => 'string',
942              'default_action' => 'ignore',
943              'exception' => [
944                'value' => 'all',
945                'title_enable' => FALSE,
946                'title' => 'All',
947              ],
948              'title_enable' => FALSE,
949              'title' => '',
950              'default_argument_type' => 'fixed',
951              'default_argument_options' => [
952                'argument' => '',
953              ],
954              'summary_options' => [
955                'base_path' => '',
956                'count' => TRUE,
957                'override' => FALSE,
958                'items_per_page' => 25,
959              ],
960              'summary' => [
961                'sort_order' => 'asc',
962                'number_of_records' => 0,
963                'format' => 'default_summary',
964              ],
965              'specify_validation' => FALSE,
966              'validate' => [
967                'type' => 'none',
968                'fail' => 'not found',
969              ],
970              'validate_options' => [],
971              'glossary' => FALSE,
972              'limit' => 0,
973              'case' => 'none',
974              'path_case' => 'none',
975              'transform_dash' => FALSE,
976              'break_phrase' => FALSE,
977            ],
978            'location_region' => [
979              'id' => 'location_region',
980              'table' => 'visitors',
981              'field' => 'location_region',
982              'relationship' => 'none',
983              'group_type' => 'group',
984              'admin_label' => '',
985              'plugin_id' => 'string',
986              'default_action' => 'ignore',
987              'exception' => [
988                'value' => 'all',
989                'title_enable' => FALSE,
990                'title' => 'All',
991              ],
992              'title_enable' => FALSE,
993              'title' => '',
994              'default_argument_type' => 'fixed',
995              'default_argument_options' => [
996                'argument' => '',
997              ],
998              'summary_options' => [
999                'base_path' => '',
1000                'count' => TRUE,
1001                'override' => FALSE,
1002                'items_per_page' => 25,
1003              ],
1004              'summary' => [
1005                'sort_order' => 'asc',
1006                'number_of_records' => 0,
1007                'format' => 'default_summary',
1008              ],
1009              'specify_validation' => FALSE,
1010              'validate' => [
1011                'type' => 'none',
1012                'fail' => 'not found',
1013              ],
1014              'validate_options' => [],
1015              'glossary' => FALSE,
1016              'limit' => 0,
1017              'case' => 'none',
1018              'path_case' => 'none',
1019              'transform_dash' => FALSE,
1020              'break_phrase' => FALSE,
1021            ],
1022          ],
1023          'defaults' => [
1024            'fields' => FALSE,
1025            'arguments' => FALSE,
1026          ],
1027          'display_description' => '',
1028          'display_extenders' => [],
1029        ],
1030        'cache_metadata' => [
1031          'max-age' => -1,
1032          'contexts' => [
1033            0 => 'languages:language_interface',
1034            1 => 'url',
1035            2 => 'url.query_args',
1036          ],
1037          'tags' => [],
1038        ],
1039      ],
1040      'recent_view_table' => [
1041        'id' => 'recent_view_table',
1042        'display_title' => 'Recent Views',
1043        'display_plugin' => 'embed',
1044        'position' => 3,
1045        'display_options' => [
1046          'fields' => [
1047            'visitors_id' => [
1048              'id' => 'visitors_id',
1049              'table' => 'visitors',
1050              'field' => 'visitors_id',
1051              'relationship' => 'none',
1052              'group_type' => 'group',
1053              'admin_label' => '',
1054              'plugin_id' => 'numeric',
1055              'label' => 'Visitors ID',
1056              'exclude' => TRUE,
1057              'alter' => [
1058                'alter_text' => FALSE,
1059                'text' => '',
1060                'make_link' => FALSE,
1061                'path' => '',
1062                'absolute' => FALSE,
1063                'external' => FALSE,
1064                'replace_spaces' => FALSE,
1065                'path_case' => 'none',
1066                'trim_whitespace' => FALSE,
1067                'alt' => '',
1068                'rel' => '',
1069                'link_class' => '',
1070                'prefix' => '',
1071                'suffix' => '',
1072                'target' => '',
1073                'nl2br' => FALSE,
1074                'max_length' => 0,
1075                'word_boundary' => TRUE,
1076                'ellipsis' => TRUE,
1077                'more_link' => FALSE,
1078                'more_link_text' => '',
1079                'more_link_path' => '',
1080                'strip_tags' => FALSE,
1081                'trim' => FALSE,
1082                'preserve_tags' => '',
1083                'html' => FALSE,
1084              ],
1085              'element_type' => '',
1086              'element_class' => '',
1087              'element_label_type' => '',
1088              'element_label_class' => '',
1089              'element_label_colon' => TRUE,
1090              'element_wrapper_type' => '',
1091              'element_wrapper_class' => '',
1092              'element_default_classes' => TRUE,
1093              'empty' => '',
1094              'hide_empty' => FALSE,
1095              'empty_zero' => FALSE,
1096              'hide_alter_empty' => TRUE,
1097              'set_precision' => FALSE,
1098              'precision' => 0,
1099              'decimal' => '.',
1100              'separator' => ',',
1101              'format_plural' => FALSE,
1102              'format_plural_string' => '1
1103  \x03
1104  @count',
1105              'prefix' => '',
1106              'suffix' => '',
1107            ],
1108            'visitors_url' => [
1109              'id' => 'visitors_url',
1110              'table' => 'visitors',
1111              'field' => 'visitors_url',
1112              'relationship' => 'none',
1113              'group_type' => 'group',
1114              'admin_label' => '',
1115              'plugin_id' => 'standard',
1116              'label' => 'URL',
1117              'exclude' => FALSE,
1118              'alter' => [
1119                'alter_text' => FALSE,
1120                'text' => '',
1121                'make_link' => FALSE,
1122                'path' => '',
1123                'absolute' => FALSE,
1124                'external' => FALSE,
1125                'replace_spaces' => FALSE,
1126                'path_case' => 'none',
1127                'trim_whitespace' => FALSE,
1128                'alt' => '',
1129                'rel' => '',
1130                'link_class' => '',
1131                'prefix' => '',
1132                'suffix' => '',
1133                'target' => '',
1134                'nl2br' => FALSE,
1135                'max_length' => 0,
1136                'word_boundary' => TRUE,
1137                'ellipsis' => TRUE,
1138                'more_link' => FALSE,
1139                'more_link_text' => '',
1140                'more_link_path' => '',
1141                'strip_tags' => FALSE,
1142                'trim' => FALSE,
1143                'preserve_tags' => '',
1144                'html' => FALSE,
1145              ],
1146              'element_type' => '',
1147              'element_class' => '',
1148              'element_label_type' => '',
1149              'element_label_class' => '',
1150              'element_label_colon' => TRUE,
1151              'element_wrapper_type' => '',
1152              'element_wrapper_class' => '',
1153              'element_default_classes' => TRUE,
1154              'empty' => '',
1155              'hide_empty' => FALSE,
1156              'empty_zero' => FALSE,
1157              'hide_alter_empty' => TRUE,
1158            ],
1159            'visitors_date_time' => [
1160              'id' => 'visitors_date_time',
1161              'table' => 'visitors',
1162              'field' => 'visitors_date_time',
1163              'relationship' => 'none',
1164              'group_type' => 'group',
1165              'admin_label' => '',
1166              'plugin_id' => 'date',
1167              'label' => 'Date Time',
1168              'exclude' => FALSE,
1169              'alter' => [
1170                'alter_text' => FALSE,
1171                'text' => '',
1172                'make_link' => FALSE,
1173                'path' => '',
1174                'absolute' => FALSE,
1175                'external' => FALSE,
1176                'replace_spaces' => FALSE,
1177                'path_case' => 'none',
1178                'trim_whitespace' => FALSE,
1179                'alt' => '',
1180                'rel' => '',
1181                'link_class' => '',
1182                'prefix' => '',
1183                'suffix' => '',
1184                'target' => '',
1185                'nl2br' => FALSE,
1186                'max_length' => 0,
1187                'word_boundary' => TRUE,
1188                'ellipsis' => TRUE,
1189                'more_link' => FALSE,
1190                'more_link_text' => '',
1191                'more_link_path' => '',
1192                'strip_tags' => FALSE,
1193                'trim' => FALSE,
1194                'preserve_tags' => '',
1195                'html' => FALSE,
1196              ],
1197              'element_type' => '',
1198              'element_class' => '',
1199              'element_label_type' => '',
1200              'element_label_class' => '',
1201              'element_label_colon' => TRUE,
1202              'element_wrapper_type' => '',
1203              'element_wrapper_class' => '',
1204              'element_default_classes' => TRUE,
1205              'empty' => '',
1206              'hide_empty' => FALSE,
1207              'empty_zero' => FALSE,
1208              'hide_alter_empty' => TRUE,
1209              'date_format' => 'short',
1210              'custom_date_format' => '',
1211              'timezone' => '',
1212            ],
1213            'visitor_id' => [
1214              'id' => 'visitor_id',
1215              'table' => 'visitors',
1216              'field' => 'visitor_id',
1217              'relationship' => 'none',
1218              'group_type' => 'group',
1219              'admin_label' => '',
1220              'plugin_id' => 'standard',
1221              'label' => 'Visitor',
1222              'exclude' => FALSE,
1223              'alter' => [
1224                'alter_text' => FALSE,
1225                'text' => '',
1226                'make_link' => FALSE,
1227                'path' => '',
1228                'absolute' => FALSE,
1229                'external' => FALSE,
1230                'replace_spaces' => FALSE,
1231                'path_case' => 'none',
1232                'trim_whitespace' => FALSE,
1233                'alt' => '',
1234                'rel' => '',
1235                'link_class' => '',
1236                'prefix' => '',
1237                'suffix' => '',
1238                'target' => '',
1239                'nl2br' => FALSE,
1240                'max_length' => 0,
1241                'word_boundary' => TRUE,
1242                'ellipsis' => TRUE,
1243                'more_link' => FALSE,
1244                'more_link_text' => '',
1245                'more_link_path' => '',
1246                'strip_tags' => FALSE,
1247                'trim' => FALSE,
1248                'preserve_tags' => '',
1249                'html' => FALSE,
1250              ],
1251              'element_type' => '',
1252              'element_class' => '',
1253              'element_label_type' => '',
1254              'element_label_class' => '',
1255              'element_label_colon' => TRUE,
1256              'element_wrapper_type' => '',
1257              'element_wrapper_class' => '',
1258              'element_default_classes' => TRUE,
1259              'empty' => '',
1260              'hide_empty' => FALSE,
1261              'empty_zero' => FALSE,
1262              'hide_alter_empty' => TRUE,
1263            ],
1264            'nothing' => [
1265              'id' => 'nothing',
1266              'table' => 'views',
1267              'field' => 'nothing',
1268              'relationship' => 'none',
1269              'group_type' => 'group',
1270              'admin_label' => '',
1271              'plugin_id' => 'custom',
1272              'label' => 'Operations',
1273              'exclude' => FALSE,
1274              'alter' => [
1275                'alter_text' => TRUE,
1276                'text' => 'details',
1277                'make_link' => TRUE,
1278                'path' => 'internal:/visitors/hits/{{ visitors_id }}',
1279                'absolute' => FALSE,
1280                'external' => FALSE,
1281                'replace_spaces' => FALSE,
1282                'path_case' => 'none',
1283                'trim_whitespace' => FALSE,
1284                'alt' => '',
1285                'rel' => '',
1286                'link_class' => '',
1287                'prefix' => '',
1288                'suffix' => '',
1289                'target' => '',
1290                'nl2br' => FALSE,
1291                'max_length' => 0,
1292                'word_boundary' => TRUE,
1293                'ellipsis' => TRUE,
1294                'more_link' => FALSE,
1295                'more_link_text' => '',
1296                'more_link_path' => '',
1297                'strip_tags' => FALSE,
1298                'trim' => FALSE,
1299                'preserve_tags' => '',
1300                'html' => FALSE,
1301              ],
1302              'element_type' => '',
1303              'element_class' => '',
1304              'element_label_type' => '',
1305              'element_label_class' => '',
1306              'element_label_colon' => TRUE,
1307              'element_wrapper_type' => '',
1308              'element_wrapper_class' => '',
1309              'element_default_classes' => TRUE,
1310              'empty' => '',
1311              'hide_empty' => FALSE,
1312              'empty_zero' => FALSE,
1313              'hide_alter_empty' => FALSE,
1314            ],
1315          ],
1316          'pager' => [
1317            'type' => 'full',
1318            'options' => [
1319              'offset' => 0,
1320              'items_per_page' => 10,
1321              'total_pages' => NULL,
1322              'id' => 0,
1323              'tags' => [
1324                'next' => '››',
1325                'previous' => '‹‹',
1326                'first' => '« First',
1327                'last' => 'Last Â»',
1328              ],
1329              'expose' => [
1330                'items_per_page' => FALSE,
1331                'items_per_page_label' => 'Items per page',
1332                'items_per_page_options' => '5, 10, 25, 50',
1333                'items_per_page_options_all' => FALSE,
1334                'items_per_page_options_all_label' => '- All -',
1335                'offset' => FALSE,
1336                'offset_label' => 'Offset',
1337              ],
1338              'quantity' => 9,
1339            ],
1340          ],
1341          'sorts' => [
1342            'visitors_id' => [
1343              'id' => 'visitors_id',
1344              'table' => 'visitors',
1345              'field' => 'visitors_id',
1346              'relationship' => 'none',
1347              'group_type' => 'group',
1348              'admin_label' => '',
1349              'plugin_id' => 'standard',
1350              'order' => 'DESC',
1351              'expose' => [
1352                'label' => '',
1353                'field_identifier' => '',
1354              ],
1355              'exposed' => FALSE,
1356            ],
1357          ],
1358          'arguments' => [
1359            'location_country' => [
1360              'id' => 'location_country',
1361              'table' => 'visitors',
1362              'field' => 'location_country',
1363              'relationship' => 'none',
1364              'group_type' => 'group',
1365              'admin_label' => '',
1366              'plugin_id' => 'string',
1367              'default_action' => 'ignore',
1368              'exception' => [
1369                'value' => 'all',
1370                'title_enable' => FALSE,
1371                'title' => 'All',
1372              ],
1373              'title_enable' => FALSE,
1374              'title' => '',
1375              'default_argument_type' => 'fixed',
1376              'default_argument_options' => [
1377                'argument' => '',
1378              ],
1379              'summary_options' => [
1380                'base_path' => '',
1381                'count' => TRUE,
1382                'override' => FALSE,
1383                'items_per_page' => 25,
1384              ],
1385              'summary' => [
1386                'sort_order' => 'asc',
1387                'number_of_records' => 0,
1388                'format' => 'default_summary',
1389              ],
1390              'specify_validation' => FALSE,
1391              'validate' => [
1392                'type' => 'none',
1393                'fail' => 'not found',
1394              ],
1395              'validate_options' => [],
1396              'glossary' => FALSE,
1397              'limit' => 0,
1398              'case' => 'lower',
1399              'path_case' => 'none',
1400              'transform_dash' => FALSE,
1401              'break_phrase' => FALSE,
1402            ],
1403            'location_region' => [
1404              'id' => 'location_region',
1405              'table' => 'visitors',
1406              'field' => 'location_region',
1407              'relationship' => 'none',
1408              'group_type' => 'group',
1409              'admin_label' => '',
1410              'plugin_id' => 'string',
1411              'default_action' => 'ignore',
1412              'exception' => [
1413                'value' => 'all',
1414                'title_enable' => FALSE,
1415                'title' => 'All',
1416              ],
1417              'title_enable' => FALSE,
1418              'title' => '',
1419              'default_argument_type' => 'fixed',
1420              'default_argument_options' => [
1421                'argument' => '',
1422              ],
1423              'summary_options' => [
1424                'base_path' => '',
1425                'count' => TRUE,
1426                'override' => FALSE,
1427                'items_per_page' => 25,
1428              ],
1429              'summary' => [
1430                'sort_order' => 'asc',
1431                'number_of_records' => 0,
1432                'format' => 'default_summary',
1433              ],
1434              'specify_validation' => FALSE,
1435              'validate' => [
1436                'type' => 'none',
1437                'fail' => 'not found',
1438              ],
1439              'validate_options' => [],
1440              'glossary' => FALSE,
1441              'limit' => 0,
1442              'case' => 'none',
1443              'path_case' => 'none',
1444              'transform_dash' => FALSE,
1445              'break_phrase' => FALSE,
1446            ],
1447            'location_city' => [
1448              'id' => 'location_city',
1449              'table' => 'visitors',
1450              'field' => 'location_city',
1451              'relationship' => 'none',
1452              'group_type' => 'group',
1453              'admin_label' => '',
1454              'plugin_id' => 'string',
1455              'default_action' => 'ignore',
1456              'exception' => [
1457                'value' => 'all',
1458                'title_enable' => FALSE,
1459                'title' => 'All',
1460              ],
1461              'title_enable' => FALSE,
1462              'title' => '',
1463              'default_argument_type' => 'fixed',
1464              'default_argument_options' => [
1465                'argument' => '',
1466              ],
1467              'summary_options' => [
1468                'base_path' => '',
1469                'count' => TRUE,
1470                'override' => FALSE,
1471                'items_per_page' => 25,
1472              ],
1473              'summary' => [
1474                'sort_order' => 'asc',
1475                'number_of_records' => 0,
1476                'format' => 'default_summary',
1477              ],
1478              'specify_validation' => FALSE,
1479              'validate' => [
1480                'type' => 'none',
1481                'fail' => 'not found',
1482              ],
1483              'validate_options' => [],
1484              'glossary' => FALSE,
1485              'limit' => 0,
1486              'case' => 'none',
1487              'path_case' => 'none',
1488              'transform_dash' => FALSE,
1489              'break_phrase' => FALSE,
1490            ],
1491          ],
1492          'filters' => [
1493            'bot' => [
1494              'id' => 'bot',
1495              'table' => 'visitors',
1496              'field' => 'bot',
1497              'relationship' => 'none',
1498              'group_type' => 'group',
1499              'admin_label' => '',
1500              'plugin_id' => 'boolean',
1501              'operator' => '!=',
1502              'value' => '1',
1503              'group' => 1,
1504              'exposed' => FALSE,
1505              'expose' => [
1506                'operator_id' => '',
1507                'label' => '',
1508                'description' => '',
1509                'use_operator' => FALSE,
1510                'operator' => '',
1511                'operator_limit_selection' => FALSE,
1512                'operator_list' => [],
1513                'identifier' => '',
1514                'required' => FALSE,
1515                'remember' => FALSE,
1516                'multiple' => FALSE,
1517                'remember_roles' => [
1518                  'authenticated' => 'authenticated',
1519                ],
1520              ],
1521              'is_grouped' => FALSE,
1522              'group_info' => [
1523                'label' => '',
1524                'description' => '',
1525                'identifier' => '',
1526                'optional' => TRUE,
1527                'widget' => 'select',
1528                'multiple' => FALSE,
1529                'remember' => FALSE,
1530                'default_group' => 'All',
1531                'default_group_multiple' => [],
1532                'group_items' => [],
1533              ],
1534            ],
1535            'visitors_date_time' => [
1536              'id' => 'visitors_date_time',
1537              'table' => 'visitors',
1538              'field' => 'visitors_date_time',
1539              'relationship' => 'none',
1540              'group_type' => 'group',
1541              'admin_label' => '',
1542              'plugin_id' => 'visitors_date',
1543              'operator' => 'between',
1544              'value' => [
1545                'min' => 'to',
1546                'max' => 'from',
1547                'value' => '',
1548                'type' => 'global',
1549              ],
1550              'group' => 1,
1551              'exposed' => FALSE,
1552              'expose' => [
1553                'operator_id' => '',
1554                'label' => '',
1555                'description' => '',
1556                'use_operator' => FALSE,
1557                'operator' => '',
1558                'operator_limit_selection' => FALSE,
1559                'operator_list' => [],
1560                'identifier' => '',
1561                'required' => FALSE,
1562                'remember' => FALSE,
1563                'multiple' => FALSE,
1564                'remember_roles' => [
1565                  'authenticated' => 'authenticated',
1566                ],
1567                'min_placeholder' => '',
1568                'max_placeholder' => '',
1569                'placeholder' => '',
1570              ],
1571              'is_grouped' => FALSE,
1572              'group_info' => [
1573                'label' => '',
1574                'description' => '',
1575                'identifier' => '',
1576                'optional' => TRUE,
1577                'widget' => 'select',
1578                'multiple' => FALSE,
1579                'remember' => FALSE,
1580                'default_group' => 'All',
1581                'default_group_multiple' => [],
1582                'group_items' => [],
1583              ],
1584            ],
1585            'visitors_path' => [
1586              'id' => 'visitors_path',
1587              'table' => 'visitors',
1588              'field' => 'visitors_path',
1589              'relationship' => 'none',
1590              'group_type' => 'group',
1591              'admin_label' => '',
1592              'plugin_id' => 'string',
1593              'operator' => 'starts',
1594              'value' => '',
1595              'group' => 1,
1596              'exposed' => TRUE,
1597              'expose' => [
1598                'operator_id' => 'visitors_path_op',
1599                'label' => 'Path',
1600                'description' => '',
1601                'use_operator' => FALSE,
1602                'operator' => 'visitors_path_op',
1603                'operator_limit_selection' => FALSE,
1604                'operator_list' => [],
1605                'identifier' => 'visitors_path',
1606                'required' => FALSE,
1607                'remember' => FALSE,
1608                'multiple' => FALSE,
1609                'remember_roles' => [
1610                  'authenticated' => 'authenticated',
1611                  'anonymous' => '0',
1612                  'content_editor' => '0',
1613                  'administrator' => '0',
1614                ],
1615                'placeholder' => '',
1616              ],
1617              'is_grouped' => FALSE,
1618              'group_info' => [
1619                'label' => '',
1620                'description' => '',
1621                'identifier' => '',
1622                'optional' => TRUE,
1623                'widget' => 'select',
1624                'multiple' => FALSE,
1625                'remember' => FALSE,
1626                'default_group' => 'All',
1627                'default_group_multiple' => [],
1628                'group_items' => [],
1629              ],
1630            ],
1631          ],
1632          'filter_groups' => [
1633            'operator' => 'AND',
1634            'groups' => [
1635              1 => 'AND',
1636            ],
1637          ],
1638          'defaults' => [
1639            'pager' => FALSE,
1640            'group_by' => FALSE,
1641            'fields' => FALSE,
1642            'sorts' => FALSE,
1643            'arguments' => FALSE,
1644            'filters' => FALSE,
1645            'filter_groups' => FALSE,
1646            'header' => FALSE,
1647          ],
1648          'group_by' => FALSE,
1649          'display_description' => '',
1650          'header' => [
1651            'result' => [
1652              'id' => 'result',
1653              'table' => 'views',
1654              'field' => 'result',
1655              'relationship' => 'none',
1656              'group_type' => 'group',
1657              'admin_label' => '',
1658              'plugin_id' => 'result',
1659              'empty' => FALSE,
1660              'content' => 'Displaying @start - @end of @total',
1661            ],
1662          ],
1663          'display_extenders' => [],
1664        ],
1665        'cache_metadata' => [
1666          'max-age' => -1,
1667          'contexts' => [
1668            0 => 'languages:language_interface',
1669            1 => 'url',
1670            2 => 'url.query_args',
1671          ],
1672          'tags' => [],
1673        ],
1674      ],
1675      'region_table' => [
1676        'id' => 'region_table',
1677        'display_title' => 'Region',
1678        'display_plugin' => 'embed',
1679        'position' => 2,
1680        'display_options' => [
1681          'fields' => [
1682            'location_region_1' => [
1683              'id' => 'location_region_1',
1684              'table' => 'visitors',
1685              'field' => 'location_region',
1686              'relationship' => 'none',
1687              'group_type' => 'group',
1688              'admin_label' => '',
1689              'plugin_id' => 'standard',
1690              'label' => 'Region link',
1691              'exclude' => TRUE,
1692              'alter' => [
1693                'alter_text' => FALSE,
1694                'text' => '',
1695                'make_link' => FALSE,
1696                'path' => '',
1697                'absolute' => FALSE,
1698                'external' => FALSE,
1699                'replace_spaces' => FALSE,
1700                'path_case' => 'none',
1701                'trim_whitespace' => FALSE,
1702                'alt' => '',
1703                'rel' => '',
1704                'link_class' => '',
1705                'prefix' => '',
1706                'suffix' => '',
1707                'target' => '',
1708                'nl2br' => FALSE,
1709                'max_length' => 0,
1710                'word_boundary' => TRUE,
1711                'ellipsis' => TRUE,
1712                'more_link' => FALSE,
1713                'more_link_text' => '',
1714                'more_link_path' => '',
1715                'strip_tags' => FALSE,
1716                'trim' => FALSE,
1717                'preserve_tags' => '',
1718                'html' => FALSE,
1719              ],
1720              'element_type' => '',
1721              'element_class' => '',
1722              'element_label_type' => '',
1723              'element_label_class' => '',
1724              'element_label_colon' => FALSE,
1725              'element_wrapper_type' => '',
1726              'element_wrapper_class' => '',
1727              'element_default_classes' => TRUE,
1728              'empty' => '_none',
1729              'hide_empty' => FALSE,
1730              'empty_zero' => FALSE,
1731              'hide_alter_empty' => TRUE,
1732            ],
1733            'location_country_2' => [
1734              'id' => 'location_country_2',
1735              'table' => 'visitors',
1736              'field' => 'location_country',
1737              'relationship' => 'none',
1738              'group_type' => 'group',
1739              'admin_label' => '',
1740              'plugin_id' => 'visitors_country',
1741              'label' => 'Abbreviation',
1742              'exclude' => TRUE,
1743              'alter' => [
1744                'alter_text' => TRUE,
1745                'text' => '{{ location_country_2|lower }}',
1746                'make_link' => FALSE,
1747                'path' => 'internal:/visitors/location/region/{{ location_country_2 }}/{{ location_region }}',
1748                'absolute' => FALSE,
1749                'external' => FALSE,
1750                'replace_spaces' => FALSE,
1751                'path_case' => 'none',
1752                'trim_whitespace' => FALSE,
1753                'alt' => '',
1754                'rel' => '',
1755                'link_class' => '',
1756                'prefix' => '',
1757                'suffix' => '',
1758                'target' => '',
1759                'nl2br' => FALSE,
1760                'max_length' => 0,
1761                'word_boundary' => TRUE,
1762                'ellipsis' => TRUE,
1763                'more_link' => FALSE,
1764                'more_link_text' => '',
1765                'more_link_path' => '',
1766                'strip_tags' => FALSE,
1767                'trim' => FALSE,
1768                'preserve_tags' => '',
1769                'html' => FALSE,
1770              ],
1771              'element_type' => '',
1772              'element_class' => '',
1773              'element_label_type' => '',
1774              'element_label_class' => '',
1775              'element_label_colon' => TRUE,
1776              'element_wrapper_type' => '',
1777              'element_wrapper_class' => '',
1778              'element_default_classes' => TRUE,
1779              'empty' => '',
1780              'hide_empty' => FALSE,
1781              'empty_zero' => FALSE,
1782              'hide_alter_empty' => TRUE,
1783              'icon' => FALSE,
1784              'text' => FALSE,
1785              'abbreviation' => TRUE,
1786            ],
1787            'location_country' => [
1788              'id' => 'location_country',
1789              'table' => 'visitors',
1790              'field' => 'location_country',
1791              'relationship' => 'none',
1792              'group_type' => 'group',
1793              'admin_label' => '',
1794              'plugin_id' => 'visitors_country',
1795              'label' => 'Flag',
1796              'exclude' => TRUE,
1797              'alter' => [
1798                'alter_text' => FALSE,
1799                'text' => '',
1800                'make_link' => FALSE,
1801                'path' => '',
1802                'absolute' => FALSE,
1803                'external' => FALSE,
1804                'replace_spaces' => FALSE,
1805                'path_case' => 'none',
1806                'trim_whitespace' => FALSE,
1807                'alt' => '',
1808                'rel' => '',
1809                'link_class' => '',
1810                'prefix' => '',
1811                'suffix' => '',
1812                'target' => '',
1813                'nl2br' => FALSE,
1814                'max_length' => 0,
1815                'word_boundary' => TRUE,
1816                'ellipsis' => TRUE,
1817                'more_link' => FALSE,
1818                'more_link_text' => '',
1819                'more_link_path' => '',
1820                'strip_tags' => FALSE,
1821                'trim' => FALSE,
1822                'preserve_tags' => '',
1823                'html' => FALSE,
1824              ],
1825              'element_type' => '',
1826              'element_class' => '',
1827              'element_label_type' => '',
1828              'element_label_class' => '',
1829              'element_label_colon' => FALSE,
1830              'element_wrapper_type' => '',
1831              'element_wrapper_class' => '',
1832              'element_default_classes' => TRUE,
1833              'empty' => '',
1834              'hide_empty' => FALSE,
1835              'empty_zero' => FALSE,
1836              'hide_alter_empty' => TRUE,
1837              'icon' => TRUE,
1838              'text' => FALSE,
1839            ],
1840            'location_region' => [
1841              'id' => 'location_region',
1842              'table' => 'visitors',
1843              'field' => 'location_region',
1844              'relationship' => 'none',
1845              'group_type' => 'group',
1846              'admin_label' => '',
1847              'plugin_id' => 'standard',
1848              'label' => 'Region',
1849              'exclude' => TRUE,
1850              'alter' => [
1851                'alter_text' => FALSE,
1852                'text' => '',
1853                'make_link' => FALSE,
1854                'path' => '',
1855                'absolute' => FALSE,
1856                'external' => FALSE,
1857                'replace_spaces' => FALSE,
1858                'path_case' => 'none',
1859                'trim_whitespace' => FALSE,
1860                'alt' => '',
1861                'rel' => '',
1862                'link_class' => '',
1863                'prefix' => '',
1864                'suffix' => '',
1865                'target' => '',
1866                'nl2br' => FALSE,
1867                'max_length' => 0,
1868                'word_boundary' => TRUE,
1869                'ellipsis' => TRUE,
1870                'more_link' => FALSE,
1871                'more_link_text' => '',
1872                'more_link_path' => '',
1873                'strip_tags' => FALSE,
1874                'trim' => FALSE,
1875                'preserve_tags' => '',
1876                'html' => FALSE,
1877              ],
1878              'element_type' => '',
1879              'element_class' => '',
1880              'element_label_type' => '',
1881              'element_label_class' => '',
1882              'element_label_colon' => TRUE,
1883              'element_wrapper_type' => '',
1884              'element_wrapper_class' => '',
1885              'element_default_classes' => TRUE,
1886              'empty' => 'Unknown',
1887              'hide_empty' => FALSE,
1888              'empty_zero' => FALSE,
1889              'hide_alter_empty' => TRUE,
1890            ],
1891            'location_country_1' => [
1892              'id' => 'location_country_1',
1893              'table' => 'visitors',
1894              'field' => 'location_country',
1895              'relationship' => 'none',
1896              'group_type' => 'group',
1897              'admin_label' => '',
1898              'plugin_id' => 'visitors_country',
1899              'label' => 'Region',
1900              'exclude' => FALSE,
1901              'alter' => [
1902                'alter_text' => TRUE,
1903                'text' => '{{location_country }} {{ location_region }}, {{ location_country_1 }} ',
1904                'make_link' => TRUE,
1905                'path' => 'internal:/visitors/location/region/{{ location_country_2 }}/{{ location_region_1 }}',
1906                'absolute' => FALSE,
1907                'external' => FALSE,
1908                'replace_spaces' => FALSE,
1909                'path_case' => 'none',
1910                'trim_whitespace' => FALSE,
1911                'alt' => '',
1912                'rel' => '',
1913                'link_class' => '',
1914                'prefix' => '',
1915                'suffix' => '',
1916                'target' => '',
1917                'nl2br' => FALSE,
1918                'max_length' => 0,
1919                'word_boundary' => TRUE,
1920                'ellipsis' => TRUE,
1921                'more_link' => FALSE,
1922                'more_link_text' => '',
1923                'more_link_path' => '',
1924                'strip_tags' => FALSE,
1925                'trim' => FALSE,
1926                'preserve_tags' => '',
1927                'html' => FALSE,
1928              ],
1929              'element_type' => '',
1930              'element_class' => '',
1931              'element_label_type' => '',
1932              'element_label_class' => '',
1933              'element_label_colon' => TRUE,
1934              'element_wrapper_type' => '',
1935              'element_wrapper_class' => '',
1936              'element_default_classes' => TRUE,
1937              'empty' => 'Unknown',
1938              'hide_empty' => FALSE,
1939              'empty_zero' => FALSE,
1940              'hide_alter_empty' => TRUE,
1941              'icon' => FALSE,
1942              'text' => TRUE,
1943              'abbreviation' => FALSE,
1944            ],
1945            'visitor_id' => [
1946              'id' => 'visitor_id',
1947              'table' => 'visitors',
1948              'field' => 'visitor_id',
1949              'relationship' => 'none',
1950              'group_type' => 'count_distinct',
1951              'admin_label' => '',
1952              'plugin_id' => 'standard',
1953              'label' => 'Unique visitors',
1954              'exclude' => FALSE,
1955              'alter' => [
1956                'alter_text' => FALSE,
1957                'text' => '',
1958                'make_link' => FALSE,
1959                'path' => '',
1960                'absolute' => FALSE,
1961                'external' => FALSE,
1962                'replace_spaces' => FALSE,
1963                'path_case' => 'none',
1964                'trim_whitespace' => FALSE,
1965                'alt' => '',
1966                'rel' => '',
1967                'link_class' => '',
1968                'prefix' => '',
1969                'suffix' => '',
1970                'target' => '',
1971                'nl2br' => FALSE,
1972                'max_length' => 0,
1973                'word_boundary' => TRUE,
1974                'ellipsis' => TRUE,
1975                'more_link' => FALSE,
1976                'more_link_text' => '',
1977                'more_link_path' => '',
1978                'strip_tags' => FALSE,
1979                'trim' => FALSE,
1980                'preserve_tags' => '',
1981                'html' => FALSE,
1982              ],
1983              'element_type' => '',
1984              'element_class' => '',
1985              'element_label_type' => '',
1986              'element_label_class' => '',
1987              'element_label_colon' => TRUE,
1988              'element_wrapper_type' => '',
1989              'element_wrapper_class' => '',
1990              'element_default_classes' => TRUE,
1991              'empty' => '',
1992              'hide_empty' => FALSE,
1993              'empty_zero' => FALSE,
1994              'hide_alter_empty' => TRUE,
1995              'set_precision' => FALSE,
1996              'precision' => 0,
1997              'decimal' => '.',
1998              'separator' => ',',
1999              'format_plural' => 0,
2000              'format_plural_string' => '1
2001  \x03
2002  @count',
2003              'prefix' => '',
2004              'suffix' => '',
2005            ],
2006          ],
2007          'arguments' => [
2008            'location_country' => [
2009              'id' => 'location_country',
2010              'table' => 'visitors',
2011              'field' => 'location_country',
2012              'relationship' => 'none',
2013              'group_type' => 'group',
2014              'admin_label' => '',
2015              'plugin_id' => 'string',
2016              'default_action' => 'ignore',
2017              'exception' => [
2018                'value' => 'all',
2019                'title_enable' => FALSE,
2020                'title' => 'All',
2021              ],
2022              'title_enable' => FALSE,
2023              'title' => '',
2024              'default_argument_type' => 'fixed',
2025              'default_argument_options' => [
2026                'argument' => '',
2027              ],
2028              'summary_options' => [
2029                'base_path' => '',
2030                'count' => TRUE,
2031                'override' => FALSE,
2032                'items_per_page' => 25,
2033              ],
2034              'summary' => [
2035                'sort_order' => 'asc',
2036                'number_of_records' => 0,
2037                'format' => 'default_summary',
2038              ],
2039              'specify_validation' => FALSE,
2040              'validate' => [
2041                'type' => 'none',
2042                'fail' => 'not found',
2043              ],
2044              'validate_options' => [],
2045              'glossary' => FALSE,
2046              'limit' => 0,
2047              'case' => 'none',
2048              'path_case' => 'none',
2049              'transform_dash' => FALSE,
2050              'break_phrase' => FALSE,
2051            ],
2052          ],
2053          'defaults' => [
2054            'fields' => FALSE,
2055            'arguments' => FALSE,
2056          ],
2057          'display_description' => '',
2058          'display_extenders' => [],
2059        ],
2060        'cache_metadata' => [
2061          'max-age' => -1,
2062          'contexts' => [
2063            0 => 'languages:language_interface',
2064            1 => 'url',
2065            2 => 'url.query_args',
2066          ],
2067          'tags' => [],
2068        ],
2069      ],
2070    ],
2071  ];
2072  $view_storage = \Drupal::entityTypeManager()->getStorage('view');
2073
2074  $view_storage->create($visitors_geoip_view)->save();
2075}
2076
2077/**
2078 * Removes 'location_postal' and 'location_area_code' fields.
2079 */
2080function visitors_geoip_update_8222() {
2081  $table = 'visitors';
2082  $schema = \Drupal::database()->schema();
2083
2084  if ($schema->fieldExists($table, 'location_postal')) {
2085    $schema->dropField($table, 'location_postal');
2086  }
2087  if ($schema->fieldExists($table, 'location_area_code')) {
2088    $schema->dropField($table, 'location_area_code');
2089  }
2090
2091}
2092
2093/**
2094 * Cache issues with the visitors_geoip view.
2095 */
2096function visitors_geoip_update_8228() {
2097  drupal_flush_all_caches();
2098
2099  $view = \Drupal::configFactory()->getEditable('views.view.visitors_geoip');
2100
2101  $view->set('display.default.display_options.cache.type', 'none');
2102
2103  $view->save();
2104}
2105
2106/**
2107 * Adds date range cache context for better performance.
2108 */
2109function visitors_geoip_update_8229() {
2110  drupal_flush_all_caches();
2111
2112  $view = \Drupal::configFactory()->getEditable('views.view.visitors_geoip');
2113
2114  $view->set('display.default.display_options.cache.type', 'tag');
2115
2116  $default_context = $view->get('display.default.cache_metadata.contexts');
2117  $default_context[] = 'visitors_date_range';
2118  $view->set('display.default.cache_metadata.contexts', $default_context);
2119
2120  $city_context = $view->get('display.city_table.cache_metadata.contexts');
2121  $city_context[] = 'visitors_date_range';
2122  $view->set('display.city_table.cache_metadata.contexts', $city_context);
2123
2124  $recent_view_context = $view->get('display.recent_view_table.cache_metadata.contexts');
2125  $recent_view_context[] = 'visitors_date_range';
2126  $view->set('display.recent_view_table.cache_metadata.contexts', $recent_view_context);
2127
2128  $region_context = $view->get('display.region_table.cache_metadata.contexts');
2129  $region_context[] = 'visitors_date_range';
2130  $view->set('display.region_table.cache_metadata.contexts', $region_context);
2131
2132  $view->save();
2133}