Пример #1
0
 public function deactivate()
 {
     // Remove Queued Updates
     EasySocialMetricsUpdater::removeAllQueuedUpdates();
 }
		<p>
			Easy Social Share Buttons for WordPress Version <strong><?php 
echo ESSB3_VERSION;
?>
</strong>.
			&nbsp;<strong><a href="http://fb.creoworx.com/essb/change-log/"
				target="_blank">See what's new in this version</a></strong>&nbsp;&nbsp;&nbsp;<strong><a
				href="http://codecanyon.net/item/easy-social-share-buttons-for-wordpress/6394476?ref=appscreo"
				target="_blank">Easy Social Share Buttons plugin homepage</a></strong>
		</p>
	</div>

	<div class="essb-clear"></div>
	
	<?php 
EasySocialMetricsUpdater::printQueueLength();
?>
     

	<div class="essb-clear"></div>

	<div class="essb-title-panel">
	<form id="easy-social-metrics-lite" method="get" action="admin.php?page=easy-social-metrics-lite">
	<input type="hidden" name="page" value="<?php 
echo $_REQUEST['page'];
?>
" />
	<?php 
$range = isset($_GET['range']) ? $_GET['range'] : 0;
?>
	    			<label for="range">Show only:</label> <select name="range">
 /**
  * Run a complete sync of all data. Download new stats for every single post in the DB.
  *
  * This should only be run when the plugin is first installed, or if data syncing was interrupted.
  *
  */
 public static function scheduleFullDataSync()
 {
     // We are going to stagger the updates so we do not overload the Wordpress cron.
     $nextTime = time();
     $interval = 5;
     // in seconds
     $post_types = EasySocialMetricsUpdater::get_post_types_static();
     $options = get_option(EasySocialShareButtons::$plugin_settings_name);
     $nextTime = time();
     $interval = 5;
     // in seconds
     // In case the function does not finish, we want to start with posts that have NO data yet.
     $querydata = query_posts(array('order' => 'DESC', 'orderby' => 'post_date', 'posts_per_page' => -1, 'post_status' => 'publish', 'post_type' => $post_types));
     foreach ($querydata as $querydatum) {
         wp_schedule_single_event($nextTime, 'easy_social_metrics_update_single_post', array($querydatum->ID));
         $nextTime = $nextTime + $interval;
     }
     return;
 }
 /**
  * Run a complete sync of all data. Download new stats for every single post in the DB.
  *
  * This should only be run when the plugin is first installed, or if data syncing was interrupted.
  *
  */
 public static function scheduleFullDataSync()
 {
     global $essb_options;
     // We are going to stagger the updates so we do not overload the Wordpress cron.
     $nextTime = time();
     $interval = 5;
     // in seconds
     $post_types = EasySocialMetricsUpdater::get_post_types_static();
     $options = $essb_options;
     $nextTime = time();
     $interval = 5;
     // in seconds
     // In case the function does not finish, we want to start with posts that have NO data yet.
     /*$querydata = query_posts(array(
     				'order'			=>'DESC',
     				'orderby'		=>'post_date',
     				'posts_per_page'=>-1,
     				'post_status'   => 'publish',
     				'post_type'		=> $post_types
     		));*/
     $querydata1 = new WP_Query(array('posts_per_page' => -1, 'post_status' => 'publish', 'post_type' => $post_types));
     //print_r($querydata);
     if ($querydata1->have_posts()) {
         while ($querydata1->have_posts()) {
             $querydata1->the_post();
             global $post;
             wp_schedule_single_event($nextTime, 'easy_social_metrics_update_single_post', array($post->ID));
             $nextTime = $nextTime + $interval;
         }
     }
     //foreach ($querydata as $querydatum ) {
     //	wp_schedule_single_event( $nextTime, 'easy_social_metrics_update_single_post', array( $querydatum->ID ) );
     //	$nextTime = $nextTime + $interval;
     //}
     wp_reset_postdata();
     return;
 }
