--- a/wp-admin/about.php
+++ b/wp-admin/about.php
@@ -45,6 +45,9 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
 
 		<div class="changelog point-releases">
 			<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
+			<p><?php printf( __( '<strong>Version %s</strong> addressed one security issue.' ), '4.8.3' ); ?>
+				<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.3' ); ?>
+			</p>
 			<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
 					'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 5 ), '4.8.2', number_format_i18n( 5 ) ); ?>
 				<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.2' ); ?>
--- a/wp-content/plugins/akismet/_inc/akismet.js
+++ b/wp-content/plugins/akismet/_inc/akismet.js
@@ -162,8 +162,14 @@ jQuery( function ( $ ) {
 	var recheck_count = 0;
 
 	function akismet_check_for_spam(offset, limit) {
+		var check_for_spam_buttons = $( '.checkforspam' );
+		
+		// We show the percentage complete down to one decimal point so even queues with 100k
+		// pending comments will show some progress pretty quickly.
+		var percentage_complete = Math.round( ( recheck_count / check_for_spam_buttons.data( 'pending-comment-count' ) ) * 1000 ) / 10;
+		
 		// Update the progress counter on the "Check for Spam" button.
-		$( '.checkforspam-progress' ).text( $( '.checkforspam' ).data( 'progress-label-format' ).replace( '%1$s', offset ) );
+		$( '.checkforspam-progress' ).text( check_for_spam_buttons.data( 'progress-label-format' ).replace( '%1$s', percentage_complete ) );
 
 		$.post(
 			ajaxurl,
@@ -177,7 +183,7 @@ jQuery( function ( $ ) {
 				spam_count += result.counts.spam;
 				
 				if (result.counts.processed < limit) {
-					window.location.href = $( '.checkforspam' ).data( 'success-url' ).replace( '__recheck_count__', recheck_count ).replace( '__spam_count__', spam_count );
+					window.location.href = check_for_spam_buttons.data( 'success-url' ).replace( '__recheck_count__', recheck_count ).replace( '__spam_count__', spam_count );
 				}
 				else {
 					// Account for comments that were caught as spam and moved out of the queue.
--- a/wp-content/plugins/akismet/akismet.php
+++ b/wp-content/plugins/akismet/akismet.php
@@ -6,7 +6,7 @@
 Plugin Name: Akismet Anti-Spam
 Plugin URI: https://akismet.com/
 Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
-Version: 3.3.4
+Version: 4.0
 Author: Automattic
 Author URI: https://automattic.com/wordpress-plugins/
 License: GPLv2 or later
@@ -37,8 +37,8 @@ if ( !function_exists( 'add_action' ) ) {
 	exit;
 }
 
-define( 'AKISMET_VERSION', '3.3.4' );
-define( 'AKISMET__MINIMUM_WP_VERSION', '3.7' );
+define( 'AKISMET_VERSION', '4.0' );
+define( 'AKISMET__MINIMUM_WP_VERSION', '4.0' );
 define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
 define( 'AKISMET_DELETE_LIMIT', 100000 );
 
@@ -47,9 +47,12 @@ register_deactivation_hook( __FILE__, array( 'Akismet', 'plugin_deactivation' )
 
 require_once( AKISMET__PLUGIN_DIR . 'class.akismet.php' );
 require_once( AKISMET__PLUGIN_DIR . 'class.akismet-widget.php' );
+require_once( AKISMET__PLUGIN_DIR . 'class.akismet-rest-api.php' );
 
 add_action( 'init', array( 'Akismet', 'init' ) );
 
+add_action( 'rest_api_init', array( 'Akismet_REST_API', 'init' ) );
+
 if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
 	require_once( AKISMET__PLUGIN_DIR . 'class.akismet-admin.php' );
 	add_action( 'init', array( 'Akismet_Admin', 'init' ) );
--- a/wp-content/plugins/akismet/class.akismet-admin.php
+++ b/wp-content/plugins/akismet/class.akismet-admin.php
@@ -91,12 +91,14 @@ class Akismet_Admin {
 	}
 
 	public static function load_menu() {
-		if ( class_exists( 'Jetpack' ) )
+		if ( class_exists( 'Jetpack' ) ) {
 			$hook = add_submenu_page( 'jetpack', __( 'Akismet' , 'akismet'), __( 'Akismet' , 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );
-		else
+		}
+		else {
 			$hook = add_options_page( __('Akismet', 'akismet'), __('Akismet', 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );
-
-		if ( version_compare( $GLOBALS['wp_version'], '3.3', '>=' ) ) {
+		}
+		
+		if ( $hook ) {
 			add_action( "load-$hook", array( 'Akismet_Admin', 'admin_help' ) );
 		}
 	}
@@ -248,8 +250,9 @@ class Akismet_Admin {
 	}
 
 	public static function enter_api_key() {
-		if ( function_exists('current_user_can') && !current_user_can('manage_options') )
-			die(__('Cheatin&#8217; uh?', 'akismet'));
+		if ( ! current_user_can( 'manage_options' ) ) {
+			die( __( 'Cheatin&#8217; uh?', 'akismet' ) );
+		}
 
 		if ( !wp_verify_nonce( $_POST['_wpnonce'], self::NONCE ) )
 			return false;
@@ -303,8 +306,9 @@ class Akismet_Admin {
 	}
 
 	public static function dashboard_stats() {
-		if ( !function_exists('did_action') || did_action( 'rightnow_end' ) )
+		if ( did_action( 'rightnow_end' ) ) {
 			return; // We already displayed this info in the "Right Now" section
+		}
 
 		if ( !$count = get_option('akismet_spam_count') )
 			return;
@@ -356,19 +360,19 @@ class Akismet_Admin {
 			return;
 		}
 
-		if ( function_exists('plugins_url') )
-			$link = add_query_arg( array( 'action' => 'akismet_recheck_queue' ), admin_url( 'admin.php' ) );
-		else
-			$link = add_query_arg( array( 'page' => 'akismet-admin', 'recheckqueue' => 'true', 'noheader' => 'true' ), admin_url( 'edit-comments.php' ) );
+		$link = add_query_arg( array( 'action' => 'akismet_recheck_queue' ), admin_url( 'admin.php' ) );
 
+		$comments_count = wp_count_comments();
+		
 		echo '</div>';
 		echo '<div class="alignleft">';
 		echo '<a
 				class="button-secondary checkforspam"
 				href="' . esc_url( $link ) . '"
 				data-active-label="' . esc_attr( __( 'Checking for Spam', 'akismet' ) ) . '"
-				data-progress-label-format="' . esc_attr( __( '(%1$s...)', 'akismet' ) ) . '"
+				data-progress-label-format="' . esc_attr( __( '(%1$s%)', 'akismet' ) ) . '"
 				data-success-url="' . esc_attr( remove_query_arg( 'akismet_recheck', add_query_arg( array( 'akismet_recheck_complete' => 1, 'recheck_count' => urlencode( '__recheck_count__' ), 'spam_count' => urlencode( '__spam_count__' ) ) ) ) ) . '"
+				data-pending-comment-count="' . esc_attr( $comments_count->moderated ) . '"
 				>';
 			echo '<span class="akismet-label">' . esc_html__('Check for Spam', 'akismet') . '</span>';
 			echo '<span class="checkforspam-progress"></span>';
@@ -467,11 +471,6 @@ class Akismet_Admin {
 	}
 
 	public static function comment_row_action( $a, $comment ) {
-
-		// failsafe for old WP versions
-		if ( !function_exists('add_comment_meta') )
-			return $a;
-
 		$akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );
 		$akismet_error  = get_comment_meta( $comment->comment_ID, 'akismet_error', true );
 		$user_result    = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
@@ -500,7 +499,7 @@ class Akismet_Admin {
 				$b[ $k ] = $item;
 				if (
 					$k == 'edit'
-					|| ( $k == 'unspam' && $GLOBALS['wp_version'] >= 3.4 )
+					|| $k == 'unspam'
 				) {
 					$b['history'] = '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="'. esc_attr__( 'View comment history' , 'akismet') . '"> '. esc_html__('History', 'akismet') . '</a>';
 				}
@@ -645,12 +644,8 @@ class Akismet_Admin {
 		if ( !$type ) { // total
 			$count = wp_cache_get( 'akismet_spam_count', 'widget' );
 			if ( false === $count ) {
-				if ( function_exists('wp_count_comments') ) {
-					$count = wp_count_comments();
-					$count = $count->spam;
-				} else {
-					$count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM {$wpdb->comments} WHERE comment_approved = 'spam'");
-				}
+				$count = wp_count_comments();
+				$count = $count->spam;
 				wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );
 			}
 			return $count;
@@ -706,7 +701,7 @@ class Akismet_Admin {
 			update_option('akismet_connectivity_time', time());
 		}
 
-		if ( function_exists( 'wp_http_supports' ) && ( wp_http_supports( array( 'ssl' ) ) ) ) {
+		if ( wp_http_supports( array( 'ssl' ) ) ) {
 			$response = wp_remote_get( 'https://rest.akismet.com/1.1/test' );
 		}
 		else {
--- /dev/null
+++ b/wp-content/plugins/akismet/class.akismet-rest-api.php
@@ -0,0 +1,271 @@
+<?php
+
+class Akismet_REST_API {
+	/**
+	 * Register the REST API routes.
+	 */
+	public static function init() {
+		if ( ! function_exists( 'register_rest_route' ) ) {
+			// The REST API wasn't integrated into core until 4.4, and we support 4.0+ (for now).
+			return false;
+		}
+
+		register_rest_route( 'akismet/v1', '/key', array(
+			array(
+				'methods' => WP_REST_Server::READABLE,
+				'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
+				'callback' => array( 'Akismet_REST_API', 'get_key' ),
+			), array(
+				'methods' => WP_REST_Server::EDITABLE,
+				'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
+				'callback' => array( 'Akismet_REST_API', 'set_key' ),
+				'args' => array(
+					'key' => array(
+						'required' => true,
+						'type' => 'string',
+						'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
+						'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
+					),
+				),
+			), array(
+				'methods' => WP_REST_Server::DELETABLE,
+				'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
+				'callback' => array( 'Akismet_REST_API', 'delete_key' ),
+			)
+		) );
+
+		register_rest_route( 'akismet/v1', '/settings/', array(
+			array(
+				'methods' => WP_REST_Server::READABLE,
+				'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
+				'callback' => array( 'Akismet_REST_API', 'get_settings' ),
+			),
+			array(
+				'methods' => WP_REST_Server::EDITABLE,
+				'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
+				'callback' => array( 'Akismet_REST_API', 'set_boolean_settings' ),
+				'args' => array(
+					'akismet_strictness' => array(
+						'required' => false,
+						'type' => 'boolean',
+						'description' => __( 'If true, Akismet will automatically discard the worst spam automatically rather than putting it in the spam folder.', 'akismet' ),
+					),
+					'akismet_show_user_comments_approved' => array(
+						'required' => false,
+						'type' => 'boolean',
+						'description' => __( 'If true, show the number of approved comments beside each comment author in the comments list page.', 'akismet' ),
+					),
+				),
+			)
+		) );
+
+		register_rest_route( 'akismet/v1', '/stats', array(
+			'methods' => WP_REST_Server::READABLE,
+			'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
+			'callback' => array( 'Akismet_REST_API', 'get_stats' ),
+			'args' => array(
+				'interval' => array(
+					'required' => false,
+					'type' => 'string',
+					'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_interval' ),
+					'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),
+					'default' => 'all',
+				),
+			),
+		) );
+
+		register_rest_route( 'akismet/v1', '/stats/(?P<interval>[\w+])', array(
+			'args' => array(
+				'interval' => array(
+					'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),
+					'type' => 'string',
+				),
+			),
+			array(
+				'methods' => WP_REST_Server::READABLE,
+				'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
+				'callback' => array( 'Akismet_REST_API', 'get_stats' ),
+			)
+		) );
+	}
+
+	/**
+	 * Get the current Akismet API key.
+	 *
+	 * @param WP_REST_Request $request
+	 * @return WP_Error|WP_REST_Response
+	 */
+	public static function get_key( $request = null ) {
+		return rest_ensure_response( Akismet::get_api_key() );
+	}
+
+	/**
+	 * Set the API key, if possible.
+	 *
+	 * @param WP_REST_Request $request
+	 * @return WP_Error|WP_REST_Response
+	 */
+	public static function set_key( $request ) {
+		if ( defined( 'WPCOM_API_KEY' ) ) {
+			return rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\'s API key is hardcoded and cannot be changed via the API.', 'akismet' ), array( 'status'=> 409 ) ) );
+		}
+
+		$new_api_key = $request->get_param( 'key' );
+
+		if ( ! self::key_is_valid( $new_api_key ) ) {
+			return rest_ensure_response( new WP_Error( 'invalid_key', __( 'The value provided is not a valid and registered API key.', 'akismet' ), array( 'status' => 400 ) ) );
+		}
+
+		update_option( 'wordpress_api_key', $new_api_key );
+
+		return self::get_key();
+	}
+
+	/**
+	 * Unset the API key, if possible.
+	 *
+	 * @param WP_REST_Request $request
+	 * @return WP_Error|WP_REST_Response
+	 */
+	public static function delete_key( $request ) {
+		if ( defined( 'WPCOM_API_KEY' ) ) {
+			return rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\'s API key is hardcoded and cannot be deleted.', 'akismet' ), array( 'status'=> 409 ) ) );
+		}
+
+		delete_option( 'wordpress_api_key' );
+
+		return rest_ensure_response( true );
+	}
+
+	/**
+	 * Get the Akismet settings.
+	 *
+	 * @param WP_REST_Request $request
+	 * @return WP_Error|WP_REST_Response
+	 */
+	public static function get_settings( $request = null ) {
+		return rest_ensure_response( array(
+			'akismet_strictness' => ( get_option( 'akismet_strictness', '1' ) === '1' ),
+			'akismet_show_user_comments_approved' => ( get_option( 'akismet_show_user_comments_approved', '1' ) === '1' ),
+		) );
+	}
+
+	/**
+	 * Update the Akismet settings.
+	 *
+	 * @param WP_REST_Request $request
+	 * @return WP_Error|WP_REST_Response
+	 */
+	public static function set_boolean_settings( $request ) {
+		foreach ( array(
+			'akismet_strictness',
+			'akismet_show_user_comments_approved',
+		) as $setting_key ) {
+
+			$setting_value = $request->get_param( $setting_key );
+			if ( is_null( $setting_value ) ) {
+				// This setting was not specified.
+				continue;
+			}
+
+			// From 4.7+, WP core will ensure that these are always boolean
+			// values because they are registered with 'type' => 'boolean',
+			// but we need to do this ourselves for prior versions.
+			$setting_value = Akismet_REST_API::parse_boolean( $setting_value );
+
+			update_option( $setting_key, $setting_value ? '1' : '0' );
+		}
+
+		return self::get_settings();
+	}
+
+	/**
+	 * Parse a numeric or string boolean value into a boolean.
+	 *
+	 * @param mixed $value The value to convert into a boolean.
+	 * @return bool The converted value.
+	 */
+	public static function parse_boolean( $value ) {
+		switch ( $value ) {
+			case true:
+			case 'true':
+			case '1':
+			case 1:
+				return true;
+
+			case false:
+			case 'false':
+			case '0':
+			case 0:
+				return false;
+
+			default:
+				return (bool) $value;
+		}
+	}
+
+	/**
+	 * Get the Akismet stats for a given time period.
+	 *
+	 * Possible `interval` values:
+	 * - all
+	 * - 60-days
+	 * - 6-months
+	 *
+	 * @param WP_REST_Request $request
+	 * @return WP_Error|WP_REST_Response
+	 */
+	public static function get_stats( $request ) {
+		$api_key = Akismet::get_api_key();
+
+		$interval = $request->get_param( 'interval' );
+
+		$stat_totals = array();
+
+		$response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
+
+		if ( ! empty( $response[1] ) ) {
+			$stat_totals[$interval] = json_decode( $response[1] );
+		}
+
+		return rest_ensure_response( $stat_totals );
+	}
+
+	private static function key_is_valid( $key ) {
+		$response = Akismet::http_post(
+			Akismet::build_query(
+				array(
+					'key' => $key,
+					'blog' => get_option( 'home' )
+				)
+			),
+			'verify-key'
+		);
+
+		if ( $response[1] == 'valid' ) {
+			return true;
+		}
+
+		return false;
+	}
+
+	public static function privileged_permission_callback() {
+		return current_user_can( 'manage_options' );
+	}
+
+	public static function sanitize_interval( $interval, $request, $param ) {
+		$interval = trim( $interval );
+
+		$valid_intervals = array( '60-days', '6-months', 'all', );
+
+		if ( ! in_array( $interval, $valid_intervals ) ) {
+			$interval = 'all';
+		}
+
+		return $interval;
+	}
+
+	public static function sanitize_key( $key, $request, $param ) {
+		return trim( $key );
+	}
+}
--- a/wp-content/plugins/akismet/class.akismet.php
+++ b/wp-content/plugins/akismet/class.akismet.php
@@ -10,7 +10,8 @@ class Akismet {
 	private static $prevent_moderation_email_for_these_comments = array();
 	private static $last_comment_result = null;
 	private static $comment_as_submitted_allowed_keys = array( 'blog' => '', 'blog_charset' => '', 'blog_lang' => '', 'blog_ua' => '', 'comment_agent' => '', 'comment_author' => '', 'comment_author_IP' => '', 'comment_author_email' => '', 'comment_author_url' => '', 'comment_content' => '', 'comment_date_gmt' => '', 'comment_tags' => '', 'comment_type' => '', 'guid' => '', 'is_test' => '', 'permalink' => '', 'reporter' => '', 'site_domain' => '', 'submit_referer' => '', 'submit_uri' => '', 'user_ID' => '', 'user_agent' => '', 'user_id' => '', 'user_ip' => '' );
-
+	private static $is_rest_api_call = false;
+	
 	public static function init() {
 		if ( ! self::$initiated ) {
 			self::init_hooks();
@@ -25,6 +26,8 @@ class Akismet {
 
 		add_action( 'wp_insert_comment', array( 'Akismet', 'auto_check_update_meta' ), 10, 2 );
 		add_filter( 'preprocess_comment', array( 'Akismet', 'auto_check_comment' ), 1 );
+		add_filter( 'rest_pre_insert_comment', array( 'Akismet', 'rest_auto_check_comment' ), 1 );
+
 		add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments' ) );
 		add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );
 		add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );
@@ -104,6 +107,12 @@ class Akismet {
 			self::verify_key( $value );
 		}
 	}
+	
+	public static function rest_auto_check_comment( $commentdata ) {
+		self::$is_rest_api_call = true;
+		
+		return self::auto_check_comment( $commentdata );
+	}
 
 	public static function auto_check_comment( $commentdata ) {
 		self::$last_comment_result = null;
@@ -190,14 +199,25 @@ class Akismet {
 			do_action( 'akismet_spam_caught', $discard );
 
 			if ( $discard ) {
+				// The spam is obvious, so we're bailing out early. 
 				// akismet_result_spam() won't be called so bump the counter here
-				if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
-					update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
-				// The spam is obvious, so we're bailing out early. Redirect back to the previous page,
-				// or failing that, the post permalink, or failing that, the homepage of the blog.
-				$redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ( $post ? get_permalink( $post ) : home_url() );
-				wp_safe_redirect( esc_url_raw( $redirect_to ) );
-				die();
+				if ( $incr = apply_filters( 'akismet_spam_count_incr', 1 ) ) {
+					update_option( 'akismet_spam_count', get_option( 'akismet_spam_count' ) + $incr );
+				}
+
+				if ( self::$is_rest_api_call ) {
+					return new WP_Error( 'akismet_rest_comment_discarded', __( 'Comment discarded.', 'akismet' ) );
+				}
+				else {
+					// Redirect back to the previous page, or failing that, the post permalink, or failing that, the homepage of the blog.
+					$redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ( $post ? get_permalink( $post ) : home_url() );
+					wp_safe_redirect( esc_url_raw( $redirect_to ) );
+					die();
+				}
+			}
+			else if ( self::$is_rest_api_call ) {
+				// The way the REST API structures its calls, we can set the comment_approved value right away.
+				$commentdata['comment_approved'] = 'spam';
 			}
 		}
 		
@@ -207,26 +227,20 @@ class Akismet {
 				// Comment status should be moderated
 				self::$last_comment_result = '0';
 			}
-			if ( function_exists('wp_next_scheduled') && function_exists('wp_schedule_single_event') ) {
-				if ( !wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
-					wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
-					do_action( 'akismet_scheduled_recheck', 'invalid-response-' . $response[1] );
-				}
+
+			if ( ! wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
+				wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
+				do_action( 'akismet_scheduled_recheck', 'invalid-response-' . $response[1] );
 			}
 
 			self::$prevent_moderation_email_for_these_comments[] = $commentdata;
 		}
 
-		if ( function_exists('wp_next_scheduled') && function_exists('wp_schedule_event') ) {
-			// WP 2.1+: delete old comments daily
-			if ( !wp_next_scheduled( 'akismet_scheduled_delete' ) )
-				wp_schedule_event( time(), 'daily', 'akismet_scheduled_delete' );
-		}
-		elseif ( (mt_rand(1, 10) == 3) ) {
-			// WP 2.0: run this one time in ten
-			self::delete_old_comments();
+		// Delete old comments daily
+		if ( ! wp_next_scheduled( 'akismet_scheduled_delete' ) ) {
+			wp_schedule_event( time(), 'daily', 'akismet_scheduled_delete' );
 		}
-		
+
 		self::set_last_comment( $commentdata );
 		self::fix_scheduled_recheck();
 
@@ -256,11 +270,6 @@ class Akismet {
 	// this fires on wp_insert_comment.  we can't update comment_meta when auto_check_comment() runs
 	// because we don't know the comment ID at that point.
 	public static function auto_check_update_meta( $id, $comment ) {
-
-		// failsafe for old WP versions
-		if ( !function_exists('add_comment_meta') )
-			return false;
-
 		// wp_insert_comment() might be called in other contexts, so make sure this is the same comment
 		// as was checked by auto_check_comment
 		if ( is_object( $comment ) && !empty( self::$last_comment ) && is_array( self::$last_comment ) ) {
@@ -398,11 +407,6 @@ class Akismet {
 
 	// get the full comment history for a given comment, as an array in reverse chronological order
 	public static function get_comment_history( $comment_id ) {
-
-		// failsafe for old WP versions
-		if ( !function_exists('add_comment_meta') )
-			return false;
-
 		$history = get_comment_meta( $comment_id, 'akismet_history', false );
 		usort( $history, array( 'Akismet', '_cmp_time' ) );
 		return $history;
@@ -419,10 +423,6 @@ class Akismet {
 	public static function update_comment_history( $comment_id, $message, $event=null, $meta=null ) {
 		global $current_user;
 
-		// failsafe for old WP versions
-		if ( !function_exists('add_comment_meta') )
-			return false;
-
 		$user = '';
 
 		$event = array(
@@ -1024,7 +1024,7 @@ class Akismet {
 			do_action( 'akismet_ssl_disabled' );
 		}
 
-		if ( ! $ssl_disabled && function_exists( 'wp_http_supports') && ( $ssl = wp_http_supports( array( 'ssl' ) ) ) ) {
+		if ( ! $ssl_disabled && ( $ssl = wp_http_supports( array( 'ssl' ) ) ) ) {
 			$akismet_url = set_url_scheme( $akismet_url, 'https' );
 
 			do_action( 'akismet_https_request_pre' );
--- a/wp-content/plugins/akismet/readme.txt
+++ b/wp-content/plugins/akismet/readme.txt
@@ -1,9 +1,9 @@
 === Akismet ===
 Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
 Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
-Requires at least: 3.7
+Requires at least: 4.0
 Tested up to: 4.8.1
-Stable tag: 3.3.4
+Stable tag: 4.0
 License: GPLv2 or later
 
 Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content.
@@ -30,7 +30,16 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
 
 == Changelog ==
 
+= 4.0 =
+*Release Date - 19 September 2017*
+
+* Added REST API endpoints for configuring Akismet and retrieving stats.
+* Increased the minimum supported WordPress version to 4.0.
+* Added compatibility with comments submitted via the REST API.
+* Improved the progress indicator on the "Check for Spam" button.
+
 = 3.3.4 =
+*Release Date - 3 August 2017*
 
 * Disabled Akismet's debug log output by default unless AKISMET_DEBUG is defined.
 * URL previews now begin preloading when the mouse moves near them in the comments section of wp-admin.
--- a/wp-content/plugins/akismet/views/config.php
+++ b/wp-content/plugins/akismet/views/config.php
@@ -82,10 +82,7 @@
 											<p>
 												<?php
 
-												if ( ! function_exists( 'wp_http_supports' ) ) {
-													?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
-												}
-												else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
+												if ( ! wp_http_supports( array( 'ssl' ) ) ) {
 													?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?><?php
 												}
 												else {
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -3738,6 +3738,11 @@ function _deep_replace( $search, $subject ) {
  * Sometimes, spot-escaping is required or useful. One example
  * is preparing an array for use in an IN clause.
  *
+ * NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string,
+ * this prevents certain SQLi attacks from taking place. This change in behaviour
+ * may cause issues for code that expects the return value of esc_sql() to be useable
+ * for other purposes.
+ *
  * @since 2.8.0
  *
  * @global wpdb $wpdb WordPress database abstraction object.
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -4246,10 +4246,10 @@ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) {
 	$page_path = str_replace('%2F', '/', $page_path);
 	$page_path = str_replace('%20', ' ', $page_path);
 	$parts = explode( '/', trim( $page_path, '/' ) );
-	$parts = esc_sql( $parts );
 	$parts = array_map( 'sanitize_title_for_query', $parts );
+	$escaped_parts = esc_sql( $parts );
 
-	$in_string = "'" . implode( "','", $parts ) . "'";
+	$in_string = "'" . implode( "','", $escaped_parts ) . "'";
 
 	if ( is_array( $post_type ) ) {
 		$post_types = $post_type;
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '4.8.2';
+$wp_version = '4.8.3';
 
 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -1168,20 +1168,22 @@ class wpdb {
 	function _real_escape( $string ) {
 		if ( $this->dbh ) {
 			if ( $this->use_mysqli ) {
-				return mysqli_real_escape_string( $this->dbh, $string );
+				$escaped = mysqli_real_escape_string( $this->dbh, $string );
 			} else {
-				return mysql_real_escape_string( $string, $this->dbh );
+				$escaped = mysql_real_escape_string( $string, $this->dbh );
 			}
-		}
-
-		$class = get_class( $this );
-		if ( function_exists( '__' ) ) {
-			/* translators: %s: database access abstraction class, usually wpdb or a class extending wpdb */
-			_doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' );
 		} else {
-			_doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), '3.6.0' );
+			$class = get_class( $this );
+			if ( function_exists( '__' ) ) {
+				/* translators: %s: database access abstraction class, usually wpdb or a class extending wpdb */
+				_doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' );
+			} else {
+				_doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), '3.6.0' );
+			}
+			$escaped = addslashes( $string );
 		}
-		return addslashes( $string );
+
+		return $this->add_placeholder_escape( $escaped );
 	}
 
 	/**
@@ -1257,67 +1259,120 @@ class wpdb {
 	/**
 	 * Prepares a SQL query for safe execution. Uses sprintf()-like syntax.
 	 *
-	 * The following directives can be used in the query format string:
+	 * The following placeholders can be used in the query string:
 	 *   %d (integer)
 	 *   %f (float)
 	 *   %s (string)
-	 *   %% (literal percentage sign - no argument needed)
 	 *
-	 * All of %d, %f, and %s are to be left unquoted in the query string and they need an argument passed for them.
-	 * Literals (%) as parts of the query must be properly written as %%.
+	 * All placeholders MUST be left unquoted in the query string. A corresponding argument MUST be passed for each placeholder.
 	 *
-	 * This function only supports a small subset of the sprintf syntax; it only supports %d (integer), %f (float), and %s (string).
-	 * Does not support sign, padding, alignment, width or precision specifiers.
-	 * Does not support argument numbering/swapping.
+	 * For compatibility with old behavior, numbered or formatted string placeholders (eg, %1$s, %5s) will not have quotes
+	 * added by this function, so should be passed with appropriate quotes around them for your usage.
 	 *
-	 * May be called like {@link https://secure.php.net/sprintf sprintf()} or like {@link https://secure.php.net/vsprintf vsprintf()}.
+	 * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards (for example,
+	 * to use in LIKE syntax) must be passed via a substitution argument containing the complete LIKE string, these
+	 * cannot be inserted directly in the query string. Also see {@see esc_like()}.
 	 *
-	 * Both %d and %s should be left unquoted in the query string.
+	 * Arguments may be passed as individual arguments to the method, or as a single array containing all arguments. A combination
+	 * of the two is not supported.
 	 *
-	 *     $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 );
+	 * Examples:
+	 *     $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d OR `other_field` LIKE %s", array( 'foo', 1337, '%bar' ) );
 	 *     $wpdb->prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
 	 *
 	 * @link https://secure.php.net/sprintf Description of syntax.
 	 * @since 2.3.0
 	 *
 	 * @param string      $query    Query statement with sprintf()-like placeholders
-	 * @param array|mixed $args     The array of variables to substitute into the query's placeholders if being called like
-	 *                              {@link https://secure.php.net/vsprintf vsprintf()}, or the first variable to substitute into the query's placeholders if
-	 *                              being called like {@link https://secure.php.net/sprintf sprintf()}.
-	 * @param mixed       $args,... further variables to substitute into the query's placeholders if being called like
-	 *                              {@link https://secure.php.net/sprintf sprintf()}.
+	 * @param array|mixed $args     The array of variables to substitute into the query's placeholders if being called with an array of arguments,
+	 *                              or the first variable to substitute into the query's placeholders if being called with individual arguments.
+	 * @param mixed       $args,... further variables to substitute into the query's placeholders if being called wih individual arguments.
 	 * @return string|void Sanitized query string, if there is a query to prepare.
 	 */
 	public function prepare( $query, $args ) {
-		if ( is_null( $query ) )
+		if ( is_null( $query ) ) {
 			return;
+		}
 
 		// This is not meant to be foolproof -- but it will catch obviously incorrect usage.
 		if ( strpos( $query, '%' ) === false ) {
+			wp_load_translations_early();
 			_doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s must have a placeholder.' ), 'wpdb::prepare()' ), '3.9.0' );
 		}
 
 		$args = func_get_args();
 		array_shift( $args );
 
-		// If args were passed as an array (as in vsprintf), move them up
+		// If args were passed as an array (as in vsprintf), move them up.
+		$passed_as_array = false;
 		if ( is_array( $args[0] ) && count( $args ) == 1 ) {
+			$passed_as_array = true;
 			$args = $args[0];
 		}
 
 		foreach ( $args as $arg ) {
 			if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) {
-				_doing_it_wrong( 'wpdb::prepare', sprintf( 'Unsupported value type (%s).', gettype( $arg ) ), '4.8.2' );
+				wp_load_translations_early();
+				_doing_it_wrong( 'wpdb::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' );
+			}
+		}
+
+		/*
+		 * Specify the formatting allowed in a placeholder. The following are allowed:
+		 *
+		 * - Sign specifier. eg, $+d
+		 * - Numbered placeholders. eg, %1$s
+		 * - Padding specifier, including custom padding characters. eg, %05s, %'#5s
+		 * - Alignment specifier. eg, %05-s
+		 * - Precision specifier. eg, %.2f
+		 */
+		$allowed_format = '(?:[1-9][0-9]*[$])?[-+0-9]*(?: |0|\'.)?[-+0-9]*(?:\.[0-9]+)?';
+
+		/*
+		 * If a %s placeholder already has quotes around it, removing the existing quotes and re-inserting them
+		 * ensures the quotes are consistent.
+		 *
+		 * For backwards compatibility, this is only applied to %s, and not to placeholders like %1$s, which are frequently
+		 * used in the middle of longer strings, or as table name placeholders.
+		 */
+		$query = str_replace( "'%s'", '%s', $query ); // Strip any existing single quotes.
+		$query = str_replace( '"%s"', '%s', $query ); // Strip any existing double quotes.
+		$query = preg_replace( '/(?<!%)%s/', "'%s'", $query ); // Quote the strings, avoiding escaped strings like %%s.
+
+		$query = preg_replace( "/(?<!%)(%($allowed_format)?f)/" , '%\\2F', $query ); // Force floats to be locale unaware.
+
+		$query = preg_replace( "/%(?:%|$|(?!($allowed_format)?[sdF]))/", '%%\\1', $query ); // Escape any unescaped percents.
+
+		// Count the number of valid placeholders in the query.
+		$placeholders = preg_match_all( "/(^|[^%]|(%%)+)%($allowed_format)?[sdF]/", $query, $matches );
+
+		if ( count( $args ) !== $placeholders ) {
+			if ( 1 === $placeholders && $passed_as_array ) {
+				// If the passed query only expected one argument, but the wrong number of arguments were sent as an array, bail.
+				wp_load_translations_early();
+				_doing_it_wrong( 'wpdb::prepare', __( 'The query only expected one placeholder, but an array of multiple placeholders was sent.' ), '4.9.0' );
+
+				return;
+			} else {
+				/*
+				 * If we don't have the right number of placeholders, but they were passed as individual arguments,
+				 * or we were expecting multiple arguments in an array, throw a warning.
+				 */
+				wp_load_translations_early();
+				_doing_it_wrong( 'wpdb::prepare',
+					/* translators: 1: number of placeholders, 2: number of arguments passed */
+					sprintf( __( 'The query does not contain the correct number of placeholders (%1$d) for the number of arguments passed (%2$d).' ),
+						$placeholders,
+						count( $args ) ),
+					'4.8.3'
+				);
 			}
 		}
 
-		$query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
-		$query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
-		$query = preg_replace( '|(?<!%)%f|' , '%F', $query ); // Force floats to be locale unaware
-		$query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
-		$query = preg_replace( '/%(?:%|$|([^dsF]))/', '%%\\1', $query ); // escape any unescaped percents 
 		array_walk( $args, array( $this, 'escape_by_ref' ) );
-		return @vsprintf( $query, $args );
+		$query = @vsprintf( $query, $args );
+
+		return $this->add_placeholder_escape( $query );
 	}
 
 	/**
@@ -1895,6 +1950,64 @@ class wpdb {
 		}
 	}
 
+	/**
+	 * Generates and returns a placeholder escape string for use in queries returned by ::prepare().
+	 *
+	 * @since 4.8.3
+	 *
+	 * @return string String to escape placeholders.
+	 */
+	public function placeholder_escape() {
+		static $placeholder;
+
+		if ( ! $placeholder ) {
+			// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
+			$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
+			// Old WP installs may not have AUTH_SALT defined.
+			$salt = defined( 'AUTH_SALT' ) ? AUTH_SALT : rand();
+
+			$placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}';
+		}
+
+		/*
+		 * Add the filter to remove the placeholder escaper. Uses priority 0, so that anything
+		 * else attached to this filter will recieve the query with the placeholder string removed.
+		 */
+		if ( ! has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) {
+			add_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 );
+		}
+
+		return $placeholder;
+	}
+
+	/**
+	 * Adds a placeholder escape string, to escape anything that resembles a printf() placeholder.
+	 *
+	 * @since 4.8.3
+	 *
+	 * @param string $query The query to escape.
+	 * @return string The query with the placeholder escape string inserted where necessary.
+	 */
+	public function add_placeholder_escape( $query ) {
+		/*
+		 * To prevent returning anything that even vaguely resembles a placeholder,
+		 * we clobber every % we can find.
+		 */
+		return str_replace( '%', $this->placeholder_escape(), $query );
+	}
+
+	/**
+	 * Removes the placeholder escape strings from a query.
+	 *
+	 * @since 4.8.3
+	 *
+	 * @param string $query The query from which the placeholder will be removed.
+	 * @return string The query with the placeholder removed.
+	 */
+	public function remove_placeholder_escape( $query ) {
+		return str_replace( $this->placeholder_escape(), '%', $query );
+	}
+
 	/**
 	 * Insert a row into a table.
 	 *
