Tagged: featured member
Thank you for the help Sanjay.
Yes, you are right, you can either put the file or the whole folder in wp-content/plugins and it will work. It is just like a normal plugin. You will need to activate it too. It uses cron to remove users on hourly basis.
Regards
BrajeshHi Herve,
1. Tried several variant:- 60 means 60 seconds but the cron job will only remove it after an hour(It checks hourly). Also, only newer members marked after you change the time will have the new time.So, change it to say 120( 2 minutes), Mark a user as featured member after the change and check after an hour.
DAY_IN_SECONDS is a constant that WordPress defines which is equivalent to 24*60*60( 86400) seconds.
That would be strange. Is there any chance that WordPress Cron is disabled by your web host?
Hi Brajesh,
It works well even if it’s not every 3 minutes
[16-Jul-2018 09:35:04 UTC] Test every 3 minutes
[16-Jul-2018 10:01:03 UTC] Test every 3 minutesadd_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' ) ); 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' ); } // Hook into that action that'll fire every three minutes add_action( 'isa_add_every_three_minutes', 'every_three_minutes_event_func' ); function every_three_minutes_event_func() { error_log("Test toutes les 3 mn"); }
Regards
Re
Perhaps interesting information:[16-Jul-2018 10:20:15 UTC] Test toutes les 3 mn [16-Jul-2018 10:59:47 UTC] Test toutes les 3 mn [16-Jul-2018 10:59:47 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 ) < 1531738727 ) faite par do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, BP_Featured_Member_Expirable_Membership->remove_featured
but then why only now !?
- This reply was modified 6 years, 5 months ago by Hervé.
Hi Herve,
It seems there is a problem with the sql. We might have to break it into 2 queries instead of one.I will push an update. I am not sure why it is showing now, It should have shown the error earlier too.
Hi Herve,
I have fixed the query. Please use the updated plugin.
https://github.com/buddydev/bp-featured-member-expirable-membershipRegard
Brajesh
You must be logged in to reply to this topic.