wp-user-avatars.php000064400000003517147206645470010343 0ustar00 array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', ), 'test_form' => false, 'unique_filename_callback' => 'wp_user_avatars_unique_filename_callback' ) ); // No more global unset( $GLOBALS['wp_user_avatars_user_id'] ); remove_filter( 'upload_size_limit', 'wp_user_avatars_upload_size_limit' ); // Failures if ( empty( $avatar['file'] ) ) { // Error feedback switch ( $avatar['error'] ) { case 'File type does not meet security guidelines. Try another.' : add_action( 'user_profile_update_errors', 'wp_user_avatars_file_extension_error' ); return; default : add_action( 'user_profile_update_errors', 'wp_user_avatars_generic_error' ); return; } } // Update wp_user_avatars_update_avatar( $user_id, $avatar['url'] ); } // Rating if ( isset( $avatar['url'] ) || $avatar = get_user_meta( $user_id, 'wp_user_avatars', true ) ) { if ( empty( $_POST['wp_user_avatars_rating'] ) || ! array_key_exists( $_POST['wp_user_avatars_rating'], wp_user_avatars_get_ratings() ) ) { $_POST['wp_user_avatars_rating'] = key( wp_user_avatars_get_ratings() ); } update_user_meta( $user_id, 'wp_user_avatars_rating', $_POST['wp_user_avatars_rating'] ); } } /** * Return a unique filename for uploaded avatars * * @since 0.1.0 * * @param string $dir Path for file * @param string $name Filename * @param string $ext File extension (e.g. ".jpg") * * @return string Final filename */ function wp_user_avatars_unique_filename_callback( $dir, $name, $ext ) { // Get user $user = get_user_by( 'id', $GLOBALS['wp_user_avatars_user_id'] ); // File suffix $suffix = time(); // Override names $_name = $base_name = sanitize_file_name( 'avatar_user_' . $user->ID . '_' . $suffix ); // Ensure no conflicts with existing file names $number = 1; while ( file_exists( $dir . "/{$_name}{$ext}" ) ) { $_name = $base_name . '_' . $number; $number++; } // Return the unique filename return $_name . $ext; } /** * Override maximum allowable avatar upload file-size * * @since 0.1.0 * * @param int $bytes WordPress default byte size check * * @return int Maximum byte size */ function wp_user_avatars_upload_size_limit( $bytes = 2000 ) { return apply_filters( 'wp_user_avatars_upload_size_limit', $bytes ); } /** * Return an array of avatar ratings * * @since 0.1.0 * * @return array */ function wp_user_avatars_get_ratings() { return apply_filters( 'wp_user_avatars_get_ratings', array( 'G' => esc_html__( 'Suitable for all audiences', 'wp-user-avatars' ), 'PG' => esc_html__( 'Possibly offensive, usually for audiences 13 and above', 'wp-user-avatars' ), 'R' => esc_html__( 'Intended for adult audiences above 17', 'wp-user-avatars' ), 'X' => esc_html__( 'Even more mature than above', 'wp-user-avatars' ) ) ); } /** * Deprecated. Now you can use `get_avatar()` directly. * * @since 0.1.0 * @deprecated 1.0.0 * * @param mixed $id_or_email * @param int $size * @param string $default * @param string $alt * * @return string */ function get_user_avatar( $id_or_email, $size = 250, $default = '', $alt = '' ) { return get_avatar( $id_or_email, $size, $default, $alt ); } /** * Calculate a user ID based on whatever object was passed in * * @since 1.0.0 * * @param mixed $id_or_email * * @return int */ function wp_user_avatars_get_user_id( $id_or_email ) { // Default $retval = 0; // Numeric, so use ID if ( is_numeric( $id_or_email ) ) { $retval = $id_or_email; // Maybe email or login } elseif ( is_string( $id_or_email ) ) { // User by $user_by = is_email( $id_or_email ) ? 'email' : 'login'; // Get user $user = get_user_by( $user_by, $id_or_email ); // User ID if ( ! empty( $user ) ) { $retval = $user->ID; } // User Object } elseif ( $id_or_email instanceof WP_User ) { $retval = $id_or_email->ID; // Post Object } elseif ( $id_or_email instanceof WP_Post ) { $retval = $id_or_email->post_author; // Comment } elseif ( $id_or_email instanceof WP_Comment ) { if ( ! empty( $id_or_email->user_id ) ) { $retval = $id_or_email->user_id; } } return (int) apply_filters( 'wp_user_avatars_get_user_id', (int) $retval, $id_or_email ); } /** * Look for and return the URL to a local avatar if found * * @since 1.0.0 * * @param int $user_id * @param int $size * @param string $fallback * * @return mixed */ function wp_user_avatars_get_local_avatar_url( $user_id = false, $size = 250 ) { // Try to get user ID $user_id = wp_user_avatars_get_user_id( $user_id ); // Bail if no user ID if ( empty( $user_id ) ) { return null; } // Fetch avatars from usermeta, bail if no full option $user_avatars = get_user_meta( $user_id, 'wp_user_avatars', true ); if ( empty( $user_avatars['full'] ) ) { return null; } // Get ratings $avatar_rating = get_user_meta( $user_id, 'wp_user_avatars_rating', true ); $site_rating = get_option( 'avatar_rating', 'G' ); $switched = false; // Compare ratings if ( ! empty( $avatar_rating ) && ( 'G' !== $avatar_rating ) && ( $avatar_rating !== $site_rating ) ) { // Calculate rating weights $ratings = wp_user_avatars_get_ratings(); $ratings_key = array_keys( $ratings ); $site_rating_weight = array_search( $site_rating, $ratings_key ); $avatar_rating_weight = array_search( $avatar_rating, $ratings_key ); // Too risky if ( ( false !== $avatar_rating_weight ) && ( $avatar_rating_weight > $site_rating_weight ) ) { return null; } } $dynamic_resize = apply_filters( 'wp_user_avatars_dynamic_resize', true, $user_id, $size, $user_avatars ); // Return early if there's no media to check and we either have an avatar of the correct size or don't dynamically resize if ( empty( $user_avatars['media_id'] ) && ( ! empty( $user_avatars[ $size ] ) || $dynamic_resize === false ) ) { if ( empty( $user_avatars[ $size ] ) ) { return $user_avatars['full']; } return $user_avatars[ $size ]; } // Maybe switch to blog if ( isset( $user_avatars['site_id'] ) && is_multisite() ) { $switched = true; switch_to_blog( $user_avatars['site_id'] ); } // Handle "real" media if ( ! empty( $user_avatars['media_id'] ) ) { // Has the media been deleted? $avatar_full_path = get_attached_file( $user_avatars['media_id'] ); // Maybe return null & maybe delete the avatar setting if ( empty( $avatar_full_path ) ) { // Only let logged in users delete missing avatars if ( is_user_logged_in() ) { wp_user_avatars_delete_avatar( $user_id ); } // Maybe switch back if ( true === $switched ) { restore_current_blog(); } return null; } } // Generate a new size if ( empty( $user_avatars[ $size ] ) ) { // Set full size $user_avatars[ $size ] = $user_avatars['full']; // Allow rescaling to be toggled, usually for performance reasons if ( $dynamic_resize ) { // Get the upload path (hard to trust this sometimes, though...) $upload_path = wp_upload_dir(); // Get path for image by converting URL if ( ! isset( $avatar_full_path ) ) { $avatar_full_path = str_replace( $upload_path['baseurl'], $upload_path['basedir'], $user_avatars['full'] ); } // Load image editor (for resizing) $editor = wp_get_image_editor( $avatar_full_path ); if ( ! is_wp_error( $editor ) ) { // Attempt to resize $resized = $editor->resize( $size, $size, true ); if ( ! is_wp_error( $resized ) ) { $dest_file = $editor->generate_filename(); $saved = $editor->save( $dest_file ); if ( ! is_wp_error( $saved ) ) { $user_avatars[ $size ] = str_replace( $upload_path['basedir'], $upload_path['baseurl'], $dest_file ); } } } // Save updated avatar sizes update_user_meta( $user_id, 'wp_user_avatars', $user_avatars ); } } // URL corrections if ( 'http' !== substr( $user_avatars[ $size ], 0, 4 ) ) { $user_avatars[ $size ] = home_url( $user_avatars[ $size ] ); } // Maybe switch back if ( true === $switched ) { restore_current_blog(); } // Return the url return $user_avatars[ $size ]; } /** * Filter 'get_avatar_url' and maybe return a local avatar * * @since 1.0.0 * * @param string $url * @param mixed $id_or_email * @param array $args * * @return string */ function wp_user_avatars_filter_get_avatar_url( $url, $id_or_email, $args ) { // Bail if forcing default if ( ! empty( $args['force_default'] ) ) { return $url; } // Bail if explicitly an md5'd Gravatar url // https://github.com/stuttter/wp-user-avatars/issues/11 if ( is_string( $id_or_email ) && strpos( $id_or_email, '@md5.gravatar.com' ) ) { return $url; } // Look for local avatar $avatar = wp_user_avatars_get_local_avatar_url( $id_or_email, $args['size'] ); // Override URL if avatar is found if ( ! empty( $avatar ) ) { $url = $avatar; } // Return maybe-local URL return $url; } /** * Delete an avatar * * @since 0.1.0 * * @param int $user_id * * @return type */ function wp_user_avatars_delete_avatar( $user_id = 0 ) { // Bail if no avatars to delete $old_avatars = (array) get_user_meta( $user_id, 'wp_user_avatars', true ); if ( empty( $old_avatars ) ) { return; } // Don't erase media library files if ( array_key_exists( 'media_id', $old_avatars ) ) { unset( $old_avatars['media_id'], $old_avatars['full'] ); } // Are there files to delete? if ( ! empty( $old_avatars ) ) { $upload_path = wp_upload_dir(); // Loop through avatars foreach ( $old_avatars as $old_avatar ) { // Use the upload directory $old_avatar_path = str_replace( $upload_path['baseurl'], $upload_path['basedir'], $old_avatar ); // Maybe delete the file if ( file_exists( $old_avatar_path ) ) { unlink( $old_avatar_path ); } } } // Remove metadata delete_user_meta( $user_id, 'wp_user_avatars' ); delete_user_meta( $user_id, 'wp_user_avatars_rating' ); } /** * Saves avatar image to a user * * @since 0.1.0 * * @param int $user_id ID of user to assign image to * @param int|string $media Local URL for avatar or ID of attachment */ function wp_user_avatars_update_avatar( $user_id, $media ) { // Delete old avatar wp_user_avatars_delete_avatar( $user_id ); // Setup empty meta array $meta_value = array(); // Set the attachment URL if ( is_int( $media ) ) { $meta_value['media_id'] = $media; $meta_value['site_id'] = get_current_blog_id(); $media = wp_get_attachment_url( $media ); } // Set full value to media URL $meta_value['full'] = esc_url_raw( $media ); // Update user metadata update_user_meta( $user_id, 'wp_user_avatars', $meta_value ); } /** * Remove user-avatars filter for the avatar list in options-discussion.php. * * @since 0.1.0 */ function wp_user_avatars_avatar_defaults( $avatar_defaults = array() ) { // Default $new_avatar_defaults = $avatar_defaults; // Maybe block Gravatars if ( get_option( 'wp_user_avatars_block_gravatar' ) ) { $new_avatar_defaults = array( wp_user_avatars_get_mystery_url() => esc_html__( 'Mystery Person', 'wp-user-avatars' ), 'blank' => esc_html__( 'Blank', 'wp-user-avatars' ) ); } // Return avatar types, maybe without Gravatar options return $new_avatar_defaults; } /** * Maybe divert Gravatar requests to use the local mystery person image. * * @since 1.1.0 * * @param string $url * * @return string */ function wp_user_avatars_maybe_use_local_mystery_person( $url = '' ) { // Bail if not blocking gravatar requests if ( ! get_option( 'wp_user_avatars_block_gravatar' ) ) { return $url; } // Local mystery $mystery = wp_user_avatars_get_mystery_url(); // Bail if not already requesting the local mystery person if ( false === strpos( $url, urlencode( $mystery ) ) ) { return $url; } // Return the local mystery person return $mystery; } /** * Maybe change the 'mystery' avatar_default setting to be the local mystery person. * * @since 1.1.0 * * @param string $value * * @return string */ function wp_user_avatars_update_option_avatar_default( $value = null ) { // Bail if not defaulting to mystery if ( wp_user_avatars_get_mystery_url() !== $value ) { return $value; } // Bail if not blocking gravatar requests if ( ! get_option( 'wp_user_avatars_block_gravatar' ) ) { return $value; } // Return the local mystery person return 'mystery'; } /** * Maybe change the 'mystery' avatar_default setting to be the local mystery person. * * @since 1.1.0 * * @param string $value * * @return string */ function wp_user_avatars_option_avatar_default( $value = null ) { // Bail if not defaulting to mystery if ( 'mystery' !== $value ) { return $value; } // Bail if not blocking gravatar requests if ( ! get_option( 'wp_user_avatars_block_gravatar' ) ) { return $value; } // Return the local mystery person return wp_user_avatars_get_mystery_url(); } /** * Return URL to local mystery person image * * @since 1.1.0 * * @return string */ function wp_user_avatars_get_mystery_url() { $mystery = wp_user_avatars_get_plugin_url() . 'assets/images/mystery.jpg'; return apply_filters( 'wp_user_avatars_get_mystery_url', $mystery ); } /** * Output the rating field radio options for a given user object * * @since 0.1.0 * * @param WP_User $user */ function wp_user_avatars_user_rating_form_field( WP_User $user ) { // Start an output buffer ob_start(); // Output ratings foreach ( wp_user_avatars_get_ratings() as $key => $rating ) : ?>
add( 'avatar_error', esc_html__( 'This image file appears to be invalid, or violates an upload rule.', 'wp-user-avatars' ) ); } /** * Adds errors based on avatar upload problems. * * @since 0.1.0 * * @param WP_Error $errors Error messages for user profile screen. */ function wp_user_avatars_generic_error( WP_Error $errors ) { $errors->add( 'avatar_error', esc_html__( 'Avatar upload failed.', 'wp-user-avatars' ) ); } wp-user-avatars/includes/capabilities.php000064400000001702147206645470014574 0ustar00ID ) ) { return; } // First pass wp_user_avatars_section_content( $user ); } wp-user-avatars/includes/sponsor.php000064400000002440147206645470013646 0ustar00 '' . esc_html( $text ) . '' ) ); } wp-user-avatars/includes/admin.php000064400000017427147206645470013246 0ustar00 'avatar-settings' ) : array( 'class' => 'avatar-settings hide-if-js' ); // Capabilities add_settings_field( 'wp_user_avatars_roles', esc_html__( 'Allowed Roles', 'wp-user-avatars' ), 'wp_user_avatars_settings_field_roles', 'discussion', 'avatars', $args ); // Local only (no Gravatars) add_settings_field( 'wp_user_avatars_block_gravatar', esc_html__( 'Block Gravatar', 'wp-user-avatars' ), 'wp_user_avatars_settings_field_gravatar', 'discussion', 'avatars', $args ); } /** * Settings field for preventing requests to Gravatar * * @since 0.1.0 */ function wp_user_avatars_settings_field_gravatar() { // Get roles $val = (bool) get_option( 'wp_user_avatars_block_gravatar', false ); ?>
$role ) : ?>
esc_html__( 'Choose an Avatar', 'wp-user-avatars' ), 'insertIntoPost' => esc_html__( 'Set as avatar', 'wp-user-avatars' ), 'deleteNonce' => wp_create_nonce( 'remove_wp_user_avatars_nonce' ), 'mediaNonce' => wp_create_nonce( 'assign_wp_user_avatars_nonce' ), 'user_id' => $user_id, ) ); } /** * Output avatar field on edit/profile screens * * @since 0.1.0 * * @param object $user User object */ function wp_user_avatars_edit_user_profile( $user = 0 ) { // Bail if current user cannot edit this user's avatar and rating if ( ! current_user_can( 'edit_avatar', $user->ID ) && ! current_user_can( 'edit_avatar_rating', $user->ID ) ) { return; } ?>

ID ) ) { return; } ?> ID ) ) : ?> ID ) ) : ?>
ID, 250 ); ?> ID ) ) : ?>
  ID ) ) : ?> 'remove-wp-user-avatars', 'user_id' => $user->ID, '_wpnonce' => false, ) ); ?> wp_user_avatars ) ) echo ' style="display:none;"'; ?>>
