Jetpack by WordPress.com - Version 3.9.7

Version Description

Release date: May 26th, 2016

  • Important security update. Please upgrade immediately.
Download this release

Release Info

Developer samhotchkiss
Plugin Icon 128x128 Jetpack by WordPress.com
Version 3.9.7
Comparing to
See all releases

Code changes from version 3.8.3 to 3.9.7

Files changed (125) hide show
  1. _inc/facebook-embed.js +57 -0
  2. _inc/footer.php +3 -3
  3. _inc/genericons/README.md +4 -0
  4. _inc/genericons/genericons/genericons.css +1 -0
  5. _inc/genericons/genericons/rtl/genericons-rtl.css +2 -1
  6. _inc/header.php +1 -1
  7. _inc/jetpack-jitm.js +55 -19
  8. _inc/jetpack-modules.js +1 -4
  9. _inc/lib/admin-pages/class.jetpack-landing-page.php +2 -4
  10. _inc/lib/class.color.php +11 -6
  11. _inc/lib/markdown/extra.php +2 -2
  12. _inc/lib/markdown/gfm.php +16 -0
  13. _inc/lib/tracks/class.tracks-client.php +168 -0
  14. _inc/lib/tracks/class.tracks-event.php +149 -0
  15. _inc/lib/tracks/client.php +124 -0
  16. _inc/lib/tracks/tracks-ajax.js +49 -0
  17. _inc/twitter-timeline.js +39 -0
  18. changelog.txt +261 -27
  19. class.jetpack-admin.php +7 -17
  20. class.jetpack-cli.php +1 -1
  21. class.jetpack-client-server.php +8 -1
  22. class.jetpack-client.php +7 -2
  23. class.jetpack-debugger.php +34 -8
  24. class.jetpack-jitm.php +298 -80
  25. class.jetpack-modules-list-table.php +3 -8
  26. class.jetpack-network-sites-list-table.php +4 -1
  27. class.jetpack-network.php +5 -5
  28. class.jetpack-post-images.php +23 -0
  29. class.jetpack-signature.php +5 -0
  30. class.jetpack-sync.php +1 -1
  31. class.jetpack-tracks.php +83 -0
  32. class.jetpack-user-agent.php +3 -3
  33. class.jetpack-xmlrpc-server.php +1 -1
  34. class.jetpack.php +332 -176
  35. class.json-api-endpoints.php +105 -42
  36. class.json-api.php +2 -14
  37. class.photon.php +48 -21
  38. composer.json +1 -1
  39. css/jetpack-admin-jitm-rtl.css +44 -1
  40. css/jetpack-admin-jitm-rtl.min.css +1 -1
  41. css/jetpack-admin-jitm.css +43 -0
  42. css/jetpack-admin-jitm.css.map +1 -1
  43. css/jetpack-admin-jitm.min.css +1 -1
  44. css/jetpack-admin-jitm.min.css.map +1 -1
  45. css/jetpack-admin-rtl.css +16 -8
  46. css/jetpack-admin-rtl.min.css +1 -1
  47. css/jetpack-admin.css +15 -7
  48. css/jetpack-admin.css.map +1 -1
  49. css/jetpack-admin.min.css +1 -1
  50. css/jetpack-admin.min.css.map +1 -1
  51. css/jetpack-rtl.css +1 -1
  52. css/jetpack.css +1 -1
  53. functions.opengraph.php +14 -9
  54. functions.photon.php +6 -2
  55. jetpack.php +9 -6
  56. json-endpoints.php +24 -232
  57. json-endpoints/class.wpcom-json-api-delete-media-endpoint.php +1 -1
  58. json-endpoints/class.wpcom-json-api-delete-media-v1-1-endpoint.php +1 -1
  59. json-endpoints/class.wpcom-json-api-get-media-v1-1-endpoint.php +4 -0
  60. json-endpoints/class.wpcom-json-api-get-site-endpoint.php +73 -99
  61. json-endpoints/class.wpcom-json-api-get-site-v1-2-endpoint.php +52 -0
  62. json-endpoints/class.wpcom-json-api-list-media-v1-1-endpoint.php +4 -0
  63. json-endpoints/class.wpcom-json-api-list-post-types-endpoint.php +84 -0
  64. json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php +2 -1
  65. json-endpoints/class.wpcom-json-api-post-endpoint.php +3 -3
  66. json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php +20 -5
  67. json-endpoints/class.wpcom-json-api-sharing-buttons-endpoint.php +4 -0
  68. json-endpoints/class.wpcom-json-api-site-settings-endpoint.php +66 -9
  69. json-endpoints/class.wpcom-json-api-site-settings-v1-2-endpoint.php +61 -0
  70. json-endpoints/class.wpcom-json-api-update-post-endpoint.php +8 -1
  71. json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php +8 -1
  72. json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php +8 -2
  73. json-endpoints/jetpack/class.jetpack-json-api-core-modify-endpoint.php +9 -0
  74. json-endpoints/jetpack/class.jetpack-json-api-modules-endpoint.php +2 -7
  75. json-endpoints/jetpack/class.jetpack-json-api-plugins-install-endpoint.php +24 -14
  76. json-endpoints/jetpack/class.jetpack-json-api-plugins-modify-endpoint.php +11 -0
  77. json-endpoints/jetpack/class.jetpack-json-api-themes-modify-endpoint.php +10 -1
  78. json-endpoints/jetpack/class.wpcom-json-api-update-option-endpoint.php +9 -1
  79. json-endpoints/jetpack/json-api-jetpack-endpoints.php +6 -5
  80. languages/jetpack-ar.mo +0 -0
  81. languages/jetpack-de_DE.mo +0 -0
  82. languages/jetpack-es_ES.mo +0 -0
  83. languages/jetpack-fi.mo +0 -0
  84. languages/jetpack-fr_FR.mo +0 -0
  85. languages/jetpack-he_IL.mo +0 -0
  86. languages/jetpack-id_ID.mo +0 -0
  87. languages/jetpack-it_IT.mo +0 -0
  88. languages/jetpack-ja.mo +0 -0
  89. languages/jetpack-ko_KR.mo +0 -0
  90. languages/jetpack-nl_NL.mo +0 -0
  91. languages/jetpack-pt_BR.mo +0 -0
  92. languages/jetpack-ro_RO.mo +0 -0
  93. languages/jetpack-ru_RU.mo +0 -0
  94. languages/jetpack-sq.mo +0 -0
  95. languages/jetpack-sv_SE.mo +0 -0
  96. languages/jetpack-tr_TR.mo +0 -0
  97. languages/jetpack-zh_CN.mo +0 -0
  98. languages/jetpack-zh_TW.mo +0 -0
  99. locales.php +1 -3
  100. modules/after-the-deadline/atd-nonvis-editor-plugin.js +18 -2
  101. modules/after-the-deadline/atd.core.js +14 -1
  102. modules/carousel/jetpack-carousel.js +39 -17
  103. modules/carousel/jetpack-carousel.php +5 -2
  104. modules/carousel/rtl/jetpack-carousel-rtl.css +16 -1
  105. modules/comments/comments.php +5 -6
  106. modules/contact-form/admin.php +10 -7
  107. modules/contact-form/grunion-contact-form.php +355 -34
  108. modules/contact-form/js/grunion-frontend.js +3 -1
  109. modules/custom-content-types.php +1 -1
  110. modules/custom-css/custom-css.php +2 -2
  111. modules/custom-post-types/comics.php +1 -0
  112. modules/custom-post-types/js/many-items.js +1 -1
  113. modules/custom-post-types/nova.php +54 -48
  114. modules/custom-post-types/portfolios.php +18 -0
  115. modules/custom-post-types/testimonial.php +4 -0
  116. modules/infinite-scroll/infinity.js +65 -7
  117. modules/infinite-scroll/infinity.php +31 -154
  118. modules/latex.php +16 -1
  119. modules/likes.php +8 -1
  120. modules/manage/activate-admin.php +1 -1
  121. modules/manage/confirm-admin.php +2 -2
  122. modules/minileven.php +2 -2
  123. modules/module-extras.php +2 -1
  124. modules/module-headings.php +304 -236
  125. modules/module-info.php +264 -369
_inc/facebook-embed.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global FB, jpfbembed */
2
+ (function( window ) {
3
+ var facebookEmbed = function() {
4
+ var fbroot, src;
5
+
6
+ if ( 'undefined' !== typeof FB && FB.XFBML ) {
7
+ FB.XFBML.parse();
8
+ } else {
9
+ fbroot = document.createElement( 'div' );
10
+ fbroot.id = 'fb-root';
11
+ document.getElementsByTagName( 'body' )[0].appendChild( fbroot );
12
+
13
+ src = '//connect.facebook.net/' + jpfbembed.locale + '/sdk.js#xfbml=1';
14
+ if ( jpfbembed.appid ) {
15
+ src += '&appId=' + jpfbembed.appid;
16
+ }
17
+ src += '&version=v2.3';
18
+ jQuery.getScript( src );
19
+ }
20
+ };
21
+
22
+ window.fbAsyncInit = function() {
23
+ FB.init( {
24
+ appId : jpfbembed.appid,
25
+ version: 'v2.3'
26
+ } );
27
+
28
+ FB.XFBML.parse();
29
+ };
30
+
31
+ if ( 'undefined' !== typeof infiniteScroll ) {
32
+ jQuery( document.body ).on( 'post-load', facebookEmbed );
33
+ }
34
+
35
+ // Re-render Facebook XFBML when partials are re-rendered in the Customizer.
36
+ jQuery( function() {
37
+ var hasSelectiveRefresh = (
38
+ 'undefined' !== typeof wp &&
39
+ wp.customize &&
40
+ wp.customize.selectiveRefresh &&
41
+ wp.customize.widgetsPreview &&
42
+ wp.customize.widgetsPreview.WidgetPartial
43
+ );
44
+ if ( ! hasSelectiveRefresh ) {
45
+ return;
46
+ }
47
+
48
+ // Render Facebook widget in rendered partial.
49
+ wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
50
+ if ( placement.container ) {
51
+ FB.XFBML.parse( placement.container[0] );
52
+ }
53
+ } );
54
+ } );
55
+
56
+ facebookEmbed();
57
+ })( this );
_inc/footer.php CHANGED
@@ -13,12 +13,12 @@
13
 
14
  <nav class="secondary nav-horizontal">
15
  <div class="secondary-footer">
16
- <a href="http://jetpack.me">Jetpack <?php echo JETPACK__VERSION; ?></a>
17
  <a href="http://wordpress.com/tos/"><?php esc_html_e( 'Terms', 'jetpack' ); ?></a>
