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 (212) 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 +339 -403
  126. modules/monitor.php +20 -0
  127. modules/omnisearch/omnisearch-core.php +8 -1
  128. modules/post-by-email.php +1 -1
  129. modules/protect.php +2 -2
  130. modules/publicize/ui.php +11 -2
  131. modules/related-posts/jetpack-related-posts.php +15 -3
  132. modules/related-posts/related-posts.js +3 -2
  133. modules/sharedaddy/admin-sharing-rtl.css +10 -0
  134. modules/sharedaddy/admin-sharing-rtl.min.css +1 -1
  135. modules/sharedaddy/admin-sharing.css +10 -0
  136. modules/sharedaddy/admin-sharing.min.css +1 -1
  137. modules/sharedaddy/images/smart-skype.png +0 -0
  138. modules/sharedaddy/images/smart-skype@2x.png +0 -0
  139. modules/sharedaddy/images/smart-twitter.png +0 -0
  140. modules/sharedaddy/images/smart-twitter@2x.png +0 -0
  141. modules/sharedaddy/sharing-service.php +3 -2
  142. modules/sharedaddy/sharing-sources.php +85 -1
  143. modules/sharedaddy/sharing.css +15 -0
  144. modules/shortcodes/archives.php +28 -26
  145. modules/shortcodes/bandcamp.php +55 -45
  146. modules/shortcodes/codepen.php +10 -0
  147. modules/shortcodes/dailymotion.php +1 -1
  148. modules/shortcodes/facebook.php +2 -14
  149. modules/shortcodes/flickr.php +44 -29
  150. modules/shortcodes/gist.php +66 -11
  151. modules/shortcodes/houzz.php +29 -0
  152. modules/shortcodes/instagram.php +27 -24
  153. modules/shortcodes/js/facebook.js +0 -29
  154. modules/shortcodes/js/gist.js +28 -0
  155. modules/shortcodes/js/slideshow-shortcode.js +6 -1
  156. modules/shortcodes/medium.php +5 -4
  157. modules/shortcodes/presentations.php +130 -107
  158. modules/shortcodes/scribd.php +6 -2
  159. modules/shortcodes/slideshare.php +57 -30
  160. modules/shortcodes/slideshow.php +72 -48
  161. modules/shortcodes/soundcloud.php +84 -56
  162. modules/shortcodes/ted.php +23 -17
  163. modules/shortcodes/twitter-timeline.php +19 -12
  164. modules/shortcodes/vimeo.php +135 -45
  165. modules/shortcodes/wufoo.php +46 -45
  166. modules/shortcodes/youtube.php +25 -15
  167. modules/site-icon/jetpack-site-icon.php +1 -1
  168. modules/sitemaps.php +26 -0
  169. modules/sitemaps/sitemap-xsl.php +144 -0
  170. modules/sitemaps/sitemaps.php +761 -0
  171. modules/sso.php +7 -2
  172. modules/stats.php +48 -42
  173. modules/subscriptions.php +2 -2
  174. modules/subscriptions/subscriptions.css +0 -1
  175. modules/theme-tools/compat/twentyfifteen.php +1 -1
  176. modules/theme-tools/compat/twentysixteen-rtl.css +9 -16
  177. modules/theme-tools/compat/twentysixteen.css +9 -16
  178. modules/theme-tools/compat/twentysixteen.php +1 -1
  179. modules/theme-tools/random-redirect.php +15 -10
  180. modules/theme-tools/responsive-videos.php +6 -6
  181. modules/theme-tools/responsive-videos/responsive-videos.js +9 -4
  182. modules/theme-tools/responsive-videos/responsive-videos.min.js +1 -1
  183. modules/theme-tools/site-logo.php +7 -1
  184. modules/theme-tools/site-logo/inc/class-site-logo.php +5 -0
  185. modules/theme-tools/site-logo/inc/functions.php +3 -1
  186. modules/theme-tools/site-logo/js/site-logo-control.js +5 -4
  187. modules/theme-tools/social-menu.php +67 -0
  188. modules/theme-tools/social-menu/social-menu.css +180 -0
  189. modules/tiled-gallery/tiled-gallery/rtl/tiled-gallery-rtl.css +2 -2
  190. modules/tiled-gallery/tiled-gallery/templates/carousel-container.php +1 -0
  191. modules/tiled-gallery/tiled-gallery/templates/partials/item.php +10 -5
  192. modules/vaultpress.php +2 -2
  193. modules/videopress/videopress.php +3 -3
  194. modules/widget-visibility/widget-conditions.php +12 -4
  195. modules/widget-visibility/widget-conditions/widget-conditions.js +11 -3
  196. modules/widgets/contact-info.php +34 -6
  197. modules/widgets/contact-info/contact-info-map.js +32 -6
  198. modules/widgets/facebook-likebox.php +42 -44
  199. modules/widgets/gravatar-profile.php +5 -4
  200. modules/widgets/image-widget.php +20 -12
  201. modules/widgets/social-media-icons.php +5 -2
  202. modules/widgets/top-posts.php +149 -13
  203. modules/widgets/twitter-timeline.php +17 -17
  204. modules/widgets/wordpress-post-widget.php +978 -116
  205. readme.txt +420 -260
  206. scss/jetpack-admin-jitm.scss +58 -0
  207. scss/templates/_main.scss +4 -0
  208. scss/templates/_nux-landing-2015.scss +13 -7
  209. views/admin/admin-page.php +33 -50
  210. views/admin/landing-page-templates.php +3 -3
  211. views/admin/my-jetpack-page.php +13 -6
  212. views/admin/network-admin-footer.php +3 -3
