BuddyDev

Search

[Resolved] Featured Member: time limit option

  • Participant
    Level: Enlightened
    Posts: 126
    Hervé on #16414

    Hi Brajesh,
    I am sorry.
    I installed the new version. Put new members to features
    Even 1 hour later, they are still displayed in the widget
    Other people tested ??
    Regards

    [23-Jul-2018 07:25:46 UTC] Erreur de la base de données WordPress You can't specify target table 'wpamo2_usermeta' for update in FROM clause pour la requête DELETE FROM wpamo2_usermeta WHERE ( meta_key='_is_featured' OR meta_key='_bpfm_featured_at_time' ) AND user_id IN ( SELECT user_id FROM wpamo2_usermeta WHERE meta_key = '_bpfm_featured_at_time'  AND CAST( meta_value AS UNSIGNED ) < 1532330686 ) faite par do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, BP_Featured_Member_Expirable_Membership->remove_featured
    [23-Jul-2018 07:29:47 UTC] Test toutes les 3 mn
    [23-Jul-2018 07:39:12 UTC] Test toutes les 3 mn
    [23-Jul-2018 07:40:56 UTC] Test toutes les 3 mn
    [23-Jul-2018 08:48:15 UTC] Test toutes les 3 mn
    [23-Jul-2018 08:48:16 UTC] Erreur de la base de données WordPress You can't specify target table 'wpamo2_usermeta' for update in FROM clause pour la requête DELETE FROM wpamo2_usermeta WHERE ( meta_key='_is_featured' OR meta_key='_bpfm_featured_at_time' ) AND user_id IN ( SELECT user_id FROM wpamo2_usermeta WHERE meta_key = '_bpfm_featured_at_time'  AND CAST( meta_value AS UNSIGNED ) < 1532335636 ) faite par do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, BP_Featured_Member_Expirable_Membership->remove_featured
    [23-Jul-2018 08:53:40 UTC] Test toutes les 3 mn
  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #16419

    Hi Herve,
    The log is still showing the old query.Are you sure you have used the updated version?

  • Participant
    Level: Enlightened
    Posts: 126
    Hervé on #16451

    Hi Brajesh,

    I reinstalled the plugin,
    clear the cache
    and waited a day
    the cron is activated,
    I put

    private function get_interval() {
    		return 7 *60 ;  // 7 days.DAY_IN_SECONDS
    	}

    I no longer have the message in the debug.log, but still no suppression !!
    No urgency but if other member can confirm

    Regards

    PHP Version 7.1.17
    MySQL Version 5.7.21

    [23-Jul-2018 20:40:48 UTC] Test toutes les 3 mn
    [24-Jul-2018 08:18:57 UTC] Test toutes les 3 mn
    [24-Jul-2018 08:25:48 UTC] Test toutes les 3 mn
    [24-Jul-2018 09:35:53 UTC] Test toutes les 3 mn
    [24-Jul-2018 10:42:53 UTC] Test toutes les 3 mn
    [24-Jul-2018 12:13:44 UTC] Test toutes les 3 mn
    [24-Jul-2018 12:17:08 UTC] Test toutes les 3 mn
  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #16483

    Hi Herve,
    I will do a re-test today and will get back to you.

    PS:- In future, If you do not want to wait for the cron to test, you can use the cron control to manually trigger and call the hooked function.

  • Participant
    Level: Enlightened
    Posts: 126
    Hervé on #16795

    Hi Brajesh,

    I just checked again. I think it works 🙂
    I put that

    
    private function get_interval() {
    		return 60 ;  
    	}
    

    After one hour, the display disappears. What does it take to display for a month?
    The problem stems (perhaps) from the frequency of the wordpress cron with this function.

    
    add_filter( 'cron_schedules', 'isa_add_every_three_minutes' );
    function isa_add_every_three_minutes( $schedules ) {
        $schedules['every_three_minutes'] = array(
                'interval'  => 180,
                'display'   => __( 'Every 3 Minutes', 'woffice' ) // ZZZZZZZ 3 minutes ??
        );
        return $schedules;
    }
    // Schedule an action if it's not already scheduled
    if ( ! wp_next_scheduled( 'isa_add_every_three_minutes' ) ) {
        wp_schedule_event( time(), 'every_three_minutes', 'isa_add_every_three_minutes' ); // {  wp_schedule_event( time(), 'hourly', 'my_task_hook' );
    }
    

    Regards

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #16802

    Hi Herve,
    Thank you.

    You can change

    
    return 60 ; 
    
    

    to

    
    return MONTH_IN_SECONDS
    
    

    I am not sure which coded added “isa_add_every_three_minutes” as it is not from ours.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 126
    Hervé on #16820

    Hi Brajesh,
    It works 🙂
    It did not work, wanting to test with my features with less than an hour
    Regards

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #16826

    Good to know that.
    I am glad it did finally 🙂

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved