403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/(Del)hsihk.com/wp-content/plugins/bruteprotect/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/(Del)hsihk.com/wp-content/plugins/bruteprotect/clear_transients.php
<?php
/*
Adapted from Purge Transients by Seebz
https://github.com/Seebz/Snippets/tree/master/Wordpress/plugins/purge-transients
*/

if ( !function_exists( 'bp_purge_transients' ) ) {
    function bp_purge_transients( $older_than = '1 day' )
    {
        global $wpdb;

        $older_than_time = strtotime( '-' . $older_than );
        if ( $older_than_time > time() || $older_than_time < 1 ) {
            return false;
        }

	    $sql =

        $sql = $wpdb->prepare( "
SELECT REPLACE(option_name, '_site_transient_timeout_brute_', '') AS transient_name
FROM {$wpdb->options}
WHERE option_name LIKE '\_site\_transient\_timeout\_brute\__%%'
AND option_value < %s
", $older_than_time );

        $transients = $wpdb->get_col( $sql );

        $options_names = array();

        foreach ( $transients as $transient ) {
            $options_names[ ] = '_site_transient_brute_' . $transient;
            $options_names[ ] = '_site_transient_timeout_brute_' . $transient;
        }

        if ( $options_names ) {
            $option_names_string = implode( ', ', array_fill( 0, count( $options_names ), '%s') );
	        $delete_sql = "DELETE FROM {$wpdb->options} WHERE option_name IN ($option_names_string)";

	        $delete_sql = call_user_func_array( array($wpdb, 'prepare'), array_merge( array( $delete_sql ), $options_names ) );

            $result = $wpdb->query( $delete_sql );
            if ( !$result ) {
                return false;
            }

        }

        return $transients;
    }
}


function bp_purge_transients_activation()
{
    if ( !wp_next_scheduled( 'bp_purge_transients_cron' ) ) {
        wp_schedule_event( time(), 'daily', 'bp_purge_transients_cron' );
    }
}

// register_activation_hook(__FILE__, 'bp_purge_transients_activation');
add_action( 'admin_init', 'bp_purge_transients_activation' );

function do_bp_purge_transients_cron()
{
    $o = bp_purge_transients();
}

add_action( 'bp_purge_transients_cron', 'do_bp_purge_transients_cron' );

Youez - 2016 - github.com/yon3zu
LinuXploit