_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_]+)#x2F;';
43
+ const PROP_NAME_REGEX = '/^[a-z_][a-z0-9_]*#x2F;';
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
+ Release Post: http://jetpack.com/2013/01/04/galleries/
1253
1254
* Enhancement: Tiled Galleries: Show off your photos with cool mosaic galleries.
1255
* Enhancement: Slideshow gallery type: Display any gallery as a slideshow.
1308
1309
= 2.0 =
1310
Release Date: November 8, 2012
1311
+ Release Post: http://jetpack.com/2012/11/08/jetpack-2-0-publicize-to-facebook-twitter-linkedin-tumblr-post-by-email-photon-infinite-scroll/
1312
1313
* Enhancement: Publicize: Connect your site to popular social networks and automatically share new posts with your friends.
1314
* Enhancement: Post By Email: Publish posts to your blog directly from your personal email account.
1335
1336
= 1.9 =
1337
Release Date: October 26, 2012
1338
+ Release Post: http://jetpack.com/2012/10/26/jetpack-1-9-toolbar-notifications/
1339
1340
* Enhancement: Notifications: Display Notifications in the toolbar and support reply/moderation of comment notifications.
1341
* Enhancement: Mobile Push Notifications: Added support for mobile push notifications of new comments for users that linked their accounts to WordPress.com accounts.
1387
1388
= 1.8 =
1389
Release Date: September 27, 2012
1390
+ Release Post: http://jetpack.com/2012/09/27/jetpack-1-8-mobile-theme/
1391
1392
* Enhancement: Mobile Theme: Automatically serve a slimmed down version of your site to users on mobile devices.
1393
* Enhancement: Multiuser: Allow multiple users to link their accounts to WordPress.com accounts.
1405
1406
= 1.7 =
1407
Release Date: August 23, 2012
1408
+ Release Post: http://jetpack.com/2012/08/23/jetpack-1-7-custom-css/
1409
1410
* Enhancement: CSS Editor: Customize your site's design without modifying your theme.
1411
* Enhancement: Comments: Submit the comment within the iframe. No more full page load to jetpack.wordpress.com.
1438
1439
= 1.6 =
1440
Release Date: August 2, 2012
1441
+ Release Post: http://jetpack.com/2012/08/02/jetpack-1-6-retina-and-pinterest/
1442
1443
* Enhancement: Carousel: Better image resolution selection based on available width/height.
1444
* Enhancement: Carousel: Load image caption, metadata, comments, et alii when a slide is clicked to switch to instead of waiting.
1517
1518
= 1.3 =
1519
Release Date: April 25, 2012
1520
+ Release Post: http://jetpack.com/2012/04/24/jetpack-1-3-released-contact-forms/
1521
1522
* Enhancement: Add Contact Forms feature. Formerly Grunion Contact Forms.
1523
* Bug Fix: Tweak YouTube autoembedder to catch more YouTube URLs.
1567
* Bug Fix: Fixed errors displayed during some upgrades.
1568
* Bug Fix: Fix inaccurate new modules "bubble" in menu for some upgrades.
1569
* Bug Fix: Fix VaultPress detection.
1570
+ * Bug Fix: Fix link to http://jetpack.com/faq/
1571
1572
= 1.2 =
1573
Release Date: November 17, 2011
1574
+ Release Post: http://jetpack.com/2011/11/17/announcing-jetpack-1-2/
1575
1576
* Enhancement: Add Subscriptions: Subscribe to site's posts and posts' comments.
1577
* Enhancement: Add Google Maps shortcode.
class.jetpack-admin.php CHANGED
@@ -111,23 +111,13 @@ class Jetpack_Admin {
111
$module_array['learn_more_button'] = ob_get_clean();
112
113
ob_start();
114
- if ( Jetpack::is_active() && has_action( 'jetpack_module_more_info_connected_' . $module ) ) {
115
- /**
116
- * Allow the display of information text when Jetpack is connected to WordPress.com.
117
- * The dynamic part of the action, $module, is the module slug.
118
- *
119
- * @since 3.0.0
120
- */
121
- do_action( 'jetpack_module_more_info_connected_' . $module );
122
- } else {
123
- /**
124
- * Allow the display of information text when Jetpack is connected to WordPress.com.
125
- * The dynamic part of the action, $module, is the module slug.
126
- *
127
- * @since 3.0.0
128
- */
129
- do_action( 'jetpack_module_more_info_' . $module );
130
- }
131
132
/**
133
* Filter the long description of a module.
111
$module_array['learn_more_button'] = ob_get_clean();
112
113
ob_start();
114
+ /**
115
+ * Allow the display of information text when Jetpack is connected to WordPress.com.
116
+ * The dynamic part of the action, $module, is the module slug.
117
+ *
118
+ * @since 3.0.0
119
+ */
120
+ do_action( 'jetpack_module_more_info_' . $module );
121
122
/**
123
* Filter the long description of a module.
class.jetpack-cli.php CHANGED
@@ -579,7 +579,7 @@ function jetpack_cli_are_you_sure( $flagged = false, $error_msg = false ) {
579
__( 'Action cancelled. Have a question?', 'jetpack' )
580
. ' '
581
. $cli->green_open
582
- . 'jetpack.me/support'
583
. $cli->color_close;
584
}
585
579
__( 'Action cancelled. Have a question?', 'jetpack' )
580
. ' '
581
. $cli->green_open
582
+ . 'jetpack.com/support'
583
. $cli->color_close;
584
}
585
class.jetpack-client-server.php CHANGED
@@ -234,9 +234,16 @@ class Jetpack_Client_Server {
234
235
if ( !$cap = $jetpack->translate_role_to_cap( $role ) )
236
return new Jetpack_Error( 'scope', 'No Cap', $code );
237
- if ( !current_user_can( $cap ) )
238
return new Jetpack_Error( 'scope', 'current_user_cannot', $code );
239
240
return (string) $json->access_token;
241
}
242
234
235
if ( !$cap = $jetpack->translate_role_to_cap( $role ) )
236
return new Jetpack_Error( 'scope', 'No Cap', $code );
237
+ if ( ! current_user_can( $cap ) )
238
return new Jetpack_Error( 'scope', 'current_user_cannot', $code );
239
240
+ /**
241
+ * Fires after user has successfully received an auth token.
242
+ *
243
+ * @since 3.9.0
244
+ */
245
+ do_action( 'jetpack_user_authorized' );
246
+
247
return (string) $json->access_token;
248
}
249
class.jetpack-client.php CHANGED
@@ -1,7 +1,6 @@
1
<?php
2
3
class Jetpack_Client {
4
- const WPCOM_JSON_API_HOST = 'public-api.wordpress.com';
5
const WPCOM_JSON_API_VERSION = '1.1';
6
7
/**
@@ -111,6 +110,12 @@ class Jetpack_Client {
111
'Authorization' => "X_JETPACK " . join( ' ', $header_pieces ),
112
);
113
114
if ( 'header' != $args['auth_location'] ) {
115
$url = add_query_arg( 'signature', urlencode( $signature ), $url );
116
}
@@ -271,7 +276,7 @@ class Jetpack_Client {
271
}
272
273
$validated_args = array_merge( $filtered_args, array(
274
- 'url' => sprintf( '%s://%s/rest/v%s/%s', $proto, self::WPCOM_JSON_API_HOST, $version, $_path ),
275
'blog_id' => (int) Jetpack_Options::get_option( 'id' ),
276
'method' => $request_method,
277
) );
1
<?php
2
3
class Jetpack_Client {
4
const WPCOM_JSON_API_VERSION = '1.1';
5
6
/**
110
'Authorization' => "X_JETPACK " . join( ' ', $header_pieces ),
111
);
112
113
+ // Make sure we keep the host when we do JETPACK__WPCOM_JSON_API_HOST requests.
114
+ $host = parse_url( $url, PHP_URL_HOST );
115
+ if ( $host === JETPACK__WPCOM_JSON_API_HOST ) {
116
+ $request['headers']['Host'] = 'public-api.wordpress.com';
117
+ }
118
+
119
if ( 'header' != $args['auth_location'] ) {
120
$url = add_query_arg( 'signature', urlencode( $signature ), $url );
121
}
276
}
277
278
$validated_args = array_merge( $filtered_args, array(
279
+ 'url' => sprintf( '%s://%s/rest/v%s/%s', $proto, JETPACK__WPCOM_JSON_API_HOST, $version, $_path ),
280
'blog_id' => (int) Jetpack_Options::get_option( 'id' ),
281
'method' => $request_method,
282
) );
class.jetpack-debugger.php CHANGED
@@ -4,7 +4,7 @@ class Jetpack_Debugger {
4
5
private static function is_jetpack_support_open() {
6
try {
7
- $response = wp_remote_request( "http://jetpack.me/is-support-open" );
8
$body = wp_remote_retrieve_body( $response );
9
$json = json_decode( $body );
10
return ( ( bool ) $json->is_support_open );
@@ -22,8 +22,7 @@ class Jetpack_Debugger {
22
if ( ! current_user_can( 'manage_options' ) )
23
wp_die( esc_html__('You do not have sufficient permissions to access this page.', 'jetpack' ) );
24
25
- global $current_user;
26
- get_currentuserinfo();
27
28
$user_id = get_current_user_id();
29
$user_tokens = Jetpack_Options::get_option( 'user_tokens' );
@@ -167,9 +166,21 @@ class Jetpack_Debugger {
167
<h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3>
168
<h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4>
169
<ol>
170
- <li><b><em><?php esc_html_e( 'A known issue.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Some themes and plugins have <a href="%1$s">known conflicts</a> with Jetpack – check the <a href="%2$s">list</a>. (You can also browse the <a href="%3$s">Jetpack support pages</a> or <a href="%4$s">Jetpack support forum</a> to see if others have experienced and solved the problem.)', 'jetpack' ), 'http://jetpack.me/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.me/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.me/support/', 'http://wordpress.org/support/plugin/jetpack' ); ?></li>
171
<li><b><em><?php esc_html_e( 'An incompatible plugin.', 'jetpack' ); ?></em></b> <?php esc_html_e( "Find out by disabling all plugins except Jetpack. If the problem persists, it's not a plugin issue. If the problem is solved, turn your plugins on one by one until the problem pops up again – there's the culprit! Let us know, and we'll try to help.", 'jetpack' ); ?></li>
172
- <li><b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b> <?php esc_html_e( "If your problem isn't known or caused by a plugin, try activating Twenty Fifteen (the default WordPress theme). If this solves the problem, something in your theme is probably broken – let the theme's author know.", 'jetpack' ); ?></li>
173
<li><b><em><?php esc_html_e( 'A problem with your XMLRPC file.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Load your <a href="%s">XMLRPC file</a>. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ), site_url( 'xmlrpc.php' ) ); ?>
174
<ul>
175
<li>- <?php esc_html_e( "If it's not by itself, a theme or plugin is displaying extra characters. Try steps 2 and 3.", 'jetpack' ); ?></li>
@@ -188,20 +199,35 @@ class Jetpack_Debugger {
188
</div>
189
<hr />
190
<div id="sync-related-posts">
191
- <p><?php echo esc_html__( 'Some features of Jetpack uses the WordPress.com infrastructure and requires that your public content be mirrored there. If you see intermittent issues only affecting certain posts, please try requesting a reindex of your posts.', 'jetpack' ); ?></p>
192
<?php echo Jetpack::init()->sync->reindex_ui() ?>
193
</div>
194
<?php endif; ?>
195
</div>
196
<div id="contact-message" <?php if( ! isset( $_GET['contact'] ) ) {?> style="display:none" <?php } ?>>
197
<?php if ( self::is_jetpack_support_open() ): ?>
198
- <form id="contactme" method="post" action="http://jetpack.me/contact-support/">
199
<input type="hidden" name="action" value="submit">
200
<input type="hidden" name="jetpack" value="needs-service">
201
202
<input type="hidden" name="contact_form" id="contact_form" value="1">
203
<input type="hidden" name="blog_url" id="blog_url" value="<?php echo esc_attr( site_url() ); ?>">
204
- <input type="hidden" name="subject" id="subject" value="from: <?php echo esc_attr( site_url() ); ?> Jetpack contact form">
205
<div class="formbox">
206
<label for="message" class="h"><?php esc_html_e( 'Please describe the problem you are having.', 'jetpack' ); ?></label>
207
<textarea name="message" cols="40" rows="7" id="did"></textarea>
4
5
private static function is_jetpack_support_open() {
6
try {
7
+ $response = wp_remote_request( "http://jetpack.com/is-support-open" );
8
$body = wp_remote_retrieve_body( $response );
9
$json = json_decode( $body );
10
return ( ( bool ) $json->is_support_open );
22
if ( ! current_user_can( 'manage_options' ) )
23
wp_die( esc_html__('You do not have sufficient permissions to access this page.', 'jetpack' ) );
24
25
+ $current_user = wp_get_current_user();
26
27
$user_id = get_current_user_id();
28
$user_tokens = Jetpack_Options::get_option( 'user_tokens' );
166
<h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3>
167
<h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4>
168
<ol>
169
+ <li><b><em><?php esc_html_e( 'A known issue.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Some themes and plugins have <a href="%1$s">known conflicts</a> with Jetpack – check the <a href="%2$s">list</a>. (You can also browse the <a href="%3$s">Jetpack support pages</a> or <a href="%4$s">Jetpack support forum</a> to see if others have experienced and solved the problem.)', 'jetpack' ), 'http://jetpack.com/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.com/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.com/support/', 'http://wordpress.org/support/plugin/jetpack' ); ?></li>
170
<li><b><em><?php esc_html_e( 'An incompatible plugin.', 'jetpack' ); ?></em></b> <?php esc_html_e( "Find out by disabling all plugins except Jetpack. If the problem persists, it's not a plugin issue. If the problem is solved, turn your plugins on one by one until the problem pops up again – there's the culprit! Let us know, and we'll try to help.", 'jetpack' ); ?></li>
171
+ <li>
172
+ <b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b>
173
+ <?php
174
+ $default_theme = wp_get_theme( WP_DEFAULT_THEME );
175
+
176
+ if ( $default_theme->exists() ) {
177
+ echo esc_html( sprintf( __( "If your problem isn't known or caused by a plugin, try activating %s (the default WordPress theme).", 'jetpack' ), $default_theme->get( 'Name' ) ) );
178
+ } else {
179
+ esc_html_e( "If your problem isn't known or caused by a plugin, try activating the default WordPress theme.", 'jetpack' );
180
+ }
181
+ ?>
182
+ <?php esc_html_e( "If this solves the problem, something in your theme is probably broken – let the theme's author know.", 'jetpack' ); ?>
183
+ </li>
184
<li><b><em><?php esc_html_e( 'A problem with your XMLRPC file.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Load your <a href="%s">XMLRPC file</a>. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ), site_url( 'xmlrpc.php' ) ); ?>
185
<ul>
186
<li>- <?php esc_html_e( "If it's not by itself, a theme or plugin is displaying extra characters. Try steps 2 and 3.", 'jetpack' ); ?></li>
199
</div>
200
<hr />
201
<div id="sync-related-posts">
202
+ <p><?php echo esc_html__( 'Some features of Jetpack use the WordPress.com infrastructure and require that your public content be mirrored there. If you see intermittent issues only affecting certain posts, please try requesting a reindex of your posts.', 'jetpack' ); ?></p>
203
<?php echo Jetpack::init()->sync->reindex_ui() ?>
204
</div>
205
<?php endif; ?>
206
</div>
207
<div id="contact-message" <?php if( ! isset( $_GET['contact'] ) ) {?> style="display:none" <?php } ?>>
208
<?php if ( self::is_jetpack_support_open() ): ?>
209
+ <form id="contactme" method="post" action="http://jetpack.com/contact-support/">
210
<input type="hidden" name="action" value="submit">
211
<input type="hidden" name="jetpack" value="needs-service">
212
213
<input type="hidden" name="contact_form" id="contact_form" value="1">
214
<input type="hidden" name="blog_url" id="blog_url" value="<?php echo esc_attr( site_url() ); ?>">
215
+ <?php
216
+ $subject_line = sprintf(
217
+ /* translators: %s is the URL of the site */
218
+ _x( 'from: %s Jetpack contact form', 'Support request email subject line', 'jetpack' ),
219
+ esc_attr( site_url() )
220
+ );
221
+
222
+ if ( Jetpack::is_development_version() ) {
223
+ $subject_line = 'BETA ' . $subject_line;
224
+ }
225
+
226
+ $subject_line_input = printf(
227
+ '<input type="hidden" name="subject" id="subject" value="%s"">',
228
+ $subject_line
229
+ );
230
+ ?>
231
<div class="formbox">
232
<label for="message" class="h"><?php esc_html_e( 'Please describe the problem you are having.', 'jetpack' ); ?></label>
233
<textarea name="message" cols="40" rows="7" id="did"></textarea>
class.jetpack-jitm.php CHANGED
@@ -17,7 +17,14 @@ class Jetpack_JITM {
17
*
18
* @var array
19
*/
20
- private static $jetpack_hide_jitm = array();
21
22
static function init() {
23
if ( is_null( self::$instance ) ) {
@@ -28,7 +35,7 @@ class Jetpack_JITM {
28
}
29
30
private function __construct() {
31
- if ( ! Jetpack::is_active() ) {
32
return;
33
}
34
add_action( 'current_screen', array( $this, 'prepare_jitms' ) );
@@ -39,31 +46,26 @@ class Jetpack_JITM {
39
*
40
* @since 3.8.2
41
*
42
* @param object $screen
43
*/
44
function prepare_jitms( $screen ) {
45
- global $pagenow;
46
- $post_type = $screen->post_type;
47
- self::$jetpack_hide_jitm = Jetpack_Options::get_option( 'hide_jitm' );
48
- $showphoton = empty( self::$jetpack_hide_jitm['photon'] ) ? 'show' : self::$jetpack_hide_jitm['photon'];
49
- $showmanage = empty( self::$jetpack_hide_jitm['manage'] ) ? 'show' : self::$jetpack_hide_jitm['manage'];
50
- $show_manage_pi = empty( self::$jetpack_hide_jitm['manage-pi'] ) ? 'show' : self::$jetpack_hide_jitm['manage-pi'];
51
- $show_editor = empty( self::$jetpack_hide_jitm['editor'] ) ? 'show' : self::$jetpack_hide_jitm['editor'];
52
- if ( 'media-new.php' == $pagenow && ! Jetpack::is_module_active( 'photon' ) && 'hide' != $showphoton ) {
53
- add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) );
54
- add_action( 'post-plupload-upload-ui', array( $this, 'photon_msg' ) );
55
}
56
- else if ( 'update-core.php' == $pagenow && 'hide' != $showmanage ) {
57
add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) );
58
- add_action( 'admin_notices', array( $this, 'manage_msg' ) );
59
}
60
- elseif ( 'plugins.php' === $pagenow && isset( $_GET['activate'] ) && 'true' === $_GET['activate'] && 'hide' != $show_manage_pi ) {
61
add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) );
62
- add_action( 'pre_current_active_plugins', array( $this, 'manage_pi_msg' ) );
63
}
64
- elseif ( 'post-new.php' === $pagenow && in_array( $post_type, array( 'post', 'page' ) ) && 'hide' != $show_editor ) {
65
add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) );
66
- add_action( 'admin_notices', array( $this, 'editor_msg' ) );
67
}
68
}
69
@@ -72,30 +74,31 @@ class Jetpack_JITM {
72
*
73
*/
74
function manage_msg() {
75
- if ( current_user_can( 'jetpack_manage_modules' ) ) {
76
- $normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
77
- $manage_active = Jetpack::is_module_active( 'manage' );
78
- ?>
79
- <div class="jp-jitm">
80
- <a href="#" data-module="manage" class="dismiss"><span class="genericon genericon-close"></span></a>
81
- <div class="jp-emblem">
82
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0" y="0" viewBox="0 0 172.9 172.9" enable-background="new 0 0 172.9 172.9" xml:space="preserve">
83
- <path d="M86.4 0C38.7 0 0 38.7 0 86.4c0 47.7 38.7 86.4 86.4 86.4s86.4-38.7 86.4-86.4C172.9 38.7 134.2 0 86.4 0zM83.1 106.6l-27.1-6.9C49 98 45.7 90.1 49.3 84l33.8-58.5V106.6zM124.9 88.9l-33.8 58.5V66.3l27.1 6.9C125.1 74.9 128.4 82.8 124.9 88.9z"/>
84
- </svg>
85
- </div>
86
- <p class="msg">
87
- <?php _e( 'Reduce security risks with automated plugin updates.', 'jetpack' ); ?>
88
- </p>
89
- <p>
90
- <img class="j-spinner hide" src="<?php echo esc_url( includes_url( 'images/spinner-2x.gif' ) ); ?>" alt="Loading ..." /><a href="#" data-module="manage" class="activate button <?php if( Jetpack::is_module_active( 'manage' ) ) { echo 'hide'; } ?>"><?php esc_html_e( 'Activate Now', 'jetpack' ); ?></a><a href="<?php echo esc_url( 'https://wordpress.com/plugins/' . $normalized_site_url ); ?>" target="_blank" title="<?php esc_attr_e( 'Go to WordPress.com to try these features', 'jetpack' ); ?>" id="jetpack-wordpressdotcom" class="button button-jetpack <?php if( ! Jetpack::is_module_active( 'manage' ) ) { echo 'hide'; } ?>"><?php esc_html_e( 'Go to WordPress.com', 'jetpack' ); ?></a>
91
- </p>
92
</div>
93
<?php
94
- //jitm is being viewed, track it
95
- $jetpack = Jetpack::init();
96
- $jetpack->stat( 'jitm', 'manage-viewed-' . JETPACK__VERSION );
97
- $jetpack->do_stats( 'server_side' );
98
- }
99
}
100
101
/*
@@ -103,27 +106,52 @@ class Jetpack_JITM {
103
*
104
*/
105
function photon_msg() {
106
- if ( current_user_can( 'jetpack_manage_modules' ) ) { ?>
107
- <div class="jp-jitm">
108
- <a href="#" data-module="photon" class="dismiss"><span class="genericon genericon-close"></span></a>
109
<div class="jp-emblem">
110
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0" y="0" viewBox="0 0 172.9 172.9" enable-background="new 0 0 172.9 172.9" xml:space="preserve">
111
- <path d="M86.4 0C38.7 0 0 38.7 0 86.4c0 47.7 38.7 86.4 86.4 86.4s86.4-38.7 86.4-86.4C172.9 38.7 134.2 0 86.4 0zM83.1 106.6l-27.1-6.9C49 98 45.7 90.1 49.3 84l33.8-58.5V106.6zM124.9 88.9l-33.8 58.5V66.3l27.1 6.9C125.1 74.9 128.4 82.8 124.9 88.9z"/>
112
- </svg>
113
</div>
114
<p class="msg">
115
- <?php _e( 'Speed up your photos and save bandwidth costs by using a free content delivery network.', 'jetpack' ); ?>
116
</p>
117
<p>
118
- <img class="j-spinner hide" style="margin-top: 13px;" width="17" height="17" src="<?php echo esc_url( includes_url( 'images/spinner-2x.gif' ) ); ?>" alt="Loading ..." /><a href="#" data-module="photon" class="activate button button-jetpack"><?php esc_html_e( 'Activate Photon', 'jetpack' ); ?></a>
119