Title: Bug with other Plugin Shortcodes
Last modified: August 20, 2016

---

# Bug with other Plugin Shortcodes

 *  Resolved [professor99](https://wordpress.org/support/users/professor99/)
 * (@professor99)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/bug-with-other-plugin-shortcodes/)
 * Relevanssi includes an option to expand shortcodes of other plugins in posts 
   when searching. If this is enabled I have found a bug in version 3.1.3 and version
   3.1.4 of Relevanssi (that may exist in earlier versions) that may result in the
   server timing out when such a shortcode results in a post being added, updated,
   or deleted. In such a case an infinite loop will occur which will result in hundreds
   of copies of the original post being added to the database.
 * The plugin I encountered this problem with is WP User Frontend (more about this
   problem and how I found this bug [here](http://wordpress.org/support/topic/plugin-wp-user-frontend-100s-of-duplicate-entries-on-single-submit-bug)).
 * On investigating I found that a bug fix was already somewhat implemented in Relevanssi
   via the wp_insert_post action hook in init.php which calls the relevanssi_insert_edit()
   function but the cause of the old bug hadn’t been disabled.
 * The fix for this bug is to comment out this line as follows in the Relevanssi
   file init.php
 * //add_action(‘save_post’, ‘relevanssi_edit’, 99, 1);
 * Cheers
    The Professor
 * [http://wordpress.org/extend/plugins/relevanssi/](http://wordpress.org/extend/plugins/relevanssi/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/bug-with-other-plugin-shortcodes/#post-3497353)
 * Commenting out that line disables indexing new posts, so it’s not a very good
   solution for general use. But good to hear it helps with the problem with WP 
   User Frontend.
 * What is the shortcode that is causing the problem? Relevanssi has a list of shortcodes
   that don’t play nice with it, and those shortcodes are disabled during indexing.
   I can add this shortcode to the list.
 *  Thread Starter [professor99](https://wordpress.org/support/users/professor99/)
 * (@professor99)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/bug-with-other-plugin-shortcodes/#post-3497355)
 * Hi Mikko,
 * Seems you missed what I was trying to say [here](http://wordpress.org/support/topic/plugin-wp-user-frontend-100s-of-duplicate-entries-on-single-submit-bug)
 * Commenting out this line doesn’t stop your indexing.
 * //add_action(‘save_post’, ‘relevanssi_edit’, 99, 1);
 * Reason being is that the following line a few lines down from the one above already
   does the required indexing (with fix included)
 * add_action(‘wp_insert_post’, ‘relevanssi_insert_edit’, 99, 1 );
 * To me it seems this line was added as a fix to this problem but for some reason
   the original line wasn’t removed.
 * Note that the action wp_insert_post always directly follows the action save_post
   in the two places it occurs (both in \wp-includes\post.php)
    wp_insert_post()&
   wp_publish_post().
 * So without this fix you are effectively indexing twice and introducing a bug 
   as well.
 * Without this fix we get an infinite loop as stated in my given [link](http://wordpress.org/support/topic/plugin-wp-user-frontend-100s-of-duplicate-entries-on-single-submit-bug)
   as the expansion of the shortcode results in a recursive call.
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/bug-with-other-plugin-shortcodes/#post-3497366)
 * No, the line was added to cover some cases the save_post action didn’t cover.
   I was not aware it is essentially a duplicate. However, since that’s the case,
   I’ll remove the save_post hook right away.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Bug with other Plugin Shortcodes’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/bug-with-other-plugin-shortcodes/#post-3497366)
 * Status: resolved