| 开发者 | alimuzzamanalim |
|---|---|
| 更新时间 | 2026年11月26日 02:48 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
Users > Author or User Image and standard WordPress Profile / Edit User screens).[author_or_user_image_upload] shortcode with configurable preview visibility, preview size, alignment, and labels for signed-in visitors.Users > Avatar Management, plus read-only lifecycle lock diagnostics under Settings.author-or-user-image/v1) for authenticated avatar, block-list, bulk, and settings management.wp zmai import)./wp-content/plugins/author-or-user-image, or install the plugin through the Plugins screen.[author_or_user_image_upload] shortcode on a Classic Editor page.wp zmai import).Version 3.0.0 stores new uploads as WordPress Media Library attachments. Attachments created by the plugin are marked internally so replacement, privacy erasure, and optional uninstall cleanup only delete plugin-managed files.
An administrator visit starts a one-time migration. The plugin imports valid legacy JPG files into the Media Library and keeps the old files as a safe fallback. Existing image-size and blocked-user options are also understood and migrated.
Temporary import failures are retried on a later administrator visit. On multisite, avatars and blocked-upload settings belong to each individual site.
Imported images are stored separately from explicit uploads and removals, so a legacy import in progress cannot replace a newer user choice.
Legacy images are read from the fixed wp-content/uploads/author-image location used by the old plugin, including on sites with a custom upload directory. On multisite, removing an avatar hides its legacy fallback on that site and retains the shared original for other sites. Privacy erasure reports any shared original it retains.
Network cleanup requires network activation, or activation on the main site so the plugin loads in network admin. Activation only on a subsite cannot install a network deletion hook, so that subsite's avatar data may remain after a network account is deleted. Deletion checks all existing sites in pages of 100. Sites without plugin settings, affected user metadata or owned images are skipped with one database existence check and receive no plugin rows. Cleanup runs synchronously and holds a fence for each affected site until deletion ends. Large networks should allow enough execution time and delete accounts in small batches. Keep site creation, removal and first avatar setup quiescent during deletion. A busy site aborts the account deletion so it can be retried.
Not by default. Administrators may opt in under Users > Avatar Management > Settings. Deactivation never deletes data.
Opted-in cleanup removes plugin settings, upload and import data, and managed Media Library attachments for that site, including originals and square renditions. Legacy JPG fallback files retained during upgrades remain in uploads/author-image; remove those separately if they are no longer needed.
Blocks and shortcodes stay in your content after uninstall and do nothing. Remove each Avatar upload block and [author_or_user_image_upload] shortcode before you uninstall.
By default, yes. Any logged-in user who can read the site can upload an image for their own account, unless an administrator has blocked local avatar uploads for that user. Administrators can narrow this for each site under Users > Avatar Management > Settings:
read capability rule on the dashboard and front-end form.
Each user can make five authorized self-upload attempts per minute and twenty per hour, shared across the dashboard, Profile screen, front-end form, and REST API on the same site. Multisite counters are per site, so a member of several sites has a separate allowance on each. Failed image attempts count too. Removal, privacy erasure, administrator moderation, imports and site-default changes do not use this counter.
Insert the Avatar upload block in the block editor. On a Classic Editor page, use the [author_or_user_image_upload] shortcode instead.
The form changes only the signed-in visitor's own avatar. Presentation options (showPreview, previewSize, alignment, and button or link labels) are supported, while attributes that choose a user, an attachment, a source URL, or the default avatar are ignored. Logged-out visitors see a log-in link. Blocked users, and users the upload setting excludes, see the reason instead of the form. The form posts directly to WordPress, so uploads and removals work with JavaScript turned off.
Place the block or shortcode as standalone content. Nesting it inside another form is not supported, and some themes nest content that way.
Yes. The form is personal to each signed-in visitor, so a full-page cache must not serve it to anyone else. Exclude every page that contains the block or shortcode from full-page caching, including forms placed in widgets or templates. For signed-in visitors, the plugin sends early no-cache headers when the queried content contains the block or shortcode. Rendering a form also sets DONOTCACHEPAGE and sends headers if they are still available. Other pages keep their normal cache behavior. A cache that answers before WordPress runs ignores these signals, so configure the exclusion in that cache.
Yes. The form submits to admin-post.php. Login and security plugins that block wp-admin for some users can block that file too, and then uploads and removals fail. Allow admin-post.php for logged-in users.
The plugin accepts JPEG, PNG, and static WebP images. GIF, SVG, AVIF, APNG, and animated WebP are rejected. Images must be no larger than 8 MiB or the site upload limit, whichever is smaller, and no more than 4096 pixels on either side. WordPress verifies the actual file type and processes the upload with its image APIs. JPEG processing requires the server's EXIF extension so phone-photo orientation can be handled safely. PNG and WebP do not require EXIF.
Each new upload and competitor import gets a square rendition, cropped from the center to the avatar size set in the settings. The sanitized original image is kept uncropped. Center cropping can cut off a face near an edge, so upload a square or centered photo for the best result. A small image may be enlarged for display, which can look soft.
New uploads need the local file until the square avatar is generated. Offload setups that delete local copies before then are not supported for uploads. Existing avatars keep rendering from attachment metadata. Existing avatars and legacy JPG files are not rewritten. They keep their current display until the user replaces them. Changing the avatar size affects newly processed uploads and imports only. When square-rendition metadata is missing or invalid, avatar display uses WordPress's normal attachment-size fallback, which may serve an uncropped image. Cropping is not redaction. The original keeps its full image.
Starting with 3.1, new uploads, imported copies and legacy migration copies remove EXIF, GPS, XMP, IPTC, comments and embedded thumbnails before WordPress stores the image. JPEG, PNG eXIf and WebP EXIF orientation is applied to pixels first, including mirrored orientations. Rendering data, transparency and ICC color profiles are retained. Malformed files or failed sanitation are rejected, keeping the previous avatar. Oriented CMYK JPEGs are rejected when the selected editor cannot preserve their color space.
Previously uploaded originals and existing legacy files keep their metadata until the user re-uploads. There is no automatic backfill. Competitor source files and metadata are never changed.
Trusted PHP code can opt out for an individual operation with the zmai_strip_image_metadata filter, which receives a boolean defaulting to true and a context array with owner and source keys. Source is upload, default, import or legacy. This exception retains descriptive metadata and cannot be enabled through form fields, block attributes or imported settings. It does not bypass upload validation, provenance, permissions or rate limits.
Open Users > Avatar Management > Avatar Migration and use the import action for the detected source plugin. The tab is always available. A separate Users > Avatar Migration menu appears when a supported plugin or saved avatar data is detected, or an unfinished import needs attention. No source selector is needed. Only an administrator can run an import. Competitor imports start only from this screen or via WP-CLI (wp zmai import). The automatic migration of this plugin's older data remains separate. The import runs in pages and reports counts, errors, and completion. Stop pauses the import, and Resume continues it. Closing the page stops further batches, so reopen the page and choose Continue or Resume.
A user who already has an imported avatar is skipped by later runs, so the first source imported for that user wins. A user who removes an avatar stays without one, and removal blocks any later re-import for that user.
Upload settings do not stop an administrator's import. Individual blocks still do.
Missing, offloaded, malformed, oversized, animated, and unsupported files are permanent skips for that sweep. A sweep with only these skips finishes. The screen lists up to 100 skipped user IDs and reason codes so you can repair their source files, then start a new import. Counts include every skipped user. Temporary lock or persistence failures pause the job; choose Retry repaired sources after resolving them. A paused job also offers Finish this import, which retains its results and lets you start another source. It does not clear recovery locks or undo imported avatars.
The importer supports these sources and verified versions:
profile.php / user-edit.php) avatar upload, removal, and administrator block controls.author-or-user-image/v1 (/avatars, /avatars/{user_id}, /default, /blocked, /blocked/{user_id}, /bulk, and /settings) enforcing capabilities, upload policy, rate limits, and metadata stripping.showPreview, previewSize, alignment, uploadLabel, removeLabel, loginLabel) and inspector controls to the Avatar upload block and [author_or_user_image_upload] shortcode.wp zmai import sources|status|run|pause|resume|retry|finish and wp zmai locks list|unlock) for batch competitor imports and exact-token lock recovery.[author_or_user_image_upload] shortcode for signed-in visitors.