|
7 | 7 | *
|
8 | 8 | * @package Integrate Umami
|
9 | 9 | */
|
| 10 | + |
10 | 11 | ?>
|
11 | 12 | <form method="post" action="options.php" xmlns="http://www.w3.org/1999/html">
|
12 | 13 | <?php settings_fields( 'integration_umami' ); ?>
|
13 | 14 | <table class="form-table">
|
14 | 15 | <tr>
|
15 | 16 | <th scope="row">
|
16 |
| - <label for="integration_umami_enabled"><?php esc_html_e( 'Enabled', 'integrate-umami' ); ?></label> |
| 17 | + <?php esc_html_e( 'Enabled', 'integrate-umami' ); ?> |
17 | 18 | </th>
|
18 | 19 | <td>
|
19 |
| - <input type="checkbox" name="umami_options[enabled]" id="integration_umami_enabled" |
20 |
| - value="1" <?php checked( $options['enabled'] ); ?> /> |
21 |
| - <p class="description"><?php esc_html_e( 'Enable umami analytics', 'integrate-umami' ); ?></p> |
| 20 | + <label for="integration_umami_enabled"> |
| 21 | + <input type="checkbox" name="umami_options[enabled]" id="integration_umami_enabled" |
| 22 | + value="1" <?php checked( $options['enabled'] ); ?> /> |
| 23 | + <?php esc_html_e( 'Enable umami analytics', 'integrate-umami' ); ?> |
| 24 | + </label> |
22 | 25 | </td>
|
23 | 26 | </tr>
|
24 | 27 |
|
25 | 28 | <tr>
|
26 | 29 | <th scope="row">
|
27 |
| - <label for="integration_umami_script_url"><?php esc_html_e( 'Script Url', 'integrate-umami' ); ?></label> |
| 30 | + <?php esc_html_e( 'Script Url', 'integrate-umami' ); ?> |
28 | 31 | </th>
|
29 | 32 | <td>
|
30 |
| - <input type="url" name="umami_options[script_url]" id="integration_umami_script_url" |
| 33 | + <input class="integrate-umami-url" type="url" name="umami_options[script_url]" id="integration_umami_script_url" |
31 | 34 | value="<?php echo esc_attr( $options['script_url'] ); ?>"/>
|
32 | 35 | <p class="description"><?php esc_html_e( 'The url to your umami tracking script', 'integrate-umami' ); ?></p>
|
33 | 36 | </td>
|
34 | 37 | </tr>
|
35 | 38 |
|
36 | 39 | <tr>
|
37 | 40 | <th scope="row">
|
38 |
| - <label for="integration_umami_host_url"><?php esc_html_e( 'Host Url', 'integrate-umami' ); ?></label> |
| 41 | + <?php esc_html_e( 'Host Url', 'integrate-umami' ); ?> |
39 | 42 | </th>
|
40 | 43 | <td>
|
41 |
| - <input type="url" name="umami_options[host_url]" id="integration_umami_host_url" |
| 44 | + <input class="integrate-umami-url" type="url" name="umami_options[host_url]" id="integration_umami_host_url" |
42 | 45 | value="<?php echo esc_attr( $options['host_url'] ); ?>"/>
|
43 | 46 | <p class="description"><?php esc_html_e( 'The url to your umami instanace', 'integrate-umami' ); ?></p>
|
44 | 47 | </td>
|
45 | 48 | </tr>
|
46 | 49 |
|
47 | 50 | <tr>
|
48 | 51 | <th scope="row">
|
49 |
| - <label for="integration_umami_website_id"><?php esc_html_e( 'Website ID', 'integrate-umami' ); ?></label> |
| 52 | + <?php esc_html_e( 'Website ID', 'integrate-umami' ); ?> |
50 | 53 | </th>
|
51 | 54 | <td>
|
52 |
| - <input type="text" name="umami_options[website_id]" id="integration_umami_website_id" |
| 55 | + <input class="integrate-umami-text" type="text" name="umami_options[website_id]" id="integration_umami_website_id" |
53 | 56 | value="<?php echo esc_attr( $options['website_id'] ); ?>"/>
|
54 | 57 | <p class="description"><?php esc_html_e( 'The umami websiteId generated by your installation', 'integrate-umami' ); ?></p>
|
55 | 58 | </td>
|
56 | 59 | </tr>
|
| 60 | + </table> |
57 | 61 |
|
58 |
| - <tr> |
59 |
| - <th class="row"> |
60 |
| - <label for="integration_umami_ignore_admins"><?php esc_html_e( 'Ignore Admins', 'integrate-umami' ); ?></label> |
61 |
| - </th> |
62 |
| - <td> |
63 |
| - <input type="checkbox" name="umami_options[ignore_admins]" id="integration_umami_ignore_admins" |
64 |
| - value="1" |
65 |
| - <?php checked( $options['ignore_admins'] ); ?> /> |
66 |
| - <p class="description"><?php esc_html_e( 'Disable tracking for admin users', 'integrate-umami' ); ?></p> |
67 |
| - </td> |
68 |
| - </tr> |
| 62 | + <div class="integrate-umami-collapsed"> |
| 63 | + <input class="toggle" id="advanced-options" type="checkbox"> |
| 64 | + <label class="toggle-label" for="advanced-options"><?php esc_html_e( 'Advanced Options', 'integrate-umami' ); ?></label> |
| 65 | + <div class="content"> |
| 66 | + <table class="form-table"> |
| 67 | + <tr> |
| 68 | + <th class="row"> |
| 69 | + <?php esc_html_e( 'Ignore Admins', 'integrate-umami' ); ?> |
| 70 | + </th> |
| 71 | + <td> |
| 72 | + <label for="integration_umami_ignore_admins"> |
| 73 | + <input type="checkbox" name="umami_options[ignore_admins]" id="integration_umami_ignore_admins" |
| 74 | + value="1" <?php checked( $options['ignore_admins'] ); ?> /> |
| 75 | + <?php esc_html_e( 'Disable tracking for admin users', 'integrate-umami' ); ?> |
| 76 | + </label> |
| 77 | + </td> |
| 78 | + </tr> |
69 | 79 |
|
70 |
| - <tr> |
71 |
| - <th class="row"> |
72 |
| - <label for="integration_umami_auto_track"><?php esc_html_e( 'Auto Track', 'integrate-umami' ); ?></label> |
73 |
| - </th> |
74 |
| - <td> |
75 |
| - <input type="checkbox" name="umami_options[auto_track]" id="integration_umami_auto_track" value="1" |
76 |
| - <?php checked( $options['auto_track'] ); ?> /> |
77 |
| - <p class="description"><?php esc_html_e( 'Enable auto tracking', 'integrate-umami' ); ?></p> |
78 |
| - </td> |
79 |
| - </tr> |
| 80 | + <tr> |
| 81 | + <th class="row"> |
| 82 | + <?php esc_html_e( 'Auto Tracking', 'integrate-umami' ); ?> |
| 83 | + </th> |
| 84 | + <td> |
| 85 | + <label for="integration_umami_auto_track"> |
| 86 | + <input type="checkbox" name="umami_options[auto_track]" id="integration_umami_auto_track" |
| 87 | + value="1" <?php checked( $options['auto_track'] ); ?> /> |
| 88 | + <?php esc_html_e( 'Enable the automatic events and pageviews tracking', 'integrate-umami' ); ?> |
| 89 | + <p class="description"> |
| 90 | + <?php |
| 91 | + echo wp_kses( |
| 92 | + __( '<b>Note</b>: You need to add your own <a href="https://umami.is/docs/tracker-functions">Tracker functions</a> when disabled.', 'integrate-umami' ), |
| 93 | + [ |
| 94 | + 'b' => [], |
| 95 | + 'a' => [ |
| 96 | + 'href' => [], |
| 97 | + ], |
| 98 | + ] |
| 99 | + ); |
| 100 | + ?> |
| 101 | + </p> |
| 102 | + </label> |
| 103 | + </td> |
| 104 | + </tr> |
80 | 105 |
|
81 |
| - <tr> |
82 |
| - <th class="row"> |
83 |
| - <label for="integration_umami_do_not_track"><?php esc_html_e( 'Do Not Track', 'integrate-umami' ); ?></label> |
84 |
| - </th> |
85 |
| - <td> |
86 |
| - <input type="checkbox" name="umami_options[do_not_track]" id="integration_umami_do_not_track" value="1" |
87 |
| - <?php checked( $options['do_not_track'] ); ?> /> |
88 |
| - <p class="description"><?php echo esc_html__( 'Respect visitor`s <b>Do Not Track</b> setting', 'integrate-umami' ); ?></p> |
89 |
| - </td> |
90 |
| - </tr> |
| 106 | + <tr> |
| 107 | + <th class="row"> |
| 108 | + <?php esc_html_e( 'Do Not Track', 'integrate-umami' ); ?> |
| 109 | + </th> |
| 110 | + <td> |
| 111 | + <label for="integration_umami_do_not_track"> |
| 112 | + <input type="checkbox" name="umami_options[do_not_track]" id="integration_umami_do_not_track" |
| 113 | + value="1" <?php checked( $options['do_not_track'] ); ?> /> |
| 114 | + <?php |
| 115 | + echo wp_kses( |
| 116 | + __( 'Respect visitor`s <b>Do Not Track</b> setting', 'integrate-umami' ), |
| 117 | + [ |
| 118 | + 'b' => [], |
| 119 | + ] |
| 120 | + ); |
| 121 | + ?> |
| 122 | + </label> |
| 123 | + </td> |
| 124 | + </tr> |
91 | 125 |
|
92 |
| - <tr> |
93 |
| - <th class="row"> |
94 |
| - <label for="integration_umami_cache"><?php esc_html_e( 'Cache', 'integrate-umami' ); ?></label> |
95 |
| - </th> |
96 |
| - <td> |
97 |
| - <input type="checkbox" name="umami_options[cache]" id="integration_umami_cache" value="1" |
98 |
| - <?php checked( $options['cache'] ); ?> /> |
99 |
| - <p class="description"><?php esc_html_e( 'Cache data for better performance', 'integrate-umami' ); ?></p> |
100 |
| - </td> |
101 |
| - </tr> |
102 |
| - </table> |
| 126 | + <tr> |
| 127 | + <th class="row"> |
| 128 | + <?php esc_html_e( 'Cache', 'integrate-umami' ); ?> |
| 129 | + </th> |
| 130 | + <td> |
| 131 | + <label for="integration_umami_cache"> |
| 132 | + <input type="checkbox" name="umami_options[cache]" id="integration_umami_cache" |
| 133 | + value="1" <?php checked( $options['cache'] ); ?> /> |
| 134 | + <?php esc_html_e( 'Enable caching of tracking data for better performance', 'integrate-umami' ); ?> |
| 135 | + <p class="description"> |
| 136 | + <?php |
| 137 | + echo wp_kses( |
| 138 | + __( ' <b>Note</b>: This will use session storage so you may need to inform your users.', 'integrate-umami' ), |
| 139 | + [ |
| 140 | + 'b' => [], |
| 141 | + ] |
| 142 | + ); |
| 143 | + ?> |
| 144 | + </p> |
| 145 | + </label> |
| 146 | + </td> |
| 147 | + </tr> |
| 148 | + </table> |
| 149 | + </div> |
| 150 | + </div> |
103 | 151 |
|
104 | 152 | <?php submit_button(); ?>
|
105 | 153 | </form>
|
0 commit comments