To implement features like Lightbox and code highlighting, I added post-processing code to my blog theme that performs an additional layer of processing on the HTML output after Typecho's Markdown conversion. However, due to the large number of historical articles on my blog and my use of different editors over time (WordPress editor, Baidu UEditor, etc.), my processing logic became quite complex to ensure compatibility with older articles. Combined with the limited performance of my budget VPS, this resulted in longer webpage loading times. I added the following line to my nginx configuration to output server-side processing time in HTTP headers: add_header LT-Latency $request_time ; Initially, this value was around 0.25, meaning each page took about 250ms to process on the server....

CommentToMail Modified Version
Recently, I suddenly noticed that the daily emails from my self-built Baidu Tieba check-in system had stopped, though the check-ins were still happening normally. When I checked the Mailgun interface, the status was all red: The logs showed a long list of bounce messages sent to my Outlook mailbox, such as: The error indicated that Mailgun's entire AS (Autonomous System) had been blacklisted by Outlook. It was now completely unusable. The good news is that many email service providers offer similar services to Mailgun, such as SendGrid. I quickly registered an account on their website, enabled SMTP, and connected my Tieba check-in system, NextCloud, and other services without any issues. The bad news is that my blog uses CommentGun , which I specifically developed for Mailgun,...
Typecho Comment Email Notification Plugin Based on Mailgun
Often, when replying on websites with self-hosted comment systems like WordPress or Typecho, one has to constantly check back to see if their comment has been replied to. However, for most people, this is very inconvenient. A common solution for bloggers is to install an email notification plugin. When a commenter's comment receives a reply, an email notification is sent to alert them. The most widely used plugin on Typecho is CommentToMail, initially developed by DEFE and later maintained by Byends Upd . This plugin sends emails using standard methods like PHP Mail, SendMail, or SMTP. However, instead of registering dedicated email accounts for notifications, bloggers are now adopting email platforms like Mailgun. These platforms provide API-based email sending capabilities,...
Typecho Display Commenter Country and Browser
Due to the scarcity of plugins for Typecho, I couldn't find one that displays commenters' countries and browsers, so I had to implement it myself. The code is modified from the WordPress plugin Show UserAgent. Download page: https://wordpress.org/plugins/show-useragent/ Prerequisite: Your theme uses custom comment code instead of Typecho's default comment display. Generally, themes meeting this requirement will have code like the following in comments.php or functions.php: <?php function threadedComments ( $comments , $options ) { //blablabla ?> After downloading the Show UserAgent plugin, extract it. Rename the "flags" folder to "country", the "browsers" folder to "browser", and the "ip2c" folder to "lib". Upload these to your theme folder on the server. (Renaming is optional,...

【In My Lifetime】Typecho 0.9 Alpha Finally Released
Yesterday afternoon, I got home and opened Feedly, and saw an article about Typecho 0.9 on Jiang's Blog . What? Typecho actually updated in my lifetime!? I immediately opened the Typecho Official Website and saw that clean default theme of TE. I remember the official site didn't look like this before. The post started with just one sentence: "Yes, you haven't entered the wrong website. This simple place is indeed the official website of Typecho."... So I immediately downloaded, updated, and installed. The update method is simple: log in to FTP, delete the admin and var directories and index.php , upload these files from version 0.9, and then update the database in the backend. When I opened the login page, I instantly felt it was high-end, grand, and classy. It's said that TE 0....
HTML Compression for PHP Web Pages
< body id = "wordpress-org" class = "home blog" > < div id = "header" > < div class = "wrapper" > < h1 > [WordPress.org ](http://cn.wordpress.org/) </ h1 > < h2 class = "rosetta" > [China &#31616;&#20307;&#20013;&#25991; ](http://cn.wordpress.org/) </ h2 > < div style = "clear:both" ></ div > < ul > < li > < a href = "/" title = " &#39318;&#39029; " class = "current" > &#39318;&#39029; </ a > </ li > < li > < a href = "http://zh-cn.forums.wordpress....