=== WP REST API – User Meta ===
Contributors: ruhul105
Tags: rest-api, user-meta, api, json
Requires at least: 4.4
Tested up to: 7.1
Requires PHP: 5.6
Stable tag: 1.1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Enhance WordPress REST API by including configurable user meta fields in post responses without additional API requests.

== Description ==

Now you have no need to make additional requests to get author info from their id that is available in the default json response.
This plugin allows you to configure which user meta fields should be included in the REST API response through an easy-to-use admin interface.

= Features =
* Configurable user meta fields
* Includes avatar URL option
* Shows user role information
* No additional API requests needed
* Clean implementation

= Available Fields =
* Nickname
* Description
* User URL
* First Name
* Last Name
* User Email
* Role
* Avatar

**Example Response:**
`{
    "id": 1,
    "title": "Sample Post",
    "author": 1,
    "author_meta": {
        "first_name": "John",
        "last_name": "Doe",
        "role": "administrator",
        "avatar": "https://secure.gravatar.com/..."
    }
}`

= Credits =
This plugin is created by <a href="https://www.linkedin.com/in/arruhulamin/" rel="friend" title="Ruhul Amin">Ruhul Amin</a>

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Go to Settings -> REST User Meta to configure which fields to include

== Changelog ==

= 1.1.1 =
* Verified compatibility with WordPress 7.1
* Register the REST field on `rest_api_init` instead of at plugin construction time, per current core guidance
* Added explicit `Requires PHP` header and modern `register_setting()` args array (type/sanitize_callback/default)
* Escaped settings-page output and hardened the author-meta callback against missing author data
* Normalized the readme header format (Text Domain slug, Tags list) for the current plugin directory checks

= 1.1.0 =
* Added settings page under Settings menu
* Added configurable user meta fields
* Added avatar URL option
* Added user role support
* Improved code organization
* Removed unnecessary debug information

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.1.1 =
Confirms compatibility with WordPress 7.1 and hardens the settings page and REST field registration. No settings changes needed.

= 1.1.0 =
This version adds a settings page and configurable fields. Visit Settings -> REST User Meta to configure which fields to include.

== Frequently Asked Questions ==

= Where can I find the settings page? =
The settings page is located under Settings -> REST User Meta in your WordPress admin panel.

= How do I access the user meta in the API response? =
The user meta data is included in the `author_meta` object of each post in the REST API response.

= Can I add custom meta fields? =
Currently, the plugin supports a predefined set of common user meta fields. Custom fields support may be added in future versions.

== Screenshots ==

1. Settings page under Settings -> REST User Meta
2. Example of REST API response with user meta data

== Support ==

For support, please visit http://www.ruhulamin.me/
