diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..0fc58102 --- /dev/null +++ b/composer.json @@ -0,0 +1,25 @@ +{ + "name": "10up/simple-local-avatars", + "description": "Adds an avatar upload field to user profiles. Generates requested sizes on demand just like Gravatar!", + "version": "2.1", + "type": "wordpress-plugin", + "keywords": [ + "wordpress", + "10up" + ], + "homepage": "https://github.com/10up/simple-local-avatars", + "license": ["GPL-2.0-only"], + "authors": [ + { + "name": "10up", + "homepage": "https://10up.com/" + } + ], + "support": { + "issues": "https://github.com/10up/simple-local-avatars/issues", + "source": "https://github.com/10up/simple-local-avatars" + }, + "require": { + "php": ">=5.3" + } +} \ No newline at end of file diff --git a/localization/simple-local-avatars-be_BY.mo b/localization/simple-local-avatars-be_BY.mo deleted file mode 100644 index b71bf167..00000000 Binary files a/localization/simple-local-avatars-be_BY.mo and /dev/null differ diff --git a/localization/simple-local-avatars-be_BY.po b/localization/simple-local-avatars-be_BY.po deleted file mode 100644 index d52ef7bc..00000000 --- a/localization/simple-local-avatars-be_BY.po +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-11-03 19:09+0200\n" -"Last-Translator: \n" -"Language-Team: Web Geeks\n" -"X-Poedit-Language: Belarusian\n" -"X-Poedit-Country: BELARUS\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Лакальныя налады аватара" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Толькі карыстачы вызначанай катэгорыі могуць загружаць аватары (Аўтары і вышэй)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Аватар" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Загрузіць аватар" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "Няма установленого лакальнага аватара. Выкарыстоўвайце загрузку, каб дадаць аватар." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Выдаліць лакальны аватар" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Замяніць лакальны аватар загрузіўшы новы малюнак ці сцерці лакальны аватар пазначыўшы опцыю выдалення. (па змаўчанні вернецца gravatar)" - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "Лакальны аватар не ўсталяваны. Усталяваць ваш аватар на Gravatar.com" - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "Вашых паўнамоцтваў не досыць для змены аватара. Каб змяніць лакальны аватар, звяжыцеся з адміністратарам сайта." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Лакальны аватар" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Дадаць запампоўку аватара да профіля карыстача, калі ў бягучага карыстача ёсць паўнамоцтвы. Генераваць такія ж памеры, як на Gravatar-е. Проста і лёгка." - diff --git a/localization/simple-local-avatars-de_DE.mo b/localization/simple-local-avatars-de_DE.mo deleted file mode 100644 index 95abc45a..00000000 Binary files a/localization/simple-local-avatars-de_DE.mo and /dev/null differ diff --git a/localization/simple-local-avatars-de_DE.po b/localization/simple-local-avatars-de_DE.po deleted file mode 100644 index 479da08d..00000000 --- a/localization/simple-local-avatars-de_DE.po +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-01-18 14:17-0500\n" -"Last-Translator: Jake Goldman <jakemgold@emailgroups.net>\n" -"Language-Team: \n" -"X-Poedit-Language: German\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Profilbild-Berechtigungen" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Erlaube ausschließlich Benutzern mit der Berechtigung zum Bearbeiten von Dateien das Hochladen von Profilbildern (Autoren und darüber)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Profilbild" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Profilbild hochladen" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "Es ist kein Profilbild festgelegt. Klicke „Durchsuchen…“, um ein Profilbild hochzuladen." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Profilbild löschen" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Ersetze das Profilbild, indem du ein neues hochlädst, oder lösche das Profilbild (dann wird ggf. dein Gravatar angezeigt), indem du „Profilbild löschen“ auswählst." - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "Es ist kein Profilbild festgelegt. Lade dein Profilbild bei Gravatar.com hoch." - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "Du hast keine Berechtigung zur Bearbeitung von Mediadateien. Um dein Profilbild zu ändern, kontaktiere den Administrator dieser Website." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Simple Local Avatars (Einfache lokale Profilbilder)" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Fügt ein Feld zum Hochladen eines Profilbilds (Avatar) hinzu, sofern der Benutzer zum Bearbeiten von Mediadateien berechtigt ist. Generiert die erforderlichen Maße, genau wie Gravatar! Einfach und schlank." diff --git a/localization/simple-local-avatars-es_ES.mo b/localization/simple-local-avatars-es_ES.mo deleted file mode 100644 index 78833ca0..00000000 Binary files a/localization/simple-local-avatars-es_ES.mo and /dev/null differ diff --git a/localization/simple-local-avatars-es_ES.po b/localization/simple-local-avatars-es_ES.po deleted file mode 100644 index d0b67eb2..00000000 --- a/localization/simple-local-avatars-es_ES.po +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-01-26 10:57+0100\n" -"Last-Translator: KLAMM <http://retroriff.com>\n" -"Language-Team: \n" -"X-Poedit-Language: Spanish\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Permisos de Local Avatar" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Sólo aceptar usuarios con permisos para subir avatares locales (Autores y superiores)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Avatar" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Subir avatar" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "No se ha configurado ningún avatar. Usa el formulario para subir tu propio avatar." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Eliminar avatar" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Substituye el avatar subiendo uno nuevo, o borrando el avatar actual seleccionando la opción de eliminar (en su lugar se utilizará Gravatar.com)." - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "No se ha configurado ningún avatar. Configura tu avatar en Gravatar.com." - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "No tienes los permisos necesarios. Para cambiar tu avatar contacta con el administrador del blog." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Simple Local Avatars" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Añade un campo para subir un avatar a los perfiles de usuario siempre que éstos tengan los permisos adecuados. Redimensiona las imágenes de la misma manera que Gravatar. Simple y ligero." - diff --git a/localization/simple-local-avatars-fr_FR.mo b/localization/simple-local-avatars-fr_FR.mo deleted file mode 100644 index 24596e69..00000000 Binary files a/localization/simple-local-avatars-fr_FR.mo and /dev/null differ diff --git a/localization/simple-local-avatars-fr_FR.po b/localization/simple-local-avatars-fr_FR.po deleted file mode 100644 index fd0ba02d..00000000 --- a/localization/simple-local-avatars-fr_FR.po +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-01-27 00:16+0100\n" -"Last-Translator: Valentin Brandt <nitraxer@gmail.com>\n" -"Language-Team: \n" -"X-Poedit-Language: German\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Permissions des avatars" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Autoriser uniquement les utilisateurs ayant les capacités d'envoyer un avatar sur le serveur (auteurs)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Avatar" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Envoyer un Avatar" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "Il n'y aucun avatar local. Utilisez le champ de téléchargement pour ajouter un avatar local." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Supprimer l'avatar local" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Remplacer l'avatar local en envoyant un nouvel avatar, ou effacez-le (vous allez retomber à un gravatar, si disponible) en cochant l'option de suppression." - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "Aucun avatar local. Configurez votre avatar sur Gravatar.com." - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "Vous n'avez pas les autorisations nécessaire pour gérer les médias. Pour changer votre avatar local, contacter l'administrateur du blog." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Simple Local Avatars" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Ajoute un champ d'envoi d'avatar pour les profils utilisateurs, si l'utilisateur dispose des autorisations pour gérer les médias du blog. Il est possible de générer de nouvelles tailles, à la demande ! Simple et léger." - diff --git a/localization/simple-local-avatars-hu_HU.mo b/localization/simple-local-avatars-hu_HU.mo deleted file mode 100755 index 4da228ac..00000000 Binary files a/localization/simple-local-avatars-hu_HU.mo and /dev/null differ diff --git a/localization/simple-local-avatars-hu_HU.po b/localization/simple-local-avatars-hu_HU.po deleted file mode 100755 index c015cb03..00000000 --- a/localization/simple-local-avatars-hu_HU.po +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2013-02-04 22:13+0100\n" -"Last-Translator: Zahalka Bence <bence.zahalka@invitel.hu>\n" -"Language-Team: Bence Zahalka\n" -"Language: magyar\n" -"X-Generator: Poedit 1.5.4\n" -"X-Poedit-Basepath: ..\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Lokális profilkép engedélyek" - -#: simple-local-avatars.php:120 -msgid "" -"Only allow users with file upload capabilities to upload local avatars " -"(Authors and above)" -msgstr "" -"Csak azok a felhasználók tölthessenek fel saját avatárt, akik fájlokat is " -"tölthetnek fel (Szerzők, vagy magasabb jogosultsági szintűek)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Profilkép" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Profilkép feltöltése" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "" -"Még nincs profilkép feltöltve. Saját profilkép hozzáadásához használd a " -"feltöltés mezőt!" - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Profilkép törlése" - -#: simple-local-avatars.php:152 -msgid "" -"Replace the local avatar by uploading a new avatar, or erase the local " -"avatar (falling back to a gravatar) by checking the delete option." -msgstr "" -"A meglévő profilkép lecserélhető egy új profilkép feltöltésével, vagy a " -"meglévő törlésével (ekkor a gravatar képed lesz használva), ha bepipálod a " -"törlés mezőt." - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "" -"Nincs lokális profilképed. Állíts be magadnak egy profilképet a Gravatar.com " -"oldalon!" - -#: simple-local-avatars.php:161 -msgid "" -"You do not have media management permissions. To change your local avatar, " -"contact the blog administrator." -msgstr "" -"Nincs médiafájl-kezelési jogosultságod! A profilképed megváltoztatásához meg " -"kell keresned az oldal valamelyik adminisztrátorát." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Egyszerű helyi profilképek" - -#. Description of the plugin/theme -msgid "" -"Adds an avatar upload field to user profiles if the current user has media " -"permissions. Generates requested sizes on demand just like Gravatar! Simple " -"and lightweight." -msgstr "" -"A felhasználói profilhoz hozzáad egy profilkép feltöltése mezőt, ha a " -"felhasználónak van médiakezelési jogosultsága. A szükséges képméreteket " -"éppúgy legenerálja, mint a Gravatar. Egyszerű és pehelykönnyű." diff --git a/localization/simple-local-avatars-it_IT.mo b/localization/simple-local-avatars-it_IT.mo deleted file mode 100644 index dca4e99f..00000000 Binary files a/localization/simple-local-avatars-it_IT.mo and /dev/null differ diff --git a/localization/simple-local-avatars-it_IT.po b/localization/simple-local-avatars-it_IT.po deleted file mode 100644 index 283459a9..00000000 --- a/localization/simple-local-avatars-it_IT.po +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-01-18 21:35+0100\n" -"Last-Translator: MARCO <marco@teethgrinder.net>\n" -"Language-Team: \n" -"X-Poedit-Language: Italian\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Permessi per Avatar Locali" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Consentire solo agli utenti con permessi di upload di caricare avatar locali (Autori e superiori) " - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Avatar" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Caricare l'Avatar" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "Nessun avatar locale è stato definito. Usa il campo di upload per aggiungerne uno." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Cancella l'avatar locale" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Sostituire l'avatar locale caricandone uno nuovo, o cancellarlo (tornando al Gravatar) selezionando l'opzione di eliminazione." - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "Non è impostato alcun avatar locale. Utilizza Gravatar.com per impostarne uno." - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "Non hai i permessi necessari. Per cambiare il tuo avatar locale contatta l'amministratore del blog." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Simple Local Avatars" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Aggiunge un campo per permettere l'upload di un avatar personalizzato agli utenti che dispongono di adeguati permessi. Ridimensiona l'immagine come Gravatar! Semplice e leggero" - diff --git a/localization/simple-local-avatars-nb_NO.mo b/localization/simple-local-avatars-nb_NO.mo deleted file mode 100644 index 10987c06..00000000 Binary files a/localization/simple-local-avatars-nb_NO.mo and /dev/null differ diff --git a/localization/simple-local-avatars-nb_NO.po b/localization/simple-local-avatars-nb_NO.po deleted file mode 100644 index 09146239..00000000 --- a/localization/simple-local-avatars-nb_NO.po +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-01-18 23:22+0100\n" -"Last-Translator: Øyvind Enger <enger@morsom.no>\n" -"Language-Team: \n" -"X-Poedit-Language: German\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Innstilling for lokale profilbilder" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Kun brukere med rettigheter til å laste opp filer, kan legge inn nye lokale profilbilder. (Forfattere og høyere)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Profilbilde" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Last opp profilbilde" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "Et lokalt profilbilde er ikke definert. Bruk skjemafeltet over for å laste opp et nytt lokalt profilbilde." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Slett lokalt profilbilde" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Erstatt det lokale profilbildet ved å laste opp et nytt profilbilde, eller slett det lokale profilbildet (vil gå tilbake til å vise gravatar) ved å krysse av valget om sletting." - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "Et lokalt profilbilde er ikke definert. Definer ditt profilbilde på Gravatar.com." - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "Du har ikke rettigheter til å redigere media. For å endre ditt lokale profilbilde, ta kontakt med administratoren for nettsiden." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Simple Local Avatars" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Legger til et felt for opplasting av lokale profilbilder dersom brukeren har rettigheter til å redigere media. Genererer riktig størrelse ved behov akkurat som Gravatar! Enkelt og greit." - diff --git a/localization/simple-local-avatars-pt_BR.mo b/localization/simple-local-avatars-pt_BR.mo deleted file mode 100644 index ccf288a7..00000000 Binary files a/localization/simple-local-avatars-pt_BR.mo and /dev/null differ diff --git a/localization/simple-local-avatars-pt_BR.po b/localization/simple-local-avatars-pt_BR.po deleted file mode 100644 index 3043f100..00000000 --- a/localization/simple-local-avatars-pt_BR.po +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-12-28 13:18-0300\n" -"Last-Translator: Billy Blay <billy.blay@gmail.com>\n" -"Language-Team: Billy Blay <billy.blay@gmail.com>\n" -"X-Poedit-Language: Portuguese\n" -"X-Poedit-Country: BRAZIL\n" -"X-Poedit-SourceCharset: utf-8\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Permissões do Local Avatar" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Só aceitar usuarios com permisões para enviar avatares locais (Autores e superiores)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Avatar" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Enviar avatar" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "Não há nenhum avatar configurado. Use o formulário de envio para adicionar um novo avatar." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Deletar avatar" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Substituir o avatar enviando um novo, ou apague o avatar atual selecionando a opção de deletar (em seu lugar se utilizará o Gravatar.com)." - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "Não há nenhum avatar configurado. Configure seu avatar em Gravatar.com." - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "Você não tem permissão para mudar seu avatar contate o administrador do blog." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Simple Local Avatars" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Adicione um avatar no campo de upload de perfis de usuário se o usuário atual tem permissões de mídia. Gere tamanhos solicitada como no Gravatar! Simples e leve." - diff --git a/localization/simple-local-avatars-ru_RU.mo b/localization/simple-local-avatars-ru_RU.mo deleted file mode 100644 index 122c72d9..00000000 Binary files a/localization/simple-local-avatars-ru_RU.mo and /dev/null differ diff --git a/localization/simple-local-avatars-ru_RU.po b/localization/simple-local-avatars-ru_RU.po deleted file mode 100644 index 28146a06..00000000 --- a/localization/simple-local-avatars-ru_RU.po +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) 2010 Simple Local Avatars -# This file is distributed under the same license as the Simple Local Avatars package. -msgid "" -msgstr "" -"Project-Id-Version: Simple Local Avatars 1.1\n" -"Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-local-avatars\n" -"POT-Creation-Date: 2011-01-18 16:36:12+00:00\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2011-04-03 00:40+0200\n" -"Last-Translator: seo-semjanin <slan82@bk.ru>\n" -"Language-Team: seo-semjanin <slan82@bk.ru>\n" -"X-Poedit-Language: Russian\n" -"X-Poedit-Country: RUSSIAN FEDERATION\n" - -#: simple-local-avatars.php:104 -msgid "Local Avatar Permissions" -msgstr "Локальные настройки аватара" - -#: simple-local-avatars.php:120 -msgid "Only allow users with file upload capabilities to upload local avatars (Authors and above)" -msgstr "Только пользователи определенной категории могут загружать аватары (Авторы и выше)" - -#: simple-local-avatars.php:128 -msgid "Avatar" -msgstr "Аватар" - -#: simple-local-avatars.php:132 -msgid "Upload Avatar" -msgstr "Загрузить аватар" - -#: simple-local-avatars.php:148 -msgid "No local avatar is set. Use the upload field to add a local avatar." -msgstr "Нет установленого локального аватара. Используйте загрузку, чтобы добавить аватар." - -#: simple-local-avatars.php:151 -msgid "Delete local avatar" -msgstr "Удалить локальный аватар" - -#: simple-local-avatars.php:152 -msgid "Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option." -msgstr "Заменить локальный аватар загрузив новое изображение или стереть локальный аватар обозначив опцию удаления. (по умолчанию вернется gravatar)" - -#: simple-local-avatars.php:158 -msgid "No local avatar is set. Set up your avatar at Gravatar.com." -msgstr "Локальный аватар не установлен. Установить ваш аватар на Gravatar.com" - -#: simple-local-avatars.php:161 -msgid "You do not have media management permissions. To change your local avatar, contact the blog administrator." -msgstr "Ваших полномочий не достаточно для смены аватара. Чтобы сменить локальный аватар, свяжитесь с администратором сайта." - -#. Plugin Name of the plugin/theme -msgid "Simple Local Avatars" -msgstr "Локальный аватар" - -#. Description of the plugin/theme -msgid "Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight." -msgstr "Добавить закачку аватара к профилю пользователя, если у текущего пользователя есть полномочия. Генерировать такие же размеры, как на Gravatar-е. Просто и легко." - diff --git a/readme.txt b/readme.txt index 6ead59e3..7b8653c3 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,11 @@ === Simple Local Avatars === Contributors: jakemgold, 10up, thinkoomph -Donate link: http://10up.com/plugins/simple-local-avatars-wordpress/ +Donate link: https://10up.com/plugins/simple-local-avatars-wordpress/ Tags: avatar, gravatar, user photos, users, profile -Requires at least: 3.5 -Tested up to: 3.6 -Stable tag: 2.0 +Requires at least: 4.6 +Tested up to: 4.9.8 +Stable tag: 2.1 +Text Domain: simple-local-avatars Adds an avatar upload field to user profiles. Generates requested sizes on demand just like Gravatar! @@ -42,8 +43,15 @@ You can also use `get_simple_local_avatar()` (with the same arguments) to retrei == Changelog == += 2.1 = +* *New:* All avatar uploads now go into the media library. Don't worry - users without the ability to upload files cannot otherwise see the contents of your media library. This allows local avatars to respect other functionality your site may have around uploaded images, such as external hosting. +* *New:* REST API support for getting and updating. +* *New:* Use .org language packs rather than bundling translations. +* *Fixed:* Avoid an `ArgumentCountError`. +* *Fixed:* A couple of internationalization issues. + = 2.0 = -* Choose or upload an avatar from the media library (for user's with appropriate capabilities)! +* Choose or upload an avatar from the media library (for users with appropriate capabilities)! * Local avatars are rated for appropriateness, just like Gravatar * A new setting under Discussion enables administrators to turn off Gravatar (only use local avatars) * Delete the local avatar with a single button click (like everywhere else in WordPress) @@ -101,6 +109,9 @@ You can also use `get_simple_local_avatar()` (with the same arguments) to retrei == Upgrade Notice == += 2.1 = +*Important note:* All avatar uploads now go into the media library. Don't worry - users without the ability to upload files cannot otherwise see the contents of your media library. This allows local avatars to respect other functionality your site may have around uploaded images, such as external hosting. + = 2.0 = Upgraded to take advantage of *WordPress 3.5 and newer*. Does not support older versions! This has also *not* been tested with front end profile plug-ins - feedback welcome. Note that several language strings have been added or modified - revised translations would be welcome! diff --git a/screenshot-1.png b/screenshot-1.png index a5ab97f9..ebd81d0b 100644 Binary files a/screenshot-1.png and b/screenshot-1.png differ diff --git a/simple-local-avatars.php b/simple-local-avatars.php index 44de848e..bf0cd5d7 100644 --- a/simple-local-avatars.php +++ b/simple-local-avatars.php @@ -1,13 +1,14 @@ <?php /** - Plugin Name: Simple Local Avatars - Plugin URI: http://10up.com/plugins/simple-local-avatars-wordpress/ - Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight. - Version: 2.0 - Author: Jake Goldman, 10up - Author URI: http://10up.com - License: GPLv2 or later -*/ + * Plugin Name: Simple Local Avatars + * Plugin URI: https://10up.com/plugins/simple-local-avatars-wordpress/ + * Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight. + * Version: 2.1 + * Author: Jake Goldman, 10up + * Author URI: https://10up.com + * License: GPLv2 or later + * Text Domain: simple-local-avatars + */ /** * add field to user profiles @@ -21,8 +22,6 @@ class Simple_Local_Avatars { * Set up the hooks and default values */ public function __construct() { - load_plugin_textdomain( 'simple-local-avatars', false, dirname( plugin_basename( __FILE__ ) ) . '/localization/' ); - $this->options = (array) get_option( 'simple_local_avatars' ); $this->avatar_ratings = array( 'G' => __('G — Suitable for all audiences'), @@ -49,6 +48,8 @@ public function __construct() { add_action( 'user_edit_form_tag', array( $this, 'user_edit_form_tag' ) ); add_filter( 'avatar_defaults', array( $this, 'avatar_defaults' ) ); + + add_action( 'rest_api_init', array( $this, 'register_rest_fields' ) ); } /** @@ -61,7 +62,7 @@ public function __construct() { * @param string $alt Alternative text to use in image tag. Defaults to blank * @return string <img> tag for the user's avatar */ - public function get_avatar( $avatar = '', $id_or_email, $size = 96, $default = '', $alt = '' ) { + public function get_avatar( $avatar = '', $id_or_email = '', $size = 96, $default = '', $alt = '' ) { if ( is_numeric( $id_or_email ) ) $user_id = (int) $id_or_email; elseif ( is_string( $id_or_email ) && ( $user = get_user_by( 'email', $id_or_email ) ) ) @@ -154,8 +155,28 @@ public function admin_init() { } register_setting( 'discussion', 'simple_local_avatars', array( $this, 'sanitize_options' ) ); - add_settings_field( 'simple-local-avatars-only', __('Local Avatars Only','simple-local-avatars'), array( $this, 'avatar_settings_field' ), 'discussion', 'avatars', array( 'key' => 'only', 'desc' => 'Only allow local avatars (still uses Gravatar for default avatars)' ) ); - add_settings_field( 'simple-local-avatars-caps', __('Local Upload Permissions','simple-local-avatars'), array( $this, 'avatar_settings_field' ), 'discussion', 'avatars', array( 'key' => 'caps', 'desc' => 'Only allow users with file upload capabilities to upload local avatars (Authors and above)' ) ); + add_settings_field( + 'simple-local-avatars-only', + __('Local Avatars Only','simple-local-avatars'), + array( $this, 'avatar_settings_field' ), + 'discussion', + 'avatars', + array( + 'key' => 'only', + 'desc' => __( 'Only allow local avatars (still uses Gravatar for default avatars)', 'simple-local-avatars' ) + ) + ); + add_settings_field( + 'simple-local-avatars-caps', + __('Local Upload Permissions','simple-local-avatars'), + array( $this, 'avatar_settings_field' ), + 'discussion', + 'avatars', + array( + 'key' => 'caps', + 'desc' => __( 'Only allow users with file upload capabilities to upload local avatars (Authors and above)', 'simple-local-avatars' ) + ) + ); } /** @@ -214,7 +235,7 @@ public function avatar_settings_field( $args ) { echo ' <label for="simple-local-avatars-' . $args['key'] . '"> <input type="checkbox" name="simple_local_avatars[' . $args['key'] . ']" id="simple-local-avatars-' . $args['key'] . '" value="1" ' . checked( $this->options[$args['key']], 1, false ) . ' /> - ' . __($args['desc'],'simple-local-avatars') . ' + ' . $args['desc'] . ' </label> '; } @@ -252,6 +273,16 @@ public function edit_user_profile( $profileuser ) { '_wpnonce' => $this->remove_nonce, ) ); ?> + <?php + // if user is author and above hide the choose file option + // force them to use the WP Media Selector + if ( ! current_user_can( 'upload_files' ) ) { ?> + <p style="display: inline-block; width: 26em;"> + <span class="description"><?php _e( 'Choose an image from your computer:' ); ?></span><br /> + <input type="file" name="simple-local-avatar" id="simple-local-avatar" class="standard-text" /> + <span class="spinner" id="simple-local-avatar-spinner"></span> + </p> + <?php } ?> <p> <?php if ( current_user_can( 'upload_files' ) && did_action( 'wp_enqueue_media' ) ) : ?><a href="#" class="button hide-if-no-js" id="simple-local-avatar-media"><?php _e( 'Choose from Media Library', 'simple-local-avatars' ); ?></a> <?php endif; ?> <a href="<?php echo $remove_url; ?>" class="button item-delete submitdelete deletion" id="simple-local-avatar-remove"<?php if ( empty( $profileuser->simple_local_avatar ) ) echo ' style="display:none;"'; ?>><?php _e('Delete local avatar','simple-local-avatars'); ?></a> @@ -279,7 +310,7 @@ public function edit_user_profile( $profileuser ) { echo "\n\t<label><input type='radio' name='simple_local_avatar_rating' value='" . esc_attr( $key ) . "' " . checked( $profileuser->simple_local_avatar_rating, $key, false ) . "/> $rating</label><br />"; endforeach; ?> - <p class="description"><?php _e( 'If the local avatar is inappropriate for this site, Gravatar will be attempted.' ); ?></p> + <p class="description"><?php _e( 'If the local avatar is inappropriate for this site, Gravatar will be attempted.', 'simple-local-avatars' ); ?></p> </fieldset></td> </tr> </table> @@ -326,8 +357,48 @@ public function edit_user_profile_update( $user_id ) { if( empty( $_POST['_simple_local_avatar_nonce'] ) || ! wp_verify_nonce( $_POST['_simple_local_avatar_nonce'], 'simple_local_avatar_nonce' ) ) return; + // check for uploaded files + if ( ! empty( $_FILES['simple-local-avatar']['name'] ) ) : + + // need to be more secure since low privelege users can upload + if ( false !== strpos( $_FILES['simple-local-avatar']['name'], '.php' ) ) { + $this->avatar_upload_error = __('For security reasons, the extension ".php" cannot be in your file name.','simple-local-avatars'); + add_action( 'user_profile_update_errors', array( $this, 'user_profile_update_errors' ) ); + return; + } + + // front end (theme my profile etc) support + if ( ! function_exists( 'media_handle_upload' ) ) + require_once( ABSPATH . 'wp-admin/includes/media.php' ); + + // allow developers to override file size upload limit for avatars + add_filter( 'upload_size_limit', array( $this, 'upload_size_limit' ) ); + + $this->user_id_being_edited = $user_id; // make user_id known to unique_filename_callback function + $avatar_id = media_handle_upload( 'simple-local-avatar', 0, array(), array( + 'mimes' => array( + 'jpg|jpeg|jpe' => 'image/jpeg', + 'gif' => 'image/gif', + 'png' => 'image/png', + ), + 'test_form' => false, + 'unique_filename_callback' => array( $this, 'unique_filename_callback' ) + ) ); + + remove_filter( 'upload_size_limit', array( $this, 'upload_size_limit' ) ); + + if ( is_wp_error( $avatar_id ) ) { // handle failures. + $this->avatar_upload_error = '<strong>' . __( 'There was an error uploading the avatar:', 'simple-local-avatars' ) . '</strong> ' . esc_html( $avatar_id->get_error_message() ); + add_action( 'user_profile_update_errors', array( $this, 'user_profile_update_errors' ) ); + return; + } + + $this->assign_new_user_avatar( $avatar_id, $user_id ); + + endif; + // handle rating - if ( isset( $avatar['url'] ) || $avatar = get_user_meta( $user_id, 'simple_local_avatar', true ) ) { + if ( isset( $avatar_id ) || $avatar = get_user_meta( $user_id, 'simple_local_avatar', true ) ) { if ( empty( $_POST['simple_local_avatar_rating'] ) || ! array_key_exists( $_POST['simple_local_avatar_rating'], $this->avatar_ratings ) ) $_POST['simple_local_avatar_rating'] = key( $this->avatar_ratings ); @@ -453,6 +524,48 @@ public function unique_filename_callback( $dir, $name, $ext ) { public function user_profile_update_errors( WP_Error $errors ) { $errors->add( 'avatar_error', $this->avatar_upload_error ); } + + /** + * Registers the simple_local_avatar field in the REST API. + */ + public function register_rest_fields() { + register_rest_field( 'user', 'simple_local_avatar', array( + 'get_callback' => array( $this, 'get_avatar_rest' ), + 'update_callback' => array( $this, 'set_avatar_rest' ), + 'schema' => array( + 'description' => 'The users simple local avatar', + 'type' => 'object', + ) + )); + } + + /** + * Returns the simple_local_avatar meta key for the given user. + * + * @param object $user User object + */ + public function get_avatar_rest( $user ) { + $local_avatar = get_user_meta( $user['id'], 'simple_local_avatar', true ); + if ( empty( $local_avatar ) ) { + return; + } + return $local_avatar; + } + + /** + * Updates the simple local avatar from a REST request. + * + * Since we are just adding a field to the existing user endpoint + * we don't need to worry about ensuring the calling user has proper permissions. + * Only the user or an administrator would be able to change the avatar. + * + * @param array $input Input submitted via REST request. + * @param object $user The user making the request. + */ + public function set_avatar_rest( $input, $user ) { + $this->assign_new_user_avatar($input['media_id'], $user->ID); + } + } $simple_local_avatars = new Simple_Local_Avatars; @@ -473,7 +586,7 @@ function get_simple_local_avatar( $id_or_email, $size = 96, $default = '', $alt if ( empty ( $avatar ) ) { remove_action( 'get_avatar', array( $simple_local_avatars, 'get_avatar' ) ); $avatar = get_avatar( $id_or_email, $size, $default, $alt ); - add_action( 'get_avatar', array( $simple_local_avatars, 'get_avatar' ) ); + add_action( 'get_avatar', array( $simple_local_avatars, 'get_avatar' ), 10, 5 ); } return $avatar; @@ -549,4 +662,4 @@ function simple_local_avatars_uninstall() { endforeach; delete_option('simple_local_avatars'); -} \ No newline at end of file +}