18
  <a href="http://automattic.com/privacy/"><?php esc_html_e( 'Privacy', 'jetpack' ); ?></a>
19
  <?php if ( current_user_can( 'jetpack_manage_modules' ) ) : ?><a href="<?php echo esc_url( Jetpack::admin_url( 'page=jetpack-debugger' ) ); ?>" title="<?php esc_attr_e( 'Test your site&#8217;s compatibility with Jetpack.', 'jetpack' ); ?>"><?php _e( 'Debug', 'jetpack' ); ?><?php endif; ?></a>
20
- <a href="http://jetpack.me/contact-support/" title="<?php esc_attr_e( 'Contact the Jetpack Happiness Squad.', 'jetpack' ); ?>"><?php _e( 'Support', 'jetpack' ); ?></a>
21
- <a href="http://jetpack.me/survey/?rel=<?php echo JETPACK__VERSION; ?>" title="<?php esc_attr_e( 'Take a survey. Tell us how we&#8217;re doing.', 'jetpack' ); ?>"><?php _e( 'Give Us Feedback', 'jetpack' ); ?></a>
22
  <?php if ( Jetpack::is_active() && current_user_can( 'jetpack_disconnect' ) ) : ?>
23
  <a href="<?php echo esc_url( Jetpack::admin_url( 'page=my_jetpack#disconnect' ) ); ?>"><?php esc_html_e( 'Disconnect Jetpack', 'jetpack' ); ?></a>
24
  <?php endif; ?>
13
 
14
  <nav class="secondary nav-horizontal">
15
  <div class="secondary-footer">
16
+ <a href="http://jetpack.com">Jetpack <?php echo JETPACK__VERSION; ?></a>
17
  <a href="http://wordpress.com/tos/"><?php esc_html_e( 'Terms', 'jetpack' ); ?></a>
18
  <a href="http://automattic.com/privacy/"><?php esc_html_e( 'Privacy', 'jetpack' ); ?></a>
19
  <?php if ( current_user_can( 'jetpack_manage_modules' ) ) : ?><a href="<?php echo esc_url( Jetpack::admin_url( 'page=jetpack-debugger' ) ); ?>" title="<?php esc_attr_e( 'Test your site&#8217;s compatibility with Jetpack.', 'jetpack' ); ?>"><?php _e( 'Debug', 'jetpack' ); ?><?php endif; ?></a>
20
+ <a href="http://jetpack.com/contact-support/" title="<?php esc_attr_e( 'Contact the Jetpack Happiness Squad.', 'jetpack' ); ?>"><?php _e( 'Support', 'jetpack' ); ?></a>
21
+ <a href="http://jetpack.com/survey/?rel=<?php echo JETPACK__VERSION; ?>" title="<?php esc_attr_e( 'Take a survey. Tell us how we&#8217;re doing.', 'jetpack' ); ?>"><?php _e( 'Give Us Feedback', 'jetpack' ); ?></a>
22
  <?php if ( Jetpack::is_active() && current_user_can( 'jetpack_disconnect' ) ) : ?>
23
  <a href="<?php echo esc_url( Jetpack::admin_url( 'page=my_jetpack#disconnect' ) ); ?>"><?php esc_html_e( 'Disconnect Jetpack', 'jetpack' ); ?></a>
24
  <?php endif; ?>
_inc/genericons/README.md CHANGED
@@ -94,6 +94,10 @@ Base64 encoding comes with a 25% filesize overhead compared to just loading the
94
 
95
  ## Changelog
96
 
 
 
 
 
97
  **3.4**
98
 
99
  * Updated: Update Google Plus icon to new geometric version. This also *retires* the "alt" version, so *please be mindful if you choose to update, make sure you use the `f206` glyph, not the `f218` glyph, as it no longer exists!
94
 
95
  ## Changelog
96
 
97
+ **3.4.1**
98
+
99
+ * IE8 support restored.
100
+
101
  **3.4**
102
 
103
  * Updated: Update Google Plus icon to new geometric version. This also *retires* the "alt" version, so *please be mindful if you choose to update, make sure you use the `f206` glyph, not the `f218` glyph, as it no longer exists!
_inc/genericons/genericons/genericons.css CHANGED
@@ -11,6 +11,7 @@
11
  When the font is base64 encoded, cross-site embedding works in Firefox */
12
  @font-face {
13
  font-family: "Genericons";
 
14
  src: url("./Genericons.eot?") format("embedded-opentype");
15
  font-weight: normal;
16
  font-style: normal;
11
  When the font is base64 encoded, cross-site embedding works in Firefox */
12
  @font-face {
13
  font-family: "Genericons";
14
+ src: url("./Genericons.eot");
15
  src: url("./Genericons.eot?") format("embedded-opentype");
16
  font-weight: normal;
17
  font-style: normal;
_inc/genericons/genericons/rtl/genericons-rtl.css CHANGED
@@ -1,4 +1,4 @@
1
- /* This file was automatically generated on Sep 18 2015 08:27:44 */
2
 
3
  /**
4
 
@@ -13,6 +13,7 @@
13
  When the font is base64 encoded, cross-site embedding works in Firefox */
14
  @font-face {
15
  font-family: "Genericons";
 
16
  src: url(".././Genericons.eot?") format("embedded-opentype");
17
  font-weight: normal;
18
  font-style: normal;
1
+ /* This file was automatically generated on Sep 30 2015 12:24:15 */
2
 
3
  /**
4
 
13
  When the font is base64 encoded, cross-site embedding works in Firefox */
14
  @font-face {
15
  font-family: "Genericons";
16
+ src: url(".././Genericons.eot");
17
  src: url(".././Genericons.eot?") format("embedded-opentype");
18
  font-weight: normal;
19
  font-style: normal;
_inc/header.php CHANGED
@@ -11,7 +11,7 @@
11
  <a href="<?php echo Jetpack::admin_url( 'page=jetpack_modules' ); ?>" class="jp-button--settings <?php if ( 'jetpack_modules' == $current ) { echo 'current'; } ?>"><?php esc_html_e( 'Settings', 'jetpack' ); ?></a>
12
  </li>
13
  <li class="jetpack-modules">
14
- <a href="http://jetpack.me/survey/?rel=<?php echo JETPACK__VERSION; ?>" class="jp-button--settings"><?php esc_html_e( 'Feedback', 'jetpack' ); ?></a>
15
  </li>
16
  <?php endif; // End if connected or dev mode and is admin ?>
17
 
11
  <a href="<?php echo Jetpack::admin_url( 'page=jetpack_modules' ); ?>" class="jp-button--settings <?php if ( 'jetpack_modules' == $current ) { echo 'current'; } ?>"><?php esc_html_e( 'Settings', 'jetpack' ); ?></a>
12
  </li>
13
  <li class="jetpack-modules">
14
+ <a href="http://jetpack.com/survey/?rel=<?php echo JETPACK__VERSION; ?>" class="jp-button--settings"><?php esc_html_e( 'Feedback', 'jetpack' ); ?></a>
15
  </li>
16
  <?php endif; // End if connected or dev mode and is admin ?>
17
 
_inc/jetpack-jitm.js CHANGED
@@ -15,7 +15,9 @@
15
  'jitmNonce' : jitmL10n.jitm_nonce,
16
  'photon' : jitmL10n.photon_msgs,
17
  'manage' : jitmL10n.manage_msgs,
18
- 'jitm_stats_url' : jitmL10n.jitm_stats_url
 
 
19
  };
20
 
21
  initEvents();
@@ -28,16 +30,19 @@
28
 
29
  function initEvents() {
30
 
31
- var module_slug, success_msg, fail_msg, hide_msg;
 
32
 
33
  // On dismiss of JITM admin notice
34
- $( '.jp-jitm .dismiss' ).click( function() {
 
 
35
  // hide the notice
36
- $( '.jp-jitm' ).hide();
37
 
38
  // ajax request to save dismiss and never show again
39
  data.jitmActionToTake = 'dismiss';
40
- module_slug = $(this).data( 'module' );
41
  data.jitmModule = module_slug;
42
 
43
  $.post( jitmL10n.ajaxurl, data, function ( response ) {
@@ -47,11 +52,12 @@
47
  });
48
  });
49
 
50
- $( '.jp-jitm .activate' ).click(function() {
51
 
52
- var $self = $( this );
53
- $( '.button' ).addClass( 'hide' );
54
- $( '.j-spinner' ).toggleClass( 'hide' );
 
55
  data.jitmActionToTake = 'activate';
56
 
57
  // get the module we're working with using the data-module attribute
@@ -66,34 +72,64 @@
66
  $.post( jitmL10n.ajaxurl, data, function ( response ) {
67
  // If there's no response, something bad happened
68
  if ( true === response.success ) {
69
- var $msg = $( '.msg' );
70
  $msg.html( success_msg );
71
- $( '#jetpack-wordpressdotcom, .j-spinner' ).toggleClass( 'hide' );
72
  if ( 'manage' !== data.jitmModule ) {
73
  hide_msg = setTimeout( function () {
74
- $( '.jp-jitm' ).hide( 'slow' );
75
  }, 5000 );
76
  }
77
- $msg.closest( '.jp-jitm' ).find( '.show-after-enable.hide' ).removeClass( 'hide' );
 
78
  } else {
79
- $( '.jp-jitm' ).html( '<p><span class="icon"></span>' + fail_msg + '</p>' );
80
  }
81
  });
82
 
83
  });
84
 
85
- $( '.jp-jitm .launch' ).click(function() {
 
 
 
 
 
 
 
 
86
  data.jitmActionToTake = 'launch';
87
- module_slug = $(this).data( 'module' );
88
- data.jitmModule = module_slug;
89
  // ajax request to save click in stat
90
  $.post( jitmL10n.ajaxurl, data );
91
  } );
92
 
93
- $( '#jetpack-wordpressdotcom' ).click(function() {
94
  //Log user heads to wordpress.com/plugins
95
  new Image().src = data.jitm_stats_url;
96
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
 
99
- })(jQuery, jitmL10n);
15
  'jitmNonce' : jitmL10n.jitm_nonce,
16
  'photon' : jitmL10n.photon_msgs,
17
  'manage' : jitmL10n.manage_msgs,
18
+ 'stats' : jitmL10n.stats_msgs,
19
+ 'jitm_stats_url' : jitmL10n.jitm_stats_url,
20
+ 'enabledModules' : []
21
  };
22
 
23
  initEvents();
30
 
31
  function initEvents() {
32
 
33
+ var module_slug, success_msg, fail_msg, hide_msg,
34
+ $body = $( 'body' );
35
 
36
  // On dismiss of JITM admin notice
37
+ $body.on( 'click', '.jp-jitm .dismiss', function() {
38
+ var $self = $( this );
39
+
40
  // hide the notice
41
+ $self.closest( '.jp-jitm' ).hide();
42
 
43
  // ajax request to save dismiss and never show again
44
  data.jitmActionToTake = 'dismiss';
45
+ module_slug = $self.data( 'module' );
46
  data.jitmModule = module_slug;
47
 
48
  $.post( jitmL10n.ajaxurl, data, function ( response ) {
52
  });
53
  });
54
 
55
+ $body.on( 'click', '.jp-jitm .activate', function() {
56
 
57
+ var $self = $( this ),
58
+ $jitm = $self.closest( '.jp-jitm' );
59
+ $jitm.find( '.button' ).addClass( 'hide' );
60
+ $jitm.find( '.j-spinner' ).toggleClass( 'hide' );
61
  data.jitmActionToTake = 'activate';
62
 
63
  // get the module we're working with using the data-module attribute
72
  $.post( jitmL10n.ajaxurl, data, function ( response ) {
73
  // If there's no response, something bad happened
74
  if ( true === response.success ) {
75
+ var $msg = $jitm.find( '.msg' );
76
  $msg.html( success_msg );
77
+ $jitm.find( '.j-spinner' ).add( '#jetpack-wordpressdotcom' ).toggleClass( 'hide' );
78
  if ( 'manage' !== data.jitmModule ) {
79
  hide_msg = setTimeout( function () {
80
+ $jitm.hide( 'slow' );
81
  }, 5000 );
82
  }
83
+ $jitm.find( '.show-after-enable.hide' ).removeClass( 'hide' );
84
+ data.enabledModules.push( module_slug );
85
  } else {
86
+ $jitm.html( '<p><span class="icon"></span>' + fail_msg + '</p>' );
87
  }
88
  });
89
 
90
  });
91
 
92
+ $body.on( 'click', '.jp-jitm .launch', function() {
93
+ var $jitm = $(this).closest( '.jp-jitm' );
94
+
95
+ if ( $jitm.data( 'stats_url' ) ) {
96
+ data.jitm_stats_url = $jitm.data( 'stats_url' );
97
+ new Image().src = data.jitm_stats_url;
98
+ }
99
+
100
+ data.jitmModule = $jitm.data( 'track' ) ? $jitm.data( 'track' ) : $(this).data( 'module' );
101
  data.jitmActionToTake = 'launch';
 
 
102
  // ajax request to save click in stat
103
  $.post( jitmL10n.ajaxurl, data );
104
  } );
105
 
106
+ $body.on( 'click', '#jetpack-wordpressdotcom', function() {
107
  //Log user heads to wordpress.com/plugins
108
  new Image().src = data.jitm_stats_url;
109
  });
110
+
111
+ // Display Photon JITM after user started uploading an image.
112
+ if ( $( '#tmpl-jitm-photon' ).length > 0 ) {
113
+ wp.Uploader.queue.on( 'add', function ( e ) {
114
+ if ( -1 === $.inArray( 'photon', data.enabledModules ) ) {
115
+ if ( 'image' === e.attributes.type ) {
116
+ var jitmTemplate = wp.template( 'jitm-photon' ),
117
+ $menu = wp.media.frame.$el.find( '.media-menu' ),
118
+ $jitm;
119
+ if ( $menu.length > 0 && 0 === $menu.find( '.jp-jitm' ).length ) {
120
+ $jitm = $menu.append( jitmTemplate() ).find( '.jp-jitm' );
121
+
122
+ // JITM is visible to user, track it.
123
+ data.jitmActionToTake = 'viewed';
124
+ data.jitmModule = $jitm.data( 'track' );
125
+ $.post( jitmL10n.ajaxurl, data );
126
+ }
127
+ } else {
128
+ $( '.media-menu' ).find( '.jp-jitm' ).remove();
129
+ }
130
+ }
131
+ } );
132
+ }
133
  }
134
 
135
+ })(jQuery, jitmL10n);
_inc/jetpack-modules.js CHANGED
@@ -41,10 +41,7 @@
41
  $( window ).on( 'keydown', function( e ) {
42
  // If pressing ESC close the modal
43
  if ( 27 === e.keyCode ) {
44
- $( '.shade, .modal' ).hide();
45
- $( '.manage-right' ).removeClass( 'show' );
46
- originPoint.focus();
47
- $( '.modal' )[0].removeAttribute( 'tabindex' );
48
  }
49
  });
50
 
41
  $( window ).on( 'keydown', function( e ) {
42
  // If pressing ESC close the modal
43
  if ( 27 === e.keyCode ) {
44
+ hide_modal();
 
 
 
45
  }
46
  });
47
 
_inc/lib/admin-pages/class.jetpack-landing-page.php CHANGED
@@ -123,10 +123,8 @@ class Jetpack_Landing_Page extends Jetpack_Admin_Page {
123
  $module_name[] = $val['module_name'];
124
  }
125
  }
