wordpress/wp-content/themes/basic/themify/themify-config.php
/**
 * Clear legacy themify-ajax.php and strange files that might have been uploaded to or directories created in the uploads folder within the theme.
 * @since 1.6.3
 */
Clear legacy themify-ajax.php and strange files that might have been uploaded to or directories created in the uploads folder within the theme.
Clear legacy themify - ajax . php and strange files that might have been uploaded to or directories created in the uploads folder within the theme .
function themify_maybe_clear_legacy() {
	$flag = 'themify_clear_legacy';
	$clear = get_option( $flag );
	if ( empty( $clear )) {
		if ( ! function_exists( 'WP_Filesystem' ) ) {
			require_once( ABSPATH . 'wp-admin/includes/file.php' );
		}
		WP_Filesystem();
		global $wp_filesystem;
		$legacy = THEMIFY_DIR . '/themify-ajax.php';
		if ( $exists = $wp_filesystem->exists( $legacy ) ) {
			$wp_filesystem->delete( $legacy );
		}
		$list = $wp_filesystem->dirlist( THEME_DIR . '/uploads/', true, true );
		if ( is_array( $list ) ) {
			foreach ( $list as $item ) {
				if ( 'd' === $item['type'] ) {
					foreach ( $item['files'] as $subitem ) {
						if ( 'd' === $subitem['type'] ) {
							$del_dir = THEME_DIR . '/uploads/' . $item['name'] . '/' . $subitem['name'];
							$wp_filesystem->delete( $del_dir, true );
						} else {
							$extension = pathinfo( $subitem['name'], PATHINFO_EXTENSION );
							if ( ! in_array( $extension, array( 'jpg', 'gif', 'png', 'jpeg', 'bmp','webp','apng' ),true ) ) {
								$del_file = THEME_DIR . '/uploads/' . $item['name'] . '/' . $subitem['name'];
								$wp_filesystem->delete( $del_file );
							}
						}
					}
				} else {
					$extension = pathinfo( $item['name'], PATHINFO_EXTENSION );
					if ( ! in_array( $extension, array( 'jpg', 'gif', 'png', 'jpeg', 'bmp','webp','apng' ),true ) ) {
						$del_file = THEME_DIR . '/uploads/' . $item['name'];
						$wp_filesystem->delete( $del_file );
					}
				}
			}
		}
		update_option( $flag, true );
	}
}
function themify_maybe_clear_legacy ( ) { $ flag = 'themify_clear_legacy' ; $ clear = get_option ( $ flag ) ; if ( empty ( $ clear ) ) { if ( ! function_exists ( 'WP_Filesystem' ) ) { require_once ( ABSPATH . 'wp-admin/includes/file.php' ) ; } WP_Filesystem ( ) ; global $ wp_filesystem ; $ legacy = THEMIFY_DIR . '/themify-ajax.php' ; if ( $ exists = $ wp_filesystem -> exists ( $ legacy ) ) { $ wp_filesystem -> delete ( $ legacy ) ; } $ list = $ wp_filesystem -> dirlist ( THEME_DIR . '/uploads/' , true , true ) ; if ( is_array ( $ list ) ) { foreach ( $ list as $ item ) { if ( 'd' === $ item [ 'type' ] ) { foreach ( $ item [ 'files' ] as $ subitem ) { if ( 'd' === $ subitem [ 'type' ] ) { $ del_dir = THEME_DIR . '/uploads/' . $ item [ 'name' ] . '/' . $ subitem [ 'name' ] ; $ wp_filesystem -> delete ( $ del_dir , true ) ; } else { $ extension = pathinfo ( $ subitem [ 'name' ] , PATHINFO_EXTENSION ) ; if ( ! in_array ( $ extension , array ( 'jpg' , 'gif' , 'png' , 'jpeg' , 'bmp' , 'webp' , 'apng' ) , true ) ) { $ del_file = THEME_DIR . '/uploads/' . $ item [ 'name' ] . '/' . $ subitem [ 'name' ] ; $ wp_filesystem -> delete ( $ del_file ) ; } } } } else { $ extension = pathinfo ( $ item [ 'name' ] , PATHINFO_EXTENSION ) ; if ( ! in_array ( $ extension , array ( 'jpg' , 'gif' , 'png' , 'jpeg' , 'bmp' , 'webp' , 'apng' ) , true ) ) { $ del_file = THEME_DIR . '/uploads/' . $ item [ 'name' ] ; $ wp_filesystem -> delete ( $ del_file ) ; } } } } update_option ( $ flag , true ) ; } }
Clear legacy themify-ajax.php and strange files that might have been uploaded to or directories created in the uploads folder within the theme.
Clear legacy themify - ajax . php and strange files that might have been uploaded to or directories created in the uploads folder within the theme .
// There shouldn't be a directory here, let's delete it