5 step to implement WordPress has a new review WeChat reminder webmaster

Step 1. Authorized Github account login Server sauce Step 2. Bind WeChat Push Step 3. Get Sckey Step 4. Code Configuration Step 5. Verify Directory

May usually work, often need to take your own spare time to take your own WordPress blog, if you work hard without watching the blog OR website construction, you can’t reply to everyone in time when you have a new review. At present, WeChat is a communication tool that May is very like. So I tried to find the answer soon.

The most convenient thing is to use Server sauce. Server sauce, English name: ServerChan, is a tool developed from the server push alarm and log to mobile phone. Server sauce plays a middleman role in communication between WordPress servers and WeChat.

The following steps are successful with May, please feel free to use it.

Step 1. Authorized GitHub account login Server sauce

Enter: http://sc.ftqq.com – Login – Log in to Server Sauce with Github (If there is no GitHub account, click “CREATE An Account” to create an account) – Allow GitHub account to log in to Server sauce

Step 2. Bind WeChat push

The QR code is valid for only 2 seconds, takes out the phone, the WeChat scans the QR code to complete the binding.

Step 3. Get Sckey

Click “Send Message” to get your own sckey. Copy it, standby.

STEP 4. Code configuration

“Your Sckey” in the following code is changed to you copy STEP 3 Sckey;

Then configure the code into the wordpress’s function.php

// Review WeChat push Function sc_send ($ comment_id) {$ text = ‘blog has a new review’; $ comment = get_comment ($ comment_id); $ desp = $ comment-> comment_content; $ key = ‘Your sckey ‘; $ postdata = http_build_query (array (‘ text ‘=> $ text,’ desp ‘=> $ desp); $ OPTS = array (‘ http ‘=> array (‘ Method ‘=>’ POST ‘,’ HEADER ‘=>’ Content-Type: Application / X-WWW-FORM-URLENCODED ‘,’ Content ‘=> $ PostData)); $ context = stream_context_create ($ OPTS); Return $ Result = file_get_contents (‘ http: // sc .ftqq.com /’.$ key. ‘. Send’, false, $ context);} add_action (‘comment_post’, ‘sc_send “, 19, 2);

(Code comes from the network, unclear which master left code, if you know, please tell May)

Step 5. Verification

After completing the 4 steps above, when the blog has a new comment, WeChat binding Server sauce public account – Fang Sugar, will send a message to remind.

Haha, success ~~~

Do you try it? If you have any questions, please leave a message below.