Analytics - Version 1.2.3

Version Description

Download this release

Release Info

Developer tms_gac
Plugin Icon 128x128 Analytics
Version 1.2.3
Comparing to
See all releases

Code changes from version 1.0.0 to 1.2.3

analytics-code-notice.css ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @-webkit-keyframes fadeIt {
2
+ 0% { background-color: #ffd89f; }
3
+ 100% { background-color: #FFFFFF; }
4
+ }
5
+ @-moz-keyframes fadeIt {
6
+ 0% { background-color: #ffd89f }
7
+ 100% { background-color: #FFFFFF; }
8
+ }
9
+ @-o-keyframes fadeIt {
10
+ 0% { background-color: #ffd89f }
11
+ 100% { background-color: #FFFFFF; }
12
+ }
13
+ @keyframes fadeIt {
14
+ 0% { background-color: #ffd89f }
15
+ 100% { background-color: #FFFFFF; }
16
+ }
17
+
18
+ .acp_pro_backgroundAnimated{
19
+ background-image:none !important;
20
+ -webkit-animation: fadeIt 3s ease;
21
+ -moz-animation: fadeIt 3s ease;
22
+ -o-animation: fadeIt 3s ease;
23
+ animation: fadeIt 3s ease;
24
+ background-color: white !important;
25
+ }
26
+
27
+ .acp_notice_get_pro_btn {
28
+ -moz-box-shadow:inset 0px 1px 0px 0px #9acc85;
29
+ -webkit-box-shadow:inset 0px 1px 0px 0px #9acc85;
30
+ box-shadow:inset 0px 1px 0px 0px #9acc85;
31
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #74ad5a), color-stop(1, #68a54b));
32
+ background:-moz-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
33
+ background:-webkit-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
34
+ background:-o-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
35
+ background:-ms-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
36
+ background:linear-gradient(to bottom, #74ad5a 5%, #68a54b 100%);
37
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#74ad5a', endColorstr='#68a54b',GradientType=0);
38
+ background-color:#74ad5a;
39
+ border:1px solid #3b6e22;
40
+ display:inline-block;
41
+ cursor:pointer;
42
+ color:#ffffff;
43
+ font-family:Arial;
44
+ font-size:18px;
45
+ font-weight:bold;
46
+ padding:10px 20px 10px 20px;
47
+ text-decoration:none;
48
+ border-radius: 5px;
49
+ }
50
+ .acp_notice_get_pro_btn:hover {
51
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #68a54b), color-stop(1, #74ad5a));
52
+ background:-moz-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
53
+ background:-webkit-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
54
+ background:-o-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
55
+ background:-ms-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
56
+ background:linear-gradient(to bottom, #68a54b 5%, #74ad5a 100%);
57
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#68a54b', endColorstr='#74ad5a',GradientType=0);
58
+ background-color:#68a54b;
59
+ }
60
+
61
+ .acp_notice_get_pro_btn:active {
62
+ position:relative;
63
+ top:1px;
64
+ }
65
+
66
+ #ga_tc_notice_get_pro .notice-dismiss {
67
+ background-color: #ffd89f;
68
+ padding-left: 20px;
69
+ }
70
+
71
+ #ga_tc_notice_get_pro .notice-dismiss-opened {
72
+ background-color: white;
73
+ }
74
+
75
+
76
+ #ga_tc_notice_get_pro .notice-dismiss:before {
77
+ position: inherit;
78
+ margin-left: -20px;
79
+
80
+ }
81
+ #ga_tc_notice_get_pro .notice-dismiss:after {
82
+ top: -4px;
83
+ left: 1px;
84
+ color: #4f73bc;
85
+ }
86
+
87
+ .acp_pro_banner {
88
+ padding-left: 16px;
89
+ height: 47px;
90
+ /*min-width: 340px;*/
91
+ overflow-y: hidden;
92
+ margin-lefT: -5px;
93
+ cursor: pointer;
94
+ }
95
+ #ga_tc_notice_get_pro {
96
+ margin-left: 0px;
97
+ padding-right: 0px;
98
+ padding: 10px 0px 0px 0px;
99
+ background-color: #ffd89f;
100
+ overflow-y: hidden;
101
+ height: 97px;
102
+ }
103
+
104
+ #ga_tc_notice_get_pro .opened {
105
+ background-color: white;
106
+ }
107
+
108
+ .acp_pro_banner_title {
109
+ font-weight: bold;
110
+ font-size: 28px;
111
+ font-family: "open sans",arial,sans-serif;
112
+ text-shadow: 1px 1px 15px #929292;
113
+ float: left;
114
+ padding: 3px 10px 14px 80px;
115
+ margin-right: 15px;
116
+ }
117
+
118
+ .acp_pro_banner_features {
119
+ margin-left: 100px;
120
+ }
121
+
122
+ .acp_pro_banner_feature {
123
+ font-size: 16px;
124
+ font-family: "open sans",arial,sans-serif;
125
+ text-shadow: 1px 1px 15px #929292;
126
+ font-weight: bold;
127
+ float: left;
128
+ border-radius: 15px;
129
+ margin-right: 25px;
130
+ margin-top: -5px;
131
+ }
132
+
133
+ .acp_pro_banner_buttons, .acp_pro_banner_buttons2 {
134
+ text-align: center;
135
+ width: 100%;
136
+ float: left;
137
+ background-color: transparent;
138
+ }
139
+ .acp_pro_banner_buttons a, .acp_pro_banner_buttons2 a {
140
+ line-height: 30px;
141
+ font-weight: bold;
142
+ text-decoration: none;
143
+ }
144
+
145
+ #acp_pro_banner_screenshots {
146
+ max-width: 780px;
147
+ margin-left: 20px;
148
+ }
149
+
150
+ #acp_pro_banner_screenshots div.screenshot {
151
+ float: left;
152
+ max-width: 30%;
153
+ width: 130px;
154
+ height: 50px;
155
+ margin-right: 10px;
156
+ overflow-y: hidden;
157
+ margin-bottom: -1px;
158
+ }
159
+
160
+ #acp_pro_banner_screenshots div.screenshot_opened {
161
+ background-color: white;
162
+ height: 130px;
163
+ overflow: hidden;
164
+ margin-top: 5px;
165
+ border: 2px solid #bababa;
166
+ }
167
+
168
+ #acp_pro_banner_screenshots div.screenshot_opened:hover {
169
+ border: 2px solid gray;
170
+ }
171
+
172
+ #acp_pro_banner_screenshots div.screenshot_opened img {
173
+ margin-top: 0px !important;
174
+ }
175
+
176
+ .screenshot_opened img:hover {
177
+
178
+ }
179
+
180
+ #acp_pro_banner_screenshots div.screenshot2 {
181
+ float: left;
182
+ max-width: 30%;
183
+ width: 230px;
184
+ max-height: 127px;
185
+ margin-right: 10px;
186
+ overflow-y: hidden;
187
+ border: 1px solid #bdbdbd;
188
+ background-color: white;
189
+ }
190
+
191
+
192
+ .screenshot_shadow {
193
+ -webkit-box-shadow: 0 8px 8px -6px #727272;
194
+ -moz-box-shadow: 0 8px 8px -6px #727272;
195
+ box-shadow: 0 8px 8px -6px #727272;
196
+ border-bottom: 1px solid #dbdbdb;
197
+ }
198
+
199
+ #acp_pro_banner_screenshots div.screenshot img {
200
+ margin-top: 10px;
201
+ cursor: pointer;
202
+ }
203
+ #acp_pro_banner_screenshots div.screenshot img:hover {
204
+ margin-top: 0px;
205
+ }
206
+
207
+
208
+ #acp_pro_banner_enjoy {
209
+ position: absolute;
210
+ margin-top: -33px;
211
+ margin-left: 5px;
212
+ }
213
+
214
+
215
+
216
+
217
+ #acp_pro_banner_list_features {
218
+ display: none;
219
+ /*max-width: 780px;*/
220
+ background-color: white;
221
+ padding: 0px 10px 60px 20px;
222
+ /*margin-left: 0px;*/
223
+ }
224
+ #acp_pro_banner_list_features li {
225
+ /*list-style-type: inherit;*/
226
+ list-style-image: url("checkbox.gif");
227
+ margin-left: 30px;
228
+ font-size: 16px;
229
+ font-family: "open sans",arial,sans-serif;
230
+ }
231
+
232
+ #acp_pro_banner_list_features h2 {
233
+ margin-top: 5px;
234
+ }
235
+
236
+
237
+ .acp_pro_banner_feature_cont {
238
+ margin-left: 10px;
239
+ }
240
+
241
+ @media only screen and (max-width: 780px) {
242
+ .acp_pro_banner_feature {
243
+ font-size: 13px;
244
+ margin-bottom: 10px;
245
+ margin-left:0px;
246
+ margin-right: 15px;
247
+ /*font-weight: normal;*/
248
+ margin-top: -13px;
249
+ }
250
+ }
251
+
252
+ @media only screen and (max-width: 780px) {
253
+ #acp_pro_banner_enjoy {
254
+ display: none;
255
+ }
256
+ .acp_pro_banner_title {
257
+ padding-left: 0px;
258
+ }
259
+ }
260
+
261
+
262
+ @media only screen and (max-width: 580px) {
263
+ #ga_tc_notice_get_pro {
264
+ padding-right: 0px;
265
+ }
266
+ .acp_pro_banner_title {
267
+ font-size: 23px;
268
+ padding: 0px 5px 15px 0px;
269
+ }
270
+ #ga_tc_notice_get_pro .notice-dismiss {
271
+ padding-left: 0px;
272
+ }
273
+
274
+
275
+ #ga_tc_notice_get_pro .notice-dismiss:before {
276
+ /*position: inherit;*/
277
+ /*margin-left: 0px;*/
278
+
279
+ }
280
+ #ga_tc_notice_get_pro .notice-dismiss:after {
281
+ content: "";
282
+ }
283
+
284
+ .acp_pro_banner_features {
285
+ margin-left: 0px;
286
+ }
287
+ }
288
+
289
+ @media only screen and (max-width: 480px) {
290
+ .acp_pro_banner_title {
291
+ font-size: 18px;
292
+ }
293
+ }
294
+
295
+
296
+ @media only screen and (max-width: 440px) {
297
+ .acp_pro_banner_title {
298
+ padding: 0px 5px 5px 0px;
299
+ line-height: 20px;
300
+ }
301
+ .acp_pro_banner_buttons a {
302
+ line-height: 20px;
303
+ }
304
+
305
+ .acp_pro_banner_feature_cont {
306
+ margin-left: 0px;
307
+ }
308
+ .acp_pro_banner_feature {
309
+ margin-top: auto;
310
+ }
311
+
312
+ }
313
+
314
+ @media only screen and (max-width: 380px) {
315
+ .acp_pro_banner_features {
316
+ display: none;
317
+ }
318
+
319
+ }
320
+
321
+ @media only screen and (max-width: 280px) {
322
+ #ga_tc_notice_get_pro .notice-dismiss:before {
323
+ color:red;
324
+ background: rgba(255, 255, 255, 0.80);
325
+ }
326
+
327
+ }
analytics-code-notice.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready(function() {
2
+ jQuery('#ga_tc_notice_get_pro').find('button.notice-dismiss').click(function() {
3
+ var data = {
4
+ 'action': 'ga_tc_stop_notice_pro_get'
5
+ }
6
+ jQuery.post(ajaxurl, data, function (response) {
7
+ });
8
+
9
+ })
10
+ });
analytics-code.css ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .acp_logo {
2
+ margin-right: 10px;
3
+ margin-bottom: -2px;
4
+ }
5
+
6
+ #ga_tc_id_options {
7
+ margin-bottom: 40px;
8
+ }
9
+
10
+ .ga_tc_pro_chart {
11
+ background-color: white;
12
+ padding: 20px;
13
+ border: 1px solid #e5e5e5;
14
+ }
15
+
16
+ .acp_get_pro h2 {
17
+ font-family: "Open Sans";
18
+ font-weight: bold;
19
+ font-size: 35px !important;
20
+ font-family: "open sans",arial,sans-serif;
21
+ text-shadow: 1px 1px 15px #929292;
22
+ margin-bottom: 20px;
23
+ line-height: 30px;;
24
+ }
25
+
26
+ .acp_get_pro .slogan {
27
+ font-family: "Open Sans";
28
+ font-weight: bold;
29
+ font-size: 14px !important;
30
+ font-family: "open sans",arial,sans-serif;
31
+ text-shadow: 1px 1px 5px #929292;
32
+ margin-bottom: 20px;
33
+ max-width: 550px;
34
+ }
35
+
36
+ .acp_get_pro ul {
37
+ list-style-type: disc;
38
+ list-style-position: inside;
39
+ margin-left: 20px;
40
+ margin-top: 10px;
41
+ }
42
+ .acp_get_pro ul ul,
43
+ .acp_get_pro ol ul {
44
+ list-style-type: circle;
45
+ list-style-position: inside;
46
+ margin-left: 15px;
47
+ }
48
+
49
+
50
+
51
+ .acp_get_pro_btn {
52
+ -moz-box-shadow:inset 0px 1px 0px 0px #9acc85;
53
+ -webkit-box-shadow:inset 0px 1px 0px 0px #9acc85;
54
+ box-shadow:inset 0px 1px 0px 0px #9acc85;
55
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #74ad5a), color-stop(1, #68a54b));
56
+ background:-moz-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
57
+ background:-webkit-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
58
+ background:-o-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
59
+ background:-ms-linear-gradient(top, #74ad5a 5%, #68a54b 100%);
60
+ background:linear-gradient(to bottom, #74ad5a 5%, #68a54b 100%);
61
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#74ad5a', endColorstr='#68a54b',GradientType=0);
62
+ background-color:#74ad5a;
63
+ border:1px solid #3b6e22;
64
+ display:inline-block;
65
+ cursor:pointer;
66
+ color:#ffffff;
67
+ font-family:Arial;
68
+ font-size:18px;
69
+ font-weight:bold;
70
+ padding:10px 20px 10px 20px;
71
+ text-decoration:none;
72
+ border-radius: 5px;
73
+ }
74
+ .acp_get_pro_btn:hover {
75
+ background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #68a54b), color-stop(1, #74ad5a));
76
+ background:-moz-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
77
+ background:-webkit-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
78
+ background:-o-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
79
+ background:-ms-linear-gradient(top, #68a54b 5%, #74ad5a 100%);
80
+ background:linear-gradient(to bottom, #68a54b 5%, #74ad5a 100%);
81
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#68a54b', endColorstr='#74ad5a',GradientType=0);
82
+ background-color:#68a54b;
83
+ }
84
+
85
+ .acp_get_pro_btn:active {
86
+ position:relative;
87
+ top:1px;
88
+ }
89
+
90
+ .acp_get_pro .info {
91
+ float: left;
92
+ margin-right: 40px;
93
+ }
94
+
95
+ .acp_purchased p{
96
+ font-size: 16px !important;
97
+ }
98
+
99
+
100
+ #acp_pro_description {
101
+ font-size: 16px;
102
+ margin-top: 10px;
103
+ max-width: 550px;
104
+ /*float:left;*/
105
+ }
106
+
107
+ #acp_pro_description li{
108
+ list-style-image: url("check_small.png");
109
+ margin-left: 40px;
110
+ font-size: 16px;
111
+ font-family: "open sans",arial,sans-serif;
112
+ list-style-position: outside;
113
+ line-height: 20px;
114
+ }
115
+
116
+
117
+ .ga_tc_pro_chart {
118
+ display: table-cell;
119
+ }
120
+
121
+ .info {
122
+ min-width: 600px;
123
+ }
124
+
125
+
126
+ .acp_pro_button {
127
+ max-width: 550px;
128
+ text-align: center;
129
+ }
130
+
131
+ #ga_tc_code_options {
132
+ margin-bottom: 25px;
133
+ }
134
+
135
+
136
+ @media only screen and (max-width: 750px) {
137
+ .ga_tc_pro_chart {
138
+ }
139
+
140
+ #acp_get_pro_btn {
141
+ margin-top: 0px !important;
142
+ }
143
+
144
+ .info {
145
+ }
146
+
147
+
148
+ }
149
+
150
+ @media only screen and (max-width: 400px) {
151
+ #acp_pro_description li{
152
+ margin-left: 5px;
153
+ margin-right: 5px;
154
+ }
155
+ #acp_pro_banner_screenshots div.screenshot_opened {
156
+ height: 80px;
157
+ }
158
+
159
+
160
+ }
161
+
analytics-code.php CHANGED
@@ -2,18 +2,100 @@
2
  /*
3
  Plugin Name: Analytics Code Integration
4
  Description: Easy integrate the Google Analytics Code on any WordPress website.
5
- Version: 1.0
6
  License: GPLv2 or later
 
 
7
  Author: tms_gac
8
  */
