WordPress version of wechat app version 2.1.8 released

Time:2021-6-6

Recently, I’ve done a lot of work, and I’m also thinking about the future development direction of this project. Although there are new WordPress webmasters constantly building wechat applets with my open source program, my personal enthusiasm for this project is decreasing, which makes my motivation to continuously improve and maintain this open source project weaken. I need to find a new direction and motivation. If I just rely on my personal hobbies and enthusiasm, I can’t continue this project.

WordPress version of wechat app version 2.1.8 released

Some people asked me why I thought about using WordPress as a back end for small programs. There are two main reasons

1. My website: shouwangxuan is built with WordPress. After making a small program, it can let my website and the words I write have more channels to spread.

2. There are many webmasters who use WordPress. At the same time, WordPress provides a very convenient rest API call, so that wechat applets can be built quickly without writing the background.

Open source address of wechat applet of WordPress version:https://github.com/iamxjb/win…

If you don’t know much about the wechat applet of WordPress version, as usual, please read my previous articles:

1. Connect WordPress website with wechat applet

2. Release of WordPress version wechat applet version 1.5

3. WordPress version wechat applet version 2.0 released

4. Using WordPress rest API to develop wechat applet

5. WordPress version wechat applet version 2.1.5 released

This version of the update content is relatively small, the main update content is the article comments.

Perfect comments

In the past, comments on articles were displayed in the order of comments. It seems that the comments are a bit messy. The comments are first-class, and there is no reply or reply to the reply. Therefore, the following updates have been made on the display of comments

1. The first level comments are arranged according to the time of the comments, and the latest comments will be placed at the top.

2. Show five levels of comments, that is, show the reply of the comments, up to five levels of comments (including one level of comments and four levels of reply) can be displayed. Why is it only displayed? On the one hand, considering that too many levels will affect the performance of the program, and on the other hand, my worpress background setting is: enable comment nesting, with a maximum of 5 nesting levels

WordPress version of wechat app version 2.1.8 released

If you allow more levels of nesting in your WordPress background comment settings, you can modify the code of the detail.wxml file in the applet.

3. Add “reply” function. You can reply to level 4 Comments (replies). Reply input box is a public comment box. Click the “reply” button to make the comment box get the focus automatically. After entering the reply content, the list of comments will be updated.

The content of the article is perfect

Since the first version, the parsing of the article page has referred to the open source parsing component wxparse(https://github.com/icindy/wxP…)。 However, I’m ashamed to say that I don’t pay enough attention to this component of HTML to wxml. I may think that I was biased when I first used it. I think there are still many bugs in this component. Recently, after careful research, we found that there are a lot of very valuable code. Although the official rich text component was released a few days ago, there are more bugs. More importantly, the official rich text component does not provide a programmable interface when parsing HTML code, which is a lack of imagination for programmers who like to do it yourself. Wxparse provides the source code, if you want more customization, you can directly modify the source code. Jeff uses the secondary development interface provided by wxparse to develop the advanced functions of many small programs, such as “article chain” click to jump

However, I made a stupid mistake at the beginning of the first version. I didn’t quote wxparse.wxss file all the time. As a result, the content page of the article was very ugly and I mistook it for wxparse. It’s ridiculous. The introduction of wxparse. Wxss in the article page shows that the article content page is much more beautiful.

Thoughts on the follow up development of the project

Since the first open source version of this project was launched on April 28, 2017, I just played with my hobbies, thinking that I also borrowed a lot of open source code, so I simply open source. It’s not how well I wrote my own code. I want to show it off. The code itself is not complicated, there is no high technical content, and it’s a bit messy, Now I feel ashamed when I look at these codes, and I want to refactor them all. Since open source, many friends have developed many cool and powerful small programs on the basis of my open source programs. For example, professional designer “notes” has created a cool small program. Interested friends can go around and scan the following QR code to visit:
WordPress version of wechat app version 2.1.8 released

At the same time, this set of imperfect code also helps many friends who know a little bit about program development to develop their own wechat applet in a very short time, reducing the threshold of entry.

All of these make me very happy, which is also the driving force for me to stick to it. It’s just that the motivation is not enough for me to use more energy to improve the project. I hope open source and commercialization can be combined. There is such a way for me to explore, but I haven’t found it yet.

I will continue to insist and hope to get more support.

Address of this article:https://www.watch-life.net/wo…