Commit 1f9521b8 authored by lucha's avatar lucha

Wordpress version 4.7.3

parent 9fb40cb1
......@@ -45,6 +45,10 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<div class="changelog point-releases">
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
<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.', 39 ), '4.7.3', number_format_i18n( 39 ) ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.7.3' ); ?>
</p>
<p><?php printf( __( '<strong>Version %s</strong> addressed some security issues.' ), '4.7.2' ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.7.2' ); ?>
</p>
......@@ -89,8 +93,6 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
echo wp_video_shortcode( array(
'mp4' => 'https://s.w.org/images/core/4.7/starter-content-v1.mp4',
'poster' => 'https://s.w.org/images/core/4.7/starter-content.jpg?v2',
'loop' => true,
'autoplay' => true,
'width' => 1140,
'height' => 624,
// 'class' => 'wp-video-shortcode feature-video',
......@@ -106,8 +108,6 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
echo wp_video_shortcode( array(
'mp4' => 'https://s.w.org/images/core/4.7/edit-shortcuts-v1.mp4',
'poster' => 'https://s.w.org/images/core/4.7/edit-shortcuts.jpg?v2',
'loop' => true,
'autoplay' => true,
'width' => 2520,
'height' => 1454,
// 'class' => 'wp-video-shortcode feature-video',
......@@ -121,8 +121,6 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
echo wp_video_shortcode( array(
'mp4' => 'https://s.w.org/images/core/4.7/header-video-v1.mp4',
'poster' => 'https://s.w.org/images/core/4.7/header-video.jpg?v2',
'loop' => true,
'autoplay' => true,
'width' => 2520,
'height' => 1454,
// 'class' => 'wp-video-shortcode feature-video',
......
......@@ -718,7 +718,11 @@ class WP_Press_This {
* making PT fully backward compatible with the older bookmarklet.
*/
if ( empty( $_POST ) && ! empty( $data['u'] ) ) {
$data = $this->source_data_fetch_fallback( $data['u'], $data );
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'scan-site' ) ) {
$data = $this->source_data_fetch_fallback( $data['u'], $data );
} else {
$data['errors'] = 'missing nonce';
}
} else {
foreach ( array( '_images', '_embeds' ) as $type ) {
if ( empty( $_POST[ $type ] ) ) {
......@@ -1235,7 +1239,7 @@ class WP_Press_This {
$site_data = array(
'v' => ! empty( $data['v'] ) ? $data['v'] : '',
'u' => ! empty( $data['u'] ) ? $data['u'] : '',
'hasData' => ! empty( $data ),
'hasData' => ! empty( $data ) && ! isset( $data['errors'] ),
);
if ( ! empty( $images ) ) {
......@@ -1367,8 +1371,9 @@ class WP_Press_This {
<div id="scanbar" class="scan">
<form method="GET">
<label for="url-scan" class="screen-reader-text"><?php _e( 'Scan site for content' ); ?></label>
<input type="url" name="u" id="url-scan" class="scan-url" value="" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" />
<input type="url" name="u" id="url-scan" class="scan-url" value="<?php echo esc_attr( $site_data['u'] ) ?>" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" />
<input type="submit" name="url-scan-submit" id="url-scan-submit" class="scan-submit" value="<?php esc_attr_e( 'Scan' ) ?>" />
<?php wp_nonce_field( 'scan-site' ); ?>
</form>
</div>
......
......@@ -251,7 +251,15 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
$editor = wp_get_image_editor( $file );
if ( ! is_wp_error( $editor ) ) { // No support for this type of file
$uploaded = $editor->save( $file, 'image/jpeg' );
/*
* PDFs may have the same file filename as JPEGs.
* Ensure the PDF preview image does not overwrite any JPEG images that already exist.
*/
$dirname = dirname( $file ) . '/';
$ext = '.' . pathinfo( $file, PATHINFO_EXTENSION );
$preview_file = $dirname . wp_unique_filename( $dirname, wp_basename( $file, $ext ) . '-pdf.jpg' );
$uploaded = $editor->save( $preview_file, 'image/jpeg' );
unset( $editor );
// Resize based on the full size image, rather than the source.
......
......@@ -3072,6 +3072,8 @@ function wp_read_video_metadata( $file ) {
wp_add_id3_tag_data( $metadata, $data );
$metadata = wp_kses_post_deep( $metadata );
return $metadata;
}
......@@ -3117,6 +3119,8 @@ function wp_read_audio_metadata( $file ) {
wp_add_id3_tag_data( $metadata, $data );
$metadata = wp_kses_post_deep( $metadata );
return $metadata;
}
......
......@@ -418,7 +418,7 @@ $document.ready( function() {
screenMeta.init();
// This event needs to be delegated. Ticket #37973.
$body.on( 'click', 'tbody .check-column :checkbox', function( event ) {
$body.on( 'click', 'tbody > .check-column :checkbox', function( event ) {
// Shift click to select a range of checkboxes.
if ( 'undefined' == event.shiftKey ) { return true; }
if ( event.shiftKey ) {
......
This diff is collapsed.
......@@ -4696,7 +4696,10 @@
editShortcutVisibility( 'visible' );
api.bind( 'change', function() {
state('saved').set( false );
if ( state( 'saved' ).get() ) {
state( 'saved' ).set( false );
populateChangesetUuidParam( true );
}
});
saving.bind( function( isSaving ) {
......
This diff is collapsed.
......@@ -1509,22 +1509,29 @@
* Update item handle title when changed.
*/
_setupTitleUI: function() {
var control = this;
var control = this, titleEl;
// Ensure that whitespace is trimmed on blur so placeholder can be shown.
control.container.find( '.edit-menu-item-title' ).on( 'blur', function() {
$( this ).val( $.trim( $( this ).val() ) );
} );
titleEl = control.container.find( '.menu-item-title' );
control.setting.bind( function( item ) {
var trimmedTitle, titleText;
if ( ! item ) {
return;
}
trimmedTitle = $.trim( item.title );
var titleEl = control.container.find( '.menu-item-title' ),
titleText = item.title || item.original_title || api.Menus.data.l10n.untitled;
titleText = trimmedTitle || item.original_title || api.Menus.data.l10n.untitled;
if ( item._invalid ) {
titleText = api.Menus.data.l10n.invalidTitleTpl.replace( '%s', titleText );
}
// Don't update to an empty title.
if ( item.title || item.original_title ) {
if ( trimmedTitle || item.original_title ) {
titleEl
.text( titleText )
.removeClass( 'no-title' );
......
This diff is collapsed.
......@@ -118,7 +118,7 @@
// Replace paragraphs with double line breaks
function removep( html ) {
var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset',
var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure',
blocklist1 = blocklist + '|div|p',
blocklist2 = blocklist + '|pre',
preserve_linebreaks = false,
......@@ -257,6 +257,11 @@
});
}
if ( text.indexOf( '<figcaption' ) !== -1 ) {
text = text.replace( /\s*(<figcaption[^>]*>)/g, '$1' );
text = text.replace( /<\/figcaption>\s*/g, '</figcaption>' );
}
// keep <br> tags inside captions and convert line breaks
if ( text.indexOf( '[caption' ) !== -1 ) {
preserve_br = true;
......
This diff is collapsed.
......@@ -92,7 +92,7 @@ var tagBox, array_unique_noempty;
*/
xbutton = $( '<button type="button" id="' + id + '-check-num-' + key + '" class="ntdelbutton">' +
'<span class="remove-tag-icon" aria-hidden="true"></span>' +
'<span class="screen-reader-text">' + window.tagsSuggestL10n.removeTerm + ' ' + val + '</span>' +
'<span class="screen-reader-text">' + window.tagsSuggestL10n.removeTerm + ' ' + span.html() + '</span>' +
'</button>' );
xbutton.on( 'click keypress', function( e ) {
......
var tagBox,array_unique_noempty;!function(a){var b=window.tagsSuggestL10n&&window.tagsSuggestL10n.tagDelimiter||",";array_unique_noempty=function(b){var c=[];return a.each(b,function(b,d){d=a.trim(d),d&&a.inArray(d,c)===-1&&c.push(d)}),c},tagBox={clean:function(a){return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(c){var d=c.id,e=d.split("-check-num-")[1],f=a(c).closest(".tagsdiv"),g=f.find(".the-tags"),h=g.val().split(b),i=[];return delete h[e],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),g.val(this.clean(i.join(b))),this.quickClicks(f),!1},quickClicks:function(c){var d,e,f=a(".the-tags",c),g=a(".tagchecklist",c),h=a(c).attr("id");f.length&&(e=f.prop("disabled"),d=f.val().split(b),g.empty(),a.each(d,function(b,c){var d,f;c=a.trim(c),c&&(d=a("<span />").text(c),e||(f=a('<button type="button" id="'+h+"-check-num-"+b+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+window.tagsSuggestL10n.removeTerm+" "+c+"</span></button>"),f.on("click keypress",function(b){"click"!==b.type&&13!==b.keyCode&&32!==b.keyCode||(13!==b.keyCode&&32!==b.keyCode||a(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.userAction="remove",tagBox.parseTags(this))}),d.prepend("&nbsp;").prepend(f)),g.append(d))}),tagBox.screenReadersMessage())},flushTags:function(c,d,e){var f,g,h,i=a(".the-tags",c),j=a("input.newtag",c);return d=d||!1,h=d?a(d).text():j.val(),"undefined"!=typeof h&&""!==h&&(f=i.val(),g=f?f+b+h:h,g=this.clean(g),g=array_unique_noempty(g.split(b)).join(b),i.val(g),this.quickClicks(c),d||j.val(""),"undefined"==typeof e&&j.focus(),!1)},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){0!==d&&"success"==e&&(d=a('<p id="tagcloud-'+c+'" class="the-tagcloud">'+d+"</p>"),a("a",d).click(function(){return tagBox.userAction="add",tagBox.flushTags(a("#"+c),this),!1}),a("#"+b).after(d))})},userAction:"",screenReadersMessage:function(){var a;switch(this.userAction){case"remove":a=window.tagsSuggestL10n.termRemoved;break;case"add":a=window.tagsSuggestL10n.termAdded;break;default:return}window.wp.a11y.speak(a,"assertive")},init:function(){var b=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a(".tagadd",b).click(function(){tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv"))}),a("input.newtag",b).keyup(function(b){13==b.which&&(tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv")),b.preventDefault(),b.stopPropagation())}).keypress(function(a){13==a.which&&(a.preventDefault(),a.stopPropagation())}).each(function(b,c){a(c).wpTagsSuggest()}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a(".tagcloud-link").click(function(){tagBox.get(a(this).attr("id")),a(this).attr("aria-expanded","true").unbind().click(function(){a(this).attr("aria-expanded","false"===a(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery);
\ No newline at end of file
var tagBox,array_unique_noempty;!function(a){var b=window.tagsSuggestL10n&&window.tagsSuggestL10n.tagDelimiter||",";array_unique_noempty=function(b){var c=[];return a.each(b,function(b,d){d=a.trim(d),d&&a.inArray(d,c)===-1&&c.push(d)}),c},tagBox={clean:function(a){return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(c){var d=c.id,e=d.split("-check-num-")[1],f=a(c).closest(".tagsdiv"),g=f.find(".the-tags"),h=g.val().split(b),i=[];return delete h[e],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),g.val(this.clean(i.join(b))),this.quickClicks(f),!1},quickClicks:function(c){var d,e,f=a(".the-tags",c),g=a(".tagchecklist",c),h=a(c).attr("id");f.length&&(e=f.prop("disabled"),d=f.val().split(b),g.empty(),a.each(d,function(b,c){var d,f;c=a.trim(c),c&&(d=a("<span />").text(c),e||(f=a('<button type="button" id="'+h+"-check-num-"+b+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+window.tagsSuggestL10n.removeTerm+" "+d.html()+"</span></button>"),f.on("click keypress",function(b){"click"!==b.type&&13!==b.keyCode&&32!==b.keyCode||(13!==b.keyCode&&32!==b.keyCode||a(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.userAction="remove",tagBox.parseTags(this))}),d.prepend("&nbsp;").prepend(f)),g.append(d))}),tagBox.screenReadersMessage())},flushTags:function(c,d,e){var f,g,h,i=a(".the-tags",c),j=a("input.newtag",c);return d=d||!1,h=d?a(d).text():j.val(),"undefined"!=typeof h&&""!==h&&(f=i.val(),g=f?f+b+h:h,g=this.clean(g),g=array_unique_noempty(g.split(b)).join(b),i.val(g),this.quickClicks(c),d||j.val(""),"undefined"==typeof e&&j.focus(),!1)},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){0!==d&&"success"==e&&(d=a('<p id="tagcloud-'+c+'" class="the-tagcloud">'+d+"</p>"),a("a",d).click(function(){return tagBox.userAction="add",tagBox.flushTags(a("#"+c),this),!1}),a("#"+b).after(d))})},userAction:"",screenReadersMessage:function(){var a;switch(this.userAction){case"remove":a=window.tagsSuggestL10n.termRemoved;break;case"add":a=window.tagsSuggestL10n.termAdded;break;default:return}window.wp.a11y.speak(a,"assertive")},init:function(){var b=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a(".tagadd",b).click(function(){tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv"))}),a("input.newtag",b).keyup(function(b){13==b.which&&(tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv")),b.preventDefault(),b.stopPropagation())}).keypress(function(a){13==a.which&&(a.preventDefault(),a.stopPropagation())}).each(function(b,c){a(c).wpTagsSuggest()}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a(".tagcloud-link").click(function(){tagBox.get(a(this).attr("id")),a(this).attr("aria-expanded","true").unbind().click(function(){a(this).attr("aria-expanded","false"===a(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery);
\ No newline at end of file
......@@ -246,6 +246,14 @@ if ( $action ) {
exit;
}
// Bail on all if any paths are invalid.
// validate_file() returns truthy for invalid files
$invalid_plugin_files = array_filter( $plugins, 'validate_file' );
if ( $invalid_plugin_files ) {
wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
exit;
}
include(ABSPATH . 'wp-admin/update.php');
$parent_file = 'plugins.php';
......
This diff is collapsed.
......@@ -3,17 +3,6 @@ jQuery( function ( $ ) {
var mshotSecondTryTimer = null
var mshotThirdTryTimer = null
$( 'a.activate-option' ).click( function(){
var link = $( this );
if ( link.hasClass( 'clicked' ) ) {
link.removeClass( 'clicked' );
}
else {
link.addClass( 'clicked' );
}
$( '.toggle-have-key' ).slideToggle( 'slow', function() {});
return false;
});
$('.akismet-status').each(function () {
var thisId = $(this).attr('commentid');
$(this).prependTo('#comment-' + thisId + ' .column-comment');
......@@ -162,13 +151,24 @@ jQuery( function ( $ ) {
} );
$('.checkforspam:not(.button-disabled)').click( function(e) {
e.preventDefault();
$('.checkforspam:not(.button-disabled)').addClass('button-disabled');
$('.checkforspam-spinner').addClass( 'spinner' );
$('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
// Update the label on the "Check for Spam" button to use the active "Checking for Spam" language.
$( '.checkforspam .akismet-label' ).text( $( '.checkforspam' ).data( 'active-label' ) );
akismet_check_for_spam(0, 100);
e.preventDefault();
});
var spam_count = 0;
var recheck_count = 0;
function akismet_check_for_spam(offset, limit) {
// Update the progress counter on the "Check for Spam" button.
$( '.checkforspam-progress' ).text( $( '.checkforspam' ).data( 'progress-label-format' ).replace( '%1$s', offset ) );
$.post(
ajaxurl,
{
......@@ -177,8 +177,11 @@ jQuery( function ( $ ) {
'limit': limit
},
function(result) {
recheck_count += result.counts.processed;
spam_count += result.counts.spam;
if (result.counts.processed < limit) {
window.location.reload();
window.location.href = $( '.checkforspam' ).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.
......@@ -187,6 +190,10 @@ jQuery( function ( $ ) {
}
);
}
if ( "start_recheck" in WPAkismet && WPAkismet.start_recheck ) {
$( '.checkforspam' ).click();
}
});
// URL encode plugin
jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
......
......@@ -3,10 +3,10 @@
* @package Akismet
*/
/*
Plugin Name: Akismet
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: 1) Click the "Activate" link to the left of this description, 2) <a href="https://akismet.com/get/">Sign up for an Akismet plan</a> to get an API key, and 3) Go to your Akismet configuration page, and save your API key.
Version: 3.2
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
Author: Automattic
Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2 or later
......@@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
exit;
}
define( 'AKISMET_VERSION', '3.2' );
define( 'AKISMET_VERSION', '3.3' );
define( 'AKISMET__MINIMUM_WP_VERSION', '3.7' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 100000 );
......
......@@ -129,8 +129,9 @@ class Akismet {
$comment['blog_charset'] = get_option('blog_charset');
$comment['permalink'] = get_permalink( $comment['comment_post_ID'] );
if ( !empty( $comment['user_ID'] ) )
if ( ! empty( $comment['user_ID'] ) ) {
$comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
}
/** See filter documentation in init_hooks(). */
$akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
......@@ -465,8 +466,9 @@ class Akismet {
$c['recheck_reason'] = $recheck_reason;
$c['user_role'] = '';
if ( isset( $c['user_ID'] ) )
$c['user_role'] = Akismet::get_user_roles($c['user_ID']);
if ( ! empty( $c['user_ID'] ) ) {
$c['user_role'] = Akismet::get_user_roles( $c['user_ID'] );
}
if ( self::is_test_mode() )
$c['is_test'] = 'true';
......@@ -596,8 +598,9 @@ class Akismet {
$comment->site_domain = $current_site->domain;
$comment->user_role = '';
if ( isset( $comment->user_ID ) )
if ( ! empty( $comment->user_ID ) ) {
$comment->user_role = Akismet::get_user_roles( $comment->user_ID );
}
if ( self::is_test_mode() )
$comment->is_test = 'true';
......@@ -642,8 +645,9 @@ class Akismet {
if ( is_object($current_site) )
$comment->site_domain = $current_site->domain;
if ( isset( $comment->user_ID ) )
$comment->user_role = Akismet::get_user_roles($comment->user_ID);
if ( ! empty( $comment->user_ID ) ) {
$comment->user_role = Akismet::get_user_roles( $comment->user_ID );
}
if ( Akismet::is_test_mode() )
$comment->is_test = 'true';
......@@ -1038,7 +1042,7 @@ class Akismet {
}
// given a response from an API call like check_key_status(), update the alert code options if an alert is present.
private static function update_alert( $response ) {
public static function update_alert( $response ) {
$code = $msg = null;
if ( isset( $response[0]['x-akismet-alert-code'] ) ) {
$code = $response[0]['x-akismet-alert-code'];
......
......@@ -2,15 +2,15 @@
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
Tested up to: 4.7
Stable tag: 3.2
Tested up to: 4.7.2
Stable tag: 3.3
License: GPLv2 or later
Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content.
== Description ==
Akismet checks your comments against the Akismet Web service to see if they look like spam or not and lets you review the spam it catches under your blog's "Comments" admin screen.
Akismet checks your comments and contact form submissions against our global database of spam to prevent your site from publishing malicious content. You can review the comment spam it catches on your blog's "Comments" admin screen.
Major features in Akismet include:
......@@ -30,6 +30,15 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
== Changelog ==
= 3.3 =
*Release Date - 23 February 2017*
* Updated the Akismet admin pages with a new clean design.
* Fixed bugs preventing the `akismet_add_comment_nonce` and `akismet_update_alert` wrapper functions from working properly.
* Fixed bug preventing the loading indicator from appearing when re-checking all comments for spam.
* Added a progress indicator to the "Check for Spam" button.
* Added a success message after manually rechecking the Pending queue for spam.
= 3.2 =
*Release Date - 6 September 2016*
......
This diff is collapsed.
......@@ -2,5 +2,5 @@
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
<input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
<input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
<input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button akismet-is-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
</form>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<div class="wrap">
<h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2>
<iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
<div id="akismet-plugin-container">
<div class="akismet-masthead">
<div class="akismet-masthead__inside-container">
<a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="akismet-right"><?php esc_html_e( 'Akismet Settings' , 'akismet' ); ?></a>
<div class="akismet-masthead__logo-container">
<img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
</div>
</div>
</div>
<iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
</div>
\ No newline at end of file
......@@ -175,7 +175,7 @@ function akismet_get_ip_address() {
function akismet_cron_recheck() {
return Akismet::cron_recheck();
}
function akismet_add_comment_nonce() {
function akismet_add_comment_nonce( $post_id ) {
return Akismet::add_comment_nonce( $post_id );
}
function akismet_fix_scheduled_recheck() {
......
......@@ -53,7 +53,7 @@ class Walker_Page extends Walker {
* Default empty array.
*/
public function start_lvl( &$output, $depth = 0, $args = array() ) {
if ( 'preserve' === $args['item_spacing'] ) {
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
$t = "\t";
$n = "\n";
} else {
......@@ -78,7 +78,7 @@ class Walker_Page extends Walker {
* Default empty array.
*/
public function end_lvl( &$output, $depth = 0, $args = array() ) {
if ( 'preserve' === $args['item_spacing'] ) {
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
$t = "\t";
$n = "\n";
} else {
......@@ -103,7 +103,7 @@ class Walker_Page extends Walker {
* @param int $current_page Optional. Page ID. Default 0.
*/
public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
if ( 'preserve' === $args['item_spacing'] ) {
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
$t = "\t";
$n = "\n";
} else {
......@@ -196,7 +196,7 @@ class Walker_Page extends Walker {
* @param array $args Optional. Array of arguments. Default empty array.
*/
public function end_el( &$output, $page, $depth = 0, $args = array() ) {
if ( 'preserve' === $args['item_spacing'] ) {
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
$t = "\t";
$n = "\n";
} else {
......
......@@ -997,13 +997,19 @@ final class WP_Customize_Manager {
wp_list_pluck( $posts, 'post_name' )
);
/*
* Obtain all post types referenced in starter content to use in query.
* This is needed because 'any' will not account for post types not yet registered.
*/
$post_types = array_filter( array_merge( array( 'attachment' ), wp_list_pluck( $posts, 'post_type' ) ) );
// Re-use auto-draft starter content posts referenced in the current customized state.
$existing_starter_content_posts = array();
if ( ! empty( $starter_content_auto_draft_post_ids ) ) {
$existing_posts_query = new WP_Query( array(
'post__in' => $starter_content_auto_draft_post_ids,
'post_status' => 'auto-draft',
'post_type' => 'any',
'post_type' => $post_types,
'posts_per_page' => -1,
) );
foreach ( $existing_posts_query->posts as $existing_post ) {
......@@ -1571,6 +1577,7 @@ final class WP_Customize_Manager {
add_filter( 'wp_redirect', array( $this, 'add_state_query_params' ) );
wp_enqueue_script( 'customize-preview' );
wp_enqueue_style( 'customize-preview' );
add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) );
add_action( 'wp_head', array( $this, 'remove_frameless_preview_messenger_channel' ) );
add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
......@@ -2487,6 +2494,14 @@ final class WP_Customize_Manager {
} elseif ( $args['date_gmt'] ) {
$post_array['post_date_gmt'] = $args['date_gmt'];
$post_array['post_date'] = get_date_from_gmt( $args['date_gmt'] );
} elseif ( $changeset_post_id && 'auto-draft' === get_post_status( $changeset_post_id ) ) {
/*
* Keep bumping the date for the auto-draft whenever it is modified;
* this extends its life, preserving it from garbage-collection via
* wp_delete_auto_drafts().
*/
$post_array['post_date'] = current_time( 'mysql' );
$post_array['post_date_gmt'] = '';
}
$this->store_changeset_revision = $allow_revision;
......
......@@ -786,7 +786,7 @@ final class WP_Customize_Nav_Menus {
* @return WP_Post|WP_Error Inserted auto-draft post object or error.
*/
public function insert_auto_draft_post( $postarr ) {
if ( ! isset( $postarr['post_type'] ) || ! post_type_exists( $postarr['post_type'] ) ) {
if ( ! isset( $postarr['post_type'] ) ) {
return new WP_Error( 'unknown_post_type', __( 'Unknown post type' ) );
}
if ( empty( $postarr['post_title'] ) ) {
......@@ -1327,7 +1327,6 @@ final class WP_Customize_Nav_Menus {
*/
public function customize_preview_enqueue_deps() {
wp_enqueue_script( 'customize-preview-nav-menus' ); // Note that we have overridden this.
wp_enqueue_style( 'customize-preview' );
}
/**
......
......@@ -585,7 +585,7 @@ class WP_Customize_Setting {
$id_base = $this->id_data['base'];
if ( 'option' === $this->type ) {
return get_option( $id_base, $default );
} else if ( 'theme_mod' ) {
} elseif ( 'theme_mod' === $this->type ) {
return get_theme_mod( $id_base, $default );
} else {
/*
......@@ -614,7 +614,7 @@ class WP_Customize_Setting {
$autoload = self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'];
}
return update_option( $id_base, $value, $autoload );
} else if ( 'theme_mod' ) {
} elseif ( 'theme_mod' === $this->type ) {
set_theme_mod( $id_base, $value );
return true;
} else {
......
......@@ -1086,7 +1086,6 @@ final class WP_Customize_Widgets {
*/
public function customize_preview_enqueue() {
wp_enqueue_script( 'customize-preview-widgets' );
wp_enqueue_style( 'customize-preview' );
}
/**
......
......@@ -54,7 +54,7 @@ class WP_HTTP_Requests_Hooks extends Requests_Hooks {
switch ( $hook ) {
case 'curl.before_send':
/** This action is documented in wp-includes/class-wp-http-curl.php */
do_action_ref_array( 'http_api_curl', array( $parameters[0], $this->request, $this->url ) );
do_action_ref_array( 'http_api_curl', array( &$parameters[0], $this->request, $this->url ) );
break;
}
......
......@@ -549,6 +549,11 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
try {
$this->image->rotateImage( new ImagickPixel('none'), 360-$angle );
// Normalise Exif orientation data so that display is consistent across devices.
if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {
$this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT );
}
// Since this changes the dimensions of the image, update the size.
$result = $this->update_size();
if ( is_wp_error( $result ) )
......
......@@ -333,6 +333,8 @@ final class WP_Taxonomy {
}
}
$args['name'] = $this->name;
foreach ( $args as $property_name => $property_value ) {
$this->$property_name = $property_value;