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