Google Analytics - Version 2.0.7

Version Description

  • 14-Oct-2019
  • Fix : restrict settings to super admins.
Download this release

Release Info

Developer amribrahim
Plugin Icon 128x128 Google Analytics
Version 2.0.7
Comparing to
See all releases

Code changes from version 2.0.6 to 2.0.7

Files changed (2) hide show
  1. lara-google-analytics.php +31 -29
  2. readme.txt +6 -2
lara-google-analytics.php CHANGED
@@ -4,14 +4,14 @@
4
  Plugin Name: Lara's Google Analytics
5
  Plugin URI: https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/
6
  Description: Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics tracking code to your pages.
7
- Version: 2.0.6
8
  Author: Amr M. Ibrahim
9
  Author URI: https://www.xtraorbit.com/
10
  License: GPL2
11
  */
12
 
13
- define ("lrgawidget_plugin_version", "2.0.6");
14
- define ("lrgawidget_plugin_scripts_version", "206");
15
  define ("lrgawidget_plugin_prefiex", "lrgalite-");
16
  define ("lrgawidget_plugin_dist_dir", plugin_dir_url( __FILE__ ).'dist/');
17
  define ("lrgawidget_plugin_plugins_dir", plugin_dir_url( __FILE__ ).'dist/plugins/');
@@ -80,35 +80,37 @@ function lrgawidget_internal_permissions(){
80
  }
81
 
82
  function lrgawidget_callback() {
83
- global $wpdb;
84
- $user_id = get_current_user_id();
85
- $lrperm = lrgawidget_internal_permissions();
86
- $lrdata = array_map ( 'htmlspecialchars' , $_POST );
87
- $modifiedAction = explode("_", $lrdata['action']);
88
- $lrdata['action'] = sanitize_text_field($modifiedAction[1]);
89
-
90
- if ($lrdata['action'] == "setProfileID"){
91
- $lrdata['property_id'] = sanitize_text_field($lrdata['property_id']);
92
- if ( (isset($lrdata['enable_universal_tracking'])) && !empty($lrdata['property_id']) && lrgawidget_is_analytics($lrdata['property_id']) ){
93
- update_option('lrgawidget_property_id', $lrdata['property_id']);
94
- }else{
 
 
 
 
 
95
  delete_option('lrgawidget_property_id');
96
  }
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
- if ($lrdata['action'] == "settingsReset"){
99
- delete_option('lrgawidget_property_id');
100
- }
101
-
102
- if ($lrdata['action'] == "hideShowWidget"){
103
- $lrdata['wstate'] = sanitize_text_field($lrdata['wstate']);
104
- if ($lrdata['wstate'] == "show" || $lrdata['wstate'] == "hide"){
105
- update_user_option( $user_id, 'lrgawidget_hideShowWidget', $lrdata['wstate'] );
106
- lrgawidget_jsonOutput();
107
- }
108
- };
109
-
110
-
111
- require (dirname(__FILE__).'/core/lrgawidget.handler.php');
112
  }
113
 
114
  function lrgawidget_jsonOutput(){
4
  Plugin Name: Lara's Google Analytics
5
  Plugin URI: https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/
6
  Description: Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics tracking code to your pages.
7
+ Version: 2.0.7
8
  Author: Amr M. Ibrahim
9
  Author URI: https://www.xtraorbit.com/
10
  License: GPL2
11
  */
12
 
13
+ define ("lrgawidget_plugin_version", "2.0.7");
14
+ define ("lrgawidget_plugin_scripts_version", "207");
15
  define ("lrgawidget_plugin_prefiex", "lrgalite-");
16
  define ("lrgawidget_plugin_dist_dir", plugin_dir_url( __FILE__ ).'dist/');
17
  define ("lrgawidget_plugin_plugins_dir", plugin_dir_url( __FILE__ ).'dist/plugins/');
80
  }
81
 
82
  function lrgawidget_callback() {
83
+ if (current_user_can('manage_options')){
84
+ global $wpdb;
85
+ $user_id = get_current_user_id();
86
+ $lrperm = lrgawidget_internal_permissions();
87
+ $lrdata = array_map ( 'htmlspecialchars' , $_POST );
88
+ $modifiedAction = explode("_", $lrdata['action']);
89
+ $lrdata['action'] = sanitize_text_field($modifiedAction[1]);
90
+
91
+ if ($lrdata['action'] == "setProfileID"){
92
+ $lrdata['property_id'] = sanitize_text_field($lrdata['property_id']);
93
+ if ( (isset($lrdata['enable_universal_tracking'])) && !empty($lrdata['property_id']) && lrgawidget_is_analytics($lrdata['property_id']) ){
94
+ update_option('lrgawidget_property_id', $lrdata['property_id']);
95
+ }else{
96
+ delete_option('lrgawidget_property_id');
97
+ }
98
+ }
99
+ if ($lrdata['action'] == "settingsReset"){
100
  delete_option('lrgawidget_property_id');
101
  }
102
+
103
+ if ($lrdata['action'] == "hideShowWidget"){
104
+ $lrdata['wstate'] = sanitize_text_field($lrdata['wstate']);
105
+ if ($lrdata['wstate'] == "show" || $lrdata['wstate'] == "hide"){
106
+ update_user_option( $user_id, 'lrgawidget_hideShowWidget', $lrdata['wstate'] );
107
+ lrgawidget_jsonOutput();
108
+ }
109
+ };
110
+
111
+
112
+ require (dirname(__FILE__).'/core/lrgawidget.handler.php');
113
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  }
115
 
116
  function lrgawidget_jsonOutput(){
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: amribrahim, laragoogleanalytics
4
  Requires PHP: 5.3.0
5
  Requires at least: 4.0
6
  Tested up to: 5.2.3
7
- Stable tag: 2.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -107,4 +107,8 @@ Adds a full width Google Analytics dashboard widget for WordPress admin interfac
107
  = 2.0.6 =
108
  * 14-Oct-2019
109
  * Fix : extra validation for POST variables.
110
- * Fix : Pages tab shows correct percentage values.
 
 
 
 
4
  Requires PHP: 5.3.0
5
  Requires at least: 4.0
6
  Tested up to: 5.2.3
7
+ Stable tag: 2.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
107
  = 2.0.6 =
108
  * 14-Oct-2019
109
  * Fix : extra validation for POST variables.
110
+ * Fix : Pages tab shows correct percentage values.
111
+
112
+ = 2.0.7 =
113
+ * 14-Oct-2019
114
+ * Fix : restrict settings to super admins.