Conditions | 8 |
Paths | 2 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | function insert_tracking_id() { |
||
18 | $option = get_option( 'jetpack_cloudflare_analytics' ); |
||
19 | |||
20 | if ( |
||
21 | ! empty( $option['code'] ) |
||
22 | && ! is_admin() |
||
23 | && ( class_exists( 'Jetpack_AMP_Support' ) && ! \Jetpack_AMP_Support::is_amp_request() ) |
||
24 | && ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || \jetpack_is_atomic_site() ) |
||
25 | ) { |
||
26 | printf( |
||
27 | "<!-- Jetpack Cloudflare Web Analytics --> |
||
28 | <script defer |
||
29 | src='https://static.cloudflareinsights.com/beacon.min.js' |
||
30 | data-cf-beacon='{\"token\": \"%s\"}'> |
||
31 | </script> |
||
32 | <!-- End Jetpack Cloudflare Web Analytics -->\r\n", |
||
33 | esc_html( $option['code'] ) |
||
34 | ); |
||
35 | } |
||
36 | } |
||
37 | add_action( 'wp_footer', __NAMESPACE__ . '\insert_tracking_id', 999 ); |
||
38 |