Exemple #1
0
<?php

if (!current_user_can('manage_options')) {
    wp_die(__('You do not have sufficient permissions to access this page.'));
}
wpMandrill::getConnected();
?>
<div class="wrap">
<div class="icon32" style="background: url('<?php 
echo plugins_url('images/mandrill-head-icon.png', __FILE__);
?>
');"><br /></div>
<h2><?php 
_e('Mandrill Service Report', 'wpmandrill');
?>
</h2><?php 
$stats = self::getCurrentStats();
if (empty($stats)) {
    echo '<p>' . __('There was a problem retrieving statistics.', 'wpmandrill') . '</p>';
    echo '</div>';
    return;
}
$delivered = $stats['general']['stats']['sent'] - $stats['general']['stats']['hard_bounces'] - $stats['general']['stats']['soft_bounces'] - $stats['general']['stats']['rejects'];
$lit = array();
$lit['hourly']['title'] = __('Hourly Sending Volume and Open/Click Rate', 'wpmandrill');
$lit['hourly']['Xtitle'] = __('Hours', 'wpmandrill');
$lit['hourly']['tooltip'] = __('Hour', 'wpmandrill');
$lit['daily']['title'] = __('Daily Sending Volume and Open/Click Rate', 'wpmandrill');
$lit['daily']['Xtitle'] = __('Days', 'wpmandrill');
$lit['daily']['tooltip'] = __('Day', 'wpmandrill');
$lit['subtitle'] = __('in the last 30 days', 'wpmandrill');
/**
 * Get the notification strategy.
 *
 * @internal
 *
 * @since 1.0
 *
 * @return \IronBound\WP_Notifications\Strategy\Strategy
 */
function get_notification_strategy()
{
    if (class_exists('wpMandrill') && ($c = \wpMandrill::getConnected() && \wpMandrill::isConnected())) {
        $key = \wpMandrill::getAPIKey();
        $strategy = new Mandrill_Strategy(new Mandrill_API($key));
    } elseif (defined('ITELIC_Mandrill') && class_exists('Mandrill')) {
        $key = ITELIC_Mandrill;
        $strategy = new Mandrill_Strategy(new Mandrill_API($key));
    } else {
        $strategy = new iThemes_Exchange();
    }
    /**
     * Get a notifications strategy.
     *
     * @since 1.0
     *
     * @param \IronBound\WP_Notifications\Strategy\Strategy $strategy
     * @param string                                        $batch_name
     */
    return apply_filters('itelic_get_queue_processor', $strategy);
}