A couple of plugins that fix jambs in the new (and not quite new) Wordpress

    For a corporate blog, I decided to choose the latest version of Wordpress 2.2.1 (many holes there are patched). After downloading it and testing, I came across a couple of unpleasant jambs. As a result, not being a programmer, he wrote two plugins.

    Plugin: Novikov's OLD OPERA Commenting Page Refresh Bugfix
    Version: 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, which gives the code 304, and the location of the page with comments is specified as location. In new versions of Wordpress, a structure of the form "# comment-id" is inserted into the location to redirect to a specific comment.
    The old "Opera" (tested on version 8.5), apparently, is experiencing problems with the "#" symbol in location: when you add a comment for the first time, it can successfully refresh the page. But next time the page is no longer being updated.

    The comment falls 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, 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 the user adds a comment, the wp_comment_post.php file is called. It contains various functions that process this comment, put it in the database, and then call the wp_redirect function. Location is passed as an argument to this function - 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 "Opera" has less than the ninth version, then he simply bites off the "tail" from location. Now everyone is happy.

    Plug-in: Novikov's FROM Krjakozjabri Bugfix
    Version: 0.9

    What is the problem:

    When Wordpress sends an email to the post author about new comments, the commentator’s name is inserted in the From field of the message header. Russian letters turn into crackers that are unreadable.
    Wordpress authors seem to have messed up a bit 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 located in the file “wp-includes \ pluggable.php”, that is, it can be redefined using the plugin, rather than hacking the engine.
    Actually, the plugin also overrides this function, making the FROM field in notifications beautiful. Now the Russian letters look normal.

    Also popular now: