# 重新介绍 WPAvatar ，全新设计，彻底解决WordPress 中国头像显示问题。

*Published:* 2025-05-19
*Author:* 诗语

当一项便捷网络服务变成了一个区域性特色问题的时候这往往意味着理想与现实的鸿沟。过去几年我反复思考过一个问题：

> 「Cravatar 头像服务值得花这么多人力、财力在上面吗？」

从此项目的属性来看其实没有太大意义，因为本质上这只是一个头像图片托管「图床」CDN 而已，没人会愿意为此服务付费，更不会为其提供太多价值，文派会一直提供此服务的根本原因还是在于 Gravatar 这是过去几十年里 WordPress 以及众多开源程序内置的一款公共头像服务。但此服务在中国不可用（国家政策原因）。

Cravatar 初认头像也是在这种特殊的需求下产生，如果要把此当成一个创业项目一定会崩溃，好在我从来就没考虑过要对此项目收费。商业计划是有的，但并不会做有损用户权益的事情，这些放在以后再谈。

2025年7月31日更新，

- 插件主页 <https://wenpai.org/plugins/wpavatar/>
- 开放讨论 <https://meta.cyberforums.com/tag/wpavatar>

此 1.9.3 版本为稳定版本，暂时不升级版本号为 2.0 等，2.0 版本发布将与寻鹿建站套件全部 2.0 版本插件一起提供。



