=== ChargeWP - Front End Avatar Upload ===
Contributors: chargewp
Tags: avatar, profile picture, frontend upload, woocommerce, gravatar
Requires at least: 5.8
Tested up to: 6.9
Stable tag: 2.0.2
Requires PHP: 7.4
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Change your profile picture instantly from the front end.  
Simple, fast, and built to feel like part of WordPress.

== Description ==

**It just works.**

ChargeWP Avatar Upload gives users a clean, intuitive way to update their profile photo without opening the dashboard.  
It’s built for modern WordPress sites: secure, lightweight, and theme-friendly.

### Key Features

- **Instant front-end upload** — update your avatar right on the page or in WooCommerce “My Account.”  
- **SmartCrop.js built in** — automatically centers faces for perfect, professional results.  
- **Gutenberg Block and Shortcode** — add the avatar uploader anywhere you want.  
- **Gravatar friendly** — keeps existing Gravatars in place and simply takes priority when a custom image is uploaded.  
- **Automatic cleanup** — replaces old avatars so your media library stays tidy.  
- **Lightweight and native** — no complex settings, no setup screens, and no bloat.

### Why You’ll Love It

- Works straight out of the box.  
- Looks and feels like part of WordPress and WooCommerce.  
- Secure uploads with smart cropping and optimized JPEG output.  
- Supports all image types WordPress allows (JPG, PNG, WebP, and more).  
- Translation ready and developer friendly.

---

== Installation ==

1. Upload to `/wp-content/plugins/chargewp-avatar` or install from **Plugins → Add New**.  
2. Activate the plugin.  
3. The avatar uploader automatically appears above the WooCommerce “My Account” menu.  
4. Or use the **ChargeWP Avatar Block** or shortcode anywhere you want.

---

== Usage ==

Shortcode example:

`[chargewp_avatar type="0" check_page_author="false"]`

**Attributes:**
- `type` — 0 = avatar only, 1 = avatar + name + ID, 2 = avatar + name + ID + profile link. Default: 0  
- `check_page_author` — true or false. When true, shows the page or post author’s avatar instead of the current user. Default: false  
- `classes` — Optional extra CSS classes for custom styling.

**Block:**
- Insert the **ChargeWP Avatar** block in the editor.  
- Adjust display type and author options from the block sidebar.

---

== Developer Notes ==

- Template overrides are supported. Copy files from  
  `plugins/chargewp-avatar/templates/` to `yourtheme/templates/cwpa/`.  
- Filters to disable automatic placement:  
  - `add_filter('cwpa_auto_inject_wc_account', '__return_false');`  
  - `add_filter('cwpa_auto_inject_cwpd_sidebar', '__return_false');`  
- Filters to change display type:  
  - `cwpa_avatar_type_wc_account`  
  - `cwpa_avatar_type_cwpd_sidebar`

---

== Frequently Asked Questions ==

= Does it replace Gravatar? =
No. If a user doesn’t upload their own image, WordPress still uses Gravatar by default.

= What image types can be uploaded? =
Any format WordPress supports, including JPG, PNG, GIF, and WebP. SmartCrop automatically converts and optimizes the upload to JPEG for performance.

= Can I style it differently? =
Yes. You can override templates in your theme or use the `classes` attribute for custom styles.

= Is it secure? =
Yes. Uploads use WordPress’s built-in media handling, nonces, and capability checks. Old avatars are safely removed to save space.

---

== Upgrade Notice ==

= 2.0.0 =
Rebuilt from the old “CodeablePress - Simple Frontend Profile Picture Upload” plugin. Existing avatars migrate automatically on activation.
Note: user meta key changed from csfpp_avatar to chargewp_avatar.

---

== Screenshots ==
1. Avatar upload from the front for all users
2. Delete and upload users avatars from the admin dashboard

---

== Changelog ==

= 2.0.2 =
- Updated plugin to support new 6.9 Wordpress

= 2.0.1 =
- Fixed an issue that could prevent the Avatar block from showing the upload icon to users on the frontend.

= 2.0.0 =
- First release under the ChargeWP brand.
- Added Gutenberg block and refined front-end experience.
- Optimized SmartCrop.js for lighter face detection and cropping.
- Improved upload validation, rate limiting, and feedback messages.
- Removed jQuery and Tailwind CSS dependancy.

---

**ChargeWP Front End Avatar Upload** makes changing your profile picture simple, fast, and natural.