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( $ga_dash_profile_list ) ) { GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': No properties were found in this account!', $this->error_timeout ); } else { GADWP_Tools::delete_cache( 'last_error' ); } return $ga_dash_profile_list; } catch ( Google_IO_Exception $e ) { GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout ); return $ga_dash_profile_list; } catch ( Google_Service_Exception $e ) { GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . $e->getMessage() ), $this->error_timeout ); GADWP_Tools::set_cache( 'gapi_errors', array( $e->getCode(), (array) $e->getErrors() ), $this->error_timeout ); } catch ( Exception $e ) { GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( $e ), $this->error_timeout ); return $ga_dash_profile_list; } } /** * Handles the token reset process * * @param * $all */ public function reset_token( $all = true ) { $this->gadwp->config->options['ga_dash_token'] = ""; if ( $all ) { $this->gadwp->config->options['ga_dash_tableid_jail'] = ""; $this->gadwp->config->options['ga_dash_profile_list'] = array(); try { $this->client->revokeToken(); } catch ( Exception $e ) { if ( is_multisite() && $this->gadwp->config->options['ga_dash_network'] ) { $this->gadwp->config->set_plugin_options( true ); } else { $this->gadwp->config->set_plugin_options(); } } } if ( is_multisite() && $this->gadwp->config->options['ga_dash_network'] ) { $this->gadwp->config->set_plugin_options( true ); } else { $this->gadwp->config->set_plugin_options(); } } /** * Get and cache Core Reports * * @param * $projecId * @param * $from * @param * $to * @param * $metrics * @param * $options * @param * $serial * @return int|Google_Service_Analytics_GaData */ private function handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ) { try { if ( $from == "today" ) { $timeouts = 0; } else { $timeouts = 1; } $transient = GADWP_Tools::get_cache( $serial ); if ( $transient === false ) { if ( $this->gapi_errors_handler() ) { return - 23; } $options['samplingLevel'] = 'HIGHER_PRECISION'; $data = $this->service->data_ga->get( 'ga:' . $projectId, $from, $to, $metrics, $options ); GADWP_Tools::set_cache( $serial, $data, $this->get_timeouts( $timeouts ) ); $this->gadwp->config->options['api_backoff'] = 0; $this->gadwp->config->set_plugin_options(); } else { $data = $transient; } } catch ( Google_Service_Exception $e ) { GADWP_Tools::set_cache( 'last_error', date( 'Y-m-d H:i:s' ) . ': ' . esc_html( "(" . $e->getCode() . ") " . _string( $image ) ) { preg_match( '/(.*?)\#([0-9]+)x([0-9]+)$/', $image, $matches ); return ! empty( $matches ) ? $matches : false; } } } ial ); if ( is_numeric( $data ) ) { return $data; } $block = ( $query == 'channelGrouping' ) ? __( "Channels", 'google-analytics-dashboard-for-wp' ) : __( "Devices", 'google-analytics-dashboard-for-wp' ); $gadwp_data = array( array( '
' . $block . '
' . (int) $data['totalsForAllResults']["ga:sessions"] . '
', "" ) ); foreach ( $data->getRows() as $row ) { $shrink = explode( " ", $row[0] ); $gadwp_data[] = array( '
' . esc_html( $shrink[0] ) . '
' . (int) $row[1] . '
', '
' . $block . '
' . (int) $data['totalsForAllResults']["ga:sessions"] . '
' ); } return $gadwp_data; } /** * Analytics data for Pie Charts (traffic mediums, serach engines, social networks, browsers, screen rsolutions, etc.) * * @param * $projectId * @param * $from * @param * $to * @param * $query * @param * $filter * @return array|int */ private function get_piechart_data( $projectId, $from, $to, $query, $filter = '' ) { $metrics = 'ga:sessions'; $dimensions = 'ga:' . $query; if ( $query == 'source' ) { $options = array( 'dimensions' => $dimensions, 'sort' => '-ga:sessions', 'quotaUser' => $this->managequota . 'p' . $projectId ); if ( $filter ) { $options['filters'] = 'ga:medium==organic;ga:keyword!=(not set);ga:pagePath==' . $filter; } else { $options['filters'] = 'ga:medium==organic;ga:keyword!=(not set)'; } } else { $options = array( 'dimensions' => $dimensions, 'sort' => '-ga:sessions', 'quotaUser' => $this->managequota . 'p' . $projectId ); if ( $filter ) { $options['filters'] = 'ga:' . $query . '!=(not set);ga:pagePath==' . $filter; } else { $options['filters'] = 'ga:' . $query . '!=(not set)'; } } $serial = 'qr10_' . $this->get_serial( $projectId . $from . $query . $filter ); $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ); if ( is_numeric( $data ) ) { return $data; } $gadwp_data = array( array( __( "Type", 'google-analytics-dashboard-for-wp' ), __( "Sessions", 'google-analytics-dashboard-for-wp' ) ) ); $i = 0; $included = 0; foreach ( $data->getRows() as $row ) { if ( $i < 20 ) { $gadwp_data[] = array( str_replace( "(none)", "direct", esc_html( $row[0] ) ), (int) $row[1] ); $included += $row[1]; $i++; } else { break; } } $totals = $data->getTotalsForAllResults(); $others = $totals['ga:sessions'] - $included; if ( $others > 0 ) { $gadwp_data[] = array( __( 'Other', 'google-analytics-dashboard-for-wp' ), $others ); } return $gadwp_data; } /** * Analytics data for Frontend Widget (chart data and totals) * * @param * $projectId * @param * $period * @param * $anonim * @return array|int */ public function frontend_widget_stats( $projectId, $from, $anonim ) { $content = ''; $to = 'yesterday'; $metrics = 'ga:sessions'; $dimensions = 'ga:date,ga:dayOfWeekName'; $options = array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId ); $serial = 'qr2_' . $this->get_serial( $projectId . $from . $metrics ); $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ); if ( is_numeric( $data ) ) { return $data; } $gadwp_data = array( array( __( "Date", 'google-analytics-dashboard-for-wp' ), __( "Sessions", 'google-analytics-dashboard-for-wp' ) ) ); if ( $anonim ) { $max_array = array(); foreach ( $data->getRows() as $item ) { $max_array[] = $item[2]; } $max = max( $max_array ) ? max( $max_array ) : 1; } foreach ( $data->getRows() as $row ) { $gadwp_data[] = array( date_i18n( __( 'l, F j, Y', 'google-analytics-dashboard-for-wp' ), strtotime( $row[0] ) ), ( $anonim ? round( $row[2] * 100 / $max, 2 ) : (int) $row[2] ) ); } $totals = $data->getTotalsForAllResults(); return array( $gadwp_data, $anonim ? 0 : number_format_i18n( $totals['ga:sessions'] ) ); } /** * Analytics data for Realtime component (the real-time report) * * @param * $projectId * @return array|int */ private function get_realtime( $projectId ) { $metrics = 'rt:activeUsers'; $dimensions = 'rt:pagePath,rt:source,rt:keyword,rt:trafficType,rt:visitorType,rt:pageTitle'; try { $serial = 'qr_realtimecache_' . $this->get_serial( $projectId ); $transient = GADWP_Tools::get_cache( $serial ); if ( $transient === false ) { if ( $this->gapi_errors_handler() ) { return - 23; } $data = $this->service->data_realtime->get( 'ga:' . $projectId, $metrics, array( 'dimensions' => $dimensions, 'quotaUser' => $this->managequota . 'p' . $projectId ) ); GADWP_Tools::set_cache( $serial, $data, 55 ); $this->gadwp->config->options['api_backoff'] = 0; $this->gadwp->config->set_plugin_options(); } else { $data = $trs data for Org Charts & Table Charts (searches) * * @param * $projectId * @param * $from * @param * $to * @param * $filter * @return array|int */ private function get_searches( $projectId, $from, $to, $filter = '' ) { $metrics = 'ga:sessions'; $dimensions = 'ga:keyword'; $options = array( 'dimensions' => $dimensions, 'sort' => '-ga:sessions', 'quotaUser' => $this->managequota . 'p' . $projectId ); if ( $filter ) { $options['filters'] = 'ga:keyword!=(not set);ga:pagePath==' . $filter; } else { $options['filters'] = 'ga:keyword!=(not set)'; } $serial = 'qr6_' . $this->get_serial( $projectId . $from . $filter ); $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ); if ( is_numeric( $data ) ) { return $data; } $gadwp_data = array( array( __( "Searches", 'google-analytics-dashboard-for-wp' ), __( "Sessions", 'google-analytics-dashboard-for-wp' ) ) ); foreach ( $data->getRows() as $row ) { $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] ); } return $gadwp_data; } /** * Analytics data for Org Charts & Table Charts (location reports) * * @param * $projectId * @param * $from * @param * $to * @param * $filter * @return array|int */ private function get_locations( $projectId, $from, $to, $filter = '' ) { $metrics = 'ga:sessions'; $options = ""; $title = __( "Countries", 'google-analytics-dashboard-for-wp' ); $serial = 'qr7_' . $this->get_serial( $projectId . $from . $filter ); $dimensions = 'ga:country'; $local_filter = ''; if ( $this->gadwp->config->options['ga_target_geomap'] ) { $dimensions = 'ga:city, ga:region'; $country_codes = GADWP_Tools::get_countrycodes(); if ( isset( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ) ) { $local_filter = 'ga:country==' . ( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ); $title = __( "Cities from", 'google-analytics-dashboard-for-wp' ) . ' ' . __( $country_codes[$this->gadwp->config->options['ga_target_geomap']] ); $serial = 'qr7_' . $this->get_serial( $projectId . $from . $this->gadwp->config->options['ga_target_geomap'] . $filter ); } } $options = array( 'dimensions' => $dimensions, 'sort' => '-ga:sessions', 'quotaUser' => $this->managequota . 'p' . $projectId ); if ( $filter ) { $options['filters'] = 'ga:pagePath==' . $filter; if ( $local_filter ) { $options['filters'] .= ';' . $local_filter; } } else { if ( $local_filter ) { $options['filters'] = $local_filter; } } $data = $this->handle_corereports( $projectId, $from, $to, $metrics, $options, $serial ); if ( is_numeric( $data ) ) { return $data; } $gadwp_data = array( array( $title, __( "Sessions", 'google-analytics-dashboard-for-wp' ) ) ); foreach ( $data->getRows() as $row ) { if ( isset( $row[2] ) ) { $gadwp_data[] = array( esc_html( $row[0] ) . ', ' . esc_html( $row[1] ), (int) $row[2] ); } else { $gadwp_data[] = array( esc_html( $row[0] ), (int) $row[1] ); } } return $gadwp_data; } /** * Analytics data for Org Charts (traffic channels, device categories) * * @param * $projectId * @param * $from * @param * $to * @param * $query * @param * $filter * @return array|int */ private function get_orgchart_data( $projectId, $from, $to, $query, $filter = '' ) { $metrics = 'ga:sessions'; $dimensions = 'ga:' . $query; $options = array( 'dimensions' => $dimensions, 'sort' => '-ga:sessions', 'quotaUser' => $this->managequota . 'p' . $projectId ); if ( $filter ) { $options['filters'] = 'ga:pagePath==' . $filter; } $serial = 'qr8_' . $this->get_serial( $projectId ta[2] = number_format_i18n( $gadwp_data[2] ); $gadwp_data[3] = number_format_i18n( $gadwp_data[3], 2 ) . '%'; $gadwp_data[4] = number_format_i18n( $gadwp_data[4] ); $gadwp_data[5] = number_format_i18n( $gadwp_data[5], 2 ); $gadwp_data[6] = gmdate( "H:i:s", $gadwp_data[6] ); $gadwp_data[7] = gmdate( "H:i:s", $gadwp_data[7] ); if ( $filter ) { $gadwp_data[8] = number_format_i18n( $gadwp_data[8], 2 ) . '%'; } else { $gadwp_data[8] = gmdate( "H:i:s", $gadwp_data[8] ); } return $gadwp_data; } /** * Analytics data for Org Charts & Table Charts (content pages) * * @param * $projectId * @param * $from * @param * $to * @param * $filter * @return array|int */render( $post_id ); if( $save ) { $this->save( $post_id ); } return array( 'html' => $this->cache[ 'html' ][ $post_id ], 'css' => $this->cache[ 'css' ][ $post_id ], ); } } } } } return $css; } /** * @param SiteOrigin_Panels_Css_Builder $css * @param $panels_data * @param $post_id * * @return mixed */ static function filter_css_object( $css, $panels_data, $post_id, $layout ) { $mobile_width = siteorigin_panels_setting( 'mobile-width' ); if( empty( $layout ) ) { return $css; } foreach( $layout as $ri => $row ) { if( empty( $row[ 'style' ] ) ) $row[ 'style' ] = array(); $standard_css = apply_filters( 'siteorigin_panels_row_style_css', array(), $row['style'] ); $mobile_css = apply_filters( 'siteorigin_panels_row_style_mobile_css', array(), $row['style'] ); if ( ! empty( $standard_css ) ) { $css->add_row_css( $post_id, $ri, '> .panel-row-style', $standard_css ); } if ( ! empty( $mobile_css ) ) { $css->add_row_css( $post_id, $ri, '> .panel-row-style', $mobile_css, $mobile_width ); } // Add in flexbox alignment to the main row element if ( ! empty( $row['style']['cell_alignment'] ) ) { $css->add_row_css( $post_id, $ri, array( '.panel-no-style', '.panel-has-style > .panel-row-style' ), array( '-webkit-align-items' => $row['style']['cell_alignment'], 'align-items' => $row['style']['cell_alignment'], ) ); } // Process the cells if there are any if( empty( $row[ 'cells' ] ) ) continue; foreach( $row[ 'cells' ] as $ci => $cell ) { if( empty( $cell[ 'style' ] ) ) $cell[ 'style' ] = array(); $standard_css = apply_filters( 'siteorigin_panels_cell_style_css', array(), $cell['style'] ); $mobile_css = apply_filters( 'siteorigin_panels_cell_style_mobile_css', array(), $cell['style'] ); if ( ! empty( $standard_css ) ) { $css->add_cell_css( $post_id, $ri, $ci, '> .panel-cell-style', $standard_css ); } if ( ! empty( $mobile_css ) ) { $css->add_cell_css( $post_id, $ri, $ci, '> .p
Fatal error: Class 'SiteOrigin_Widget_Meta_Box_Manager' not found in /home4/nathanng/public_html/wp-content/plugins/so-widgets-bundle/so-widgets-bundle.php on line 759