VK All in One Expansion Unit - Version 6.3.1

Version Description

Download this release

Release Info

Developer kurudrive
Plugin Icon 128x128 VK All in One Expansion Unit
Version 6.3.1
Comparing to
See all releases

Code changes from version 6.3.0 to 6.3.1

plugins/google_analytics/google_analytics.php CHANGED
@@ -5,10 +5,10 @@
5
 
6
  function vkExUnit_add_ga_options_page() {
7
  // require dirname( __FILE__ ) . '/ga_admin.php';
8
- require_once(dirname(__FILE__)."/ga_admin.php");
9
  }
10
  // カスタマイザー読み込み
11
- require_once(dirname(__FILE__)."/ga_customizer.php");
12
 
13
 
14
  /*-------------------------------------------*/
@@ -20,8 +20,8 @@ function vkExUnit_ga_options_init() {
20
  }
21
 
22
  vkExUnit_register_setting(
23
- __( 'Google Analytics Settings', 'vkExUnit' ), // Immediately following form tag of edit page.
24
- 'vkExUnit_ga_options', // name attr
25
  'vkExUnit_ga_options_validate',
26
  'vkExUnit_add_ga_options_page'
27
  );
@@ -29,10 +29,10 @@ function vkExUnit_ga_options_init() {
29
  add_action( 'vkExUnit_package_init', 'vkExUnit_ga_options_init' );
30
 
31
  function vkExUnit_get_ga_options() {
32
- $options = get_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() );
33
- $options_dafault = vkExUnit_get_ga_options_default();
34
  foreach ( $options_dafault as $key => $value ) {
35
- $options[ $key ] = ( isset( $options[ $key ] )) ? $options[ $key ] : $options_dafault[ $key ];
36
  }
37
  return apply_filters( 'vkExUnit_ga_options', $options );
38
  }
@@ -55,8 +55,8 @@ function vkExUnit_ga_options_validate( $input ) {
55
  $input = wp_parse_args( $input, $defaults );
56
 
57
  // 入力値をサニタイズ
58
- $output[ 'gaId' ] = esc_html($input[ 'gaId' ]);
59
- $output[ 'gaType'] = esc_html($input[ 'gaType' ]);
60
 
61
  return apply_filters( 'vkExUnit_ga_options_validate', $output, $input, $defaults );
62
  }
@@ -64,62 +64,69 @@ function vkExUnit_ga_options_validate( $input ) {
64
  /*-------------------------------------------*/
65
  /* GoogleAnalytics
66
  /*-------------------------------------------*/
67
- $options = vkExUnit_get_ga_options();
68
- $gaType = esc_html( $options['gaType'] );
69
- if ( $gaType == 'gaType_gtag') {
70
- $priority = 0;
71
- } else {
72
- $priority = 10000;
 
 
 
 
 
73
  }
74
 
75
- add_action( 'wp_head', 'vkExUnit_googleAnalytics', $priority );
76
  function vkExUnit_googleAnalytics() {
77
  $options = vkExUnit_get_ga_options();
78
- $gaId = esc_html( $options['gaId'] );
79
- $gaType = esc_html( $options['gaType'] );
80
- // print '<pre style="text-align:left">';print_r($gaType);print '</pre>';
81
  if ( $gaId ) {
82
 
83
  if ( $gaType == 'gaType_universal' ) {
84
  $domainUrl = home_url();
85
- $delete = array( 'http://', 'https://' );
86
- $domain = str_replace( $delete, '', $domainUrl ); ?>
87
  <script>
88
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
89
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
90
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
91
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
92
 
93
- ga('create', 'UA-<?php echo $gaId ?>', '<?php echo $domain ?>');
94
  ga('send', 'pageview');
95
  </script>
96
  <?php
97
 
98
- } else if ( $gaType == 'gaType_normal' ) { ?>
 
99
  <script type="text/javascript">
100
 
101
  var _gaq = _gaq || [];
102
- _gaq.push(['_setAccount', 'UA-<?php echo $gaId ?>']);
103
  _gaq.push(['_trackPageview']);
104
 
105
  (function() {
106
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
107
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
108
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
109
  })();
110
 
111
  </script>
112
- <?php } else {
113
- // $gaType == 'gaType_gtag'
114
- ?><!-- Global site tag (gtag.js) - Google Analytics -->
115
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-<?php echo $gaId ?>"></script>
 
 
116
  <script>
117
  window.dataLayer = window.dataLayer || [];
118
  function gtag(){dataLayer.push(arguments);}
119
  gtag('js', new Date());
120
 
121
- gtag('config', 'UA-<?php echo $gaId ?>');
122
  </script>
123
- <?php }
124
- } // if ( $gaId ) {
 
125
  }
5
 
6
  function vkExUnit_add_ga_options_page() {
7
  // require dirname( __FILE__ ) . '/ga_admin.php';
8
+ require_once( dirname( __FILE__ ) . '/ga_admin.php' );
9
  }
10
  // カスタマイザー読み込み
11
+ require_once( dirname( __FILE__ ) . '/ga_customizer.php' );
12
 
13
 
14
  /*-------------------------------------------*/
20
  }