wp_user_avatars ) ) echo ' class="fancy-hidden"'; ?>>
wp_user_avatars ) ); ?>> wp_user_avatars_rating ) || ! array_key_exists( $user->wp_user_avatars_rating, wp_user_avatars_get_ratings() ) ) { $user->wp_user_avatars_rating = 'G'; } // Output the rating form field wp_user_avatars_user_rating_form_field( $user ); ?>
'wp_user_avatars', 'fields' => 'ids' ) ); // Delete all avatars foreach ( $users as $user_id ) { wp_user_avatars_delete_avatar( $user_id ); } // Cleanup options delete_option( 'wp_user_avatars' ); } wp-user-avatars/includes/.htaccess000064400000001626147206645470013235 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] wp-user-avatars/assets/css/user-avatars.css000064400000006005147206645470015046 0ustar00#wp-user-avatars-photo { width: 90px; } #normal-sortables #user_avatar img, #wp-user-avatars-user-settings img { -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); height: 90px; width: 90px; } #wp-user-avatars-actions div, #wp-user-avatars-actions input[type=file] { text-overflow: ellipsis; width: 100%; } #wp-user-avatars-actions input[type=file] { margin: 0 0 10px; } /** * Special styling for wide screens */ @media screen and ( min-width: 1110px ) { #your-profile { position: relative; } #your-profile > table { margin-right: 390px; width: auto; } #wp-user-avatars-user-settings { position: absolute; top: 0px; right: 0; width: 390px; border: 1px solid #e5e5e5; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); background: #fff; } #wp-user-avatars-user-settings label { font-size: 13px; } #wp-user-avatars-user-settings br, #wp-user-avatars-user-settings .wp-user-avatar-rating-description, #wp-user-avatars-user-settings .fancy-hidden { display: none; } #wp-user-avatars-ratings fieldset { padding-left: 110px; } #wp-user-avatars-user-settings .wp-user-avatar-rating { margin-right: 15px; } #wp-user-avatars-user-settings h2 { font-size: 14px; padding: 8px 12px; margin: 0; line-height: 1.4; border-bottom: 1px solid #eee; } #wp-user-avatars-user-settings table { margin: 0; padding: 0; } #wp-user-avatars-user-settings th { display: none; } #wp-user-avatars-user-settings td { padding: 10px; } #wp-user-avatars-user-settings p.submit { margin: 0; padding: 10px; border-top: 1px solid #ddd; background-color: #f5f5f5; text-align: right; } /* BuddyPress Support */ body.buddypress #wp-user-avatars-user-settings { top: 60px; } } /* WP User Profiles Support */ tr.user-profile-picture, #side-sortables #user-avatar br, #side-sortables #user-avatar .wp-user-avatar-rating-description, #side-sortables #user-avatar .fancy-hidden { display: none; } #normal-sortables #wp-user-avatars-ratings fieldset, #side-sortables #wp-user-avatars-ratings fieldset { padding-left: 0; } #side-sortables #user-avatar .wp-user-avatar-rating { margin-right: 20px; } #side-sortables #user-avatar img { -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); height: 125px; width: 125px; } #side-sortables #user-avatar h3 { font-size: 14px; padding: 8px 12px; margin: 0; line-height: 1.4; border-bottom: 1px solid #eee; } #side-sortables #user-avatar table { margin: 0; padding: 0; } #side-sortables #user-avatar th { display: none; } #side-sortables #user-avatar td { padding: 15px 0 0 0; margin-bottom: 0; } #side-sortables #wp-user-avatars-photo, #side-sortables #wp-user-avatars-actions { float: left; width: 100%; } #side-sortables #wp-user-avatars-photo { text-align: center; } #side-sortables #user-avatar p.submit { margin: 0; padding: 10px; border-top: 1px solid #ddd; background-color: #f5f5f5; text-align: right; } wp-user-avatars/assets/css/user-avatars-rtl.css000064400000001557147206645470015654 0ustar00/** * Special styling for wide screens */ @media screen and ( min-width: 1110px ) { #your-profile > table { margin-left: 390px; margin-right: 0; } #wp-user-avatars-user-settings { right: auto; left: 0; } #wp-user-avatars-ratings fieldset { padding-left: 0; padding-right: 110px; } #wp-user-avatars-user-settings .wp-user-avatar-rating { margin-right: 0; margin-left: 15px; } #wp-user-avatars-user-settings p.submit { text-align: left; } } #normal-sortables #wp-user-avatars-ratings fieldset, #side-sortables #wp-user-avatars-ratings fieldset { padding-left: auto; padding-right: 0; } #side-sortables #user-avatar .wp-user-avatar-rating { margin-right: 0; margin-left: 20px; } #side-sortables #wp-user-avatars-photo, #side-sortables #wp-user-avatars-actions { float: right; } #side-sortables #user-avatar p.submit { text-align: left; } wp-user-avatars/assets/css/.htaccess000064400000001626147206645470013521 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] wp-user-avatars/assets/languages/wp-user-avatars.pot000064400000005436147206645470016671 0ustar00# Copyright (C) 2016 WP User Avatars # This file is distributed under the same license as the WP User Avatars package. msgid "" msgstr "" "Project-Id-Version: WP User Avatars 1.0.1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-user-avatars\n" "POT-Creation-Date: 2016-11-18 15:04:47+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "PO-Revision-Date: 2016-11-18 09:00+0\n" "Last-Translator: John James Jacoby\n" "Language-Team: English\n" #: wp-user-avatars/includes/admin.php:26 msgid "Allowed Roles" msgstr "" #: wp-user-avatars/includes/admin.php:29 msgid "Block Gravatar" msgstr "" #: wp-user-avatars/includes/admin.php:44 msgid "Prevent avatar requests from reaching out to Gravatar.com." msgstr "" #: wp-user-avatars/includes/admin.php:62 msgid "Upload Options" msgstr "" #: wp-user-avatars/includes/admin.php:139 msgid "Choose an Avatar" msgstr "" #: wp-user-avatars/includes/admin.php:140 msgid "Set as avatar" msgstr "" #: wp-user-avatars/includes/admin.php:162 msgid "Avatar" msgstr "" #: wp-user-avatars/includes/admin.php:193 msgid "Upload" msgstr "" #: wp-user-avatars/includes/admin.php:216 msgid "Choose from Media" msgstr "" #: wp-user-avatars/includes/admin.php:233 msgid "Remove" msgstr "" #: wp-user-avatars/includes/admin.php:253 #: wp-user-avatars/includes/admin.php:256 msgid "Rating" msgstr "" #: wp-user-avatars/includes/ajax.php:36 msgid "You do not have permission to edit this user." msgstr "" #: wp-user-avatars/includes/errors.php:22 msgid "This image file appears to be invalid, or violates an upload rule." msgstr "" #: wp-user-avatars/includes/errors.php:33 msgid "Avatar upload failed." msgstr "" #: wp-user-avatars/includes/functions.php:148 msgid "Suitable for all audiences" msgstr "" #: wp-user-avatars/includes/functions.php:149 msgid "Possibly offensive, usually for audiences 13 and above" msgstr "" #: wp-user-avatars/includes/functions.php:150 msgid "Intended for adult audiences above 17" msgstr "" #: wp-user-avatars/includes/functions.php:151 msgid "Even more mature than above" msgstr "" #: wp-user-avatars/includes/functions.php:445 msgid "Mystery Person" msgstr "" #: wp-user-avatars/includes/functions.php:446 msgid "Blank" msgstr "" #: wp-user-avatars/includes/metabox.php:25 msgctxt "users user-admin edit screen" msgid "Avatar" msgstr "" #. Plugin Name of the plugin/theme msgid "WP User Avatars" msgstr "" #. Plugin URI of the plugin/theme msgid "https://wordpress.org/plugins/wp-user-avatars/" msgstr "" #. Description of the plugin/theme msgid "Allow registered users to upload & select their own avatars" msgstr "" #. Author of the plugin/theme msgid "John James Jacoby" msgstr "" #. Author URI of the plugin/theme msgid "https://profiles.wordpress.org/johnjamesjacoby/" msgstr "" wp-user-avatars/assets/languages/.htaccess000064400000001626147206645470014677 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] wp-user-avatars/assets/js/user-avatars.js000064400000006227147206645470014524 0ustar00/* global i10n_WPUserAvatars, ajaxurl */ jQuery( document ).ready( function ( $ ) { /** * Check if submit should move */ function checkSubmitMove() { var windowsize = $( window ).width(); if ( windowsize > 1110 ) { $( '#your-profile p.submit' ).last().appendTo( $( '#wp-user-avatars-user-settings' ) ); } else { $( '#wp-user-avatars-user-settings p.submit' ).appendTo( $( '#your-profile' ) ); } } // Bind event listener $( window ).on( 'resize', function() { checkSubmitMove(); } ); // Fire right away checkSubmitMove(); /* Globals */ var wp_user_avatars_modal, avatar_working; /** * Invoke the media modal * * @param {object} event The event */ $( '#wp-user-avatars-media' ).on( 'click', function ( event ) { event.preventDefault(); // Already adding if ( avatar_working ) { return; } // Open the modal if ( wp_user_avatars_modal ) { wp_user_avatars_modal.open(); return; } // First time modal wp_user_avatars_modal = wp.media.frames.wp_user_avatars_modal = wp.media( { title: i10n_WPUserAvatars.insertMediaTitle, button: { text: i10n_WPUserAvatars.insertIntoPost }, library: { type: 'image' }, multiple: false } ); // Picking an avatar wp_user_avatars_modal.on( 'select', function () { // Prevent doubles avatar_lock( 'lock' ); // Get the avatar URL var avatar_url = wp_user_avatars_modal.state().get( 'selection' ).first().toJSON().id; // Post the new avatar $.post( ajaxurl, { action: 'assign_wp_user_avatars_media', media_id: avatar_url, user_id: i10n_WPUserAvatars.user_id, _wpnonce: i10n_WPUserAvatars.mediaNonce }, function ( data ) { // Update the UI if ( '' !== data ) { $( '#wp-user-avatars-photo' ).html( data ); $( '#wp-user-avatars-remove' ).show(); $( '#wp-user-avatars-ratings' ).removeClass( 'fancy-hidden' ); $( '#wp-user-avatars-ratings fieldset' ).prop( 'disabled', false ); } avatar_lock( 'unlock' ); } ); } ); // Open the modal wp_user_avatars_modal.open(); } ); /** * Remove avatar * * @param {object} event The event */ $( '#wp-user-avatars-remove' ).on( 'click', function ( event ) { event.preventDefault(); // Already removing if ( avatar_working ) { return; } // Prevent doubles avatar_lock( 'lock' ); // Remove the URL $.get( ajaxurl, { action: 'remove_wp_user_avatars', user_id: i10n_WPUserAvatars.user_id, _wpnonce: i10n_WPUserAvatars.deleteNonce } ).done( function ( data ) { // Update the UI if ( '' !== data ) { $( '#wp-user-avatars-photo' ).html( data ); $( '#wp-user-avatars-remove' ).hide(); $( '#wp-user-avatars-ratings' ).addClass( 'fancy-hidden' ); $( '#wp-user-avatars-ratings fieldset' ).prop( 'disabled', true ); } avatar_lock( 'unlock' ); } ); } ); /** * Lock the avatar fieldset * * @param {boolean} lock_or_unlock */ function avatar_lock( lock_or_unlock ) { if ( lock_or_unlock === 'unlock' ) { avatar_working = false; $( '#wp-user-avatars-media' ).prop( 'disabled', false ); } else { avatar_working = true; $( '#wp-user-avatars-media' ).prop( 'disabled', true ); } } } ); wp-user-avatars/assets/js/.htaccess000064400000001626147206645470013345 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] wp-user-avatars/assets/images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EPEPEPEPEPEPEPEPIKEQEQEQEy_[`.ꌤ^q^mT1^Q@RZ( ( (REQEQE%jUCO Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] wp-user-avatars/assets/.htaccess000064400000001626147206645470012731 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] wp-user-avatars/.htaccess000064400000001626147206645470011427 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] readme.txt000064400000010466147206645470006570 0ustar00=== WP User Avatars === Author: Triple J Software, Inc. Author URI: https://jjj.software Donate link: https://buy.stripe.com/7sI3cd2tK1Cy2lydQR Plugin URI: https://wordpress.org/plugins/wp-user-avatars License URI: https://www.gnu.org/licenses/gpl-2.0.html License: GPLv2 or later Contributors: johnjamesjacoby Tags: user, profile, avatar, media, local Requires PHP: 7.2 Requires at least: 5.2 Tested up to: 5.8 Stable tag: 1.4.1 == Description == Allow registered users to upload & select their own avatars. = Recommended Plugins = If you like this plugin, you'll probably like these! * [WP User Profiles](https://wordpress.org/plugins/wp-user-profiles/ "A sophisticated way to edit users in WordPress.") * [WP User Activity](https://wordpress.org/plugins/wp-user-activity/ "The best way to log activity in WordPress.") * [WP User Avatars](https://wordpress.org/plugins/wp-user-avatars/ "Allow users to upload avatars or choose them from your media library.") * [WP User Groups](https://wordpress.org/plugins/wp-user-groups/ "Group users together with taxonomies & terms.") * [WP User Signups](https://wordpress.org/plugins/wp-user-signups/ "The best way to manage user & site sign-ups in WordPress.") * [WP Term Authors](https://wordpress.org/plugins/wp-term-authors/ "Authors for categories, tags, and other taxonomy terms.") * [WP Term Colors](https://wordpress.org/plugins/wp-term-colors/ "Pretty colors for categories, tags, and other taxonomy terms.") * [WP Term Families](https://wordpress.org/plugins/wp-term-families/ "Associate taxonomy terms with other taxonomy terms.") * [WP Term Icons](https://wordpress.org/plugins/wp-term-icons/ "Pretty icons for categories, tags, and other taxonomy terms.") * [WP Term Images](https://wordpress.org/plugins/wp-term-images/ "Pretty images for categories, tags, and other taxonomy terms.") * [WP Term Locks](https://wordpress.org/plugins/wp-term-locks/ "Protect categories, tags, and other taxonomy terms from being edited or deleted.") * [WP Term Order](https://wordpress.org/plugins/wp-term-order/ "Sort taxonomy terms, your way.") * [WP Term Visibility](https://wordpress.org/plugins/wp-term-visibility/ "Visibilities for categories, tags, and other taxonomy terms.") * [WP Media Categories](https://wordpress.org/plugins/wp-media-categories/ "Add categories to media & attachments.") * [WP Pretty Filters](https://wordpress.org/plugins/wp-pretty-filters/ "Makes post filters better match what's already in Media & Attachments.") * [WP Chosen](https://wordpress.org/plugins/wp-chosen/ "Make long, unwieldy select boxes much more user-friendly.") == Screenshots == 1. Your Profile (+1100px) 2. Your Profile (-1100px) 3. WP User Profiles (Side) 4. WP User Profiles (Normal) == Installation == * Download and install using the built in WordPress plugin installer. * Activate in the "Plugins" area of your admin by clicking the "Activate" link. * No further setup or configuration is necessary. == Frequently Asked Questions == = How does this work with multisite? = It works OK, but you'll want to consider exactly what level of privacy is best for your installation. = Where can I get support? = * Community: https://wordpress.org/support/plugin/wp-user-avatars * Development: https://github.com/stuttter/wp-user-avatars/discussions == Changelog == = [1.4.1] - 2021-05-29 = * Update author info * Add sponsor link = 1.4.0 = * Improved support for long file names = 1.3.0 = * Fix local avatars in comments = 1.2.0 = * BuddyPress profile styling support = 1.1.1 = * Rename functions.php to common.php = 1.1.0 = * Compatibility with future versions of WP User Profiles = 1.0.2 = * Fix bug with "Default Avatar" display introduced in 1.0.1 = 1.0.1 = * Improved mu-plugins location support * Use WordPress 4.2+ functions & filters = 0.2.0 = * Support for User Profiles 0.2.0 = 0.1.8 = * Hide "Profile Picture" section (WordPress 4.4) = 0.1.7 = * Improve capability mappings * Improve required file loading * Remove unused action hook = 0.1.6 = * Improve support for user dashboard = 0.1.5 = * Support for WP User Profiles 0.1.7 = 0.1.4 = * Bump assets & update readme's & metadata = 0.1.3 = * Improve compatibility with WP User Profiles = 0.1.2 = * Improve avatar styling = 0.1.1 = * Retina support for user profiles = 0.1.0 = * Initial release .htaccess000064400000001626147206645470006366 0ustar00 Order allow,deny Deny from all Order allow,deny Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L]