WordPress WeChat integration
WP Weixin provides integration between WordPress and WeChat. Register or authenticate users automatically in WeChat browser, use WeChat to create an account or authenticate on computers by scanning a QR code with WeChat, share posts in WeChat Moments and conversations or extend the plugin for more features!
This plugin adds the following major features to WordPress:
wx
JavaScript global variable is pre-configured with a signed package to leverage the JavaScript SDK of WeChat in WordPress themes more easily.Compatible with WooCommerce, WooCommerce Multilingual, WPML, Ultimate Member, WordPress Multisite, and many caching plugins.
Developers are encouraged to build plugins and themes integrated with WeChat with WP Weixin as a core, leveraging its publicly available functions, actions and filters, or directly make use of the provided SDK.
If you wish to see your plugin added to this list, please contact the author.
WP Weixin supports multisite installs of WordPress, wether using domain/subdomains or subdirectories. It can even support multiple Official Accounts, provided the proper filters are implemented. For more information, see a more extensive description of the multisite settings, and the Multisite section of the documentation.
Unlike some plugins (commercial, obfuscated, and with dubious security standards), WP Weixin does not and will not rely on a crossdomain script dumped at the root of WordPress, but prefers to leverage the standard WordPress functions, actions and filters.
Unlike most WeChat integration plugins, WP Weixin and its companion plugins published by the same author are provided for free.
WP Weixin is regularly updated, and bug reports are welcome, preferably on Github. Each bug report will be addressed in a timely manner, but issues reported on WordPress may take significantly longer to receive a response.
WP Weixin and all the companion plugins have been tested with the latest version of WordPress – in case of issue, please ensure you are able to reproduce it with a default installation of WordPress, Storefront theme if WooCommerce is active, and any of the aforementioned supported plugins if used before reporting a bug.
Feature requests (such as “it would be nice to have XYZ”) or 3rd party integration requests (such as “it is not working with XYZ plugin” or “it is not working with my theme”) for WP Weixin and all its companion plugins will be considered only after receiving a red envelope (红包) of a minimum RMB 500 on WeChat (guarantee of best effort, no guarantee of result).
To add the author on WeChat, click here, scan the WeChat QR code, and add “WP Weixin” as a comment in your contact request.
This section describes how to install the plugin and get it working.
/wp-content/plugins/wp-weixin
directory, or install the plugin through the WordPress plugins screen directly.The main settings to integrate WordPress with WeChat.
The WeChat Responder settings (for developers) and the proxy settings.
Other settings.
The screen shown in classic browser when "Force WeChat mobile" is checked in the main settings.
The welcome message sent to a new subscriber when the WeChat Responder is active (customisable via filters).
The list of users displaying WeChat names and WeChat avatars if they exist, instead of the default values.
The default WordPress login form with WeChat QR code authentication link.
The WeChat QR code authentication page.
The public WeChat account informaton displayed on the default WordPress account page.
The page to bind a WordPress user acount with a WeChat account.
The page to unbind a WordPress user acount with a WeChat account.
The default WooCommerce login form with WeChat QR code authentication link (similar on Ultimate Member login form).
The default WooCommerce account page with WeChat account binding link (similar on Ultimate Member account page).
The public WeChat account informaton and WeChat account unbinding link displayed on the default WooCommerce account page (similar on Ultimate Member account page).
The WP Weixin QR code generator.
The interface to setup the WeChat Official Account menu when the WeChat Responder is active.
WP_WEIXIN_API_DISABLED
constant to prevent calling WeChat API when set to true
wp_weixin_is_follower
function$_SERVER
values before using themwp_doing_ajax
filter$class
parameter to wp_weixin_get_auth_link
WP_WEIXIN_ALLOW_DESKTOP
constant to turn off WeChat desktop reztrictionwx.updateTimelineShareData
and wx.updateAppMessageShareData
instead of updateTimelineShareData
and updateAppMessageShareData
'wp_login'
action when automatically logging in with the WeChat browserjweixin-1.4.0.js
add_action
to add_filter
mass_preview
mass_to_users
, mass_to_all_or_tag
, mass_delete
, mass_check_status
)mobileUnifiedOrder
)wp_weixin_ajax_safe()
function to allow WP Weixin to run during specific ajax requestswp_weixin_ecommerce_description
to allow extensions to customise the WeChat Pay Settings description.current_time( 'timestamp' )
by time()
as per WordPress trac ticketwp
(breaks multisite if done in wp_loaded
)extend
parameter to refundOrder
– if string, value is attributed to refund_desc
Special thanks:
wp_loaded
instead of template_redirect
public function cert_files_exist()