WordPress.org

Forums

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

  1. .sarah.
    Member
    Posted 1 year 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. Kathryn
    Automattic Happiness Engineer
    Posted 11 months ago #

    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
    Member
    Posted 11 months 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.

    https://github.com/wpbrasil/wpbr-participe/commit/c25871ad77ae6637c7e2ee801d8722fff344a845#diff-78cd5aa3783a74555c9938a2a81d01c6R18

  4. Kathryn
    Automattic Happiness Engineer
    Posted 11 months ago #

    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:

    http://geto2.com/

    Thanks again for the feedback.

  5. .sarah.
    Member
    Posted 11 months ago #

    Thanks Kathryn

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

  6. joeymalek
    Member
    Posted 10 months 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."
    Thanks.

  7. .sarah.
    Member
    Posted 10 months 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