21
 
22
  vkExUnit_register_setting(
23
+ __( 'Google Analytics Settings', 'vkExUnit' ), // Immediately following form tag of edit page.
24
+ 'vkExUnit_ga_options', // name attr
25
  'vkExUnit_ga_options_validate',
26
  'vkExUnit_add_ga_options_page'
27
  );
29
  add_action( 'vkExUnit_package_init', 'vkExUnit_ga_options_init' );
30
 
31
  function vkExUnit_get_ga_options() {
32
+ $options = get_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() );
33
+ $options_dafault = vkExUnit_get_ga_options_default();
34
  foreach ( $options_dafault as $key => $value ) {
35
+ $options[ $key ] = ( isset( $options[ $key ] ) ) ? $options[ $key ] : $options_dafault[ $key ];
36
  }
37
  return apply_filters( 'vkExUnit_ga_options', $options );
38
  }
55
  $input = wp_parse_args( $input, $defaults );
56
 
57
  // 入力値をサニタイズ
58
+ $output['gaId'] = esc_html( $input['gaId'] );
59
+ $output['gaType'] = esc_html( $input['gaType'] );
60
 
61
  return apply_filters( 'vkExUnit_ga_options_validate', $output, $input, $defaults );
62
  }
64
  /*-------------------------------------------*/
65
  /* GoogleAnalytics
66
  /*-------------------------------------------*/
67
+
68
+ add_action( 'init', 'vkExUnit_googleAnalytics_load' );
69
+ function vkExUnit_googleAnalytics_load() {
70
+ $options = vkExUnit_get_ga_options();
71
+ $gaType = esc_html( $options['gaType'] );
72
+ if ( $gaType == 'gaType_gtag' ) {
73
+ $priority = 0;
74
+ } else {
75
+ $priority = 10000;
76
+ }
77
+ add_action( 'wp_head', 'vkExUnit_googleAnalytics', $priority );
78
  }
