Fixing «PostPost» and «Ozh’ Absolute Comments» Plugins

I use a modified version of the simple PostPost plugin created by Douglas Karr to display one sentence affiliate advertising in my RSS feed for entries that contain more than 700 letters.

Today I installed the very useful Ozh’ Absolute Comments plugin that makes the process of replying to comments a lot easier. However, when trying out the inline (and ajaxy) comment reply feature within the ‘Manage Comments’ section of WordPress admin for the first time, I got the following error message:

Error (duplicate comment, or posting too quickly ?). Aborted

Fatal error: Call to undefined function: add_options_page() in /.../wp-content/plugins/postpost/postpost.php on line 88

PostPost plugin causing error in Absolute Comments

Line 88 of postpost.php contains the following:

add_action('admin_head', 'wppp_add_options_page');

In all of my plugins I have used the admin_menu hook for adding plugin settings page, so the solution was simply to replace admin_head with admin_menu, like this:

add_action('admin_menu', 'wppp_add_options_page');

Download PostPost 1.3 which allows you to specify three rotating feed footers for posts that exceed certain number of letters.

Fixing the Reply Prefill backslash error in Ozh’ Absolute Comments (2.2)

Update: Ozh has updated the plugin (version 2.2.1) and it fixes the problem mentioned below. To get the latest version use the automatic plugin updater or download it from the WordPress Extend.

Reply Prefill is a really handy feature that automates the process of referring to the author of a comment you are replying to.

The default reply prefill looks like this: @%%name%%:... , but I wanted to include also a link to the original comment: <a href="%%link%%">%%name%%</a>, ...

However, after saving the settings, the new prefill contained added backslashes before the quotes: <a href=\"%%link%%\">%%name%%</a>, .... It was immediately clear that backslashes are added when the user input is sanitized before saving it to the database, and not removed when retrieved from the database.

Absolute Comments Prefill error -- added backslashes

The solution is to strip slashes before the output is presented to a user — open the _admin.php file located in /ozh-absolute-comments/includes/ folder, and replace

$prefill = $wp_ozh_cqr['prefill_reply']; (line 40)

with

$prefill = stripslashes($wp_ozh_cqr['prefill_reply']);

and that’s it — comment prefills look exactely like they should.

Leave a Reply