=== Real Simple Avatar ===
Contributors: avsalexandra
Tags: avatar, local avatar, user avatar, profile picture, gravatar
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Local user avatars for WordPress: upload a profile photo, pick a preset, or auto-generate colourful initials. No Gravatar, no Media Library clutter.

== Description ==

Real Simple Avatar gives your users a real profile picture on your WordPress site — without Gravatar and without cluttering your Media Library.

Users can upload their own photo or choose a preset avatar right from the front end. If no avatar is set, the plugin generates a clean, colourful SVG avatar from the user's initials, so every user has a proper avatar from day one — no grey silhouettes.

It is built to stay tidy: when a user changes or removes their avatar, the previous file is deleted from the Media Library automatically. One user, one file, at one size — WordPress does not generate extra thumbnails for it.

**Why people choose Real Simple Avatar**

* **A local alternative to Gravatar** — avatars live on your own site. No account required, no external request per avatar, no email hash sent to a third party.
* **No Media Library clutter** — the old avatar attachment is removed automatically on replacement, on deletion, and when a user account is deleted. Saves disk space.
* **Automatic SVG initials** — lightweight vector avatars with a background colour that stays the same for each user. As of 1.0.2 they are inlined into the page, with no extra request.
* **Front-end form** — the `[rsava_avatar_form]` shortcode lets logged-in users change their avatar instantly (AJAX, no page reload, no admin access).
* **Preset avatars** — show a grid of ready-made pictures. Replace the built-in set with your own, or disable photo uploads entirely and let users pick a preset only.
* **Strict size control** — set the crop size (e.g. 240 × 240 px). Uploaded images are stored only at that size.
* **Configurable** — allowed formats (PNG, JPG, JPEG, WebP, HEIC, HEIF, AVIF, GIF), maximum file size, initials palette and text colour.
* **Admin control** — upload or remove any user's avatar from the Edit User screen.
* **Clean uninstall** — optionally remove all settings and uploaded avatars when the plugin is deleted.

A good fit for membership sites, forums, communities, multi-author blogs, and shops with customer accounts.

== Installation ==

1. Install the plugin from **Plugins → Add New** (search for "Real Simple Avatar"), or upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → Avatar** to configure the plugin.
4. Add the shortcode `[rsava_avatar_form]` to any page or post where you want users to manage their avatar.

== Frequently Asked Questions ==

= Does Real Simple Avatar work without Gravatar? =
Yes. Avatars are stored locally on your own site, and initials are shown when no avatar is set. Gravatar is not used and no external request is made to load an avatar. Since 1.0.4, the "Default Avatar" choice under Settings → Discussion also has a local, non-Gravatar option, and the "change your picture on Gravatar" link is gone from the user profile screen.

= Does it delete old avatar files? =
Yes. When a user replaces or removes their avatar, the previous file is deleted from the Media Library automatically. The same happens when a user account is deleted.

= Can I replace the built-in preset avatars with my own? =
Yes. In **Settings → Avatar → Preset Avatars**, upload your own images. You can also disable the built-in presets entirely and show only your custom ones.

= Can I stop users from uploading a custom photo and only let them choose from presets? =
Yes. In **Settings → Avatar → Media**, uncheck "Allow file upload". The upload button is hidden and users can only pick from preset images.

= What image formats are supported? =
By default: PNG, JPG, JPEG, WebP, HEIC. You can add or remove formats (including AVIF and GIF) in **Settings → Avatar → Media**.

= Where is the avatar stored? =
Uploaded photos are stored in the WordPress Media Library as a regular attachment. Each user has at most one avatar attachment; the old one is deleted automatically when a new photo is uploaded or the avatar is removed.

= What happens to avatar files when a user is deleted? =
The avatar attachment is automatically removed from the Media Library when a user account is deleted.

= How do I completely remove all plugin data? =
In **Settings → Avatar → Advanced**, check "Delete data on uninstall", save, then delete the plugin from the Plugins screen. All plugin options and uploaded avatar media are removed in batches.

== Screenshots ==

1. Front-end avatar form added with the `[rsava_avatar_form]` shortcode.
2. Changing a user's avatar from the WordPress admin.
3. Plugin settings page.
4. Initials avatar colour settings.

== Changelog ==

= 1.0.4 =
* Initials avatars now take initials from the Display Name first, falling back to First/Last Name only if the display name is empty.
* Preset avatars (built-in and admin-added) are now available directly on the user profile screen in wp-admin, not only through the `[rsava_avatar_form]` shortcode.
* Added a local, non-Gravatar option to Settings → Discussion → Default Avatar, so the site-wide fallback avatar for unmatched/guest emails no longer requires Gravatar.
* Removed the "You can change your profile picture on Gravatar" link from the profile picture field, replacing it with the plugin's own local upload UI.

= 1.0.3 =
* Rewrote the description and refined the tags for clarity and discoverability. No functional changes.

= 1.0.2 =
* Tested with WordPress 7.1.
* Initials avatars are now rendered inline (data URI) in the standard avatar output, removing one admin-ajax request per avatar. The admin-ajax endpoint is kept for the REST API and other callers that need a real URL.

= 1.0.1 =
* Bug fixes and minor improvements. Plugin version updated to 1.0.1.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.4 =
Initials now follow Display Name, presets are pickable in wp-admin, a local Default Avatar option replaces Gravatar's, and the Gravatar link on the profile page is gone.

= 1.0.3 =
Updated plugin description and tags. No code changes.

= 1.0.2 =
Tested with WordPress 7.1. Initials avatars now render inline for fewer requests.

= 1.0.1 =
Bug fixes and minor improvement.

= 1.0.0 =
First public release.

== Compatibility ==

Tested with PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4. Tested with WordPress 5.0 – 7.1

== License ==

This plugin is licensed under the GPLv2 or later.