79
 
 
80
  function vkExUnit_googleAnalytics() {
81
  $options = vkExUnit_get_ga_options();
82
+ $gaId = esc_html( $options['gaId'] );
83
+ $gaType = esc_html( $options['gaType'] );
 
84
  if ( $gaId ) {
85
 
86
  if ( $gaType == 'gaType_universal' ) {
87
  $domainUrl = home_url();
88
+ $delete = array( 'http://', 'https://' );
89
+ $domain = str_replace( $delete, '', $domainUrl ); ?>
90
  <script>
91
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
92
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
93
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
94
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
95
 
96
+ ga('create', 'UA-<?php echo $gaId; ?>', '<?php echo $domain; ?>');
97
  ga('send', 'pageview');
98
  </script>
99
  <?php
100
 
101
+ } elseif ( $gaType == 'gaType_normal' ) {
102
+ ?>
103
  <script type="text/javascript">
104
 
105
  var _gaq = _gaq || [];
106
+ _gaq.push(['_setAccount', 'UA-<?php echo $gaId; ?>']);
107
  _gaq.push(['_trackPageview']);
108
 
109
  (function() {
110
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
111
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
112
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
113
  })();
114
 
115
  </script>
116
+ <?php
117
+ } else {
118
+ // $gaType == 'gaType_gtag'
119
+ ?>
120
+ <!-- Global site tag (gtag.js) - Google Analytics -->
121
+ <script async src="https://www.googletagmanager.com/gtag/js?id=UA-<?php echo $gaId; ?>"></script>
122
  <script>
123
  window.dataLayer = window.dataLayer || [];
124
  function gtag(){dataLayer.push(arguments);}
125
  gtag('js', new Date());
126
 
127
+ gtag('config', 'UA-<?php echo $gaId; ?>');
128
  </script>
129
+ <?php
130
+ }
131
+ } // if ( $gaId ) {
132
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
  Requires at least: 4.4
6
  Tested up to: 4.9.5
7
- Stable tag: 6.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
  Requires at least: 4.4
6
  Tested up to: 4.9.5
7
+ Stable tag: 6.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
veu-package-manager.php CHANGED
@@ -12,15 +12,18 @@ vkExUnit_package_initilate();
12
 
13
  function vkExUnit_package_initilate() {
14
  global $vkExUnit_packages;
15
- if ( ! is_array( $vkExUnit_packages ) ) { $vkExUnit_packages = array(); }
 
 
16
  }
17
 
18
 
19
- add_action('init', 'vkExUnit_package_init');
20
- function vkExUnit_package_init()
21
- {
22
- if ( ! current_user_can( 'activate_plugins' ) ) { return; }
23
- do_action('vkExUnit_package_init');
 
24
  }
25
 
26
 
@@ -29,23 +32,24 @@ function vkExUnit_package_is_enable( $package_name ) {
29
  global $vkExUnit_packages;
30
 
31
  // パッケージ情報に パッケージ名 が存在しなかった場合はnullを返す
32
- if ( ! isset( $vkExUnit_packages[ $package_name ] ) ) { return null; }
 
33
 
34
  // 共通設定(有効化情報)を読み込む
35
  $options = vkExUnit_get_common_options();
36
 
37
  // 保存されている共通設定データにパッケージ名が存在しない場合
38
- if ( ! isset( $options[ 'active_'.$package_name ] ) ) {
39
  // 初期情報のデータを返す
40
- return $vkExUnit_packages[ $package_name ]['default'];
41
  }
42
- return $options[ 'active_'.$package_name ];
43
  }
44
 
45
 
46
  function vkExUnit_package_register( $args ) {
47
  $defaults = vkExUnit_package_default();
48
- $args = wp_parse_args( $args, $defaults );
49
 
50
  global $vkExUnit_packages;
51
  $vkExUnit_packages[ $args['name'] ] = $args;
@@ -54,14 +58,15 @@ function vkExUnit_package_register( $args ) {
54
 
55
  function vkExUnit_package_include() {
56
  global $vkExUnit_packages;
57
- if ( ! count( $vkExUnit_packages ) || ! is_array( $vkExUnit_packages ) ) { return $output; }
58
- $options = vkExUnit_get_common_options();
59
- $include_base = vkExUnit_get_directory().'/plugins/';
 
60
  foreach ( $vkExUnit_packages as $package ) {
61
  if (
62
  $package['include'] and
63
  (
64
- ( isset( $options[ 'active_' . $package['name'] ] ) and $options[ 'active_' . $package['name'] ] ) or
65
  ( ! isset( $options[ 'active_' . $package['name'] ] ) and $package['default'] )
66
  )
67
  ) {
@@ -84,16 +89,18 @@ function vkExUnit_package_default() {
84
  }
85
 
86
 
87
- add_filter( 'vkExUnit_common_options_validate' , 'vkExUnit_common_package_options_validate', 10, 2 );
88
  function vkExUnit_common_package_options_validate( $output, $input ) {
89
  global $vkExUnit_packages;
90
- if ( ! count( $vkExUnit_packages ) || ! is_array( $vkExUnit_packages ) ) { return $output; }
 
91
  foreach ( $vkExUnit_packages as $package ) {
92
  if (
93
- isset( $output[ 'active_'.$package['name'] ] ) &&
94
- $output[ 'active_'.$package['name'] ] == (isset( $input[ 'active_'.$package['name'] ] ) && $input[ 'active_'.$package['name'] ]) ? true : false
95
- ) { continue; }
96
- $output[ 'active_'.$package['name'] ] = (isset( $input[ 'active_'.$package['name'] ] )) ? true : false;
 
97
  }
98
  return $output;
99
  }
12
 
13
  function vkExUnit_package_initilate() {
14
  global $vkExUnit_packages;
15
+ if ( ! is_array( $vkExUnit_packages ) ) {
16
+ $vkExUnit_packages = array();
17
+ }
18
  }
19
 
20
 
21
+ add_action( 'init', 'vkExUnit_package_init' );
22
+ function vkExUnit_package_init() {
23
+ if ( ! current_user_can( 'activate_plugins' ) ) {
24
+ return;
25
+ }
26
+ do_action( 'vkExUnit_package_init' );
27
  }
28
 
29
 
32
  global $vkExUnit_packages;
33
 
34
  // パッケージ情報に パッケージ名 が存在しなかった場合はnullを返す
35
+ if ( ! isset( $vkExUnit_packages[ $package_name ] ) ) {
36
+ return null; }
37
 
38
  // 共通設定(有効化情報)を読み込む
39
  $options = vkExUnit_get_common_options();
40
 
41
  // 保存されている共通設定データにパッケージ名が存在しない場合
42
+ if ( ! isset( $options[ 'active_' . $package_name ] ) ) {
43
  // 初期情報のデータを返す
44
+ return $vkExUnit_packages[ $package_name ]['default'];
45
  }
46
+ return $options[ 'active_' . $package_name ];
47
  }
48
 
49
 
50
  function vkExUnit_package_register( $args ) {
51
  $defaults = vkExUnit_package_default();
52
+ $args = wp_parse_args( $args, $defaults );
53
 
54
  global $vkExUnit_packages;
55
  $vkExUnit_packages[ $args['name'] ] = $args;
58
 
59
  function vkExUnit_package_include() {
60
  global $vkExUnit_packages;
61
+ if ( ! count( $vkExUnit_packages ) || ! is_array( $vkExUnit_packages ) ) {
62
+ return $output; }
63
+ $options = vkExUnit_get_common_options();
64
+ $include_base = vkExUnit_get_directory() . '/plugins/';
65
  foreach ( $vkExUnit_packages as $package ) {
66
  if (
67
  $package['include'] and
68
  (
69
+ ( isset( $options[ 'active_' . $package['name'] ] ) and $options[ 'active_' . $package['name'] ] ) or
70
  ( ! isset( $options[ 'active_' . $package['name'] ] ) and $package['default'] )
71
  )
72
  ) {
89
  }
90
 
91
 
92
+ add_filter( 'vkExUnit_common_options_validate', 'vkExUnit_common_package_options_validate', 10, 2 );
93
  function vkExUnit_common_package_options_validate( $output, $input ) {
94
  global $vkExUnit_packages;
95
+ if ( ! count( $vkExUnit_packages ) || ! is_array( $vkExUnit_packages ) ) {
96
+ return $output; }
97
  foreach ( $vkExUnit_packages as $package ) {
98
  if (
99
+ isset( $output[ 'active_' . $package['name'] ] ) &&
100
+ $output[ 'active_' . $package['name'] ] == ( isset( $input[ 'active_' . $package['name'] ] ) && $input[ 'active_' . $package['name'] ] ) ? true : false
101
+ ) {
102
+ continue; }
103
+ $output[ 'active_' . $package['name'] ] = ( isset( $input[ 'active_' . $package['name'] ] ) ) ? true : false;
104
  }
105
  return $output;
106
  }
vkExUnit.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: VK All in One Expansion Unit
4
  * Plugin URI: https://ex-unit.nagoya
5
  * Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
- * Version: 6.3.0
7
  * Author: Vektor,Inc.
8
  * Text Domain: vkExUnit
9
  * Domain Path: /languages
3
  * Plugin Name: VK All in One Expansion Unit
4
  * Plugin URI: https://ex-unit.nagoya
5
  * Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
+ * Version: 6.3.1
7
  * Author: Vektor,Inc.
8
  * Text Domain: vkExUnit
9
  * Domain Path: /languages