[resolved] Need a setting to turn off mentionData (7 posts)

  1. .sarah.
    Posted 2 years ago #

    Blogs with many (normally spam) users fall over on the mentionData line in js.php.

    It would be great to have a setting to make mentionData an option. In the meantime I've hardcoded it out with PHP comments.

  2. Thanks for the idea. I will suggest this enhancement to our developers to see if it's something they'd consider for a future version of the theme.

    Have you tried looking into a plugin to prevent all the spam registrations? Could be another way to tackle the issue.

  3. Vinicius Massuchetto
    Posted 2 years ago #

    You can try a filter to return only the relevant users -- the ones on latest posts and comments. I tried it and at least i could solve the mentionData size.


  4. Sarah - I just wanted to let you know that our developers said that making mentionData an option isn't a feature that's going to be added at this stage, since development efforts are currently going into the next generation of p2.

    If you'd like to be notified when it's available or are interested in beta testing, feel free to sign up here:


    Thanks again for the feedback.

  5. .sarah.
    Posted 2 years ago #

    Thanks Kathryn

    There's always a cutoff when a new version gets started and I appreciate your comment.

  6. joeymalek
    Posted 1 year ago #

    .Sarah could you show me (I am no coder) the way to filter off the mentiondata : " In the meantime I've hardcoded it out with PHP comments."

  7. .sarah.
    Posted 1 year ago #

    Sure thing joeymalek, it's not where you'd think it might be!

    open up wp-content/themes/p2/inc/js.php

    find line 250

    there are a whole stack of javascript variables being created and line 250 should read

    var mentionData = <?php echo json_encode($mentions->user_suggestion());

    I changed that to

    /* var mentionData = <?php echo json_encode($mentions->user_suggestion()); */
    var mentionData = false;

    The variable needs to be declared otherwise other scripts break, but false means there is no longer an overhead and your site will work. Visible if you view source over at itamer.com

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic