0 ) { $message = 'success'; foreach ( $options[ 'blocking_files' ] as $k => $file ) { if ( !@unlink( $file ) ) $message = __( 'Some files could not be removed. Please remove them via FTP.', 'wordpress-seo' ); else unset( $options[ 'blocking_files' ][ $k ] ); } update_option( 'wpseo', $options ); } die( $message ); } add_action( 'wp_ajax_wpseo_kill_blocking_files', 'wpseo_kill_blocking_files' ); /** * Retrieve the suggestions from the Google Suggest API and return them to be * used in the suggest box within the plugin. Dies on exit. */ function wpseo_get_suggest() { check_ajax_referer( 'wpseo-get-suggest' ); $term = urlencode( $_GET[ 'term' ] ); $result = wp_remote_get( 'http://www.google.com/complete/search?output=toolbar&q=' . $term ); preg_match_all( '/suggestion data="([^"]+)"\/>/u', $result[ 'body' ], $matches ); $return_arr = array(); foreach ( $matches[ 1 ] as $match ) { $return_arr[ ] = html_entity_decode( $match, ENT_COMPAT, "UTF-8" ); } echo json_encode( $return_arr ); die(); } add_action( 'wp_ajax_wpseo_get_suggest', 'wpseo_get_suggest' );