Title: Bosima WeChat Page Sharing
Author: bossma
Published: <strong>July 13, 2017</strong>
Last modified: August 24, 2019

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/bosima-wechat-page-sharing/assets/icon-256x256.png?rev=1695510)

# Bosima WeChat Page Sharing

 By [bossma](https://profiles.wordpress.org/bossma/)

[Download](https://downloads.wordpress.org/plugin/bosima-wechat-page-sharing.0.3.4.zip)

 * [Details](https://test.wordpress.org/plugins/bosima-wechat-page-sharing/#description)
 * [Reviews](https://test.wordpress.org/plugins/bosima-wechat-page-sharing/#reviews)
 *  [Installation](https://test.wordpress.org/plugins/bosima-wechat-page-sharing/#installation)
 * [Development](https://test.wordpress.org/plugins/bosima-wechat-page-sharing/#developers)

 [Support](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/)

## Description

本插件通过集成微信提供的JS-SDK，从而实现自定义网页分享的内容，包括Url、标题、图片
和内容。

1、本插件简单灵活，分享的内容可全部从页面提取，也可在后台自定义。
 2、目前已实现
首页、分类页、文章页、标签页、搜索页、存档页以及单独页面的分享。 3、分享目标支持
微信朋友、微信朋友圈、QQ、QQ空间。 4、分享标题、图片、描述等内容首先从自定义模板
提取，如果未设置模板则从页面提取，如果页面上提取不到则根据当前页面内容自动生成。
5、从页面提取时，各个分享内容的来源：标题来源于html->head->title，描述从html->head-
>meta[name=’description’]提取，图片取正文中的第一张图。 6、分享url目前只能是当前
url，未提供自定义设置功能。

### Dependency

#### WeChat JS-SDK

https://res.wx.qq.com/open/js/jweixin-1.2.0.js
 This plugin depends on the WeChat
JS-SDK, which is a remote JS file and provided by WeChat. It provides initialization
method of WeChat services, and provide some functions, including share to friends,
share to circle of friends. The JS-SDK is a service.

#### myip.fireflysoft.net

http://myip.fireflysoft.net
 This plugin depends on the myip.fireflysoft.net, which
can return the outbound IP of the user server. The exit IP needs to be added to 
the WeChat IP whitelist.

## Screenshots

 * [[
 * 使用说明、微信设置和模板设置
 * [[
 * [[

## Installation

1、在您的Wordpress管理后台安装本插件或者通过上传文件夹到Wordpress插件目录的方式安装
本插件；
 2、启用插件； 3、注册一个微信公众号，访问地址：https://mp.weixin.qq.com；
4、在“Wordpress管理后台”-“设置”-“微信分享设置”中获取服务器出口IP，填写到“微信公众
平台”-“安全中心”-“IP白名单”中； 5、在“微信公众平台”-“公众号设置”-“功能设置”-“JS接口
安全域名”中填写您网站的域名； 6、在“Wordpress管理后台”-“设置”-“微信分享设置”中填写
您微信公众号的AppID和AppSecrect（从“微信公众平台”-“基本配置”中获取）。

安装完毕。

**特别说明：**
 由于0.2.0版本将微信的配置参数保存到了插件目录下（当然也不会被外部
访问到），导致控制台升级后配置会丢失。 从0.2.1版本后配置参数保存位置进行了修改，
防止升级导致丢失。 因此0.2.0版本升级后请重新设置微信的AppId和AppSecrect。

## FAQ

  微信IP白名单中需要的IP是域名解析到的IP吗？

这两个IP可能是同一个，也可能不是。
 微信IP白名单中的IP是网站所在服务器的外网出口
IP，也就是服务器访问外部网络资源时暴漏的IP。

  如获取获取微信IP白名单中需要的IP？

1、直接询问您的主机服务商服务器的外网出口IP；
 2、在“Wordpress管理后台”-“设置”-“
微信分享设置”中查看。

  微信公众号可以是个人账号吗？

现在不可以，需要是认证过的企业账号。
 如果你是很久之前注册的，有可能具备分享接口
权限，请登陆微信公众号平台查看。

  这个插件和缓存插件冲突吗？

没有冲突，对于启用缓存插件的WordPress，本插件将自动使用Ajax的方式实现页面分享。

## Reviews

![](https://secure.gravatar.com/avatar/b04eb7bdd2a03b11ae46ed5f11f807556476fc3716dfdcd71908e9de32ef6760?
s=60&d=retro&r=g)

### 󠀁[简单灵活的微信分享插件](https://wordpress.org/support/topic/%e7%ae%80%e5%8d%95%e7%81%b5%e6%b4%bb%e7%9a%84%e5%be%ae%e4%bf%a1%e5%88%86%e4%ba%ab%e6%8f%92%e4%bb%b6/)󠁿

 [bossma](https://profiles.wordpress.org/bossma/) August 31, 2018

很少的配置就可以实现微信分享，还可以使用模板个性化分享内容。

 [ Read all 1 review ](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/)

## Contributors & Developers

“Bosima WeChat Page Sharing” is open source software. The following people have 
contributed to this plugin.

Contributors

 *   [ bossma ](https://profiles.wordpress.org/bossma/)

[Translate “Bosima WeChat Page Sharing” into your language.](https://translate.wordpress.org/projects/wp-plugins/bosima-wechat-page-sharing)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/bosima-wechat-page-sharing/),
check out the [SVN repository](https://plugins.svn.wordpress.org/bosima-wechat-page-sharing/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/bosima-wechat-page-sharing/)
by [RSS](https://plugins.trac.wordpress.org/log/bosima-wechat-page-sharing/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 0.3.4

 * 修改生成微信分享js的顺序，避免找不到jQuery的问题
 * 统一获取微信js签名的方式为ajax方式
 * 修改后台使用说明中的域名使用前端js获取

#### 0.3.3

 * 更改反向代理情况下获取分享链接域名的方法
 * 对分享标题和描述中的双引号进行转义
 * 修改从文章中提取图片的正则表达式
 * 在插件列表增加“设置”链接

#### 0.3.2

 * 增加插件截图
 * 在插件后台增加使用说明
 * 修正错误的作者url

#### 0.3.1

 * 增加了分享标题和描述的模板设置功能，让分享更个性化；
 * 增加了首页分享使用网站Icon的选择；
 * 增加了单篇文章分享使用特色图片的选择；
 * 更换了从正文提取图片url时调用的方法为当前类的静态方法;
 * 更换了通过ajax方式生成签名时检查url的函数为esc_url_raw；
 * 为后台管理界面编写了多语言文件；
 * 更新了判断https协议的方法；
 * 更换了获取服务器出口IP的方法。

#### 0.3.0

 * 解决了Url中含有中文时签名无效的问题;
 * 增加了首页、分类页、标签页、搜索页、存档页以及单独页面的分享。

#### 0.2.2

 * 修改Exit IP为Outbound IP;
 * 注释签名包中调试用的url和原始签名字符串，防止信息泄露。

#### 0.2.1

 * 增加显示服务器出口IP功能，方便在微信“安全中心”-“IP白名单”中进行配置。
 * 更改微信配置参数保存位置，防止控制台升级后丢失；但从0.2.0升级后仍会丢失，需重新
   配置。

#### 0.2.0

 * 第一个版本，仅支持文章分享给朋友和分享到朋友圈。

## Meta

 *  Version **0.3.4**
 *  Last updated **7 years ago**
 *  Active installations **200+**
 *  WordPress version ** 4.4 or higher **
 *  Tested up to **5.2.24**
 *  Language
 * [English (US)](https://wordpress.org/plugins/bosima-wechat-page-sharing/)
 * Tags
 * [sharing](https://test.wordpress.org/plugins/tags/sharing/)[分享](https://test.wordpress.org/plugins/tags/%e5%88%86%e4%ba%ab/)
   [微信](https://test.wordpress.org/plugins/tags/%e5%be%ae%e4%bf%a1/)
 *  [Advanced View](https://test.wordpress.org/plugins/bosima-wechat-page-sharing/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/reviews/)

## Contributors

 *   [ bossma ](https://profiles.wordpress.org/bossma/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/bosima-wechat-page-sharing/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](http://blog.bossma.cn/)