下载渠道：菲码源库 feiCode 为国内线路，GitHub 为国际线路；

 ![菲码源库 feiCode.com](https://cn.cravatar.com/favicon/api/index.php?url=cn.feicode.com)  [ 菲码源库 feiCode.com ](https://cn.feicode.com)  

 ![wpavatar](https://feicode.com/repo-avatars/acc27ce433ea94779a4587b6534146b6885840a1b395669af0dddf6751654f5c "仓库头像")###   [ WenPai-org/wpavatar ](https://feicode.com/WenPai-org/wpavatar) 

 组织 [ @WenPai-org ](https://feicode.com/WenPai-org)   

 

 

  FORGEJO  

 

  文派头像 👤（WPAvatar.com）面向中国互联网用户的开放式网络头像服务，并解决 Gravatar 在中国无法访问的问题。这也是 Cravatar 的官方插件。

   星标： 0    分叉： 0    议题： 0  

 [  查看仓库 ](https://feicode.com/WenPai-org/wpavatar) [  下载 v1.9.3 ](https://cn.feicode.com/api/v1/repos/WenPai-org/wpavatar/archive/v1.9.3.zip "下载 Release v1.9.3 (v1.9.3)") 

 

 
            (function() {
                'use strict';
                
                const containerId = 'git-embed-fd58b5ec-e824-4fb9-9280-4d38a26fce5a';
                const container = document.getElementById(containerId);
                if (!container) return;

                const cloneBtn = container.querySelector('.git-embed-clone-btn');
                if (cloneBtn && !cloneBtn.hasAttribute('data-initialized')) {
                    cloneBtn.setAttribute('data-initialized', 'true');
                    cloneBtn.addEventListener('click', function() {
                        const cloneUrl = this.getAttribute('data-clone-url');
                        const originalHtml = this.innerHTML;
                        
                        if (navigator.clipboard && navigator.clipboard.writeText) {
                            navigator.clipboard.writeText(cloneUrl).then(() => {
                                this.innerHTML = '<span class="dashicons dashicons-yes">已复制！';
                                setTimeout(() => {
                                    this.innerHTML = originalHtml;
                                }, 2000);
                            }).catch(() => {
                                fallbackCopy(cloneUrl, this, originalHtml);
                            });
                        } else {
                            fallbackCopy(cloneUrl, this, originalHtml);
                        }
                    });
                }

                const downloadBtn = container.querySelector('.git-embed-download-btn');
                if (downloadBtn && !downloadBtn.hasAttribute('data-initialized')) {
                    downloadBtn.setAttribute('data-initialized', 'true');
                    downloadBtn.addEventListener('click', function(e) {
                        const filename = this.getAttribute('data-filename');
                        if (filename) {
                            e.preventDefault();
                            const url = this.href;
                            
                            const a = document.createElement('a');
                            a.href = url;
                            a.download = filename;
                            a.style.display = 'none';
                            document.body.appendChild(a);
                            a.click();
                            document.body.removeChild(a);
                        }
                    });
                }

                function fallbackCopy(text, button, originalHtml) {
                    const textarea = document.createElement('textarea');
                    textarea.value = text;
                    textarea.style.position = 'fixed';
                    textarea.style.opacity = '0';
                    document.body.appendChild(textarea);
                    textarea.select();
                    
                    try {
                        document.execCommand('copy');
                        button.innerHTML = '<span class="dashicons dashicons-yes">已复制！';
                        setTimeout(() => {
                            button.innerHTML = originalHtml;
                        }, 2000);
                    } catch(err) {
                        console.error('Copy failed:', err);
                    }
                    
                    document.body.removeChild(textarea);
                }
            })();
             

###   [ WenPai-org/wpavatar ](https://github.com/WenPai-org/wpavatar) 

 

 

  GITHUB  

 

  文派头像 👤（WPAvatar.com）面向中国互联网用户的开放式网络头像服务，并解决 Gravatar 在中国无法访问的问题。这也是 Cravatar 的官方插件。

   星标： 6    分叉： 1    议题： 0  

 [  查看仓库 ](https://github.com/WenPai-org/wpavatar) [  下载 v1.9.3 ](https://github.com/WenPai-org/wpavatar/archive/refs/tags/v1.9.3.zip "下载 v1.9.3 (v1.9.3)") 

 

 
            (function() {
                'use strict';
                
                const containerId = 'git-embed-31817451-837a-439c-989c-932f7fbc2600';
                const container = document.getElementById(containerId);
                if (!container) return;

                const cloneBtn = container.querySelector('.git-embed-clone-btn');
                if (cloneBtn && !cloneBtn.hasAttribute('data-initialized')) {
                    cloneBtn.setAttribute('data-initialized', 'true');
                    cloneBtn.addEventListener('click', function() {
                        const cloneUrl = this.getAttribute('data-clone-url');
                        const originalHtml = this.innerHTML;
                        
                        if (navigator.clipboard && navigator.clipboard.writeText) {
                            navigator.clipboard.writeText(cloneUrl).then(() => {
                                this.innerHTML = '<span class="dashicons dashicons-yes">已复制！';
                                setTimeout(() => {
                                    this.innerHTML = originalHtml;
                                }, 2000);
                            }).catch(() => {
                                fallbackCopy(cloneUrl, this, originalHtml);
                            });
                        } else {
                            fallbackCopy(cloneUrl, this, originalHtml);
                        }
                    });
                }

                const downloadBtn = container.querySelector('.git-embed-download-btn');
                if (downloadBtn && !downloadBtn.hasAttribute('data-initialized')) {
                    downloadBtn.setAttribute('data-initialized', 'true');
                    downloadBtn.addEventListener('click', function(e) {
                        const filename = this.getAttribute('data-filename');
                        if (filename) {
                            e.preventDefault();
                            const url = this.href;
                            
                            const a = document.createElement('a');
                            a.href = url;
                            a.download = filename;
                            a.style.display = 'none';
                            document.body.appendChild(a);
                            a.click();
                            document.body.removeChild(a);
                        }
                    });
                }

                function fallbackCopy(text, button, originalHtml) {
                    const textarea = document.createElement('textarea');
                    textarea.value = text;
                    textarea.style.position = 'fixed';
                    textarea.style.opacity = '0';
                    document.body.appendChild(textarea);
                    textarea.select();
                    
                    try {
                        document.execCommand('copy');
                        button.innerHTML = '<span class="dashicons dashicons-yes">已复制！';
                        setTimeout(() => {
                            button.innerHTML = originalHtml;
                        }, 2000);
                    } catch(err) {
                        console.error('Copy failed:', err);
                    }
                    
                    document.body.removeChild(textarea);
                }
            })();
             

### 一、旧版系统问题

前两周我们写了篇 [《Cravatar 服务在 WordPress 6.8 版本中无法显示 QQ 头像的兼容性说明 》](https://wptea.com/cravatar-qq-avatar-compatibility/)文章，原因如下：

> WordPress 6.8 和 Gravatar 头像加密算法从原来的 `MD5` 升级为 `SHA256` 。此变更导致现有 Cravatar 数据库结构无法正确匹配 QQ 头像。

为什么不直接做平台升级？不是不想做，而是不能，Cravatar 的结构及数据库完全是基于 MD5 算法设计的，要改造需要对整个平台进行重写，这将会占用我们开发团队大量的时间精力，并且短期内带来不了任何实质性的收益和回报。

Cravatar 平台会升级，会更新，会更好用，这是我给全部文派用户的另一项承诺，也是我对文章开头的提问的答复，试问连一个破头像、图床服务都做不好，还谈什么 WordPress 中国生态建设？？？

Cravatar 现有很多问题，但都是态度问题，这些回应就是我的态度。

### 二、替代解决方案

上周我们对 Cravatar 提供的官方 WordPress 插件文派头像（WPAvatar） 进行了全新重写和升级，特别针对 6.8 版本进行了头像算法和第三方多源兼容、如果你爱折腾还有自己添加自定义头像CDN源，这取决于你自己。

![](https://wptea.com/wp-content/uploads/2025/05/e0826a18-510d-4a22-9261-608e19c3cf38.png)    文派头像（WPAvatar） 可以彻底解决 WordPress 系统内置 Gravatar 头像无法加载且缓慢的问题，并且现在也可以解决 Cravatar 暂时不兼容新算法的问题。

我们建议所有在中国区域使用 WordPress 的用户都安装上文派头像（WPAvatar）插件，不仅可以彻底解决头像问题，还有主动 SEO 优化和远程头像加载失败后的备用方案自动处理，这样即便是未来 cravatar 或者gravatar 以及第三方镜像服务都宕机，也不会拖慢你的网站访问速度。

![](https://wptea.com/wp-content/uploads/2025/05/ea250e21-a87f-4905-8eac-defdfd69ce28.png)    访客和互动很多的情况下你可以开启【头像缓存】功能，这样可以更快的加载图片，在实际测试中，我们建议保留缓存头像 7~15天，可以有效提升网站访问速度而不影响用户体验。

![](https://wptea.com/wp-content/uploads/2025/05/87d363a4-bf5a-4866-9535-a23b0b1352ff.png)    ### 三、文派生态服务

 Cravatar 这类服务是属于及时性和需要在线率可用性很高的服务类型，稍微有点儿异常情况就会影响到数百万用户使用。

有个特殊角色需要特别提出——平台网站管理员，如果你是运营者有自己的网站项目那么也会考虑在线服务的稳定性， Cravatar 现在是有文派开源团队进行维护运营，所以不存在未知风险，最大的问题也就还是在于网络环境以及安全攻击等情况。

使用文派头像（WPAvatar） + 文派叶子（WPCY.COM）组合功能可以实现本地备用头像和自动在线头像源切换双重保障。

如果你的平台有很多用户，并且头像服务是你使用 WordPress 会担忧的一个痛点，那么请务必安装此组合插件。

### 四、扩展营销工具

网络头像的本质上是自我营销和展现的一种形式，为了更方便用户使用，我们专门开发了头像简码调用功能，并且会在未来增加更多与之相关的营销功能。比如随机头像、新注册用户头像等。

![](https://wptea.com/wp-content/uploads/2025/05/07665863-0e95-49fd-9c73-57caf38dedf0.png)    这免费服务值得投入这么大吗？你一个头像服务平台都不赚钱，开发个头像插件就能了？有没有一种可能我根本就没打算在这上面死磕，这些服务开发的出发点就没有考虑要盈利？

> 试问连一个破头像、图床服务都做不好，还谈什么 WordPress 中国生态建设？？？

愿意在这上面耗费时间精力，只不过是我希望、我需要、我喜欢、然后到现在的我可以、我能够、我想要，并不关乎任何第三方。在实现目标的过程中，这也是一个自我成长的过程。

WPAvatar 插件旧版本（目前还未提交是 v1.0）可以在后台搜索到，我们将会在本周提供 2.0 版本，官网为 WPAvatar.com 届时下载地址会在 Cravatar.com 等用户使用界面进行标注，WordPress 用户就自行安装吧。

目前能做的也就这些，更多新品将会在未来一段时间陆续上线。
<!-- WP Chinese Converter Full Page Converted. Target Lang: zh-sg -->