1 | <?php |
||
21 | class WP_Cloudflare_Analytics { |
||
22 | |||
23 | /** |
||
24 | * Manages the insertion of Cloudflare analytics snippets into a user's |
||
25 | * site <head>. |
||
26 | * |
||
27 | * @var WP_Cloudflare_Analytics Static property to hold our singleton instance |
||
28 | */ |
||
29 | private static $instance = false; |
||
30 | |||
31 | /** |
||
32 | * Constructor method |
||
33 | * Causes Cloudflare JS snippet to be included during head rendering. |
||
34 | */ |
||
35 | public function __construct() { |
||
38 | |||
39 | /** |
||
40 | * Function to instantiate our class and make it a singleton |
||
41 | */ |
||
42 | public static function get_instance() { |
||
49 | |||
50 | /** |
||
51 | * This injects Cloudflare analytics code into the footer of the page. |
||
52 | * Called exclusively by wp_head action |
||
53 | */ |
||
54 | public function insert_code() { |
||
69 | |||
70 | /** |
||
71 | * Renders Cloudflare analytics code snippet. |
||
72 | * |
||
73 | * @param string $tracking_id Cloudflare Analytics tracking ID. |
||
74 | */ |
||
75 | private function render_code( $tracking_id ) { |
||
86 | } |
||
87 |