summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules')
-rw-r--r--plugins/jetpack/modules/after-the-deadline/config-options.php2
-rw-r--r--plugins/jetpack/modules/carousel/jetpack-carousel.css27
-rw-r--r--plugins/jetpack/modules/carousel/jetpack-carousel.js104
-rw-r--r--plugins/jetpack/modules/carousel/jetpack-carousel.php9
-rw-r--r--plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css27
-rw-r--r--plugins/jetpack/modules/contact-form/admin.php2
-rw-r--r--plugins/jetpack/modules/contact-form/grunion-contact-form.php74
-rw-r--r--plugins/jetpack/modules/custom-css/custom-css.php9
-rw-r--r--plugins/jetpack/modules/custom-post-types/comics.php2
-rw-r--r--plugins/jetpack/modules/custom-post-types/nova.php87
-rw-r--r--plugins/jetpack/modules/custom-post-types/testimonial.php26
-rw-r--r--plugins/jetpack/modules/infinite-scroll/infinity.php6
-rw-r--r--plugins/jetpack/modules/likes/post-count.js8
-rw-r--r--plugins/jetpack/modules/manage/confirm-admin.php2
-rw-r--r--plugins/jetpack/modules/minileven.php4
-rw-r--r--plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php2
-rw-r--r--plugins/jetpack/modules/module-info.php125
-rw-r--r--plugins/jetpack/modules/monitor.php2
-rw-r--r--plugins/jetpack/modules/omnisearch/omnisearch-core.php8
-rw-r--r--plugins/jetpack/modules/protect.php11
-rw-r--r--plugins/jetpack/modules/publicize/enhanced-open-graph.php9
-rw-r--r--plugins/jetpack/modules/related-posts/jetpack-related-posts.php4
-rw-r--r--plugins/jetpack/modules/sharedaddy/sharedaddy.php14
-rw-r--r--plugins/jetpack/modules/sharedaddy/sharing.php2
-rw-r--r--plugins/jetpack/modules/shortcodes/dailymotion.php4
-rw-r--r--plugins/jetpack/modules/shortcodes/instagram.php2
-rw-r--r--plugins/jetpack/modules/shortcodes/medium.php2
-rw-r--r--plugins/jetpack/modules/shortcodes/polldaddy.php6
-rw-r--r--plugins/jetpack/modules/shortcodes/scribd.php2
-rw-r--r--plugins/jetpack/modules/shortcodes/videopress.php24
-rw-r--r--plugins/jetpack/modules/shortcodes/wufoo.php4
-rw-r--r--plugins/jetpack/modules/sitemaps/sitemap-xsl.php6
-rw-r--r--plugins/jetpack/modules/sso.php8
-rw-r--r--plugins/jetpack/modules/stats.php6
-rw-r--r--plugins/jetpack/modules/subscriptions.php2
-rw-r--r--plugins/jetpack/modules/theme-tools/random-redirect.php2
-rw-r--r--plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js107
-rw-r--r--plugins/jetpack/modules/theme-tools/site-breadcrumbs.php10
-rw-r--r--plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js8
-rw-r--r--plugins/jetpack/modules/videopress.php12
-rw-r--r--plugins/jetpack/modules/videopress/class.videopress-player.php6
-rw-r--r--plugins/jetpack/modules/videopress/js/editor-view.js261
-rw-r--r--plugins/jetpack/modules/videopress/js/videopress-admin.js (renamed from plugins/jetpack/modules/videopress/videopress-admin.js)0
-rw-r--r--plugins/jetpack/modules/videopress/shortcode.php342
-rw-r--r--plugins/jetpack/modules/videopress/utility-functions.php99
-rw-r--r--plugins/jetpack/modules/videopress/videopress-editor-style.css21
-rw-r--r--plugins/jetpack/modules/videopress/videopress.php8
-rw-r--r--plugins/jetpack/modules/widget-visibility/widget-conditions.php62
-rw-r--r--plugins/jetpack/modules/widgets.php10
-rw-r--r--plugins/jetpack/modules/widgets/contact-info/contact-info-map.js12
-rw-r--r--plugins/jetpack/modules/widgets/customizer-utils.js76
-rw-r--r--plugins/jetpack/modules/widgets/facebook-likebox.php4
-rw-r--r--plugins/jetpack/modules/widgets/gallery.php22
-rw-r--r--plugins/jetpack/modules/widgets/gallery/js/gallery.js14
-rw-r--r--plugins/jetpack/modules/widgets/goodreads.php9
-rw-r--r--plugins/jetpack/modules/widgets/googleplus-badge.php5
-rw-r--r--plugins/jetpack/modules/widgets/gravatar-profile.php43
-rw-r--r--plugins/jetpack/modules/widgets/image-widget.php5
-rw-r--r--plugins/jetpack/modules/widgets/rsslinks-widget.php3
-rw-r--r--plugins/jetpack/modules/widgets/top-posts.php5
-rw-r--r--plugins/jetpack/modules/widgets/twitter-timeline.php2
-rw-r--r--plugins/jetpack/modules/widgets/wordpress-post-widget.php17
62 files changed, 1292 insertions, 505 deletions
diff --git a/plugins/jetpack/modules/after-the-deadline/config-options.php b/plugins/jetpack/modules/after-the-deadline/config-options.php
index 10ca96c6..2b325146 100644
--- a/plugins/jetpack/modules/after-the-deadline/config-options.php
+++ b/plugins/jetpack/modules/after-the-deadline/config-options.php
@@ -80,7 +80,7 @@ function AtD_display_options_form() {
echo '<br />';
AtD_print_option( 'Redundant Expression', __('Redundant Phrases', 'jetpack'), $options_show_types );
?></p>
- <p><?php printf( __( '<a href="%s">Learn more</a> about these options.', 'jetpack' ), 'http://support.wordpress.com/proofreading/' );
+ <p><?php printf( __( '<a href="%s" target="_blank">Learn more</a> about these options.', 'jetpack' ), 'http://support.wordpress.com/proofreading/' );
?></p>
<p style="font-weight: bold"><?php _e( 'Language', 'jetpack' ); ?></font>
diff --git a/plugins/jetpack/modules/carousel/jetpack-carousel.css b/plugins/jetpack/modules/carousel/jetpack-carousel.css
index 7d24d047..b9cabc60 100644
--- a/plugins/jetpack/modules/carousel/jetpack-carousel.css
+++ b/plugins/jetpack/modules/carousel/jetpack-carousel.css
@@ -281,7 +281,6 @@ div.jp-carousel-buttons a:hover {
border-color: #fff;
}
-div.jp-carousel-buttons a.jp-carousel-like,
div.jp-carousel-buttons a.jp-carousel-reblog,
div.jp-carousel-buttons a.jp-carousel-commentlink,
a.jp-carousel-image-download {
@@ -294,8 +293,7 @@ div.jp-carousel-buttons a.jp-carousel-commentlink {
margin: 0 14px 0 0 !important;
}
-div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
-div.jp-carousel-buttons a.jp-carousel-like.liked {
+div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
background-color: #303030;
padding-right: 8px !important;
border-radius: 2px;
@@ -332,21 +330,11 @@ div.jp-carousel-buttons a.jp-carousel-reblog:hover {
color: #68c9e8;
}
-div.jp-carousel-buttons a.jp-carousel-like {
- background-position: 5px 5px;
- padding-left: 24px !important;
-}
-
-div.jp-carousel-buttons a.jp-carousel-like:hover {
- background-position: 5px -15px;
-}
-
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
- div.jp-carousel-buttons a.jp-carousel-like,
div.jp-carousel-buttons a.jp-carousel-reblog,
div.jp-carousel-buttons a.jp-carousel-commentlink,
a.jp-carousel-image-download {
@@ -938,8 +926,7 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
padding-left: 24px !important;
}
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like.liked {
+.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
background-color: #2ea2cc;
color: #fff;
}
@@ -948,20 +935,10 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
background-position: 0px -176px;
}
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like,
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like:hover {
- background-position: 5px -15px;
- padding-left: 23px !important;
-}
-
.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
background-position: 5px -36px;
}
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like.liked {
- background-position: 5px 5px;
-}
-
.jp-carousel-light div#carousel-reblog-box {
background: #eee;
background: -moz-linear-gradient(bottom, #ececec, #f7f7f7);
diff --git a/plugins/jetpack/modules/carousel/jetpack-carousel.js b/plugins/jetpack/modules/carousel/jetpack-carousel.js
index a4b6aac4..dd586866 100644
--- a/plugins/jetpack/modules/carousel/jetpack-carousel.js
+++ b/plugins/jetpack/modules/carousel/jetpack-carousel.js
@@ -1,5 +1,5 @@
/* jshint sub: true, onevar: false, multistr: true, devel: true, smarttabs: true */
-/* global jetpackCarouselStrings, DocumentTouch, jetpackLikesWidgetQueue */
+/* global jetpackCarouselStrings, DocumentTouch */
jQuery(document).ready(function($) {
@@ -424,10 +424,6 @@ jQuery(document).ready(function($) {
preventDefaultEvents : false
} );
- $( '.jetpack-likes-widget-unloaded' ).each( function() {
- jetpackLikesWidgetQueue.push( this.id );
- });
-
nextButton.add(previousButton).click(function(e){
e.preventDefault();
e.stopPropagation();
@@ -490,11 +486,6 @@ jQuery(document).ready(function($) {
$('html').css('overflow', 'hidden');
scrollPos = $( window ).scrollTop();
- // Re-apply inline-block style here and give an initial value for the width
- // This value will get replaced with a more appropriate value once the slide is loaded
- // This avoids the likes widget appearing initially full width below the comment button and then shuffling up
- jQuery( '.slim-likes-widget' ).find( 'iframe' ).css( 'display', 'inline-block' ).css( 'width', '60px' );
-
container.data('carousel-extra', data);
return this.each(function() {
@@ -561,14 +552,6 @@ jQuery(document).ready(function($) {
}
},
- resetButtons : function(current) {
- if ( current.data('liked') ) {
- $('.jp-carousel-buttons a.jp-carousel-like').addClass('liked').text(jetpackCarouselStrings.unlike);
- } else {
- $('.jp-carousel-buttons a.jp-carousel-like').removeClass('liked').text(jetpackCarouselStrings.like);
- }
- },
-
selectedSlide : function(){
return this.find('.selected');
},
@@ -672,7 +655,6 @@ jQuery(document).ready(function($) {
gallery.jp_carousel( 'updateSlidePositions', animate );
- gallery.jp_carousel( 'resetButtons', current );
container.trigger( 'jp_carousel.selectSlide', [current] );
gallery.jp_carousel( 'getTitleDesc', {
@@ -680,18 +662,6 @@ jQuery(document).ready(function($) {
desc: current.data( 'desc' )
});
- // Lazy-load the Likes iframe for the current, next, and previous slides.
- gallery.jp_carousel( 'loadLikes', attachmentId );
- gallery.jp_carousel( 'updateLikesWidgetVisibility', attachmentId );
-
- if ( next.length > 0 ) {
- gallery.jp_carousel( 'loadLikes', next.data( 'attachment-id' ) );
- }
-
- if ( previous.length > 0 ) {
- gallery.jp_carousel( 'loadLikes', previous.data( 'attachment-id' ) );
- }
-
var imageMeta = current.data( 'image-meta' );
gallery.jp_carousel( 'updateExif', imageMeta );
gallery.jp_carousel( 'updateFullSizeLink', current );
@@ -1128,74 +1098,6 @@ jQuery(document).ready(function($) {
$( 'div#jp-carousel-comments-loading' ).css('margin-top', '20px');
},
- updateLikesWidgetVisibility: function ( attachmentId ) {
- // Only do this if likes is enabled
- if ( 'undefined' === typeof jetpackLikesWidgetQueue ) {
- return;
- }
-
- // Hide all likes widgets except for the one for the attachmentId passed in
- $( '.jp-carousel-buttons .jetpack-likes-widget-wrapper' ).css( 'display', 'none' ).each( function () {
- var widgetWrapper = $( this );
- if ( widgetWrapper.attr( 'data-attachment-id' ) == attachmentId ) { // jshint ignore:line
- widgetWrapper.css( 'display', 'inline-block' );
- return false;
- }
- });
- },
-
- loadLikes : function ( attachmentId ) {
- var dataCarouselExtra = $( '.jp-carousel-wrap' ).data( 'carousel-extra' );
- var blogId = dataCarouselExtra.likes_blog_id;
-
- if ( $( '#like-post-wrapper-' + blogId + '-' + attachmentId ).length === 0 ) {
- // Add the iframe the first time the slide is shown.
- var protocol = 'http';
- var originDomain = 'http://wordpress.com';
-
- if ( dataCarouselExtra.permalink.length ) {
- protocol = dataCarouselExtra.permalink.split( ':' )[0];
-
- if ( ( protocol !== 'http' ) && ( protocol !== 'https' ) ) {
- protocol = 'http';
- }
-
- var parts = dataCarouselExtra.permalink.split( '/' );
-
- if ( parts.length >= 2 ) {
- originDomain = protocol + '://' + parts[2];
- }
- }
-
- var dataSource = protocol + '://widgets.wp.com/likes/#blog_id=' + encodeURIComponent( blogId ) +
- '&post_id=' + encodeURIComponent( attachmentId ) +
- '&slim=1&origin=' + encodeURIComponent( originDomain );
-
- if ( 'en' !== jetpackCarouselStrings.lang ) {
- dataSource += '&lang=' + encodeURIComponent( jetpackCarouselStrings.lang );
- }
-
- var likesWidget = $( '<iframe class=\'post-likes-widget jetpack-likes-widget jetpack-resizeable\'></iframe>' )
- .attr( 'name', 'like-post-frame-' + blogId + '-' + attachmentId )
- .attr( 'src', dataSource )
- .css( 'display', 'inline-block' );
-
- var likesWidgetWrapper = $( '<div/>' )
- .addClass( 'jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded slim-likes-widget' )
- .attr( 'id', 'like-post-wrapper-' + blogId + '-' + attachmentId )
- .attr( 'data-src', dataSource )
- .attr( 'data-name', 'like-post-frame-' + blogId + '-' + attachmentId )
- .attr( 'data-attachment-id', attachmentId )
- .css( 'display', 'none' )
- .css( 'vertical-align', 'middle' )
- .append( likesWidget )
- .append( '<div class=\'post-likes-widget-placeholder\'></div>' );
-
- $( '.jp-carousel-buttons' ).append( likesWidgetWrapper );
- }
-
- },
-
// updateExif updates the contents of the exif UL (.jp-carousel-image-exif)
updateExif: function( meta ) {
if ( !meta || 1 !== Number( jetpackCarouselStrings.display_exif ) ) {
@@ -1474,7 +1376,7 @@ jQuery(document).ready(function($) {
};
// register the event listener for starting the gallery
- $( document.body ).on( 'click', 'div.gallery,div.tiled-gallery', function(e) {
+ $( document.body ).on( 'click.jp-carousel', 'div.gallery,div.tiled-gallery', function(e) {
if ( ! $(this).jp_carousel( 'testForData', e.currentTarget ) ) {
return;
}
@@ -1490,7 +1392,7 @@ jQuery(document).ready(function($) {
});
// Makes carousel work on page load and when back button leads to same URL with carousel hash (ie: no actual document.ready trigger)
- $( window ).on( 'hashchange', function () {
+ $( window ).on( 'hashchange.jp-carousel', function () {
var hashRegExp = /jp-carousel-(\d+)/,
matches, attachmentId, galleries, selectedThumbnail;
diff --git a/plugins/jetpack/modules/carousel/jetpack-carousel.php b/plugins/jetpack/modules/carousel/jetpack-carousel.php
index f34e70b1..b3d5302d 100644
--- a/plugins/jetpack/modules/carousel/jetpack-carousel.php
+++ b/plugins/jetpack/modules/carousel/jetpack-carousel.php
@@ -152,7 +152,7 @@ class Jetpack_Carousel {
do_action( 'jp_carousel_thumbnails_shown' );
if ( $this->first_run ) {
- wp_enqueue_script( 'jetpack-carousel', plugins_url( 'jetpack-carousel.js', __FILE__ ), array( 'jquery.spin' ), $this->asset_version( '20140505' ), true );
+ wp_enqueue_script( 'jetpack-carousel', plugins_url( 'jetpack-carousel.js', __FILE__ ), array( 'jquery.spin' ), $this->asset_version( '20160325' ), true );
// Note: using home_url() instead of admin_url() for ajaxurl to be sure to get same domain on wpcom when using mapped domains (also works on self-hosted)
// Also: not hardcoding path since there is no guarantee site is running on site root in self-hosted context.
@@ -330,17 +330,10 @@ class Jetpack_Carousel {
if ( isset( $post ) ) {
$blog_id = (int) get_current_blog_id();
- if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
- $likes_blog_id = $blog_id;
- } else {
- $likes_blog_id = Jetpack_Options::get_option( 'id' );
- }
-
$extra_data = array(
'data-carousel-extra' => array(
'blog_id' => $blog_id,
'permalink' => get_permalink( $post->ID ),
- 'likes_blog_id' => $likes_blog_id
)
);
diff --git a/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css b/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css
index a4c64b4a..c42d454b 100644
--- a/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css
+++ b/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css
@@ -283,7 +283,6 @@ div.jp-carousel-buttons a:hover {
border-color: #fff;
}
-div.jp-carousel-buttons a.jp-carousel-like,
div.jp-carousel-buttons a.jp-carousel-reblog,
div.jp-carousel-buttons a.jp-carousel-commentlink,
a.jp-carousel-image-download {
@@ -296,8 +295,7 @@ div.jp-carousel-buttons a.jp-carousel-commentlink {
margin: 0 0 0 14px !important;
}
-div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
-div.jp-carousel-buttons a.jp-carousel-like.liked {
+div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
background-color: #303030;
padding-left: 8px !important;
border-radius: 2px;
@@ -334,21 +332,11 @@ div.jp-carousel-buttons a.jp-carousel-reblog:hover {
color: #68c9e8;
}
-div.jp-carousel-buttons a.jp-carousel-like {
- background-position: 5px 5px;
- padding-right: 24px !important;
-}
-
-div.jp-carousel-buttons a.jp-carousel-like:hover {
- background-position: 5px -15px;
-}
-
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
- div.jp-carousel-buttons a.jp-carousel-like,
div.jp-carousel-buttons a.jp-carousel-reblog,
div.jp-carousel-buttons a.jp-carousel-commentlink,
a.jp-carousel-image-download {
@@ -940,8 +928,7 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
padding-right: 24px !important;
}
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like.liked {
+.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
background-color: #2ea2cc;
color: #fff;
}
@@ -950,20 +937,10 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
background-position: 0px -176px;
}
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like,
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like:hover {
- background-position: 5px -15px;
- padding-right: 23px !important;
-}
-
.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
background-position: 5px -36px;
}
-.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like.liked {
- background-position: 5px 5px;
-}
-
.jp-carousel-light div#carousel-reblog-box {
background: #eee;
background: -moz-linear-gradient(bottom, #ececec, #f7f7f7);
diff --git a/plugins/jetpack/modules/contact-form/admin.php b/plugins/jetpack/modules/contact-form/admin.php
index 7332e8f5..ea7c5571 100644
--- a/plugins/jetpack/modules/contact-form/admin.php
+++ b/plugins/jetpack/modules/contact-form/admin.php
@@ -314,7 +314,7 @@ function grunion_manage_post_columns( $col, $post_id ) {
$author_email_line = '';
if ( !empty( $author_email ) ) {
- $author_email_line = sprintf( "<a href='%1\$s'>%2\$s</a><br />", esc_url( "mailto:" . $author_email ) , esc_html( $author_email ) );
+ $author_email_line = sprintf( "<a href='%1\$s' target='_blank'>%2\$s</a><br />", esc_url( "mailto:" . $author_email ) , esc_html( $author_email ) );
}
$author_url_line = '';
diff --git a/plugins/jetpack/modules/contact-form/grunion-contact-form.php b/plugins/jetpack/modules/contact-form/grunion-contact-form.php
index faa8fca1..13b25ad3 100644
--- a/plugins/jetpack/modules/contact-form/grunion-contact-form.php
+++ b/plugins/jetpack/modules/contact-form/grunion-contact-form.php
@@ -47,7 +47,7 @@ class Grunion_Contact_Form_Plugin {
public function daily_akismet_meta_cleanup() {
global $wpdb;
- $feedback_ids = $wpdb->get_col( "SELECT p.ID FROM {$wpdb->posts} as p INNER JOIN {$wpdb->postmeta} as m on m.post_id = p.ID WHERE p.post_type = 'feedback' AND m.meta_key = '_feedback_akismet_values' > p.post_date_gmt LIMIT 10000" );
+ $feedback_ids = $wpdb->get_col( "SELECT p.ID FROM {$wpdb->posts} as p INNER JOIN {$wpdb->postmeta} as m on m.post_id = p.ID WHERE p.post_type = 'feedback' AND m.meta_key = '_feedback_akismet_values' AND DATE_SUB(NOW(), INTERVAL 15 DAY) > p.post_date_gmt LIMIT 10000" );
if ( empty( $feedback_ids ) ) {
return;
@@ -407,7 +407,7 @@ class Grunion_Contact_Form_Plugin {
*/
function prepare_for_akismet( $form ) {
$form['comment_type'] = 'contact_form';
- $form['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] );
+ $form['user_ip'] = $_SERVER['REMOTE_ADDR'];
$form['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
$form['referrer'] = $_SERVER['HTTP_REFERER'];
$form['blog'] = get_option( 'home' );
@@ -1586,7 +1586,46 @@ class Grunion_Contact_Form extends Crunion_Contact_Form_Shortcode {
}
/**
- * Loops through $this->fields to generate a (structured) list of field IDs
+ * Loops through $this->fields to generate a (structured) list of field IDs.
+ *
+ * Important: Currently the whitelisted fields are defined as follows:
+ * `name`, `email`, `url`, `subject`, `textarea`
+ *
+ * If you need to add new fields to the Contact Form, please don't add them
+ * to the whitelisted fields and leave them as extra fields.
+ *
+ * The reasoning behind this is that both the admin Feedback view and the CSV
+ * export will not include any fields that are added to the list of
+ * whitelisted fields without taking proper care to add them to all the
+ * other places where they accessed/used/saved.
+ *
+ * The safest way to add new fields is to add them to the dropdown and the
+ * HTML list ( @see Grunion_Contact_Form_Field::render ) and don't add them
+ * to the list of whitelisted fields. This way they will become a part of the
+ * `extra fields` which are saved in the post meta and will be properly
+ * handled by the admin Feedback view and the CSV Export without any extra
+ * work.
+ *
+ * If there is need to add a field to the whitelisted fields, then please
+ * take proper care to add logic to handle the field in the following places:
+ *
+ * - Below in the switch statement - so the field is recognized as whitelisted.
+ *
+ * - Grunion_Contact_Form::process_submission - validation and logic.
+ *
+ * - Grunion_Contact_Form::process_submission - add the field as an additional
+ * field in the `post_content` when saving the feedback content.
+ *
+ * - Grunion_Contact_Form_Plugin::parse_fields_from_content - add mapping
+ * for the field, defined in the above method.
+ *
+ * - Grunion_Contact_Form_Plugin::map_parsed_field_contents_of_post_to_field_names -
+ * add mapping of the field for the CSV Export. Otherwise it will be missing
+ * from the exported data.
+ *
+ * - admin.php / grunion_manage_post_columns - add the field to the render logic.
+ * Otherwise it will be missing from the admin Feedback view.
+ *
* @return array
*/
function get_field_ids() {
@@ -1603,28 +1642,30 @@ class Grunion_Contact_Form extends Crunion_Contact_Form_Shortcode {
);
foreach ( $this->fields as $id => $field ) {
- $field_ids['all'][] = $id;
+ $field_ids[ 'all' ][] = $id;
$type = $field->get_attribute( 'type' );
- if ( isset( $field_ids[$type] ) ) {
+ if ( isset( $field_ids[ $type ] ) ) {
// This type of field is already present in our whitelist of "standard" fields for this form
// Put it in extra
- $field_ids['extra'][] = $id;
+ $field_ids[ 'extra' ][] = $id;
continue;
}
+ /**
+ * See method description before modifying the switch cases.
+ */
switch ( $type ) {
- case 'email' :
- case 'telephone' :
- case 'name' :
- case 'url' :
- case 'subject' :
- case 'textarea' :
- $field_ids[$type] = $id;
- break;
+ case 'email' :
+ case 'name' :
+ case 'url' :
+ case 'subject' :
+ case 'textarea' :
+ $field_ids[ $type ] = $id;
+ break;
default :
// Put everything else in extra
- $field_ids['extra'][] = $id;
+ $field_ids[ 'extra' ][] = $id;
}
}
@@ -1906,7 +1947,7 @@ class Grunion_Contact_Form extends Crunion_Contact_Form_Shortcode {
update_post_meta( $post_id, '_feedback_extra_fields', $this->addslashes_deep( $extra_values ) );
- if ( Jetpack::is_plugin_active( 'akismet/akismet.php' ) ) {
+ if ( defined( 'AKISMET_VERSION' ) ) {
update_post_meta( $post_id, '_feedback_akismet_values', $this->addslashes_deep( $akismet_values ) );
}
@@ -2288,6 +2329,7 @@ class Grunion_Contact_Form_Field extends Crunion_Contact_Form_Shortcode {
$r .= "\n<div>\n";
$r .= "\t\t<label for='" . esc_attr( $field_id ) . "' class='grunion-field-label telephone" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n";
$r .= "\t\t<input type='tel' name='" . esc_attr( $field_id ) . "' id='" . esc_attr( $field_id ) . "' value='" . esc_attr( $field_value ) . "' " . $field_class . $field_placeholder . "/>\n";
+ break;
case 'textarea' :
$r .= "\n<div>\n";
$r .= "\t\t<label for='contact-form-comment-" . esc_attr( $field_id ) . "' class='grunion-field-label textarea" . ( $this->is_error() ? ' form-error' : '' ) . "'>" . esc_html( $field_label ) . ( $field_required ? '<span>' . $required_field_text . '</span>' : '' ) . "</label>\n";
diff --git a/plugins/jetpack/modules/custom-css/custom-css.php b/plugins/jetpack/modules/custom-css/custom-css.php
index 999b7f3e..e3e6fbff 100644
--- a/plugins/jetpack/modules/custom-css/custom-css.php
+++ b/plugins/jetpack/modules/custom-css/custom-css.php
@@ -108,7 +108,7 @@ class Jetpack_Custom_CSS {
check_admin_referer( 'safecss' );
$save_result = self::save( array(
- 'css' => stripslashes( $_POST['safecss'] ),
+ 'css' => $_POST['safecss'],
'is_preview' => isset( $_POST['action'] ) && $_POST['action'] == 'preview',
'preprocessor' => isset( $_POST['custom_css_preprocessor'] ) ? $_POST['custom_css_preprocessor'] : '',
'add_to_existing' => isset( $_POST['add_to_existing'] ) ? $_POST['add_to_existing'] == 'true' : true,
@@ -618,7 +618,6 @@ class Jetpack_Custom_CSS {
else if ( 'safecss_preview' == $option ) {
$safecss_post = Jetpack_Custom_CSS::get_current_revision();
$css = $safecss_post['post_content'];
- $css = stripslashes( $css );
$css = Jetpack_Custom_CSS::minify( $css, get_post_meta( $safecss_post['ID'], 'custom_css_preprocessor', true ) );
}
@@ -993,8 +992,8 @@ class Jetpack_Custom_CSS {
*
* @param string $str Intro text appearing above the Custom CSS editor.
*/
- echo apply_filters( 'safecss_intro_text', __( 'New to CSS? Start with a <a href="http://www.htmldog.com/guides/cssbeginner/">beginner tutorial</a>. Questions?
- Ask in the <a href="http://wordpress.org/support/forum/themes-and-templates">Themes and Templates forum</a>.', 'jetpack' ) );
+ echo apply_filters( 'safecss_intro_text', __( 'New to CSS? Start with a <a href="http://www.htmldog.com/guides/cssbeginner/" target="_blank">beginner tutorial</a>. Questions?
+ Ask in the <a href="http://wordpress.org/support/forum/themes-and-templates" target="_blank">Themes and Templates forum</a>.', 'jetpack' ) );
?></p>
<p class="css-support"><?php echo __( 'Note: Custom CSS will be reset when changing themes.', 'jetpack' ); ?></p>
@@ -1042,7 +1041,7 @@ class Jetpack_Custom_CSS {
<?php
printf(
- __( 'Limit width to %1$s pixels for full size images. (<a href="%2$s">More info</a>.)', 'jetpack' ),
+ __( 'Limit width to %1$s pixels for full size images. (<a href="%2$s" target="_blank">More info</a>.)', 'jetpack' ),
'<input type="text" id="custom_content_width_visible" value="' . esc_attr( $custom_content_width ) . '" size="4" />',
/**
* Filter the Custom CSS limited width's support doc URL.
diff --git a/plugins/jetpack/modules/custom-post-types/comics.php b/plugins/jetpack/modules/custom-post-types/comics.php
index dfc52b45..59d4982f 100644
--- a/plugins/jetpack/modules/custom-post-types/comics.php
+++ b/plugins/jetpack/modules/custom-post-types/comics.php
@@ -521,7 +521,7 @@ function comics_welcome_email( $welcome_email, $blog_id, $user_id, $password, $t
Your webcomic's new site is ready to go. Get started by <a href=\"BLOG_URLwp-admin/customize.php#title\">setting your comic's title and tagline</a> so your readers know what it's all about.
-Looking for more help with setting up your site? Check out the WordPress.com <a href=\"http://learn.wordpress.com/\">beginner's tutorial</a> and the <a href=\"http://en.support.wordpress.com/comics/\">guide to comics on WordPress.com</a>. Dive right in by <a href=\"BLOG_URLwp-admin/customize.php#title\">publishing your first strip!</a>
+Looking for more help with setting up your site? Check out the WordPress.com <a href=\"http://learn.wordpress.com/\" target=\"_blank\">beginner's tutorial</a> and the <a href=\"http://en.support.wordpress.com/comics/\" target=\"_blank\">guide to comics on WordPress.com</a>. Dive right in by <a href=\"BLOG_URLwp-admin/customize.php#title\">publishing your first strip!</a>
Lots of laughs,
The WordPress.com Team", 'jetpack' );
diff --git a/plugins/jetpack/modules/custom-post-types/nova.php b/plugins/jetpack/modules/custom-post-types/nova.php
index 7419cbd2..a336d25b 100644
--- a/plugins/jetpack/modules/custom-post-types/nova.php
+++ b/plugins/jetpack/modules/custom-post-types/nova.php
@@ -126,15 +126,24 @@ class Nova_Restaurant {
if ( ! taxonomy_exists( self::MENU_ITEM_LABEL_TAX ) ) {
register_taxonomy( self::MENU_ITEM_LABEL_TAX, self::MENU_ITEM_POST_TYPE, array(
'labels' => array(
+ /* translators: this is about a food menu */
'name' => __( 'Menu Item Labels', 'jetpack' ),
+ /* translators: this is about a food menu */
'singular_name' => __( 'Menu Item Label', 'jetpack' ),
+ /* translators: this is about a food menu */
'search_items' => __( 'Search Menu Item Labels', 'jetpack' ),
'popular_items' => __( 'Popular Labels', 'jetpack' ),
+ /* translators: this is about a food menu */
'all_items' => __( 'All Menu Item Labels', 'jetpack' ),
+ /* translators: this is about a food menu */
'edit_item' => __( 'Edit Menu Item Label', 'jetpack' ),
+ /* translators: this is about a food menu */
'view_item' => __( 'View Menu Item Label', 'jetpack' ),
+ /* translators: this is about a food menu */
'update_item' => __( 'Update Menu Item Label', 'jetpack' ),
+ /* translators: this is about a food menu */
'add_new_item' => __( 'Add New Menu Item Label', 'jetpack' ),
+ /* translators: this is about a food menu */
'new_item_name' => __( 'New Menu Item Label Name', 'jetpack' ),
'separate_items_with_commas' => __( 'For example, spicy, favorite, etc. <br /> Separate Labels with commas', 'jetpack' ),
'add_or_remove_items' => __( 'Add or remove Labels', 'jetpack' ),
@@ -150,17 +159,28 @@ class Nova_Restaurant {
if ( ! taxonomy_exists( self::MENU_TAX ) ) {
register_taxonomy( self::MENU_TAX, self::MENU_ITEM_POST_TYPE, array(
'labels' => array(
- 'name' => __( 'Menu Sections', 'jetpack' ),
- 'singular_name' => __( 'Menu Section', 'jetpack' ),
- 'search_items' => __( 'Search Menu Sections', 'jetpack' ),
- 'all_items' => __( 'All Menu Sections', 'jetpack' ),
- 'parent_item' => __( 'Parent Menu Section', 'jetpack' ),
- 'parent_item_colon' => __( 'Parent Menu Section:', 'jetpack' ),
- 'edit_item' => __( 'Edit Menu Section', 'jetpack' ),
- 'view_item' => __( 'View Menu Section', 'jetpack' ),
- 'update_item' => __( 'Update Menu Section', 'jetpack' ),
- 'add_new_item' => __( 'Add New Menu Section', 'jetpack' ),
- 'new_item_name' => __( 'New Menu Sections Name', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'name' => __( 'Menu Sections', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'singular_name' => __( 'Menu Section', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'search_items' => __( 'Search Menu Sections', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'all_items' => __( 'All Menu Sections', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'parent_item' => __( 'Parent Menu Section', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'parent_item_colon' => __( 'Parent Menu Section:', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'edit_item' => __( 'Edit Menu Section', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'view_item' => __( 'View Menu Section', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'update_item' => __( 'Update Menu Section', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'add_new_item' => __( 'Add New Menu Section', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'new_item_name' => __( 'New Menu Sections Name', 'jetpack' ),
'items_list_navigation' => __( 'Menu section list navigation', 'jetpack' ),
'items_list' => __( 'Menu section list', 'jetpack' ),
),
@@ -185,18 +205,30 @@ class Nova_Restaurant {
'description' => __( "Items on your restaurant's menu", 'jetpack' ),
'labels' => array(
- 'name' => __( 'Menu Items', 'jetpack' ),
- 'singular_name' => __( 'Menu Item', 'jetpack' ),
- 'menu_name' => __( 'Food Menus', 'jetpack' ),
- 'all_items' => __( 'Menu Items', 'jetpack' ),
- 'add_new' => __( 'Add One Item', 'jetpack' ),
- 'add_new_item' => __( 'Add Menu Item', 'jetpack' ),
- 'edit_item' => __( 'Edit Menu Item', 'jetpack' ),
- 'new_item' => __( 'New Menu Item', 'jetpack' ),
- 'view_item' => __( 'View Menu Item', 'jetpack' ),
- 'search_items' => __( 'Search Menu Items', 'jetpack' ),
- 'not_found' => __( 'No Menu Items found', 'jetpack' ),
- 'not_found_in_trash' => __( 'No Menu Items found in Trash', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'name' => __( 'Menu Items', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'singular_name' => __( 'Menu Item', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'menu_name' => __( 'Food Menus', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'all_items' => __( 'Menu Items', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'add_new' => __( 'Add One Item', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'add_new_item' => __( 'Add Menu Item', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'edit_item' => __( 'Edit Menu Item', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'new_item' => __( 'New Menu Item', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'view_item' => __( 'View Menu Item', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'search_items' => __( 'Search Menu Items', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'not_found' => __( 'No Menu Items found', 'jetpack' ),
+ /* translators: this is about a food menu */
+ 'not_found_in_trash' => __( 'No Menu Items found in Trash', 'jetpack' ),
'filter_items_list' => __( 'Filter menu items list', 'jetpack' ),
'items_list_navigation' => __( 'Menu item list navigation', 'jetpack' ),
'items_list' => __( 'Menu items list', 'jetpack' ),
@@ -234,18 +266,25 @@ class Nova_Restaurant {
$messages[self::MENU_ITEM_POST_TYPE] = array(
0 => '', // Unused. Messages start at index 1.
+ /* translators: this is about a food menu */
1 => sprintf( __( 'Menu item updated. <a href="%s">View item</a>', 'jetpack' ), esc_url( get_permalink( $post->ID ) ) ),
2 => esc_html__( 'Custom field updated.', 'jetpack' ),
3 => esc_html__( 'Custom field deleted.', 'jetpack' ),
+ /* translators: this is about a food menu */
4 => esc_html__( 'Menu item updated.', 'jetpack' ),
/* translators: %s: date and time of the revision */
5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Menu item restored to revision from %s', 'jetpack' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
+ /* translators: this is about a food menu */
6 => sprintf( __( 'Menu item published. <a href="%s">View item</a>', 'jetpack' ), esc_url( get_permalink( $post->ID ) ) ),
+ /* translators: this is about a food menu */
7 => esc_html__( 'Menu item saved.', 'jetpack' ),
+ /* translators: this is about a food menu */
8 => sprintf( __( 'Menu item submitted. <a target="_blank" href="%s">Preview item</a>', 'jetpack' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
+ /* translators: this is about a food menu */
9 => sprintf( __( 'Menu item scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview item</a>', 'jetpack' ),
// translators: Publish box date format, see http://php.net/date
date_i18n( __( 'M j, Y @ G:i', 'jetpack' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ),
+ /* translators: this is about a food menu */
10 => sprintf( __( 'Menu item draft updated. <a target="_blank" href="%s">Preview item</a>', 'jetpack' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
);
@@ -275,6 +314,7 @@ class Nova_Restaurant {
$screen = get_current_screen();
if ( self::MENU_ITEM_POST_TYPE == $screen->post_type )
+ /* translators: this is about a food menu */
$title = esc_html__( "Enter the menu item's name here", 'jetpack' );
return $title;
@@ -431,6 +471,7 @@ class Nova_Restaurant {
function admin_notices() {
if ( isset( $_GET['nova_reordered'] ) )
+ /* translators: this is about a food menu */
printf( '<div class="updated"><p>%s</p></div>', __( 'Menu Items re-ordered.', 'jetpack' ) );
}
diff --git a/plugins/jetpack/modules/custom-post-types/testimonial.php b/plugins/jetpack/modules/custom-post-types/testimonial.php
index bca9fdbb..dfe9de45 100644
--- a/plugins/jetpack/modules/custom-post-types/testimonial.php
+++ b/plugins/jetpack/modules/custom-post-types/testimonial.php
@@ -93,6 +93,7 @@ class Jetpack_Testimonial {
// Adjust CPT archive and custom taxonomies to obey CPT reading setting
add_filter( 'pre_get_posts', array( $this, 'query_reading_setting' ), 20 );
+ add_filter( 'infinite_scroll_settings', array( $this, 'infinite_scroll_click_posts_per_page' ) );
// Register [jetpack_testimonials] always and
// register [testimonials] if [testimonials] isn't already set
@@ -312,6 +313,7 @@ class Jetpack_Testimonial {
'editor',
'thumbnail',
'page-attributes',
+ 'revisions',
),
'rewrite' => array(
'slug' => 'testimonial',
@@ -390,6 +392,19 @@ class Jetpack_Testimonial {
}
}
+ /*
+ * If Infinite Scroll is set to 'click', use our custom reading setting instead of core's `posts_per_page`.
+ */
+ function infinite_scroll_click_posts_per_page( $settings ) {
+ global $wp_query;
+
+ if ( ! is_admin() && true === $settings['click_handle'] && $wp_query->is_post_type_archive( self::CUSTOM_POST_TYPE ) ) {
+ $settings['posts_per_page'] = get_option( self::OPTION_READING_SETTING, $settings['posts_per_page'] );
+ }
+
+ return $settings;
+ }
+
/**
* Add CPT to Dotcom sitemap
*/
@@ -599,7 +614,7 @@ class Jetpack_Testimonial {
$query->the_post();
$post_id = get_the_ID();
?>
- <div class="testimonial-entry <?php echo esc_attr( self::get_testimonial_class( $testimonial_index_number, $atts['columns'] ) ); ?>">
+ <div class="testimonial-entry <?php echo esc_attr( self::get_testimonial_class( $testimonial_index_number, $atts['columns'], has_post_thumbnail( $post_id ) ) ); ?>">
<?php
// The content
if ( false !== $atts['display_content'] ) {
@@ -645,7 +660,7 @@ class Jetpack_Testimonial {
*
* @return string
*/
- static function get_testimonial_class( $testimonial_index_number, $columns ) {
+ static function get_testimonial_class( $testimonial_index_number, $columns, $image ) {
$class = array();
$class[] = 'testimonial-entry-column-'.$columns;
@@ -665,6 +680,10 @@ class Jetpack_Testimonial {
$class[] = 'testimonial-entry-last-item-row';
}
+ // add class if testimonial has a featured image
+ if ( false !== $image ) {
+ $class[] = 'has-testimonial-thumbnail';
+ }
/**
* Filter the class applied to testimonial div in the testimonial
@@ -676,9 +695,10 @@ class Jetpack_Testimonial {
* @param string $class class name of the div.
* @param int $testimonial_index_number iterator count the number of columns up starting from 0.
* @param int $columns number of columns to display the content in.
+ * @param boolean $image has a thumbnail or not.
*
*/
- return apply_filters( 'testimonial-entry-post-class', implode( " ", $class ) , $testimonial_index_number, $columns );
+ return apply_filters( 'testimonial-entry-post-class', implode( " ", $class ) , $testimonial_index_number, $columns, $image );
}
/**
diff --git a/plugins/jetpack/modules/infinite-scroll/infinity.php b/plugins/jetpack/modules/infinite-scroll/infinity.php
index f98d8a75..4d4043cc 100644
--- a/plugins/jetpack/modules/infinite-scroll/infinity.php
+++ b/plugins/jetpack/modules/infinite-scroll/infinity.php
@@ -376,7 +376,7 @@ class The_Neverending_Home_Page {
add_filter( 'body_class', array( $this, 'body_class' ) );
// Add our scripts.
- wp_enqueue_script( 'the-neverending-homepage', plugins_url( 'infinity.js', __FILE__ ), array( 'jquery' ), '3.10', true );
+ wp_enqueue_script( 'the-neverending-homepage', plugins_url( 'infinity.js', __FILE__ ), array( 'jquery' ), '4.0.0', true );
// Add our default styles.
wp_enqueue_style( 'the-neverending-homepage', plugins_url( 'infinity.css', __FILE__ ), array(), '20140422' );
@@ -1428,7 +1428,7 @@ class The_Neverending_Home_Page {
*/
private function default_footer() {
$credits = sprintf(
- '<a href="http://wordpress.org/" rel="generator">%1$s</a> ',
+ '<a href="http://wordpress.org/" target="_blank" rel="generator">%1$s</a> ',
__( 'Proudly powered by WordPress', 'jetpack' )
);
$credits .= sprintf(
@@ -1450,7 +1450,7 @@ class The_Neverending_Home_Page {
<div id="infinite-footer">
<div class="container">
<div class="blog-info">
- <a id="infinity-blog-title" href="<?php echo home_url( '/' ); ?>" rel="home">
+ <a id="infinity-blog-title" href="<?php echo home_url( '/' ); ?>" target="_blank" rel="home">
<?php bloginfo( 'name' ); ?>
</a>
</div>
diff --git a/plugins/jetpack/modules/likes/post-count.js b/plugins/jetpack/modules/likes/post-count.js
index bf987f06..c531fe84 100644
--- a/plugins/jetpack/modules/likes/post-count.js
+++ b/plugins/jetpack/modules/likes/post-count.js
@@ -19,9 +19,11 @@ var wpPostLikeCount = wpPostLikeCount || {};
},
showCount: function( post_id, count ) {
- $( '#post-like-count-' + post_id ).find( '.comment-count' ).hide();
- $( '#post-like-count-' + post_id ).find( '.comment-count' ).text( count );
- $( '#post-like-count-' + post_id ).find( '.comment-count' ).fadeIn();
+ if ( count > 0 ) {
+ $( '#post-like-count-' + post_id ).find( '.comment-count' ).hide();
+ $( '#post-like-count-' + post_id ).find( '.comment-count' ).text( count );
+ $( '#post-like-count-' + post_id ).find( '.comment-count' ).fadeIn();
+ }
},
getCounts: function() {
diff --git a/plugins/jetpack/modules/manage/confirm-admin.php b/plugins/jetpack/modules/manage/confirm-admin.php
index da0dce95..ed7e2e98 100644
--- a/plugins/jetpack/modules/manage/confirm-admin.php
+++ b/plugins/jetpack/modules/manage/confirm-admin.php
@@ -23,7 +23,7 @@ switch( $section ) {
break;
case 'themes':
- $link = 'https://wordpress.com/plugins/' . $normalized_site_url;
+ $link = 'https://wordpress.com/design/' . $normalized_site_url;
$link_title = __( 'Manage Your Themes', 'jetpack' );
break;
diff --git a/plugins/jetpack/modules/minileven.php b/plugins/jetpack/modules/minileven.php
index 2da8345a..674e7cf7 100644
--- a/plugins/jetpack/modules/minileven.php
+++ b/plugins/jetpack/modules/minileven.php
@@ -100,8 +100,8 @@ function minileven_configuration_screen() {
</form>
<h3><?php _e( 'Mobile Apps', 'jetpack' ); ?></h3>
<p><?php _e( 'Take WordPress with you.', 'jetpack' ); ?></p>
- <a href="https://wordpress.org/mobile/"><img src="<?php echo plugin_dir_url( __FILE__ ); ?>/minileven/images/wp-app-devices.png" width="332" height="73" /></a>
- <p><?php printf( __( 'We have apps for <a href="%s">iOS (iPhone, iPad, iPod Touch) and Android</a>!', 'jetpack' ), 'https://apps.wordpress.org/' ); ?></p>
+ <a href="https://wordpress.org/mobile/" target="_blank"><img src="<?php echo plugin_dir_url( __FILE__ ); ?>/minileven/images/wp-app-devices.png" width="332" height="73" /></a>
+ <p><?php printf( __( 'We have apps for <a href="%s" target="_blank">iOS (iPhone, iPad, iPod Touch) and Android</a>!', 'jetpack' ), 'https://apps.wordpress.org/' ); ?></p>
<?php
}
diff --git a/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php b/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php
index 5737040b..762fd733 100644
--- a/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php
+++ b/plugins/jetpack/modules/minileven/theme/pub/minileven/footer.php
@@ -56,7 +56,7 @@
do_action( 'minileven_credits' );
?>
- <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'jetpack' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'jetpack' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'jetpack' ), 'WordPress' ); ?></a>
+ <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'jetpack' ) ); ?>" target="_blank" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'jetpack' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'jetpack' ), 'WordPress' ); ?></a>
</div>
</footer><!-- #colophon -->
diff --git a/plugins/jetpack/modules/module-info.php b/plugins/jetpack/modules/module-info.php
index 857900a8..b0582ea9 100644
--- a/plugins/jetpack/modules/module-info.php
+++ b/plugins/jetpack/modules/module-info.php
@@ -19,7 +19,7 @@ function vaultpress_jetpack_load_more_link() {
$vaultpress_url = 'http://vaultpress.com/jetpack/';
}
- echo '<a class="button-secondary more-info-link" href="' . $vaultpress_url . '">' . __( "Learn More", 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="' . $vaultpress_url . '" target="_blank">' . __( "Learn More", 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_vaultpress', 'vaultpress_jetpack_load_more_link' );
@@ -32,17 +32,17 @@ function vaultpress_jetpack_more_info() {
?>
<div class="jp-info-img">
- <a href="<?php echo $vaultpress_url?>">
+ <a href="<?php echo $vaultpress_url?>" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/vaultpress.jpg' ) ?>" alt="<?php esc_attr_e( 'VaultPress', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
<?php if ( class_exists( 'VaultPress' ) || function_exists( 'vaultpress_contact_service' ) ) : ?>
<p><?php esc_html_e( 'Your WordPress installation is currently being protected with the world&#8217;s best security, backup, and support.', 'jetpack' ); ?></p>
- <p><?php printf( _x( 'To check your backups, see any security alerts, or check your VaultPress Vitality, visit your %s.', 'Visit your _VaultPress_dashboard_.', 'jetpack' ), '<a href="https://dashboard.vaultpress.com/">' . esc_html__( 'VaultPress dashboard', 'jetpack' ) . '</a>' ); ?></a></p>
+ <p><?php printf( _x( 'To check your backups, see any security alerts, or check your VaultPress Vitality, visit your %s.', 'Visit your _VaultPress_dashboard_.', 'jetpack' ), '<a href="https://dashboard.vaultpress.com/" target="_blank">' . esc_html__( 'VaultPress dashboard', 'jetpack' ) . '</a>' ); ?></a></p>
<?php else : ?>
<p><?php esc_html_e( 'With a monthly subscription, the VaultPress plugin will backup your site&#8217;s content, themes, and plugins in real-time, as well as perform regular security scans for common threats and attacks.', 'jetpack' ); ?></p>
- <p><?php printf( _x( 'View %s.', 'View _Plans_&_Pricing_. (VaultPress)', 'jetpack' ), '<a href="' . $vaultpress_url . '">' . esc_html__( 'Plans & Pricing', 'jetpack' ) . '</a>' ); ?></a></p>
+ <p><?php printf( _x( 'View %s.', 'View _Plans_&_Pricing_. (VaultPress)', 'jetpack' ), '<a href="' . $vaultpress_url . '" target="_blank">' . esc_html__( 'Plans & Pricing', 'jetpack' ) . '</a>' ); ?></a></p>
<?php endif;
}
add_action( 'jetpack_module_more_info_vaultpress', 'vaultpress_jetpack_more_info' );
@@ -51,13 +51,13 @@ add_action( 'jetpack_module_more_info_vaultpress', 'vaultpress_jetpack_more_info
* Gravatar Hovercards
*/
function grofiles_load_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://blog.gravatar.com/2010/10/06/gravatar-hovercards-on-wordpress-com/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://blog.gravatar.com/2010/10/06/gravatar-hovercards-on-wordpress-com/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_gravatar-hovercards', 'grofiles_load_more_link' );
function grofiles_more_info() { ?>
<div class="jp-info-img">
- <a href="http://blog.gravatar.com/2010/10/06/gravatar-hovercards-on-wordpress-com/">
+ <a href="http://blog.gravatar.com/2010/10/06/gravatar-hovercards-on-wordpress-com/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/hovercards.jpg' ) ?>" alt="<?php esc_attr_e( 'Gravatar Hovercard', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
@@ -73,13 +73,13 @@ add_action( 'jetpack_module_more_info_gravatar-hovercards', 'grofiles_more_info'
* Shortcodes
*/
function jetpack_shortcodes_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/shortcodes/">' . esc_html__( 'Learn More' , 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/shortcodes/" target="_blank">' . esc_html__( 'Learn More' , 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_shortcodes', 'jetpack_shortcodes_load_more_link' );
function jetpack_shortcodes_more_info() { ?>
<div class="jp-info-img">
- <a href="http://en.support.wordpress.com/shortcodes/">
+ <a href="http://en.support.wordpress.com/shortcodes/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/shortcodes.jpg' ) ?>" alt="<?php esc_attr_e( 'Shortcode Embeds', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
@@ -90,13 +90,19 @@ function jetpack_shortcodes_more_info() { ?>
$codes = array( 'archives' => 'http://support.wordpress.com/archives-shortcode/',
'bandcamp' => 'http://en.support.wordpress.com/audio/bandcamp/',
'blip.tv' => 'http://support.wordpress.com/videos/bliptv/',
+ 'cartodb' => 'https://en.support.wordpress.com/cartodb-embeds/',
+ 'codepen' => 'https://en.support.wordpress.com/codepen-embeds/',
'dailymotion' => 'http://support.wordpress.com/videos/dailymotion/',
'facebook' => 'http://en.support.wordpress.com/facebook-integration/facebook-embeds/',
'flickr' => 'http://support.wordpress.com/videos/flickr-video/',
'gist' => 'http://en.support.wordpress.com/gist/',
'googlemaps' => 'http://support.wordpress.com/google-maps/',
+ 'googleplus' => 'https://en.support.wordpress.com/google-plus-embeds/',
+ 'houzz' => 'https://en.support.wordpress.com/houzz-embeds/',
'instagram' => 'https://en.support.wordpress.com/instagram/instagram-images/',
- 'jetpack_subscription_form' => 'http://jetpack.com/support/subscriptions/#display',
+ 'jetpack_subscription_form' => 'http://jetpack.com/support/subscriptions/#shortcode',
+ 'medium' => '',
+ 'mixcloud' => 'https://en.support.wordpress.com/mixcloud-audio-player/',
'polldaddy' => 'http://support.polldaddy.com/wordpress-shortcodes/',
'presentation' => 'http://en.support.wordpress.com/presentations/',
'recipes' => 'http://en.support.wordpress.com/recipes/',
@@ -105,10 +111,12 @@ function jetpack_shortcodes_more_info() { ?>
'slideshow' => 'http://en.support.wordpress.com/slideshows/',
'soundcloud' => 'http://support.wordpress.com/audio/soundcloud-audio-player/',
'ted' => 'http://en.support.wordpress.com/videos/ted-talks/',
+ 'twitchtv' => 'https://en.support.wordpress.com/videos/twitch-tv-shortcode/',
'twitter-timeline' => 'http://en.support.wordpress.com/widgets/twitter-timeline-widget/#embedding-with-a-shortcode',
// 'upcomingevents' => 'http://en.support.wordpress.com/widgets/upcoming-events/#events-list-shortcode',
'vimeo' => 'http://support.wordpress.com/videos/vimeo/',
'vine' => 'http://en.support.wordpress.com/videos/vine/',
+ 'wufoo' => 'https://en.support.wordpress.com/wufoo/',
'youtube' => 'http://support.wordpress.com/videos/youtube/',
);
@@ -129,13 +137,13 @@ add_action( 'jetpack_module_more_info_shortcodes', 'jetpack_shortcodes_more_info
* Shortlinks
*/
function wpme_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://wp.me/sf2B5-shorten">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://wp.me/sf2B5-shorten" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_shortlinks', 'wpme_load_more_link' );
function wpme_more_info() { ?>
<div class="jp-info-img">
- <a href="http://wp.me/sf2B5-shorten">
+ <a href="http://wp.me/sf2B5-shorten" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/shortlinks.jpg' ) ?>" alt="<?php esc_attr_e( 'WP.me Shortlinks', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
@@ -151,13 +159,13 @@ add_action( 'jetpack_module_more_info_shortlinks', 'wpme_more_info' );
* Site Stats
*/
function stats_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/stats/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/stats/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_stats', 'stats_load_more_link' );
function stats_more_info() { ?>
<div class="jp-info-img">
- <a href="http://en.support.wordpress.com/stats/">
+ <a href="http://en.support.wordpress.com/stats/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/stats.jpg' ) ?>" alt="<?php esc_attr_e( 'Site Stats', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
@@ -172,19 +180,19 @@ add_action( 'jetpack_module_more_info_stats', 'stats_more_info' );
* Publicize
*/
function publicize_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/publicize/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/publicize/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_publicize', 'publicize_load_more_link' );
function publicize_more_info() { ?>
<div class="jp-info-img">
- <a href="http://en.support.wordpress.com/publicize/">
+ <a href="http://en.support.wordpress.com/publicize/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/publicize.jpg' ) ?>" alt="<?php esc_attr_e( 'Publicize', 'jetpack' ) ?>" width="328" height="123" />
</a>
</div>
<p><?php esc_html_e( 'Publicize allows you to connect your blog to popular social networking sites and automatically share new posts with your friends. You can make a connection for just yourself or for all users on your blog.', 'jetpack' ) ?></p>
- <p><?php esc_html_e( 'Publicize allows you to share your posts on Facebook, Twitter, Tumblr, Yahoo!, and Linkedin.', 'jetpack' ); ?></p>
+ <p><?php esc_html_e( 'Publicize allows you to share your posts on Facebook, Twitter, Tumblr, Google+, Path, and Linkedin.', 'jetpack' ); ?></p>
<?php if ( 'jetpack_module_more_info_connected_publicize' == current_filter() ) : ?>
@@ -192,7 +200,7 @@ function publicize_more_info() { ?>
<?php endif; ?>
- <p>&rarr; <a href="http://jetpack.com/support/publicize/"><?php esc_html_e( 'More information on using Publicize.', 'jetpack' ); ?></a></p>
+ <p>&rarr; <a href="http://jetpack.com/support/publicize/" target="_blank"><?php esc_html_e( 'More information on using Publicize.', 'jetpack' ); ?></a></p>
<?php
}
add_action( 'jetpack_module_more_info_publicize', 'publicize_more_info' );
@@ -201,19 +209,19 @@ add_action( 'jetpack_module_more_info_publicize', 'publicize_more_info' );
* Notifications
*/
function notes_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/notifications/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/notifications/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_notes', 'notes_load_more_link' );
function notes_more_info() { ?>
<div class="jp-info-img">
- <a href="http://support.wordpress.com/notifications/">
+ <a href="http://support.wordpress.com/notifications/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/notes.jpg' ) ?>" alt="<?php esc_attr_e( 'Notifications', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
<p><?php esc_html_e( 'Keep up with the latest happenings on all your WordPress sites and interact with other WordPress.com users.', 'jetpack' ) ?></p>
- <p><?php printf( __( 'You can view your notifications in the Toolbar and <a href="%s">on WordPress.com</a>.', 'jetpack' ), 'http://wordpress.com/#!/notifications/' ); ?></p>
+ <p><?php printf( __( 'You can view your notifications in the Toolbar and <a href="%s" target="_blank">on WordPress.com</a>.', 'jetpack' ), 'http://wordpress.com/#!/notifications/' ); ?></p>
<?php
}
add_filter( 'jetpack_module_more_info_notes', 'notes_more_info' );
@@ -222,13 +230,13 @@ add_filter( 'jetpack_module_more_info_notes', 'notes_more_info' );
* LaTeX
*/
function latex_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/latex/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/latex/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_latex', 'latex_load_more_link' );
function latex_more_info() { ?>
<div class="jp-info-img">
- <a href="http://support.wordpress.com/latex/">
+ <a href="http://support.wordpress.com/latex/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/beautifulmath.jpg' ) ?>" alt="<?php esc_attr_e( 'LaTeX', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
@@ -245,7 +253,7 @@ add_action( 'jetpack_module_more_info_latex', 'latex_more_info' );
* Sharing
*/
function sharedaddy_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/sharing/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/sharing/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_sharedaddy', 'sharedaddy_load_more_link' );
@@ -274,7 +282,7 @@ function sharedaddy_more_info() { ?>
}
?>
- <p><?php printf( __( 'Full details can be found on the <a href="%s">Sharing support page</a>. This video also gives a swish run-down of how to use the Sharing feature. Watch it in HD for extra snazz!', 'jetpack' ), 'http://support.wordpress.com/sharing/' ); ?></p>
+ <p><?php printf( __( 'Full details can be found on the <a href="%s" target="_blank">Sharing support page</a>. This video also gives a swish run-down of how to use the Sharing feature. Watch it in HD for extra snazz!', 'jetpack' ), 'http://support.wordpress.com/sharing/' ); ?></p>
<?php
}
add_action( 'jetpack_module_more_info_sharedaddy', 'sharedaddy_more_info' );
@@ -283,18 +291,18 @@ add_action( 'jetpack_module_more_info_sharedaddy', 'sharedaddy_more_info' );
* After The Deadline
*/
function jpatd_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/proofreading/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/proofreading/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_after-the-deadline', 'jpatd_load_more_link' );
function jpatd_more_info() { ?>
<div class="jp-info-img">
- <a href="http://en.support.wordpress.com/proofreading/">
+ <a href="http://en.support.wordpress.com/proofreading/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/spelling.jpg' ) ?>" alt="<?php esc_attr_e( 'Spelling and Grammar', 'jetpack' ) ?>" width="300" height="150" />
</a>
</div>
- <p><?php printf( __( "The <a href='%s'>After&nbsp;the&nbsp;Deadline</a> Proofreading service improves your writing by using artificial intelligence to find your errors and offer smart suggestions.", 'jetpack' ), 'http://www.afterthedeadline.com/' ); ?></p>
+ <p><?php printf( __( "The <a href='%s' target='_blank'>After&nbsp;the&nbsp;Deadline</a> Proofreading service improves your writing by using artificial intelligence to find your errors and offer smart suggestions.", 'jetpack' ), 'http://www.afterthedeadline.com/' ); ?></p>
<p><?php printf( __( 'After the Deadline provides a number of <a href="%s">customization options</a>, which you can edit in your profile.', 'jetpack' ), esc_url( get_edit_profile_url( get_current_user_id() ) ) . '#atd' ); ?></p>
<?php
}
@@ -304,7 +312,7 @@ add_action( 'jetpack_module_more_info_after-the-deadline', 'jpatd_more_info' );
* Extra Sidebar Widgets
*/
function jetpack_widgets_load_more_link( $description ) {
- echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/widgets/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/widgets/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_filter( 'jetpack_learn_more_button_widgets', 'jetpack_widgets_load_more_link' );
@@ -315,11 +323,14 @@ function jetpack_widgets_more_info() { ?>
<p><?php printf( __( '<strong>The Twitter Widget</strong> shows your latest tweets within a sidebar on your theme.', 'jetpack' ) ); ?></p>
<p><?php printf( __( '<strong>The Facebook Like Box Widget</strong> shows your Facebook Like Box within a sidebar on your theme.', 'jetpack' ) ); ?></p>
+ <p><?php printf( __( '<strong>The Google+ Badge Widget</strong> allows you to display information about a person, a page, or a community from Google+.', 'jetpack' ) ); ?></p>
<p><?php printf( __( '<strong>The Image Widget</strong> lets you easily add images to a sidebar on your theme.', 'jetpack' ) ); ?></strong> <?php esc_html_e( '', 'jetpack' ) ?></p>
<p><?php printf( __( '<strong>The Gravatar Widget</strong> allows you to pull in your Gravatar image along with some of your Gravatar profile data.', 'jetpack' ) ); ?></p>
<p><?php printf( __( '<strong>The Gallery Widget</strong> provides you with a simple way to display a photo gallery or slideshow in your blog’s sidebar. Requires the Tiled Gallery module.', 'jetpack' ) ); ?></p>
<p><?php printf( __( '<strong>The Display WordPress Posts Widget</strong> lets you display up to ten recent posts from another WordPress.com blog, or a self-hosted WordPress site with Jetpack enabled.', 'jetpack' ) ); ?></p>
<p><?php printf( __( '<strong>The Social Media Icons Widget</strong> lets you add icons for the most popular social networks to your sidebar or other widget area.', 'jetpack' ) ); ?></p>
+ <p><?php printf( __( '<strong>The Contact Info Widget</strong> helps you display important information about your business. The widget allows you to show your business on a map, as well as your opening hours and contact information.', 'jetpack' ) ); ?></p>
+ <p><?php printf( __( '<strong>The Goodreads Widget</strong> lets you display your Goodreads Shelf in your sidebar.', 'jetpack' ) ); ?></p>
<!--<p><?php printf( __( '<strong>The Upcoming Events Widget</strong> allows you to use an iCalendar link to display a list of events on your site.', 'jetpack' ) ); ?></p>-->
<p><?php esc_html_e( 'Each of these widgets has a number of customization options.', 'jetpack' ); ?> <?php printf( __( 'To use the widgets, go to Appearance &#8594; <a href="%s">Widgets</a>. Drag them into one of your sidebars and configure away.', 'jetpack' ), admin_url( 'widgets.php' ) ); ?></p>
@@ -331,7 +342,7 @@ add_action( 'jetpack_module_more_info_widgets', 'jetpack_widgets_more_info' );
* Subscriptions
*/
function jetpack_subscriptions_load_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/following/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/following/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_subscriptions', 'jetpack_subscriptions_load_more_link' );
@@ -363,7 +374,7 @@ add_action( 'jetpack_module_more_info_subscriptions', 'jetpack_subscriptions_mor
* Enhanced Distribution
*/
function jetpack_enhanced_distribution_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://en.wordpress.com/firehose/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://en.wordpress.com/firehose/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_enhanced-distribution', 'jetpack_enhanced_distribution_more_link' );
@@ -378,7 +389,7 @@ add_action( 'jetpack_module_more_info_enhanced-distribution', 'jetpack_enhanced_
* Protect
*/
function jetpack_protect_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/protect/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/protect/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_protect', 'jetpack_protect_more_link' );
@@ -396,14 +407,14 @@ add_action( 'jetpack_module_more_info_protect', 'jetpack_protect_more_info' );
* JSON API
*/
function jetpack_json_api_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/json-api/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/json-api/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_json-api', 'jetpack_json_api_more_link' );
function jetpack_json_api_more_info() { ?>
<p><?php esc_html_e( 'Jetpack will allow you to authorize applications and services to securely connect to your blog and allow them to use your content in new ways and offer you new functionality.', 'jetpack' ); ?>
- <p><?php _e( "Developers can use WordPress.com's <a href='http://developer.wordpress.com/docs/oauth2/'>OAuth2</a> authentication system and <a href='http://developer.wordpress.com/docs/api/'>WordPress.com REST API</a> to manage and access your site's content.", 'jetpack' ); ?></p>
+ <p><?php _e( "Developers can use WordPress.com's <a href='http://developer.wordpress.com/docs/oauth2/' target='_blank'>OAuth2</a> authentication system and <a href='http://developer.wordpress.com/docs/api/' target='_blank'>WordPress.com REST API</a> to manage and access your site's content.", 'jetpack' ); ?></p>
<?php
}
@@ -414,13 +425,13 @@ add_action( 'jetpack_module_more_info_json-api', 'jetpack_json_api_more_info' );
* Contact Form
*/
function jetpack_contact_form_learn_more_button() {
- echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/contact-form/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/contact-form/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_contact-form', 'jetpack_contact_form_learn_more_button' );
function jetpack_contact_form_more_info() {
echo '<div class="jp-info-img">';
- echo '<a href="http://support.wordpress.com/contact-form/">';
+ echo '<a href="http://support.wordpress.com/contact-form/" target="_blank">';
echo '<img class="jp-info-img" src="' . plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/contactform.jpg' ) . '" alt="' . esc_attr__( 'Contact Form', 'jetpack' ) . '" width="300" height="150" />';
echo '</a>';
echo '</div>';
@@ -431,7 +442,7 @@ function jetpack_contact_form_more_info() {
echo '<p>';
printf(
- __( 'Each contact form can easily be customized to fit your needs. When a user submits your contact form, the feedback will be filtered through <a href="http://akismet.com/">Akismet</a> (if it is <a href="%s">active on your site</a>) to make sure it’s not spam. Any legitimate feedback will then be emailed to you, and added to your feedback management area.', 'jetpack' ),
+ __( 'Each contact form can easily be customized to fit your needs. When a user submits your contact form, the feedback will be filtered through <a href="http://akismet.com/" target="_blank">Akismet</a> (if it is <a href="%s">active on your site</a>) to make sure it’s not spam. Any legitimate feedback will then be emailed to you, and added to your feedback management area.', 'jetpack' ),
admin_url( 'plugin-install.php?tab=search&s=akismet' )
);
echo '</p>';
@@ -538,7 +549,7 @@ function jetpack_infinite_scroll_more_button() {
add_action( 'jetpack_learn_more_button_infinite-scroll', 'jetpack_infinite_scroll_more_button' );
function jetpack_infinite_scroll_more_info() {
- $support_text = sprintf( __( 'If you are a theme author, you can learn about adding support for Infinite Scroll at <a href="%1$s">%1$s</a>.', 'jetpack' ), 'http://jetpack.com/support/infinite-scroll/' );
+ $support_text = sprintf( __( 'If you are a theme author, you can learn about adding support for Infinite Scroll at <a href="%1$s" target="_blank">%1$s</a>.', 'jetpack' ), 'http://jetpack.com/support/infinite-scroll/' );
?>
@@ -575,7 +586,7 @@ add_action( 'jetpack_module_more_info_infinite-scroll', 'jetpack_infinite_scroll
* Post by Email
*/
function jetpack_post_by_email_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/post-by-email/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/post-by-email/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_post-by-email', 'jetpack_post_by_email_more_link' );
@@ -588,7 +599,7 @@ function jetpack_post_by_email_more_info() { ?>
<p><?php printf( __( 'Manage your Post By Email address from your <a href="%s">profile settings</a>.', 'jetpack' ), esc_url( get_edit_profile_url( get_current_user_id() ) . '#post-by-email' ) ); ?>
- <p>&rarr; <a href="http://jetpack.com/support/post-by-email/"><?php esc_html_e( 'More information on sending emails, attachments, and customizing your posts.', 'jetpack' ); ?></a></p>
+ <p>&rarr; <a href="http://jetpack.com/support/post-by-email/" target="_blank"><?php esc_html_e( 'More information on sending emails, attachments, and customizing your posts.', 'jetpack' ); ?></a></p>
<?php
}
@@ -639,7 +650,7 @@ add_action( 'jetpack_learn_more_button_likes', 'jetpack_likes_more_link' );
function jetpack_likes_more_info() { ?>
<div class="jp-info-img">
- <a href="http://jetpack.com/support/likes/">
+ <a href="http://jetpack.com/support/likes/" target="_blank">
<img class="jp-info-img" src="<?php echo plugins_url( basename( dirname( dirname( __FILE__ ) ) ) . '/images/screenshots/likes.jpg' ) ?>" alt="<?php esc_attr_e( 'Likes', 'jetpack' ) ?>" width="323" height="69" />
</a>
</div>
@@ -654,7 +665,7 @@ function jetpack_likes_more_info() { ?>
<li><?php esc_html_e( 'Ensure that "WordPress.com Likes are…" is set to "On for all posts"', 'jetpack' ); ?></li>
</ol>
<?php endif; ?>
- <p>&rarr; <a href="http://jetpack.com/support/likes/"><?php esc_html_e( 'More information on using Likes.', 'jetpack' ); ?></a></p>
+ <p>&rarr; <a href="http://jetpack.com/support/likes/" target="_blank"><?php esc_html_e( 'More information on using Likes.', 'jetpack' ); ?></a></p>
<?php
}
@@ -664,7 +675,7 @@ add_action( 'jetpack_module_more_info_likes', 'jetpack_likes_more_info' );
* Omnisearch
*/
function jetpack_omnisearch_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/omnisearch/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/omnisearch/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_omnisearch', 'jetpack_omnisearch_more_link' );
@@ -686,7 +697,7 @@ add_action( 'jetpack_module_more_info_omnisearch', 'jetpack_omnisearch_more_inf
* Widget Visibility
*/
function jetpack_widget_visibility_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/widget-visibility/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/widget-visibility/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_widget-visibility', 'jetpack_widget_visibility_more_link' );
@@ -721,7 +732,7 @@ add_action( 'jetpack_module_more_info_videopress', 'jetpack_videopress_more_info
* SSO
*/
function jetpack_sso_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/sso/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/sso/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_sso', 'jetpack_sso_more_link' );
@@ -738,7 +749,7 @@ add_action( 'jetpack_module_more_info_sso', 'jetpack_sso_more_info' );
* Monitor
*/
function jetpack_monitor_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/monitor/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/monitor/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_monitor', 'jetpack_monitor_more_link' );
@@ -763,13 +774,13 @@ add_action( 'jetpack_learn_more_button_related-posts', 'jetpack_related_posts_mo
function jetpack_related_posts_more_info() {
$template = <<<EOT
<div class="jp-info-img">
- <a href="http://jetpack.com/support/related-posts/">
+ <a href="http://jetpack.com/support/related-posts/" target="_blank">
<img class="jp-info-img" src="%s" alt="%s" width="300" height="98" />
</a>
</div>
<p>%s</p>
- <p>&rarr; <a href="http://jetpack.com/support/related-posts/">%s</a></p>
+ <p>&rarr; <a href="http://jetpack.com/support/related-posts/" target="_blank">%s</a></p>
<hr />
<p><a href="%s#sync-related-posts">%s</a></p>
EOT;
@@ -789,7 +800,7 @@ add_action( 'jetpack_module_more_info_related-posts', 'jetpack_related_posts_mor
* Markdown
*/
function jetpack_markdown_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/markdown/">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://en.support.wordpress.com/markdown/" target="_blank">' . esc_html__( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_markdown', 'jetpack_markdown_more_link' );
@@ -804,7 +815,7 @@ add_action( 'jetpack_module_more_info_markdown', 'jetpack_markdown_more_info' );
* Site Verification Tools
*/
function jetpack_verification_tools_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/webmaster-tools/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/webmaster-tools/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_verification-tools', 'jetpack_verification_tools_more_link' );
@@ -819,7 +830,7 @@ add_action( 'jetpack_module_more_info_verification-tools', 'jetpack_verification
* Custom Content Types
*/
function jetpack_custom_content_types_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/portfolios/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://support.wordpress.com/portfolios/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_custom-content-types', 'jetpack_custom_content_types_more_link' );
@@ -850,7 +861,7 @@ function jetpack_custom_content_types_more_info() { ?>
<?php else : ?>
- <p><?php esc_html_e( 'Once activated, you can selectively activate the content types you need at Settings &rarr; Writing &rarr; Your Custom Content Types.'); ?></p>
+ <p><?php esc_html_e( 'Once activated, you can selectively activate the content types you need at Settings &rarr; Writing &rarr; Your Custom Content Types.', 'jetpack'); ?></p>
<p><?php echo wp_kses( sprintf( __( 'Full details can be found on the <a href="%s" title="Custom Content Types support page" target="_blank">Custom Content Types support page</a>.', 'jetpack' ), 'https://jetpack.com/support/custom-content-types/' ), array( 'a' => array( 'href' => true, 'title' => true, 'target' => true ) ) ); ?></p>
@@ -862,7 +873,7 @@ add_action( 'jetpack_module_more_info_custom-content-types', 'jetpack_custom_con
* Site Icon
*/
function jetpack_site_icon_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/site-icon">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/site-icon" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_site-icon', 'jetpack_site_icon_more_link' );
@@ -883,7 +894,7 @@ add_action( 'jetpack_module_more_info_site-icon', 'jetpack_custom_site_icon' );
* Manage
*/
function jetpack_manage_more_link() {
- echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/site-management/">' . __( 'Learn More', 'jetpack' ) . '</a>';
+ echo '<a class="button-secondary more-info-link" href="http://jetpack.com/support/site-management/" target="_blank">' . __( 'Learn More', 'jetpack' ) . '</a>';
}
add_action( 'jetpack_learn_more_button_manage', 'jetpack_manage_more_link' );
@@ -895,13 +906,13 @@ function jetpack_custom_jetpack_manage() { ?>
<p><em><?php esc_html_e( 'Enabling Manage allows you to update your self-hosted WordPress sites along with any WordPress.com sites you have, all in one simple dashboard.', 'jetpack' ); ?></em></p>
<p><strong><?php _e( 'Plugins', 'jetpack' ); ?></strong><br />
- <?php printf( __( 'Now you can update plugins, set plugins to automatically update, and activate or deactivate plugins on a per-site basis or in bulk from <a href="%s">wordpress.com/plugins</a>.', 'jetpack' ), 'https://wordpress.com/plugins' ); ?></p>
+ <?php printf( __( 'Now you can update plugins, set plugins to automatically update, and activate or deactivate plugins on a per-site basis or in bulk from <a href="%s" target="_blank">wordpress.com/plugins</a>.', 'jetpack' ), 'https://wordpress.com/plugins' ); ?></p>
<p><strong><?php _e( 'Themes', 'jetpack' ); ?></strong><br />
- <?php printf( __( 'List your installed themes, search, and activate them from <a href="%s">wordpress.com/design</a>.', 'jetpack' ), 'https://wordpress.com/design' ); ?></p>
+ <?php printf( __( 'List your installed themes, search, and activate them from <a href="%s" target="_blank">wordpress.com/design</a>.', 'jetpack' ), 'https://wordpress.com/design' ); ?></p>
<p><strong><?php _e( 'Menus', 'jetpack' ); ?></strong><br />
- <?php printf( __( 'Create a new menu for your site, or edit existing menus from <a href="%s">wordpress.com/menus</a>.', 'jetpack' ), 'https://wordpress.com/menus' ); ?></p>
+ <?php printf( __( 'Create a new menu for your site, or edit existing menus from <a href="%s" target="_blank">wordpress.com/menus</a>.', 'jetpack' ), 'https://wordpress.com/menus' ); ?></p>
<?php
}
@@ -940,7 +951,7 @@ function jetpack_xml_sitemap_more_info() { ?>
</li>
</ul>
<?php endif; ?>
- <p>&rarr; <a href="http://jetpack.com/support/sitemaps/"><?php esc_html_e( 'More information on Sitemaps.', 'jetpack' ); ?></a></p>
+ <p>&rarr; <a href="http://jetpack.com/support/sitemaps/" target="_blank"><?php esc_html_e( 'More information on Sitemaps.', 'jetpack' ); ?></a></p>
<?php
}
add_action( 'jetpack_module_more_info_sitemaps', 'jetpack_xml_sitemap_more_info' );
diff --git a/plugins/jetpack/modules/monitor.php b/plugins/jetpack/modules/monitor.php
index 812e41ce..93a93f17 100644
--- a/plugins/jetpack/modules/monitor.php
+++ b/plugins/jetpack/modules/monitor.php
@@ -154,7 +154,7 @@ class Jetpack_Monitor {
/*
* Returns date of the last downtime.
*
- * @since 4.0
+ * @since 4.0.0
* @return date in YYYY-MM-DD HH:mm:ss format
*/
public function monitor_get_last_downtime() {
diff --git a/plugins/jetpack/modules/omnisearch/omnisearch-core.php b/plugins/jetpack/modules/omnisearch/omnisearch-core.php
index 9b82a7da..7a097747 100644
--- a/plugins/jetpack/modules/omnisearch/omnisearch-core.php
+++ b/plugins/jetpack/modules/omnisearch/omnisearch-core.php
@@ -42,7 +42,7 @@ class Jetpack_Omnisearch {
*
* Can be used to add your own Omnisearch provider.
*
- * @module minileven
+ * @module omnisearch
*
* @since 2.3.2
*/
@@ -93,7 +93,7 @@ class Jetpack_Omnisearch {
/**
* Filter the results returned for a given Omnisearch search query.
*
- * @module minileven
+ * @module omnisearch
*
* @since 2.3.0
*
@@ -105,7 +105,7 @@ class Jetpack_Omnisearch {
/**
* Filter the number of results displayed for each Omnisearch searched section.
*
- * @module minileven
+ * @module omnisearch
*
* @since 2.3.0
*
@@ -220,7 +220,7 @@ class Jetpack_Omnisearch {
/**
* Filters the Omnisearch search form output.
*
- * @module minileven
+ * @module omnisearch
*
* @since 2.3.0
*
diff --git a/plugins/jetpack/modules/protect.php b/plugins/jetpack/modules/protect.php
index d1b92de7..7f0bcb48 100644
--- a/plugins/jetpack/modules/protect.php
+++ b/plugins/jetpack/modules/protect.php
@@ -64,19 +64,16 @@ class Jetpack_Protect_Module {
// Runs a script every day to clean up expired transients so they don't
// clog up our users' databases
require_once( JETPACK__PLUGIN_DIR . '/modules/protect/transient-cleanup.php' );
-
- //this should move into on_activation in 3.8, but, for now, we want to make sure all sites get this option set
- if ( is_multisite() && is_main_site() ) {
- update_site_option( 'jetpack_protect_active', 1 );
- }
-
-
}
/**
* On module activation, try to get an api key
*/
public function on_activation() {
+ if ( is_multisite() && is_main_site() && get_site_option( 'jetpack_protect_active', 0 ) == 0 ) {
+ update_site_option( 'jetpack_protect_active', 1 );
+ }
+
update_site_option( 'jetpack_protect_activating', 'activating' );
// Get BruteProtect's counter number
diff --git a/plugins/jetpack/modules/publicize/enhanced-open-graph.php b/plugins/jetpack/modules/publicize/enhanced-open-graph.php
index 207756c1..eb9f7e73 100644
--- a/plugins/jetpack/modules/publicize/enhanced-open-graph.php
+++ b/plugins/jetpack/modules/publicize/enhanced-open-graph.php
@@ -1,6 +1,11 @@
<?php
-if ( ! class_exists( 'Jetpack_Media_Summary' ) && defined('IS_WPCOM') && IS_WPCOM )
- include WP_CONTENT_DIR . '/lib/class.wpcom-media-summary.php';
+if ( ! class_exists( 'Jetpack_Media_Summary' ) ) {
+ if ( defined('IS_WPCOM') && IS_WPCOM ) {
+ include WP_CONTENT_DIR . '/lib/class.wpcom-media-summary.php';
+ } else {
+ jetpack_require_lib( 'class.media-summary' );
+ }
+}
/**
* Better OG Image Tags for Image Post Formats
diff --git a/plugins/jetpack/modules/related-posts/jetpack-related-posts.php b/plugins/jetpack/modules/related-posts/jetpack-related-posts.php
index d7560729..fa1524fa 100644
--- a/plugins/jetpack/modules/related-posts/jetpack-related-posts.php
+++ b/plugins/jetpack/modules/related-posts/jetpack-related-posts.php
@@ -72,6 +72,10 @@ class Jetpack_RelatedPosts {
add_action( 'admin_init', array( $this, 'action_admin_init' ) );
add_action( 'wp', array( $this, 'action_frontend_init' ) );
+
+ if ( ! class_exists( 'Jetpack_Media_Summary' ) ) {
+ jetpack_require_lib( 'class.media-summary' );
+ }
}
/**
diff --git a/plugins/jetpack/modules/sharedaddy/sharedaddy.php b/plugins/jetpack/modules/sharedaddy/sharedaddy.php
index c6b71a5e..ffd7bbc4 100644
--- a/plugins/jetpack/modules/sharedaddy/sharedaddy.php
+++ b/plugins/jetpack/modules/sharedaddy/sharedaddy.php
@@ -13,7 +13,17 @@ require_once plugin_dir_path( __FILE__ ).'sharing.php';
function sharing_email_send_post( $data ) {
$content = sharing_email_send_post_content( $data );
- $headers[] = sprintf( 'From: %1$s <%2$s>', $data['name'], $data['source'] );
+ // Borrowed from wp_mail();
+ $sitename = strtolower( $_SERVER['SERVER_NAME'] );
+ if ( substr( $sitename, 0, 4 ) == 'www.' ) {
+ $sitename = substr( $sitename, 4 );
+ }
+
+ /** This filter is documented in core/src/wp-includes/pluggable.php */
+ $from_email = apply_filters( 'wp_mail_from', 'wordpress@' . $sitename );
+
+ $headers[] = sprintf( 'From: %1$s <%2$s>', $data['name'], $from_email );
+ $headers[] = sprintf( 'Reply-To: %1$s <%2$s>', $data['name'], $data['source'] );
wp_mail( $data['target'], '['.__( 'Shared Post', 'jetpack' ).'] '.$data['post']->post_title, $content, $headers );
}
@@ -174,7 +184,7 @@ function sharing_plugin_settings( $links ) {
function sharing_add_plugin_settings($links, $file) {
if ( $file == basename( dirname( __FILE__ ) ).'/'.basename( __FILE__ ) ) {
$links[] = '<a href="options-general.php?page=sharing.php">' . __( 'Settings', 'jetpack' ) . '</a>';
- $links[] = '<a href="http://support.wordpress.com/sharing/">' . __( 'Support', 'jetpack' ) . '</a>';
+ $links[] = '<a href="http://support.wordpress.com/sharing/" target="_blank">' . __( 'Support', 'jetpack' ) . '</a>';
}
return $links;
diff --git a/plugins/jetpack/modules/sharedaddy/sharing.php b/plugins/jetpack/modules/sharedaddy/sharing.php
index 74ad1059..72dc3a04 100644
--- a/plugins/jetpack/modules/sharedaddy/sharing.php
+++ b/plugins/jetpack/modules/sharedaddy/sharing.php
@@ -159,7 +159,7 @@ class Sharing_Admin {
if ( false == function_exists( 'mb_stripos' ) ) {
echo '<div id="message" class="updated fade"><h3>' . __( 'Warning! Multibyte support missing!', 'jetpack' ) . '</h3>';
- echo "<p>" . sprintf( __( 'This plugin will work without it, but multibyte support is used <a href="%s">if available</a>. You may see minor problems with Tweets and other sharing services.', 'jetpack' ), "http://www.php.net/manual/en/mbstring.installation.php" ) . '</p></div>';
+ echo "<p>" . sprintf( __( 'This plugin will work without it, but multibyte support is used <a href="%s" target="_blank">if available</a>. You may see minor problems with Tweets and other sharing services.', 'jetpack' ), "http://www.php.net/manual/en/mbstring.installation.php" ) . '</p></div>';
}
if ( isset( $_GET['update'] ) && $_GET['update'] == 'saved' )
diff --git a/plugins/jetpack/modules/shortcodes/dailymotion.php b/plugins/jetpack/modules/shortcodes/dailymotion.php
index d538ba38..bd4612ec 100644
--- a/plugins/jetpack/modules/shortcodes/dailymotion.php
+++ b/plugins/jetpack/modules/shortcodes/dailymotion.php
@@ -118,11 +118,11 @@ function dailymotion_shortcode( $atts ) {
$after = '';
if ( array_key_exists( 'video', $atts ) && $video = preg_replace( '/[^-a-z0-9_]/i', '', $atts['video'] ) && array_key_exists( 'title', $atts ) && $title = wp_kses( $atts['title'], array() ) ) {
- $after .= '<br /><strong><a href="' . esc_url( 'http://www.dailymotion.com/video/' . $video ) . '">' . esc_html( $title ) . '</a></strong>';
+ $after .= '<br /><strong><a href="' . esc_url( 'http://www.dailymotion.com/video/' . $video ) . '" target="_blank">' . esc_html( $title ) . '</a></strong>';
}
if ( array_key_exists( 'user', $atts ) && $user = preg_replace( '/[^-a-z0-9_]/i', '', $atts['user'] ) ) {
- $after .= '<br /><em>Uploaded by <a href="' . esc_url( 'http://www.dailymotion.com/' . $user ) . '">' . esc_html( $user ) . '</a></em>';
+ $after .= '<br /><em>Uploaded by <a href="' . esc_url( 'http://www.dailymotion.com/' . $user ) . '" target="_blank">' . esc_html( $user ) . '</a></em>';
}
}
diff --git a/plugins/jetpack/modules/shortcodes/instagram.php b/plugins/jetpack/modules/shortcodes/instagram.php
index 08c8ceb0..cb246d50 100644
--- a/plugins/jetpack/modules/shortcodes/instagram.php
+++ b/plugins/jetpack/modules/shortcodes/instagram.php
@@ -73,7 +73,7 @@ function jetpack_instagram_handler( $matches, $atts, $url ) {
if ( is_feed() ) {
$media_url = sprintf( 'http://instagr.am/p/%s/media/?size=l', $matches[4] );
- return sprintf( '<a href="%s" title="%s"><img src="%s" alt="Instagram Photo" /></a>', esc_url( $url ), esc_attr__( 'View on Instagram', 'jetpack' ), esc_url( $media_url ) );
+ return sprintf( '<a href="%s" title="%s" target="_blank"><img src="%s" alt="Instagram Photo" /></a>', esc_url( $url ), esc_attr__( 'View on Instagram', 'jetpack' ), esc_url( $media_url ) );
}
$atts = shortcode_atts( array(
diff --git a/plugins/jetpack/modules/shortcodes/medium.php b/plugins/jetpack/modules/shortcodes/medium.php
index 2d11cf15..fc0bab5c 100644
--- a/plugins/jetpack/modules/shortcodes/medium.php
+++ b/plugins/jetpack/modules/shortcodes/medium.php
@@ -27,7 +27,7 @@ function jetpack_embed_medium_embed_html( $args ) {
$args['type'] = jetpack_embed_medium_get_embed_type( $args['url'] );
- return sprintf( '<script async src="https://static.medium.com/embed.js"></script><a class="m-%1$s" href="%2$s" data-width="%3$s" data-border="%4$s" data-collapsed="%5$s">View %1$s at Medium.com</a>', esc_attr( $args['type'] ), esc_url( $args['url'] ), esc_attr( $args['width'] ), esc_attr( $args['border'] ), esc_attr( $args['collapsed'] ) );
+ return sprintf( '<script async src="https://static.medium.com/embed.js"></script><a class="m-%1$s" href="%2$s" target="_blank" data-width="%3$s" data-border="%4$s" data-collapsed="%5$s">View %1$s at Medium.com</a>', esc_attr( $args['type'] ), esc_url( $args['url'] ), esc_attr( $args['width'] ), esc_attr( $args['border'] ), esc_attr( $args['collapsed'] ) );
}
/**
diff --git a/plugins/jetpack/modules/shortcodes/polldaddy.php b/plugins/jetpack/modules/shortcodes/polldaddy.php
index dc6bc1c3..70ec89b7 100644
--- a/plugins/jetpack/modules/shortcodes/polldaddy.php
+++ b/plugins/jetpack/modules/shortcodes/polldaddy.php
@@ -251,7 +251,7 @@ CONTAINER;
$poll = intval( $poll );
$poll_url = sprintf( 'http://polldaddy.com/poll/%d', $poll );
$poll_js = sprintf( '%s.polldaddy.com/p/%d.js', ( is_ssl() ? 'https://secure' : 'http://static' ), $poll );
- $poll_link = sprintf( '<a href="%s">Take Our Poll</a>', $poll_url );
+ $poll_link = sprintf( '<a href="%s" target="_blank">Take Our Poll</a>', $poll_url );
if ( $no_script ) {
return $poll_link;
@@ -360,7 +360,7 @@ CONTAINER;
$survey = preg_replace( '/[^a-f0-9]/i', '', $survey );
$survey_url = esc_url( "http://polldaddy.com/s/{$survey}" );
- $survey_link = sprintf( '<a href="%s">%s</a>', $survey_url, esc_html( $title ) );
+ $survey_link = sprintf( '<a href="%s" target="_blank">%s</a>', $survey_url, esc_html( $title ) );
$settings = array();
@@ -565,7 +565,7 @@ new PolldaddyShortcode();
if ( ! function_exists( 'polldaddy_link' ) ) {
// http://polldaddy.com/poll/1562975/?view=results&msg=voted
function polldaddy_link( $content ) {
- return preg_replace( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n<script type='text/javascript' language='javascript' charset='utf-8' src='//static.polldaddy.com/p/$1.js'></script><noscript> <a href='http://polldaddy.com/poll/$1/'>View Poll</a></noscript>\n", $content );
+ return preg_replace( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n<script type='text/javascript' language='javascript' charset='utf-8' src='//static.polldaddy.com/p/$1.js'></script><noscript> <a href='http://polldaddy.com/poll/$1/' target='_blank'>View Poll</a></noscript>\n", $content );
}
// higher priority because we need it before auto-link and autop get to it
diff --git a/plugins/jetpack/modules/shortcodes/scribd.php b/plugins/jetpack/modules/shortcodes/scribd.php
index 7a278ea1..2f745daf 100644
--- a/plugins/jetpack/modules/shortcodes/scribd.php
+++ b/plugins/jetpack/modules/shortcodes/scribd.php
@@ -37,7 +37,7 @@ function scribd_shortcode_handler( $atts ) {
function scribd_shortcode_markup( $atts ) {
$markup = <<<EOD
<iframe class="scribd_iframe_embed" src="//www.scribd.com/embeds/$atts[id]/content?start_page=1&view_mode=$atts[mode]&access_key=$atts[key]" data-auto-height="true" scrolling="no" id="scribd_$atts[id]" width="100%" height="500" frameborder="0"></iframe>
-<div style="font-size:10px;text-align:center;width:100%"><a href="http://www.scribd.com/doc/$atts[id]">View this document on Scribd</a></div>
+<div style="font-size:10px;text-align:center;width:100%"><a href="http://www.scribd.com/doc/$atts[id]" target="_blank">View this document on Scribd</a></div>
EOD;
return $markup;
diff --git a/plugins/jetpack/modules/shortcodes/videopress.php b/plugins/jetpack/modules/shortcodes/videopress.php
index 08f33c6f..f876f1d3 100644
--- a/plugins/jetpack/modules/shortcodes/videopress.php
+++ b/plugins/jetpack/modules/shortcodes/videopress.php
@@ -1,3 +1,23 @@
<?php
-// Boom!
-require_once( JETPACK__PLUGIN_DIR . 'modules/videopress/shortcode.php' ); \ No newline at end of file
+/**
+ * Provides VideoPress videos support when module is disabled.
+ *
+ * @since 2.4
+ * @since 3.9.5 Added compatibility with refactored VideoPress module.
+ */
+
+if ( ! Jetpack::is_module_active( 'videopress' ) ) {
+
+ Jetpack::dns_prefetch( array(
+ '//v0.wordpress.com',
+ ) );
+
+ /**
+ * We won't have any videos less than sixty pixels wide. That would be silly.
+ */
+ define( 'VIDEOPRESS_MIN_WIDTH', 60 );
+
+ include_once JETPACK__PLUGIN_DIR . 'modules/videopress/utility-functions.php';
+ include_once JETPACK__PLUGIN_DIR . 'modules/videopress/shortcode.php';
+
+} \ No newline at end of file
diff --git a/plugins/jetpack/modules/shortcodes/wufoo.php b/plugins/jetpack/modules/shortcodes/wufoo.php
index 4020c5ea..3dd88a0e 100644
--- a/plugins/jetpack/modules/shortcodes/wufoo.php
+++ b/plugins/jetpack/modules/shortcodes/wufoo.php
@@ -28,7 +28,7 @@ function wufoo_shortcode( $atts ) {
* Return an error to the users with instructions if one of these params is invalid
* They don't have default values because they are user/form-specific
*/
- $return_error = sprintf( __( 'Something is wrong with your Wufoo shortcode. If you copy and paste it from the %sWufoo Code Manager%s, you should be golden.', 'jetpack' ), '<a href="http://wufoo.com/docs/code-manager/">', '</a>' );
+ $return_error = sprintf( __( 'Something is wrong with your Wufoo shortcode. If you copy and paste it from the %sWufoo Code Manager%s, you should be golden.', 'jetpack' ), '<a href="http://wufoo.com/docs/code-manager/" target="_blank">', '</a>' );
return '
<div style="border: 20px solid red; border-radius: 40px; padding: 40px; margin: 50px 0 70px;">
@@ -68,7 +68,7 @@ function wufoo_shortcode( $atts ) {
$iframe_embed .= 'allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none;"';
$iframe_embed .= 'src="https://' . $attr['username'] . '.wufoo.com/embed/' . $attr['formhash'] . '/">';
$iframe_embed .= '<a href="https://' . $attr['username'] . '.wufoo.com/forms/' . $attr['formhash'] . '/" ';
- $iframe_embed .= 'rel="nofollow">Fill out my Wufoo form!</a></iframe>';
+ $iframe_embed .= 'rel="nofollow" target="_blank">' . __( 'Fill out my Wufoo form!', 'jetpack' ) . '</a></iframe>';
/** This action is already documented in modules/widgets/gravatar-profile.php */
do_action( 'jetpack_stats_extra', 'embeds', 'wufoo' );
diff --git a/plugins/jetpack/modules/sitemaps/sitemap-xsl.php b/plugins/jetpack/modules/sitemaps/sitemap-xsl.php
index 7f40d1cf..fc97d291 100644
--- a/plugins/jetpack/modules/sitemaps/sitemap-xsl.php
+++ b/plugins/jetpack/modules/sitemaps/sitemap-xsl.php
@@ -90,8 +90,8 @@ $xsl = '<?xml version="1.0" encoding="UTF-8"?>
<body>
<div id="description">
<h1>' . esc_html__( 'XML Sitemap', 'jetpack' ) . '</h1>
- <p>' . wp_kses( sprintf( __( 'This is an XML Sitemap generated by <a href="%s">Jetpack</a>, meant to be consumed by search engines like <a href="%s">Google</a> or <a href="%s">Bing</a>.', 'jetpack' ), 'http://jetpack.com/', 'https://www.google.com', 'https://www.bing.com/' ), array( 'a' => array( 'href' => true, 'title' => true ) ) ) . '</p>
- <p>' . wp_kses( sprintf( __( 'You can find more information on XML sitemaps at <a href="%s">sitemaps.org</a>', 'jetpack' ), 'http://sitemaps.org' ), array( 'a' => array( 'href' => true, 'title' => true ) ) ) . '</p>
+ <p>' . wp_kses( sprintf( __( 'This is an XML Sitemap generated by <a href="%s" target="_blank">Jetpack</a>, meant to be consumed by search engines like <a href="%s" target="_blank">Google</a> or <a href="%s" target="_blank">Bing</a>.', 'jetpack' ), 'http://jetpack.com/', 'https://www.google.com', 'https://www.bing.com/' ), array( 'a' => array( 'href' => true, 'title' => true ) ) ) . '</p>
+ <p>' . wp_kses( sprintf( __( 'You can find more information on XML sitemaps at <a href="%s" target="_blank">sitemaps.org</a>', 'jetpack' ), 'http://sitemaps.org' ), array( 'a' => array( 'href' => true, 'title' => true ) ) ) . '</p>
</div>
<div id="content">
<table>
@@ -136,7 +136,7 @@ $xsl .= ' </tr>
</table>
</div>
<div id="footer">
- <p>' . wp_kses( sprintf( __( '<em>Generated</em> by <a href="%s">Jetpack for WordPress</a>', 'jetpack' ), 'https://jetpack.com' ), array( 'a' => array( 'href' => true, 'title' => true ) ) ) . '</p>
+ <p>' . wp_kses( sprintf( __( '<em>Generated</em> by <a href="%s" target="_blank">Jetpack for WordPress</a>', 'jetpack' ), 'https://jetpack.com' ), array( 'a' => array( 'href' => true, 'title' => true ) ) ) . '</p>
</div>
</body>
</html>
diff --git a/plugins/jetpack/modules/sso.php b/plugins/jetpack/modules/sso.php
index d822e28d..d29380be 100644
--- a/plugins/jetpack/modules/sso.php
+++ b/plugins/jetpack/modules/sso.php
@@ -888,7 +888,7 @@ class Jetpack_SSO {
* @return string
**/
public function error_msg_enable_two_step( $message ) {
- $err = __( sprintf( 'This site requires two step authentication be enabled for your user account on WordPress.com. Please visit the <a href="%1$s"> Security Settings</a> page to enable two step', 'https://wordpress.com/me/security/two-step' ) , 'jetpack' );
+ $err = __( sprintf( 'This site requires two step authentication be enabled for your user account on WordPress.com. Please visit the <a href="%1$s" target="_blank"> Security Settings</a> page to enable two step', 'https://wordpress.com/me/security/two-step' ) , 'jetpack' );
$message .= sprintf( '<p class="message" id="login_error">%s</p>', $err );
@@ -921,7 +921,7 @@ class Jetpack_SSO {
**/
public function msg_login_by_jetpack( $message ) {
- $msg = __( sprintf( 'Jetpack authenticates through WordPress.com — to log in, enter your WordPress.com username and password, or <a href="%1$s">visit WordPress.com</a> to create a free account now.', 'http://wordpress.com/signup' ) , 'jetpack' );
+ $msg = __( sprintf( 'Jetpack authenticates through WordPress.com — to log in, enter your WordPress.com username and password, or <a href="%1$s" target="_blank">visit WordPress.com</a> to create a free account now.', 'http://wordpress.com/signup' ) , 'jetpack' );
/**
* Filter the message displayed when the default WordPress login form is disabled.
@@ -1024,9 +1024,9 @@ class Jetpack_SSO {
<span class="two_step">
<?php
if( $user_data->two_step_enabled ) {
- ?> <p class="enabled"><a href="https://wordpress.com/me/security/two-step"><?php _e( 'Two-Step Authentication Enabled', 'jetpack' ); ?></a></p> <?php
+ ?> <p class="enabled"><a href="https://wordpress.com/me/security/two-step" target="_blank"><?php _e( 'Two-Step Authentication Enabled', 'jetpack' ); ?></a></p> <?php
} else {
- ?> <p class="disabled"><a href="https://wordpress.com/me/security/two-step"><?php _e( 'Two-Step Authentication Disabled', 'jetpack' ); ?></a></p> <?php
+ ?> <p class="disabled"><a href="https://wordpress.com/me/security/two-step" target="_blank"><?php _e( 'Two-Step Authentication Disabled', 'jetpack' ); ?></a></p> <?php
}
?>
</span>
diff --git a/plugins/jetpack/modules/stats.php b/plugins/jetpack/modules/stats.php
index 9dca3975..9465a08a 100644
--- a/plugins/jetpack/modules/stats.php
+++ b/plugins/jetpack/modules/stats.php
@@ -393,7 +393,7 @@ function stats_reports_page( $main_chart_only = false ) {
<p class="hide-if-no-js"><img width="32" height="32" alt="<?php esc_attr_e( 'Loading&hellip;', 'jetpack' ); ?>" src="<?php
/** This filter is documented in modules/shortcodes/audio.php */
echo esc_url( apply_filters( 'jetpack_static_url', "{$http}://en.wordpress.com/i/loading/loading-64.gif" ) ); ?>" /></p>
-<p style="font-size: 11pt; margin: 0;"><a href="https://wordpress.com/stats/<?php echo $domain; ?>"><?php esc_html_e( 'View stats on WordPress.com right now', 'jetpack' ); ?></a></p>
+<p style="font-size: 11pt; margin: 0;"><a href="https://wordpress.com/stats/<?php echo $domain; ?>" target="_blank"><?php esc_html_e( 'View stats on WordPress.com right now', 'jetpack' ); ?></a></p>
<p class="hide-if-js"><?php esc_html_e( 'Your Site Stats work better with JavaScript enabled.', 'jetpack' ); ?><br />
<a href="<?php echo esc_url( $nojs_url ); ?>"><?php esc_html_e( 'View Site Stats without JavaScript', 'jetpack' ); ?></a>.</p>
</div>
@@ -838,7 +838,7 @@ function stats_dashboard_widget_control() {
function stats_jetpack_dashboard_widget() {
?>
- <form id="stats_dashboard_widget_control" action="<?php esc_url( admin_url() ); ?>" method="post">
+ <form id="stats_dashboard_widget_control" action="<?php echo esc_url( admin_url() ); ?>" method="post">
<?php stats_dashboard_widget_control(); ?>
<?php wp_nonce_field( 'edit-dashboard-widget_dashboard_stats', 'dashboard-widget-nonce' ); ?>
<input type="hidden" name="widget_id" value="dashboard_stats" />
@@ -1134,7 +1134,7 @@ function stats_print_wp_remote_error( $get, $url ) {
}
?>
<div class="wrap">
- <p><?php printf( __( 'We were unable to get your stats just now. Please reload this page to try again. If this error persists, please <a href="%1$s">contact support</a>. In your report please include the information below.', 'jetpack' ), 'http://support.wordpress.com/contact/?jetpack=needs-service' ); ?></p>
+ <p><?php printf( __( 'We were unable to get your stats just now. Please reload this page to try again. If this error persists, please <a href="%1$s" target="_blank">contact support</a>. In your report please include the information below.', 'jetpack' ), 'http://support.wordpress.com/contact/?jetpack=needs-service' ); ?></p>
<pre>
User Agent: "<?php echo esc_html( $_SERVER['HTTP_USER_AGENT'] ); ?>"
Page URL: "http<?php echo (is_ssl()?'s':'') . '://' . esc_html( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); ?>"
diff --git a/plugins/jetpack/modules/subscriptions.php b/plugins/jetpack/modules/subscriptions.php
index 92bdd667..d34c8715 100644
--- a/plugins/jetpack/modules/subscriptions.php
+++ b/plugins/jetpack/modules/subscriptions.php
@@ -607,7 +607,7 @@ class Jetpack_Subscriptions {
$str = '';
- if ( FALSE === has_filter( 'comment_form', 'show_subscription_checkbox' ) && 1 == get_option( 'stc_enabled', 1 ) && empty( $post->post_password ) ) {
+ if ( FALSE === has_filter( 'comment_form', 'show_subscription_checkbox' ) && 1 == get_option( 'stc_enabled', 1 ) && empty( $post->post_password ) && 'post' == get_post_type() ) {
// Subscribe to comments checkbox
$str .= '<p class="comment-subscription-form"><input type="checkbox" name="subscribe_comments" id="subscribe_comments" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;"' . $comments_checked . ' /> ';
$comment_sub_text = __( 'Notify me of follow-up comments by email.', 'jetpack' );
diff --git a/plugins/jetpack/modules/theme-tools/random-redirect.php b/plugins/jetpack/modules/theme-tools/random-redirect.php
index de6c5d43..a4f29d80 100644
--- a/plugins/jetpack/modules/theme-tools/random-redirect.php
+++ b/plugins/jetpack/modules/theme-tools/random-redirect.php
@@ -43,7 +43,7 @@ function jetpack_matt_random_redirect() {
// Persistent AppEngine abuse. ORDER BY RAND is expensive.
if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'AppEngine-Google' ) )
- wp_die( 'Please <a href="http://en.support.wordpress.com/contact/">contact support</a>' );
+ wp_die( 'Please <a href="http://en.support.wordpress.com/contact/" target="_blank">contact support</a>' );
// Set the category ID if the parameter is set.
if ( isset( $_GET['random_cat_id'] ) )
diff --git a/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js b/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js
index ee468c33..e315891f 100644
--- a/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js
+++ b/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js
@@ -1 +1,106 @@
-!function(t){function a(){t(".jetpack-video-wrapper").find("embed, iframe, object").each(function(){var a,e,i,r,h,n,d;a=t(this),n=0,"center"===a.parents(".jetpack-video-wrapper").prev("p").css("text-align")&&(n="0 auto"),a.attr("data-ratio")||a.attr("data-ratio",this.height/this.width).attr("data-width",this.width).attr("data-height",this.height).css({display:"block",margin:n}),e=a.attr("data-width"),i=a.attr("data-height"),r=a.attr("data-ratio"),h=a.parent(),d=h.width(),"Infinity"===r&&(e="100%"),a.removeAttr("height").removeAttr("width"),e>d?a.width(d).height(d*r):a.width(e).height(i)})}var e=function(t,a){var e,i,r,h;return function(){r=this,i=[].slice.call(arguments,0),h=new Date;var n=function(){var d=new Date-h;a>d?e=setTimeout(n,a-d):(e=null,t.apply(r,i))};e||(e=setTimeout(n,a))}};t(window).load(a).resize(e(a,100)).trigger("resize"),t(document).on("post-load",a)}(jQuery);
+/**
+ * This file was unminified in Jetpack 4.0 to address an issue wherein ClamAV
+ * was flagging the minified version of this file with a false-positive virus warning.
+ *
+ * This file will be re-minified in a future Jetpack release once ClamAV corrects their
+ * incorrect definition.
+ */
+
+( function( $ ) {
+
+ /**
+ * A function to help debouncing.
+ */
+ var debounce = function( func, wait ) {
+
+ var timeout, args, context, timestamp;
+
+ return function() {
+
+ context = this;
+ args = [].slice.call( arguments, 0 );
+ timestamp = new Date();
+
+ var later = function() {
+
+ var last = ( new Date() ) - timestamp;
+
+ if ( last < wait ) {
+ timeout = setTimeout( later, wait - last );
+ } else {
+ timeout = null;
+ func.apply( context, args );
+ }
+
+ };
+
+ if ( ! timeout ) {
+ timeout = setTimeout( later, wait );
+ }
+
+ };
+
+ };
+
+ /**
+ * A function to resize videos.
+ */
+ function responsive_videos() {
+
+ $( '.jetpack-video-wrapper' ).find( 'embed, iframe, object' ).each( function() {
+ var video_element, video_width, video_height, video_ratio, video_wrapper, video_margin, container_width;
+
+ video_element = $( this );
+ video_margin = 0;
+
+ if ( video_element.parents( '.jetpack-video-wrapper' ).prev( 'p' ).css( 'text-align' ) === 'center' ) {
+ video_margin = '0 auto';
+ }
+
+ if ( ! video_element.attr( 'data-ratio' ) ) {
+ video_element
+ .attr( 'data-ratio', this.height / this.width )
+ .attr( 'data-width', this.width )
+ .attr( 'data-height', this.height )
+ .css( {
+ 'display' : 'block',
+ 'margin' : video_margin
+ } );
+ }
+
+ video_width = video_element.attr( 'data-width' );
+ video_height = video_element.attr( 'data-height' );
+ video_ratio = video_element.attr( 'data-ratio' );
+ video_wrapper = video_element.parent();
+ container_width = video_wrapper.width();
+
+ if ( video_ratio === 'Infinity' ) {
+ video_width = '100%';
+ }
+
+ video_element
+ .removeAttr( 'height' )
+ .removeAttr( 'width' );
+
+ if ( video_width > container_width ) {
+ video_element
+ .width( container_width )
+ .height( container_width * video_ratio );
+ } else {
+ video_element
+ .width( video_width )
+ .height( video_height );
+ }
+
+ } );
+
+ }
+
+ /**
+ * Load responsive_videos().
+ * Trigger resize to make sure responsive_videos() is loaded after IS.
+ */
+ $( window ).load( responsive_videos ).resize( debounce( responsive_videos, 100 ) ).trigger( 'resize' );
+ $( document ).on( 'post-load', responsive_videos );
+
+} )( jQuery );
diff --git a/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php b/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php
index 0e524f7b..3b783eea 100644
--- a/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php
+++ b/plugins/jetpack/modules/theme-tools/site-breadcrumbs.php
@@ -18,20 +18,20 @@ function jetpack_breadcrumbs() {
$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
- $before = '<nav class="entry-breadcrumbs">';
+ $before = '<nav class="entry-breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">';
$after = '</nav>';
- $home = '<a href="' . esc_url( home_url( "/" ) ) . '" class="home-link" rel="home">' . __( 'Home', 'jetpack' ) . '</a>';
+ $home = '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . esc_url( home_url( "/" ) ) . '" class="home-link" itemprop="item" rel="home"><span itemprop="name">' . __( 'Home', 'jetpack' ) . '</span></a></span>';
$breadcrumb = '';
if ( $ancestors ) {
foreach ( $ancestors as $ancestor ) {
- $breadcrumb .= '<a href="' . esc_url( get_permalink( $ancestor ) ) . '">' . esc_html( get_the_title( $ancestor ) ) . '</a>';
+ $breadcrumb .= '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . esc_url( get_permalink( $ancestor ) ) . '" itemprop="item"><span itemprop="name">' . esc_html( get_the_title( $ancestor ) ) . '</span></a></span>';
}
}
- $breadcrumb .= '<span class="current-page">' . esc_html( get_the_title( $post->ID ) ) . '</span>';
+ $breadcrumb .= '<span class="current-page" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">' . esc_html( get_the_title( $post->ID ) ) . '</span></span>';
echo $before . $home . $breadcrumb . $after;
-} \ No newline at end of file
+}
diff --git a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js
index 3dd5b769..12f49f1a 100644
--- a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js
+++ b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js
@@ -159,6 +159,14 @@
} else {
attachPlainResize( tiledGalleries );
}
+
+ if ( wp && wp.customize && wp.customizerHasPartialWidgetRefresh() ) {
+ wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
+ if ( wp.isJetpackWidgetPlaced( placement, 'gallery' ) ) {
+ tiledGalleries.findAndSetupNewGalleries();
+ }
+ } );
+ }
});
})(jQuery);
diff --git a/plugins/jetpack/modules/videopress.php b/plugins/jetpack/modules/videopress.php
index 229432a3..cdbab44e 100644
--- a/plugins/jetpack/modules/videopress.php
+++ b/plugins/jetpack/modules/videopress.php
@@ -14,7 +14,11 @@ Jetpack::dns_prefetch( array(
'//v0.wordpress.com',
) );
-function jetpack_load_videopress() {
- include dirname( __FILE__ ) . "/videopress/videopress.php";
-}
-jetpack_load_videopress();
+/**
+ * We won't have any videos less than sixty pixels wide. That would be silly.
+ */
+define( 'VIDEOPRESS_MIN_WIDTH', 60 );
+
+include_once dirname( __FILE__ ) . '/videopress/utility-functions.php';
+include_once dirname( __FILE__ ) . '/videopress/shortcode.php';
+include_once dirname( __FILE__ ) . '/videopress/videopress.php';
diff --git a/plugins/jetpack/modules/videopress/class.videopress-player.php b/plugins/jetpack/modules/videopress/class.videopress-player.php
index 00fa76bf..778d518d 100644
--- a/plugins/jetpack/modules/videopress/class.videopress-player.php
+++ b/plugins/jetpack/modules/videopress/class.videopress-player.php
@@ -280,7 +280,7 @@ class VideoPress_Player {
$html .= '<input type="submit" value="' . __( 'Submit', 'jetpack' ) . '" style="cursor:pointer;border-radius: 1em;border:1px solid #333;background-color:#333;background:-webkit-gradient( linear, left top, left bottom, color-stop(0.0, #444), color-stop(1, #111) );background:-moz-linear-gradient(center top, #444 0%, #111 100%);font-size:13px;padding:4px 10px 5px;line-height:1em;vertical-align:top;color:white;text-decoration:none;margin:0" />';
$html .= '</fieldset>';
- $html .= '<p style="padding-top:20px;padding-bottom:60px;text-align:' . $text_align . ';"><a rel="nofollow" href="http://videopress.com/" style="color:rgb(128,128,128);text-decoration:underline;font-size:15px">' . __( 'More information', 'jetpack' ) . '</a></p>';
+ $html .= '<p style="padding-top:20px;padding-bottom:60px;text-align:' . $text_align . ';"><a rel="nofollow" href="http://videopress.com/" target="_blank" style="color:rgb(128,128,128);text-decoration:underline;font-size:15px">' . __( 'More information', 'jetpack' ) . '</a></p>';
$html .= '</div>';
return $html;
@@ -324,7 +324,7 @@ class VideoPress_Player {
$html .= esc_attr( $this->video->title );
$html .= '" src="' . $thumbnail . '" width="' . $this->video->calculated_width . '" height="' . $this->video->calculated_height . '" /></div>';
if ( isset( $this->options['freedom'] ) && $this->options['freedom'] === true )
- $html .= '<p class="robots-nocontent">' . sprintf( __( 'You do not have sufficient <a rel="nofollow" href="%s">freedom levels</a> to view this video. Support free software and upgrade.', 'jetpack' ), 'http://www.gnu.org/philosophy/free-sw.html' ) . '</p>';
+ $html .= '<p class="robots-nocontent">' . sprintf( __( 'You do not have sufficient <a rel="nofollow" href="%s" target="_blank">freedom levels</a> to view this video. Support free software and upgrade.', 'jetpack' ), 'http://www.gnu.org/philosophy/free-sw.html' ) . '</p>';
elseif ( isset( $this->video->title ) )
$html .= '<p>' . esc_html( $this->video->title ) . '</p>';
$html .= '</video>';
@@ -780,7 +780,7 @@ class VideoPress_Player {
foreach ( $this->get_flash_parameters() as $attribute => $value ) {
$flash_params .= '<param name="' . esc_attr( $attribute ) . '" value="' . esc_attr( $value ) . '" />';
}
- $flash_help = sprintf( __( 'This video requires <a rel="nofollow" href="%s">Adobe Flash</a> for playback.', 'jetpack' ), 'http://www.adobe.com/go/getflashplayer');
+ $flash_help = sprintf( __( 'This video requires <a rel="nofollow" href="%s" target="_blank">Adobe Flash</a> for playback.', 'jetpack' ), 'http://www.adobe.com/go/getflashplayer');
$flash_player_url = esc_url( $this->video->players->swf->url, array( 'http', 'https' ) );
$description = '';
if ( isset( $this->video->title ) ) {
diff --git a/plugins/jetpack/modules/videopress/js/editor-view.js b/plugins/jetpack/modules/videopress/js/editor-view.js
new file mode 100644
index 00000000..c77f5b6a
--- /dev/null
+++ b/plugins/jetpack/modules/videopress/js/editor-view.js
@@ -0,0 +1,261 @@
+/* global tinyMCE, vpEditorView */
+(function( $, wp, vpEditorView ){
+ wp.mce = wp.mce || {};
+ wp.mce.videopress_wp_view_renderer = {
+ shortcode_string : 'videopress',
+ shortcode_data : {},
+ defaults : {
+ w : '',
+ at : '',
+ permalink : true,
+ hd : false,
+ loop : false,
+ freedom : false,
+ autoplay : false,
+ flashonly : false
+ },
+ coerce : wp.media.coerce,
+ template : wp.template( 'videopress_iframe_vnext' ),
+ getContent : function() {
+ var urlargs = 'for=' + encodeURIComponent( vpEditorView.home_url_host ),
+ named = this.shortcode.attrs.named,
+ options, key, width;
+
+ for ( key in named ) {
+ switch ( key ) {
+ case 'at' :
+ if ( parseInt( named[ key ], 10 ) ) {
+ urlargs += '&' + key + '=' + parseInt( named[ key ], 10 );
+ } // Else omit, as it's the default.
+ break;
+ case 'permalink' :
+ if ( 'false' === named[ key ] ) {
+ urlargs += '&' + key + '=0';
+ } // Else omit, as it's the default.
+ break;
+ case 'hd' :
+ case 'loop' :
+ case 'autoplay' :
+ if ( 'true' === named[ key ] ) {
+ urlargs += '&' + key + '=1';
+ } // Else omit, as it's the default.
+ break;
+ default:
+ // Unknown parameters? Ditch it!
+ break;
+ }
+ }
+
+ options = {
+ width : vpEditorView.content_width,
+ height : ( vpEditorView.content_width * 0.5625 ),
+ guid : this.shortcode.attrs.numeric[0],
+ urlargs : urlargs
+ };
+
+ if ( typeof named.w !== 'undefined' ) {
+ width = parseInt( named.w, 10 );
+ if ( width >= vpEditorView.min_content_width && width < vpEditorView.content_width ) {
+ options.width = width;
+ options.height = parseInt( width * 0.5625, 10 );
+ }
+ }
+
+ options.ratio = 100 * ( options.height / options.width );
+
+ return this.template( options );
+ },
+ edit: function( data ) {
+ var shortcode_data = wp.shortcode.next( this.shortcode_string, data),
+ named = shortcode_data.shortcode.attrs.named,
+ editor = tinyMCE.activeEditor,
+ renderer = this,
+ oldRenderFormItem = tinyMCE.ui.FormItem.prototype.renderHtml;
+
+ /**
+ * Override TextBox renderHtml to support html5 attrs.
+ * @link https://github.com/tinymce/tinymce/pull/2784
+ *
+ * @returns {string}
+ */
+ tinyMCE.ui.TextBox.prototype.renderHtml = function() {
+ var self = this,
+ settings = self.settings,
+ element = document.createElement( settings.multiline ? 'textarea' : 'input' ),
+ extraAttrs = [
+ 'rows',
+ 'spellcheck',
+ 'maxLength',
+ 'size',
+ 'readonly',
+ 'min',
+ 'max',
+ 'step',
+ 'list',
+ 'pattern',
+ 'placeholder',
+ 'required',
+ 'multiple'
+ ],
+ i, key;
+
+ for ( i = 0; i < extraAttrs.length; i++ ) {
+ key = extraAttrs[ i ];
+ if ( typeof settings[ key ] !== 'undefined' ) {
+ element.setAttribute( key, settings[ key ] );
+ }
+ }
+
+ if ( settings.multiline ) {
+ element.innerText = self.state.get( 'value' );
+ } else {
+ element.setAttribute( 'type', settings.subtype ? settings.subtype : 'text' );
+ element.setAttribute( 'value', self.state.get( 'value' ) );
+ }
+
+ element.id = self._id;
+ element.className = self.classes;
+ element.setAttribute( 'hidefocus', 1 );
+ if ( self.disabled() ) {
+ element.disabled = true;
+ }
+
+ return element.outerHTML;
+ };
+
+ tinyMCE.ui.FormItem.prototype.renderHtml = function() {
+ _.each( vpEditorView.modal_labels, function( value, key ) {
+ if ( value === this.settings.items.text ) {
+ this.classes.add( 'videopress-field-' + key );
+ }
+ }, this );
+
+ if ( _.contains( [
+ vpEditorView.modal_labels.hd,
+ vpEditorView.modal_labels.permalink,
+ vpEditorView.modal_labels.autoplay,
+ vpEditorView.modal_labels.loop,
+ vpEditorView.modal_labels.freedom,
+ vpEditorView.modal_labels.flashonly
+ ], this.settings.items.text ) ) {
+ this.classes.add( 'videopress-checkbox' );
+ }
+ return oldRenderFormItem.call( this );
+ };
+
+ /**
+ * Populate the defaults.
+ */
+ _.each( this.defaults, function( value, key ) {
+ named[ key ] = this.coerce( named, key);
+ }, this );
+
+ /**
+ * Declare the fields that will show in the popup when editing the shortcode.
+ */
+ editor.windowManager.open( {
+ title : vpEditorView.modal_labels.title,
+ id : 'videopress-shortcode-settings-modal',
+ width : 520,
+ height : 240,
+ body : [
+ {
+ type : 'textbox',
+ disabled : true,
+ name : 'guid',
+ label : vpEditorView.modal_labels.guid,
+ value : shortcode_data.shortcode.attrs.numeric[0]
+ }, {
+ type : 'textbox',
+ subtype : 'number',
+ min : vpEditorView.min_content_width, // The `min` may supported be in the future. https://github.com/tinymce/tinymce/pull/2784
+ name : 'w',
+ label : vpEditorView.modal_labels.w,
+ value : named.w
+ }, {
+ type : 'textbox',
+ subtype : 'number',
+ min : 0, // The `min` may supported be in the future. https://github.com/tinymce/tinymce/pull/2784
+ name : 'at',
+ label : vpEditorView.modal_labels.at,
+ value : named.at
+ }, {
+ type : 'checkbox',
+ name : 'hd',
+ label : vpEditorView.modal_labels.hd,
+ checked : named.hd
+ }, {
+ type : 'checkbox',
+ name : 'permalink',
+ label : vpEditorView.modal_labels.permalink,
+ checked : named.permalink
+ }, {
+ type : 'checkbox',
+ name : 'autoplay',
+ label : vpEditorView.modal_labels.autoplay,
+ checked : named.autoplay
+ }, {
+ type : 'checkbox',
+ name : 'loop',
+ label : vpEditorView.modal_labels.loop,
+ checked : named.loop
+ }, {
+ type : 'checkbox',
+ name : 'freedom',
+ label : vpEditorView.modal_labels.freedom,
+ checked : named.freedom
+ }, {
+ type : 'checkbox',
+ name : 'flashonly',
+ label : vpEditorView.modal_labels.flashonly,
+ checked : named.flashonly
+ }
+ ],
+ onsubmit : function( e ) {
+ var args = {
+ tag : renderer.shortcode_string,
+ type : 'single',
+ attrs : {
+ named : _.pick( e.data, _.keys( renderer.defaults ) ),
+ numeric : [ e.data.guid ]
+ }
+ };
+
+ if ( '0' === args.attrs.named.at ) {
+ args.attrs.named.at = '';
+ }
+
+ _.each( renderer.defaults, function( value, key ) {
+ args.attrs.named[ key ] = this.coerce( args.attrs.named, key );
+
+ if ( value === args.attrs.named[ key ] ) {
+ delete args.attrs.named[ key ];
+ }
+ }, renderer );
+
+ editor.insertContent( wp.shortcode.string( args ) );
+ },
+ onopen : function ( e ) {
+ var prefix = 'mce-videopress-field-';
+ _.each( ['w', 'at'], function( value ) {
+ e.target.$el.find( '.' + prefix + value + ' .mce-container-body' ).append( '<span class="' + prefix + 'unit ' + prefix + 'unit-' + value + '">' + vpEditorView.modal_labels[ value + '_unit' ] );
+ } );
+ $('body').addClass( 'modal-open' );
+ },
+ onclose: function () {
+ $('body').removeClass( 'modal-open' );
+ }
+ } );
+
+ // Set it back to its original renderer.
+ tinyMCE.ui.FormItem.prototype.renderHtml = oldRenderFormItem;
+ }
+ };
+ wp.mce.views.register( 'videopress', wp.mce.videopress_wp_view_renderer );
+
+ // Extend the videopress one to also handle `wpvideo` instances.
+ wp.mce.wpvideo_wp_view_renderer = _.extend( {}, wp.mce.videopress_wp_view_renderer, {
+ shortcode_string : 'wpvideo'
+ });
+ wp.mce.views.register( 'wpvideo', wp.mce.wpvideo_wp_view_renderer );
+}( jQuery, wp, vpEditorView ));
diff --git a/plugins/jetpack/modules/videopress/videopress-admin.js b/plugins/jetpack/modules/videopress/js/videopress-admin.js
index c7851117..c7851117 100644
--- a/plugins/jetpack/modules/videopress/videopress-admin.js
+++ b/plugins/jetpack/modules/videopress/js/videopress-admin.js
diff --git a/plugins/jetpack/modules/videopress/shortcode.php b/plugins/jetpack/modules/videopress/shortcode.php
index c0fb87e8..a9dd1480 100644
--- a/plugins/jetpack/modules/videopress/shortcode.php
+++ b/plugins/jetpack/modules/videopress/shortcode.php
@@ -1,151 +1,255 @@
<?php
+
/**
* VideoPress Shortcode Handler
*
* This file may or may not be included from the Jetpack VideoPress module.
*/
-class Jetpack_VideoPress_Shortcode {
- public $min_width = 60;
+
+/**
+ * Translate a 'videopress' or 'wpvideo' shortcode and arguments into a video player display.
+ *
+ * Expected input formats:
+ *
+ * [videopress OcobLTqC]
+ * [wpvideo OcobLTqC]
+ *
+ * @link http://codex.wordpress.org/Shortcode_API Shortcode API
+ * @param array $attr shortcode attributes
+ * @return string HTML markup or blank string on fail
+ */
+function videopress_shortcode_callback( $attr ) {
+ global $content_width;
/**
- * Singleton
+ * We only accept GUIDs as a first unnamed argument.
*/
- public static function init() {
- static $instance = false;
+ $guid = $attr[0];
- if ( ! $instance )
- $instance = new Jetpack_VideoPress_Shortcode;
-
- return $instance;
+ /**
+ * Make sure the GUID passed in matches how actual GUIDs are formatted.
+ */
+ if ( ! videopress_is_valid_guid( $guid ) ) {
+ return '';
}
- function __construct() {
- add_shortcode( 'videopress', array( $this, 'shortcode_callback' ) );
- add_shortcode( 'wpvideo', array( $this, 'shortcode_callback' ) );
- }
+ /**
+ * Set the defaults
+ */
+ $defaults = array(
+ 'w' => 0, // Width of the video player, in pixels
+ 'at' => 0, // How many seconds in to initially seek to
+ 'hd' => false, // Whether to display a high definition version
+ 'loop' => false, // Whether to loop the video repeatedly
+ 'freedom' => false, // Whether to use only free/libre codecs
+ 'autoplay' => false, // Whether to autoplay the video on load
+ 'permalink' => true, // Whether to display the permalink to the video
+ 'flashonly' => false, // Whether to support the Flash player exclusively
+ 'defaultlangcode' => false, // Default language code
+ );
+
+ $attr = shortcode_atts( $defaults, $attr, 'videopress' );
/**
- * Translate a 'videopress' or 'wpvideo' shortcode and arguments into a video player display.
- *
- * @link http://codex.wordpress.org/Shortcode_API Shortcode API
- * @param array $attr shortcode attributes
- * @return string HTML markup or blank string on fail
+ * Cast the attributes, post-input.
*/
- public function shortcode_callback( $attr, $content = '' ) {
- global $content_width;
-
- $guid = $attr[0];
- if ( ! $this->is_valid_guid( $guid ) )
- return '';
-
- $attr = shortcode_atts( array(
- 'w' => 0,
- 'h' => 0,
- 'freedom' => false,
- 'flashonly' => false,
- 'autoplay' => false,
- 'hd' => false,
- 'permalink' => true,
- 'loop' => false,
- 'at' => 0,
- 'defaultlangcode' => false,
- ), $attr );
-
- $attr['forcestatic'] = false;
-
- $attr['freedom'] = (bool) $attr['freedom'];
- $attr['hd'] = (bool) $attr['hd'];
- $attr['width'] = absint( $attr['w'] );
-
- if ( $attr['width'] < $this->min_width )
- $attr['width'] = 0;
- elseif ( isset( $content_width ) && $content_width > $this->min_width && $attr['width'] > $content_width )
- $attr['width'] = 0;
-
- if ( $attr['width'] === 0 && isset( $content_width ) && $content_width > $this->min_width )
- $attr['width'] = $content_width;
-
- if ( ( $attr['width'] % 2 ) === 1 )
- $attr['width']--;
-
- /**
- * Filter the default VideoPress shortcode options.
- *
- * @module videopress
- *
- * @since 2.5.0
- *
- * @param array $args Array of VideoPress shortcode options.
- */
- $options = apply_filters( 'videopress_shortcode_options', array(
- 'freedom' => $attr['freedom'],
- 'force_flash' => (bool) $attr['flashonly'],
- 'autoplay' => $attr['autoplay'],
- 'forcestatic' => $attr['forcestatic'],
- 'hd' => $attr['hd'],
- 'permalink' => $attr['permalink'],
- 'loop' => $attr['autoplay'],
- 'at' => (int) $attr['at'],
- 'defaultlangcode' => $attr['defaultlangcode']
- ) );
-
- // Enqueue VideoPress scripts
- self::register_scripts();
-
- require_once( dirname( __FILE__ ) . '/class.videopress-video.php' );
- require_once( dirname( __FILE__ ) . '/class.videopress-player.php' );
-
- $player = new VideoPress_Player( $guid, $attr['width'], $options );
-
- if ( is_feed() )
- return $player->asXML();
- else
- return $player->asHTML();
+ $attr['width'] = absint( $attr['w'] );
+ $attr['hd'] = (bool) $attr['hd'];
+ $attr['freedom'] = (bool) $attr['freedom'];
+
+ /**
+ * If the provided width is less than the minimum allowed
+ * width, or greater than `$content_width` ignore.
+ */
+ if ( $attr['width'] < VIDEOPRESS_MIN_WIDTH ) {
+ $attr['width'] = 0;
+ } elseif ( isset( $content_width ) && $content_width > VIDEOPRESS_MIN_WIDTH && $attr['width'] > $content_width ) {
+ $attr['width'] = 0;
}
/**
- * Validate user-supplied guid values against expected inputs
- *
- * @since 1.1
- * @param string $guid video identifier
- * @return bool true if passes validation test
+ * If there was an invalid or unspecified width, set the width equal to the theme's `$content_width`.
*/
- public function is_valid_guid( $guid ) {
- if ( ! empty( $guid ) && strlen( $guid ) === 8 && ctype_alnum( $guid ) )
- return true;
- else
- return false;
+ if ( 0 === $attr['width'] && isset( $content_width ) && $content_width >= VIDEOPRESS_MIN_WIDTH ) {
+ $attr['width'] = $content_width;
}
/**
- * Register scripts needed to play VideoPress videos. One of the player methods will
- * enqueue thoe script if needed.
- *
- * @uses is_ssl()
- * @uses wp_register_script()
- * @return null
+ * If the width isn't an even number, reduce it by one (making it even).
*/
- public static function register_scripts() {
- $js_url = ( is_ssl() ) ? 'https://v0.wordpress.com/js/videopress.js' : 'http://s0.videopress.com/js/videopress.js';
- wp_register_script( 'videopress', $js_url, array( 'jquery', 'swfobject' ), '1.09' );
+ if ( 1 === ( $attr['width'] % 2 ) ) {
+ $attr['width'] --;
}
/**
- * Adds a `for` query parameter to the oembed provider request URL.
- * @param String $oembed_provider
- * @return String $ehnanced_oembed_provider
+ * Filter the default VideoPress shortcode options.
+ *
+ * @module videopress
+ *
+ * @since 2.5.0
+ *
+ * @param array $args Array of VideoPress shortcode options.
*/
- public static function add_oembed_parameter( $oembed_provider ) {
- if ( false === stripos( $oembed_provider, 'videopress.com' ) ) {
- return $oembed_provider;
- }
- return add_query_arg( 'for', parse_url( home_url(), PHP_URL_HOST ), $oembed_provider );
+ $options = apply_filters( 'videopress_shortcode_options', array(
+ 'at' => (int) $attr['at'],
+ 'hd' => $attr['hd'],
+ 'loop' => $attr['autoplay'] || $attr['loop'],
+ 'freedom' => $attr['freedom'],
+ 'autoplay' => $attr['autoplay'],
+ 'permalink' => $attr['permalink'],
+ 'force_flash' => (bool) $attr['flashonly'],
+ 'defaultlangcode' => $attr['defaultlangcode'],
+ 'forcestatic' => false, // This used to be a displayed option, but now is only
+ // accessible via the `videopress_shortcode_options` filter.
+ ) );
+
+ // Register VideoPress scripts
+ wp_register_script( 'videopress', 'https://v0.wordpress.com/js/videopress.js', array( 'jquery', 'swfobject' ), '1.09' );
+
+ require_once( dirname( __FILE__ ) . '/class.videopress-video.php' );
+ require_once( dirname( __FILE__ ) . '/class.videopress-player.php' );
+
+ $player = new VideoPress_Player( $guid, $attr['width'], $options );
+
+ if ( is_feed() ) {
+ return $player->asXML();
+ } else {
+ return $player->asHTML();
}
}
+add_shortcode( 'videopress', 'videopress_shortcode_callback' );
+add_shortcode( 'wpvideo', 'videopress_shortcode_callback' );
-// Initialize the shortcode handler.
-Jetpack_VideoPress_Shortcode::init();
-
+/**
+ * By explicitly declaring the provider here, we can speed things up by not relying on oEmbed discovery.
+ */
wp_oembed_add_provider( '#^https?://videopress.com/v/.*#', 'http://public-api.wordpress.com/oembed/1.0/', true );
-add_filter( 'oembed_fetch_url', 'Jetpack_VideoPress_Shortcode::add_oembed_parameter' );
+/**
+ * Adds a `for` query parameter to the oembed provider request URL.
+ * @param String $oembed_provider
+ * @return String $ehnanced_oembed_provider
+ */
+function videopress_add_oembed_for_parameter( $oembed_provider ) {
+ if ( false === stripos( $oembed_provider, 'videopress.com' ) ) {
+ return $oembed_provider;
+ }
+ return add_query_arg( 'for', parse_url( home_url(), PHP_URL_HOST ), $oembed_provider );
+}
+add_filter( 'oembed_fetch_url', 'videopress_add_oembed_for_parameter' );
+
+/**
+ * WordPress Shortcode Editor View JS Code
+ */
+function videopress_handle_editor_view_js() {
+ global $content_width;
+ $current_screen = get_current_screen();
+ if ( ! isset( $current_screen->id ) || $current_screen->base !== 'post' ) {
+ return;
+ }
+
+ add_action( 'admin_print_footer_scripts', 'videopress_editor_view_js_templates' );
+
+ wp_enqueue_script( 'videopress-editor-view', plugins_url( 'js/editor-view.js', __FILE__ ), array( 'wp-util', 'jquery' ), false, true );
+ wp_localize_script( 'videopress-editor-view', 'vpEditorView', array(
+ 'home_url_host' => parse_url( home_url(), PHP_URL_HOST ),
+ 'min_content_width' => VIDEOPRESS_MIN_WIDTH,
+ 'content_width' => $content_width,
+ 'modal_labels' => array(
+ 'title' => esc_html__( 'VideoPress Shortcode', 'jetpack' ),
+ 'guid' => esc_html__( 'Video ID', 'jetpack' ),
+ 'w' => esc_html__( 'Video Width', 'jetpack' ),
+ 'w_unit' => esc_html__( 'pixels', 'jetpack' ),
+ /* Translators: example of usage of this is "Start Video After 10 seconds" */
+ 'at' => esc_html__( 'Start Video After', 'jetpack' ),
+ 'at_unit' => esc_html__( 'seconds', 'jetpack' ),
+ 'hd' => esc_html__( 'High definition on by default', 'jetpack' ),
+ 'permalink' => esc_html__( 'Link the video title to its URL on VideoPress.com', 'jetpack' ),
+ 'autoplay' => esc_html__( 'Autoplay video on page load', 'jetpack' ),
+ 'loop' => esc_html__( 'Loop video playback', 'jetpack' ),
+ 'freedom' => esc_html__( 'Use only Open Source codecs (may degrade performance)', 'jetpack' ),
+ 'flashonly' => esc_html__( 'Use legacy Flash Player (not recommended)', 'jetpack' ),
+ )
+ ) );
+
+ add_editor_style( plugins_url( 'videopress-editor-style.css', __FILE__ ) );
+}
+add_action( 'admin_notices', 'videopress_handle_editor_view_js' );
+
+/**
+ * WordPress Editor Views
+ */
+function videopress_editor_view_js_templates() {
+ /**
+ * This template uses the following parameters, and displays the video as an iframe:
+ * - data.guid // The guid of the video.
+ * - data.width // The width of the iframe.
+ * - data.height // The height of the iframe.
+ * - data.urlargs // Arguments serialized into a get string.
+ *
+ * In addition, the calling script will need to ensure that the following
+ * JS file is added to the header of the editor iframe:
+ * - https://s0.wp.com/wp-content/plugins/video/assets/js/next/videopress-iframe.js
+ */
+ ?>
+ <script type="text/html" id="tmpl-videopress_iframe_vnext">
+ <div class="tmpl-videopress_iframe_next" style="max-height:{{ data.height }}px;">
+ <div class="videopress-editor-wrapper" style="padding-top:{{ data.ratio }}%;">
+ <iframe style="display: block;" width="{{ data.width }}" height="{{ data.height }}" src="https://videopress.com/embed/{{ data.guid }}?{{ data.urlargs }}" frameborder='0' allowfullscreen></iframe>
+ </div>
+ </div>
+ </script>
+
+ <!-- VideoPress Settings Modal style overrides -->
+ <style type="text/css">
+ .mce-videopress-field-guid, .mce-videopress-field-freedom, .mce-videopress-field-flashonly {
+ display: none;
+ }
+ .mce-videopress-checkbox .mce-checkbox {
+ left: 120px !important;
+ width: 100% !important; /* assigning a full width so the label area is clickable */
+ }
+
+ .mce-videopress-checkbox .mce-label {
+ left: 150px !important;
+ }
+ .mce-videopress-checkbox .mce-label-unit {
+ position: absolute;
+ left: 210px;
+ top: 5px;
+ }
+ .mce-videopress-checkbox i.mce-i-checkbox {
+ background-color: #fff;
+ color: #1e8cbe;
+ }
+ .mce-videopress-checkbox .mce-i-checkbox:before {
+ display: inline-block;
+ vertical-align: middle;
+ width: 16px;
+ font: 400 21px/1 dashicons;
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ margin: -3px 0 0 -3px;
+ content: "\f147";
+ }
+ .mce-videopress-checkbox .mce-i-checkbox.mce-checked:before {
+ content: "\f147";
+ }
+ div[class*=mce-videopress-field] input[type=number] {
+ width: 70px !important;
+ left: 120px !important;
+ }
+ .mce-videopress-field-w .mce-label,
+ .mce-videopress-field-at .mce-label {
+ width: 115px !important;
+ text-align: right;
+ }
+ .mce-videopress-field-unit {
+ position: absolute;
+ left: 210px;
+ top: 5px;
+ }
+ </style>
+ <?php
+}
diff --git a/plugins/jetpack/modules/videopress/utility-functions.php b/plugins/jetpack/modules/videopress/utility-functions.php
new file mode 100644
index 00000000..99eb7557
--- /dev/null
+++ b/plugins/jetpack/modules/videopress/utility-functions.php
@@ -0,0 +1,99 @@
+<?php
+
+/**
+ * Validate user-supplied guid values against expected inputs
+ *
+ * @since 1.1
+ * @param string $guid video identifier
+ * @return bool true if passes validation test
+ */
+function videopress_is_valid_guid( $guid ) {
+ if ( ! empty( $guid ) && strlen( $guid ) === 8 && ctype_alnum( $guid ) ) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Get details about a specific video by GUID:
+ *
+ * @param $guid string
+ * @return object
+ */
+function videopress_get_video_details( $guid ) {
+ if ( ! videopress_is_valid_guid( $guid ) ) {
+ return new WP_Error( 'bad-guid-format', __( 'Invalid Video GUID!', 'jetpack' ) );
+ }
+
+ $version = '1.1';
+ $endpoint = sprintf( '/videos/%1$s', $guid );
+ $response = wp_remote_get( sprintf( 'https://public-api.wordpress.com/rest/v%1$s%2$s', $version, $endpoint ) );
+ $data = json_decode( wp_remote_retrieve_body( $response ) );
+
+ /**
+ * Allow functions to modify fetched video details.
+ *
+ * This filter allows third-party code to modify the return data
+ * about a given video. It may involve swapping some data out or
+ * adding new parameters.
+ *
+ * @since 4.0.0
+ *
+ * @param object $data The data returned by the WPCOM API. See: https://developer.wordpress.com/docs/api/1.1/get/videos/%24guid/
+ * @param string $guid The GUID of the VideoPress video in question.
+ */
+ return apply_filters( 'videopress_get_video_details', $data, $guid );
+}
+
+
+/**
+ * Get an attachment ID given a URL.
+ *
+ * Modified from http://wpscholar.com/blog/get-attachment-id-from-wp-image-url/
+ *
+ * @todo: Add some caching in here.
+ *
+ * @param string $url
+ *
+ * @return int|bool Attachment ID on success, false on failure
+ */
+function videopress_get_attachment_id_by_url( $url ) {
+ $wp_upload_dir = wp_upload_dir();
+ // Strip out protocols, so it doesn't fail because searching for http: in https: dir.
+ $dir = set_url_scheme( trailingslashit( $wp_upload_dir['baseurl'] ), 'relative' );
+
+ // Is URL in uploads directory?
+ if ( false !== strpos( $url, $dir ) ) {
+
+ $file = basename( $url );
+
+ $query_args = array(
+ 'post_type' => 'attachment',
+ 'post_status' => 'inherit',
+ 'fields' => 'ids',
+ 'meta_query' => array(
+ array(
+ 'key' => '_wp_attachment_metadata',
+ 'compare' => 'LIKE',
+ 'value' => $file,
+ ),
+ )
+ );
+
+ $query = new WP_Query( $query_args );
+
+ if ( $query->have_posts() ) {
+ foreach ( $query->posts as $attachment_id ) {
+ $meta = wp_get_attachment_metadata( $attachment_id );
+ $original_file = basename( $meta['file'] );
+ $cropped_files = wp_list_pluck( $meta['sizes'], 'file' );
+
+ if ( $original_file === $file || in_array( $file, $cropped_files ) ) {
+ return (int) $attachment_id;
+ }
+ }
+ }
+
+ }
+ return false;
+}
diff --git a/plugins/jetpack/modules/videopress/videopress-editor-style.css b/plugins/jetpack/modules/videopress/videopress-editor-style.css
new file mode 100644
index 00000000..b2c29c5f
--- /dev/null
+++ b/plugins/jetpack/modules/videopress/videopress-editor-style.css
@@ -0,0 +1,21 @@
+/**
+ * VideoPress styles for Editor
+ */
+.videopress-editor-wrapper {
+ position: relative;
+ max-width: 100%;
+ padding: 56.25% 0 0;
+ height: 0;
+ overflow: hidden;
+}
+.tmpl-videopress_iframe_next iframe {
+ position: absolute;
+ top: 0;
+ left: 0;
+ max-width: 100%;
+ max-height: 100%;
+}
+body.rtl .tmpl-videopress_iframe_next iframe {
+ left: auto;
+ right: 0;
+} \ No newline at end of file
diff --git a/plugins/jetpack/modules/videopress/videopress.php b/plugins/jetpack/modules/videopress/videopress.php
index 1f7236a1..274b740e 100644
--- a/plugins/jetpack/modules/videopress/videopress.php
+++ b/plugins/jetpack/modules/videopress/videopress.php
@@ -25,8 +25,6 @@ class Jetpack_VideoPress {
add_action( 'init', array( $this, 'on_init' ) );
add_action( 'jetpack_activate_module_videopress', array( $this, 'jetpack_module_activated' ) );
add_action( 'jetpack_deactivate_module_videopress', array( $this, 'jetpack_module_deactivated' ) );
-
- require_once( dirname( __FILE__ ) . '/shortcode.php' );
}
/**
@@ -428,7 +426,6 @@ class Jetpack_VideoPress {
return wp_send_json_error( 'xml rpc request error' );
$items = $result;
- $shortcode_handler = Jetpack_VideoPress_Shortcode::init();
foreach ( $items as $key => $item ) {
@@ -447,7 +444,7 @@ class Jetpack_VideoPress {
if ( ! empty( $item['vp_nonces']['delete'] ) )
$item['nonces']['delete'] = wp_create_nonce( 'delete-videopress-post_' . $item['id'] );
- $item['vp_embed'] = $shortcode_handler->shortcode_callback( array(
+ $item['vp_embed'] = videopress_shortcode_callback( array(
$item['vp_guid'],
'autoplay' => true,
'flashonly' => true,
@@ -578,7 +575,7 @@ class Jetpack_VideoPress {
if ( did_action( 'videopress_enqueue_admin_scripts' ) )
return;
- wp_enqueue_script( 'videopress-admin', plugins_url( 'videopress-admin.js', __FILE__ ), array( 'jquery', 'media-views', 'media-models' ), $this->version );
+ wp_enqueue_script( 'videopress-admin', plugins_url( 'js/videopress-admin.js', __FILE__ ), array( 'jquery', 'media-views', 'media-models' ), $this->version );
wp_enqueue_style( 'videopress-admin', plugins_url( 'videopress-admin.css', __FILE__ ), array(), $this->version );
$caps = array();
@@ -733,6 +730,7 @@ class Jetpack_VideoPress {
return $options;
}
+
}
// Initialize the module.
diff --git a/plugins/jetpack/modules/widget-visibility/widget-conditions.php b/plugins/jetpack/modules/widget-visibility/widget-conditions.php
index c6241dea..01a18ca7 100644
--- a/plugins/jetpack/modules/widget-visibility/widget-conditions.php
+++ b/plugins/jetpack/modules/widget-visibility/widget-conditions.php
@@ -119,7 +119,7 @@ class Jetpack_Widget_Conditions {
<optgroup label="<?php esc_attr_e( 'Post type:', 'jetpack' ); ?>">
<?php
- $post_types = get_post_types( array( 'public' => true ), 'objects' );
+ $post_types = get_post_types( array( 'public' => true, '_builtin' => true ), 'objects' );
foreach ( $post_types as $post_type ) {
?>
@@ -173,6 +173,55 @@ class Jetpack_Widget_Conditions {
<?php
}
break;
+
+ case 'post_type':
+ ?>
+ <optgroup label="<?php echo esc_attr_x( 'Single post:', 'a heading for a list of custom post types', 'jetpack' ); ?>">
+ <?php
+
+ $post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'objects' );
+
+ foreach ( $post_types as $post_type ) {
+ ?>
+ <option
+ value="<?php echo esc_attr( 'post_type-' . $post_type->name ); ?>"
+ <?php selected( 'post_type-' . $post_type->name, $minor ); ?>>
+ <?php echo esc_html( $post_type->labels->singular_name ); ?>
+ </option>
+ <?php
+ }
+
+ ?>
+ </optgroup>
+ <optgroup label="<?php echo esc_attr_x( 'Archive page:', 'a heading for a list of custom post archive pages', 'jetpack' ); ?>">
+ <?php
+
+ $post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'objects' );
+
+ foreach ( $post_types as $post_type ) {
+ ?>
+ <option
+ value="<?php echo esc_attr( 'post_type_archive-' . $post_type->name ); ?>"
+ <?php selected( 'post_type_archive-' . $post_type->name, $minor ); ?>>
+ <?php
+ echo sprintf(
+ /* translators: %s is a plural name of the custom post type, i.e. testimonials */
+ _x(
+ 'Archive of %s',
+ 'a label in the list of custom post type archive pages',
+ 'jetpack'
+ ),
+ $post_type->labels->name
+ );
+ ?>
+ </option>
+ <?php
+ }
+
+ ?>
+ </optgroup>
+ <?php
+ break;
}
}
@@ -269,7 +318,7 @@ class Jetpack_Widget_Conditions {
<option value="tag" <?php selected( "tag", $rule['major'] ); ?>><?php echo esc_html_x( 'Tag', 'Noun, as in: "This post has one tag."', 'jetpack' ); ?></option>
<option value="date" <?php selected( "date", $rule['major'] ); ?>><?php echo esc_html_x( 'Date', 'Noun, as in: "This page is a date archive."', 'jetpack' ); ?></option>
<option value="page" <?php selected( "page", $rule['major'] ); ?>><?php echo esc_html_x( 'Page', 'Example: The user is looking at a page, not a post.', 'jetpack' ); ?></option>
-
+ <option value="post_type" <?php selected( "post_type", $rule['major'] ); ?>><?php echo esc_html_x( 'Post Type', 'Example: the user is viewing a custom post type archive.', 'jetpack' ); ?></option>
<?php if ( get_taxonomies( array( '_builtin' => false ) ) ) : ?>
<option value="taxonomy" <?php selected( "taxonomy", $rule['major'] ); ?>><?php echo esc_html_x( 'Taxonomy', 'Noun, as in: "This post has one taxonomy."', 'jetpack' ); ?></option>
<?php endif; ?>
@@ -519,7 +568,7 @@ class Jetpack_Widget_Conditions {
} else {
// $rule['minor'] is a page ID
$condition_result = is_page() && ( $rule['minor'] == get_the_ID() );
-
+
// Check if $rule['minor'] is parent of page ID
if ( ! $condition_result && isset( $rule['has_children'] ) && $rule['has_children'] )
$condition_result = wp_get_post_parent_id( get_the_ID() ) == $rule['minor'];
@@ -584,6 +633,13 @@ class Jetpack_Widget_Conditions {
$condition_result = false;
}
break;
+ case 'post_type':
+ if ( substr( $rule['minor'], 0, 10 ) == 'post_type-' ) {
+ $condition_result = is_singular( substr( $rule['minor'], 10 ) );
+ } elseif ( substr( $rule['minor'], 0, 18 ) == 'post_type_archive-' ) {
+ $condition_result = is_post_type_archive( substr( $rule['minor'], 18 ) );
+ }
+ break;
case 'taxonomy':
$term = explode( '_tax_', $rule['minor'] ); // $term[0] = taxonomy name; $term[1] = term id
if ( isset( $term[0] ) && isset( $term[1] ) ) {
diff --git a/plugins/jetpack/modules/widgets.php b/plugins/jetpack/modules/widgets.php
index 8997c06c..288b985b 100644
--- a/plugins/jetpack/modules/widgets.php
+++ b/plugins/jetpack/modules/widgets.php
@@ -55,3 +55,13 @@ add_filter( 'jetpack_widget_name', 'jetpack_widgets_add_suffix' );
jetpack_load_widgets();
+
+/**
+ * Enqueue utilities to work with widgets in Customizer.
+ *
+ * @since 4.0.0
+ */
+function jetpack_widgets_customizer_assets() {
+ wp_enqueue_script( 'jetpack-customizer-widget-utils', plugins_url( '/widgets/customizer-utils.js', __FILE__ ), array( 'jquery' ) );
+}
+add_action( 'customize_preview_init', 'jetpack_widgets_customizer_assets' ); \ No newline at end of file
diff --git a/plugins/jetpack/modules/widgets/contact-info/contact-info-map.js b/plugins/jetpack/modules/widgets/contact-info/contact-info-map.js
index 3b5a0de7..cf09d91c 100644
--- a/plugins/jetpack/modules/widgets/contact-info/contact-info-map.js
+++ b/plugins/jetpack/modules/widgets/contact-info/contact-info-map.js
@@ -1,7 +1,6 @@
/* global google */
/* jshint unused:false */
jQuery( function( $ ) {
- var hasSelectiveRefresh;
function setupContactMaps( rootElement ) {
rootElement = $( rootElement || document.body );
@@ -32,16 +31,9 @@ jQuery( function( $ ) {
setupContactMaps();
- hasSelectiveRefresh = (
- 'undefined' !== typeof wp &&
- wp.customize &&
- wp.customize.selectiveRefresh &&
- wp.customize.widgetsPreview &&
- wp.customize.widgetsPreview.WidgetPartial
- );
- if ( hasSelectiveRefresh ) {
+ if ( wp && wp.customize && wp.customizerHasPartialWidgetRefresh() ) {
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
- if ( placement.partial.widgetId && /^widget_contact_info-\d+$/.test( placement.partial.widgetId ) ) {
+ if ( wp.isJetpackWidgetPlaced( placement, 'widget_contact_info' ) ) {
setupContactMaps( placement.container );
}
} );
diff --git a/plugins/jetpack/modules/widgets/customizer-utils.js b/plugins/jetpack/modules/widgets/customizer-utils.js
new file mode 100644
index 00000000..a7832a3c
--- /dev/null
+++ b/plugins/jetpack/modules/widgets/customizer-utils.js
@@ -0,0 +1,76 @@
+/* global gapi, FB, twttr */
+
+/**
+ * Utilities to work with widgets in Customizer.
+ */
+
+/**
+ * Checks whether this Customizer supports partial widget refresh.
+ * @returns {boolean}
+ */
+wp.customizerHasPartialWidgetRefresh = function() {
+ return 'object' === typeof wp && 'function' === typeof wp.customize && 'object' === typeof wp.customize.selectiveRefresh && 'object' === typeof wp.customize.widgetsPreview && 'function' === typeof wp.customize.widgetsPreview.WidgetPartial;
+};
+
+/**
+ * Verifies that the placed widget ID contains the widget name.
+ * @param {object} placement
+ * @param {string} widgetName
+ * @returns {*|boolean}
+ */
+wp.isJetpackWidgetPlaced = function( placement, widgetName ) {
+ return placement.partial.widgetId && 0 === placement.partial.widgetId.indexOf( widgetName );
+};
+
+/**
+ * Bind events for selective refresh in Customizer.
+ */
+(function($){
+
+ $( document ).ready( function() {
+
+ if ( wp && wp.customize && wp.customizerHasPartialWidgetRefresh() ) {
+
+ // Refresh widget contents when a partial is rendered.
+ wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function ( placement ) {
+ if ( placement.container ) {
+
+ // Refresh Google+
+ if ( wp.isJetpackWidgetPlaced( placement, 'googleplus-badge' ) && 'object' === typeof gapi && gapi.person && 'function' === typeof gapi.person.go ) {
+ gapi.person.go( placement.container[0] );
+ }
+
+ // Refresh Facebook XFBML
+ else if ( wp.isJetpackWidgetPlaced( placement, 'facebook-likebox' ) && 'object' === typeof FB && 'object' === typeof FB.XFBML && 'function' === typeof FB.XFBML.parse ) {
+ FB.XFBML.parse( placement.container[0], function() {
+ var $fbContainer = $( placement.container[0] ).find( '.fb_iframe_widget' ),
+ fbWidth = $fbContainer.data( 'width' ),
+ fbHeight = $fbContainer.data( 'height' );
+ $fbContainer.find( 'span' ).css( { 'width': fbWidth, 'height': fbHeight } );
+ setTimeout( function() {
+ $fbContainer.find( 'iframe' ).css( { 'width': fbWidth, 'height': fbHeight, 'position': 'relative' } );
+ }, 1 );
+ } );
+ }
+
+ // Refresh Twitter
+ else if ( wp.isJetpackWidgetPlaced( placement, 'twitter_timeline' ) && 'object' === typeof twttr && 'object' === typeof twttr.widgets && 'function' === typeof twttr.widgets.load ) {
+ twttr.widgets.load( placement.container[0] );
+ }
+ }
+ } );
+
+ // Refresh widgets when they're moved.
+ wp.customize.selectiveRefresh.bind( 'partial-content-moved', function( placement ) {
+ if ( placement.container ) {
+
+ // Refresh Twitter timeline iframe, since it has to be re-built.
+ if ( wp.isJetpackWidgetPlaced( placement, 'twitter_timeline' ) && placement.container.find( 'iframe.twitter-timeline:not([src]):first' ).length ) {
+ placement.partial.refresh();
+ }
+ }
+ } );
+ }
+ });
+
+})(jQuery); \ No newline at end of file
diff --git a/plugins/jetpack/modules/widgets/facebook-likebox.php b/plugins/jetpack/modules/widgets/facebook-likebox.php
index 4bf00713..cd7e8c51 100644
--- a/plugins/jetpack/modules/widgets/facebook-likebox.php
+++ b/plugins/jetpack/modules/widgets/facebook-likebox.php
@@ -288,7 +288,7 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget {
* @deprecated
*/
function guess_locale_from_lang( $lang ) {
- _deprecated_function( __METHOD__, '3.10', 'Jetpack::guess_locale_from_lang()' );
+ _deprecated_function( __METHOD__, '4.0.0', 'Jetpack::guess_locale_from_lang()' );
Jetpack::$instance->get_locale_from_lang( $lang );
}
@@ -296,7 +296,7 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget {
* @deprecated
*/
function get_locale() {
- _deprecated_function( __METHOD__, '3.10', 'Jetpack::get_locale()' );
+ _deprecated_function( __METHOD__, '4.0.0', 'Jetpack::get_locale()' );
Jetpack::$instance->get_locale();
}
}
diff --git a/plugins/jetpack/modules/widgets/gallery.php b/plugins/jetpack/modules/widgets/gallery.php
index 0ad87d40..cfda090d 100644
--- a/plugins/jetpack/modules/widgets/gallery.php
+++ b/plugins/jetpack/modules/widgets/gallery.php
@@ -17,7 +17,8 @@ class Jetpack_Gallery_Widget extends WP_Widget {
public function __construct() {
$widget_ops = array(
'classname' => 'widget-gallery',
- 'description' => __( 'Display a photo gallery or slideshow', 'jetpack' )
+ 'description' => __( 'Display a photo gallery or slideshow', 'jetpack' ),
+ 'customize_selective_refresh' => true,
);
$control_ops = array( 'width' => 250 );
@@ -30,6 +31,25 @@ class Jetpack_Gallery_Widget extends WP_Widget {
$widget_ops,
$control_ops
);
+
+ if ( is_customize_preview() ) {
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
+
+ if ( class_exists( 'Jetpack_Tiled_Gallery' ) ) {
+ $tiled_gallery = new Jetpack_Tiled_Gallery();
+ add_action( 'wp_enqueue_scripts', array( $tiled_gallery, 'default_scripts_and_styles' ) );
+ }
+
+ if ( class_exists( 'Jetpack_Slideshow_Shortcode' ) ) {
+ $slideshow = new Jetpack_Slideshow_Shortcode();
+ add_action( 'wp_enqueue_scripts', array( $slideshow, 'enqueue_scripts' ) );
+ }
+
+ if ( class_exists( 'Jetpack_Carousel' ) ) {
+ $carousel = new Jetpack_Carousel();
+ add_action( 'wp_enqueue_scripts', array( $carousel, 'enqueue_assets' ) );
+ }
+ }
}
/**
diff --git a/plugins/jetpack/modules/widgets/gallery/js/gallery.js b/plugins/jetpack/modules/widgets/gallery/js/gallery.js
index b5764f87..1740262e 100644
--- a/plugins/jetpack/modules/widgets/gallery/js/gallery.js
+++ b/plugins/jetpack/modules/widgets/gallery/js/gallery.js
@@ -1,12 +1,10 @@
(function($){
- $(function(){
- // Fixes a bug with carousels being triggered even when a widget's Link To option is not set to carousel.
- // Happens when another gallery is loaded on the page, either in a post or separate widget
- $( '.widget-gallery .no-carousel .tiled-gallery-item a' ).on( 'click', function( event ){
- // Have to trigger default, instead of carousel
- event.stopPropagation();
+ // Fixes a bug with carousels being triggered even when a widget's Link To option is not set to carousel.
+ // Happens when another gallery is loaded on the page, either in a post or separate widget
+ $( 'body' ).on( 'click', '.widget-gallery .no-carousel .tiled-gallery-item a', function( event ){
+ // Have to trigger default, instead of carousel
+ event.stopPropagation();
- return true;
- });
+ return true;
});
})(jQuery); \ No newline at end of file
diff --git a/plugins/jetpack/modules/widgets/goodreads.php b/plugins/jetpack/modules/widgets/goodreads.php
index 338a481d..e268b10e 100644
--- a/plugins/jetpack/modules/widgets/goodreads.php
+++ b/plugins/jetpack/modules/widgets/goodreads.php
@@ -25,7 +25,8 @@ class WPCOM_Widget_Goodreads extends WP_Widget {
apply_filters( 'jetpack_widget_name', __( 'Goodreads', 'jetpack' ) ),
array(
'classname' => 'widget_goodreads',
- 'description' => __( 'Display your books from Goodreads', 'jetpack' )
+ 'description' => __( 'Display your books from Goodreads', 'jetpack' ),
+ 'customize_selective_refresh' => true,
)
);
// For user input sanitization and display
@@ -35,7 +36,7 @@ class WPCOM_Widget_Goodreads extends WP_Widget {
'to-read' => _x( 'To Read', 'my list of books to read', 'jetpack' )
);
- if ( is_active_widget( '', '', 'wpcom-goodreads' ) ) {
+ if ( is_active_widget( '', '', 'wpcom-goodreads' ) || is_customize_preview() ) {
add_action( 'wp_print_styles', array( $this, 'enqueue_style' ) );
}
}
@@ -50,13 +51,13 @@ class WPCOM_Widget_Goodreads extends WP_Widget {
function widget( $args, $instance ) {
/** This filter is documented in core/src/wp-includes/default-widgets.php */
- $title = apply_filters( 'widget_title', $instance['title'] );
+ $title = apply_filters( 'widget_title', isset( $instance['title'] ) ? $instance['title'] : '' );
if ( empty( $instance['user_id'] ) || 'invalid' === $instance['user_id'] ) {
if ( current_user_can('edit_theme_options') ) {
echo $args['before_widget'];
echo '<p>' . sprintf(
- __( 'You need to enter your numeric user ID for the <a href="%1$s">Goodreads Widget</a> to work correctly. <a href="%2$s">Full instructions</a>.', 'jetpack' ),
+ __( 'You need to enter your numeric user ID for the <a href="%1$s">Goodreads Widget</a> to work correctly. <a href="%2$s" target="_blank">Full instructions</a>.', 'jetpack' ),
esc_url( admin_url( 'widgets.php' ) ),
'http://support.wordpress.com/widgets/goodreads-widget/#goodreads-user-id'
) . '</p>';
diff --git a/plugins/jetpack/modules/widgets/googleplus-badge.php b/plugins/jetpack/modules/widgets/googleplus-badge.php
index 617daf0d..de688437 100644
--- a/plugins/jetpack/modules/widgets/googleplus-badge.php
+++ b/plugins/jetpack/modules/widgets/googleplus-badge.php
@@ -42,13 +42,14 @@ class WPCOM_Widget_GooglePlus_Badge extends WP_Widget {
apply_filters( 'jetpack_widget_name', __( 'Google+ Badge', 'jetpack' ) ),
array(
'classname' => 'widget_googleplus_badge',
- 'description' => __( 'Display a Google+ Badge to connect visitors to your Google+', 'jetpack' )
+ 'description' => __( 'Display a Google+ Badge to connect visitors to your Google+', 'jetpack' ),
+ 'customize_selective_refresh' => true,
)
);
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
- if ( is_active_widget( '', '', 'googleplus-badge' ) ) {
+ if ( is_active_widget( '', '', 'googleplus-badge' ) || is_customize_preview() ) {
add_action( 'wp_print_styles', array( $this, 'enqueue_script' ) );
add_filter( 'script_loader_tag', array( $this, 'replace_script_tag' ), 10, 2 );
}
diff --git a/plugins/jetpack/modules/widgets/gravatar-profile.php b/plugins/jetpack/modules/widgets/gravatar-profile.php
index 103fb128..00e701e2 100644
--- a/plugins/jetpack/modules/widgets/gravatar-profile.php
+++ b/plugins/jetpack/modules/widgets/gravatar-profile.php
@@ -22,13 +22,18 @@ class Jetpack_Gravatar_Profile_Widget extends WP_Widget {
apply_filters( 'jetpack_widget_name', __( 'Gravatar Profile', 'jetpack' ) ),
array(
'classname' => 'widget-grofile grofile',
- 'description' => __( 'Display a mini version of your Gravatar Profile', 'jetpack' )
+ 'description' => __( 'Display a mini version of your Gravatar Profile', 'jetpack' ),
+ 'customize_selective_refresh' => true,
)
);
if ( is_admin() ) {
add_action( 'admin_footer-widgets.php', array( $this, 'admin_script' ) );
}
+
+ if ( is_customize_preview() ) {
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
+ }
}
function widget( $args, $instance ) {
@@ -69,19 +74,8 @@ class Jetpack_Gravatar_Profile_Widget extends WP_Widget {
) );
$gravatar_url = add_query_arg( 's', 320, $profile['thumbnailUrl'] ); // the default grav returned by grofiles is super small
- wp_enqueue_style(
- 'gravatar-profile-widget',
- plugins_url( 'gravatar-profile.css', __FILE__ ),
- array(),
- '20120711'
- );
-
- wp_enqueue_style(
- 'gravatar-card-services',
- is_ssl() ? 'https://secure.gravatar.com/css/services.css' : 'http://s.gravatar.com/css/services.css',
- array(),
- defined( 'GROFILES__CACHE_BUSTER' ) ? GROFILES__CACHE_BUSTER : gmdate( 'YW' )
- );
+ // Enqueue front end assets.
+ $this->enqueue_scripts();
?>
<img src="<?php echo esc_url( $gravatar_url ); ?>" class="grofile-thumbnail no-grav" alt="<?php echo esc_attr( $profile['displayName'] ); ?>" />
@@ -221,6 +215,27 @@ class Jetpack_Gravatar_Profile_Widget extends WP_Widget {
<?php
}
+ /**
+ * Enqueue CSS and JavaScript.
+ *
+ * @since 4.0.0
+ */
+ function enqueue_scripts() {
+ wp_enqueue_style(
+ 'gravatar-profile-widget',
+ plugins_url( 'gravatar-profile.css', __FILE__ ),
+ array(),
+ '20120711'
+ );
+
+ wp_enqueue_style(
+ 'gravatar-card-services',
+ is_ssl() ? 'https://secure.gravatar.com/css/services.css' : 'http://s.gravatar.com/css/services.css',
+ array(),
+ defined( 'GROFILES__CACHE_BUSTER' ) ? GROFILES__CACHE_BUSTER : gmdate( 'YW' )
+ );
+ }
+
function form( $instance ) {
$title = isset( $instance['title'] ) ? $instance['title'] : '';
$email = isset( $instance['email'] ) ? $instance['email'] : '';
diff --git a/plugins/jetpack/modules/widgets/image-widget.php b/plugins/jetpack/modules/widgets/image-widget.php
index fab8df50..8563cf1b 100644
--- a/plugins/jetpack/modules/widgets/image-widget.php
+++ b/plugins/jetpack/modules/widgets/image-widget.php
@@ -25,11 +25,12 @@ class Jetpack_Image_Widget extends WP_Widget {
apply_filters( 'jetpack_widget_name', esc_html__( 'Image', 'jetpack' ) ),
array(
'classname' => 'widget_image',
- 'description' => __( 'Display an image in your sidebar', 'jetpack' )
+ 'description' => __( 'Display an image in your sidebar', 'jetpack' ),
+ 'customize_selective_refresh' => true,
)
);
- if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) ) {
+ if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) );
}
}
diff --git a/plugins/jetpack/modules/widgets/rsslinks-widget.php b/plugins/jetpack/modules/widgets/rsslinks-widget.php
index c1ed416e..6086744e 100644
--- a/plugins/jetpack/modules/widgets/rsslinks-widget.php
+++ b/plugins/jetpack/modules/widgets/rsslinks-widget.php
@@ -11,7 +11,8 @@ class Jetpack_RSS_Links_Widget extends WP_Widget {
function __construct() {
$widget_ops = array(
'classname' => 'widget_rss_links',
- 'description' => __( "Links to your blog's RSS feeds", 'jetpack' )
+ 'description' => __( "Links to your blog's RSS feeds", 'jetpack' ),
+ 'customize_selective_refresh' => true,
);
parent::__construct(
'rss_links',
diff --git a/plugins/jetpack/modules/widgets/top-posts.php b/plugins/jetpack/modules/widgets/top-posts.php
index 3bf12b7c..9e0278bc 100644
--- a/plugins/jetpack/modules/widgets/top-posts.php
+++ b/plugins/jetpack/modules/widgets/top-posts.php
@@ -36,12 +36,13 @@ class Jetpack_Top_Posts_Widget extends WP_Widget {
apply_filters( 'jetpack_widget_name', __( 'Top Posts &amp; Pages', 'jetpack' ) ),
array(
'description' => __( 'Shows your most viewed posts and pages.', 'jetpack' ),
+ 'customize_selective_refresh' => true,
)
);
$this->default_title = __( 'Top Posts &amp; Pages', 'jetpack' );
- if ( is_active_widget( false, false, $this->id_base ) ) {
+ if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) );
}
@@ -295,7 +296,7 @@ class Jetpack_Top_Posts_Widget extends WP_Widget {
if ( ! $posts ) {
if ( current_user_can( 'edit_theme_options' ) ) {
echo '<p>' . sprintf(
- __( 'There are no posts to display. <a href="%s">Want more traffic?</a>', 'jetpack' ),
+ __( 'There are no posts to display. <a href="%s" target="_blank">Want more traffic?</a>', 'jetpack' ),
'http://en.support.wordpress.com/getting-more-site-traffic/'
) . '</p>';
}
diff --git a/plugins/jetpack/modules/widgets/twitter-timeline.php b/plugins/jetpack/modules/widgets/twitter-timeline.php
index 76719043..fc22fc5a 100644
--- a/plugins/jetpack/modules/widgets/twitter-timeline.php
+++ b/plugins/jetpack/modules/widgets/twitter-timeline.php
@@ -48,7 +48,7 @@ class Jetpack_Twitter_Timeline_Widget extends WP_Widget {
* @deprecated
*/
public function library() {
- _deprecated_function( __METHOD__, '3.10' );
+ _deprecated_function( __METHOD__, '4.0.0' );
wp_print_scripts( array( 'jetpack-twitter-timeline' ) );
}
diff --git a/plugins/jetpack/modules/widgets/wordpress-post-widget.php b/plugins/jetpack/modules/widgets/wordpress-post-widget.php
index f06753bc..33cb528d 100644
--- a/plugins/jetpack/modules/widgets/wordpress-post-widget.php
+++ b/plugins/jetpack/modules/widgets/wordpress-post-widget.php
@@ -145,8 +145,13 @@ class Jetpack_Display_Posts_Widget extends WP_Widget {
apply_filters( 'jetpack_widget_name', __( 'Display WordPress Posts', 'jetpack' ) ),
array(
'description' => __( 'Displays a list of recent posts from another WordPress.com or Jetpack-enabled blog.', 'jetpack' ),
+ 'customize_selective_refresh' => true,
)
);
+
+ if ( is_customize_preview() ) {
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
+ }
}
/**
@@ -727,7 +732,8 @@ class Jetpack_Display_Posts_Widget extends WP_Widget {
/** This filter is documented in core/src/wp-includes/default-widgets.php */
$title = apply_filters( 'widget_title', $instance['title'] );
- wp_enqueue_style( 'jetpack_display_posts_widget', plugins_url( 'wordpress-post-widget/style.css', __FILE__ ) );
+ // Enqueue front end assets.
+ $this->enqueue_scripts();
echo $args['before_widget'];
@@ -883,6 +889,15 @@ class Jetpack_Display_Posts_Widget extends WP_Widget {
}
/**
+ * Enqueue CSS and JavaScript.
+ *
+ * @since 4.0.0
+ */
+ public function enqueue_scripts() {
+ wp_enqueue_style( 'jetpack_display_posts_widget', plugins_url( 'wordpress-post-widget/style.css', __FILE__ ) );
+ }
+
+ /**
* Display the widget administration form.
*
* @param array $instance Widget instance configuration.