| 1 |
<?php |
| 2 |
|
| 3 |
@ignore_user_abort( true ); |
| 4 |
@set_time_limit( 0 ); |
| 5 |
$mem = '512M'; |
| 6 |
@ini_set( 'memory_limit', $mem ); |
| 7 |
@ini_set( 'max_execution_time', 0 ); |
| 8 |
|
| 9 |
define( 'DOING_CRON', true ); |
| 10 |
$included = false; |
| 11 |
|
| 12 |
if ( file_exists( __DIR__ . '/../../../../wp-load.php' ) ) { |
| 13 |
include_once __DIR__ . '/../../../../wp-load.php'; |
| 14 |
$included = true; |
| 15 |
} else if ( file_exists( __DIR__ . '/../../../../wp-config.php' ) ) { |
| 16 |
$wp_config = file_get_contents( __DIR__ . '/../../../../wp-config.php' ); |
| 17 |
preg_match_all( '/.*define[^d].*ABSPATH.*/i', $wp_config, $matches ); |
| 18 |
if ( count( $matches ) > 0 ) { |
| 19 |
foreach ( $matches as $match ) { |
| 20 |
$execute = str_ireplace( 'ABSPATH', 'TMPABSPATH', $match[ 0 ] ); |
| 21 |
$execute = str_ireplace( '__FILE__', "'" . __DIR__ . '/../../../../wp-config.php' . "'", $execute ); |
| 22 |
eval( $execute ); |
| 23 |
if ( file_exists( TMPABSPATH . 'wp-load.php' ) ) { |
| 24 |
include_once TMPABSPATH . 'wp-load.php'; |
| 25 |
$included = true; |
| 26 |
break; |
| 27 |
} |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
if ( !$included ) { |
| 33 |
exit( 'Unsupported wordpress setup' ); |
| 34 |
} |