From 5270f951fb580d2c21ca8cb31174d3cc44166ef4 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Fri, 26 Aug 2011 17:45:47 +0300 Subject: Update limit-login-attempts, smart-youtube and wp-stats --- .../limit-login-attempts-es_ES.mo | Bin 5512 -> 5336 bytes .../limit-login-attempts-es_ES.po | 149 ++++++++--------- .../limit-login-attempts/limit-login-attempts.php | 36 +++-- plugins/limit-login-attempts/readme.txt | 10 +- plugins/smart-youtube/readme.txt | 3 + plugins/smart-youtube/smartyoutube.class.php | 18 ++- plugins/smart-youtube/smartyoutube.php | 4 +- plugins/stats/_inc/images/cloudybox-back.png | Bin 0 -> 517 bytes plugins/stats/_inc/jetpack.css | 101 ++++++++++++ plugins/stats/readme.txt | 29 +++- plugins/stats/stats.php | 177 +++++++++++++++------ 11 files changed, 365 insertions(+), 162 deletions(-) create mode 100644 plugins/stats/_inc/images/cloudybox-back.png create mode 100644 plugins/stats/_inc/jetpack.css diff --git a/plugins/limit-login-attempts/limit-login-attempts-es_ES.mo b/plugins/limit-login-attempts/limit-login-attempts-es_ES.mo index 8692f0df..a4d2033a 100755 Binary files a/plugins/limit-login-attempts/limit-login-attempts-es_ES.mo and b/plugins/limit-login-attempts/limit-login-attempts-es_ES.mo differ diff --git a/plugins/limit-login-attempts/limit-login-attempts-es_ES.po b/plugins/limit-login-attempts/limit-login-attempts-es_ES.po index c5170435..35f76eee 100755 --- a/plugins/limit-login-attempts/limit-login-attempts-es_ES.po +++ b/plugins/limit-login-attempts/limit-login-attempts-es_ES.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: limit-login-attempts 1.3\n" "Report-Msgid-Bugs-To: http://wordpress.org/tag/limit-login-attempts\n" -"POT-Creation-Date: 2009-01-28 17:17+0000\n" -"PO-Revision-Date: 2009-07-25 08:07-0300\n" -"Last-Translator: Marcelo Pedra \n" +"POT-Creation-Date: 2011-02-17 15:08:09+00:00\n" +"PO-Revision-Date: 2011-02-20 09:24-0300\n" +"Last-Translator: Marcelo Pedra \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,260 +18,249 @@ msgstr "" "X-Poedit-Language: Spanish\n" "X-Poedit-Country: ARGENTINA\n" -#: limit-login-attempts.php:372 -#, php-format +#: limit-login-attempts.php:474 msgid "%d hour" msgid_plural "%d hours" msgstr[0] "%d hora" msgstr[1] "%d horas" -#: limit-login-attempts.php:378 -#, php-format +#: limit-login-attempts.php:480 msgid "%d minute" msgid_plural "%d minutes" msgstr[0] "%d minuto" msgstr[1] "%d minutos" -#: limit-login-attempts.php:381 -#, php-format +#: limit-login-attempts.php:485 msgid "[%s] Too many failed login attempts" msgstr "[%s] Demasiados intentos de acceso fallidos" -#: limit-login-attempts.php:383 -#, php-format +#: limit-login-attempts.php:487 msgid "%d failed login attempts (%d lockout(s)) from IP: %s" msgstr "%d intentos de acceso fallidos (%d bloqueo(s)) desde la IP: %s" -#: limit-login-attempts.php:387 -#, php-format +#: limit-login-attempts.php:491 msgid "Last user attempted: %s" msgstr "Ultimo usuario probado: %s" -#: limit-login-attempts.php:390 -#, php-format +#: limit-login-attempts.php:494 msgid "IP was blocked for %s" msgstr "La IP se ha bloqueado para %s" -#: limit-login-attempts.php:445 +#: limit-login-attempts.php:551 msgid "ERROR: Too many failed login attempts." msgstr "ERROR: Demasiados intentos de acceso fallidos." -#: limit-login-attempts.php:449 +#: limit-login-attempts.php:555 msgid "Please try again later." msgstr "Por favor inténtelo más tarde." -#: limit-login-attempts.php:456 -#, php-format +#: limit-login-attempts.php:562 msgid "Please try again in %d hour." msgid_plural "Please try again in %d hours." msgstr[0] "Por favor inténtelo dentro de %d hora." msgstr[1] "Por favor inténtelo dentro de %d horas." -#: limit-login-attempts.php:458 -#, php-format +#: limit-login-attempts.php:564 msgid "Please try again in %d minute." msgid_plural "Please try again in %d minutes." msgstr[0] "Por favor inténtelo dentro de %d minuto." msgstr[1] "Por favor inténtelo dentro de %d minutos." -#: limit-login-attempts.php:487 -#, php-format +#: limit-login-attempts.php:593 msgid "%d attempt remaining." msgid_plural "%d attempts remaining." msgstr[0] "Le queda %d intento más." msgstr[1] "Le quedan %d intentos más." -#: limit-login-attempts.php:551 +#: limit-login-attempts.php:658 msgid "ERROR: Incorrect username or password." msgstr "ERROR: Nombre de usuario o contraseña incorrectos." -#: limit-login-attempts.php:714 -msgid "IP|Internet address" -msgstr "IP|Dirección de Internet" +#: limit-login-attempts.php:826 +msgctxt "Internet address" +msgid "IP" +msgstr "IP" -#: limit-login-attempts.php:714 +#: limit-login-attempts.php:826 msgid "Tried to log in as" msgstr "Intentó ingresar como" -#: limit-login-attempts.php:719 -#, php-format +#: limit-login-attempts.php:831 msgid "%d lockout" msgid_plural "%d lockouts" msgstr[0] "%d bloqueo" msgstr[1] "%d bloqueos" -#: limit-login-attempts.php:743 +#: limit-login-attempts.php:860 msgid "Cleared IP log" msgstr "Direcciones liberadas" -#: limit-login-attempts.php:751 +#: limit-login-attempts.php:868 msgid "Reset lockout count" msgstr "Reiniciar contador de bloqueos" -#: limit-login-attempts.php:759 +#: limit-login-attempts.php:876 msgid "Cleared current lockouts" msgstr "Bloqueos actuales liberados" -#: limit-login-attempts.php:788 +#: limit-login-attempts.php:905 msgid "Options changed" msgstr "Opciones actualizadas" -#: limit-login-attempts.php:799 -msgid "NOTE: Only works in Wordpress 2.7 or later" -msgstr "NOTA: Este plugin sólo funciona en Wordpress 2.7 o superior" - -#: limit-login-attempts.php:815 -#, php-format +#: limit-login-attempts.php:923 msgid "It appears the site is reached directly (from your IP: %s)" msgstr "Al parecer, el sitio está siendo accedido directamente (desde tu IP: %s)" -#: limit-login-attempts.php:817 -#, php-format +#: limit-login-attempts.php:925 msgid "It appears the site is reached through a proxy server (proxy IP: %s, your IP: %s)" msgstr "Al parecer, el sitio está siendo accedido desde un servidor proxy (IP del proxy: %s, tu IP: %s)" -#: limit-login-attempts.php:825 -#, php-format +#: limit-login-attempts.php:933 msgid "Current setting appears to be invalid. Please make sure it is correct. Further information can be found here" msgstr "La configuración actual parece ser incorrecta. Asegúrate de verificarla. Para mayor información, click aquí" -#: limit-login-attempts.php:833 +#: limit-login-attempts.php:941 msgid "Limit Login Attempts Settings" msgstr "Preferencias del Limitador de Acceso" -#: limit-login-attempts.php:834 +#: limit-login-attempts.php:942 msgid "Statistics" msgstr "Estadísticas" -#: limit-login-attempts.php:838 +#: limit-login-attempts.php:947 msgid "Total lockouts" msgstr "Bloqueos totales" -#: limit-login-attempts.php:841 +#: limit-login-attempts.php:950 msgid "Reset Counter" msgstr "Reiniciar contador" -#: limit-login-attempts.php:842 -#, php-format +#: limit-login-attempts.php:951 msgid "%d lockout since last reset" msgid_plural "%d lockouts since last reset" msgstr[0] "%d bloqueo desde el último reinicio." msgstr[1] "%d bloqueos desde el último reinicio." -#: limit-login-attempts.php:843 +#: limit-login-attempts.php:952 msgid "No lockouts yet" msgstr "Ningún bloqueo hasta ahora" -#: limit-login-attempts.php:848 +#: limit-login-attempts.php:957 msgid "Active lockouts" msgstr "Bloqueos activos" -#: limit-login-attempts.php:850 +#: limit-login-attempts.php:959 msgid "Restore Lockouts" msgstr "Restablecer bloqueos" -#: limit-login-attempts.php:851 -#, php-format +#: limit-login-attempts.php:960 msgid "%d IP is currently blocked from trying to log in" msgstr "La IP %d actualmente tiene restringido el acceso" -#: limit-login-attempts.php:857 +#: limit-login-attempts.php:966 msgid "Options" msgstr "Opciones" -#: limit-login-attempts.php:861 +#: limit-login-attempts.php:971 msgid "Lockout" msgstr "Bloqueo" -#: limit-login-attempts.php:863 +#: limit-login-attempts.php:973 msgid "allowed retries" msgstr "reintentos permitidos" -#: limit-login-attempts.php:864 +#: limit-login-attempts.php:974 msgid "minutes lockout" msgstr "minutos por bloqueo" -#: limit-login-attempts.php:865 +#: limit-login-attempts.php:975 msgid "lockouts increase lockout time to" msgstr "bloqueos incrementan el tiempo a" -#: limit-login-attempts.php:865 +#: limit-login-attempts.php:975 msgid "hours" msgstr "horas" -#: limit-login-attempts.php:866 +#: limit-login-attempts.php:976 msgid "hours until retries are reset" msgstr "horas hasta restablecer los reintentos" -#: limit-login-attempts.php:870 +#: limit-login-attempts.php:980 msgid "Site connection" msgstr "Conexión" -#: limit-login-attempts.php:876 +#: limit-login-attempts.php:986 msgid "Direct connection" msgstr "Connexión directa" -#: limit-login-attempts.php:881 +#: limit-login-attempts.php:991 msgid "From behind a reversy proxy" msgstr "Detrás de un proxy" -#: limit-login-attempts.php:887 +#: limit-login-attempts.php:997 msgid "Handle cookie login" msgstr "Gestionar cookies de login" -#: limit-login-attempts.php:889 +#: limit-login-attempts.php:999 msgid "Yes" msgstr "Sí" -#: limit-login-attempts.php:889 +#: limit-login-attempts.php:999 msgid "No" msgstr "No" -#: limit-login-attempts.php:894 +#: limit-login-attempts.php:1003 msgid "Notify on lockout" msgstr "Notificar al bloquear" -#: limit-login-attempts.php:896 +#: limit-login-attempts.php:1005 msgid "Log IP" msgstr "Registrar IP" -#: limit-login-attempts.php:897 +#: limit-login-attempts.php:1006 msgid "Email to admin after" msgstr "Enviar email al administrador cada" -#: limit-login-attempts.php:897 +#: limit-login-attempts.php:1006 msgid "lockouts" msgstr "bloqueos" -#: limit-login-attempts.php:902 +#: limit-login-attempts.php:1011 msgid "Change Options" msgstr "Cambiar opciones" -#: limit-login-attempts.php:910 +#: limit-login-attempts.php:1019 msgid "Lockout log" msgstr "Registro de bloqueos" -#: limit-login-attempts.php:914 +#: limit-login-attempts.php:1024 msgid "Clear Log" msgstr "Limpiar registro" -#. Plugin Name of an extension +#. Plugin Name of the plugin/theme msgid "Limit Login Attempts" msgstr "Límitador de intentos de login" -#. Plugin URI of an extension +#. Plugin URI of the plugin/theme msgid "http://devel.kostdoktorn.se/limit-login-attempts" msgstr "http://devel.kostdoktorn.se/limit-login-attempts" -#. Description of an extension +#. Description of the plugin/theme msgid "Limit rate of login attempts, including by way of cookies, for each IP." msgstr "Limita la tasa de intentos de acceso, usando cookies por IP." -#. Author of an extension +#. Author of the plugin/theme msgid "Johan Eenfeldt" msgstr "Johan Eenfeldt" -#. Author URI of an extension +#. Author URI of the plugin/theme msgid "http://devel.kostdoktorn.se" msgstr "http://devel.kostdoktorn.se" +#~ msgid "IP|Internet address" +#~ msgstr "IP|Dirección de Internet" +#~ msgid "NOTE: Only works in Wordpress 2.7 or later" +#~ msgstr "" +#~ "NOTA: Este plugin sólo funciona en Wordpress 2.7 o " +#~ "superior" + diff --git a/plugins/limit-login-attempts/limit-login-attempts.php b/plugins/limit-login-attempts/limit-login-attempts.php index 0407a8ea..a92f5b62 100755 --- a/plugins/limit-login-attempts/limit-login-attempts.php +++ b/plugins/limit-login-attempts/limit-login-attempts.php @@ -6,7 +6,7 @@ Author: Johan Eenfeldt Author URI: http://devel.kostdoktorn.se Text Domain: limit-login-attempts - Version: 1.6.1 + Version: 1.6.2 Copyright 2008 - 2011 Johan Eenfeldt @@ -85,7 +85,7 @@ $limit_login_nonempty_credentials = false; /* user and pwd nonempty */ * Startup */ -limit_login_setup(); +add_action('init', 'limit_login_setup'); /* @@ -501,22 +501,26 @@ function limit_login_notify_email($user) { /* Logging of lockout (if configured) */ function limit_login_notify_log($user) { - $log = get_option('limit_login_logged'); - $ip = limit_login_get_address(); + $log = $option = get_option('limit_login_logged'); if (!is_array($log)) { - $log = array($ip => array($user => 1)); - add_option('limit_login_logged', $log, '', 'no'); /* no autoload */ - } else { - /* can be written much simpler, if you do not mind php warnings */ - if (isset($log[$ip])) { - if (isset($log[$ip][$user])) { - $log[$ip][$user]++; - } else { - $log[$ip][$user] = 1; - } + $log = array(); + } + $ip = limit_login_get_address(); + + /* can be written much simpler, if you do not mind php warnings */ + if (isset($log[$ip])) { + if (isset($log[$ip][$user])) { + $log[$ip][$user]++; } else { - $log[$ip] = array($user => 1); + $log[$ip][$user] = 1; } + } else { + $log[$ip] = array($user => 1); + } + + if ($option === false) { + add_option('limit_login_logged', $log, '', 'no'); /* no autoload */ + } else { update_option('limit_login_logged', $log); } } @@ -855,7 +859,7 @@ function limit_login_option_page() { /* Should we clear log? */ if (isset($_POST['clear_log'])) { - update_option('limit_login_logged', ''); + delete_option('limit_login_logged'); echo '

