Feature #2 Hook CleanUp job to Statify cron action

This commit is contained in:
2016-08-25 20:19:28 +02:00
parent 0c9e63b7ee
commit f8ab4214de
3 changed files with 27 additions and 9 deletions

View File

@ -19,7 +19,7 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
public static function update_options( $options = null ) {
if ( isset( $options ) && current_user_can( 'manage_options' ) ) {
/* Sanitize URLs and remove empty inputs */
$givenReferer = $options['referer'];
$givenReferer = $options['referer'];
$sanitizedReferer = self::sanitizeURLs( $givenReferer );
/* Abort on errors */
@ -110,11 +110,11 @@ class StatifyBlacklist_Admin extends StatifyBlacklist {
* Filter database for cleanup.
*
* @since 1.1.0
* @changed 1.2.1
* @changed 1.2.0
*/
public static function cleanup_database() {
/* Check user permissions */
if ( ! current_user_can( 'manage_options' ) ) {
if ( ! current_user_can( 'manage_options' ) && ! ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
die( _e( 'Are you sure you want to do this?' ) );
}