WordPress real WeChat official account verification code view plug-in

» WordPress » WordPress real WeChat official account verification code view plug-in

When you see the title, many people will say that this function has been available for a long time. Why do you still post this article? Yunluo certainly won't take the previous function to write. What I wrote today is not a real public account verification code viewing function, but a function I thought of when I was sleeping in bed.

WordPress真微信公众号验证码查看插件-极客公园

thinking

Here is a brief introduction to the design idea. First of all, we need to design a verification code, which must be unique and have an expiration date. From this point of view, the visible function of these public account verification codes circulating on the Internet is actually false, because the verification code is manually set and is a fixed character, You will know after using it once.

The first idea is to use a public verification code pool, which is to generate some verification codes at one time, put them in a txt file, call them randomly, read the file, form an array, and then call out the verification code from the array. After this method is implemented, and after thinking about it, it is found that although it can achieve the functions I need, it cannot be used, After all, this means that the verification code is directly disclosed, so this method is eliminated and another verification code method is redesigned.

Verification code design

The redesigned verification code scheme is based on time, domain name and WeChat token. The time unit is 1 hour, so there are 60 minutes, and every minute corresponds to a verification code, that is, there are 60 verification codes, such as 13-12, and every minute is 12. The verification code can be simply set to 12. If you need to change the verification code every 2 minutes, the current minutes can be divided by 2, and so on. Splice the website domain name and the current minute into strings, such as 12 https://gitcafe.net , combined with WeChat official account token [12 https://gitcafe.netweixintoken 】Later, we will use the Sha1 method to encrypt it and calculate a 40 digit string. We will intercept 6 of them as the verification code, and then add the date at this time. For example, today is 2-18. Then we will intercept 6 of them from the 18th to ensure that the verification code does not repeat 30 days a month, Finally, this 6-digit string can be sent to the WeChat public account as a verification code and used to verify whether the verification code entered on the web page is correct.

The verification code design is OK. The following is the connection to the WeChat public account. It is slightly modified on the basis of the example code of the public account. Only WeChat class is reserved, and other codes are not required. Try it out. OK, no problem.

The WeChat end is ready, and then the WordPress end. Here I want to talk about the code visible in the popular WeChat public account verification code. For so many times, it is still a native form submission, and it will be submitted repeatedly after refreshing. The cloud is slightly changed here, and the actual experience will be better if it is changed to ajax submission.

The code in this article is not important, but the important thing is the design idea of the verification code. It can also be designed in this way where the verification code needs to be used later. In addition, this verification code has a small disadvantage that the expiration time is not calculated from the generation of the verification code, but the verification code expires over time. So if you get the verification code at 59 seconds, it will become invalid immediately, Of course, this is just a small defect, which does not hinder the use. It is OK to reapply for the expired verification code.

Plug in description

Because it is a very simple plug-in, there is no background. There are two constants in the plug-in. One is WeChat token, and the other is a QR code image of the public account. The plug-in is a file that can be seen when you open it. In addition, Js code uses Jquery's
The other is that the administrator has no effect. If the administrator needs to check, he or she needs to exit the account to check

Plug in download

--End--

Post reply

Your email address will not be disclosed. Required items have been used * tagging

72 Replies to "WordPress official account verification code viewing plug-in"

  1. Hello, excuse me, isn't it 6.2 or above wp? No matter whether the verification code is correct or wrong, only 400 is displayed, and hidden content is not displayed

  2. Hello, boss, I want to ask whether the message encryption and decryption method of the public account can only select compatible and clear text. I need a security mode to connect the public account with the WeChat robot plug-in, but when I turn on the security mode, the obtained verification code will not be refreshed. It has always been a

  3. Cloudfall, please tell me how to change the server address in the source code. The source code is "domain name/wxcaptcha", but my website has enabled the WeChat login function. The server interface address is fixed and cannot be changed, so only the plug-in can be changed (want to change it to be the same as the server address I registered on WeChat), and the specific location to change, thank you.

  4. Hello, the plug-in is very useful, but I encountered some small problems in the process of using it. After using the plug-in, some interfaces of the web page will shift, https://ir12.cn/%e6%b5%8b%e8%af%95%e5%be%ae%e4%bf%a1%e9%aa%8c%e8%af%81%e7%a0%81/ , due to my limited level, I can't locate the cause of the problem. Could you ask the author to help me check

        1. @ Robby I also had this problem before. Uninstalling and reinstalling only changed the number of verification codes and the expiration date. Now everything is normal.

  5. Hello, how do you reply to the public account that the service provided by the public account has failed? Please try again later

  6. The configuration can be used normally according to the requirements of the building owner, but if the developer mode is enabled, the original menu will be taken over and the automatic reply will be made. The menu cannot be customized for an unauthenticated subscription number.
    Now the public account background is connected to WeChat engine, and the server address in the public account configuration has changed. How to realize this function?

  7. How to reply to the verification code? The plug-in and WeChat server are normal

  8. What should we do if Yunluo makes this mistake!
    Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /www/wwwroot/www.Xxxx.net/wp-content/plugins/wx/wx.php on line 68

  9. Token can't pass the verification code, public account, basic configuration URL, and I don't know how to fill it in. I hope the boss can explain it more clearly

  10. After configuration, the verification code can also be received.
    The problem is that the verification code is entered, and the error is always prompted
    Verification code error

  11. The device has been successfully deployed, but why is there always an IP segment 150.138.138. * It is under attack and has been guessing the password. If the IP terminal is blocked, the verification code function cannot be used. The IP segment does not seem to belong to Tencent Cloud or the public account. The IP login fails all day long. The user name is right... What's going on?

    1. @ Abai Well, it is found to be the node~of Baidu Cloud CDN. However, this takes over the menu and automatic reply. It's not easy to do this for those who don't have the ability to develop

  12. The configuration is successful, but why doesn't the public account reply when you enter the keyword "verification code"?

  13. If the WeChat public account does not send a verification code, the public account will return that the service provided by the public account is faulty. Please try again later.

    See if the boss can handle it.

    1. @ stone This does not pay any attention to the plug-in. To use this plug-in, you need to learn to develop other replies, develop the menu bar, and so on

  14. I have a problem. After enabling this plug-in, my WP website chooses 21:50 as the time to publish the article, but the time is 13:50, which is 8 hours slow. How can I solve this problem? The time to close this plug-in will be normal

  15. I filled in the relevant information in the [Server Configuration] in the background of WeChat public account, but I was prompted that [token verification failed]. What should I do?

  16. What settings should be made on WeChat public account?
    At present, I have obtained the token and modified the QR code image address of the public account. The plug-in has been enabled in the WP background, but after trying with a small account, the public account will not automatically generate a verification code.

  17. Upload the compressed package directly to the plug-in installation, and the BT panel will prompt you that the submitted content contains dangerous attack requests

  18. The public account has been configured, WX_TOKEN and WX_QR have also been modified, and the public account also has a verification code. But the content on the wd is not hidden. Do you know the possible reason?

  19. This plug-in is great. Compared with some old online products several years ago, it is still more reliable in new size. It is a small pity that there is no visual setting option, but what does Xiaobai do with it?
    I reprinted this article at the following address: https://www.npc.ink/12091.html