' . __('Cleared IP log', 'limit-login-attempts') . '

'; diff --git a/plugins/limit-login-attempts/readme.txt b/plugins/limit-login-attempts/readme.txt index 5b2ba085..5c375647 100755 --- a/plugins/limit-login-attempts/readme.txt +++ b/plugins/limit-login-attempts/readme.txt @@ -2,8 +2,8 @@ Contributors: johanee Tags: login, security, authentication Requires at least: 2.8 -Tested up to: 3.1-RC4 -Stable tag: 1.6.1 +Tested up to: 3.2.1 +Stable tag: 1.6.2 Limit rate of login attempts, including by way of cookies, for each IP. Fully customizable. @@ -67,6 +67,12 @@ If you have access to the database (for example through phpMyAdmin) you can clea == Changelog == += 1.6.2 = +* Fix bug where log would not get updated after it had been cleared +* Do plugin setup in 'init' action +* Small update to Spanish translation file, thanks to Marcelo Pedra +* Tested against WordPress 3.2.1 + = 1.6.1 = * (WordPress 3.0+) An invalid cookie can sometimes get sent multiple times before it gets cleared, resulting in multiple failed attempts or even a lockout from a single invalid cookie. Store the latest failed cookie to make sure we only count it as one failed attempt * Define "Text Domain" correctly diff --git a/plugins/smart-youtube/readme.txt b/plugins/smart-youtube/readme.txt index 6a86b6f8..e68d2f01 100644 --- a/plugins/smart-youtube/readme.txt +++ b/plugins/smart-youtube/readme.txt @@ -37,6 +37,9 @@ Plugin by Vladimir Prelovac. Looking for


