Skip to:
Content
Pages
Categories
Search
Top
Bottom

After installing buddypress, google captcha is no longer displayed


  • btccvagmailcom
    Participant

    @btccvagmailcom

    After installing buddypress, google captcha is no longer displayed in comments form. Javascript scripts are not connected on the comments form page, although in the previous version (2.9.4) everything worked fine.

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

  • Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    Please go to BuddyPress settings (Settings->BuddyPress->Options) and then in ‘Template Pack’ option choose template legacy.

    Hopefully, it will fix the issue.

    Thanks


    btccvagmailcom
    Participant

    @btccvagmailcom

    Hi, Could you tell me which hooks can be used instead of bp_activity_entry_comments and bp_activity_before_save in the template pack: BuddyPress nouveau.
    Thank you so much.


    Prashant Singh
    Participant

    @prashantvatsh

    bp_nouveau_activity_hook( 'before', 'entry_comments' ); bp_nouveau_activity_hook( 'after', 'entry_comments' ); you can use any of them and they are in the file entry.php under activity folder. Also this bp_activity_before_save is still there and it do not depends on any template so you can go with this.

    Thanks


    btccvagmailcom
    Participant

    @btccvagmailcom

    Could you tell me please why Javascript scripts are not connected on the page of the comment form buddypress with template pack Nouveau? Can you advise something to solve this problem? Thanks


    Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    Can you please confirm which JS you are missing or if can explain which plugin or code you are using to implement captcha there?

    I think you are not able to get captcha working there now, right?

    Thanks


    btccvagmailcom
    Participant

    @btccvagmailcom

    That’s right, at the moment captcha is not working.

    if ( gglcptch_is_recaptcha_required( ‘buddypress_comments’, $is_user_logged_in ) ) {
    add_action( ‘bp_activity_entry_comments’, ‘gglcptch_buddypress_comments_display’ );
    if ( ! $gglcptch_ip_in_whitelist ) {
    add_action( ‘bp_activity_before_save’, ‘gglcptch_buddypress_comments_check’ );
    }
    }

    I call this function

    /* display google captcha in BuddyPress comments form */
    if ( ! function_exists( ‘gglcptch_buddypress_comments_display’ ) ) {
    function gglcptch_buddypress_comments_display() {
    printf( ‘<div class=”ac-reply-content ac-reply-content-gglcptch”>%s</div>’, gglcptch_display() );
    gglcptch_add_buddypress_script();
    }
    }

    Further, in the gglcptch_display () function, the scripts are registered and connected.

    wp_register_script( ‘gglcptch_api’, $api_url, $deps, $gglcptch_plugin_info[‘Version’], true );
    add_action( ‘wp_footer’, ‘gglcptch_add_scripts’ );

    in this place add_action (‘wp_footer’, ‘gglcptch_add_scripts’); the wp_footer hook does not work, control reaches it, but the hook does not work, and the function itself gglcptch_add_scripts () is not called. On the old template pack legacy, everything works well, and on the template pack nouveau, this bug manifests.


    Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    Please confirm if you are writing the function like this:

    add_action( 'wp_footer', 'gglcptch_add_scripts' );
    
    function gglcptch_add_scripts(){
    	wp_register_script( 'gglcptch_api', $api_url, $deps, $gglcptch_plugin_info['Version'], true );
    	wp_enqueue_script('gglcptch_api');
    }

    Thanks


    btccvagmailcom
    Participant

    @btccvagmailcom

    That’s right.


    Prashant Singh
    Participant

    @prashantvatsh

    And also are you sure that these variables are having values ‘$api_url, $deps’?
    Also, search in elements whether ‘gglcptch_api’ text appears there or not?


    btccvagmailcom
    Participant

    @btccvagmailcom

    I checked the script in xdebug in phpstorm, all the necessary scripts are registered, the variables have values, the only problem on the wp_footer hook is not the add_action function (‘wp_footer’, ‘gglcptch_add_scripts’); which connects scripts to the buddypress comment form page.
    Thanks.


    Prashant Singh
    Participant

    @prashantvatsh

    Have you tried ‘wp_enqueue_scripts’ in place of ‘wp_footer’?

    Also, check if there is any error in browser console.

    Thanks


    btccvagmailcom
    Participant

    @btccvagmailcom

    I installed the query monitor plugin, it does not give any errors. I also tried to replace wp_footer with wp_enqueue_scripts, unfortunately this did not help either.
    Thanks


    Prashant Singh
    Participant

    @prashantvatsh

    This is really strange because these are the hooks and ways to register and enqueue script. One last thing I can tell you is that just override entry.php and put script tag just after `bp_nouveau_activity_hook( ‘after’, ‘entry’ );
    `

    This is not the right way but we can do it to test.

    Thanks


    vegasslots
    Participant

    @vegasslots

    Hi Is Buddypress compatible with Blog2social? I’d like to use both on my Vegas Slots website.


    Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    For a new query please always post a new thread instead of writing in some other thread.

    Secondly, this plugin is for auto-posting blog posts so one can not share the BuddyPress activity with this. It may be possible but not without customization.

    If you want to use BuddyPress and want to share activity posts on social media or wants to let your members share activities you can use this plugin https://wordpress.org/plugins/bp-activity-social-share/ with BuddyPress.

    Thanks


    btccvagmailcom
    Participant

    @btccvagmailcom

    I checked the script in xdebug in phpstorm, all the necessary scripts are registered, the variables have values, the only problem on the wp_footer hook is not the add_action function (‘wp_footer’, ‘gglcptch_add_scripts’); which connects scripts to the buddypress comment form page.
    Thanks.

    Template pack nouveau displays a comment form using ajax. The function in which the necessary scripts are registered in the new template pack is called using ajax. In the old template pack legacy, the output of the comment form on the page was done without ajax. It seems to me that (js)scripts are not connected to the page for this reason. Please share your opinion on this. thank

Viewing 16 replies - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.
Skip to toolbar