Пример #5
0
function esml_render_dashboard_view($options)
{
    //Create an instance of our package class...
    $testListTable = new EasySocialMetricsLiteResultTable();
    $testListTable->options = $options;
    //Fetch, prepare, sort, and filter our data...
    $testListTable->prepare_items();
    ?>
    
    <style type="text/css">

    .column-post_title { width: 30%; }
    .column-total { font-weight: bold; }
    
    </style>
    
    <div class="wrap">
        
        <h2>Easy Social Metrics Lite Dashboard</h2>
        <div style="clear:both;"></div>
        <div class="welcome-panel">
        	<div class="welcome-panel-content">
        	
        		<div class="welcome-panel-column-container">
        			<div class="welcome-panel-column" style="width: 49%;">
        			
        				<h4>Social Networks Presentation</h4>
        				<?php 
    $testListTable->output_total_results();
    ?>
        			</div>
        			<div class="welcome-panel-column"  style="width: 49%;">
        			
        				<h4>Top Shared Content by Social Network</h4>        				
        				<?php 
    $testListTable->output_total_content();
    ?>
        			</div>

        		</div>	
        	</div>
        
        </div>

        <?php 
    EasySocialMetricsUpdater::printQueueLength();
    ?>
       
        
        
		<form id="easy-social-metrics-lite" method="get" action="admin.php?page=easy-social-metrics-lite">
			<!-- For plugins, we also need to ensure that the form posts back to our current page -->
			<input type="hidden" name="page" value="<?php 
    echo $_REQUEST['page'];
    ?>
" />
			<input type="hidden" name="orderby" value="<?php 
    echo !empty($_REQUEST['orderby']) ? $_REQUEST['orderby'] : 'total';
    ?>
" />
			<input type="hidden" name="order" value="<?php 
    echo !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'DESC';
    ?>
" />
                    <?php 
    $testListTable->display();
    ?>
        </form>
 		
    </div>
    <?php 
}
// since 2.0 Easy Social Image Share Module
$essb_image_options = ESSBSocialImageShareOptions::get_instance();
if ($essb_image_options->is_active_module()) {
    include_once ESSB_PLUGIN_ROOT . 'lib/modules/easy-image-share/easy-image-share.php';
}
//if (is_admin () && (! defined ( 'DOING_AJAX' ) || ! DOING_AJAX)) {
if (is_admin()) {
    include ESSB_PLUGIN_ROOT . 'lib/external/autoupdate/plugin-update-checker.php';
    include ESSB_PLUGIN_ROOT . 'lib/admin/essb-metabox.php';
    include ESSB_PLUGIN_ROOT . 'lib/extensions/essb-settings-helper.php';
    include_once ESSB_PLUGIN_ROOT . 'lib/helpers/essb-shortcode-generator.php';
    global $stats;
    $stats = EasySocialShareButtons_Stats_Admin::get_instance();
    // @since 1.3.9.5 - Hanlde activation of Easy Social Metrics Lite
    if (ESSB_ESML_ACTIVE == 'false') {
        EasySocialMetricsUpdater::removeAllQueuedUpdates();
        delete_option("esml_version");
    }
    // /end load of Easy Social Metrics Lite
    include_once ESSB_PLUGIN_ROOT . 'lib/essb-admin.php';
    add_action('plugins_loaded', array('EasySocialShareButtons_Admin', 'get_instance'));
    $puchase_code = isset($option['purchase_code']) ? $option['purchase_code'] : 'none';
    // @since 1.3.3
    // autoupdate
    // activating autoupdate option
    $essb_autoupdate = PucFactory::buildUpdateChecker('http://update.creoworx.com/essb/', __FILE__, 'easy-social-share-buttons');
    // @since 1.3.7.2 - update to avoid issues with other plugins that uses same
    // method
    function addSecretKeyESSB($query)
    {
        global $puchase_code;