plugin_path . '/tools/tools.php'); $tools = new GADASH_Tools (); if (! $tools->check_roles ( $GADASH_Config->options ['ga_dash_access_front'] ) or ! ($GADASH_Config->options ['ga_dash_frontend_stats'] or $GADASH_Config->options ['ga_dash_frontend_keywords'])) { return $content; } if ((is_page () || is_single ()) && ! is_preview ()) { wp_enqueue_script ( 'gadash-general-settings', plugins_url ( 'admin/js/admin.js', dirname ( __FILE__ ) ), array ( 'jquery' ) ); /* * Include GAPI */ if (function_exists ( 'curl_version' ) and $GADASH_Config->options ['ga_dash_tableid_jail'] and $GADASH_Config->options ['ga_dash_token']) { include_once ($GADASH_Config->plugin_path . '/tools/gapi.php'); global $GADASH_GAPI; } else { return $content; } if (! $GADASH_GAPI->client->getAccessToken ()) { return $content; } if (isset ( $GADASH_Config->options ['ga_dash_tableid_jail'] )) { $projectId = $GADASH_Config->options ['ga_dash_tableid_jail']; $profile_info = $tools->get_selected_profile ( $GADASH_Config->options ['ga_dash_profile_list'], $projectId ); if (isset ( $profile_info [4] )) { $GADASH_GAPI->timeshift = $profile_info [4]; } else { $GADASH_GAPI->timeshift = ( int ) current_time ( 'timestamp' ) - time (); } } else { return $content; } $page_url = $_SERVER ["REQUEST_URI"]; // str_replace(site_url(), "", get_permalink()); $post_id = $post->ID; $data_visits = $GADASH_GAPI->frontend_afterpost_visits ( $projectId, $page_url, $post_id ); $data_keywords = $GADASH_GAPI->frontend_afterpost_searches ( $projectId, $page_url, $post_id ); if ($data_visits or $data_keywords) { $content .= ''; $content .= ' "; $content .= '

'; } } return $content; } } } if (! is_admin ()) { $GLOBALS ['GADASH_Frontend'] = new GADASH_Frontend (); }