• Resolved teeboy4real

    (@teeboy4real)


    Hello,

    Please can you help confirm if this code are correct and safe to use

    // Schedule event to clean gamipress logs every 7 days
    if ( ! wp_next_scheduled( 'gamipress_clean_logs' ) ) {
        wp_schedule_event( time(), 'daily', 'gamipress_clean_logs' );
    }
    
    // Gamipress action to perform log cleaning
    function gamipress_clean_logs_daily() {
        gamipress_clean_logs( 7 );
    }
    add_action( 'gamipress_clean_logs', 'gamipress_clean_logs_daily' );

    And

    // Schedule event to clean user earnings logs every 7 days
    if ( ! wp_next_scheduled( 'gamipress_clean_user_earnings_logs' ) ) {
        wp_schedule_event( time(), 'daily', 'gamipress_clean_user_earnings_logs' );
    }
    
    // Action to perform user earnings log cleaning
    function clean_gamipress_user_earnings_logs_daily() {
        global $wpdb;
        $table_name = $wpdb->prefix . 'gamipress_user_earnings';
        $wpdb->query( "DELETE FROM $table_name WHERE date < DATE_SUB( NOW(), INTERVAL 7 DAY )" );
    }
    add_action( 'gamipress_clean_user_earnings_logs', 'clean_gamipress_user_earnings_logs_daily()' );

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Ruben Garcia

    (@rubengc)

    Hi @teeboy4real

    I’m sorry but we do not offer support for customizations like that since our main focus is the development and maintenance of GamiPress, AutomatorWP and all official add-ons.

    Anyway, any WordPress custom development agency or freelancer can handle it for you.

    If you do not know one, we recommend checking our list of trusted experts that can estimate any type of job for you here: https://gamipress.com/customizations/

Viewing 1 replies (of 1 total)
  • The topic ‘Help with gamipress logs’ is closed to new replies.