Orbit Fox by ThemeIsle - Version 2.4.3

Version Description

  • 2018-03-04
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Orbit Fox by ThemeIsle
Version 2.4.3
Comparing to
See all releases

Code changes from version 2.4.2 to 2.4.3

CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
 
 
 
 
 
 
2
  ### v2.4.2 - 2018-03-02
3
  **Changes:**
4
  * Added a new Google Analytics Integration module
1
 
2
+ ### v2.4.3 - 2018-03-04
3
+ **Changes:**
4
+ * Fixed Analytics module issues.
5
+ * Better UX on module activation.
6
+
7
  ### v2.4.2 - 2018-03-02
8
  **Changes:**
9
  * Added a new Google Analytics Integration module
core/app/helpers/class-orbit-fox-render-helper.php CHANGED
@@ -23,9 +23,11 @@ class Orbit_Fox_Render_Helper {
23
  *
24
  * @since 1.0.0
25
  * @access public
 
26
  * @param string $name The name of the partial w/o '-tpl.php'.
27
  * @param array $args Optional. An associative array with name and value to be
28
- * passed to the partial.
 
29
  * @return string
30
  */
31
  public function get_partial( $name = '', $args = array() ) {
@@ -39,6 +41,7 @@ class Orbit_Fox_Render_Helper {
39
  if ( file_exists( $file ) ) {
40
  include $file;
41
  }
 
42
  return ob_get_clean();
43
  }
44
 
@@ -47,9 +50,11 @@ class Orbit_Fox_Render_Helper {
47
  *
48
  * @since 1.0.0
49
  * @access public
 
50
  * @param string $name The name of the partial w/o '-page.php'.
51
  * @param array $args Optional. An associative array with name and value to be
52
- * passed to the view.
 
53
  * @return string
54
  */
55
  public function get_view( $name = '', $args = array() ) {
@@ -63,6 +68,7 @@ class Orbit_Fox_Render_Helper {
63
  if ( file_exists( $file ) ) {
64
  include $file;
65
  }
 
66
  return ob_get_clean();
67
  }
68
 
@@ -71,7 +77,9 @@ class Orbit_Fox_Render_Helper {
71
  *
72
  * @since 1.0.0
73
  * @access private
74
- * @param array $option The specific defaults array.
 
 
75
  * @return array
76
  */
77
  private function sanitize_option( $option ) {
@@ -98,7 +106,9 @@ class Orbit_Fox_Render_Helper {
98
  *
99
  * @since 1.0.0
100
  * @access private
 
101
  * @param array $option The option from the module.
 
102
  * @return mixed
103
  */
104
  private function set_field_value( $option = array() ) {
@@ -106,6 +116,7 @@ class Orbit_Fox_Render_Helper {
106
  if ( isset( $option['value'] ) && $option['value'] != '' ) {
107
  $field_value = $option['value'];
108
  }
 
109
  return $field_value;
110
  }
111
 
@@ -114,8 +125,10 @@ class Orbit_Fox_Render_Helper {
114
  *
115
  * @since 1.0.0
116
  * @access private
 
117
  * @param string $element_id The option id field.
118
  * @param string $title The option title field.
 
119
  * @return string
120
  */
121
  private function get_title( $element_id, $title ) {
@@ -123,6 +136,7 @@ class Orbit_Fox_Render_Helper {
123
  if ( $title ) {
124
  $display_title = '<label class="form-label" for="' . $element_id . '">' . $title . '</label>';
125
  }
 
126
  return $display_title;
127
  }
128
 
@@ -131,7 +145,9 @@ class Orbit_Fox_Render_Helper {
131
  *
132
  * @since 1.0.0
133
  * @access private
 
134
  * @param string $description The option description field.
 
135
  * @return string
136
  */
137
  private function get_description( $description ) {
@@ -139,6 +155,7 @@ class Orbit_Fox_Render_Helper {
139
  if ( $description ) {
140
  $display_description = '<p><small>' . $description . '</small></p>';
141
  }
 
142
  return $display_description;
143
  }
144
 
@@ -147,8 +164,10 @@ class Orbit_Fox_Render_Helper {
147
  *
148
  * @since 1.0.0
149
  * @access private
 
150
  * @param array $option The option array.
151
  * @param string $element The element we want to wrap.
 
152
  * @return string
153
  */
154
  private function wrap_element( $option, $element ) {
@@ -167,13 +186,13 @@ class Orbit_Fox_Render_Helper {
167
 
168
  return '
169
  ' . $before_wrap . '
170
- <div class="form-group ' . $option['class'] . '">
171
- ' . $title . '
172
- ' . $element . '
173
- ' . $description . '
174
- </div>
175
- ' . $after_wrap . '
176
- ';
177
  }
178
 
179
  /**
@@ -181,20 +200,22 @@ class Orbit_Fox_Render_Helper {
181
  *
182
  * @since 1.0.0
183
  * @access private
 
184
  * @param string $type The field type ( checkbox | radio ).
185
  * @param string $field_value The field value.
186
  * @param string $checked The checked flag.
187
  * @param string $label The option label.
188
  * @param array $option The option from the module.
 
189
  * @return string
190
  */
191
  private function generate_check_type( $type = 'radio', $field_value, $checked, $label, $option = array() ) {
192
  return '
193
- <label class="form-' . $type . ' ' . $option['class'] . '">
194
- <input type="' . $type . '" name="' . $option['name'] . '" value="' . $field_value . '" ' . $checked . ' />
195
- <i class="form-icon"></i> ' . $label . '
196
- </label>
197
- ';
198
  }
199
 
200
  /**
@@ -202,8 +223,10 @@ class Orbit_Fox_Render_Helper {
202
  *
203
  * @since 1.0.0
204
  * @access private
 
205
  * @param array $option The option from the module.
206
  * @param bool $is_email Render an email input instead of text.
 
207
  * @return mixed
208
  */
209
  private function field_text( $option = array(), $is_email = false ) {
@@ -224,7 +247,9 @@ class Orbit_Fox_Render_Helper {
224
  *
225
  * @since 1.0.0
226
  * @access private
 
227
  * @param array $option The option from the module.
 
228
  * @return mixed
229
  */
230
  private function field_textarea( $option = array() ) {
@@ -240,7 +265,9 @@ class Orbit_Fox_Render_Helper {
240
  *
241
  * @since 1.0.0
242
  * @access private
 
243
  * @param array $option The option from the module.
 
244
  * @return mixed
245
  */
246
  private function field_select( $option = array() ) {
@@ -254,9 +281,9 @@ class Orbit_Fox_Render_Helper {
254
  $select_options .= '<option value="' . $value . '" ' . $is_selected . '>' . $label . '</option>';
255
  }
256
  $field = '
257
- <select class="form-select ' . $option['class'] . '" id="' . $option['id'] . '" name="' . $option['name'] . '" placeholder="' . $option['placeholder'] . '">
258
- ' . $select_options . '
259
- </select>';
260
  $field = $this->wrap_element( $option, $field );
261
 
262
  return $field;
@@ -267,7 +294,9 @@ class Orbit_Fox_Render_Helper {
267
  *
268
  * @since 1.0.0
269
  * @access private
 
270
  * @param array $option The option from the module.
 
271
  * @return mixed
272
  */
273
  private function field_radio( $option = array() ) {
@@ -290,7 +319,9 @@ class Orbit_Fox_Render_Helper {
290
  *
291
  * @since 1.0.0
292
  * @access private
 
293
  * @param array $option The option from the module.
 
294
  * @return mixed
295
  */
296
  private function field_checkbox( $option = array() ) {
@@ -310,7 +341,9 @@ class Orbit_Fox_Render_Helper {
310
  *
311
  * @since 1.0.0
312
  * @access private
 
313
  * @param array $option The option from the module.
 
314
  * @return mixed
315
  */
316
  private function field_toggle( $option = array() ) {
@@ -320,10 +353,31 @@ class Orbit_Fox_Render_Helper {
320
  $checked = 'checked';
321
  }
322
  $field = '
323
- <label class="form-switch ' . $option['class'] . '">
324
- <input type="checkbox" name="' . $option['name'] . '" value="1" ' . $checked . ' />
325
- <i class="form-icon"></i> ' . $option['label'] . '
326
- </label>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  $field = $this->wrap_element( $option, $field );
328
 
329
  return $field;
@@ -334,6 +388,7 @@ class Orbit_Fox_Render_Helper {
334
  *
335
  * @since 1.0.0
336
  * @access public
 
337
  * @param array $option The option from the module..
338
  *
339
  * @return mixed
@@ -365,7 +420,9 @@ class Orbit_Fox_Render_Helper {
365
  break;
366
  case 'custom':
367
  return apply_filters( 'obfx_custom_control_' . $option['id'], '' );
368
-
 
 
369
  break;
370
  default:
371
  return __( 'No option found for provided type', 'themeisle-companion' );
23
  *
24
  * @since 1.0.0
25
  * @access public
26
+ *
27
  * @param string $name The name of the partial w/o '-tpl.php'.
28
  * @param array $args Optional. An associative array with name and value to be
29
+ * passed to the partial.
30
+ *
31
  * @return string
32
  */
33
  public function get_partial( $name = '', $args = array() ) {
41
  if ( file_exists( $file ) ) {
42
  include $file;
43
  }
44
+
45
  return ob_get_clean();
46
  }
47
 
50
  *
51
  * @since 1.0.0
52
  * @access public
53
+ *
54
  * @param string $name The name of the partial w/o '-page.php'.
55
  * @param array $args Optional. An associative array with name and value to be
56
+ * passed to the view.
57
+ *
58
  * @return string
59
  */
60
  public function get_view( $name = '', $args = array() ) {
68
  if ( file_exists( $file ) ) {
69
  include $file;
70
  }
71
+
72
  return ob_get_clean();
73
  }
74
 
77
  *
78
  * @since 1.0.0
79
  * @access private
80
+ *
81
+ * @param array $option The specific defaults array.
82
+ *
83
  * @return array
84
  */
85
  private function sanitize_option( $option ) {
106
  *
107
  * @since 1.0.0
108
  * @access private
109
+ *
110
  * @param array $option The option from the module.
111
+ *
112
  * @return mixed
113
  */
114
  private function set_field_value( $option = array() ) {
116
  if ( isset( $option['value'] ) && $option['value'] != '' ) {
117
  $field_value = $option['value'];
118
  }
119
+
120
  return $field_value;
121
  }
122
 
125
  *
126
  * @since 1.0.0
127
  * @access private
128
+ *
129
  * @param string $element_id The option id field.
130
  * @param string $title The option title field.
131
+ *
132
  * @return string
133
  */
134
  private function get_title( $element_id, $title ) {
136
  if ( $title ) {
137
  $display_title = '<label class="form-label" for="' . $element_id . '">' . $title . '</label>';
138
  }
139
+
140
  return $display_title;
141
  }
142
 
145
  *
146
  * @since 1.0.0
147
  * @access private
148
+ *
149
  * @param string $description The option description field.
150
+ *
151
  * @return string
152
  */
153
  private function get_description( $description ) {
155
  if ( $description ) {
156
  $display_description = '<p><small>' . $description . '</small></p>';
157
  }
158
+
159
  return $display_description;
160
  }
161
 
164
  *
165
  * @since 1.0.0
166
  * @access private
167
+ *
168
  * @param array $option The option array.
169
  * @param string $element The element we want to wrap.
170
+ *
171
  * @return string
172
  */
173
  private function wrap_element( $option, $element ) {
186
 
187
  return '
188
  ' . $before_wrap . '
189
+ <div class="form-group ' . $option['class'] . '">
190
+ ' . $title . '
191
+ ' . $element . '
192
+ ' . $description . '
193
+ </div>
194
+ ' . $after_wrap . '
195
+ ';
196
  }
197
 
198
  /**
200
  *
201
  * @since 1.0.0
202
  * @access private
203
+ *
204
  * @param string $type The field type ( checkbox | radio ).
205
  * @param string $field_value The field value.
206
  * @param string $checked The checked flag.
207
  * @param string $label The option label.
208
  * @param array $option The option from the module.
209
+ *
210
  * @return string
211
  */
212
  private function generate_check_type( $type = 'radio', $field_value, $checked, $label, $option = array() ) {
213
  return '
214
+ <label class="form-' . $type . ' ' . $option['class'] . '">
215
+ <input type="' . $type . '" name="' . $option['name'] . '" value="' . $field_value . '" ' . $checked . ' />
216
+ <i class="form-icon"></i> ' . $label . '
217
+ </label>
218
+ ';
219
  }
220
 
221
  /**
223
  *
224
  * @since 1.0.0
225
  * @access private
226
+ *
227
  * @param array $option The option from the module.
228
  * @param bool $is_email Render an email input instead of text.
229
+ *
230
  * @return mixed
231
  */
232
  private function field_text( $option = array(), $is_email = false ) {
247
  *
248
  * @since 1.0.0
249
  * @access private
250
+ *
251
  * @param array $option The option from the module.
252
+ *
253
  * @return mixed
254
  */
255
  private function field_textarea( $option = array() ) {
265
  *
266
  * @since 1.0.0
267
  * @access private
268
+ *
269
  * @param array $option The option from the module.
270
+ *
271
  * @return mixed
272
  */
273
  private function field_select( $option = array() ) {
281
  $select_options .= '<option value="' . $value . '" ' . $is_selected . '>' . $label . '</option>';
282
  }
283
  $field = '
284
+ <select class="form-select ' . $option['class'] . '" id="' . $option['id'] . '" name="' . $option['name'] . '" placeholder="' . $option['placeholder'] . '">
285
+ ' . $select_options . '
286
+ </select>';
287
  $field = $this->wrap_element( $option, $field );
288
 
289
  return $field;
294
  *
295
  * @since 1.0.0
296
  * @access private
297
+ *
298
  * @param array $option The option from the module.
299
+ *
300
  * @return mixed
301
  */
302
  private function field_radio( $option = array() ) {
319
  *
320
  * @since 1.0.0
321
  * @access private
322
+ *
323
  * @param array $option The option from the module.
324
+ *
325
  * @return mixed
326
  */
327
  private function field_checkbox( $option = array() ) {
341
  *
342
  * @since 1.0.0
343
  * @access private
344
+ *
345
  * @param array $option The option from the module.
346
+ *
347
  * @return mixed
348
  */
349
  private function field_toggle( $option = array() ) {
353
  $checked = 'checked';
354
  }
355
  $field = '
356
+ <label class="form-switch ' . $option['class'] . '">
357
+ <input type="checkbox" name="' . $option['name'] . '" value="1" ' . $checked . ' />
358
+ <i class="form-icon"></i> ' . $option['label'] . '
359
+ </label>';
360
+ $field = $this->wrap_element( $option, $field );
361
+
362
+ return $field;
363
+ }
364
+
365
+ /**
366
+ * Render a toggle field.
367
+ *
368
+ * @since 1.0.0
369
+ * @access private
370
+ *
371
+ * @param array $option The option from the module.
372
+ *
373
+ * @return mixed
374
+ */
375
+ private function field_link( $option = array() ) {
376
+ $field = '
377
+ <a id="' . esc_attr( $option['link-id'] ) . '" class="' . esc_attr( $option['link-class'] ) . '" href="' . esc_url( $option['url'] ) . '">' .
378
+ wp_kses_post( $option['text'] )
379
+ . '</a>';
380
+
381
  $field = $this->wrap_element( $option, $field );
382
 
383
  return $field;
388
  *
389
  * @since 1.0.0
390
  * @access public
391
+ *
392
  * @param array $option The option from the module..
393
  *
394
  * @return mixed
420
  break;
421
  case 'custom':
422
  return apply_filters( 'obfx_custom_control_' . $option['id'], '' );
423
+ break;
424
+ case 'link':
425
+ return $this->field_link( $option );
426
  break;
427
  default:
428
  return __( 'No option found for provided type', 'themeisle-companion' );
core/assets/css/orbit-fox-admin.css CHANGED
@@ -8,7 +8,7 @@
8
  * Extends Spectre.css Library
9
  */
10
  /*
11
- Version: 2.4.2
12
  */
13
 
14
  /* Document
8
  * Extends Spectre.css Library
9
  */
10
  /*
11
+ Version: 2.4.3
12
  */
13
 
14
  /* Document
core/includes/class-orbit-fox.php CHANGED
@@ -69,7 +69,7 @@ class Orbit_Fox {
69
 
70
  $this->plugin_name = 'orbit-fox';
71
 
72
- $this->version = '2.4.2';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
69
 
70
  $this->plugin_name = 'orbit-fox';
71
 
72
+ $this->version = '2.4.3';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
obfx_modules/google-analytics/init.php CHANGED
@@ -82,9 +82,6 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
82
  $this->loader->add_action( 'rest_api_init', $this, 'register_endpoints' );
83
  $this->loader->add_action( 'current_screen', $this, 'maybe_save_obfx_token' );
84
  $this->loader->add_action( 'admin_enqueue_scripts', $this, 'enqueue_analytics_scripts' );
85
- $this->loader->add_filter( 'obfx_custom_control_google_signin', $this, 'generate_analytics_login' );
86
- $this->loader->add_filter( 'obfx_custom_control_analytics_accounts_refresh', $this, 'render_refresh_control' );
87
- $this->loader->add_filter( 'obfx_custom_control_analytics_accounts_unregister', $this, 'render_unregister_control' );
88
  $this->loader->add_action( 'wp_head', $this, 'output_analytics_code', 0 );
89
  }
90
 
@@ -100,6 +97,11 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
100
  ) );
101
  }
102
 
 
 
 
 
 
103
  public function refresh_tracking_links() {
104
 
105
  if ( ! current_user_can( 'manage_options' ) ) {
@@ -117,6 +119,13 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
117
  $this->get_tracking_codes( $obfx_token, true );
118
  }
119
 
 
 
 
 
 
 
 
120
  public function unregister_website( $obfx_token ) {
121
  if ( ! isset( $obfx_token ) ) {
122
  return false;
@@ -147,6 +156,9 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
147
  return array();
148
  }
149
 
 
 
 
150
  public function enqueue_analytics_scripts() {
151
  $script_handle = $this->slug . '-script';
152
  wp_register_script( $script_handle, plugin_dir_url( $this->get_dir() ) . $this->slug . '/js/script.js', array( 'jquery' ), $this->version );
@@ -191,11 +203,20 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
191
  public function options() {
192
  $token = get_option( 'obfx_token', '' );
193
  if ( empty( $token ) ) {
 
 
 
 
 
 
194
  return array(
195
  array(
196
- 'id' => 'google_signin',
197
- 'name' => 'google_signin',
198
- 'type' => 'custom',
 
 
 
199
  ),
200
  );
201
  }
@@ -215,7 +236,11 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
215
  array(
216
  'id' => 'analytics_accounts_refresh',
217
  'name' => 'analytics_accounts_refresh',
218
- 'type' => 'custom',
 
 
 
 
219
  ),
220
  array(
221
  'id' => 'analytics_accounts_select',
@@ -227,33 +252,15 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
227
  array(
228
  'id' => 'analytics_accounts_unregister',
229
  'name' => 'analytics_accounts_unregister',
230
- 'type' => 'custom',
 
 
 
 
231
  )
232
  );
233
  }
234
 
235
- /**
236
- * Render the refresh button.
237
- *
238
- * @return string
239
- */
240
- public function render_refresh_control() {
241
- $refresh_button = '<button id="refresh-analytics-accounts" class="btn btn-primary btn-sm"><i class="dashicons dashicons-update"></i> ' . __( 'Refresh Accounts', 'themeisle-companion' ) . '</button><p></p>';
242
-
243
- return $refresh_button;
244
- }
245
-
246
- /**
247
- * Render the unregister button.
248
- *
249
- * @return string
250
- */
251
- public function render_unregister_control() {
252
- $unregister_button = '<button id="unregister-analytics" class="btn btn-sm"><i class="dashicons dashicons-no"></i>' . __( 'Unregister Site', 'themeisle-companion' ) . '</button><p>';
253
-
254
- return $unregister_button;
255
- }
256
-
257
  /**
258
  * Get tracking codes from server.
259
  *
@@ -296,24 +303,6 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
296
  update_option( 'obfx_google_accounts_tracking_codes', $accounts );
297
  }
298
 
299
- /**
300
- * Generates the analytics login control.
301
- *
302
- * @return string
303
- */
304
- public function generate_analytics_login() {
305
- $url = $this->api_url . '/auth';
306
- $url = add_query_arg( array(
307
- 'site_hash' => $this->get_site_hash(),
308
- 'site_url' => home_url(),
309
- 'site_return' => admin_url( 'admin.php?page=obfx_companion' ),
310
- ), $url );
311
-
312
- $template = '<a class="btn btn-success" href="' . esc_url( $url ) . '"><span class="dashicons dashicons-googleplus obfx-google"></span>' . __( 'Authenticate with Google', 'themeisle-companion' ) . '</a>';
313
-
314
- return $template;
315
- }
316
-
317
  /**
318
  * Generate a website hash.
319
  *
@@ -349,21 +338,21 @@ class Google_Analytics_OBFX_Module extends Orbit_Fox_Module_Abstract {
349
 
350
  public final function output_analytics_code() {
351
  $ua_code = $this->get_option( 'analytics_accounts_select' ); ?>
352
- <!-- Google Analytics -->
353
- <!-- Global site tag (gtag.js) - Google Analytics -->
354
- <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo esc_attr( $ua_code ); ?>"></script>
355
- <script>
356
- window.dataLayer = window.dataLayer || [];
357
-
358
- function gtag() {
359
- dataLayer.push( arguments );
360
- }
361
 
362
- gtag( 'js', new Date() );
363
 
364
- gtag( 'config', '<?php echo esc_attr( $ua_code ); ?>' );
365
- </script>
366
- <!-- End Google Analytics -->
367
  <?php
368
  }
369
  }
82
  $this->loader->add_action( 'rest_api_init', $this, 'register_endpoints' );
83
  $this->loader->add_action( 'current_screen', $this, 'maybe_save_obfx_token' );
84
  $this->loader->add_action( 'admin_enqueue_scripts', $this, 'enqueue_analytics_scripts' );
 
 
 
85
  $this->loader->add_action( 'wp_head', $this, 'output_analytics_code', 0 );
86
  }
87
 
97
  ) );
98
  }
99
 
100
+ /**
101
+ * Refresh Tracking links.
102
+ *
103
+ * @return array|bool|WP_Error
104
+ */
105
  public function refresh_tracking_links() {
106
 
107
  if ( ! current_user_can( 'manage_options' ) ) {
119
  $this->get_tracking_codes( $obfx_token, true );
120
  }
121
 
122
+ /**
123
+ * Unregister website.
124
+ *
125
+ * @param $obfx_token
126
+ *
127
+ * @return array|bool|WP_Error
128
+ */
129
  public function unregister_website( $obfx_token ) {
130
  if ( ! isset( $obfx_token ) ) {
131
  return false;
156
  return array();
157
  }
158
 
159
+ /**
160
+ * Enqueue JavaScript that requires localization.
161
+ */
162
  public function enqueue_analytics_scripts() {
163
  $script_handle = $this->slug . '-script';
164
  wp_register_script( $script_handle, plugin_dir_url( $this->get_dir() ) . $this->slug . '/js/script.js', array( 'jquery' ), $this->version );
203
  public function options() {
204
  $token = get_option( 'obfx_token', '' );
205
  if ( empty( $token ) ) {
206
+ $url = $this->api_url . '/auth';
207
+ $url = add_query_arg( array(
208
+ 'site_hash' => $this->get_site_hash(),
209
+ 'site_url' => home_url(),
210
+ 'site_return' => admin_url( 'admin.php?page=obfx_companion' ),
211
+ ), $url );
212
  return array(
213
  array(
214
+ 'id' => 'google_signin',
215
+ 'name' => 'google_signin',
216
+ 'type' => 'link',
217
+ 'url' => $url,
218
+ 'link-class' => 'btn btn-success',
219
+ 'text' => '<span class="dashicons dashicons-googleplus obfx-google"></span>' . __( 'Authenticate with Google', 'themeisle-companion' ),
220
  ),
221
  );
222
  }
236
  array(
237
  'id' => 'analytics_accounts_refresh',
238
  'name' => 'analytics_accounts_refresh',
239
+ 'type' => 'link',
240
+ 'link-class' => 'btn btn-primary btn-sm',
241
+ 'link-id' => 'refresh-analytics-accounts',
242
+ 'text' => '<i class="dashicons dashicons-update"></i> ' . __( 'Refresh Accounts', 'themeisle-companion' ),
243
+ 'url' => ''
244
  ),
245
  array(
246
  'id' => 'analytics_accounts_select',
252
  array(
253
  'id' => 'analytics_accounts_unregister',
254
  'name' => 'analytics_accounts_unregister',
255
+ 'type' => 'link',
256
+ 'link-class' => 'btn btn-sm',
257
+ 'link-id' => 'unregister-analytics',
258
+ 'text' => '<i class="dashicons dashicons-no"></i>' . __( 'Unregister Site', 'themeisle-companion' ),
259
+ 'url' => ''
260
  )
261
  );
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  /**
265
  * Get tracking codes from server.
266
  *
303
  update_option( 'obfx_google_accounts_tracking_codes', $accounts );
304
  }
305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  /**
307
  * Generate a website hash.
308
  *
338
 
339
  public final function output_analytics_code() {
340
  $ua_code = $this->get_option( 'analytics_accounts_select' ); ?>
341
+ <!-- Google Analytics -->
342
+ <!-- Global site tag (gtag.js) - Google Analytics -->
343
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo esc_attr( $ua_code ); ?>"></script>
344
+ <script>
345
+ window.dataLayer = window.dataLayer || [];
346
+
347
+ function gtag() {
348
+ dataLayer.push( arguments );
349
+ }
350
 
351
+ gtag( 'js', new Date() );
352
 
353
+ gtag( 'config', '<?php echo esc_attr( $ua_code ); ?>' );
354
+ </script>
355
+ <!-- End Google Analytics -->
356
  <?php
357
  }
358
  }
readme.md CHANGED
@@ -1,7 +1,7 @@
1
  # Orbit Fox by ThemeIsle #
2
  **Contributors:** [themeisle](https://profiles.wordpress.org/themeisle), [codeinwp](https://profiles.wordpress.org/codeinwp), [rodicaelena](https://profiles.wordpress.org/rodicaelena), [baicusandrei](https://profiles.wordpress.org/baicusandrei)
3
  **Tags:** widget, admin, widgets, sharing, sections, themes, stock photos, custom icons, icons, menu icons, stock, templates
4
- **Requires at least:** 3.0
5
  **Tested up to:** 4.9
6
  **Requires PHP:** 5.3
7
  **Stable tag:** trunk
@@ -98,6 +98,12 @@ Activating the Orbit Fox plugin is just like any other plugin. If you've uploade
98
  5. Social Sharing Module
99
 
100
  ## Changelog ##
 
 
 
 
 
 
101
  ### 2.4.2 - 2018-03-02 ###
102
 
103
  * Added a new Google Analytics Integration module
1
  # Orbit Fox by ThemeIsle #
2
  **Contributors:** [themeisle](https://profiles.wordpress.org/themeisle), [codeinwp](https://profiles.wordpress.org/codeinwp), [rodicaelena](https://profiles.wordpress.org/rodicaelena), [baicusandrei](https://profiles.wordpress.org/baicusandrei)
3
  **Tags:** widget, admin, widgets, sharing, sections, themes, stock photos, custom icons, icons, menu icons, stock, templates
4
+ **Requires at least:** 4.7
5
  **Tested up to:** 4.9
6
  **Requires PHP:** 5.3
7
  **Stable tag:** trunk
98
  5. Social Sharing Module
99
 
100
  ## Changelog ##
101
+ ### 2.4.3 - 2018-03-04 ###
102
+
103
+ * Fixed Analytics module issues.
104
+ * Better UX on module activation.
105
+
106
+
107
  ### 2.4.2 - 2018-03-02 ###
108
 
109
  * Added a new Google Analytics Integration module
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Orbit Fox by ThemeIsle ===
2
  Contributors: themeisle, codeinwp, rodicaelena, baicusandrei
3
  Tags: widget, admin, widgets, sharing, sections, themes, stock photos, custom icons, icons, menu icons, stock, templates
4
- Requires at least: 3.0
5
  Tested up to: 4.9
6
  Requires PHP: 5.3
7
  Stable tag: trunk
@@ -98,6 +98,12 @@ Activating the Orbit Fox plugin is just like any other plugin. If you've uploade
98
  5. Social Sharing Module
99
 
100
  == Changelog ==
 
 
 
 
 
 
101
  = 2.4.2 - 2018-03-02 =
102
 
103
  * Added a new Google Analytics Integration module
1
  === Orbit Fox by ThemeIsle ===
2
  Contributors: themeisle, codeinwp, rodicaelena, baicusandrei
3
  Tags: widget, admin, widgets, sharing, sections, themes, stock photos, custom icons, icons, menu icons, stock, templates
4
+ Requires at least: 4.7
5
  Tested up to: 4.9
6
  Requires PHP: 5.3
7
  Stable tag: trunk
98
  5. Social Sharing Module
99
 
100
  == Changelog ==
101
+ = 2.4.3 - 2018-03-04 =
102
+
103
+ * Fixed Analytics module issues.
104
+ * Better UX on module activation.
105
+
106
+
107
  = 2.4.2 - 2018-03-02 =
108
 
109
  * Added a new Google Analytics Integration module
themeisle-companion.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Orbit Fox Companion
16
  * Plugin URI: https://themeisle.com/plugins/orbit-fox-companion
17
  * Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, and newly added Elementor/BeaverBuilder page builder widgets on each release.
18
- * Version: 2.4.2
19
  * Author: Themeisle
20
  * Author URI: https://themeisle.com
21
  * License: GPL-2.0+
15
  * Plugin Name: Orbit Fox Companion
16
  * Plugin URI: https://themeisle.com/plugins/orbit-fox-companion
17
  * Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, and newly added Elementor/BeaverBuilder page builder widgets on each release.
18
+ * Version: 2.4.3
19
  * Author: Themeisle
20
  * Author URI: https://themeisle.com
21
  * License: GPL-2.0+
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"class-autoloader.php":"57e533b653d235e76cb9953720e4f5e9","index.php":"39ab8276fb0e4bd3fcab3270822c5977","themeisle-companion.php":"87f3347ee3a4e3c1e19cc67a6bfd30fb","uninstall.php":"7abf753a29e0eb3a844c8a0ba9493b7c"}
1
+ {"class-autoloader.php":"57e533b653d235e76cb9953720e4f5e9","index.php":"39ab8276fb0e4bd3fcab3270822c5977","themeisle-companion.php":"5005e6e289096c84eb8593335bfae032","uninstall.php":"7abf753a29e0eb3a844c8a0ba9493b7c"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit06dc1b4c7b9f52f5879703b184cdab5c::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf68c1b12f1f2eca69b3c1fdbd1ce9b09::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit06dc1b4c7b9f52f5879703b184cdab5c
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit06dc1b4c7b9f52f5879703b184cdab5c
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit06dc1b4c7b9f52f5879703b184cdab5c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit06dc1b4c7b9f52f5879703b184cdab5c', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit06dc1b4c7b9f52f5879703b184cdab5c
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire06dc1b4c7b9f52f5879703b184cdab5c($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire06dc1b4c7b9f52f5879703b184cdab5c($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf68c1b12f1f2eca69b3c1fdbd1ce9b09
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf68c1b12f1f2eca69b3c1fdbd1ce9b09', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf68c1b12f1f2eca69b3c1fdbd1ce9b09', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequiref68c1b12f1f2eca69b3c1fdbd1ce9b09($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequiref68c1b12f1f2eca69b3c1fdbd1ce9b09($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;