Skip to content

Commit 17fa1d0

Browse files
update changelog
1 parent 011b328 commit 17fa1d0

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
==========
33

4+
#### 1.0.1 - October 10, 2018
5+
6+
Added support for tracking multiple sites in a single Fathom dashboard (requires Fathom v1.0.1).
47

58

69
#### 1.0.0 - September 10, 2018

fathom-analytics.php

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Fathom Analytics
44
Description: A simple plugin to add the Fathom tracking snippet to your WordPress site.
55
Author: Fathom Team
6-
Version: 1.0.0
6+
Version: 1.0.1
77
88
Fathom Analytics for WordPress
99
Copyright (C) 2018 Danny van Kooten
@@ -25,6 +25,9 @@
2525
const FATHOM_URL_OPTION_NAME = 'fathom_url';
2626
const FATHOM_SITE_ID_OPTION_NAME = 'fathom_site_id';
2727

28+
/**
29+
* @since 1.0.0
30+
*/
2831
function fathom_get_url() {
2932
$fathom_url = get_option( FATHOM_URL_OPTION_NAME, '' );
3033

@@ -42,10 +45,16 @@ function fathom_get_url() {
4245
return $fathom_url;
4346
}
4447

48+
/**
49+
* @since 1.0.1
50+
*/
4551
function fathom_get_site_id() {
4652
return get_option( FATHOM_SITE_ID_OPTION_NAME, '' );
4753
}
4854

55+
/**
56+
* @since 1.0.0
57+
*/
4958
function fathom_print_js_snippet() {
5059
$url = fathom_get_url();
5160

@@ -57,7 +66,7 @@ function fathom_print_js_snippet() {
5766
$site_id = fathom_get_site_id();
5867

5968
?>
60-
<!-- Fathom - simple website analytics - https://github.com/usefathom/fathom -->
69+
<!-- Fathom - simple website analytics - https://usefathom.com/ -->
6170
<script>
6271
(function(f, a, t, h, o, m){
6372
a[h]=a[h]||function(){
@@ -76,23 +85,29 @@ function fathom_print_js_snippet() {
7685
<?php
7786
}
7887

88+
/**
89+
* @since 1.0.0
90+
*/
7991
function fathom_register_settings() {
8092
$fathom_logo_html = sprintf( '<a href="https://usefathom.com/" style="margin-left: 6px;"><img src="%s" width=16 height=16 style="vertical-align: bottom;"></a>', plugins_url( 'fathom.svg', __FILE__ ) );
93+
94+
// register page + section
8195
add_options_page( 'Fathom Analytics', 'Fathom Analytics', 'manage_options', 'fathom-analytics', 'fathom_print_settings_page' );
8296
add_settings_section( 'default', "Fathom Analytics {$fathom_logo_html}", '__return_true', 'fathom-analytics' );
8397

84-
// register option
98+
// register options
8599
register_setting( 'fathom', FATHOM_URL_OPTION_NAME, array( 'type' => 'string' ) );
86100
register_setting( 'fathom', FATHOM_SITE_ID_OPTION_NAME, array( 'type' => 'string' ) );
87101

88102
// register settings fields
89-
$title = __( 'Dashboard URL', 'fathom-analytics' );
90-
add_settings_field( FATHOM_URL_OPTION_NAME, $title, 'fathom_print_url_setting_field', 'fathom-analytics', 'default' );
103+
add_settings_field( FATHOM_URL_OPTION_NAME, __( 'Dashboard URL', 'fathom-analytics' ), 'fathom_print_url_setting_field', 'fathom-analytics', 'default' );
91104

92-
$title = __( 'Site ID', 'fathom-analytics' );
93-
add_settings_field( FATHOM_SITE_ID_OPTION_NAME, $title, 'fathom_print_site_id_setting_field', 'fathom-analytics', 'default' );
105+
add_settings_field( FATHOM_SITE_ID_OPTION_NAME, __( 'Site ID', 'fathom-analytics' ), 'fathom_print_site_id_setting_field', 'fathom-analytics', 'default' );
94106
}
95107

108+
/**
109+
* @since 1.0.1
110+
*/
96111
function fathom_print_settings_page() {
97112
echo '<div class="wrap">';
98113
echo sprintf( '<form method="POST" action="%s">', esc_attr( admin_url( 'options.php' ) ) );
@@ -103,13 +118,19 @@ function fathom_print_settings_page() {
103118
echo '</div>';
104119
}
105120

121+
/**
122+
* @since 1.0.0
123+
*/
106124
function fathom_print_url_setting_field( $args = array() ) {
107125
$value = get_option( FATHOM_URL_OPTION_NAME );
108126
$placeholder = 'https://my-stats.usefathom.com/';
109127
echo sprintf( '<input type="text" name="%s" id="%s" class="regular-text" value="%s" placeholder="%s" />', FATHOM_URL_OPTION_NAME, FATHOM_URL_OPTION_NAME, esc_attr( $value ), esc_attr( $placeholder ) );
110128
echo '<p class="description">' . __( 'Enter the full URL to your Fathom instance here.', 'fathom-analytics' ) . '</p>';
111129
}
112130

131+
/**
132+
* @since 1.0.1
133+
*/
113134
function fathom_print_site_id_setting_field( $args = array() ) {
114135
$value = get_option( FATHOM_SITE_ID_OPTION_NAME );
115136
$placeholder = 'ABCDEF';

readme.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ This plugin has just a single settings field, which can be found by going to **W
4747
== Changelog ==
4848

4949

50+
#### 1.0.1 - October 10, 2018
51+
52+
Added support for tracking multiple sites in a single Fathom dashboard (requires Fathom v1.0.1).
53+
54+
5055
#### 1.0.0 - September 10, 2018
5156

5257
Plugin release.

0 commit comments

Comments
 (0)