-
?] (videos may not work for Iphone users) +
+

Custom code compatibility

@@ -465,6 +467,7 @@ END; $disp_ann = $this->options['ann'] == 'on' ? '&iv_load_policy=3' : ''; $template = trim($this->options['template']) == '' ? '{video}' : $this->options['template']; $valid = $this->options['valid']; + $dark_player = ( $this->options['dark_player'] == 'on' ) ? '&theme=dark' : ''; switch ($high) { @@ -519,14 +522,14 @@ END; $root_url = $this->options['privacy'] ? 'http://www.youtube-nocookie.com' : 'http://www.youtube.com'; if ($this->options['iframe']=='on') -$video_url = htmlspecialchars("$root_url/embed/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time; +$video_url = htmlspecialchars("$root_url/embed/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel$dark_player", ENT_QUOTES) . $high . $time; else -$video_url = htmlspecialchars("$root_url/v/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time; +$video_url = htmlspecialchars("$root_url/v/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en$ap&loop=$loop{$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel$dark_player", ENT_QUOTES) . $high . $time; if ($playlist) { - $video_url = htmlspecialchars("$root_url/p/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en$ap&loop={$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel", ENT_QUOTES) . $high . $time; + $video_url = htmlspecialchars("$root_url/p/$file?color1={$this->custom_colors[$disp_color][0]}&color2={$this->custom_colors[$disp_color][1]}&border=$disp_border&fs=1&hl=en$ap&loop={$disp_info}$disp_ann&showsearch=$disp_search&rel=$disp_rel$dark_player", ENT_QUOTES) . $high . $time; if ($this->options['iframe']=='on') $yte_tag = << '', 'wtitle' => '', 'tag' => '', - 'iframe' => 'on' + 'iframe' => 'on', + 'dark_player' => '' ); $saved = get_option($this->key); diff --git a/plugins/smart-youtube/smartyoutube.php b/plugins/smart-youtube/smartyoutube.php index 9f1f8a47..c3fa0d01 100644 --- a/plugins/smart-youtube/smartyoutube.php +++ b/plugins/smart-youtube/smartyoutube.php @@ -4,7 +4,7 @@ Plugin Name: Smart Youtube Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization. Author: Vladimir Prelovac -Version: 3.8.8 +Version: 3.8.9 Author URI: http://www.prelovac.com/vladimir/ @@ -73,4 +73,4 @@ if (isset($smart_youtube)) return false; require_once(dirname(__FILE__) . '/smartyoutube.class.php'); -$smart_youtube = new SmartYouTube(); \ No newline at end of file +$smart_youtube = new SmartYouTube(); diff --git a/plugins/stats/_inc/images/cloudybox-back.png b/plugins/stats/_inc/images/cloudybox-back.png new file mode 100644 index 00000000..c2813868 Binary files /dev/null and b/plugins/stats/_inc/images/cloudybox-back.png differ diff --git a/plugins/stats/_inc/jetpack.css b/plugins/stats/_inc/jetpack.css new file mode 100644 index 00000000..ec0d9d2b --- /dev/null +++ b/plugins/stats/_inc/jetpack.css @@ -0,0 +1,101 @@ +.jetpack-message { + position: relative; + z-index: 100; + border: 1px solid #2a8cba !important; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background: url( images/cloudybox-back.png ) 100% 100% no-repeat; + background-color: #6aafcf !important; + -webkit-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + -moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + padding: 18px 90px 8px 15px !important; + overflow: hidden; + line-height: 180%; +} + +.jp-connect { padding: 10px 0 5px !important; } + +#jetpack-settings > .jetpack-message { margin: 10px 13px 10px 15px } + +.jetpack-message .squeezer { + margin: 0 0 2px; + padding: 0 10px; + text-align: left; + overflow: hidden; +} + +.jetpack-message h4 { + margin: 5px 0 0 0; + font-size: 18px; + font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; + font-weight: normal; + color: #fff; + text-shadow: 0px 1px 1px rgba(0,0,0,0.4); + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + display: block; + float: left; +} + +.jetpack-message h5 { + font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; + margin: 0; +} + +.jetpack-message code, .jetpack-err p { + background: rgba( 0,0,0,0.2 ); + font-size: 14px; + padding: 3px 5px !important; + text-shadow: 0px 1px 1px rgba(0,0,0,0.4); + color: #fff; +} + +.jetpack-message p { + float: right; + margin: -1px 0 0 0 !important; + padding: 0; + display: block; +} + +.jetpack-message a { + color: #fff; + text-decoration: underline; +} + +.jetpack-message a:hover { + color: #000; + text-decoration: underline; +} + +.jetpack-message p a.button-primary { + font-size: 16px !important; + display: inline-block; + padding: 8px 15px; + color: #fff; + text-align: center; + font-size: 20px; + text-decoration: none; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + border: 1px solid #8caa46; + background: #b4d278; + -moz-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); + -webkit-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); + box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); + text-shadow: 0px -1px 0px rgba( 0,0,0,0.3); + -webkit-transition-duration: .3s; + -moz-transition-duration: .3s; + cursor: pointer; + font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; +} + +.jetpack-message p a.button-primary:hover, .jetpack-message p a.button-primary:active { + background-color: #f0a000; + border-color: #c87800; + -webkit-transition-duration: .3s; + outline: none; +} \ No newline at end of file diff --git a/plugins/stats/readme.txt b/plugins/stats/readme.txt index 745919eb..ec20bb1c 100644 --- a/plugins/stats/readme.txt +++ b/plugins/stats/readme.txt @@ -1,21 +1,25 @@ === WordPress.com Stats === -Contributors: automattic, skeltoac, mdawaffe +Contributors: automattic, skeltoac, mdawaffe, tmoorewp Tags: stats, statistics, views Requires at least: 2.8 -Tested up to: 3.1 -Stable tag: 1.8.1 +Tested up to: 3.2.1 +Stable tag: 1.8.5 -You can have simple, concise stats with no additional load on your server by plugging into WordPress.com's stat system. +Simple, concise stats with no additional load on your server. Plug into WordPress.com's stats system with this plugin or use Jetpack to bring even more great WordPress.com features to your self-hosted blog. == Description == -There are hundreds of plugins and services which can provide statistics about your visitors. However I found that even though something like Google Analytics provides an incredible depth of information, it can be overwhelming and doesn't really highlight what's most interesting to me as a writer. That's why Automattic created its own stats system, to focus on just the most popular metrics a blogger wants to track and provide them in a clear and concise interface. +WordPress.com Stats is out of date. Get Jetpack for the latest and greatest in Stats. Get Jetpack now! + +There are hundreds of plugins and services which can provide statistics about your visitors. However even though something like Google Analytics provides an incredible depth of information, it can be overwhelming and doesn't really highlight what's most interesting to me as a writer. That's why Automattic created its own stats system, to focus on just the most popular metrics a blogger wants to track and provide them in a clear and concise interface. Installing this stats plugin is much like installing Akismet, all you need is to put in your [API Key](http://wordpress.com/api-keys/ "You can get a free API key from WordPress.com") and the rest is automatic. Once it's running it'll begin collecting information about your pageviews, which posts and pages are the most popular, where your traffic is coming from, and what people click on when they leave. It'll also add a link to your dashboard which allows you to see all your stats on a single page. A small chart will appear in your admin bar if you are running WordPress 3.1 or later. And that's it. Less is more. -Finally, because all of the processing and collection runs on our servers and not yours, it doesn't cause any additional load on your hosting account. In fact, it's one of the fastest stats system, hosted or not hosted, that you can use. +Finally, because all of the processing and collection runs on our servers and not yours, it doesn't cause any additional load on your hosting account. In fact, it's one of the fastest stats system, hosted or not hosted, that you can use. Our stats reports reflect new visits typically within ten seconds. + +As we are considering adding great new features, this plugin also puts a Quantcast tracking script on your page. == Screenshots == @@ -82,6 +86,19 @@ We opened our database for developers to retrieve stats. The API is at `http://s == Changelog == += 1.8.5 = +* Fixed typo. + += 1.8.4 = +* Added notice to upgrade to Jetpack + += 1.8.2 = +* Fix always-on admin_bar option (reported by sillybean) +* Send more post data to the API (no content or passwords) +* Send more blog data to the API for generating reports +* Fix API key reset link +* Update readme to mention Quantcast and Jetpack + = 1.8.1 = * Drop SSL from server-to-server requests for stats reports * Prepare dashboard widget for upgrade to flot charts diff --git a/plugins/stats/stats.php b/plugins/stats/stats.php index 1b1d2239..97c39bc4 100644 --- a/plugins/stats/stats.php +++ b/plugins/stats/stats.php @@ -2,9 +2,9 @@ /* Plugin Name: WordPress.com Stats Plugin URI: http://wordpress.org/extend/plugins/stats/ -Description: Tracks views, post/page views, referrers, and clicks. Requires a WordPress.com API key. +Description: Future upgrades to WordPress.com Stats will only be available in Jetpack. Author: Automattic -Version: 1.8.1 +Version: 1.8.5 License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html Text Domain: stats @@ -15,7 +15,63 @@ img#wpstats{display:none} */ -define( 'STATS_VERSION', '6' ); +define( 'STATS_VERSION', '8' ); + +function stats_display_nag_on_plugin_page() { + if ( 8 <= STATS_VERSION && strpos( $_SERVER['REQUEST_URI'], 'plugins.php' ) ) + stats_display_jetpack_nag(); +} + +function stats_fetch_autoinstall_url() { + if ( is_multisite() ) + $auto_url = get_bloginfo( 'url' ) . "/wp-admin/network/plugin-install.php?tab=search&type=term&s=jetpack&plugin-search-input=Search+Plugins"; + else + $auto_url = get_bloginfo( 'url' ) . "/wp-admin/plugin-install.php?tab=search&type=term&s=jetpack&plugin-search-input=Search+Plugins"; + + return esc_url( $auto_url ); +} + +function stats_link_plugin_meta( $links, $file ) { + $plugin = plugin_basename( __FILE__ ); + + // create link + if ( $file == $plugin ) { + return array_merge( + $links, + array( sprintf( '%2$s', stats_fetch_autoinstall_url(), __( 'Get Jetpack Now!' ) ) ) + ); + } + + return $links; +} + +function stats_admin_styles() { + wp_enqueue_style( 'jetpack', plugins_url( '_inc/jetpack.css', __FILE__ ), false, '20110824' ); +} + +function stats_display_jetpack_nag() { + static $shown = false; + if ( $shown ) { + return; + } + + $options = stats_get_options(); + + if ( ! $options['dismiss_jetpack_nag'] && ! class_exists( 'Jetpack' ) ) { + $shown = true; + ?> + + '', - 'path' => '', - 'blog_id' => false, - 'admin_bar' => true, - 'wp_me' => true, - 'roles' => array('administrator','editor','author'), - 'reg_users' => false, - 'footer' => false, + 'host' => '', + 'path' => '', + 'blog_id' => false, + 'admin_bar' => true, + 'wp_me' => true, + 'roles' => array('administrator','editor','author'), + 'reg_users' => false, + 'footer' => false, + 'dismiss_jetpack_nag' => false, ); if ( is_array( $options ) && !empty( $options ) ) @@ -148,6 +205,12 @@ function stats_admin_menu() { add_action("load-$hook", 'stats_admin_load'); add_action("admin_head-$hook", 'stats_admin_head'); add_action('admin_notices', 'stats_admin_notices'); + + if ( ! class_exists( 'Jetpack' ) ) { + add_action( "admin_print_styles", 'stats_admin_styles' ); + add_action( 'admin_head', 'stats_display_nag_on_plugin_page' ); + add_filter( 'plugin_row_meta', 'stats_link_plugin_meta', 10, 2 ); + } } function stats_admin_parent() { @@ -183,8 +246,13 @@ function stats_reports_head() { } function stats_reports_page() { + // display Jetpack nag on 20% of page loads + if ( 20 >= mt_rand( 0, 100 ) ) + stats_display_jetpack_nag(); + if ( isset( $_GET['dashboard'] ) ) return stats_dashboard_widget_content(); + $blog_id = stats_get_option('blog_id'); $key = stats_get_api_key(); $day = isset( $_GET['day'] ) && preg_match( '/^\d{4}-\d{2}-\d{2}$/', $_GET['day'] ) ? $_GET['day'] : false; @@ -311,8 +379,8 @@ function stats_convert_post_title($matches) { } function stats_admin_load() { - if ( ! empty( $_POST['action'] ) && $_POST['_wpnonce'] == wp_create_nonce('stats') ) { - switch( $_POST['action'] ) { + if ( ! empty( $_REQUEST['action'] ) && $_REQUEST['_wpnonce'] == wp_create_nonce('stats') ) { + switch( $_REQUEST['action'] ) { case 'reset' : stats_set_options(array()); wp_redirect( stats_admin_path() ); @@ -351,10 +419,10 @@ function stats_admin_load() { case 'save_options' : $options = stats_get_options(); - if ( isset($_POST['admin_bar']) ) - $options['admin_bar'] = (bool) $_POST['admin_bar']; + $options['admin_bar'] = isset($_POST['admin_bar']) && $_POST['admin_bar']; $options['wp_me'] = isset($_POST['wp_me']) && $_POST['wp_me']; $options['reg_users'] = isset($_POST['reg_users']) && $_POST['reg_users']; + $options['dismiss_jetpack_nag'] = isset( $_POST['dismiss_jetpack_nag'] ) && $_POST['dismiss_jetpack_nag']; $options['roles'] = array('administrator'); foreach ( get_editable_roles() as $role => $details ) @@ -380,9 +448,11 @@ function stats_admin_notices() { function stats_notice_blog_id() { if ( stats_get_api_key() || isset($_GET['page']) && $_GET['page'] == 'wpstats' ) return; + // Skip the notice if plugin activated network-wide. if ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network(plugin_basename(__FILE__)) ) return; + echo "

" . sprintf(__('WordPress.com Stats needs attention: please enter an API key or disable the plugin.', 'stats'), stats_admin_path()) . "

"; } @@ -412,6 +482,7 @@ function stats_admin_head() { function stats_admin_page() { $options = stats_get_options(); + stats_display_jetpack_nag(); // DISPLAY JETPACK NAG ?>

@@ -498,6 +569,8 @@ function stats_admin_page() { + + @@ -530,43 +603,50 @@ function stats_xmlrpc_methods( $methods ) { function stats_get_posts( $args ) { list( $post_ids ) = $args; - $post_ids = array_map( 'intval', (array) $post_ids ); - $r = 'include=' . join(',', $post_ids); + $r = array( + 'include' => $post_ids, + 'post_type' => 'any', + 'post_status' => 'any', + ); $posts = get_posts( $r ); - $_posts = array(); - - foreach ( $post_ids as $post_id ) - $_posts[$post_id] = stats_get_post($post_id); - - return $_posts; + foreach ( $posts as $i => $post ) + $posts[$i] = stats_get_post( $post ); + return $posts; } -function stats_get_blog( ) { - $home = parse_url( get_option('home') ); +function stats_get_blog() { + $home = parse_url( trailingslashit( get_option( 'home' ) ) ); $blog = array( - 'host' => $home['host'], - 'path' => $home['path'], - 'name' => get_option('blogname'), - 'description' => get_option('blogdescription'), - 'siteurl' => get_option('siteurl'), - 'gmt_offset' => get_option('gmt_offset'), - 'version' => STATS_VERSION - ); - return array_map('esc_html', $blog); -} - -function stats_get_post( $post_id ) { - $post = get_post( $post_id ); - if ( empty( $post ) ) - $post = get_page( $post_id ); - $_post = array( - 'id' => $post->ID, - 'permalink' => get_permalink($post->ID), - 'title' => $post->post_title, - 'type' => $post->post_type + 'host' => $home['host'], + 'path' => $home['path'], + 'blogname' => get_option( 'blogname' ), + 'blogdescription' => get_option( 'blogdescription' ), + 'siteurl' => get_option( 'siteurl' ), + 'gmt_offset' => get_option( 'gmt_offset' ), + 'timezone_string' => get_option( 'timezone_string' ), + 'stats_version' => STATS_VERSION, + 'stats_api' => 'jetpack', + 'page_on_front' => get_option( 'page_on_front' ), + 'permalink_structure' => get_option( 'permalink_structure' ), + 'category_base' => get_option( 'category_base' ), + 'tag_base' => get_option( 'tag_base' ), ); - return array_map('esc_html', $_post); + $blog = array_merge( stats_get_options(), $blog ); + unset( $blog['roles'], $blog['blog_id'] ); + return array_map( 'esc_html', $blog ); +} + +function stats_get_post( $post ) { + $post = get_post( $post ); + if ( $post ) { + $post->permalink = get_permalink( $post ); + $post->post_content = ''; + $post->post_excerpt = ''; + $post->post_content_filtered = ''; + $post->post_password = ''; + } + return $post; } function stats_client() { @@ -1008,9 +1088,9 @@ function stats_str_getcsv( $csv ) { function stats_dashboard_widget_content() { $blog_id = stats_get_option('blog_id'); - if ( ( !$width = (int) ( $_GET['width'] / 2 ) ) || $width < 250 ) + if ( !isset( $_GET['width'] ) || ( !$width = (int) ( $_GET['width'] / 2 ) ) || $width < 250 ) $width = 370; - if ( ( !$height = (int) $_GET['height'] - 36 ) || $height < 230 ) + if ( !isset( $_GET['height'] ) || ( !$height = (int) $_GET['height'] - 36 ) || $height < 230 ) $height = 230; $_width = $width - 5; @@ -1316,4 +1396,3 @@ add_action( 'update_option_permalink_structure', 'stats_flush_posts' ); add_filter( 'xmlrpc_methods', 'stats_xmlrpc_methods' ); define( 'STATS_XMLRPC_SERVER', 'http://wordpress.com/xmlrpc.php' ); - -- cgit v1.2.3