/*
Plugin Name: VSF Simple Stats
Plugin URI: http://blog.v-s-f.co.uk/simple-stats/
Description: Records all hits to your website, but excludes hits from IPs that have been added to the filter list. IPs can be filtered individually or as a range from the admin page.
Version: 0.8
Author: Victoria Scales
Author URI: http://www.v-s-f.co.uk
Donation URI: http://www.amazon.co.uk/wishlist/2FRM957UJWLZ2
Text Domain: vsf-simple-stats
*/
/*
Copyright 2011 Victoria Scales
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see .
*/
define('VSF_STATS_DEBUG', false);
include_once('vsf_simple_stats_setup.php');
include_once('vsf_simple_stats_edit.php');
include_once('vsf_simple_stats_admin.php');
include_once('vsf_simple_stats_shutdown.php');
// Export the xml file of the database filter table
if ( isset($_POST['Export']) )
{
include('vsf_simple_stats_export.php');
$xmlGenerator = new VSFSimpleStatsExport();
$xmlGenerator->generateExport();
}
if( !class_exists("VSFSimpleStats") )
{
class VSFSimpleStats
{
public function vsfSimpleStatsCreateAdminMenu()
{
if ( function_exists('add_options_page') )
{
$adminPage = new VSFSimpleStatsAdmin();
add_options_page(__('VSF Simple Stats Options', 'vsf-simple-stats'), __('VSF Simple Stats', 'vsf-simple-stats'), 1, basename(__FILE__), array($adminPage, 'createAdminMenu'));
$displayStatsPage = new VSFSimpleStatsDisplay();
add_submenu_page('edit.php', __('VSF Simple Stats', 'vsf-simple-stats'), __('Show Stats', 'vsf-simple-stats'), 1, basename(__FILE__), array($displayStatsPage, 'displayStats'));
}
}
}
}
$activationObj = new VSFSimpleStatsSetup();
register_activation_hook(__FILE__, array($activationObj, 'activation'));
$simpleStatsObj = new VSFSimpleStats();
add_action('admin_menu', array($simpleStatsObj, 'vsfSimpleStatsCreateAdminMenu'));
/** Add a hook to the shutdown to record the new hit **/
$shutdownObj = new VSFSimpleStatsShutdown();
add_action('shutdown', array($shutdownObj, 'shutdownHook'));
?>/*
Plugin Name: WP-Stats-Dashboard
Plugin URI: http://www.daveligthart.com/wp-stats-dashboard-10/
Description: Displays your WordPress and social media statistics on your dashboard.
Version: 2.9.4
Author: Dave Ligthart
Author URI: http://www.daveligthart.com
*/
if(!defined('WPSD_PLUGIN_URL')) {
define('WPSD_PLUGIN_URL', trailingslashit(get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__)));
}
if(!defined('WPSD_CACHE_PATH')) {
define('WPSD_CACHE_PATH', realpath(dirname(__FILE__) . '/../..') . '/cache/');
}
if(!defined('WPSD_CACHE_PATH_ALT')) {
define('WPSD_CACHE_PATH_ALT', realpath(dirname(__FILE__) . '/../..') . '/uploads/');
}
if(!defined('WPSD_FILE')) {
define('WPSD_FILE', 'wp-stats-dashboard/wp-stats-dashboard.php');
}
if(!defined('WPSD_VERSION')) {
define('WPSD_VERSION', '2.9.4');
}
if(!defined('WPSD_RPC_VERSION')) {
define('WPSD_RPC_VERSION', '1.4');
}
if(!defined('WPSD_DB_VERSION')) {
define('WPSD_DB_VERSION','1.0');
}
if(!defined('WPSD_DEBUG')) {
define('WPSD_DEBUG', false);
define('WPSD_DEBUG_REMOTE_URL', '');
}
/**
* wpsd_get_metrics_types function.
*
* @access public
* @return array metrics
*/
function wpsd_get_metrics_types() {
return
array('engagement'=>array('Engagement', 'eng', ''),
'pagerank'=>array('Google Pagerank', 'pr', ''),
'backlinks'=>array('Google Backlinks', 'bl', ''),
//'socialgraph'=>array('Google Social Graph', 'pr', ''),
'alexa'=>array('Alexa', 'alexa', ''),
'technorati'=>array('Technorati', 'tr', ''),
'delicious'=>array('Delicious', 'ds', ''),
//'compete'=>array('Compete', 'cc', ''),
'yahoo'=>array('Yahoo', 'yahoo', ''),
'mozrank'=>array('Mozrank', 'moz', ''),
//'postrank'=>array('Postrank', 'ptr', ''),
//'digg'=>array('Digg', 'digg', 'http://digg.com/{username}'),
'twitter'=>array('Twitter', 'tw', 'http://twitter.com/{username}'),
'reddit'=>array('Reddit', 'rd', 'http://www.reddit.com/user/{username}/'),
'stumbleupon'=>array('StumbleUpon', 'su', 'http://www.stumbleupon.com/stumbler/{username}'),
'blogcatalog'=>array('BlogCatalog', 'bc', 'http://www.blogcatalog.com/user/{username}'),
'bing'=>array('Bing', 'bing', ''),
'linkedin'=>array('LinkedIn', 'li', 'http://www.linkedin.com/in/{username}'),
'bitly'=>array('Bit.ly', 'bitly', ''),
'klout'=>array('Klout', 'kl', 'http://klout.com/{username}'),
'feedburner'=>array('FeedBurner', 'fb', '{username}'),
'lastfm'=>array('Last.fm', 'lfm', 'http://www.last.fm/user/{username}'),
'facebook'=>array('Facebook', 'fab', '{username}'),
'flickr'=>array('Flickr', 'fr', 'http://www.flickr.com/photos/{username}'),
'diigo'=>array('Diigo', 'dg', 'http://www.diigo.com/profile/{username}'),
//'brazencareerist'=>array('BrazenCareerist', 'br', 'http://www.brazencareerist.com/profile/{username}'),
//'newsvine'=>array('Newsvine', 'nv', 'http://{username}.newsvine.com'),
'youtube'=>array('Youtube', 'yt', 'http://www.youtube.com/{username}'),
'myspace'=>array('Myspace', 'ms', 'http://www.myspace.com/{username}'),
'wordpress'=>array('WordPress', 'wp', ''),
'posterous'=>array('Posterous', 'ps', 'http://{username}.posterous.com'),
'plancast'=>array('Plancast', 'pc', 'http://plancast.com/{username}'),
//'lazyfeed'=>array('Lazyfeed', 'lf', 'http://www.lazyfeed.com/user/{username}'),
//'sphinn'=>array('Sphinn', 'spn', 'http://sphinn.com/user/{username}'),
'plurk'=>array('Plurk', 'plk', 'http://www.plurk.com/{username}'),
'hyves'=>array('Hyves', 'hyves', 'http://{username}.hyves.nl'),
'foursquare'=>array('Foursquare','fsq','http://foursquare.com/user/{username}'),
'disqus'=>array('Disqus','dqs', 'http://disqus.com/{username}'),
//'blippr'=>array('Blippr', 'blippr', 'http://www.blippr.com/profiles/{username}'),
'runkeeper'=>array('Runkeeper', 'rk', 'http://runkeeper.com/user/{username}/profile'),
//'blippy'=>array('Blippy', 'blippy', 'http://blippy.com/{username}'),
'friendfeed'=>array('FriendFeed','ff', 'http://friendfeed.com/{username}'),
'battlenet'=>array('Battlenet', 'battlenet', '{username}'),
//'educopark'=>array('Educopark', 'educopark', 'http://www.educopark.com/people/view/{username}'),
'vimeo'=>array('Vimeo', 'vimeo', 'http://vimeo.com/{username}'),
'identica'=>array('Identi.ca', 'identica', 'http://identi.ca/{username}'),
'netlog'=>array('Netlog', 'netlog', 'http://en.netlog.com/{username}/'),
'plaxo'=>array('Plaxo', 'plaxo', '{username}'),
'99designs'=>array('99designs', '99designs', 'http://99designs.com/people/{username}'),
'quora'=>array('Quora', 'quora', 'http://www.quora.com/{username}'),
'getglue'=>array('Getglue', 'getglue', 'http://getglue.com/{username}'),
'googleplus'=>array('Google Plus', 'googleplus', 'https://plus.google.com/{username}/posts'),
'hunch'=>array('Hunch', 'hunch', 'http://hunch.com/{username}/'),
//'peerindex'=>array('PeerIndex', 'peerindex', 'http://peerindex.com/{username}'),
'pinterest'=>array('Pinterest', 'pinterest', 'http://pinterest.com/{username}/'),
'weread'=>array('weRead',' weread', ''),
'socialmention'=>array('SocialMention', 'socialmention', ''),
'eave'=>array('Empire Avenue', 'eave', ''),
'archive'=>array('Archive', 'archive',''),
'googlebot'=>array('GoogleBot','googlebot',''),
'w3c'=>array('W3 Validator','w3c',''),
'views'=>array('Views', 'views', ''),
'age'=>array('Site age', 'age', ''),
'est'=>array('Estimated', 'est', ''),
'powered'=>array('Powered by', 'pow', '') );
}
require(dirname(__FILE__) . '/classes/util/WPSDUtils.php');
require(dirname(__FILE__) . '/classes/util/com.daveligthart.util.wordpress.php');
require(dirname(__FILE__) . '/classes/util/WPSDWPPlugin.php');
require(dirname(__FILE__) . '/classes/dao/WPSDTrendsDao.php');
require(dirname(__FILE__) . '/classes/util/WPSDStatsFactory.php');
require(dirname(__FILE__) . '/classes/util/excel/WPSDExcel.php');
require(dirname(__FILE__) . '/classes/model/WPSDAdminConfigForm.php');
require(dirname(__FILE__) . '/classes/model/WPSDAdminConfigMetricsForm.php');
require(dirname(__FILE__) . '/classes/action/WPSDFrontEndAction.php');
require(dirname(__FILE__) . '/classes/action/WPSDAdminAction.php');
require(dirname(__FILE__) . '/classes/action/WPSDAdminConfigAction.php');
require(dirname(__FILE__) . '/classes/dao/WPSDUpgradeDao.php');
require(dirname(__FILE__) . '/classes/util/WPSDStatsRemoting.php');
require(dirname(__FILE__) . '/classes/util/metrics/user/WPSDUserMetrics.php');
/* Widgets */
require(dirname(__FILE__) . '/classes/widget/WPSDMetricsWidget.php');
require(dirname(__FILE__) . '/classes/widget/WPSDSocialProfilesWidget.php');
require(dirname(__FILE__) . '/classes/widget/WPSDTotalViewsWidget.php');
require(dirname(__FILE__) . '/classes/widget/WPSDMiniGraphWidget.php');
require(dirname(__FILE__) . '/classes/widget/WPSDAuthorWidget.php');
/**
* wpsd_admin_include function.
*
* @access public
* @return void
*/
function wpsd_admin_include() {
$user = wp_get_current_user();
if($user->caps["administrator"] || wpsd_has_access()) {
require(dirname(__FILE__) . '/classes/widget/admin/WPSDAdminWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDOverviewDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDClicksDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDReferrersDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDPostViewsDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDSearchTermsDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDCompeteDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDTrendsDashboardWidget.php');
//require(dirname(__FILE__) . '/classes/widget/admin/WPSDBlogPulseDashboardWidget.php');
//require(dirname(__FILE__) . '/classes/widget/admin/WPSDBlogPulseConversationDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDOptimizeDashboardWidget.php');
require(dirname(__FILE__) . '/classes/widget/admin/WPSDAuthorDashboardWidget.php');
require(dirname(__FILE__) . '/classes/util/WPSDSoaHelper.php');
}
}
add_action('plugins_loaded', 'wpsd_admin_include');
if(is_admin()) {
wp_enqueue_script('jquery'); // use jquery.
$config = new WPSDAdminConfigForm();
if(!$config->getWpsdDisableWidgets()) {
// Widgets only for admin.
add_action('plugins_loaded', create_function('', '
$user = wp_get_current_user();
if($user->caps["administrator"] || wpsd_has_access()){' .
'global $wpsdClicksWidget; $wpsdClicksWidget = new WPSDClicksDashboardWidget();' .
'global $wpStatsDashWidget; $wpStatsDashWidget = new WPSDDashboardWidget();' .
'global $wpsdOverviewWidget; $wpsdOverviewWidget = new WPSDOverviewDashboardWidget();' .
'global $wpsdRefWidget; $wpsdRefWidget = new WPSDReferrersDashboardWidget();' .
'global $wpsdPostViewsWidget; $wpsdPostViewsWidget = new WPSDPostViewsDashboardWidget();' .
'global $wpsdSearchTermsWidget; $wpsdSearchTermsWidget = new WPSDSearchTermsDashboardWidget();' .
'global $wpsdTrendsWidget; $wpsdTrendsWidget = new WPSDTrendsDashboardWidget();' .
'global $wpsdAuthorsWidget; $wpsdAuthorsWidget = new WPSDAuthorDashboardWidget();' .
'global $wpsdOptimizeWidget; $wpsdOptimizeWidget = new WPSDOptimizeDashboardWidget();'
.'}') );
// 'global $wpsdCompeteWidget; $wpsdCompeteWidget = new WPSDCompeteDashboardWidget();' .
}
}
/**
* WPSD main.
* @author dligthart
* @version 1.4.0
* @package wp-stats-dashboard
*/
class WPSDMain extends WPSDWPPlugin {
/**
* @var AdminAction admin action handler
*/
var $adminAction = null;
/**
* @var FrontEndAction frontend action handler
*/
var $frontEndAction = null;
/**
* __construct()
*/
function WPSDMain($path) {
$this->register_plugin('wp-stats-dashboard', $path);
if (is_admin()) {
$this->adminAction = new WPSDAdminAction($this->plugin_name, $this->plugin_base);
}
$this->frontEndAction = new WPSDFrontEndAction($this->plugin_name, $this->plugin_base);
}
}
// Start app.
$wp_stats_dashboard = new WPSDMain(__FILE__);
?>