Skip to content

Commit

Permalink
= 5.9.4 (2023.10.01) =
Browse files Browse the repository at this point in the history
* Bug Fixes:
	* last day on the Analytics area chart is wrong
  • Loading branch information
deconf authored and deconf committed Oct 1, 2023
1 parent e5873e7 commit 7344298
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function load_styles_scripts( $hook ) {
__( "Pages/Session", 'analytics-insights' ),
__( "Invalid response", 'analytics-insights' ),
__( "No Data", 'analytics-insights' ),
__( "This report is unavailable", 'analytics-insights' ),
__( "Processing data, please check again in a few hours", 'analytics-insights' ),
__( "report generated by", 'analytics-insights' ), //14
__( "This plugin needs an authorization:", 'analytics-insights' ) . ' <a href="' . menu_page_url( 'aiwp_settings', false ) . '">' . __( "authorize the plugin", 'analytics-insights' ) . '</a>.',
__( "Browser", 'analytics-insights' ), //16
Expand Down Expand Up @@ -288,7 +288,7 @@ public function load_styles_scripts( $hook ) {
__( "Pages/Session", 'analytics-insights' ),
__( "Invalid response", 'analytics-insights' ),
__( "No Data", 'analytics-insights' ),
__( "This report is unavailable", 'analytics-insights' ),
__( "Processing data, please check again in a few hours", 'analytics-insights' ),
__( "report generated by", 'analytics-insights' ), //14
__( "This plugin needs an authorization:", 'analytics-insights' ) . ' <a href="' . menu_page_url( 'aiwp_settings', false ) . '">' . __( "authorize the plugin", 'analytics-insights' ) . '</a>.',
__( "Browser", 'analytics-insights' ), //16
Expand Down
4 changes: 2 additions & 2 deletions analytics-insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://deconf.com/analytics-insights-for-wordpress/
* Description: Displays Google Analytics Reports and Real-Time Statistics in your Dashboard. Automatically inserts the tracking code in every page of your website.
* Author: DeConf
* Version: 5.9.3
* Version: 5.9.4
* Author URI: https://deconf.com
* Text Domain: analytics-insights
* Domain Path: /languages
Expand All @@ -14,7 +14,7 @@
exit();
// Plugin Version
if ( ! defined( 'AIWP_CURRENT_VERSION' ) ) {
define( 'AIWP_CURRENT_VERSION', '5.9.3' );
define( 'AIWP_CURRENT_VERSION', '5.9.4' );
}
if ( ! defined( 'AIWP_ENDPOINT_URL' ) ) {
define( 'AIWP_ENDPOINT_URL', 'https://api.deconf.com/aiwp/v2/' );
Expand Down
2 changes: 1 addition & 1 deletion common/js/reports5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ jQuery.fn.extend( {
if ( response == -21 ) {
jQuery( target ).html( aiwpItemData.i18n[ 12 ] );
} else {
jQuery( target ).html( aiwpItemData.i18n[ 13 ] + ' (' + response + ')' );
jQuery( target ).html( '<p><span style="font-size:4em;color:#778899;margin-left:-20px;" class="dashicons dashicons-clock"></span></p><br><p style="font-size:1.1em;color:#778899;">' + aiwpItemData.i18n[ 13 ] + '</p>' );
}
},

Expand Down
2 changes: 1 addition & 1 deletion front/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function load_styles_scripts() {
__( "Pages/Session", 'analytics-insights' ),
__( "Invalid response", 'analytics-insights' ),
__( "No Data", 'analytics-insights' ),
__( "This report is unavailable", 'analytics-insights' ),
__( "Processing data, please check again in a few hours", 'analytics-insights' ),
__( "report generated by", 'analytics-insights' ), //14
__( "This plugin needs an authorization:", 'analytics-insights' ) . ' <strong>' . __( "authorize the plugin", 'analytics-insights' ) . '</strong>!',
__( "Browser", 'analytics-insights' ), //16
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://deconf.com/donate/
Tags: analytics,google analytics,google analytics 4,google analytics dashboard, GA4, google analytics plugin,google analytics tracking code,google analytics widget,wordpress analytics, gainwp
Requires at least: 3.5
Tested up to: 6.3
Stable tag: 5.9.3
Stable tag: 5.9.4
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -91,6 +91,10 @@ For documentation, tutorials, FAQ and videos check out: [Analytics Insights docu

== Changelog ==

= 5.9.4 (2023.10.01) =
* Bug Fixes:
* last day on the Analytics area chart is wrong

= 5.9.3 (2023.09.12) =
* Bug Fixes:
* frontend widget displays wrong the same date on analytics chart
Expand Down
16 changes: 11 additions & 5 deletions tools/gapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -1496,15 +1496,17 @@ private function get_areachart_data_ga4( $projectId, $from, $to, $query, $filter
$fill_data[$i] = 0;
}
foreach ( $data['values'] as $row ) {
$fill_data[(int) $row[0]] = round( $row[1], 2 ) * $factor;
if ( array_key_exists((int) $row[0], $fill_data) ){
$fill_data[(int) $row[0]] = round( $row[1], 2 ) * $factor;
}
}
foreach ( $fill_data as $key => $value ) {
$aiwp_data[] = array( $key . ':00', $value );
}

} else if ( '365daysAgo' == $from || '1095daysAgo' == $from ) {

$yesterday = date("Y-m-d", strtotime("-1 day"));
$yesterday = date("Y-m-d", strtotime("now"));
$offset = str_replace('daysAgo', '', $from);
$xdaysago = date("Y-m-d", strtotime("-" . $offset . " day"));

Expand All @@ -1520,7 +1522,9 @@ private function get_areachart_data_ga4( $projectId, $from, $to, $query, $filter

foreach ( $data['values'] as $row ) {
$key = $row[0] . $row[1];
$fill_data[$key] = round( $row[2], 2 ) * $factor;
if ( array_key_exists($key, $fill_data) ){
$fill_data[$key] = round( $row[2], 2 ) * $factor;
}
}

foreach ( $fill_data as $key => $value ) {
Expand All @@ -1533,7 +1537,7 @@ private function get_areachart_data_ga4( $projectId, $from, $to, $query, $filter
}
} else {

$yesterday = date("Y-m-d", strtotime("-1 day"));
$yesterday = date("Y-m-d", strtotime("now"));
$offset = str_replace('daysAgo', '', $from);
$xdaysago = date("Y-m-d", strtotime("-" . $offset . " day"));

Expand All @@ -1548,7 +1552,9 @@ private function get_areachart_data_ga4( $projectId, $from, $to, $query, $filter
}

foreach ( $data['values'] as $row ) {
$fill_data[$row[0]] = round( $row[2], 2 ) * $factor;
if ( array_key_exists($row[0], $fill_data) ){
$fill_data[$row[0]] = round( $row[2], 2 ) * $factor;
}
}

foreach ( $fill_data as $key => $value ) {
Expand Down

0 comments on commit 7344298

Please sign in to comment.