9
 
10
  define("GA_TC_TITLE", 'Google Analytics Code');
11
  define("GA_TC_PLUGIN_NAME", basename(dirname(__FILE__)));
12
  define("GA_TC_MENU_PREFIX", 'ga_tc_');
 
13
 
14
  add_action('admin_menu', 'ga_tc_action_add_menu');
15
 
16
- add_action('wp_footer', 'ga_tc_insert_code');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  if(!function_exists('ga_tc_action_add_menu')) {
19
  function ga_tc_action_add_menu() {
@@ -30,12 +112,21 @@ if(!function_exists('ga_tc_action_add_menu')) {
30
 
31
  if(!function_exists('ga_tc_pageOptions')) {
32
  function ga_tc_pageOptions() {
 
 
 
 
 
 
 
 
 
33
  require 'page_options.php';
34
  }
35
  }
36
 
37
- if(!function_exists('ga_tc_action_wp_footer')) {
38
- function ga_tc_action_wp_footer() {
39
  $ga_tc_type = get_option( 'ga_tc_type', 'id' );
40
  $ga_tc_code = get_option('ga_tc_code', '');
41
  $ga_tc_id = get_option( 'ga_tc_id', '' );
@@ -52,3 +143,24 @@ if(!function_exists('ga_tc_action_wp_footer')) {
52
  }
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /*
3
  Plugin Name: Analytics Code Integration
4
  Description: Easy integrate the Google Analytics Code on any WordPress website.
5
+ Version: 1.2.3
6
  License: GPLv2 or later
7
+ Domain Path: /languages
8
+ Text Domain: analytics-code
9
  Author: tms_gac
10
  */
11
 
12
  define("GA_TC_TITLE", 'Google Analytics Code');
13
  define("GA_TC_PLUGIN_NAME", basename(dirname(__FILE__)));
14
  define("GA_TC_MENU_PREFIX", 'ga_tc_');
15
+ define("GA_TC_SERVER", 'http://www.toolsanalytics.com');
16
 
17
  add_action('admin_menu', 'ga_tc_action_add_menu');
18
 
19
+ add_action( 'init', 'ga_tc_load_textdomain' );
20
+ function ga_tc_load_textdomain() {
21
+ load_plugin_textdomain( 'analytics-code' );
22
+ }
23
+
24
+
25
+ $ga_tc_code = get_option('ga_tc_code', '');
26
+ $ga_tc_id = get_option( 'ga_tc_id', '' );
27
+ $ga_tc_place = get_option( 'ga_tc_place', false);
28
+
29
+ if (!$ga_tc_place) {
30
+ if (empty($ga_tc_code) && empty($ga_tc_id)) {
31
+ $ga_tc_place = 'head';
32
+ } else {
33
+ $ga_tc_place = 'footer';
34
+ }
35
+ }
36
+
37
+
38
+ if ($ga_tc_place == 'footer') {
39
+ add_action('wp_footer', 'ga_tc_insert_code');
40
+ } else {
41
+ add_action('wp_head', 'ga_tc_insert_code');
42
+ }
43
+
44
+
45
+
46
+ add_action('wp_ajax_ga_tc_stop_notice_pro_get', 'ga_tc_stop_notice_pro_get');
47
+
48
+ $v = get_option('ga_tc_stop_notice_pro_get', 0);
49
+ if( $v != ga_tc_get_plugin_version() && !get_option('ga_tc_pro')) {
50
+ add_action( 'admin_notices', 'ga_tc_notice_pro_get' );
51
+ }
52
+
53
+ if(get_option('ga_tc_pro')) {
54
+ add_action( 'admin_notices', 'ga_tc_notice_pro_update' );
55
+ }
56
+
57
+ function ga_tc_load_scripts() {
58
+ wp_register_style( 'analytics-code-notice', plugins_url('analytics-code-notice.css' , __FILE__) );
59
+ wp_enqueue_style( 'analytics-code-notice' );
60
+
61
+ wp_register_script( 'analytics-code-notice', plugins_url('analytics-code-notice.js' , __FILE__) );
62
+ wp_enqueue_script( 'analytics-code-notice' );
63
+
64
+ wp_register_style( 'responsive-lightbox', plugins_url('assets/responsive-lightbox/jquery.lightbox.min.css' , __FILE__) );
65
+ wp_enqueue_style( 'responsive-lightbox' );
66
+
67
+ wp_register_script( 'responsive-lightbox', plugins_url('assets/responsive-lightbox/jquery.lightbox.min.js' , __FILE__) );
68
+ wp_enqueue_script( 'responsive-lightbox' );
69
+ }
70
+
71
+ function ga_tc_notice_pro_get() {
72
+ ga_tc_load_scripts();
73
+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'notice_pro_get.php';
74
+ }
75
+
76
+ function ga_tc_notice_pro_update() {
77
+ wp_register_style( 'analytics-code-notice', plugins_url('analytics-code-notice.css' , __FILE__) );
78
+ wp_enqueue_style( 'analytics-code-notice' );
79
+
80
+ wp_register_script( 'analytics-code-notice', plugins_url('analytics-code-notice.js' , __FILE__) );
81
+ wp_enqueue_script( 'analytics-code-notice' );
82
+
83
+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'notice_pro_update.php';
84
+ }
85
+
86
+ function ga_tc_stop_notice_pro_get() {
87
+ $version = ga_tc_get_plugin_version();
88
+ update_option('ga_tc_stop_notice_pro_get', $version);
89
+ }
90
+
91
+
92
+ function ga_tc_get_plugin_version() {
93
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
94
+ $slug = 'analytics-code/analytics-code.php';
95
+ $plugins = get_plugins();
96
+ $info = $plugins[$slug];
97
+ return $info['Version'];
98
+ }
99
 
100
  if(!function_exists('ga_tc_action_add_menu')) {
101
  function ga_tc_action_add_menu() {
112
 
113
  if(!function_exists('ga_tc_pageOptions')) {
114
  function ga_tc_pageOptions() {
115
+
116
+ wp_register_style( 'analytics-code', plugins_url('analytics-code.css' , __FILE__) );
117
+ wp_enqueue_style( 'analytics-code' );
118
+
119
+ wp_register_style( 'analytics-code-fonts', '//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|Slabo+27px' );
120
+ wp_enqueue_style( 'analytics-code-fonts' );
121
+
122
+ ga_tc_load_scripts();
123
+
124
  require 'page_options.php';
125
  }
126
  }
127
 
128
+ if(!function_exists('ga_tc_insert_code')) {
129
+ function ga_tc_insert_code() {
130
  $ga_tc_type = get_option( 'ga_tc_type', 'id' );
131
  $ga_tc_code = get_option('ga_tc_code', '');
132
  $ga_tc_id = get_option( 'ga_tc_id', '' );
143
  }
144
  }
145
 
146
+
147
+
148
+ if (get_option('ga_tc_pro')) {
149
+ add_action( 'init', 'ga_tc_activate_au' );
150
+ function ga_tc_activate_au()
151
+ {
152
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
153
+ $my_plugin = str_replace('.php', '', basename(__FILE__));
154
+ $plugins = get_plugins('/' . $my_plugin);
155
+ $info = $plugins[basename(__FILE__)];
156
+
157
+ require_once ( dirname(__FILE__) . DIRECTORY_SEPARATOR . 'update.php' );
158
+ $plugin_current_version = $info['Version'];
159
+ $plugin_remote_path = GA_TC_SERVER . '/api/';
160
+ $plugin_slug = plugin_basename( __FILE__ );
161
+ new ga_tc_update($plugin_current_version, $plugin_remote_path, $plugin_slug);
162
+ }
163
+
164
+
165
+
166
+ }
assets/responsive-lightbox/close.png ADDED
Binary file
assets/responsive-lightbox/jquery.lightbox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .lightbox{cursor:pointer;position:fixed;width:100%;height:100%;top:0;left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIElEQVQ4T2NkYGDYDMRkA8ZRAxhGw4BhNAyA+WAYpAMAIFgLQfO9BoEAAAAASUVORK5CYII=);background:rgba(0,0,0,.7);-webkit-filter:none!important;z-index:9997}.lightbox img{display:block;position:absolute;border:5px solid #fff;box-shadow:0 0 20px #000;border-radius:1px}body.blurred>*{-webkit-filter:blur(2px);-webkit-transform:translate3d(0,0,0)}.lightbox__loading{background:url(loading.gif) center center no-repeat;width:32px;height:32px;margin:-16px 0 0 -16px;position:absolute;top:50%;left:50%}.lightbox__caption{display:none;position:absolute;left:0;bottom:0;width:100%;text-align:center;z-index:9998;background:#000;background:rgba(0,0,0,.7)}.lightbox__caption p{margin:0 auto;max-width:70%;display:inline-block;padding:10px;color:#fff;font-size:12px;line-height:18px}.lightbox__button{position:absolute;z-index:9999;background:center center no-repeat;width:32px;height:32px;opacity:.4;-webkit-transition:all .3s;-moz-transition:all .3s;-ms-transition:all .3s;transition:all .3s}.lightbox__button:focus,.lightbox__button:hover{opacity:1;-webkit-transform:scale(1.4);-moz-transform:scale(1.4);-ms-transform:scale(1.4);transform:scale(1.4)}.lightbox__close{right:10px;top:10px;background-image:url(close.png)}.lightbox__nav{top:50%;margin-top:-16px}.lightbox__nav--next{right:10px;background-image:url(next.png)}.lightbox__nav--prev{left:10px;background-image:url(previous.png)}
assets/responsive-lightbox/jquery.lightbox.min.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jquery.lightbox.js v1.3
3
+ * https://github.com/duncanmcdougall/Responsive-Lightbox
4
+ * Copyright 2015 Duncan McDougall and other contributors; @license Creative Commons Attribution 2.5
5
+ *
6
+ * Options:
7
+ * margin - int - default 50. Minimum margin around the image
8
+ * nav - bool - default true. enable navigation
9
+ * blur - bool - default true. Blur other content when open using css filter
10
+ * minSize - int - default 0. Min window width or height to open lightbox. Below threshold will open image in a new tab.
11
+ *
12
+ */
13
+ !function(a){"use strict";a.fn.lightbox=function(b){var c={margin:50,nav:!0,blur:!0,minSize:0},d={items:[],lightbox:null,image:null,current:null,locked:!1,caption:null,init:function(b){d.items=b;var e="lightbox-"+Math.floor(1e5*Math.random()+1);a("body").append('<div id="'+e+'" class="lightbox" style="display:none;"><a href="#" class="lightbox__close lightbox__button"></a><a href="#" class="lightbox__nav lightbox__nav--prev lightbox__button"></a><a href="#" class="lightbox__nav lightbox__nav--next lightbox__button"></a><div href="#" class="lightbox__caption"><p></p></div></div>'),d.lightbox=a("#"+e),d.caption=a(".lightbox__caption",d.lightbox),d.items.length>1&&c.nav?a(".lightbox__nav",d.lightbox).show():a(".lightbox__nav",d.lightbox).hide(),d.bindEvents()},loadImage:function(){c.blur&&a("body").addClass("blurred"),a("img",d.lightbox).remove(),d.lightbox.fadeIn("fast").append('<span class="lightbox__loading"></span>');var b=a('<img src="'+a(d.current).attr("href")+'" draggable="false">');a(b).on("load",function(){a(".lightbox__loading").remove(),d.lightbox.append(b),d.image=a("img",d.lightbox).hide(),d.resizeImage(),d.setCaption()})},setCaption:function(){var b=a(d.current).data("caption");b&&b.length>0?(d.caption.fadeIn(),a("p",d.caption).text(b)):d.caption.hide()},resizeImage:function(){var b,e,f,g,h;e=a(window).height()-c.margin,f=a(window).outerWidth(!0)-c.margin,d.image.width("").height(""),g=d.image.height(),h=d.image.width(),h>f&&(b=f/h,h=f,g=Math.round(g*b)),g>e&&(b=e/g,g=e,h=Math.round(h*b)),d.image.width(h).height(g).css({top:(a(window).height()-d.image.outerHeight())/2+"px",left:(a(window).width()-d.image.outerWidth())/2+"px"}).show(),d.locked=!1},getCurrentIndex:function(){return a.inArray(d.current,d.items)},next:function(){return d.locked?!1:(d.locked=!0,void(d.getCurrentIndex()>=d.items.length-1?a(d.items[0]).click():a(d.items[d.getCurrentIndex()+1]).click()))},previous:function(){return d.locked?!1:(d.locked=!0,void(d.getCurrentIndex()<=0?a(d.items[d.items.length-1]).click():a(d.items[d.getCurrentIndex()-1]).click()))},bindEvents:function(){a(d.items).click(function(b){if(!d.lightbox.is(":visible")&&(a(window).width()<c.minSize||a(window).height()<c.minSize))return void a(this).attr("target","_blank");var e=a(this)[0];b.preventDefault(),d.current=e,d.loadImage(),a(document).on("keydown",function(a){27===a.keyCode&&d.close(),39===a.keyCode&&d.next(),37===a.keyCode&&d.previous()})}),d.lightbox.on("click",function(a){this===a.target&&d.close()}),a(d.lightbox).on("click",".lightbox__nav--prev",function(){return d.previous(),!1}),a(d.lightbox).on("click",".lightbox__nav--next",function(){return d.next(),!1}),a(d.lightbox).on("click",".lightbox__close",function(){return d.close(),!1}),a(window).resize(function(){d.image&&d.resizeImage()})},close:function(){a(document).off("keydown"),a(d.lightbox).fadeOut("fast"),a("body").removeClass("blurred")}};a.extend(c,b),d.init(this)}}(jQuery);
assets/responsive-lightbox/loading.gif ADDED
Binary file
assets/responsive-lightbox/next.png ADDED
Binary file
assets/responsive-lightbox/previous.png ADDED
Binary file
assets/screenshots/1.png ADDED
Binary file
assets/screenshots/2.png ADDED
Binary file
assets/screenshots/3.png ADDED
Binary file
assets/screenshots/4.png ADDED
Binary file
assets/screenshots/5.png ADDED
Binary file
check_small.png ADDED
Binary file
checkbox.gif ADDED
Binary file
down.png ADDED
Binary file
enjoy.png ADDED
Binary file
logo-18x18_transparent.png ADDED
Binary file
logo-24x24_transparent.png ADDED
Binary file
notice_pro_get.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(strpos($_SERVER['QUERY_STRING'], 'ga_tc_settings')) {
3
+ return;
4
+ }
5
+
6
+ ?>
7
+ <style type="text/css">
8
+ #ga_tc_notice_get_pro .notice-dismiss:after {
9
+ content: "<?php _e('Close'); ?>";
10
+ }
11
+
12
+ </style>
13
+
14
+ <div class="notice notice-info is-dismissible" id="ga_tc_notice_get_pro">
15
+ <div style="float:left" class="acp_pro_banner" onclick="acp_pro_banner_show_description();">
16
+ <div class="acp_pro_banner_title" style="float: left">
17
+ <?php _e( 'Google Analytics Professional&nbsp;plugin', 'analytics-code'); ?>
18
+ </div>
19
+ <div style="clear: both;"></div>
20
+ <div class="acp_pro_banner_features">
21
+ <div class="acp_pro_banner_feature">
22
+ Analytics/Statistics
23
+ </div>
24
+ <div class="acp_pro_banner_feature">
25
+ Data exports
26
+ </div>
27
+ <div class="acp_pro_banner_feature">
28
+ White-label reports
29
+ </div>
30
+ </div>
31
+ </div>
32
+
33
+ <div style="clear: both;"></div>
34
+
35
+ <?php require dirname(__FILE__) . DIRECTORY_SEPARATOR . "notice_pro_screenshots.php"; ?>
36
+
37
+
38
+
39
+ <div style="clear: both"></div>
40
+
41
+
42
+
43
+ <div id="acp_pro_banner_list_features">
44
+
45
+ <div style="margin-top: 10px; margin-bottom: 10px;">
46
+
47
+ <form method="post" action="<?php echo GA_TC_SERVER . '/billing/getPro';?>">
48
+
49
+ <input type="hidden" name="user_email" value="<?php echo get_option('admin_email'); ?>">
50
+ <input type="hidden" name="user_site" value="<?php echo home_url(); ?>">
51
+ <input type="hidden" name="refer" value="<?php echo 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . rtrim($_SERVER['HTTP_HOST'], '/')."/" . ltrim($_SERVER['REQUEST_URI'], '/'); ?>">
52
+
53
+ <div class="acp_pro_banner_buttons2">
54
+ <input type="submit" class="acp_notice_get_pro_btn" value="Get PRO" style="margin-left: 20px;">
55
+ <a href="javascript:void(0)" style="visibility: hidden; margin: 20px 0px 0px 10px;" onclick="acp_pro_banner_hide_description()">Hide&nbsp;details <img style="margin-bottom: -5px;" src="<?php echo plugins_url('up.png', __FILE__); ?>"></a>
56
+ </div>
57
+ </form>
58
+
59
+ </div>
60
+
61
+ <div style="clear: both"></div>
62
+
63
+ <h2>Make available many professional things in your own Google Analytics like: data tables, line/pie charts, reports, exports of data and much more...</h2>
64
+
65
+
66
+ <?php require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pro_features.php'; ?>
67
+ <div style="text-align: center; width: 100%">
68
+ <form method="post" action="<?php echo GA_TC_SERVER . '/billing/getPro';?>">
69
+
70
+ <input type="hidden" name="user_email" value="<?php echo get_option('admin_email'); ?>">
71
+ <input type="hidden" name="user_site" value="<?php echo home_url(); ?>">
72
+ <input type="hidden" name="refer" value="<?php echo 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . rtrim($_SERVER['HTTP_HOST'], '/')."/" . ltrim($_SERVER['REQUEST_URI'], '/'); ?>">
73
+
74
+ <div class="acp_pro_banner_buttons2">
75
+ <input type="submit" class="acp_notice_get_pro_btn" value="Get PRO" style="margin-left: 20px;">
76
+ <a href="javascript:void(0)" style="; margin: 20px 0px 0px 10px;" onclick="acp_pro_banner_hide_description()">Hide&nbsp;details <img style="margin-bottom: -5px;" src="<?php echo plugins_url('up.png', __FILE__); ?>"></a>
77
+ </div>
78
+ </form>
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+ <script >
84
+ function acp_pro_banner_show_description() {
85
+ jQuery('#acp_pro_banner_list_features').show('slow');
86
+ jQuery('.acp_pro_banner_buttons').hide('slow');
87
+
88
+ jQuery('#ga_tc_notice_get_pro').css('overflow-y', 'none');
89
+ jQuery('#ga_tc_notice_get_pro').css('height', 'auto');
90
+
91
+ jQuery('#acp_pro_banner_screenshots div.screenshot').addClass("screenshot_opened");
92
+
93
+ jQuery('.screenshot a').attr('href', jQuery('.screenshot a').attr('data-href'));
94
+
95
+ jQuery('#acp_pro_banner_screenshots a').lightbox();
96
+
97
+ jQuery('#ga_tc_notice_get_pro').addClass('acp_pro_backgroundAnimated');
98
+ jQuery('#ga_tc_notice_get_pro .notice-dismiss').addClass('acp_pro_backgroundAnimated');
99
+
100
+
101
+ }
102
+
103
+ function acp_pro_banner_hide_description() {
104
+ jQuery('#acp_pro_banner_list_features').hide('slow');
105
+ jQuery('.acp_pro_banner_buttons').show('s8low');
106
+ jQuery('#ga_tc_notice_get_pro').css('overflow-y', 'hidden');
107
+ jQuery('#ga_tc_notice_get_pro').css('height', '97px');
108
+
109
+ jQuery('#acp_pro_banner_screenshots div.screenshot').removeClass("screenshot_opened");
110
+ jQuery('#ga_tc_notice_get_pro').addClass('acp_pro_backgroundAnimated');
111
+ jQuery('#ga_tc_notice_get_pro .notice-dismiss').addClass('acp_pro_backgroundAnimated');
112
+
113
+ }
114
+
115
+ </script>
notice_pro_screenshots.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <img src="<?php echo plugins_url("enjoy.png", __FILE__); ?>" id="acp_pro_banner_enjoy" style="cursor: pointer;" onclick="acp_pro_banner_show_description()">
2
+ <div id="acp_pro_banner_screenshots">
3
+
4
+ <?php
5
+ $screenshots = array(
6
+ plugins_url("assets/screenshots/1.png", __FILE__),
7
+ plugins_url("assets/screenshots/2.png", __FILE__),
8
+ plugins_url("assets/screenshots/3.png", __FILE__),
9
+ plugins_url("assets/screenshots/4.png", __FILE__),
10
+ plugins_url("assets/screenshots/5.png", __FILE__),
11
+ );
12
+
13
+ foreach($screenshots as $s): ?>
14
+ <div class="screenshot"><a href="<?php echo $s; ?>" onclick="acp_pro_banner_show_description(); return false;"><img src="<?php echo $s; ?>" style="width: 100%"></a></div>
15
+ <?php endforeach; ?>
16
+
17
+ </div>
18
+ <div style="clear: both"></div>
notice_pro_screenshots2.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="acp_pro_banner_screenshots">
2
+
3
+ <?php
4
+ $screenshots = array(
5
+ plugins_url("assets/screenshots/1.png", __FILE__),
6
+ plugins_url("assets/screenshots/3.png", __FILE__),
7
+ plugins_url("assets/screenshots/4.png", __FILE__),
8
+ plugins_url("assets/screenshots/5.png", __FILE__),
9
+ );
10
+ foreach($screenshots as $s):?>
11
+ <div class="screenshot screenshot_opened"><a href="<?php echo $s; ?>" onclick="acp_pro_banner_show_description()"><img src="<?php echo $s; ?>" style="width: 100%"></a></div>
12
+ <?php endforeach;?>
13
+
14
+ <?php
15
+ $screenshots = array(
16
+ plugins_url("assets/screenshots/2.png", __FILE__),
17
+
18
+ );
19
+ foreach($screenshots as $s):?>
20
+ <div class="screenshot2" style="display: none"><a href="<?php echo $s; ?>" onclick="acp_pro_banner_show_description()"><img src="<?php echo $s; ?>" style="width: 100%"></a></div>
21
+ <?php endforeach;?>
22
+
23
+ </div>
24
+ <div style="clear: both"></div>
25
+
26
+
27
+ <script>
28
+
29
+ jQuery( document ).ready(function($) {
30
+ $('#acp_pro_banner_screenshots a').lightbox();
31
+ });
32
+ </script>
notice_pro_update.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="notice notice-success is-dismissible" id="ga_tc_notice_get_pro">
2
+ <div style="float:left">
3
+ <p>
4
+ <?php
5
+ echo '<b>' . __( 'Professional version of Google Analytics Code plugin was purchased successfully!') . '</b><br>';
6
+ echo '<a href="'.admin_url('options-general.php?page=ga_tc_settings&description') . '" style="margin-left: 10px;">[ show description ]</a>';
7
+ ?>
8
+ </p>
9
+ </div>
10
+
11
+ <div style="clear: both"></div>
12
+ </div>
page_options.php CHANGED
@@ -9,6 +9,16 @@
9
  $ga_tc_type = get_option( 'ga_tc_type', 'id' );
10
 
11
 
 
 
 
 
 
 
 
 
 
 
12
  if((mb_strtolower($_SERVER['REQUEST_METHOD']) == 'post')) {
13
  check_admin_referer( GA_TC_PLUGIN_NAME );
14
  }
@@ -18,17 +28,21 @@
18
  update_option( 'ga_tc_id', '' );
19
  update_option( 'ga_tc_code', '' );
20
  update_option( 'ga_tc_type', 'id' );
 
21
  $ga_tc_deactivated = true;;
22
  }
23
 
24
 
25
  if (isset($_POST['ga_tc_submit_id']) && isset( $_POST['ga_tc_id'] )) {
26
  $ga_tc_id = trim(filter_input( INPUT_POST, 'ga_tc_id', FILTER_SANITIZE_STRING ));
 
 
27
  $ga_tc_type = 'id';
28
 
29
  if (empty($ga_tc_id) || preg_match( "/^UA\-[0-9]+\-[0-9]+$/i", $ga_tc_id)) {
30
  update_option('ga_tc_id', $ga_tc_id);
31
  update_option('ga_tc_type', 'id');
 
32
  if (empty($ga_tc_id)) {
33
  $ga_tc_deactivated = true;
34
  } else {
@@ -42,12 +56,16 @@
42
  if (isset($_POST['ga_tc_submit_code']) && isset($_POST['ga_tc_code'])) {
43
  $ga_tc_code = trim((strval($_POST['ga_tc_code'])));
44
 
 
 
 
45
  $regex = "/^\<script(.*?)?\>(.|\\n)*?\<\/script\>$/i";
46
  $ga_tc_type = 'code';
47
 
48
  if (empty($ga_tc_code) || preg_match( $regex, $ga_tc_code)) {
49
  update_option('ga_tc_code', $ga_tc_code);
50
  update_option('ga_tc_type', 'code');
 
51
 
52
  if (empty($ga_tc_code)) {
53
  $ga_tc_deactivated = true;
@@ -61,9 +79,8 @@
61
 
62
  ?>
63
 
64
- <div class="postbox-container">
65
- <h1><?php echo GA_TC_TITLE; ?></h1>
66
-
67
  <?php if($ga_tc_activated): ?>
68
  <div id="message" class="updated notice" style="margin-left: 0px; margin-right: 0px; background-color: #d6ffcb">
69
  <p>Google analitycs tracking code <strong>activated</strong>.</p>
@@ -85,15 +102,28 @@
85
  <div id="ga_tc_id_options" <?php if ($ga_tc_type == 'code') {echo 'style="display: none"';}?>>
86
  <div class="postbox">
87
  <div style="padding-left: 10px; border-bottom: 1px solid #e5e5e5">
 
88
  <h2>Automatically generate Google Analytics Code</h2>
89
  </div>
90
  <div style="padding: 10px;">
91
  <form method="post">
92
  <?php wp_nonce_field( GA_TC_PLUGIN_NAME ); ?>
93
  <table>
 
 
 
 
 
 
 
 
 
 
 
 
94
  <tr>
95
  <td>
96
- <b>Please, past your Google Analytics Tracking ID here:</b>
97
  </td>
98
  <td>
99
  <input type="text" name="ga_tc_id" value="<?php echo stripslashes($ga_tc_id);?>">
@@ -115,20 +145,33 @@
115
  </div>
116
  </div>
117
 
118
- <a href="javascript: void(0)" onclick="ga_tc_showSettings('code')" style="margin-left: 15px;">Manually past Google Analytics Code</a>
119
  </div>
120
 
121
  <div id="ga_tc_code_options" <?php if ($ga_tc_type == 'id') {echo 'style="display: none"';}?>>
122
  <div class="postbox">
123
  <div style="padding-left: 10px; border-bottom: 1px solid #e5e5e5">
124
- <h2>Manually past Google Analytics Code</h2>
125
  </div>
126
  <div style="padding: 10px;">
127
  <form method="post">
128
  <?php wp_nonce_field( GA_TC_PLUGIN_NAME ); ?>
129
  <table>
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  <tr>
131
- <td colspan="2"><b>Please, past your Google Analytics code here:</b></td>
132
  </tr>
133
  <tr>
134
  <td colspan="2">
@@ -148,7 +191,7 @@
148
  </td>
149
  </tr>
150
  <tr>
151
- <td>
152
  <p>More information about tracking code you can read on <a href="https://support.google.com/analytics/answer/1008080">Google Analytics support</a> pages.</p>
153
  If you have not yet created a google analytics account for this site, <a href='https://analytics.google.com/analytics/web/#management/Settings//%3Fm.page%3DNewAccount/' class='btn btn-xs btn-success'>create it</a>.
154
  </td>
@@ -158,10 +201,16 @@
158
  </div>
159
  </div>
160
 
161
- <a href="javascript: void(0)" onclick="ga_tc_showSettings('id')" style="margin-left: 15px;">Automatically generate Google Analytics Code</a>
162
  </div>
163
  </div>
164
 
 
 
 
 
 
 
165
  <script type="text/javascript">
166
  function ga_tc_showSettings(type) {
167
  if (type == 'id') {
9
  $ga_tc_type = get_option( 'ga_tc_type', 'id' );
10
 
11
 
12
+ $ga_tc_place = get_option( 'ga_tc_place', false);
13
+ if (!$ga_tc_place) {
14
+ if (empty($ga_tc_code) && empty($ga_tc_id)) {
15
+ $ga_tc_place = 'head';
16
+ } else {
17
+ $ga_tc_place = 'footer';
18
+ }
19
+ }
20
+
21
+
22
  if((mb_strtolower($_SERVER['REQUEST_METHOD']) == 'post')) {
23
  check_admin_referer( GA_TC_PLUGIN_NAME );
24
  }
28
  update_option( 'ga_tc_id', '' );
29
  update_option( 'ga_tc_code', '' );
30
  update_option( 'ga_tc_type', 'id' );
31
+ update_option( 'ga_tc_place', 'head' );
32
  $ga_tc_deactivated = true;;
33
  }
34
 
35
 
36
  if (isset($_POST['ga_tc_submit_id']) && isset( $_POST['ga_tc_id'] )) {
37
  $ga_tc_id = trim(filter_input( INPUT_POST, 'ga_tc_id', FILTER_SANITIZE_STRING ));
38
+ $ga_tc_place = trim(filter_input( INPUT_POST, 'ga_tc_place', FILTER_SANITIZE_STRING ));
39
+ $ga_tc_place = ($ga_tc_place == 'footer') ? 'footer' : 'header';
40
  $ga_tc_type = 'id';
41
 
42
  if (empty($ga_tc_id) || preg_match( "/^UA\-[0-9]+\-[0-9]+$/i", $ga_tc_id)) {
43
  update_option('ga_tc_id', $ga_tc_id);
44
  update_option('ga_tc_type', 'id');
45
+ update_option('ga_tc_place', $ga_tc_place);
46
  if (empty($ga_tc_id)) {
47
  $ga_tc_deactivated = true;
48
  } else {
56
  if (isset($_POST['ga_tc_submit_code']) && isset($_POST['ga_tc_code'])) {
57
  $ga_tc_code = trim((strval($_POST['ga_tc_code'])));
58
 
59
+ $ga_tc_place = trim(filter_input( INPUT_POST, 'ga_tc_place', FILTER_SANITIZE_STRING ));
60
+ $ga_tc_place = ($ga_tc_place == 'footer') ? 'footer' : 'header';
61
+
62
  $regex = "/^\<script(.*?)?\>(.|\\n)*?\<\/script\>$/i";
63
  $ga_tc_type = 'code';
64
 
65
  if (empty($ga_tc_code) || preg_match( $regex, $ga_tc_code)) {
66
  update_option('ga_tc_code', $ga_tc_code);
67
  update_option('ga_tc_type', 'code');
68
+ update_option('ga_tc_place', $ga_tc_place);
69
 
70
  if (empty($ga_tc_code)) {
71
  $ga_tc_deactivated = true;
79
 
80
  ?>
81
 
82
+ <h1><img class="acp_logo" src="<?php echo plugins_url("logo-24x24_transparent.png", __FILE__); ?>"><?php echo GA_TC_TITLE; ?></h1>
83
+ <div class="postbox-container" style="float:left; margin-right: 30px;">
 
84
  <?php if($ga_tc_activated): ?>
85
  <div id="message" class="updated notice" style="margin-left: 0px; margin-right: 0px; background-color: #d6ffcb">
86
  <p>Google analitycs tracking code <strong>activated</strong>.</p>
102
  <div id="ga_tc_id_options" <?php if ($ga_tc_type == 'code') {echo 'style="display: none"';}?>>
103
  <div class="postbox">
104
  <div style="padding-left: 10px; border-bottom: 1px solid #e5e5e5">
105
+
106
  <h2>Automatically generate Google Analytics Code</h2>
107
  </div>
108
  <div style="padding: 10px;">
109
  <form method="post">
110
  <?php wp_nonce_field( GA_TC_PLUGIN_NAME ); ?>
111
  <table>
112
+ <tr>
113
+ <td style="text-align: right">
114
+ <b>Please, select the place to insert the code:</b>
115
+ </td>
116
+ <td>
117
+ <select style="width: 100%;" name="ga_tc_place">
118
+ <option value="head">Page header (recommended)</option>
119
+ <option value="footer" <?php if($ga_tc_place == 'footer'){echo 'selected';} ?>>Page footer</option>
120
+ </select>
121
+
122
+ </td>
123
+ </tr>
124
  <tr>
125
  <td>
126
+ <b>Please, paste your Google Analytics Tracking ID here:</b>
127
  </td>
128
  <td>
129
  <input type="text" name="ga_tc_id" value="<?php echo stripslashes($ga_tc_id);?>">
145
  </div>
146
  </div>
147
 
148
+ <a href="javascript: void(0)" onclick="ga_tc_showSettings('code')" style="margin-left: 15px; font-weight: bold;">Manually past Google Analytics Code</a>
149
  </div>
150
 
151
  <div id="ga_tc_code_options" <?php if ($ga_tc_type == 'id') {echo 'style="display: none"';}?>>
152
  <div class="postbox">
153
  <div style="padding-left: 10px; border-bottom: 1px solid #e5e5e5">
154
+ <h2>Manually paste Google Analytics Code</h2>
155
  </div>
156
  <div style="padding: 10px;">
157
  <form method="post">
158
  <?php wp_nonce_field( GA_TC_PLUGIN_NAME ); ?>
159
  <table>
160
+ <tr>
161
+ <td style="width: 50px; white-space: nowrap">
162
+ <b>Please, select the place to insert the code:</b>
163
+ </td>
164
+ <td>
165
+ <select style="width: 100%;" name="ga_tc_place">
166
+ <option value="head">Page header (recommended)</option>
167
+ <option value="footer" <?php if($ga_tc_place == 'footer'){echo 'selected';} ?>>Page footer</option>
168
+ </select>
169
+
170
+ </td>
171
+ </tr>
172
+
173
  <tr>
174
+ <td colspan="2" style="padding-top:10px;"><b>Please, paste your Google Analytics code here:</b></td>
175
  </tr>
176
  <tr>
177
  <td colspan="2">
191
  </td>
192
  </tr>
193
  <tr>
194
+ <td colspan="2">
195
  <p>More information about tracking code you can read on <a href="https://support.google.com/analytics/answer/1008080">Google Analytics support</a> pages.</p>
196
  If you have not yet created a google analytics account for this site, <a href='https://analytics.google.com/analytics/web/#management/Settings//%3Fm.page%3DNewAccount/' class='btn btn-xs btn-success'>create it</a>.
197
  </td>
201
  </div>
202
  </div>
203
 
204
+ <a href="javascript: void(0)" onclick="ga_tc_showSettings('id')" style="margin-left: 15px; font-weight: bold;">Automatically generate Google Analytics Code</a>
205
  </div>
206
  </div>
207
 
208
+ <!--<div style="clear: both"></div>-->
209
+ <div class="acp_pro_container">
210
+ <?php require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pro.php'; ?>
211
+ </div>
212
+
213
+
214
  <script type="text/javascript">
215
  function ga_tc_showSettings(type) {
216
  if (type == 'id') {
pro.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="acp_get_pro">
2
+ <?php
3
+ if (isset($_GET['pay']) && $_GET['pay'] == 'success') {
4
+ ga_tc_check_license();
5
+ }
6
+
7
+ if (get_option('ga_tc_pro')):
8
+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pro_info.php';
9
+ else:
10
+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pro_get.php';
11
+ endif;
12
+
13
+ function ga_tc_check_license() {
14
+ $params = array(
15
+ 'method' => 'POST',
16
+ 'timeout' => 45,
17
+ 'redirection' => 5,
18
+ 'httpversion' => '1.0',
19
+ 'blocking' => true,
20
+ 'headers' => array(),
21
+ 'body' => array( 'url' => home_url() ),
22
+ 'cookies' => array(),
23
+ );
24
+
25
+ $pro = 0;
26
+ $request = wp_remote_post(GA_TC_SERVER . '/api/plugin-info', $params);
27
+ if ( !is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
28
+ $answer = json_decode($request['body'], true);
29
+ if (is_array($answer) && isset($answer['data']['info'])) {
30
+ $info = json_decode($answer['data']['info'], true);
31
+ if (isset($info['license']) && !empty($info['license'])) {
32
+ $pro = 1;
33
+ }
34
+ }
35
+ }
36
+
37
+ update_option('ga_tc_pro', $pro);
38
+ }
39
+
40
+ ?>
41
+ </div>
pro_charts.png ADDED
Binary file
pro_features.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul>
2
+ <li>General analytics (Users, Keywords, Sessions, Durations, Bounce Rate, etc.)</li>
3
+ <li>General statistics (Pageviews, User Sessions, Pages/Session, Avg. Session Duration, Bounce Rate of visitor, etc.)</li>
4
+ <li>Line charts of sessions, pageviews and users, etc.</li>
5
+ <li>Ratings of popular pages, popular keywords</li>
6
+ <li>Rating of countries and cities</li>
7
+ <li>Pie charts of device categories, operation systems, browsers, screen resolutions and others...</li>
8
+ <li>Any data exports in text format, for example to CSV, etc.</li>
9
+ <li>Pie charts data reports</li>
10
+ <li>Line chart data reports</li>
11
+ <li>Export of analytics data in PDF</li>
12
+ <li>Export of statistics and analytics data in TXT</li>
13
+ <li>The ability to print you own reports</li>
14
+ <li>Analytics reports with your Logo</li>
15
+ <li>Analytics reports with your signature</li>
16
+ <li>White-label reports</li>
17
+ <li>All data reports don't contain our copyrights</li>
18
+ <li>One Year Free Updates</li>
19
+ <li>One Year Priority support</li>
20
+ <li>etc.</li>
21
+ </ul>
pro_get.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $show_description = isset($_GET['description'])
3
+ ?>
4
+ <div class="ga_tc_pro_chart">
5
+ <div >
6
+ <h1 style="margin-top: 0px; text-shadow: 1px 1px 5px #929292;"> Use Professional Google Analytics Code plugin</h1>
7
+
8
+
9
+
10
+ <div class="slogan">Make available many professional things in your own Google Analytics like: data tables, line/pie charts, reports, exports of data and much more...</div>
11
+
12
+ <div style="margin-top: 10px; margin-bottom: 10px;">
13
+ <?php require dirname(__FILE__) . DIRECTORY_SEPARATOR . "notice_pro_screenshots2.php"; ?>
14
+ </div>
15
+
16
+
17
+
18
+ <div class="info" style=" width: 100%">
19
+ <div class="acp_pro_button">
20
+ <form method="post" action="<?php echo GA_TC_SERVER . '/billing/getPro';?>">
21
+ <input type="hidden" name="user_email" value="<?php echo get_option('admin_email'); ?>">
22
+ <input type="hidden" name="user_site" value="<?php echo home_url(); ?>">
23
+ <input type="hidden" name="refer" value="<?php echo 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . rtrim($_SERVER['HTTP_HOST'], '/')."/" . ltrim($_SERVER['REQUEST_URI'], '/'); ?>">
24
+ <input type="submit" class="acp_get_pro_btn" id="acp_get_pro_btn" value="Get PRO" style="margin-right: 20px;">
25
+
26
+ </form>
27
+ </div>
28
+
29
+
30
+ <div id="acp_pro_description">
31
+ <b>The following features are available in the Google Analytics PRO plugin:</b>
32
+ <?php require dirname(__FILE__) . DIRECTORY_SEPARATOR .'pro_features.php'; ?>
33
+ </div>
34
+ <div class="acp_pro_button">
35
+ <form method="post" action="<?php echo GA_TC_SERVER . '/billing/getPro';?>">
36
+ <input type="hidden" name="user_email" value="<?php echo get_option('admin_email'); ?>">
37
+ <input type="hidden" name="user_site" value="<?php echo home_url(); ?>">
38
+ <input type="hidden" name="refer" value="<?php echo 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . rtrim($_SERVER['HTTP_HOST'], '/')."/" . ltrim($_SERVER['REQUEST_URI'], '/'); ?>">
39
+ <input type="submit" class="acp_get_pro_btn" id="acp_get_pro_btn" value="Get PRO" style="margin-right: 20px;">
40
+
41
+ </form>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
pro_info.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="message" class="updated notice acp_purchased" style="display: table-cell; min-width: 300px; margin-left: 20px; margin-right: 0px; background-color: #d6ffcb">
2
+ <div>
3
+ <p><b>Professional version of Google Analytics Code plugin was purchased successfully!</b></p>
4
+ <p>
5
+ You can get the Google Analytics PRO plugin through WordPress plugin update.<br>
6
+ There are two ways to get the PRO version of Google Analytics:<br>
7
+ &nbsp;&nbsp;1. Just wait till WordPress will check for plugin updates (several times a day);<br>
8
+ &nbsp;&nbsp;2. Push the "<a href="<?php echo home_url() . '/wp-admin/update-core.php'; ?>">WordPress plugin update</a>" manually, to get GA installed directly;<br><br>
9
+ Please, do not forget to activate Professional Google Analytics Code plugin after installation/update.<br>
10
+ </p>
11
+ </div>
readme.txt CHANGED
@@ -1,11 +1,13 @@
1
  === Analytics ===
2
-
 
3
  Tags: Google Analytics, Analytics, Google Code, Code Integration, Analytics Code, Google Tracker Code, Tracker, Counter, website, web, page, Google, analytic, id, WordPress, site, automatic
4
  Requires at least: 3.9
5
- Tested up to: 4.4.1
6
  Stable tag: trunk
7
- Contributors: tms_gac
8
  License: GPLv2 or later
 
 
9
 
10
  Analytics of Google: analytics code integration on WordPress website
11
 
@@ -26,10 +28,19 @@ Analytics of Google: analytics code integration on WordPress website
26
  2. Activate the plugin through the 'Plugins' menu in WordPress;
27
  3. In your WordPress go to "Settings" -> "Google Analytics Code" and enter your Google Analytics Code there.
28
 
29
- == Screenshots ==
30
-
31
  == Changelog ==
 
 
 
 
 
 
 
32
 
33
- Google Analytics Version 1.0.0
 
 
34
 
35
- == Frequently Asked Questions ==
 
 
1
  === Analytics ===
2
+ Version: 1.2.3
3
+ Plugin Name: Analytics Code Integration
4
  Tags: Google Analytics, Analytics, Google Code, Code Integration, Analytics Code, Google Tracker Code, Tracker, Counter, website, web, page, Google, analytic, id, WordPress, site, automatic
5
  Requires at least: 3.9
6
+ Tested up to: 4.8
7
  Stable tag: trunk
 
8
  License: GPLv2 or later
9
+ Author: http://www.toolsanalytics.com/
10
+ Contributors: tms_gac
11
 
12
  Analytics of Google: analytics code integration on WordPress website
13
 
28
  2. Activate the plugin through the 'Plugins' menu in WordPress;
29
  3. In your WordPress go to "Settings" -> "Google Analytics Code" and enter your Google Analytics Code there.
30
 
 
 
31
  == Changelog ==
32
+ = Version 1.2.3 =
33
+ * Tested up to 4.7.4
34
+ * Bug fixes
35
+
36
+ = Google Analytics Version 1.2.2 =
37
+ * Tested up to 4.7.4
38
+ * Bug fixes
39
 
40
+ = Google Analytics Version 1.2.1 =
41
+ * Added the ability to select the place of the code on the page
42
+ * Bug fixes
43
 
44
+ = Google Analytics Version 1.1.0 =
45
+ * Tested up to 4.7.2
46
+ * Bug fixes
up.png ADDED
Binary file
update.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class ga_tc_update {
3
+ /**
4
+ * The plugin current version
5
+ * @var string
6
+ */
7
+ private $current_version;
8
+
9
+ /**
10
+ * The plugin remote update path
11
+ * @var string
12
+ */
13
+ private $update_path;
14
+
15
+ /**
16
+ * Plugin Slug (plugin_directory/plugin_file.php)
17
+ * @var string
18
+ */
19
+ private $plugin_slug;
20
+
21
+ /**
22
+ * Plugin name (plugin_file)
23
+ * @var string
24
+ */
25
+ private $slug;
26
+
27
+ /**
28
+ * Initialize a new instance of the WordPress Auto-Update class
29
+ * @param string $current_version
30
+ * @param string $update_path
31
+ * @param string $plugin_slug
32
+ */
33
+ public function __construct( $current_version, $update_path, $plugin_slug )
34
+ {
35
+ // Set the class public variables
36
+ $this->current_version = $current_version;
37
+ $this->update_path = $update_path;
38
+
39
+ // Set the Plugin Slug
40
+ $this->plugin_slug = $plugin_slug;
41
+ list ($t1, $t2) = explode( '/', $plugin_slug );
42
+ $this->slug = str_replace( '.php', '', $t2 );
43
+
44
+ // define the alternative API for updating checking
45
+ add_filter( 'pre_set_site_transient_update_plugins', array( &$this, 'check_update' ) );
46
+
47
+ // Define the alternative response for information checking
48
+ add_filter( 'plugins_api', array( &$this, 'check_info' ), 11, 3 );
49
+ }
50
+
51
+ /**
52
+ * Add our self-hosted autoupdate plugin to the filter transient
53
+ *
54
+ * @param $transient
55
+ * @return object $ transient
56
+ */
57
+ public function check_update( $transient )
58
+ {
59
+ if ( empty( $transient->checked ) ) {
60
+ return $transient;
61
+ }
62
+
63
+ // Get the remote version
64
+ $remote_version = $this->getRemote_version();
65
+
66
+ // If a newer version is available, add the update
67
+ if ( version_compare( $this->current_version, $remote_version->new_version, '<' ) ) {
68
+ $obj = new stdClass();
69
+ $obj->slug = $this->slug;
70
+ $obj->new_version = $remote_version->new_version;
71
+ $obj->url = $remote_version->url;
72
+ $obj->plugin = $this->plugin_slug;
73
+ $obj->package = $remote_version->package;
74
+ $obj->testes = $remote_version->tested;
75
+ $transient->response[$this->plugin_slug] = $obj;
76
+ }
77
+ return $transient;
78
+ }
79
+
80
+ /**
81
+ * Add our self-hosted description to the filter
82
+ *
83
+ * @param boolean $false
84
+ * @param array $action
85
+ * @param object $arg
86
+ * @return bool|object
87
+ */
88
+ public function check_info($false, $action, $arg)
89
+ {
90
+ if (isset($arg->slug) && $arg->slug === $this->slug) {
91
+ $information = $this->getRemote_information();
92
+
93
+
94
+ return $information;
95
+ }
96
+ return false;
97
+ }
98
+
99
+ /**
100
+ * Return the remote version
101
+ * @return string $remote_version
102
+ */
103
+ public function getRemote_version()
104
+ {
105
+ return $this->getRemote('plugin-version');
106
+ }
107
+
108
+ /**
109
+ * Get information about the remote version
110
+ * @return bool|object
111
+ */
112
+ public function getRemote_information()
113
+ {
114
+
115
+ return $this->getRemote('plugin-info');
116
+ }
117
+
118
+ protected function getRemote($method) {
119
+ $params = array(
120
+ 'method' => 'POST',
121
+ 'timeout' => 45,
122
+ 'redirection' => 5,
123
+ 'httpversion' => '1.0',
124
+ 'blocking' => true,
125
+ 'headers' => array(),
126
+ 'body' => array( 'url' => home_url() ),
127
+ 'cookies' => array(),
128
+ );
129
+
130
+ $request = wp_remote_post(GA_TC_SERVER . '/api/'.$method, $params);
131
+ if ( !is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
132
+ $answer = json_decode($request['body'], true);
133
+ if (is_array($answer) && isset($answer['data']['info'])) {
134
+ return (object)json_decode($answer['data']['info'], true);
135
+ }
136
+ }
137
+ return false;
138
+ }
139
+
140
+ /**
141
+ * Return the status of the plugin licensing
142
+ * @return boolean $remote_license
143
+ */
144
+ public function getRemote_license()
145
+ {
146
+ $params = array(
147
+ 'body' => array(
148
+ 'action' => 'license',
149
+ 'license_user' => $this->license_user,
150
+ 'license_key' => $this->license_key,
151
+ ),
152
+ );
153
+ $request = wp_remote_post( $this->update_path . 'pluginLicense', $params );
154
+ if ( !is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
155
+ $answer = json_decode($request['body'], true);
156
+ return (object)json_decode($answer['data']['info'], true);
157
+ }
158
+ return false;
159
+ }
160
+ }