/** * Ausführung der XMLRPC-Anfrage * * @since 1.1.0 * @change 1.2.5 * * @param array $args Array mit Parametern (Zugangsdaten) * @return string String mit Ergebnissen */ public static function xmlrpc_callback($args) { /* Keine Zugangsdaten? */ if (empty($args[0]) or empty($args[1])) { return '{"error": "Empty login data"}'; } /* Nutzer einloggen */ $user = wp_authenticate($args[0], $args[1]); /* Falsche Zugangsdaten */ if (!$user or is_wp_error($user)) { return '{"error": "Incorrect login"}'; } /* Berechtigung prüfen */ if (!user_can($user, 'edit_dashboard')) { return '{"error": "User can check failed"}'; } /* Leer? */ if (!($data = Statify_Dashboard::get_stats())) { return '{"error": "No data"}'; } return json_encode($data['visits']); }
/** * Set plugin version from plugin meta data * * @since 1.4.0 * @change 1.4.0 */ private static function _get_version() { /* Get plugin meta */ $meta = get_plugin_data(STATIFY_FILE); self::$_plugin_version = $meta['Version']; }
<?php /* Quit */ class_exists('Statify') or exit; /* Get stats */ $stats = Statify_Dashboard::get_stats(); ?> <div id="statify_chart"> <?php if (empty($stats['visits'])) { ?> <p> <?php esc_html_e('No data available.', 'statify'); ?> </p> <?php } else { ?> <table id="statify_chart_data"> <?php foreach ($stats['visits'] as $visit) { ?> <tr> <th><?php echo date_i18n(get_option('date_format'), strtotime($visit['date'])); ?> </th> <td><?php