Completely Solve the Problem of the Baidu Share Website Plugin Not Supporting HTTPS

5,629 0

Many WordPress themes now integrate the Baidu Share component. However, Baidu Share currently does not support HTTPS access (which is really frustrating—Baidu promotes and advocates HTTPS while its own product is not properly implemented). As a result, many site owners who have enabled HTTPS cannot use Baidu Share normally. After some searching, I found a way to solve Baidu Share's lack of HTTPS support, which I will share with you below.

Project URL

https://github.com/hrwhisper/baiduShare

Usage

  1. Download the archive, place it in the website's root directory, and extract it (make sure that the static directory is directly under the root directory, not in a subdirectory). Download link: https://github.com/hrwhisper/baiduShare/archive/master.zip
  2. Modify the corresponding Baidu Share code by replacing the URL http://bdimg.share.baidu.com/ with / (just one slash).

For example, change the code:

JavaScript
.src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];

to:

JavaScript
.src='/static/api/js/share.js?v=89860593.js?';

This completely solves the problem of Baidu Share not supporting HTTPS!

Comments

(0)

No comments yet. Start the conversation.

Leave a comment