Version Description
Download this release
Release Info
Developer | yuvalo |
Plugin | WP Google Analytics Events |
Version | 1.7 |
Comparing to | |
See all releases |
Code changes from version 1.6 to 1.7
- css/style.css +51 -0
- ga-scroll-event.php +1 -1
- images/close.png +0 -0
- includes/admin.php +81 -2
- js/admin.js +14 -0
- readme.txt +3 -2
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
css/style.css
CHANGED
@@ -129,3 +129,54 @@ a[href="admin.php?page=wp-google-analytics-events-upgrade"] {
|
|
129 |
a[href="admin.php?page=wp-google-analytics-events-upgrade"]:hover {
|
130 |
color: #cf471c !important;
|
131 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
a[href="admin.php?page=wp-google-analytics-events-upgrade"]:hover {
|
130 |
color: #cf471c !important;
|
131 |
}
|
132 |
+
.popup {
|
133 |
+
position: fixed;
|
134 |
+
width: 100%;
|
135 |
+
height: 100%;
|
136 |
+
left: 0;
|
137 |
+
background-color: rgba(0, 0, 0, 0.57);
|
138 |
+
top: 0;
|
139 |
+
z-index: 99;
|
140 |
+
}
|
141 |
+
.popup h1{
|
142 |
+
text-align: center;
|
143 |
+
color: red;
|
144 |
+
display: block;
|
145 |
+
margin: 0 auto;
|
146 |
+
width: 400px;
|
147 |
+
padding: 20px;
|
148 |
+
margin-top: 15%;
|
149 |
+
background: #FFFFFF;
|
150 |
+
position: relative;
|
151 |
+
}
|
152 |
+
a.btn_close_popup img {
|
153 |
+
width: 23px;
|
154 |
+
position: absolute;
|
155 |
+
right: 8px;
|
156 |
+
top: 6px;
|
157 |
+
}
|
158 |
+
|
159 |
+
.settings_content{
|
160 |
+
position: fixed;
|
161 |
+
width: 100%;
|
162 |
+
height: 100%;
|
163 |
+
left: 0;
|
164 |
+
background-color: rgba(0, 0, 0, 0.57);
|
165 |
+
top: 0;
|
166 |
+
display: none;
|
167 |
+
}
|
168 |
+
.settings_content form{
|
169 |
+
display: block;
|
170 |
+
margin: 0 auto;
|
171 |
+
width: 400px;
|
172 |
+
padding: 20px;
|
173 |
+
margin-top: 22%;
|
174 |
+
background: #FFFFFF;
|
175 |
+
position: relative;
|
176 |
+
}
|
177 |
+
.settings_content img{
|
178 |
+
width: 18px;
|
179 |
+
position: absolute;
|
180 |
+
right: 10px;
|
181 |
+
top: 11px;
|
182 |
+
}
|
ga-scroll-event.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Google Analytics Events
|
4 |
Plugin URI: http://wpflow.com
|
5 |
Description: Adds the Google Analytics code to your website and enables you to send events on scroll or click.
|
6 |
-
Version: 1.
|
7 |
Author: Yuval Oren
|
8 |
Author URI: http://wpflow.com
|
9 |
License: GPLv2
|
3 |
Plugin Name: WP Google Analytics Events
|
4 |
Plugin URI: http://wpflow.com
|
5 |
Description: Adds the Google Analytics code to your website and enables you to send events on scroll or click.
|
6 |
+
Version: 1.7
|
7 |
Author: Yuval Oren
|
8 |
Author URI: http://wpflow.com
|
9 |
License: GPLv2
|
images/close.png
ADDED
Binary file
|
includes/admin.php
CHANGED
@@ -16,7 +16,8 @@ function ga_events_menu() {
|
|
16 |
}
|
17 |
|
18 |
function ga_events_settings_page() {
|
19 |
-
|
|
|
20 |
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
|
21 |
<div id="ga_main" class="wrap">
|
22 |
<?php screen_icon( 'plugins' ); ?>
|
@@ -47,7 +48,13 @@ function ga_events_settings_page() {
|
|
47 |
?>
|
48 |
<input class="button-primary" type="submit" name="submit" value="Save Changes" />
|
49 |
</form>
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
</div>
|
52 |
<?php
|
53 |
if ($show_sidebar) {
|
@@ -129,6 +136,8 @@ function ga_events_settings_page() {
|
|
129 |
function load_custom_wp_admin_style() {
|
130 |
wp_register_style( 'custom_wp_admin_css', plugins_url('css/style.css', dirname(__FILE__)));
|
131 |
wp_enqueue_style( 'custom_wp_admin_css' );
|
|
|
|
|
132 |
}
|
133 |
|
134 |
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );
|
@@ -136,6 +145,19 @@ add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );
|
|
136 |
add_action('admin_init', 'ga_events_admin_init');
|
137 |
|
138 |
function ga_events_admin_init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
register_setting('ga_events_options','ga_events_options','ga_events_validate');
|
140 |
add_settings_section('ga_events_main','WP Google Analytics Events Settings', 'ga_events_section_text','ga_events');
|
141 |
add_settings_section('ga_events_click_section','Click Tracking', 'ga_events_section_text','ga_events_click');
|
@@ -146,6 +168,8 @@ function ga_events_admin_init() {
|
|
146 |
add_settings_field('ga_events_divs', '','ga_events_setting_divs_input','ga_events_scroll','ga_events_scroll_section');
|
147 |
add_settings_field('ga_events_click', '','ga_events_setting_click_input','ga_events_click','ga_events_click_section');
|
148 |
add_settings_field('ga_events_sidebar', '','ga_events_setting_sidebar','ga_events','ga_events_main');
|
|
|
|
|
149 |
|
150 |
|
151 |
}
|
@@ -178,6 +202,14 @@ function ga_events_setting_uni_input() {
|
|
178 |
echo "<span class='ga_intable'><input id='universal' name='ga_events_options[universal]' type='checkbox' value='1' " . checked( $id , 1,false) . " /></span>";
|
179 |
}
|
180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
function ga_events_setting_divs_input() {
|
182 |
$options = get_option('ga_events_options');
|
183 |
$divs= $options['divs'];
|
@@ -300,4 +332,51 @@ function ga_events_admin_footer() {
|
|
300 |
<?php
|
301 |
}
|
302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
?>
|
|
|
|
16 |
}
|
17 |
|
18 |
function ga_events_settings_page() {
|
19 |
+
|
20 |
+
?>
|
21 |
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
|
22 |
<div id="ga_main" class="wrap">
|
23 |
<?php screen_icon( 'plugins' ); ?>
|
48 |
?>
|
49 |
<input class="button-primary" type="submit" name="submit" value="Save Changes" />
|
50 |
</form>
|
51 |
+
<div class="settings_content">
|
52 |
+
<form action="" method="post" enctype="multipart/form-data">
|
53 |
+
<a href="#" class="btn_close"><img src="<?=plugins_url( 'images/close.png', dirname(__FILE__))?>"></a>
|
54 |
+
<input type="file" name="settings">
|
55 |
+
<input type="submit" name="set_settings">
|
56 |
+
</form>
|
57 |
+
</div>
|
58 |
</div>
|
59 |
<?php
|
60 |
if ($show_sidebar) {
|
136 |
function load_custom_wp_admin_style() {
|
137 |
wp_register_style( 'custom_wp_admin_css', plugins_url('css/style.css', dirname(__FILE__)));
|
138 |
wp_enqueue_style( 'custom_wp_admin_css' );
|
139 |
+
wp_enqueue_script( 'admin-init', plugins_url('js/admin.js', dirname(__FILE__)) , array('jquery'), null, true );
|
140 |
+
|
141 |
}
|
142 |
|
143 |
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );
|
145 |
add_action('admin_init', 'ga_events_admin_init');
|
146 |
|
147 |
function ga_events_admin_init() {
|
148 |
+
|
149 |
+
|
150 |
+
if(isset($_GET['download']) && isset($_GET['page'])){
|
151 |
+
if ($_GET['page'] == 'wp-google-analytics-events') {
|
152 |
+
ga_events_file();
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
if(isset($_POST['set_settings'])){
|
157 |
+
ga_events_upload_settings($_FILES);
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
register_setting('ga_events_options','ga_events_options','ga_events_validate');
|
162 |
add_settings_section('ga_events_main','WP Google Analytics Events Settings', 'ga_events_section_text','ga_events');
|
163 |
add_settings_section('ga_events_click_section','Click Tracking', 'ga_events_section_text','ga_events_click');
|
168 |
add_settings_field('ga_events_divs', '','ga_events_setting_divs_input','ga_events_scroll','ga_events_scroll_section');
|
169 |
add_settings_field('ga_events_click', '','ga_events_setting_click_input','ga_events_click','ga_events_click_section');
|
170 |
add_settings_field('ga_events_sidebar', '','ga_events_setting_sidebar','ga_events','ga_events_main');
|
171 |
+
add_settings_field('ga_events_download_settings', '','ga_events_settings_download','ga_events','ga_events_main');
|
172 |
+
add_settings_field('ga_events_upload_settings', '','ga_events_settings_upload','ga_events','ga_events_main');
|
173 |
|
174 |
|
175 |
}
|
202 |
echo "<span class='ga_intable'><input id='universal' name='ga_events_options[universal]' type='checkbox' value='1' " . checked( $id , 1,false) . " /></span>";
|
203 |
}
|
204 |
|
205 |
+
function ga_events_settings_download(){
|
206 |
+
echo '<a class="button" href="http://'.$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] .'&download=1">Export settings</a>';
|
207 |
+
}
|
208 |
+
|
209 |
+
function ga_events_settings_upload(){
|
210 |
+
echo '<a href="#" class="button btn_upload">Import settings</a>';
|
211 |
+
}
|
212 |
+
|
213 |
function ga_events_setting_divs_input() {
|
214 |
$options = get_option('ga_events_options');
|
215 |
$divs= $options['divs'];
|
332 |
<?php
|
333 |
}
|
334 |
|
335 |
+
|
336 |
+
function ga_events_get_settings(){
|
337 |
+
$options = get_option('ga_events_options');
|
338 |
+
$current = json_encode($options);
|
339 |
+
|
340 |
+
return $current;
|
341 |
+
}
|
342 |
+
|
343 |
+
function ga_events_upload_settings($file){
|
344 |
+
$uploadedfile = $file['settings'];
|
345 |
+
if($uploadedfile['type'] != 'application/octet-stream'){
|
346 |
+
ga_event_popup();
|
347 |
+
return;
|
348 |
+
}
|
349 |
+
$content = file_get_contents($uploadedfile["tmp_name"]);
|
350 |
+
|
351 |
+
ga_event_get_content($content);
|
352 |
+
}
|
353 |
+
|
354 |
+
function ga_event_get_content($content){
|
355 |
+
if(!$current = json_decode($content,true)){
|
356 |
+
ga_event_popup();
|
357 |
+
return;
|
358 |
+
}
|
359 |
+
if (!array_key_exists('id', $current) && !array_key_exists('domain', $current)) {
|
360 |
+
ga_event_popup();
|
361 |
+
return;
|
362 |
+
}
|
363 |
+
update_option( 'ga_events_options', $current );
|
364 |
+
|
365 |
+
}
|
366 |
+
function ga_event_popup(){
|
367 |
+
echo "<dev class='popup'>";
|
368 |
+
echo '<h1>Wrong file format <a href="#" class="btn_close_popup"><img src="'.plugins_url( 'images/close.png', dirname(__FILE__)).'"></a></h1>';
|
369 |
+
echo "</dev>";
|
370 |
+
}
|
371 |
+
function ga_events_file(){
|
372 |
+
header("Content-type: text/plain");
|
373 |
+
header("Content-Disposition: attachment; filename='settings.ini'");
|
374 |
+
echo ga_events_get_settings();
|
375 |
+
exit();
|
376 |
+
}
|
377 |
+
|
378 |
+
|
379 |
+
|
380 |
?>
|
381 |
+
|
382 |
+
|
js/admin.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery('.btn_upload').on('click',function(e){
|
2 |
+
jQuery('.settings_content').slideDown();
|
3 |
+
e.preventDefault();
|
4 |
+
});
|
5 |
+
|
6 |
+
jQuery('.btn_close').on('click',function(e){
|
7 |
+
jQuery('.settings_content').slideUp();
|
8 |
+
e.preventDefault();
|
9 |
+
});
|
10 |
+
|
11 |
+
jQuery('.popup').on('click',function(e){
|
12 |
+
jQuery('.popup').slideUp();
|
13 |
+
e.preventDefault();
|
14 |
+
});
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: yuvalo
|
3 |
Tags: analytics, google, events, ga
|
4 |
Tested up to: 4.3
|
5 |
-
Stable tag: 1.
|
6 |
License: GPLv2
|
7 |
Requires at least: 3.0
|
8 |
|
@@ -38,6 +38,8 @@ http://www.youtube.com/watch?v=UP8mfuV9huI
|
|
38 |
3. Plugin Scroll Settings screenshot-5.png
|
39 |
2. Google Analytics real time events screenshot-2.png
|
40 |
== Changelog ==
|
|
|
|
|
41 |
= Version 1.6 =
|
42 |
1. Bug fixes
|
43 |
= Version 1.5 =
|
@@ -51,4 +53,3 @@ Just check the "Don't add the GA tracking code" option and if you are using the
|
|
51 |
2. Admin look and feel changes.
|
52 |
3. Use the Universal Trcking code.
|
53 |
4. Added a short delay for link clicks.
|
54 |
-
|
2 |
Contributors: yuvalo
|
3 |
Tags: analytics, google, events, ga
|
4 |
Tested up to: 4.3
|
5 |
+
Stable tag: 1.7
|
6 |
License: GPLv2
|
7 |
Requires at least: 3.0
|
8 |
|
38 |
3. Plugin Scroll Settings screenshot-5.png
|
39 |
2. Google Analytics real time events screenshot-2.png
|
40 |
== Changelog ==
|
41 |
+
= Version 1.7 =
|
42 |
+
1. Import / Export ferature added
|
43 |
= Version 1.6 =
|
44 |
1. Bug fixes
|
45 |
= Version 1.5 =
|
53 |
2. Admin look and feel changes.
|
54 |
3. Use the Universal Trcking code.
|
55 |
4. Added a short delay for link clicks.
|
|
screenshot-3.png
ADDED
Binary file
|
screenshot-4.png
ADDED
Binary file
|
screenshot-5.png
ADDED
Binary file
|