126
- $last_item = array_pop( $module_name );
127
- $jumpstart_module_list = implode( $module_name, ', ' ) . ', and ' . $last_item;
128
 
129
- return $jumpstart_module_list;
130
  }
131
 
132
  function jetpack_menu_order( $menu_order ) {
@@ -285,7 +283,7 @@ class Jetpack_Landing_Page extends Jetpack_Admin_Page {
285
  'ays_dismiss' => __( "This will deactivate Jetpack.\nAre you sure you want to deactivate Jetpack?", 'jetpack' ),
286
  'view_all_features' => __( 'View all Jetpack features', 'jetpack' ),
287
  'no_modules_found' => sprintf( __( 'Sorry, no modules were found for the search term "%s"', 'jetpack' ), '{term}' ),
288
- 'modules' => array_values( Jetpack_Admin::init()->get_modules() ),
289
  'currentVersion' => JETPACK__VERSION,
290
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
291
  'jumpstart_modules' => $this->jumpstart_module_tag( 'Jumpstart' ),
123
  $module_name[] = $val['module_name'];
124
  }
125
  }
 
 
126
 
127
+ return $module_name;
128
  }
129
 
130
  function jetpack_menu_order( $menu_order ) {
283
  'ays_dismiss' => __( "This will deactivate Jetpack.\nAre you sure you want to deactivate Jetpack?", 'jetpack' ),
284
  'view_all_features' => __( 'View all Jetpack features', 'jetpack' ),
285
  'no_modules_found' => sprintf( __( 'Sorry, no modules were found for the search term "%s"', 'jetpack' ), '{term}' ),
286
+ 'modules' => Jetpack::get_translated_modules( array_values( Jetpack_Admin::init()->get_modules() ) ),
287
  'currentVersion' => JETPACK__VERSION,
288
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
289
  'jumpstart_modules' => $this->jumpstart_module_tag( 'Jumpstart' ),
_inc/lib/class.color.php CHANGED
@@ -419,7 +419,7 @@ class Jetpack_Color {
419
  }
420
  $rgb = $rgb_new;
421
 
422
- //Observer. = 2�, Illuminant = D65
423
  $xyz = array(
424
  'x' => ($rgb['red'] * 0.4124) + ($rgb['green'] * 0.3576) + ($rgb['blue'] * 0.1805),
425
  'y' => ($rgb['red'] * 0.2126) + ($rgb['green'] * 0.7152) + ($rgb['blue'] * 0.0722),
@@ -536,8 +536,12 @@ class Jetpack_Color {
536
  }
537
 
538
  public function toLuminosity() {
539
- extract( $this->toRgbInt() );
540
- return 0.2126 * pow( $red / 255, 2.2 ) + 0.7152 * pow( $green / 255, 2.2 ) + 0.0722 * pow( $blue / 255, 2.2);
 
 
 
 
541
  }
542
 
543
  /**
@@ -547,7 +551,7 @@ class Jetpack_Color {
547
  * @param Jetpack_Color $color Another color
548
  * @return float
549
  */
550
- public function getDistanceLuminosityFrom(Jetpack_Color $color) {
551
  $L1 = $this->toLuminosity();
552
  $L2 = $color->toLuminosity();
553
  if ( $L1 > $L2 ) {
@@ -559,9 +563,10 @@ class Jetpack_Color {
559
  }
560
 
561
  public function getMaxContrastColor() {
562
- $lum = $this->toLuminosity();
 
563
  $color = new Jetpack_Color;
564
- $hex = ( $lum >= 0.5 ) ? '000000' : 'ffffff';
565
  return $color->fromHex( $hex );
566
  }
567
 
419
  }
420
  $rgb = $rgb_new;
421
 
422
+ // Observer. = 2°, Illuminant = D65
423
  $xyz = array(
424
  'x' => ($rgb['red'] * 0.4124) + ($rgb['green'] * 0.3576) + ($rgb['blue'] * 0.1805),
425
  'y' => ($rgb['red'] * 0.2126) + ($rgb['green'] * 0.7152) + ($rgb['blue'] * 0.0722),
536
  }
537
 
538
  public function toLuminosity() {
539
+ $lum = array();
540
+ foreach( $this->toRgbInt() as $slot => $value ) {
541
+ $chan = $value / 255;
542
+ $lum[ $slot ] = ( $chan <= 0.03928 ) ? $chan / 12.92 : pow( ( ( $chan + 0.055 ) / 1.055 ), 2.4 );
543
+ }
544
+ return 0.2126 * $lum['red'] + 0.7152 * $lum['green'] + 0.0722 * $lum['blue'];
545
  }
546
 
547
  /**
551
  * @param Jetpack_Color $color Another color
552
  * @return float
553
  */
554
+ public function getDistanceLuminosityFrom( Jetpack_Color $color ) {
555
  $L1 = $this->toLuminosity();
556
  $L2 = $color->toLuminosity();
557
  if ( $L1 > $L2 ) {
563
  }
564
 
565
  public function getMaxContrastColor() {
566
+ $withBlack = $this->getDistanceLuminosityFrom( new Jetpack_Color( '#000') );
567
+ $withWhite = $this->getDistanceLuminosityFrom( new Jetpack_Color( '#fff') );
568
  $color = new Jetpack_Color;
569
+ $hex = ( $withBlack >= $withWhite ) ? '#000000' : '#ffffff';
570
  return $color->fromHex( $hex );
571
  }
572
 
_inc/lib/markdown/extra.php CHANGED
@@ -2949,7 +2949,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
2949
  $text .= "<hr". $this->empty_element_suffix ."\n";
2950
  $text .= "<ol>\n\n";
2951
 
2952
- $attr = " rev=\"footnote\"";
2953
  if ($this->fn_backlink_class != "") {
2954
  $class = $this->fn_backlink_class;
2955
  $class = $this->encodeAttribute($class);
@@ -3018,7 +3018,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
3018
  $ref_count_mark = $this->footnotes_ref_count[$node_id] += 1;
3019
  }
3020
 
3021
- $attr = " rel=\"footnote\"";
3022
  if ($this->fn_link_class != "") {
3023
  $class = $this->fn_link_class;
3024
  $class = $this->encodeAttribute($class);
2949
  $text .= "<hr". $this->empty_element_suffix ."\n";
2950
  $text .= "<ol>\n\n";
2951
 
2952
+ $attr = "";
2953
  if ($this->fn_backlink_class != "") {
2954
  $class = $this->fn_backlink_class;
2955
  $class = $this->encodeAttribute($class);
3018
  $ref_count_mark = $this->footnotes_ref_count[$node_id] += 1;
3019
  }
3020
 
3021
+ $attr = "";
3022
  if ($this->fn_link_class != "") {
3023
  $class = $this->fn_link_class;
3024
  $class = $this->encodeAttribute($class);
_inc/lib/markdown/gfm.php CHANGED
@@ -93,6 +93,22 @@ class WPCom_GHF_Markdown_Parser extends MarkdownExtra_Parser {
93
  // escape line-beginning # chars that do not have a space after them.
94
  $text = preg_replace_callback( '|^#{1,6}( )?|um', array( $this, '_doEscapeForHashWithoutSpacing' ), $text );
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  // run through core Markdown
97
  $text = parent::transform( $text );
98
 
93
  // escape line-beginning # chars that do not have a space after them.
94
  $text = preg_replace_callback( '|^#{1,6}( )?|um', array( $this, '_doEscapeForHashWithoutSpacing' ), $text );
95
 
96
+ /**
97
+ * Allow third-party plugins to define custom patterns that won't be processed by Markdown.
98
+ *
99
+ * @module markdown
100
+ *
101
+ * @since 3.9.2
102
+ *
103
+ * @param array $custom_patterns Array of custom patterns to be ignored by Markdown.
104
+ */
105
+ $custom_patterns = apply_filters( 'jetpack_markdown_preserve_pattern', array() );
106
+ if ( is_array( $custom_patterns ) && ! empty( $custom_patterns ) ) {
107
+ foreach ( $custom_patterns as $pattern ) {
108
+ $text = preg_replace_callback( $pattern, array( $this, '_doRemoveText'), $text );
109
+ }
110
+ }
111
+
112
  // run through core Markdown
113
  $text = parent::transform( $text );
114
 
_inc/lib/tracks/class.tracks-client.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Jetpack_Tracks_Client
5
+ * @autounit nosara tracks-client
6
+ *
7
+ * Send Tracks events on behalf of a user
8
+ *
9
+ * Example Usage:
10
+ ```php
11
+ require( dirname(__FILE__).'path/to/tracks/class.tracks-client' );
12
+
13
+ $result = Jetpack_Tracks_Client::record_event( array(
14
+ '_en' => $event_name, // required
15
+ '_ui' => $user_id, // required unless _ul is provided
16
+ '_ul' => $user_login, // required unless _ui is provided
17
+
18
+ // Optional, but recommended
19
+ '_ts' => $ts_in_ms, // Default: now
20
+ '_via_ip' => $client_ip, // we use it for geo, etc.
21
+
22
+ // Possibly useful to set some context for the event
23
+ '_via_ua' => $client_user_agent,
24
+ '_via_url' => $client_url,
25
+ '_via_ref' => $client_referrer,
26
+
27
+ // For user-targeted tests
28
+ 'abtest_name' => $abtest_name,
29
+ 'abtest_variation' => $abtest_variation,
30
+
31
+ // Your application-specific properties
32
+ 'custom_property' => $some_value,
33
+ ) );
34
+
35
+ if ( is_wp_error( $result ) ) {
36
+ // Handle the error in your app
37
+ }
38
+ ```
39
+ */
40
+
41
+ require_once( dirname(__FILE__).'/class.tracks-client.php' );
42
+
43
+ class Jetpack_Tracks_Client {
44
+ const PIXEL = 'http://pixel.wp.com/t.gif';
45
+ const BROWSER_TYPE = 'php-agent';
46
+ const USER_AGENT_SLUG = 'tracks-client';
47
+ const VERSION = '0.3';
48
+
49
+ /**
50
+ * record_event
51
+ * @param mixed $event Event object to send to Tracks. An array will be cast to object. Required.
52
+ * Properties are included directly in the pixel query string after light validation.
53
+ * @return mixed True on success, WP_Error on failure
54
+ */
55
+ static function record_event( $event ) {
56
+ if ( ! $event instanceof Jetpack_Tracks_Event ) {
57
+ $event = new Jetpack_Tracks_Event( $event );
58
+ }
59
+ if ( is_wp_error( $event ) ) {
60
+ return $event;
61
+ }
62
+
63
+ $pixel = $event->build_pixel_url( $event );
64
+
65
+ if ( ! $pixel ) {
66
+ return new WP_Error( 'invalid_pixel', 'cannot generate tracks pixel for given input', 400 );
67
+ }
68
+
69
+ return self::record_pixel( $pixel );
70
+ }
71
+
72
+ /**
73
+ * Synchronously request the pixel
74
+ */
75
+ static function record_pixel( $pixel ) {
76
+ // Add the Request Timestamp and URL terminator just before the HTTP request.
77
+ $pixel .= '&_rt=' . self::build_timestamp() . '&_=_';
78
+
79
+ $response = wp_remote_get( $pixel, array(
80
+ 'blocking' => true, // The default, but being explicit here :)
81
+ 'timeout' => 1,
82
+ 'redirection' => 2,
83
+ 'httpversion' => '1.1',
84
+ 'user-agent' => self::get_user_agent(),
85
+ ) );
86
+
87
+ if ( is_wp_error( $response ) ) {
88
+ return $response;
89
+ }
90
+
91
+ $code = isset( $response['response']['code'] ) ? $response['response']['code'] : 0;
92
+
93
+ if ( $code !== 200 ) {
94
+ return new WP_Error( 'request_failed', 'Tracks pixel request failed', $code );
95
+ }
96
+
97
+ return true;
98
+ }
99
+
100
+ static function get_user_agent() {
101
+ return Jetpack_Tracks_Client::USER_AGENT_SLUG . '-v' . Jetpack_Tracks_Client::VERSION;
102
+ }
103
+
104
+ /**
105
+ * Build an event and return its tracking URL
106
+ * @deprecated Call the `build_pixel_url` method on a Jetpack_Tracks_Event object instead.
107
+ * @param array $event Event keys and values
108
+ * @return string URL of a tracking pixel
109
+ */
110
+ static function build_pixel_url( $event ) {
111
+ $_event = new Jetpack_Tracks_Event( $event );
112
+ return $_event->build_pixel_url();
113
+ }
114
+
115
+ /**
116
+ * Validate input for a tracks event.
117
+ * @deprecated Instantiate a Jetpack_Tracks_Event object instead
118
+ * @param array $event Event keys and values
119
+ * @return mixed Validated keys and values or WP_Error on failure
120
+ */
121
+ private static function validate_and_sanitize( $event ) {
122
+ $_event = new Jetpack_Tracks_Event( $event );
123
+ if ( is_wp_error( $_event ) ) {
124
+ return $_event;
125
+ }
126
+ return get_object_vars( $_event );
127
+ }
128
+
129
+ // Milliseconds since 1970-01-01
130
+ static function build_timestamp() {
131
+ $ts = round( microtime( true ) * 1000 );
132
+ return number_format( $ts, 0, '', '' );
133
+ }
134
+
135
+ /**
136
+ * Grabs the user's anon id from cookies, or generates and sets a new one
137
+ *
138
+ * @return string An anon id for the user
139
+ */
140
+ static function get_anon_id() {
141
+ static $anon_id = null;
142
+
143
+ if ( ! isset( $anon_id ) ) {
144
+
145
+ // Did the browser send us a cookie?
146
+ if ( isset( $_COOKIE[ 'tk_ai' ] ) && preg_match( '#^[A-Za-z0-9+/=]{24}$#', $_COOKIE[ 'tk_ai' ] ) ) {
147
+ $anon_id = $_COOKIE[ 'tk_ai' ];
148
+ } else {
149
+
150
+ $binary = '';
151
+
152
+ // Generate a new anonId and try to save it in the browser's cookies
153
+ // Note that base64-encoding an 18 character string generates a 24-character anon id
154
+ for ( $i = 0; $i < 18; ++$i ) {
155
+ $binary .= chr( mt_rand( 0, 255 ) );
156
+ }
157
+
158
+ $anon_id = 'jetpack:' . base64_encode( $binary );
159
+
160
+ if ( ! headers_sent() ) {
161
+ setcookie( 'tk_ai', $anon_id );
162
+ }
163
+ }
164
+ }
165
+
166
+ return $anon_id;
167
+ }
168
+ }
_inc/lib/tracks/class.tracks-event.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @autounit nosara tracks-client
5
+ *
6
+ * Example Usage:
7
+ ```php
8
+ require_once( dirname(__FILE__) . 'path/to/tracks/class.tracks-event' );
9
+
10
+ $event = new Jetpack_Tracks_Event( array(
11
+ '_en' => $event_name, // required
12
+ '_ui' => $user_id, // required unless _ul is provided
13
+ '_ul' => $user_login, // required unless _ui is provided
14
+
15
+ // Optional, but recommended
16
+ '_via_ip' => $client_ip, // for geo, etc.
17
+
18
+ // Possibly useful to set some context for the event
19
+ '_via_ua' => $client_user_agent,
20
+ '_via_url' => $client_url,
21
+ '_via_ref' => $client_referrer,
22
+
23
+ // For user-targeted tests
24
+ 'abtest_name' => $abtest_name,
25
+ 'abtest_variation' => $abtest_variation,
26
+
27
+ // Your application-specific properties
28
+ 'custom_property' => $some_value,
29
+ ) );
30
+
31
+ if ( is_wp_error( $event->error ) ) {
32
+ // Handle the error in your app
33
+ }
34
+
35
+ $bump_and_redirect_pixel = $event->build_signed_pixel_url();
36
+ ```
37
+ */
38
+
39
+ require_once( dirname(__FILE__) . '/class.tracks-client.php' );
40
+
41
+ class Jetpack_Tracks_Event {
42
+ const EVENT_NAME_REGEX = '/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/';
43
+ const PROP_NAME_REGEX = '/^[a-z_][a-z0-9_]*$/';
44
+ public $error;
45
+
46
+ function __construct( $event ) {
47
+ $_event = self::validate_and_sanitize( $event );
48
+ if ( is_wp_error( $_event ) ) {
49
+ $this->error = $_event;
50
+ return;
51
+ }
52
+
53
+ foreach( $_event as $key => $value ) {
54
+ $this->{$key} = $value;
55
+ }
56
+ }
57
+
58
+ function record() {
59
+ return Jetpack_Tracks_Client::record_event( $this );
60
+ }
61
+
62
+ /**
63
+ * Annotate the event with all relevant info.
64
+ * @param mixed $event Object or (flat) array
65
+ * @return mixed The transformed event array or WP_Error on failure.
66
+ */
67
+ static function validate_and_sanitize( $event ) {
68
+ $event = (object) $event;
69
+
70
+ // Required
71
+ if ( ! $event->_en ) {
72
+ return new WP_Error( 'invalid_event', 'A valid event must be specified via `_en`', 400 );
73
+ }
74
+
75
+ // delete non-routable addresses otherwise geoip will discard the record entirely
76
+ if ( property_exists( $event, '_via_ip' ) && preg_match( '/^192\.168|^10\./', $event->_via_ip ) ) {
77
+ unset($event->_via_ip);
78
+ }
79
+
80
+ $validated = array(
81
+ 'browser_type' => Jetpack_Tracks_Client::BROWSER_TYPE,
82
+ '_aua' => Jetpack_Tracks_Client::get_user_agent(),
83
+ );
84
+
85
+ $_event = (object) array_merge( (array) $event, $validated );
86
+
87
+ // If you want to blacklist property names, do it here.
88
+
89
+ // Make sure we have an event timestamp.
90
+ if ( ! isset( $_event->_ts ) ) {
91
+ $_event->_ts = Jetpack_Tracks_Client::build_timestamp();
92
+ }
93
+
94
+ return $_event;
95
+ }
96
+
97
+ /**
98
+ * Build a pixel URL that will send a Tracks event when fired.
99
+ * On error, returns an empty string ('').
100
+ *
101
+ * @return string A pixel URL or empty string ('') if there were invalid args.
102
+ */
103
+ function build_pixel_url() {
104
+ if ( $this->error ) {
105
+ return '';
106
+ }
107
+
108
+ $args = get_object_vars( $this );
109
+
110
+ // Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.
111
+ unset( $args['_rt'] );
112
+ unset( $args['_'] );
113
+
114
+ $validated = self::validate_and_sanitize( $args );
115
+
116
+ if ( is_wp_error( $validated ) )
117
+ return '';
118
+
119
+ return Jetpack_Tracks_Client::PIXEL . '?' . http_build_query( $validated );
120
+ }
121
+
122
+ static function event_name_is_valid( $name ) {
123
+ return preg_match( Jetpack_Tracks_Event::EVENT_NAME_REGEX, $name );
124
+ }
125
+
126
+ static function prop_name_is_valid( $name ) {
127
+ return preg_match( Jetpack_Tracks_Event::PROP_NAME_REGEX, $name );
128
+ }
129
+
130
+ static function scrutinize_event_names( $event ) {
131
+ if ( ! Jetpack_Tracks_Event::event_name_is_valid( $event->_en ) ) {
132
+ return;
133
+ }
134
+
135
+ $whitelisted_key_names = array(
136
+ 'anonId',
137
+ 'Browser_Type',
138
+ );
139
+
140
+ foreach ( array_keys( (array) $event ) as $key ) {
141
+ if ( in_array( $key, $whitelisted_key_names ) ) {
142
+ continue;
143
+ }
144
+ if ( ! Jetpack_Tracks_Event::prop_name_is_valid( $key ) ) {
145
+ return;
146
+ }
147
+ }
148
+ }
149
+ }
_inc/lib/tracks/client.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PHP Tracks Client
4
+ * @autounit nosara tracks-client
5
+ * Example Usage:
6
+ *
7
+ ```php
8
+ include( plugin_dir_path( __FILE__ ) . 'lib/tracks/client.php');
9
+ $result = jetpack_tracks_record_event( $user, $event_name, $properties );
10
+
11
+ if ( is_wp_error( $result ) ) {
12
+ // Handle the error in your app
13
+ }
14
+ ```
15
+ */
16
+
17
+ // Load the client classes
18
+ require_once( dirname(__FILE__) . '/class.tracks-event.php' );
19
+ require_once( dirname(__FILE__) . '/class.tracks-client.php' );
20
+
21
+ // Now, let's export a sprinkling of syntactic sugar!
22
+
23
+ /**
24
+ * Procedurally (vs. Object-oriented), track an event object (or flat array)
25
+ * NOTE: Use this only when the simpler jetpack_tracks_record_event() function won't work for you.
26
+ * @param \Jetpack_Tracks_Event $event The event object.
27
+ * @return \Jetpack_Tracks_Event|\WP_Error
28
+ */
29
+ function jetpack_tracks_record_event_raw( $event ) {
30
+ return Jetpack_Tracks_Client::record_event( $event );
31
+ }
32
+
33
+ /**
34
+ * Procedurally build a Tracks Event Object.
35
+ * NOTE: Use this only when the simpler jetpack_tracks_record_event() function won't work for you.
36
+ * @param $identity WP_user object
37
+ * @param string $event_name The name of the event
38
+ * @param array $properties Custom properties to send with the event
39
+ * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred
40
+ * @return \Jetpack_Tracks_Event|\WP_Error
41
+ */
42
+ function jetpack_tracks_build_event_obj( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) {
43
+
44
+ $identity = jetpack_tracks_get_identity( $user->ID );
45
+
46
+ $properties['user_lang'] = $user->get( 'WPLANG' );
47
+
48
+ $blog_details = array(
49
+ 'blog_lang' => isset( $properties['blog_lang'] ) ? $properties['blog_lang'] : get_bloginfo( 'language' )
50
+ );
51
+
52
+ $timestamp = ( $event_timestamp_millis !== false ) ? $event_timestamp_millis : round( microtime( true ) * 1000 );
53
+ $timestamp_string = is_string( $timestamp ) ? $timestamp : number_format( $timestamp, 0, '', '' );
54
+
55
+ return new Jetpack_Tracks_Event( array_merge( $blog_details, (array) $properties, $identity, array(
56
+ '_en' => $event_name,
57
+ '_ts' => $timestamp_string
58
+ ) ) );
59
+ }
60
+
61
+ /*
62
+ * Get the identity to send to tracks.
63
+ *
64
+ * @param int $user_id The user id of the local user
65
+ * @return array $identity
66
+ */
67
+ function jetpack_tracks_get_identity( $user_id ) {
68
+
69
+ // Meta is set, and user is still connected. Use WPCOM ID
70
+ $wpcom_id = get_user_meta( $user_id, 'jetpack_tracks_wpcom_id', true );
71
+ if ( $wpcom_id && Jetpack::is_user_connected( $user_id ) ) {
72
+ return array(
73
+ '_ut' => 'wpcom:user_id',
74
+ '_ui' => $wpcom_id
75
+ );
76
+ }
77
+
78
+ // User is connected, but no meta is set yet. Use WPCOM ID and set meta.
79
+ if ( Jetpack::is_user_connected( $user_id ) ) {
80
+ $wpcom_user_data = Jetpack::get_connected_user_data( $user_id );
81
+ add_user_meta( $user_id, 'jetpack_tracks_wpcom_id', $wpcom_user_data['ID'], true );
82
+
83
+ return array(
84
+ '_ut' => 'wpcom:user_id',
85
+ '_ui' => $wpcom_user_data['ID']
86
+ );
87
+ }
88
+
89
+ // User isn't linked at all. Fall back to anonymous ID.
90
+ $anon_id = get_user_meta( $user_id, 'jetpack_tracks_anon_id', true );
91
+ if ( ! $anon_id ) {
92
+ $anon_id = Jetpack_Tracks_Client::get_anon_id();
93
+ add_user_meta( $user_id, 'jetpack_tracks_anon_id', $anon_id, false );
94
+ }
95
+
96
+ if ( ! isset( $_COOKIE[ 'tk_ai' ] ) && ! headers_sent() ) {
97
+ setcookie( 'tk_ai', $anon_id );
98
+ }
99
+
100
+ return array(
101
+ '_ut' => 'anon',
102
+ '_ui' => $anon_id
103
+ );
104
+
105
+ }
106
+
107
+ /**
108
+ * Record an event in Tracks - this is the preferred way to record events from PHP.
109
+ *
110
+ * @param mixed $identity username, user_id, or WP_user object
111
+ * @param string $event_name The name of the event
112
+ * @param array $properties Custom properties to send with the event
113
+ * @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred
114
+ * @return bool true for success | \WP_Error if the event pixel could not be fired
115
+ */
116
+ function jetpack_tracks_record_event( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) {
117
+ $event_obj = jetpack_tracks_build_event_obj( $user, $event_name, $properties, $event_timestamp_millis );
118
+
119
+ if ( is_wp_error( $event_obj->error ) ) {
120
+ return $event_obj->error;
121
+ }
122
+
123
+ return $event_obj->record();
124
+ }
_inc/lib/tracks/tracks-ajax.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global jpTracksAJAX, jQuery */
2
+
3
+ (function( $, jpTracksAJAX ) {
4
+
5
+ $( document ).ready( function () {
6
+ $( 'body' ).on( 'click', '.jptracks a, a.jptracks', function( event ) {
7
+
8
+ // We know that the jptracks element is either this, or its ancestor
9
+ var $jptracks = $( this ).closest( '.jptracks' );
10
+
11
+ var data = {
12
+ tracksNonce: jpTracksAJAX.jpTracksAJAX_nonce,
13
+ action: 'jetpack_tracks',
14
+ tracksEventType: 'click',
15
+ tracksEventName: $jptracks.attr( 'data-jptracks-name' ),
16
+ tracksEventProp: $jptracks.attr( 'data-jptracks-prop' ) || false
17
+ };
18
+
19
+ // We need an event name at least
20
+ if ( undefined === data.tracksEventName ) {
21
+ return;
22
+ }
23
+
24
+ var url = $( this ).attr( 'href' );
25
+ var target = $( this ).get( 0 ).target;
26
+ if ( url && target && '_self' !== target ) {
27
+ var newTabWindow = window.open( '', target );
28
+ }
29
+
30
+ event.preventDefault();
31
+
32
+ $.ajax( {
33
+ type: 'POST',
34
+ url: jpTracksAJAX.ajaxurl,
35
+ data: data
36
+ } ).always( function() {
37
+ // Continue on to whatever url they were trying to get to.
38
+ if ( url ) {
39
+ if ( newTabWindow ) {
40
+ newTabWindow.location = url;
41
+ return;
42
+ }
43
+ window.location = url;
44
+ }
45
+ } );
46
+ });
47
+ });
48
+
49
+ })( jQuery, jpTracksAJAX );
_inc/twitter-timeline.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global twttr */
2
+
3
+ /* jshint ignore:start */
4
+ !function(d,s,id){
5
+ var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
6
+ if(!d.getElementById(id)){
7
+ js=d.createElement(s);
8
+ js.id=id;js.src=p+"://platform.twitter.com/widgets.js";
9
+ fjs.parentNode.insertBefore(js,fjs);
10
+ }
11
+ }(document,"script","twitter-wjs");
12
+ /* jshint ignore:end */
13
+
14
+ jQuery( function() {
15
+ var hasSelectiveRefresh = (
16
+ 'undefined' !== typeof wp &&
17
+ wp.customize &&
18
+ wp.customize.selectiveRefresh &&
19
+ wp.customize.widgetsPreview &&
20
+ wp.customize.widgetsPreview.WidgetPartial
21
+ );
22
+ if ( ! hasSelectiveRefresh ) {
23
+ return;
24
+ }
25
+
26
+ // Re-load Twitter widgets when a partial is rendered.
27
+ wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
28
+ if ( placement.container ) {
29
+ twttr.widgets.load( placement.container[0] );
30
+ }
31
+ } );
32
+
33
+ // Refresh a moved partial containing a Twitter timeline iframe, since it has to be re-built.
34
+ wp.customize.selectiveRefresh.bind( 'partial-content-moved', function( placement ) {
35
+ if ( placement.container && placement.container.find( 'iframe.twitter-timeline:not([src]):first' ).length ) {
36
+ placement.partial.refresh();
37
+ }
38
+ } );
39
+ } );
changelog.txt CHANGED
@@ -1,4 +1,238 @@
1
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  = 3.7.2 =
3
  Release date: September 29th, 2015
4
 
@@ -99,11 +333,11 @@ Release Date: July 24, 2015
99
 
100
  = 3.6 =
101
  Release Date: July 6th, 2015
102
- Release Post: http://jetpack.me/2015/07/06/jetpack-3-6-updated-social-widgets-jetpack-cli-and-more/
103
 
104
  Feature Enhancements:
105
 
106
- * CLI: Add a number of Jetpack CLI improvements: see http://jetpack.me/support/jetpack-cli
107
  * New Jetpack admin page for connection management
108
  * New Social Media Icons widget
109
  * FB Like Box: A visual refresh of the Facebook likebox widget
@@ -167,7 +401,7 @@ Release Date: May 5th, 2015
167
 
168
  = 3.5 =
169
  Release Date: April 23rd, 2015
170
- Release Post: http://jetpack.me/2016/04/23/jetpack-3-5-menu-management/
171
 
172
  Jetpack 3.5 introduces the ability to manage your site's menus directly from WordPress.com and several bug fixes and enhancements. This upgrade is recommended for all users.
173
 
@@ -215,7 +449,7 @@ Release Date: March 19th, 2015
215
  = 3.4 =
216
  Release Date: March 18th, 2015
217
 
218
- Release Post: http://jetpack.me/2015/03/17/jetpack-3-4-protect-secure-and-simplify/
219
 
220
  * Enhancement : Config Settings: provide a notification for users that update features settings
221
  * Enhancement : Config Settings: provide a notification for users that update features settings
@@ -299,7 +533,7 @@ Release Date: February 11th, 2015
299
 
300
  = 3.3 =
301
  Release Date: December 15th, 2014
302
- Release Post: http://jetpack.me/2014/12/16/jetpack-3-3-a-single-home-for-all-your-wordpress-sites/
303
 
304
  * Enhancement: Adds responsive video support to BuddyPress.
305
  * Enhancement: Custom Content Types: Added 'order' and 'orderby' options to portfolio shortcode.
@@ -348,7 +582,7 @@ Release Date: November 14th, 2014
348
 
349
  = 3.2 =
350
  Release Date: October 29, 2014
351
- Release Post: http://jetpack.me/2014/11/03/jetpack-3-2/
352
 
353
  * Enhancement: Speed Improvements (woohoo!).
354
  * Enhancement: Add site icons: an avatar for your blog.
@@ -386,7 +620,7 @@ Release Date: August 7, 2014
386
 
387
  = 3.1 =
388
  Release Date: July 31, 2014
389
- Release Post: http://jetpack.me/2014/07/31/jetpack-3-1-portfolio-custom-post-types-a-new-logo-and-much-more/
390
 
391
  * Enhancement: New Custom Content Types module.
392
  * Enhancement: New Jetpack Logo.
@@ -458,7 +692,7 @@ Release Date: May 22, 2014
458
 
459
  = 3.0 =
460
  Release Date: May 20, 2014
461
- Release Post: http://jetpack.me/2014/05/20/jetpack-3-0/
462
 
463
  * New User Interface for managing modules and settings
464
  * New Module: Verfication Tools
@@ -502,7 +736,7 @@ Release Date: March 6, 2014
502
 
503
  = 2.9 =
504
  Release Date: February 26, 2014
505
- Release Post: http://jetpack.me/2014/02/26/jetpack-2-9/
506
 
507
  * Added Multisite network functionality
508
  * New Module: Related Posts
@@ -526,7 +760,7 @@ Release Post: http://jetpack.me/2014/02/26/jetpack-2-9/
526
 
527
  = 2.8 =
528
  Release Date: January 31, 2014
529
- Release Post: http://jetpack.me/2014/01/31/jetpack-2-8-introducing-markdown-and-improving-monitor/
530
 
531
  * New Module: Markdown
532
  * Module Update: Jetpack Monitor
@@ -567,7 +801,7 @@ Release Post: http://jetpack.me/2014/01/31/jetpack-2-8-introducing-markdown-and-
567
 
568
  = 2.7 =
569
  Release Date: December 11, 2013
570
- Release Post: http://jetpack.me/2013/12/11/jetpack-2-7-publicize/
571
 
572
  * Enhancement: Google+ Publicize
573
  * Enhancement: Add Cloudup as an oEmbed provider
@@ -604,10 +838,10 @@ Release Date: December 3, 2013
604
 
605
  = 2.6 =
606
  Release Date: November 28, 2013
607
- Release Post: http://jetpack.me/2013/11/26/new-release-jetpack-2-6/
608
 
609
- * Enhancement: WPCC / now called [SSO](http://jetpack.me/support/sso/): refactored.
610
- * Enhancement: Monitor: new module which will notify you if your site goes down(http://jetpack.me/support/monitor/).
611
  * Enhancement: Custom CSS: replace Ace editor with Codemirror.
612
  * Enhancement: Widgets: new “Display Posts” widget.
613
  * Enhancement: WP-CLI: add commands to disconnect a site and manage modules.
@@ -642,7 +876,7 @@ Release Post: http://jetpack.me/2013/11/26/new-release-jetpack-2-6/
642
 
643
  = 2.5 =
644
  Release Date: September 19, 2013
645
- Release Post: http://jetpack.me/2013/09/19/jetpack-2-5/
646
 
647
  * Enhancement: Connect your Google+ profile and WordPress site to prove authorship of posts.
648
  * Enhancement: Improved sharing buttons display.
@@ -692,7 +926,7 @@ Release Date: September 4, 2013
692
 
693
  = 2.4 =
694
  Release Date: August 30, 2013
695
- Release Post: http://jetpack.me/2013/09/04/jetpack-2-4-widget-visibility-and-wpcc-and-more/
696
 
697
  * Enhancement: WordPress.com Connect (WPCC): New Module.
698
  * Enhancement: Widget Visibility: New Module.
@@ -771,7 +1005,7 @@ Release Date: July 2, 2013
771
 
772
  = 2.3 =
773
  Release Date: June 19, 2013
774
- Release Post: http://jetpack.me/2013/06/19/jetpack-2-3/
775
 
776
  * Enhancement: Omnisearch: Search once, get results from everything! Omnisearch is a single search box that lets you search many different things
777
  * Enhancement: Debugger: this module helps you debug connection issues right from your dashboard, and contact the Jetpack support team if needed
@@ -934,7 +1168,7 @@ Release Date: March 28, 2013
934
 
935
  = 2.2 =
936
  Release Date: February 26, 2013
937
- Release Post: http://jetpack.me/2013/02/26/jetpack-2-2-likes/
938
 
939
  * Enhancement: Likes: Allow your readers to show their appreciation of your posts.
940
  * Enhancement: Shortcodes: SoundCloud: Update to version 2.3 of the SoundCloud plugin (HTML5 default player, various fixes).
@@ -1015,7 +1249,7 @@ Release Date: January 5, 2013
1015
 
1016
  = 2.1 =
1017
  Release Date: January 4, 2013
1018
- Release Post: http://jetpack.me/2013/01/04/galleries/
1019
 
1020
  * Enhancement: Tiled Galleries: Show off your photos with cool mosaic galleries.
1021
  * Enhancement: Slideshow gallery type: Display any gallery as a slideshow.
@@ -1074,7 +1308,7 @@ Release Date: November 21, 2012
1074
 
1075
  = 2.0 =
1076
  Release Date: November 8, 2012
1077
- Release Post: http://jetpack.me/2012/11/08/jetpack-2-0-publicize-to-facebook-twitter-linkedin-tumblr-post-by-email-photon-infinite-scroll/
1078
 
1079
  * Enhancement: Publicize: Connect your site to popular social networks and automatically share new posts with your friends.
1080
  * Enhancement: Post By Email: Publish posts to your blog directly from your personal email account.
@@ -1101,7 +1335,7 @@ Release Date: October 29, 2012
1101
 
1102
  = 1.9 =
1103
  Release Date: October 26, 2012
1104
- Release Post: http://jetpack.me/2012/10/26/jetpack-1-9-toolbar-notifications/
1105
 
1106
  * Enhancement: Notifications: Display Notifications in the toolbar and support reply/moderation of comment notifications.
1107
  * Enhancement: Mobile Push Notifications: Added support for mobile push notifications of new comments for users that linked their accounts to WordPress.com accounts.
@@ -1153,7 +1387,7 @@ Release Date: September 28, 2012
1153
 
1154
  = 1.8 =
1155
  Release Date: September 27, 2012
1156
- Release Post: http://jetpack.me/2012/09/27/jetpack-1-8-mobile-theme/
1157
 
1158
  * Enhancement: Mobile Theme: Automatically serve a slimmed down version of your site to users on mobile devices.
1159
  * Enhancement: Multiuser: Allow multiple users to link their accounts to WordPress.com accounts.
@@ -1171,7 +1405,7 @@ Release Post: http://jetpack.me/2012/09/27/jetpack-1-8-mobile-theme/
1171
 
1172
  = 1.7 =
1173
  Release Date: August 23, 2012
1174
- Release Post: http://jetpack.me/2012/08/23/jetpack-1-7-custom-css/
1175
 
1176
  * Enhancement: CSS Editor: Customize your site's design without modifying your theme.
1177
  * Enhancement: Comments: Submit the comment within the iframe. No more full page load to jetpack.wordpress.com.
@@ -1204,7 +1438,7 @@ Release Date: August 4, 2012
1204
 
1205
  = 1.6 =
1206
  Release Date: August 2, 2012
1207
- Release Post: http://jetpack.me/2012/08/02/jetpack-1-6-retina-and-pinterest/
1208
 
1209
  * Enhancement: Carousel: Better image resolution selection based on available width/height.
1210
  * Enhancement: Carousel: Load image caption, metadata, comments, et alii when a slide is clicked to switch to instead of waiting.
@@ -1283,7 +1517,7 @@ Release Date: May 22, 2012
1283
 
1284
  = 1.3 =
1285
  Release Date: April 25, 2012
1286
- Release Post: http://jetpack.me/2012/04/24/jetpack-1-3-released-contact-forms/
1287
 
1288
  * Enhancement: Add Contact Forms feature. Formerly Grunion Contact Forms.
1289
  * Bug Fix: Tweak YouTube autoembedder to catch more YouTube URLs.
@@ -1333,11 +1567,11 @@ Release Date: November 18, 2011
1333
  * Bug Fix: Fixed errors displayed during some upgrades.
1334
  * Bug Fix: Fix inaccurate new modules "bubble" in menu for some upgrades.
1335
  * Bug Fix: Fix VaultPress detection.
1336
- * Bug Fix: Fix link to http://jetpack.me/faq/
1337
 
1338
  = 1.2 =
1339
  Release Date: November 17, 2011
1340
- Release Post: http://jetpack.me/2011/11/17/announcing-jetpack-1-2/
1341
 
1342
  * Enhancement: Add Subscriptions: Subscribe to site's posts and posts' comments.
1343
  * Enhancement: Add Google Maps shortcode.
1
  == Changelog ==
2
+ = 3.9.4 =
3
+ Release date: March 10th, 2016
4
+
5
+ Bug fix: Shortcodes: Addresses an issue with embedded Vimeo content
6
+
7
+ = 3.9.3 =
8
+ Release date: March 9th, 2016
9
+ Release post: http://wp.me/p1moTy-396
10
+
11
+ Featured:
12
+
13
+ * Site Logo now supports Custom Logo - a theme tool to be introduced in WordPress 4.5.
14
+
15
+ Enhancements:
16
+
17
+ * Carousel: Made the full size image URL use a Photon URL if enabled.
18
+ * Comments: Removed an unnecessary redirect by always connecting via HTTPS.
19
+ * General: Added new actions that fire before automatic updates.
20
+ * Infinite Scroll: Introduced a later filter for settings.
21
+ * Infinite Scroll: Removed code that is now redundant due to WordPress Core.
22
+ * Markdown: Removed deprecated markup from the output.
23
+ * Publicize: Improved handling of featured images in posts.
24
+ * Shortcodes: Added houzz.com support.
25
+ * Sitemaps: Added a language attribute to the news sitemap.
26
+ * Sitemaps: Improved the image retrieval mechanism for posts.
27
+ * Widgets: Added new filters in the Top Posts Widget code.
28
+ * Widgets: Cleaned up the CSS for the Subscription widget.
29
+
30
+ Bug Fixes:
31
+
32
+ * Comments: No longer reloading the page on clicking the reply button.
33
+ * Contact Forms: Fixed a fatal error on missing metadata.
34
+ * Contact Forms: Fixed message formatting for plaintext email clients.
35
+ * Shortcodes: Fixed dimensions of Vimeo embeds in certain cases.
36
+ * Shortcodes: Fixed warnings and allowed shorter style Vimeo embeds.
37
+ * Shortcodes: Removed alignment markup from feeds for YouTube embeds.
38
+ * Sitemaps: Made URLs display properly according to the permalink structure.
39
+ * Stats: Fixed non-XHTML-valid markup.
40
+ * Widgets: No longer showing errors when adding new instances of the Display Post Widget.
41
+
42
+ = 3.9.2 =
43
+ Release date: February 25th, 2016
44
+ Release post: http://wp.me/p1moTy-2Ei
45
+
46
+ Maintenance and Security Release
47
+
48
+ Featured:
49
+
50
+ * Beautiful Math: fix XSS vulnerability when parsing LaTeX markup within HTML elements.
51
+ * Contact Form: do not save private site credentials in post meta. Thanks to @visualdatasolutions.
52
+
53
+ Enhancements:
54
+
55
+ * Contact Info: Added two hooks for adding arbitrary information to the widget.
56
+ * Development: Added new possibilities for REST API debugging.
57
+ * Embeds: Added Codepen embeds support.
58
+ * Embeds: Added Sketchfab embeds support.
59
+ * I18n: Added support for translation packages for the Finnish language.
60
+ * Markdown: Added a filter to enable skipping processing of developer supplied patterns.
61
+ * Related Posts: Added a filter to change heading markup.
62
+ * Staging: Added a constant to force staging mode.
63
+ * Staging: Added a notice to make staging mode more obvious.
64
+ * Top Posts Widget: Added a new `[jetpack_top_posts_widget]` shortcode.
65
+
66
+ Bug Fixes:
67
+
68
+ * Custom Post Types: Nova: Fixed a JavaScript bug on adding multiple items.
69
+ * Embeds: Allowing embeds from Instagram with a www in an URL.
70
+ * General: Fixed untranslated module names on the Settings screen.
71
+ * General: Improved module descriptions and fixed misleading or broken links in descriptions.
72
+ * General: No more notices on module deprecation on older installations.
73
+ * General: Only showing one prompt to enable Photon when uploading several new images.
74
+ * Multisite: Fixed a problem with site lists for older WordPress installations.
75
+ * OpenGraph: Fixed a bug to properly fallback to a WordPress Site Icon image.
76
+ * Photon: Improve performance for images over a secure connection.
77
+ * Photon: No longer including links from data attributes.
78
+ * Publicize: Fixed problems for en_AU and en_CA locales with Facebook.
79
+ * Related Posts: Fixed a notice on certain requests.
80
+ * Site Logo: It's no longer possible to choose a non-image.
81
+ * Widget Visibility: No longer confusing page IDs and titles in certain cases.
82
+
83
+ = 3.9.1 =
84
+ Release date: January 21st, 2016
85
+
86
+ Bug Fixes:
87
+
88
+ * General: Addresses a namespacing issue which was causing conflicts on some hosting providers.
89
+ * Sitemaps: Added MSM-Sitemap to the list of plugins which, if installed, will prevent Jetpack Sitemaps from being used
90
+
91
+ = 3.9 =
92
+ Release date: January 20th, 2016
93
+
94
+ Featured:
95
+
96
+ * New sharing button: let users share your content using Skype.
97
+ * New "Social Menu" theme tool that uses Genericons to display Social Links.
98
+ * Sitemap support for better search engine indexing.
99
+
100
+ Enhancements:
101
+
102
+ * Contact Form: Added a new filter that allows you to change the "Required" text.
103
+ * General: Hidden archived sites in multisite site list.
104
+ * General: Removed several function calls that would be deprecated in WordPress 4.5.
105
+ * Infinite Scroll: Added a new filter to check if Infinite Scroll has been triggered.
106
+ * Likes: Added a conditional to ensure WordPress 4.5 compatibility.
107
+ * Photon: Improved compatibility with responsive images feature added in WordPress 4.4.
108
+ * Photon: Now enabled by default on sites using HTTPS.
109
+ * REST API: Extended the ability to manage users from WordPress.com.
110
+ * REST API: Increased the performance of the plugin update endpoint.
111
+ * Responsive Videos: Centering videos when they are wrapped in a centered paragraph.
112
+ * Sharing: Added a new filter to customize the default OpenGraph description.
113
+ * Shortcodes: Added Wistia oEmbed support.
114
+ * Shortcodes: Bandcamp: Added support for new attributes for tracks approved by artists.
115
+ * Shortcodes: Improved Medium path format recognition.
116
+ * Slideshow: Improved compatibility with older IE versions.
117
+ * Staging: Improved staging environment detection.
118
+ * Widgets: Added "width" option to the Facebook Page widget.
119
+ * Widgets: Added size parameters to tags in Top Posts to avoid warnings.
120
+ * Widgets: Introduced major performance and stability improvements to the Display Posts Widget.
121
+ * Widgets: Refactored to remove deprecated code patterns.
122
+
123
+ Bug Fixes:
124
+
125
+ * AtD: Fixed replacing emojis with images in the text editor in Chrome.
126
+ * AtD: Made pre tags be excluded from spell-checking.
127
+ * CPT: Not registering Nova if it is already registered.
128
+ * Carousel: Fixed a bug where full size images were not always served by Photon.
129
+ * Carousel: Reverted a change that broke direct link to carousel image.
130
+ * Contact Form: Fixed a CSV export bug with multiple choice questions.
131
+ * Contact Form: Fixed notices when creating feedback entries without a contact form.
132
+ * General: Fixed a scrolling bug on modal window closing.
133
+ * Infinite Scroll: Disabled in the Customizer when previewing a non-active theme.
134
+ * Publicize: Fixed notices appearing with bbPress or BuddyPress installed.
135
+ * Publicize: Showing options only to users that can change them.
136
+ * Related Posts: Fixed incorrect URLs generated for posts.
137
+ * Responsive Videos: Fixed warnings in debug mode.
138
+ * Shortcodes: Bandcamp: Fixed a problem with large track IDs.
139
+ * Shortcodes: Fixed a problem with dynamic Gist embeds.
140
+ * Stats: Fixed dashboard widget resize problem.
141
+ * Widgets: Added a fallback to English US when a locale isn't supported by Facebook.
142
+ * Widgets: Fixed layout for Twenty Sixteen.
143
+
144
+ = 3.8.2 =
145
+ Release date: December 17th, 2015
146
+ Release post: http://wp.me/p1moTy-26v
147
+
148
+ Jetpack 3.8.2 is here to squash a few annoying bugs.
149
+
150
+ Bug Fixes:
151
+
152
+ * Photon: Fixed a bug where some custom thumbnail image sizes weren't being sized properly.
153
+ * Shortcodes: Fixed an incompatibility with how WordPress renders the YouTube shortcode.
154
+ * Shortcodes: Tightened up security in the Wufoo shortcode.
155
+ * Image Widget: Now shows the caption.
156
+ * Fixed typos in inline docs.
157
+ * Very minor fixes to: Carousel, Publicize, Google+, and Infinite Scroll.
158
+
159
+ = 3.8.1 =
160
+ Release date: December 1st, 2015
161
+ Release post: http://wp.me/p1moTy-23V
162
+
163
+ Jetpack 3.8.1 is here and is fully compatible with WordPress 4.4.
164
+
165
+ Featured:
166
+
167
+ * Photon + Responsive Images FTW.
168
+ * Fully compatible with Twenty Sixteen.
169
+ * More accessibility enhancements.
170
+ * Dropped some weight by optimizing Jetpack's plugin images.
171
+
172
+ Enhancements:
173
+
174
+ * Comments: filter to allow disabling comments per post type.
175
+
176
+ Bug Fixes:
177
+
178
+ * Carousel: Stop page from scrolling to top when Carousel is closed.
179
+ * Carousel: Browser compatibility fixes with older version of IE.
180
+ * Markdown: Fixed a bug that would strip markdown when saving in "Quick Edit" mode.
181
+ * Single Sign On: Fixed login always redirecting to the admin dashboard.
182
+ * Subscriptions: Filter to allow per-post emails fixed for use in themes.
183
+
184
+ = 3.8.0 =
185
+ Release date: November 4th, 2015
186
+ Release post: http://wp.me/p1moTy-1VN
187
+
188
+ We're happy to introduce Jetpack 3.8, which has significant contributions from the Jetpack community. Read more about it here: http://wp.me/p1moTy-1VN
189
+
190
+ Feature enhancements:
191
+
192
+ * New Google+ Badge Widget. Display your profile, page, or community Google+ badge.
193
+ * New twitch.tv shortcode embeds. Display a Twitch.tv stream in your posts.
194
+ * Accessibility enhancements.
195
+ * A handful of new filters to allow further customization of Jetpack.
196
+
197
+ Other enhancements:
198
+
199
+ * Carousel: Added support to retrieve image dimensions from an image url.
200
+ * Carousel: Simpler algorithm to detect shutter speeds.
201
+ * Contact Form: New "Checkbox with Multiple Items" field available in the Contact Form.
202
+ * Contact Form: Allow pre-filling form fields with URL parameters.
203
+ * Contact Form: Better styling of the emailed form responses.
204
+ * Performance: Replaced some custom-built functions with core's native functions.
205
+ * Related Posts: New filter to add post classes to post's container class.
206
+ * Sharing: New filter to choose if sharing meta box should be shown.
207
+ * Sharing: New filter to allow sharing button markup to be editable.
208
+ * Sharing: New filter to allow you to specify a custom Facebook app ID.
209
+ * Social Media Icons Widget: Added option for YouTube username as well as Channel ID.
210
+ * Social Media Icons Widget: Added Google+ icon.
211
+ * Social Media Icons Widget: New filter to allow you to add your own social media icons and links.
212
+ * Subscriptions: Better errors to your visitors if their subscription sign-up fails.
213
+ * Subscriptions: Removed "widget" class from Subs shortcode form.
214
+
215
+
216
+ Bug fixes:
217
+
218
+ * Carousel: Fixed browser back/forward button behavior.
219
+ * Contact Form: Allow the email field to be set to empty when building form in post editor.
220
+ * Facebook Likebox Widget: Fixed an issue where some languages were not translating.
221
+ * Facebook Likebox Widget: Return a language when none found.
222
+ * General: Fixed some minor styling issues in the Jetpack admin areas.
223
+ * General: Add missing parameter to the_title filter call.
224
+ * General: Prevent scrolling of body when the Jetpack admin modals are opened.
225
+ * General: Update doc to reflect that Open Graph filter jetpack_enable_opengraph has been deprecated in favor of jetpack_enable_open_graph.
226
+ * Infinite Scroll: Fixed an error that sometimes occurred that would stop posts from loading.
227
+ * JSON API: Fixed some undefined notices when publishing a post with the API.
228
+ * Open Graph: Fixed bug where facebook description content was sometimes being polluted by a filter.
229
+ * Sharing: Use full SSL Pinterest url instead of protocol relative.
230
+ * Sharing: Fixed plus signs appearing in tweets shared from iOS.
231
+ * Shortcodes: Prefer HTTPS for video embeds to avoid mixed content warnings.
232
+ * Subscriptions Widget: Fix HTML Validation error.
233
+ * Theme Tools: Check oEmbeds for the presence of a video before adding the responsive videos filter.
234
+ * Tiled Galleries: Add image alt attribute if there is a title set. This was breaking some screen reader functionality.
235
+
236
  = 3.7.2 =
237
  Release date: September 29th, 2015
238
 
333
 
334
  = 3.6 =
335
  Release Date: July 6th, 2015
336
+ Release Post: http://jetpack.com/2015/07/06/jetpack-3-6-updated-social-widgets-jetpack-cli-and-more/
337
 
338
  Feature Enhancements:
339
 
340
+ * CLI: Add a number of Jetpack CLI improvements: see http://jetpack.com/support/jetpack-cli
341
  * New Jetpack admin page for connection management
342
  * New Social Media Icons widget
343
  * FB Like Box: A visual refresh of the Facebook likebox widget
401
 
402
  = 3.5 =
403
  Release Date: April 23rd, 2015
404
+ Release Post: http://jetpack.com/2016/04/23/jetpack-3-5-menu-management/
405
 
406
  Jetpack 3.5 introduces the ability to manage your site's menus directly from WordPress.com and several bug fixes and enhancements. This upgrade is recommended for all users.
407
 
449
  = 3.4 =
450
  Release Date: March 18th, 2015
451
 
452
+ Release Post: http://jetpack.com/2015/03/17/jetpack-3-4-protect-secure-and-simplify/
453
 
454
  * Enhancement : Config Settings: provide a notification for users that update features settings
455
  * Enhancement : Config Settings: provide a notification for users that update features settings
533
 
534
  = 3.3 =
535
  Release Date: December 15th, 2014
536
+ Release Post: http://jetpack.com/2014/12/16/jetpack-3-3-a-single-home-for-all-your-wordpress-sites/
537
 
538
  * Enhancement: Adds responsive video support to BuddyPress.
539
  * Enhancement: Custom Content Types: Added 'order' and 'orderby' options to portfolio shortcode.
582
 
583
  = 3.2 =
584
  Release Date: October 29, 2014
585
+ Release Post: http://jetpack.com/2014/11/03/jetpack-3-2/
586
 
587
  * Enhancement: Speed Improvements (woohoo!).
588
  * Enhancement: Add site icons: an avatar for your blog.
620
 
621
  = 3.1 =
622
  Release Date: July 31, 2014
623
+ Release Post: http://jetpack.com/2014/07/31/jetpack-3-1-portfolio-custom-post-types-a-new-logo-and-much-more/
624
 
625
  * Enhancement: New Custom Content Types module.
626
  * Enhancement: New Jetpack Logo.
692
 
693
  = 3.0 =
694
  Release Date: May 20, 2014
695
+ Release Post: http://jetpack.com/2014/05/20/jetpack-3-0/
696
 
697
  * New User Interface for managing modules and settings
698
  * New Module: Verfication Tools
736
 
737
  = 2.9 =
738
  Release Date: February 26, 2014
739
+ Release Post: http://jetpack.com/2014/02/26/jetpack-2-9/
740
 
741
  * Added Multisite network functionality
742
  * New Module: Related Posts
760
 
761
  = 2.8 =
762
  Release Date: January 31, 2014
763
+ Release Post: http://jetpack.com/2014/01/31/jetpack-2-8-introducing-markdown-and-improving-monitor/
764
 
765
  * New Module: Markdown
766
  * Module Update: Jetpack Monitor
801
 
802
  = 2.7 =
803
  Release Date: December 11, 2013
804
+ Release Post: http://jetpack.com/2013/12/11/jetpack-2-7-publicize/
805
 
806
  * Enhancement: Google+ Publicize
807
  * Enhancement: Add Cloudup as an oEmbed provider
838
 
839
  = 2.6 =
840
  Release Date: November 28, 2013
841
+ Release Post: http://jetpack.com/2013/11/26/new-release-jetpack-2-6/
842
 
843
+ * Enhancement: WPCC / now called [SSO](http://jetpack.com/support/sso/): refactored.
844
+ * Enhancement: Monitor: new module which will notify you if your site goes down(http://jetpack.com/support/monitor/).
845
  * Enhancement: Custom CSS: replace Ace editor with Codemirror.
846
  * Enhancement: Widgets: new “Display Posts” widget.
847
  * Enhancement: WP-CLI: add commands to disconnect a site and manage modules.
876
 
877
  = 2.5 =
878
  Release Date: September 19, 2013
879
+ Release Post: http://jetpack.com/2013/09/19/jetpack-2-5/
880
 
881
  * Enhancement: Connect your Google+ profile and WordPress site to prove authorship of posts.
882
  * Enhancement: Improved sharing buttons display.
926
 
927
  = 2.4 =
928
  Release Date: August 30, 2013
929
+ Release Post: http://jetpack.com/2013/09/04/jetpack-2-4-widget-visibility-and-wpcc-and-more/
930
 
931
  * Enhancement: WordPress.com Connect (WPCC): New Module.
932
  * Enhancement: Widget Visibility: New Module.
1005
 
1006
  = 2.3 =
1007
  Release Date: June 19, 2013
1008
+ Release Post: http://jetpack.com/2013/06/19/jetpack-2-3/
1009
 
1010
  * Enhancement: Omnisearch: Search once, get results from everything! Omnisearch is a single search box that lets you search many different things
1011
  * Enhancement: Debugger: this module helps you debug connection issues right from your dashboard, and contact the Jetpack support team if needed
1168
 
1169
  = 2.2 =
1170
  Release Date: February 26, 2013
1171
+ Release Post: http://jetpack.com/2013/02/26/jetpack-2-2-likes/
1172
 
1173
  * Enhancement: Likes: Allow your readers to show their appreciation of your posts.
1174
  * Enhancement: Shortcodes: SoundCloud: Update to version 2.3 of the SoundCloud plugin (HTML5 default player, various fixes).
1249
 
1250
  = 2.1 =
1251
  Release Date: January 4, 2013
1252