For the corporate blog, I decided to choose the latest version of Wordpress 2.2.1 (many holes are patched there). After downloading it and testing it, I ran into a couple of unpleasant jambs. In the end, not being a programmer, wrote two plugins.
Plugin:
Novikov's OLD OPERA Commenting Page Refresh BugfixVersion: 0.9
What is the problem:')
In new versions of Wordpress, after adding comments, it redirects the user not just to the same page, but immediately to the added comment.
This is done using the HTTP header, in which the code is given 304, and the location of the page with the comments page is indicated. In new versions of Wordpress, a "# comment-id" structure is inserted in the location to redirect to a specific comment.
The old “Opera” (tested on version 8.5) seems to have problems with the “#” symbol in location: when adding a comment for the first time, it can successfully refresh the page. But the next time the page is not updated.
The comment gets into the database, but for the user everything looks as if the site is frozen, and the comment is gone. This leads to repeated shipments, and it just looks ugly.
What this plugin does:If the user has an old “Opera”, then the plugin removes the lattice from the location and everything that comes after it. Thus, the old “Opera” will successfully update the page, and its owners will be redirected, but not to the added comment, but simply to the top of the page, as before. Users of other browsers will not notice anything.
When a user adds a comment, the file “wp_comment_post.php” is called. It contains various functions that process this comment, place it in the database, and then call the wp_redirect function. As an argument of this function, the location is passed - a string containing the URL of the post page and the tail "# comment-id".
Before the wp_redirect function is called, the argument is processed by the comment_post_redirect filter. The plugin registers its function as this filter, and if the user has “Opera” less than the ninth version, then he simply bites off the “tail”. Now everyone is happy.
**********************************
Plugin:
Novikov's FROM Krjakozjabri BugfixVersion: 0.9
What is the problem:When Wordpress sends an email about new comments to the post author, the commentator's name is inserted into the From field of the message header. Russian letters become kryakozyabry that are unreadable.
It seems that Wordpress authors have a little nasty in the wp_notify_postauthor function, which forms the email header. First, they insert “MIME-Version: 1.0”, and then the FROM field, although usually the opposite.
What this plugin does:Fortunately, the wp_notify_postauthor function can be replaced. It is in the file “wp-includes \ pluggable.php”, that is, it can be overridden by a plug-in, and not hacked the engine.
Actually, the plugin overrides this function, making the FROM field in notifications beautiful. Now Russian letters look normal.